linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	David Ahern <dsahern@gmail.com>, Andi Kleen <ak@linux.intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 1/3] perf tools: Fix period/freq terms setup
Date: Tue, 6 Feb 2018 10:35:53 +0100	[thread overview]
Message-ID: <20180206093553.GA8065@krava> (raw)
In-Reply-To: <CABPqkBQ272K=f7eYzk1MkgG04sy_szkMuyyTmyNEVSyBdYo-Og@mail.gmail.com>

On Mon, Feb 05, 2018 at 06:51:05PM -0800, Stephane Eranian wrote:

SNIP

> >
> Looks like this is working then, great!
> 
> Now, related to profiling and reporting. There is still an issue I
> keep running into
> with grouping. I want to sample on N events, where N > number of  hw counters.
> Yet I want the same output as perf report --group, i.e., side-by-side
> profiles as
> opposed to showing me one event profile at a time (which is not very useful).
> 
> You should not require events to belong to the same group to support this. Many
> other tools support such output (e.g., VTUNE, Gooda). It is still very
> valuable even
> though events may not have been measured at the same time.
> 
> Let me use a simple (and silly but portable) example.
> Today if I do on  Intel x86:
> 
>  $ perf record -e branches,branches,branches,branches,branches my_test
> 
> And I do:
> 
> $ perf report --group
> It will show me 5 distinct profiles.
> 
> I would like perf to show me a single profile where the 5 events are
> side-by-side.
> 
> Similar to what I get if I do instead:
> $ perf record -e '{branches,branches,branches,branches}' my_test
> $ perf report --group
> 
> But here, I would have to ensure all events fits in a group to allow
> the reporting
> I want. So that would limit me to 4 events.
> 
> I think perf report --group should work regardless of how the events
> were grouped.
> Is there already a way to work around this?

no workaround.. please try attached patch, it seems
to work for what you described

thanks,
jirka


---
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 4ad5dc649716..35a013992092 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -937,6 +937,7 @@ int cmd_report(int argc, const char **argv)
 		"perf report [<options>]",
 		NULL
 	};
+	bool group_set = false;
 	struct report report = {
 		.tool = {
 			.sample		 = process_sample_event,
@@ -1056,7 +1057,7 @@ int cmd_report(int argc, const char **argv)
 		   "Specify disassembler style (e.g. -M intel for intel syntax)"),
 	OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
 		    "Show a column with the sum of periods"),
-	OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
+	OPT_BOOLEAN_SET(0, "group", &symbol_conf.event_group, &group_set,
 		    "Show event group information together"),
 	OPT_CALLBACK_NOOPT('b', "branch-stack", &branch_mode, "",
 		    "use branch records for per branch histogram filling",
@@ -1173,6 +1174,9 @@ int cmd_report(int argc, const char **argv)
 	has_br_stack = perf_header__has_feat(&session->header,
 					     HEADER_BRANCH_STACK);
 
+	if (group_set && !session->evlist->nr_groups)
+		perf_evlist__set_leader(session->evlist);
+
 	if (itrace_synth_opts.last_branch)
 		has_br_stack = true;
 

  reply	other threads:[~2018-02-06  9:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  8:38 [PATCH 0/3] perf: PEBS/period freerunning fixes Jiri Olsa
2018-02-01  8:38 ` [PATCH 1/3] perf tools: Fix period/freq terms setup Jiri Olsa
2018-02-02 18:45   ` Stephane Eranian
2018-02-02 20:28     ` Arnaldo Carvalho de Melo
2018-02-02 20:40       ` Arnaldo Carvalho de Melo
2018-02-02 21:04         ` Stephane Eranian
2018-02-05 15:17           ` Jiri Olsa
2018-02-05 20:58             ` Stephane Eranian
2018-02-05 21:13               ` Arnaldo Carvalho de Melo
2018-02-06  2:51                 ` Stephane Eranian
2018-02-06  9:35                   ` Jiri Olsa [this message]
2018-02-07 18:52                     ` Stephane Eranian
2018-02-09  9:27                       ` [PATCH] perf report: Add support to display group output for non group events Jiri Olsa
2018-02-09 18:37                         ` Arnaldo Carvalho de Melo
2018-02-09 18:43                           ` Arnaldo Carvalho de Melo
2018-02-09 19:10                           ` Jiri Olsa
2018-02-09 19:12                             ` Arnaldo Carvalho de Melo
2018-02-17 11:23                         ` [tip:perf/core] " tip-bot for Jiri Olsa
2018-02-03 15:30     ` [PATCH 1/3] perf tools: Fix period/freq terms setup Jiri Olsa
2018-02-04  0:19       ` Stephane Eranian
2018-02-05 21:35   ` [tip:perf/urgent] perf evsel: " tip-bot for Jiri Olsa
2018-02-01  8:38 ` [PATCH 2/3] perf record: Fix period option handling Jiri Olsa
2018-02-05 21:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2018-02-01  8:38 ` [PATCH 3/3] x86/events/intel/ds: Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS Jiri Olsa
2018-02-05 21:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa

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=20180206093553.GA8065@krava \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).