summaryrefslogtreecommitdiffstats
path: root/src/stats.c
diff options
context:
space:
mode:
authorJiri Olsa <Jiri Olsa jolsa@redhat.com>2010-02-13 21:20:26 +0100
committerJiri Olsa <Jiri Olsa jolsa@redhat.com>2010-02-13 21:20:26 +0100
commit7cfcb7e6a024d27e2bc9756d8a8595d7ecb50811 (patch)
tree35cb5109e2d32086cd3fb24bb4c493fda9129fc1 /src/stats.c
parent253e346421f9dd201d86e4fdf518c4985ea2f343 (diff)
downloadlatrace-7cfcb7e6a024d27e2bc9756d8a8595d7ecb50811.tar.gz
latrace-7cfcb7e6a024d27e2bc9756d8a8595d7ecb50811.tar.xz
latrace-7cfcb7e6a024d27e2bc9756d8a8595d7ecb50811.zip
refactoring shared config
Diffstat (limited to 'src/stats.c')
-rw-r--r--src/stats.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/stats.c b/src/stats.c
index 59e0d9c..27f588d 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -83,8 +83,7 @@ int lt_stats_alloc(struct lt_config_app *cfg, struct lt_thread *t)
return 0;
}
-
- PRINT_VERBOSE(cfg->sh.verbose, 1,
+ PRINT_VERBOSE(cfg, 1,
"too bad, out of symbols, reallocation... %p - %d\n",
t->sym_array, t->sym_cnt);
@@ -92,7 +91,7 @@ int lt_stats_alloc(struct lt_config_app *cfg, struct lt_thread *t)
t->sym_max += LT_SYM_HMAX;
hdestroy_r(&t->sym_htab);
- PRINT_VERBOSE(cfg->sh.verbose, 1, "creating new hash table\n");
+ PRINT_VERBOSE(cfg, 1, "creating new hash table\n");
if (!hcreate_r(t->sym_max, &t->sym_htab)) {
perror("hcreate_r failed");
@@ -107,7 +106,7 @@ int lt_stats_alloc(struct lt_config_app *cfg, struct lt_thread *t)
return -1;
}
- PRINT_VERBOSE(cfg->sh.verbose, 1,
+ PRINT_VERBOSE(cfg, 1,
"adding symbols to new hash table %p\n",
t->sym_array);
@@ -119,8 +118,7 @@ int lt_stats_alloc(struct lt_config_app *cfg, struct lt_thread *t)
e.key = sym->name;
e.data = sym;
- PRINT_VERBOSE(cfg->sh.verbose, 1,
- "adding symbol %s\n", sym->name);
+ PRINT_VERBOSE(cfg, 1, "adding symbol %s\n", sym->name);
if (0 == hsearch_r(e, ENTER, &ep, &t->sym_htab)) {
printf("failed to add hash item during reallocation\n");
@@ -128,7 +126,7 @@ int lt_stats_alloc(struct lt_config_app *cfg, struct lt_thread *t)
}
}
- PRINT_VERBOSE(cfg->sh.verbose, 1, "reallocation ok\n");
+ PRINT_VERBOSE(cfg, 1, "reallocation ok\n");
return 0;
}
@@ -175,7 +173,7 @@ int lt_stats_sym(struct lt_config_app *cfg, struct lt_thread *t,
t->sym_array[t->sym_cnt] = sym;
t->sym_cnt++;
- PRINT_VERBOSE(cfg->sh.verbose, 1,
+ PRINT_VERBOSE(cfg, 1,
"adding symbol %d %s\n", t->sym_cnt, sym->name);
} else
free(e.key);
@@ -246,7 +244,7 @@ static int lt_stats_show_thread(struct lt_config_app *cfg, struct lt_thread *t)
struct timeval tv_thread_accu = { 0, 0};
float time_global;
- PRINT_VERBOSE(cfg->sh.verbose, 1, "counting total time\n");
+ PRINT_VERBOSE(cfg, 1, "counting total time\n");
for(i = 0; i < t->sym_cnt; i++) {
struct lt_stats_sym *sym = t->sym_array[i];
tv_add(&tv_thread_accu, &tv_thread_accu, &sym->tv_all);
@@ -254,7 +252,7 @@ static int lt_stats_show_thread(struct lt_config_app *cfg, struct lt_thread *t)
time_global = tv_thread_accu.tv_sec * 1000000 + tv_thread_accu.tv_usec;
- PRINT_VERBOSE(cfg->sh.verbose, 1, "counting post mortem statistics\n");
+ PRINT_VERBOSE(cfg, 1, "counting post mortem statistics\n");
for(i = 0; i < t->sym_cnt; i++) {
struct lt_stats_sym *sym = t->sym_array[i];
@@ -264,12 +262,12 @@ static int lt_stats_show_thread(struct lt_config_app *cfg, struct lt_thread *t)
sym->usec_call = time_sym/sym->call;
}
- PRINT_VERBOSE(cfg->sh.verbose, 1, "sorting\n");
+ PRINT_VERBOSE(cfg, 1, "sorting\n");
csort = cfg->csort;
qsort(t->sym_array, t->sym_cnt, sizeof(struct lt_stats_sym*), qsort_compar);
- PRINT_VERBOSE(cfg->sh.verbose, 1, "printing\n");
+ PRINT_VERBOSE(cfg, 1, "printing\n");
tv_sub(&tv_thread_real, &t->tv_stop, &t->tv_start);
printf("\nThread %d (runtime %u.%06u sec)\n",