Skip to contentSkip to conversation

tools, perf: Allow the user to disable time stamps

PATCH New Andi Kleen 1 participant 1 message Mar 25, 2014 perf events

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 tools, perf: Allow the user to disable time stamps

From: Andi Kleen <[email protected]>

Time stamps are always implicitely enabled for record currently. The old --time/-T option is a nop.

Allow the user to disable timestamps by using --no-time

This can cause some minor misaccounting (by missing mmaps), but significantly lowers the size of perf.data

The defaults are unchanged.

---
 tools/perf/builtin-record.c | 1 +
 tools/perf/util/evsel.c     | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
tools/perf/builtin-record.c +1 -0
index 3c394bf..8e92d3c 100644
@@ -800,6 +800,7 @@ static const char * const record_usage[] = {
  */
 static struct record record = {
 	.opts = {
+		.sample_time	     = true,
 		.mmap_pages	     = UINT_MAX,
 		.user_freq	     = UINT_MAX,
 		.user_interval	     = ULLONG_MAX,
tools/perf/util/evsel.c +6 -3
index 22e18a2..a15efc4 100644
@@ -613,9 +613,12 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
 	if (opts->period)
 		perf_evsel__set_sample_bit(evsel, PERIOD);
 
-	if (!perf_missing_features.sample_id_all &&
-	    (opts->sample_time || !opts->no_inherit ||
-	     target__has_cpu(&opts->target) || per_cpu))
+	/*
+	 * When the user explicitely disabled time don't force it here.
+	 */
+	if (opts->sample_time &&
+	    (!perf_missing_features.sample_id_all &&
+	    (!opts->no_inherit || target__has_cpu(&opts->target) || per_cpu)))
 		perf_evsel__set_sample_bit(evsel, TIME);
 
 	if (opts->raw_samples) {
Signature · 1 line
1.8.5.3