X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fstat%2Fstatev.h;h=8d135df4ae2ae6d85101c9fe0bbd9d44ec46d0e3;hb=f7ff9494d0f76325b53f09452c6491aaad4a6d06;hp=7655394a19d58b6575fc9a9e1d1c5f01f8a16a4a;hpb=15f5fef710e24321a27905b26a5dc1fcbabd9b1f;p=libfirm diff --git a/ir/stat/statev.h b/ir/stat/statev.h index 7655394a1..8d135df4a 100644 --- a/ir/stat/statev.h +++ b/ir/stat/statev.h @@ -22,54 +22,51 @@ * @brief Statistic events. * @author Sebastian Hack * @date 17.06.2007 - * @version $Id$ */ #ifndef FIRM_STATEVENT_H #define FIRM_STATEVENT_H -#if !defined(FIRM_STATISTICS) || defined(DISABLE_STATEV) +#ifdef DISABLE_STATEV -#define stat_ev_do(expr) -#define stat_ev_if if (0) -#define stat_ev_dbl(name, val) -#define stat_ev_int(name, val) -#define stat_ev(name) +#define stat_ev_enabled 0 +#define stat_ev_dbl(name, val) ((void)0) +#define stat_ev_int(name, val) ((void)0) +#define stat_ev(name) ((void)0) +#define stat_ev_emit(name, value) ((void)0) -#define stat_ev_cnt_decl(var) -#define stat_ev_cnt_inc(var) -#define stat_ev_cnt_done(name, var) -#define stat_ev_tim_push() -#define stat_ev_tim_pop(name) +#define stat_ev_cnt_decl(var) ((void)0) +#define stat_ev_cnt_inc(var) ((void)0) +#define stat_ev_cnt_done(name, var) ((void)0) +#define stat_ev_tim_push() ((void)0) +#define stat_ev_tim_pop(name) ((void)0) -#define stat_ev_ctx_push(key) -#define stat_ev_ctx_push_str(key, str) -#define stat_ev_ctx_push_fmt(key, fmt, value) -#define stat_ev_ctx_push_fobj(key, firm_object) -#define stat_ev_ctx_pop(key) -#define stat_ev_flush() +#define stat_ev_ctx_push(key) ((void)0) +#define stat_ev_ctx_push_str(key, str) ((void)0) +#define stat_ev_ctx_push_fmt(key, fmt, value) ((void)0) +#define stat_ev_ctx_push_fobj(key, firm_object) ((void)0) +#define stat_ev_ctx_pop(key) ((void)0) +#define stat_ev_flush() ((void)0) #else #include #include "stat_timing.h" -extern void stat_ev_printf(char ev_type, const char *key, const char *fmt, ...); +extern void stat_ev_printf(char ev_type, const char *key, const char *fmt, ...); -extern int stat_ev_enabled; -extern int stat_ev_timer_sp; -extern timing_ticks_t stat_ev_timer_elapsed[]; -extern timing_ticks_t stat_ev_timer_start[]; -extern timing_sched_env_t stat_ev_sched_rt; -extern timing_sched_env_t stat_ev_sched_normal; +extern int stat_ev_enabled; +extern int stat_ev_timer_sp; +extern timing_ticks_t stat_ev_timer_elapsed[]; +extern timing_ticks_t stat_ev_timer_start[]; -static INLINE __attribute__((unused)) void stat_ev_tim_push(void) { +static inline void stat_ev_tim_push(void) { timing_ticks_t temp; int sp = stat_ev_timer_sp++; timing_ticks(temp); - if (sp == 0) - timing_sched_set(&stat_ev_sched_rt); - else { + if (sp == 0) { + timing_enter_max_prio(); + } else { timing_ticks_sub(temp, stat_ev_timer_start[sp - 1]); timing_ticks_add(stat_ev_timer_elapsed[sp - 1], temp); } @@ -77,7 +74,7 @@ static INLINE __attribute__((unused)) void stat_ev_tim_push(void) { timing_ticks(stat_ev_timer_start[sp]); } -static INLINE __attribute__((unused)) void stat_ev_tim_pop(const char *name) { +static inline void stat_ev_tim_pop(const char *name) { int sp; timing_ticks_t temp; timing_ticks(temp); @@ -86,10 +83,11 @@ static INLINE __attribute__((unused)) void stat_ev_tim_pop(const char *name) { timing_ticks_add(stat_ev_timer_elapsed[sp], temp); if (name != NULL && stat_ev_enabled) stat_ev_printf('E', name, "%g", timing_ticks_dbl(stat_ev_timer_elapsed[sp])); - if (sp == 0) - timing_sched_set(&stat_ev_sched_normal); - else + if (sp == 0) { + timing_leave_max_prio(); + } else { timing_ticks(stat_ev_timer_start[sp - 1]); + } } #define stat_ev_ctx_push_fmt(key, fmt, value) \ @@ -131,9 +129,6 @@ static INLINE __attribute__((unused)) void stat_ev_tim_pop(const char *name) { #define stat_ev_cnt_inc(var) do { ++stat_ev_cnt_var_ ## var; } while(0) #define stat_ev_cnt_done(var, name) stat_ev_emit((name), stat_ev_cnt_var_ ## var) -#define stat_ev_do(expr) (stat_ev_enabled ? ((expr), 1) : 0) -#define stat_ev_if if (stat_ev_enabled) - /** * Initialize the stat ev machinery. * @param filename_prefix The prefix of the filename (.ev or .ev.gz will be appended). @@ -150,4 +145,4 @@ void stat_ev_end(void); #endif -#endif /* FIRM_STATEVENT_H */ +#endif