From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751104AbdJBL6k (ORCPT ); Mon, 2 Oct 2017 07:58:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58368 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788AbdJBL6j (ORCPT ); Mon, 2 Oct 2017 07:58:39 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2A0404ACCB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Mon, 2 Oct 2017 13:58:36 +0200 From: Jiri Olsa To: Jin Yao Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH v3 6/6] perf script: support time percent and multiple time ranges Message-ID: <20171002115836.GC16128@krava> References: <1506602721-3784-1-git-send-email-yao.jin@linux.intel.com> <1506602721-3784-7-git-send-email-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506602721-3784-7-git-send-email-yao.jin@linux.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 02 Oct 2017 11:58:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 28, 2017 at 08:45:21PM +0800, Jin Yao wrote: SNIP > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c > index 9092de0..7fd3063 100644 > --- a/tools/perf/builtin-script.c > +++ b/tools/perf/builtin-script.c > @@ -1357,6 +1357,8 @@ static void print_sample_synth(struct perf_sample *sample, > } > } > > +#define PTIME_RANGE_MAX 10 > + > struct perf_script { > struct perf_tool tool; > struct perf_session *session; > @@ -1370,6 +1372,8 @@ struct perf_script { > int name_width; > const char *time_str; > struct perf_time_interval ptime; > + struct perf_time_interval ptime_range[PTIME_RANGE_MAX]; > + int range_num; > }; > > static int perf_evlist__max_name_len(struct perf_evlist *evlist) > @@ -1565,8 +1569,11 @@ static int process_sample_event(struct perf_tool *tool, > struct perf_script *scr = container_of(tool, struct perf_script, tool); > struct addr_location al; > > - if (perf_time__skip_sample(&scr->ptime, sample->time)) > + if (perf_time__skip_sample(&scr->ptime, sample->time) || > + perf_time__ranges_skip_sample(scr->ptime_range, scr->range_num, > + sample->time)) { any reason for why dont use ptime_range[1] with range_num = 1 and use just a single call here? jirka