LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Jin Yao <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com,
Linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v2 2/3] perf util: Flexible to set block info output formats
Date: Tue, 7 Jan 2020 11:06:37 +0100 [thread overview]
Message-ID: <20200107100637.GE290055@krava> (raw)
In-Reply-To: <20200106194525.12228-2-yao.jin@linux.intel.com>
On Tue, Jan 07, 2020 at 03:45:24AM +0800, Jin Yao wrote:
> 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.
>
> v2:
> ---
> New patch created in v2.
>
> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
> ---
> tools/perf/builtin-report.c | 25 +++++++++++---
> tools/perf/util/block-info.c | 64 ++++++++++++++++++++++++++----------
> tools/perf/util/block-info.h | 12 +++++--
> 3 files changed, 76 insertions(+), 25 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index de988589d99b..81ae1f862d11 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -104,6 +104,7 @@ struct report {
> bool symbol_ipc;
> bool total_cycles_mode;
> struct block_report *block_reports;
> + int nr_block_reports;
> };
>
> static int report__config(const char *var, const char *value, void *cb)
> @@ -503,7 +504,7 @@ static int perf_evlist__tui_block_hists_browse(struct evlist *evlist,
> ret = report__browse_block_hists(&rep->block_reports[i++].hist,
> rep->min_percent, pos,
> &rep->session->header.env,
> - &rep->annotation_opts);
> + &rep->annotation_opts, true);
> if (ret != 0)
> return ret;
> }
> @@ -536,7 +537,7 @@ static int perf_evlist__tty_browse_hists(struct evlist *evlist,
> if (rep->total_cycles_mode) {
> report__browse_block_hists(&rep->block_reports[i++].hist,
> rep->min_percent, pos,
> - NULL, NULL);
> + NULL, NULL, true);
> continue;
> }
>
> @@ -966,8 +967,19 @@ static int __cmd_report(struct report *rep)
> report__output_resort(rep);
>
> if (rep->total_cycles_mode) {
> + int block_hpps[6] = {
> + PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_PCT,
> + PERF_HPP_REPORT__BLOCK_LBR_CYCLES,
> + PERF_HPP_REPORT__BLOCK_CYCLES_PCT,
> + PERF_HPP_REPORT__BLOCK_AVG_CYCLES,
> + PERF_HPP_REPORT__BLOCK_RANGE,
> + PERF_HPP_REPORT__BLOCK_DSO,
> + };
I'd understand this change if there was another place in the code using
this, but it's not part of this patchset.. is it comming later?
thanks,
jirka
next prev parent reply other threads:[~2020-01-07 10:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-06 19:45 [PATCH v2 1/3] perf util: Move block_pair_cmp to block-info Jin Yao
2020-01-06 19:45 ` [PATCH v2 2/3] perf util: Flexible to set block info output formats Jin Yao
2020-01-07 10:06 ` Jiri Olsa [this message]
2020-01-07 14:00 ` Jin, Yao
2020-01-06 19:45 ` [PATCH v2 3/3] perf util: Support color ops to print block percents in color Jin Yao
2020-01-07 9:57 ` [PATCH v2 1/3] perf util: Move block_pair_cmp to block-info Jiri Olsa
2020-01-07 13:57 ` Jin, Yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200107100637.GE290055@krava \
--to=jolsa@redhat.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=yao.jin@intel.com \
--cc=yao.jin@linux.intel.com \
--subject='Re: [PATCH v2 2/3] perf util: Flexible to set block info output formats' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).