Skip to content

Commit 8affc2b

Browse files
Andi Kleenacmel
authored andcommitted
perf record: Honour --no-time command line option
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, honouring the existing option. The defaults are unchanged. Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1406789104-25863-10-git-send-email-zheng.z.yan@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent b048a24 commit 8affc2b

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎tools/perf/builtin-record.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ static const char * const record_usage[] = {
781781
*/
782782
static struct record record = {
783783
.opts = {
784+
.sample_time = true,
784785
.mmap_pages = UINT_MAX,
785786
.user_freq = UINT_MAX,
786787
.user_interval = ULLONG_MAX,

‎tools/perf/util/evsel.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,12 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
633633
if (opts->period)
634634
perf_evsel__set_sample_bit(evsel, PERIOD);
635635

636-
if (!perf_missing_features.sample_id_all &&
637-
(opts->sample_time || !opts->no_inherit ||
638-
target__has_cpu(&opts->target) || per_cpu))
636+
/*
637+
* When the user explicitely disabled time don't force it here.
638+
*/
639+
if (opts->sample_time &&
640+
(!perf_missing_features.sample_id_all &&
641+
(!opts->no_inherit || target__has_cpu(&opts->target) || per_cpu)))
639642
perf_evsel__set_sample_bit(evsel, TIME);
640643

641644
if (opts->raw_samples && !evsel->no_aux_samples) {

0 commit comments

Comments
 (0)