Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933018AbbGSTN1 (ORCPT ); Sun, 19 Jul 2015 15:13:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37884 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932392AbbGSTNZ (ORCPT ); Sun, 19 Jul 2015 15:13:25 -0400 Date: Sun, 19 Jul 2015 21:13:22 +0200 From: Jiri Olsa To: Namhyung Kim Cc: kan.liang@intel.com, acme@kernel.org, jolsa@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC V5 2/4] perf,tool: per-event time support Message-ID: <20150719191322.GA27893@krava.brq.redhat.com> References: <1437132655-15883-1-git-send-email-kan.liang@intel.com> <1437132655-15883-3-git-send-email-kan.liang@intel.com> <20150718124547.GA3759@krava.brq.redhat.com> <20150719032128.GA24219@danjae.kornet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150719032128.GA24219@danjae.kornet> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3181 Lines: 77 On Sun, Jul 19, 2015 at 12:21:28PM +0900, Namhyung Kim wrote: SNIP > > > > [jolsa@krava perf]$ ./perf record -e 'cpu/cpu-cycles/,cpu/instructions,time/' kill > > ... > > [jolsa@krava perf]$ ./perf evlist -v > > cpu/cpu-cycles/: type: 4, size: 112, config: 0x3c, { sample_period, sample_freq }: 4000, sample_type: IP|TID|PERIOD|IDENTIFIER, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1 > > cpu/instructions,time/: type: 4, size: 112, config: 0xc0, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD|IDENTIFIER, read_format: ID, disabled: 1, inherit: 1, freq: 1, enable_on_exec: 1, sample_id_all: 1, exclude_guest: 1 > > What about this case? > > $ perf record -e 'cpu/cpu-cycles/,cpu/instructions,time=0/' kill right.. hum, we need somehow separate/pospone the users term application to the final perf_event_attr.. spent some time on it today, but could not find any nice solution so far.. will try tomorrow ;-) SNIP > > + * If time (-T) is not set and we have events with TIME sample_type > > + * set (tracepoints or events with time term), disable timestamp for > > + * the rest of the events. > > + */ > > + if (!opts->sample_time_set && perf_evlist__has_time(evlist)) > > + opts->sample_time = false; > > I think it'd be better if the -T/--timestamp option gives the default > TIME sample_type value but it can be overridden by per-event setting. > > I mean: > > (per-event 'time' setting is meaningless here) > $ perf record -e 'cpu/cpu-cycles/,cpu/instructions,time/' kill > > $ perf evlist -v > cpu/cpu-cycles/: ..., sample_type: IP|TID|TIME|PERIOD|IDENTIFIER, ... > cpu/instructions,time/: ..., sample_type: IP|TID|TIME|PERIOD|IDENTIFIER, ... > > > (adding -T option, same as the default) > $ perf record -T -e 'cpu/cpu-cycles/,cpu/instructions,time/' kill > > $ perf evlist -v > cpu/cpu-cycles/: ..., sample_type: IP|TID|TIME|PERIOD|IDENTIFIER, ... > cpu/instructions,time/: ..., sample_type: IP|TID|TIME|PERIOD|IDENTIFIER, ... > > $ perf record -T -e 'cpu/cpu-cycles/,cpu/instructions,time=0/' kill > > $ perf evlist -v > cpu/cpu-cycles/: ..., sample_type: IP|TID|TIME|PERIOD|IDENTIFIER, ... > cpu/instructions,time/: ..., sample_type: IP|TID|PERIOD|IDENTIFIER, ... > > > (adding --no-timestamp option) > $ perf record --no-timestamp -e 'cpu/cpu-cycles/,cpu/instructions/' kill > > $ perf evlist -v > cpu/cpu-cycles/: ..., sample_type: IP|TID|PERIOD|IDENTIFIER, ... > cpu/instructions,time/: ..., sample_type: IP|TID|PERIOD|IDENTIFIER, ... > > $ perf record --no-timestamp -e 'cpu/cpu-cycles/,cpu/instructions,time=1/' kill > > $ perf evlist -v > cpu/cpu-cycles/: ..., sample_type: IP|TID|PERIOD|IDENTIFIER, ... > cpu/instructions,time/: ..., sample_type: IP|TID|TIME|PERIOD|IDENTIFIER, ... agreed thanks, jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/