From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86D1720DD79 for ; Fri, 10 Jan 2025 15:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736521874; cv=none; b=iNjRqTOfrmmG0JdNihN+p9Us1qP0PvnVL9lGCCB2XRRMp5ES0TiTJIm/+D/IFDfZ97i9u0uyYOaLTn9ZMpGx4YqYlgkFhLlVOUaJQGIg1mrKJUifl2FhHigRqQpwK14pJfzDQAl6ONB+9XEn6jowtNWtqBHFUqdDxN2Ch8czC6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736521874; c=relaxed/simple; bh=fBtxHDseE7pX1JFiiIw30h4s/j/FhtCbTciY4vyNYAQ=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=uZx1fohOlo6H35OVS2DVK33ig21u/QmtVOBfdDkTkq+cTnXeBDIvB3wfCFYX55vOb8Rcoc6/uWRtDjCkPKVW2A4C1cdTxIN04bgovRK6YuCJX3NWagBZVUxp2fOo4yf0Fog6ijnyYiqBr2JfQWkGQBIm1Uukr2lLwH+DpG3xSF4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LxRhwGOM; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LxRhwGOM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736521871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=fBtxHDseE7pX1JFiiIw30h4s/j/FhtCbTciY4vyNYAQ=; b=LxRhwGOMDP4Md7bM3w1+Y0xlty4vwdgMa7QickaTUMSKqSzICLE0d/2p3aylryBrsu4QWB ws44bI2oQA/6Mii5lvTOerw+skA1tJUtQXWUmKt4MeGERAeqsokUdG/xTRH7W4OQ90sw9j GBkkUffHi48K8MMGxXfKr5ke66xEjec= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-211-B9fzAh8GOtGrR_Xkf1r38A-1; Fri, 10 Jan 2025 10:11:10 -0500 X-MC-Unique: B9fzAh8GOtGrR_Xkf1r38A-1 X-Mimecast-MFC-AGG-ID: B9fzAh8GOtGrR_Xkf1r38A Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-386321c8f4bso1480977f8f.0 for ; Fri, 10 Jan 2025 07:11:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736521868; x=1737126668; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fBtxHDseE7pX1JFiiIw30h4s/j/FhtCbTciY4vyNYAQ=; b=O3AyqjSHyrtAihCN56M6R9ED8cSS1LLcXYzr2Xt/cSiRlD+FFvHILvHbb9SwJ/SMj8 k6XTomXIqUiqwoEKCkuDQwkldevommHxW7ax34OAJQY4vA7intOHdGdxCKhxk9k1dbJQ RN7fzp7yZDC2xjYqSEq3ChHntOUew6iXKdYyW1xy0n1ogFFVMOQtNab6Hp0Ebarx4roC qiWTsjaBf474kkGyRQBkkAmqVIFUwDtYjgBtljT5F3iVC2RsiztBVWDKK3cPeKjB5+h+ ocVWY7sXePbuBinQASN6zG+tJRjw2F/NcbgEYOgpo2uimInZ0ECKUmliPcf+Do1FIwzb xSDw== X-Forwarded-Encrypted: i=1; AJvYcCX8o/619fMKvZV4mOl4aurQ2Rqyt3aD85izx1fEBOER3Ntpv9TQ2SfcM62Ggemqag3Xi5ayQLlEOEsM3+I=@vger.kernel.org X-Gm-Message-State: AOJu0Yzcn0DZU/C+AgekXGRgGyk0i92lJdpx2Yz1afUJTJ3baqFzG1Op xsDKaBFS5UAVsOF7wDMv/5XchjY0uMH2OMqaCqoxSHJ964YMS8mVmAOIUw8jL5uXNc6OJcnlV8J 7nhPp8u0YYtK1+x+BLgAUCpYJ8l3R5MWEWh2UlHJAFF+2AKtz5dw/3VaDK6GNiIH7E23wZAwE X-Gm-Gg: ASbGncsxzZREhODrzpVuGZFV7Dve7twZoHI2+Mh60IFJObkk+4DTu4KErBZL7bKfpTc Fl6Yo6wcdmskZ+OHUSoJhnTUonJIxXaTEmR4D0l9iwgD/gXginPRL4tnai2f09S7AZVi3jvlzNZ Bw2aq4H+uQQmFnwWa3QvzSKXuaL5tx9Rg85fmxy2KfgzbTFAAS9o+fl6AyhbIcPbRuLrRYp2/xD SfDVoQJi16wJAoRlIg+B8GA7E8CwNOdb0/jSbUUh+RVXBMCBBQl6+EmX6VI+8ZaMIHDS1nnDFFS ZFn7DT0= X-Received: by 2002:a05:6000:1a8c:b0:385:e176:4420 with SMTP id ffacd0b85a97d-38a872fc261mr10299010f8f.10.1736521868686; Fri, 10 Jan 2025 07:11:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxREE6mTpseXK/ypN3wX8QUqL2Tj0EYQN5GiON0BLkUx0dsFbjASjpylvSWEKJ9BTHpfmTkg== X-Received: by 2002:a05:6000:1a8c:b0:385:e176:4420 with SMTP id ffacd0b85a97d-38a872fc261mr10298986f8f.10.1736521868334; Fri, 10 Jan 2025 07:11:08 -0800 (PST) Received: from gmonaco-thinkpadt14gen3.rmtit.csb ([185.107.56.40]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1f2esm4768279f8f.98.2025.01.10.07.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 07:11:07 -0800 (PST) Message-ID: <2ce46fa93b5c33491797e97c6995759b4ed31da4.camel@redhat.com> Subject: Re: [PATCH 1/2] perf ftrace: Check min/max latency only with bucket range From: Gabriele Monaco To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Ian Rogers , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Date: Fri, 10 Jan 2025 16:11:05 +0100 In-Reply-To: References: <20250108210015.1188531-1-namhyung@kernel.org> <0ef32d5e-594a-43a4-ae5c-e8ad05a2d320@redhat.com> Autocrypt: addr=gmonaco@redhat.com; prefer-encrypt=mutual; keydata=mDMEZuK5YxYJKwYBBAHaRw8BAQdAmJ3dM9Sz6/Hodu33Qrf8QH2bNeNbOikqYtxWFLVm0 1a0JEdhYnJpZWxlIE1vbmFjbyA8Z21vbmFjb0ByZWRoYXQuY29tPoiZBBMWCgBBFiEEysoR+AuB3R Zwp6j270psSVh4TfIFAmbiuWMCGwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgk Q70psSVh4TfJzZgD/TXjnqCyqaZH/Y2w+YVbvm93WX2eqBqiVZ6VEjTuGNs8A/iPrKbzdWC7AicnK xyhmqeUWOzFx5P43S1E1dhsrLWgP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.2 (3.54.2-1.fc41) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2025-01-10 at 11:03 -0300, Arnaldo Carvalho de Melo wrote: > On Fri, Jan 10, 2025 at 10:09:14AM +0000, Gabriele Monaco wrote: > > 2025-01-10T00:46:49Z Namhyung Kim : > >=20 > > > On Thu, Jan 09, 2025 at 08:53:02AM +0100, Gabriele Monaco wrote: > > > > On Wed, 2025-01-08 at 13:00 -0800, Namhyung Kim wrote: > > > > > It's an optional feature and remains 0 when bucket range is > > > > > not > > > > > given. > > > > > And it makes the histogram goes to the last entry always > > > > > because any > > > > > latency (num) is greater than or equal to 0. > > > >=20 > > > > Thanks Namhyung for fixing this, something definitely slipped > > > > while > > > > testing.. > > > >=20 > > > > I confirm your patches work well also when the bucket range is > > > > provided but the > > > > min latency isn't. > > > >=20 > > > > I'm wondering if it would be cleaner to propagate your changes > > > > (using > > > > min/max latency only if bucket_range is provided) also to > > > > make_histogram. That function currently works since we assume > > > > min_latency to be always 0, which is the case but probably not > > > > considering it altogether would look a bit better and prevent > > > > some > > > > headache in the future. > > >=20 > > > It looks good.=C2=A0 One thing I concern is 'num +=3D min_latency' > > > before > > > do_inc.=C2=A0 I put it there to make it symmetric to 'num -=3D > > > min_latency' > > > so it should go to inside the block too. > > >=20 > > > Or you could factor it out as a function like 'i =3D > > > get_bucket_index(num)' > > > so that it can keep the original num for the stats. > > >=20 > >=20 > > Good point, I can have a deeper look at that. But I'd say it can > > come as a cleanup patch later. > > I have a couple more changes in mind and this would be no longer > > related to your changes. >=20 > I'm tentatively taking this as an: >=20 > Acked-by: Gabriele Monaco >=20 > But it would be great to have it as a Reviewed-by and perhaps a > Tested-by, provided explicitely in response to this thread, ok? >=20 > Thanks, >=20 > - Arnaldo >=20 I did test after applying both patches, went through the code and confirm my test worked as expected, and I confirm the issue is there before patching. I tested also in between, so feel free to add to both patches: Reviewed-by: Gabriele Monaco Tested-by: Gabriele Monaco (I'm assuming you are referring to 1/2 and 2/2 and not the little patch I sent in the first answer) Thanks, Gabriele