diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-10-04 08:49:39 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-04 12:30:27 -0400 |
commit | 1d77822ea6245e89149872405a3844e0778a004a (patch) | |
tree | 8ddc334a3be9f0248ee83c8a5bf2b84be2204953 /tools/perf/builtin-diff.c | |
parent | 41724e4cf6c443d2dc575669b8555f0e2ae427a9 (diff) |
perf tool: Add hpp interface to enable/disable hpp column
Adding perf_hpp__column_enable function to enable/disable hists column
and removing diff command specific stuff 'need_pair and
show_displacement' from hpp code.
The diff command now enables/disables columns separately according to
the user arguments. This will be helpful in future patches where more
columns are added into diff output.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-6-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-diff.c')
-rw-r--r-- | tools/perf/builtin-diff.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 413c65a1ba39..a0b531c14b97 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c | |||
@@ -256,6 +256,21 @@ static const struct option options[] = { | |||
256 | OPT_END() | 256 | OPT_END() |
257 | }; | 257 | }; |
258 | 258 | ||
259 | static void ui_init(void) | ||
260 | { | ||
261 | perf_hpp__init(); | ||
262 | |||
263 | /* No overhead column. */ | ||
264 | perf_hpp__column_enable(PERF_HPP__OVERHEAD, false); | ||
265 | |||
266 | /* Display baseline/delta/displacement columns. */ | ||
267 | perf_hpp__column_enable(PERF_HPP__BASELINE, true); | ||
268 | perf_hpp__column_enable(PERF_HPP__DELTA, true); | ||
269 | |||
270 | if (show_displacement) | ||
271 | perf_hpp__column_enable(PERF_HPP__DISPL, true); | ||
272 | } | ||
273 | |||
259 | int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused) | 274 | int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused) |
260 | { | 275 | { |
261 | sort_order = diff__default_sort_order; | 276 | sort_order = diff__default_sort_order; |
@@ -278,7 +293,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused) | |||
278 | if (symbol__init() < 0) | 293 | if (symbol__init() < 0) |
279 | return -1; | 294 | return -1; |
280 | 295 | ||
281 | perf_hpp__init(true, show_displacement); | 296 | ui_init(); |
297 | |||
282 | setup_sorting(diff_usage, options); | 298 | setup_sorting(diff_usage, options); |
283 | setup_pager(); | 299 | setup_pager(); |
284 | 300 | ||