All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 10/11] perf record: Let user have timestamps with per-thread recording
Date: Mon,  6 Jul 2015 12:41:30 -0300	[thread overview]
Message-ID: <1436197291-21625-11-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1436197291-21625-1-git-send-email-acme@kernel.org>

From: Adrian Hunter <adrian.hunter@intel.com>

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 de165a1b9240..283fe96bdfc1 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 4a5827fff799..937b16aa0300 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 6cc97f37887d..83c08037e7e2 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) {
-- 
2.1.0


  parent reply	other threads:[~2015-07-06 15:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 15:41 [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-07-06 15:41 ` Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 01/11] perf tools: Asprintf like functions to format integer filter expression Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 02/11] perf trace: Remember what are the syscalls tracepoint evsels Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 03/11] perf trace: Store the syscall ids for the event qualifiers in a table Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 04/11] perf evsel: Rename set_filter to apply_filter Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 05/11] perf evsel: Introduce set_filter method Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 06/11] perf evlist: Make perf_evlist__set_filter use perf_evsel__set_filter Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 07/11] perf evsel: Introduce append_filter() method Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 08/11] perf trace: Use event filters for the event qualifier list Arnaldo Carvalho de Melo
2015-07-06 15:41 ` [PATCH 09/11] perf probe: Delete an unnecessary check before the function call "strfilter__delete" Arnaldo Carvalho de Melo
2015-07-06 15:41   ` Arnaldo Carvalho de Melo
2015-07-06 15:41 ` Arnaldo Carvalho de Melo [this message]
2015-07-06 15:41 ` [PATCH 11/11] tools lib api debugfs: Check for tracefs when reporting errors Arnaldo Carvalho de Melo
2015-07-06 15:47 ` [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar
2015-07-06 15:47   ` Ingo Molnar

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=1436197291-21625-11-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.