lkml.org 
[lkml]   [2009]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] perf tools: Unify debug messages mechanisms

* Arnaldo Carvalho de Melo <acme@redhat.com> 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@gmail.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Mike Galbraith <efault@gmx.de>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> 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


\
 
 \ /
  Last update: 2009-10-23 08:23    [W:0.055 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site