From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751468AbdKUV23 (ORCPT ); Tue, 21 Nov 2017 16:28:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41990 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbdKUV21 (ORCPT ); Tue, 21 Nov 2017 16:28:27 -0500 Date: Tue, 21 Nov 2017 22:28:25 +0100 From: Jiri Olsa To: Andi Kleen Cc: Andi Kleen , acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/3] perf, tools, script: Allow computing metrics in perf script Message-ID: <20171121212825.GB28582@krava> References: <20171117214300.32746-1-andi@firstfloor.org> <20171117214300.32746-4-andi@firstfloor.org> <20171120090419.GB5684@krava> <20171120153505.GJ2482@two.firstfloor.org> <20171120155345.GB13495@krava> <20171120160306.GG28112@tassilo.jf.intel.com> <20171121092806.GA25279@krava> <20171121170714.GI28112@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171121170714.GI28112@tassilo.jf.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.25]); Tue, 21 Nov 2017 21:28:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 21, 2017 at 09:07:14AM -0800, Andi Kleen wrote: > On Tue, Nov 21, 2017 at 10:28:06AM +0100, Jiri Olsa wrote: > > On Mon, Nov 20, 2017 at 08:03:06AM -0800, Andi Kleen wrote: > > > > > Yes it is. > > > > > > > > > > It's for the complete sampling period because it is computed > > > > > over the delta from the last sample to the previous sample. > > > > > > > > > > There isn't really a metric at a point, it is always over a interval. > > > > > > > > agreed, it's the count we meassured from the last sample.. but the > > > > 'averaged' word above implies to me we compute some average over the > > > > 'sampling' period, which we dont do > > > > > > Do you have a better word in mind? > > > > > > AFAIK average is the right word for this because it's the summary > > > for that time period. > > > > the way I understand it is that we take the values from the current > > sample and count the metric value.. so the phrase: > > > > .. the metric computed is averaged over the whole sampling period, > > not just for the sample point ... > > > > does not make sense to me.. because we take the value of that > > single 'sample point'.. I dont see any average sum in there > > The current samples contains the sum of event counts for a sampling period. > > EventA-1 EventA-2 EventA-3 EventA-4 > EventB-1 EventB-2 EventC-3 > > gap with no events overflow > |-----------------------------------------------------------------| > period-start period-end > ^ ^ > | | > previous sample current sample > > > So EventA = 4 and EventB = 3 at the sample point > > I generate a metric, let's say EventA / EventB. It applies > to the whole period. > > But the metric is over a longer time which does not have the same > behavior. For example the gap above doesn't have any events, while > they are clustered at the beginning and end of the sample period. > > But we're summing everything together. The metric doesn't know > that the gap is different than the busy period. > > That's what I'm trying to express with averaging. I see, so averaging to express the sum of the uneven distribution of the counts.. ook thanks for bearing with me ;-) jirka