we can do without the odd align.h
[libfirm] / ir / stat / statev.c
index b628ad1..e999bcf 100644 (file)
@@ -24,9 +24,7 @@
  * @date        17.06.2007
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <assert.h>
 #include <string.h>
@@ -39,9 +37,9 @@
 #include "irprintf.h"
 #include "statev.h"
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+
+#if defined(FIRM_STATISTICS) && !defined(DISABLE_STATEV)
 
 #ifdef HAVE_REGEX_H
 #define FIRM_HAVE_REGEX
@@ -67,18 +65,16 @@ static FILE*       stat_ev_file  = NULL;
 
 #endif /* FIRM_HAVE_LIBZ */
 
-int                stat_ev_enabled = 0;
-int                stat_ev_timer_sp = 0;
-timing_ticks_t     stat_ev_timer_elapsed[MAX_TIMER];
-timing_ticks_t     stat_ev_timer_start[MAX_TIMER];
-timing_sched_env_t stat_ev_sched_rt;
-timing_sched_env_t stat_ev_sched_normal;
+int            stat_ev_enabled = 0;
+int            stat_ev_timer_sp = 0;
+timing_ticks_t stat_ev_timer_elapsed[MAX_TIMER];
+timing_ticks_t stat_ev_timer_start[MAX_TIMER];
 
 #ifdef FIRM_HAVE_REGEX
 #include <regex.h>
 static regex_t regex;
 static regex_t *filter = NULL;
-static INLINE int key_matches(const char *key)
+static inline int key_matches(const char *key)
 {
        if (!filter)
                return 1;
@@ -88,7 +84,7 @@ static INLINE int key_matches(const char *key)
 
 #else
 static char filter[128] = { '\0' };
-static INLINE int key_matches(const char *key)
+static inline int key_matches(const char *key)
 {
        int i = 0;
 
@@ -104,7 +100,7 @@ static INLINE int key_matches(const char *key)
 
 void stat_ev_printf(char ev, const char *key, const char *fmt, ...)
 {
-       if (ev == 'E' && !key_matches(key))
+       if (!key_matches(key))
                return;
 
        mfprintf(stat_ev_file, "%c;%s", ev, key);
@@ -143,8 +139,6 @@ void stat_ev_begin(const char *prefix, const char *filt)
        }
 
        stat_ev_enabled = stat_ev_file != NULL;
-       timing_sched_get(&stat_ev_sched_normal);
-       timing_sched_prepare_max_prio(&stat_ev_sched_rt);
 }
 
 void stat_ev_end(void)
@@ -158,3 +152,5 @@ void stat_ev_end(void)
 #endif
        }
 }
+
+#endif