- char buf[96];
- ir_snprintf(buf, sizeof(buf), "%+F", firm_object);
- stat_ev_ctx_push(key, buf);
-}
-
-void stat_ev_ctx_pop(void)
-{
- if (ctx_sp >= 0) {
- if (file_ev)
- fprintf(file_ev, "O %10x\n", ctx_stack[ctx_sp].hash);
- --ctx_sp;
- }
-}
-
-void stat_ev_emit(const char *name, double value)
-{
- if (file_ev) {
- unsigned long start = get_time();
- unsigned id = ctx_sp >= 0 ? ctx_stack[ctx_sp].hash : 0;
-
- fprintf(file_ev, "E %10x %30s %30f %10ld %10ld\n", id, name, value, start, time_in_ev);
- time_in_ev += get_time() - start;
+ if (!key_matches(key))
+ return;
+
+ fprintf(stat_ev_file, "%c;%s", ev, key);
+ if (fmt != NULL) {
+ char buf[256];
+ va_list args;
+
+ va_start(args, fmt);
+ ir_vsnprintf(buf, sizeof(buf), fmt, args);
+ va_end(args);
+ fprintf(stat_ev_file, ";%s", buf);