Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6beba7ad authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar
Browse files

perf tools: Unify debug messages mechanisms



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.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1256153646-10097-1-git-send-email-acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 802da5f2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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",
+1 −1
Original line number Diff line number Diff line
@@ -630,7 +630,7 @@ static int __cmd_record(int argc, const char **argv)

		param.sched_priority = realtime_prio;
		if (sched_setscheduler(0, SCHED_FIFO, &param)) {
			printf("Could not set realtime priority.\n");
			pr_err("Could not set realtime priority.\n");
			exit(-1);
		}
	}
+5 −4
Original line number Diff line number Diff line
@@ -689,7 +689,8 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
		dump_printf("... chain: nr:%Lu\n", chain->nr);

		if (validate_chain(chain, event) < 0) {
			eprintf("call-chain problem with event, skipping it.\n");
			pr_debug("call-chain problem with event, "
				 "skipping it.\n");
			return 0;
		}

@@ -700,7 +701,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
	}

	if (thread == NULL) {
		eprintf("problem processing %d event, skipping it.\n",
		pr_debug("problem processing %d event, skipping it.\n",
			event->header.type);
		return -1;
	}
@@ -738,7 +739,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)

	if (hist_entry__add(thread, map, sym, ip,
			    chain, level, period)) {
		eprintf("problem incrementing symbol count, skipping event\n");
		pr_debug("problem incrementing symbol count, skipping event\n");
		return -1;
	}

@@ -750,7 +751,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
static int
process_mmap_event(event_t *event, unsigned long offset, unsigned long head)
{
	struct map *map = map__new(&event->mmap, cwd, cwdlen, 0, NULL, verbose);
	struct map *map = map__new(&event->mmap, cwd, cwdlen, 0, NULL);
	struct thread *thread = threads__findnew(event->mmap.pid);

	dump_printf("%p [%p]: PERF_RECORD_MMAP %d/%d: [%p(%p) @ %p]: %s\n",
+2 −2
Original line number Diff line number Diff line
@@ -1666,7 +1666,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
		(long long)period);

	if (thread == NULL) {
		eprintf("problem processing %d event, skipping it.\n",
		pr_debug("problem processing %d event, skipping it.\n",
			 event->header.type);
		return -1;
	}
+6 −7
Original line number Diff line number Diff line
@@ -1162,12 +1162,10 @@ more:
	size = event->header.size;

	if (!size || process_event(event) < 0) {

		printf("%p [%p]: skipping unknown header type: %d\n",
		pr_warning("%p [%p]: skipping unknown header type: %d\n",
			   (void *)(offset + head),
			   (void *)(long)(event->header.size),
			   event->header.type);

		/*
		 * assume we lost track of the stream, check alignment, and
		 * increment a single u64 in the hope to catch on again 'soon'.
@@ -1200,7 +1198,8 @@ done:

	write_svg_file(output_name);

	printf("Written %2.1f seconds of trace to %s.\n", (last_time - first_time) / 1000000000.0, output_name);
	pr_info("Written %2.1f seconds of trace to %s.\n",
		(last_time - first_time) / 1000000000.0, output_name);

	return rc;
}
Loading