Home | History | Annotate | Download | only in inc
      1 
      2 /*
      3  * Copyright (C) Texas Instruments - http://www.ti.com/
      4  *
      5  * This library is free software; you can redistribute it and/or
      6  * modify it under the terms of the GNU Lesser General Public
      7  * License as published by the Free Software Foundation; either
      8  * version 2.1 of the License, or (at your option) any later version.
      9  *
     10  *
     11  * This library is distributed in the hope that it will be useful,
     12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     14  * Lesser General Public License for more details.
     15  *
     16  *
     17  * You should have received a copy of the GNU Lesser General Public
     18  * License along with this library; if not, write to the Free Software
     19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     20  */
     21 #ifndef __PERF_CONFIG_H__
     22 #define __PERF_CONFIG_H__
     23 
     24 /******************************************************************************
     25     CONFIGURATION
     26 ******************************************************************************/
     27 
     28 #define TRUE (1)
     29 #define FALSE (0)
     30 
     31 #ifdef _WIN32
     32     #define PERF_CONFIG_FILE "C:\\perf.ini"
     33     #define strcasecmp stricmp
     34     #define strncasecmp strnicmp
     35 #else
     36     #define PERF_CONFIG_FILE "./perf.ini"
     37 #endif
     38 
     39 #define PERF_CONFIG_LINELENGTH 1024
     40 
     41 /** in order to prevent writing into the same log files during
     42 *   operations, each component writes its log or debug into the
     43 *   following files:
     44 *
     45 *   base_PID_handle.pref - for binary logs
     46 *   base_PID_handle.log  - for text logs
     47 *  */
     48 
     49 typedef struct PERF_Config
     50 {
     51     /* logging interface */
     52     unsigned long  mask;           /* bitmask for enabled components */
     53     unsigned long  buffer_size;    /* log buffer size */
     54     unsigned long  delayed_open;   /* open trace file only when first block
     55                                       is written */
     56     char          *trace_file;     /* file base to save trace */
     57 
     58     /* debug interface */
     59     unsigned long  csv;            /* comma-separated value output */
     60     unsigned long  debug;          /* debug flag - will print some events,
     61                                       but not all */
     62     unsigned long  detailed_debug; /* debug flag - will print ALL events */
     63 
     64     char          *log_file;       /* file to save all event logs */
     65 
     66     /* replay interface */
     67     char          *replay_file;    /* file to print replayed event logs */
     68 
     69     /* real-time interface */
     70     unsigned long  realtime;       /* real-time enabled flag */
     71     unsigned long  rt_granularity; /* real-time granularity in seconds
     72                                       valid range 1 - 15 */
     73     unsigned long  rt_detailed;    /* real-time detailed flag:
     74                                       0: will only report preferred rates
     75                                       1: will report all rates to/from Hardware,
     76                                          LLMM, HLMM
     77                                       2: will report all rates measured */
     78     unsigned long  rt_debug;       /* print current statistics on every update */
     79     unsigned long  rt_summary;     /* print summary on close */
     80     char          *rt_file;        /* file to save all real-time logs */
     81 } PERF_Config;
     82 
     83 void PERF_Config_Init(PERF_Config *sConfig);
     84 void PERF_Config_Read(PERF_Config *sConfig, char const *tag);
     85 void PERF_Config_Release(PERF_Config *sConfig);
     86 
     87 #endif
     88 
     89