summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/block-info.h
diff options
context:
space:
mode:
authorJin Yao <yao.jin@linux.intel.com>2020-02-02 15:16:54 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-03-10 01:43:25 +0100
commitcca0cc76f5f56dff2c8461b551a3e1fdabcd3fba (patch)
treecaba5b1a528f58bbad51351219cf02dd97dc8aed /tools/perf/util/block-info.h
parentperf diff: Use __block_info__cmp() to replace block_pair_cmp() (diff)
downloadlinux-cca0cc76f5f56dff2c8461b551a3e1fdabcd3fba.tar.xz
linux-cca0cc76f5f56dff2c8461b551a3e1fdabcd3fba.zip
perf block-info: Allow selecting which columns to report and its order
Currently we use a predefined array to set the block info output formats, it's fixed and inflexible. This patch adds two parameters "block_hpps" and "nr_hpps" in block_info__create_report and other static functions, in order to let user decide which columns to report and with specified report ordering. It should be more flexible. Buffers will be allocated to contain the new fmts, of course, we need to release them before perf exits. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200202141655.32053-4-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/block-info.h')
-rw-r--r--tools/perf/util/block-info.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/util/block-info.h b/tools/perf/util/block-info.h
index a0fa9fefeaf0..42e9dcc4cf0a 100644
--- a/tools/perf/util/block-info.h
+++ b/tools/perf/util/block-info.h
@@ -45,6 +45,7 @@ struct block_report {
struct block_hist hist;
u64 cycles;
struct block_fmt fmts[PERF_HPP_REPORT__BLOCK_MAX_INDEX];
+ int nr_fmts;
};
struct block_hist;
@@ -70,7 +71,11 @@ int block_info__process_sym(struct hist_entry *he, struct block_hist *bh,
u64 *block_cycles_aggr, u64 total_cycles);
struct block_report *block_info__create_report(struct evlist *evlist,
- u64 total_cycles);
+ u64 total_cycles,
+ int *block_hpps, int nr_hpps,
+ int *nr_reps);
+
+void block_info__free_report(struct block_report *reps, int nr_reps);
int report__browse_block_hists(struct block_hist *bh, float min_percent,
struct evsel *evsel, struct perf_env *env,