From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: namhyung@kernel.org, jolsa@kernel.org,
linux-kernel@vger.kernel.org, mingo@kernel.org,
peterz@infradead.org, ak@linux.intel.com, dsahern@gmail.com,
eranian@google.com, alexander.shishkin@linux.intel.com,
acme@redhat.com, tglx@linutronix.de, hpa@zytor.com,
jolsa@redhat.com
Subject: [tip:perf/core] perf report: Add support to display group output for non group events
Date: Sat, 17 Feb 2018 03:23:03 -0800 [thread overview]
Message-ID: <tip-ad52b8cb4886f572b147b02f4c59a648bbf05f9c@git.kernel.org> (raw)
In-Reply-To: <20180209092734.GB20449@krava>
Commit-ID: ad52b8cb4886f572b147b02f4c59a648bbf05f9c
Gitweb: https://git.kernel.org/tip/ad52b8cb4886f572b147b02f4c59a648bbf05f9c
Author: Jiri Olsa <jolsa@redhat.com>
AuthorDate: Fri, 9 Feb 2018 10:27:34 +0100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 16 Feb 2018 10:09:24 -0300
perf report: Add support to display group output for non group events
Add support to display group output for if non grouped events are
detected and user forces --group option. Now for non-group events
recorded like:
$ perf record -e 'cycles,instructions' ls
you can still get group output by using --group option
in report:
$ perf report --group --stdio
...
# Overhead Command Shared Object Symbol
# ................ ....... ................ ......................
#
17.67% 0.00% ls libc-2.25.so [.] _IO_do_write@@GLIB
15.59% 25.94% ls ls [.] calculate_columns
15.41% 31.35% ls libc-2.25.so [.] __strcoll_l
...
Committer note:
We should improve on this by making sure that the first line states that
this is not a group, but since the user doesn't have to force group view
when really using grouped events (e.g. '{cycles,instructions}'), the
user better know what is being done...
Requested-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180209092734.GB20449@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-report.txt | 3 ++-
tools/perf/builtin-report.c | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 907e505..a76b871 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -354,7 +354,8 @@ OPTIONS
Path to objdump binary.
--group::
- Show event group information together.
+ Show event group information together. It forces group output also
+ if there are no groups defined in data file.
--demangle::
Demangle symbol names to human readable form. It's enabled by default,
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 8ef7166..1eedb18 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -938,6 +938,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,
@@ -1057,7 +1058,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",
@@ -1174,6 +1175,9 @@ repeat:
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;
next prev parent reply other threads:[~2018-02-17 11:33 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
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-bot for Jiri Olsa [this message]
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=tip-ad52b8cb4886f572b147b02f4c59a648bbf05f9c@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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).