Re: [PATCH 1/1] perf tools: Unify debug messages mechanisms

From: Ingo Molnar
Date: Fri Oct 23 2009 - 02:20:28 EST



* Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:

> We were using eprintf in some places, that looks at a global 'verbose'
> level, and at other places passing a 'v' parameter to specify the
> verbosity level, unify it by introducing pr_{err,warning,debug,etc},
> just like in the kernel.
>
> Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Paul Mackerras <paulus@xxxxxxxxx>
> Cc: Mike Galbraith <efault@xxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> ---
> tools/perf/builtin-annotate.c | 3 +-
> tools/perf/builtin-probe.c | 20 +++---
> tools/perf/builtin-record.c | 2 +-
> tools/perf/builtin-report.c | 9 +-
> tools/perf/builtin-sched.c | 4 +-
> tools/perf/builtin-timechart.c | 13 ++--
> tools/perf/builtin-top.c | 2 +-
> tools/perf/builtin-trace.c | 4 +-
> tools/perf/util/callchain.c | 2 +-
> tools/perf/util/debug.c | 4 +-
> tools/perf/util/debug.h | 3 +-
> tools/perf/util/event.h | 3 +-
> tools/perf/util/header.c | 2 +-
> tools/perf/util/include/linux/kernel.h | 17 ++++
> tools/perf/util/map.c | 17 ++--
> tools/perf/util/probe-finder.c | 12 ++--
> tools/perf/util/symbol.c | 134 ++++++++++++++------------------
> tools/perf/util/symbol.h | 5 +-
> tools/perf/util/thread.c | 6 +-
> 19 files changed, 130 insertions(+), 132 deletions(-)
>
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 99bac6a..6d63c2e 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -203,8 +203,7 @@ static int
> process_mmap_event(event_t *event, unsigned long offset, unsigned long head)
> {
> struct map *map = map__new(&event->mmap, NULL, 0,
> - sizeof(struct sym_priv), symbol_filter,
> - verbose);
> + sizeof(struct sym_priv), symbol_filter);
> struct thread *thread = threads__findnew(event->mmap.pid);
>
> dump_printf("%p [%p]: PERF_RECORD_MMAP %d: [%p(%p) @ %p]: %s\n",
> diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> index b5ad86a..dcb406c 100644
> --- a/tools/perf/builtin-probe.c
> +++ b/tools/perf/builtin-probe.c
> @@ -78,7 +78,7 @@ static int parse_probepoint(const struct option *opt __used,
> if (!str) /* The end of probe points */
> return 0;
>
> - eprintf("probe-definition(%d): %s\n", session.nr_probe, str);
> + pr_debug("probe-definition(%d): %s\n", session.nr_probe, str);

Very nice! That verbose global/local overlap has always bothered me,
thanks for fixing it!

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/