From 73eaae45cbc65f3269c54273849d42a3719c357c Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Tue, 19 Apr 2011 23:22:41 +0200 Subject: prevent gcc warning with single printf like arg passing --- src/stats.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/stats.c') diff --git a/src/stats.c b/src/stats.c index a70ef4e..b1c8dda 100644 --- a/src/stats.c +++ b/src/stats.c @@ -91,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, 1, "creating new hash table\n"); + PRINT_VERBOSE(cfg, 1, "%s\n", "creating new hash table"); if (!hcreate_r(t->sym_max, &t->sym_htab)) { perror("hcreate_r failed"); @@ -126,7 +126,7 @@ int lt_stats_alloc(struct lt_config_app *cfg, struct lt_thread *t) } } - PRINT_VERBOSE(cfg, 1, "reallocation ok\n"); + PRINT_VERBOSE(cfg, 1, "%s\n", "reallocation ok"); return 0; } @@ -244,7 +244,8 @@ 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, 1, "counting total time\n"); + PRINT_VERBOSE(cfg, 1, "%s\n", "counting total time"); + 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); @@ -252,7 +253,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, 1, "counting post mortem statistics\n"); + PRINT_VERBOSE(cfg, 1, "%s\n", "counting post mortem statistics"); for(i = 0; i < t->sym_cnt; i++) { struct lt_stats_sym *sym = t->sym_array[i]; @@ -262,12 +263,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, 1, "sorting\n"); + PRINT_VERBOSE(cfg, 1, "%s\n", "sorting"); csort = cfg->csort; qsort(t->sym_array, t->sym_cnt, sizeof(struct lt_stats_sym*), qsort_compar); - PRINT_VERBOSE(cfg, 1, "printing\n"); + PRINT_VERBOSE(cfg, 1, "%s\n", "printing"); tv_sub(&tv_thread_real, &t->tv_stop, &t->tv_start); printf("\nThread %d (runtime %u.%06u sec)\n", -- cgit