From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, acme@redhat.com, jolsa@kernel.org,
tglx@linutronix.de, dsahern@gmail.com, mingo@kernel.org,
linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
namhyung@kernel.org
Subject: [tip:perf/core] perf evlist: Be more specific on -F/--freq
Date: Wed, 12 Aug 2015 05:31:28 -0700 [thread overview]
Message-ID: <tip-4605bb55b91449a1a953a51f0334d3bc02351adb@git.kernel.org> (raw)
In-Reply-To: <1439102724-14079-2-git-send-email-namhyung@kernel.org>
Commit-ID: 4605bb55b91449a1a953a51f0334d3bc02351adb
Gitweb: http://git.kernel.org/tip/4605bb55b91449a1a953a51f0334d3bc02351adb
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Sun, 9 Aug 2015 15:45:24 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 10 Aug 2015 17:20:26 -0300
perf evlist: Be more specific on -F/--freq
Currently perf evlist -F shows the number as if it's always sampling
frequency. But we now support per-event freq/period settings. So it'd
better to show more detailed info whether it's freq or period.
$ perf record -e 'cpu/config=1/,cpu/config=2,period=300000/' sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.017 MB perf.data ]
$ perf evlist -F
cpu/config=1/: sample_freq=4000
cpu/config=2,period=300000/: sample_period=300000
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1439102724-14079-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evsel.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f664a22..04fdddd 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2158,8 +2158,13 @@ int perf_evsel__fprintf(struct perf_evsel *evsel,
printed += perf_event_attr__fprintf(fp, &evsel->attr,
__print_attr__fprintf, &first);
} else if (details->freq) {
- printed += comma_fprintf(fp, &first, " sample_freq=%" PRIu64,
- (u64)evsel->attr.sample_freq);
+ const char *term = "sample_freq";
+
+ if (!evsel->attr.freq)
+ term = "sample_period";
+
+ printed += comma_fprintf(fp, &first, " %s=%" PRIu64,
+ term, (u64)evsel->attr.sample_freq);
}
out:
fputc('\n', fp);
next prev parent reply other threads:[~2015-08-12 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-09 6:45 [PATCH 1/2] perf record: Support per-event freq term Namhyung Kim
2015-08-09 6:45 ` [PATCH 2/2] perf evlist: Be more specific on -F/--freq Namhyung Kim
2015-08-09 9:34 ` Jiri Olsa
2015-08-12 12:31 ` tip-bot for Namhyung Kim [this message]
2015-08-09 9:34 ` [PATCH 1/2] perf record: Support per-event freq term Jiri Olsa
2015-08-10 15:44 ` Arnaldo Carvalho de Melo
2015-08-12 12:31 ` [tip:perf/core] " tip-bot for Namhyung Kim
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-4605bb55b91449a1a953a51f0334d3bc02351adb@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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
all inboxes | Powered by JetHome®