[PATCH 7/9] perf (userspace): Introduce --verbose param for perf timechart

From: Thomas Renninger
Date: Fri Jan 07 2011 - 05:31:12 EST


by making use of the already available global verbose variable
from util/debug.h (similar to perf diff or perf top).

Some already introduced if (verbose) condtitions in util/svnhelper.c
will also be activated with that one.

Signed-off-by: Thomas Renninger <trenn@xxxxxxx>
CC: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
CC: Ingo Molnar <mingo@xxxxxxx>
CC: linux-kernel@xxxxxxxxxxxxxxx
CC: linux-perf-users@xxxxxxxxxxxxxxx
---
tools/perf/builtin-timechart.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 746cf03..54e9c37 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -31,6 +31,7 @@
#include "util/event.h"
#include "util/session.h"
#include "util/svghelper.h"
+#include "util/debug.h"

#define SUPPORT_OLD_POWER_EVENTS 1
#define PWR_EVENT_EXIT -1
@@ -382,6 +383,10 @@ static void c_state_end(int cpu, u64 timestamp)
pwr->next = power_events;

power_events = pwr;
+ if (verbose)
+ printf("CPU: %d - start_time: %llu - end_time: %llu\n",
+ power_events->cpu, power_events->start_time,
+ power_events->end_time);
}

static void p_state_change(int cpu, u64 timestamp, u64 new_freq)
@@ -1069,6 +1074,8 @@ parse_process(const struct option *opt __used, const char *arg, int __used unset
}

static const struct option options[] = {
+ OPT_INCR('v', "verbose", &verbose,
+ "print extended debug info to stdout"),
OPT_STRING('i', "input", &input_name, "file",
"input file name"),
OPT_STRING('o', "output", &output_name, "file",
--
1.7.3.1

--
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/