From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A447FC433EF for ; Mon, 23 May 2022 12:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235771AbiEWMzF (ORCPT ); Mon, 23 May 2022 08:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235777AbiEWMzE (ORCPT ); Mon, 23 May 2022 08:55:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E1B152E7E; Mon, 23 May 2022 05:55:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 109B2B810AC; Mon, 23 May 2022 12:55:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 912AFC385A9; Mon, 23 May 2022 12:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653310499; bh=VL29GRANyhn2Yf22h7xWxr8NCXCPQBgciy3yLY8dyEc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gwou/P4SObZx4pE88EhIO5qDrF33vuU9h8oEaYoy1v1ypY3KKQsuPfCxmZR2LozP6 zp1T7rXjl8BVJX7MlMhJbd7P8MSN7O6QlIQs9Ph4fTWlkLApN/sARmBjqDc+JJbJLw a6P3ZkGIbAX7S5JzX8N23PEaYoaphq0KS92U4EhyzwrdZhxFdDYdwYeZgjycMx5tKG PjH9V+cpX93p6BhPwLLE0C+DP62k4+q6EToukbzs9KchPGqynaI9NmPjcdr/HftN5a eQI/rqDnr2pltEfmjMt+gHtV7tNJJVaRlC72fYpA+4p2hrTcmuepey7JTx5da/Sg58 pGv7t5MWhFjog== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 1250C400B1; Mon, 23 May 2022 09:54:57 -0300 (-03) Date: Mon, 23 May 2022 09:54:57 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Michael Petlan , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , James Clark , Kan Liang , Quentin Monnet , Dave Marchevsky , Zhengjun Xing , Lv Ruyi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Stephane Eranian Subject: Re: [PATCH 0/5] perf_counts clean up and perf stat report bug fix Message-ID: References: <20220519032005.1273691-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220519032005.1273691-1-irogers@google.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Wed, May 18, 2022 at 08:20:00PM -0700, Ian Rogers escreveu: > perf_counts takes a CPU map index as an argument, however, there were > a few places where this hadn't been cleaned up and the index was > called cpu. In part this led to the bug discovered by Michael Petlan in: > https://lore.kernel.org/linux-perf-users/CAP-5=fWQR=sCuiSMktvUtcbOLidEpUJLCybVF6=BRvORcDOq+g@mail.gmail.com/ > > Fix the bug, tidy up more of the arguments passed to perf_counts, add > a test to ensure the bug isn't reintroduced and add a helper macro to > iterate over just CPU map indices. Applied 2-5 to perf/core. The first is already in 5.18 Thanks, - Arnaldo > Ian Rogers (5): > perf stat: Fix and validate inputs in stat events > perf stat: Add stat record+report test > perf cpumap: Add perf_cpu_map__for_each_idx > perf bpf_counter: Tidy use of CPU map index > perf stat: Make use of index clearer with perf_counts > > tools/lib/perf/include/perf/cpumap.h | 3 ++ > tools/perf/tests/shell/stat.sh | 13 ++++++ > tools/perf/util/bpf_counter.c | 61 ++++++++++++++++------------ > tools/perf/util/stat-display.c | 22 +++++----- > tools/perf/util/stat.c | 27 ++++++++---- > 5 files changed, 81 insertions(+), 45 deletions(-) > > -- > 2.36.1.124.g0e6072fb45-goog -- - Arnaldo