From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@redhat.com, tglx@linutronix.de, namhyung@kernel.org,
dsahern@gmail.com, hpa@zytor.com, mingo@kernel.org,
adrian.hunter@intel.com, linux-kernel@vger.kernel.org,
acme@redhat.com
Subject: [tip:perf/core] perf record: Let user have timestamps with per-thread recording
Date: Mon, 6 Jul 2015 09:33:35 -0700 [thread overview]
Message-ID: <tip-3abebc55d70b6e3247d1f0e34c0bb906e40d2a18@git.kernel.org> (raw)
In-Reply-To: <1436183461-1918-1-git-send-email-adrian.hunter@intel.com>
Commit-ID: 3abebc55d70b6e3247d1f0e34c0bb906e40d2a18
Gitweb: http://git.kernel.org/tip/3abebc55d70b6e3247d1f0e34c0bb906e40d2a18
Author: Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Mon, 6 Jul 2015 14:51:01 +0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 6 Jul 2015 08:58:36 -0300
perf record: Let user have timestamps with per-thread recording
If the option -T is used with option --per-thread, then time is still
not sampled. Fix that by using OPT_BOOLEAN_SET to distinguish when the
user used the -T option as opposed to the default case when timestamps
are enabled but only for per-cpu recording.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1436183461-1918-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 4 +++-
tools/perf/perf.h | 1 +
tools/perf/util/evsel.c | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index de165a1..283fe96 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1030,7 +1030,9 @@ struct option __record_options[] = {
OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat,
"per thread counts"),
OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
- OPT_BOOLEAN('T', "timestamp", &record.opts.sample_time, "Record the sample timestamps"),
+ OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
+ &record.opts.sample_time_set,
+ "Record the sample timestamps"),
OPT_BOOLEAN('P', "period", &record.opts.period, "Record the sample period"),
OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples,
"don't sample"),
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 4a5827ff..937b16a 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -51,6 +51,7 @@ struct record_opts {
bool sample_address;
bool sample_weight;
bool sample_time;
+ bool sample_time_set;
bool period;
bool sample_intr_regs;
bool running_time;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 6cc97f3..83c0803 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -707,7 +707,8 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
*/
if (opts->sample_time &&
(!perf_missing_features.sample_id_all &&
- (!opts->no_inherit || target__has_cpu(&opts->target) || per_cpu)))
+ (!opts->no_inherit || target__has_cpu(&opts->target) || per_cpu ||
+ opts->sample_time_set)))
perf_evsel__set_sample_bit(evsel, TIME);
if (opts->raw_samples && !evsel->no_aux_samples) {
prev parent reply other threads:[~2015-07-06 16:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 11:51 [PATCH] " Adrian Hunter
2015-07-06 15:31 ` David Ahern
2015-07-07 7:32 ` Adrian Hunter
2015-07-06 16:33 ` tip-bot for Adrian Hunter [this message]
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-3abebc55d70b6e3247d1f0e34c0bb906e40d2a18@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=hpa@zytor.com \
--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=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
Powered by JetHome