From patchwork Thu Dec 30 07:20:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12701308 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C04DC433F5 for ; Thu, 30 Dec 2021 07:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=di5gK2Nk9ffOK7irvFUj+87uFadBZ+etsL+i+l2CeNU=; b=k/Rk+5C8FisbJuyjAmJALhDN3X UEfuipwh1Hr+X43xaecWP15A5P9Wa/tnuGWXwaNwVvZuz2CjfXcaBP76vkRc9YQov3WSzaXc0k4sH UFsKMGm2JBXFng6GprxoqFgx0Xdny5i9RsaGOcOaCGu7eX3kXwgRP7yl8N21giDNwtjfHKFb+WIZU 6DDBHJSrY8iMGpq8VtPVZRdzzeqSy6ZMRr3eozDqyhkqqi4OtNedbTrr34xiDdIUsaWWa4iy2PV3S I34bnNgQwciov8P47sZrRQfdYeIJKqmnLjx1iCZOdQLGwR++gidWMOKava1qES+vNWbi38/37xp9l NVM0XoTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2qK4-003wio-KS; Thu, 30 Dec 2021 07:58:05 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2plj-003kPy-Ux for linux-arm-kernel@lists.infradead.org; Thu, 30 Dec 2021 07:22:39 +0000 Received: by mail-yb1-xb49.google.com with SMTP id i203-20020a2554d4000000b0060a529902b3so32488804ybb.21 for ; Wed, 29 Dec 2021 23:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=nzKeKFAPBZ6rzV0NFigpy2eDVIi9FKR8HBRsYCkfB/U=; b=UsntoWcISBfoeUdNkLtrkqLUCXuV3C/cSCX/5Y8o/iLgg/RnXmD9ffJx2/3iJFFAiR E9jN91+rDWflo53Ca44K7pMJOnOFdSn/F0o2YdLW+qFnBjEGt9hU4LgsHuHAYvCt09Y+ RVanx7aw6p86GEW39zC3HrZjzIH9ExVTp/GX55VPjF9/WTETfPAiO2OYYhKJ4SORVii/ cnyXDwLHR2X8gx2KccxG9IsjhzQQkzkAt3M+BgAPPrNi4S9jPcVhCACQVNEyLafg6JGY IX6SKhcIaHVeS8g6PfOWxtev4/4/J3ZFoxo9fG9qfjIICMoRZHkA6SXhwN6bVVqXS116 42oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=nzKeKFAPBZ6rzV0NFigpy2eDVIi9FKR8HBRsYCkfB/U=; b=wmPKBxYnswNgtB/7h97uVn7PykjDMbp9/iXMk/tgf4kN9ac0Aj6+M4+Vf6RFSwynU+ BqIO3gbAAXRtz+qUbMkery/m+oJ2B4n3ISwo72NJ9yIincyCnKEqk6377FVQJKWjiZ/A fs8PDGdvcp0WlIHvhC74uecTiQzrwinDM5JpTlfyg/imRfoYa/XiAtMDmB6N4vJZI+c/ qF1/A+mjkQdmailJQt0YAl32iiPDeDGrTURe4lXKDi+OGY70OQkCoP2InztVSQQyNFxW AKQuhiAofMRtRnxK82DiuZAJDYyW0Ye7DhGMdX6TUDQbInsDG4z7WDAfSCYOdHog03Y6 Em3g== X-Gm-Message-State: AOAM531ThBR3CG6S+QR+p5bF9NaoPHaawB17hD8uzLP/ND+K/7RvbPTS DDkc/f2KGvbv3ue+da1ntFcDPXaKXgDL X-Google-Smtp-Source: ABdhPJzuD97DHHQINTddZQ7U07a5i/EHI+5mizcIFnBjhQnvGYZsTgq57fB9oUk9fU7E8+4CAaVUZrl3Zrbf X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:31c4:9539:dba1:a82b]) (user=irogers job=sendgmr) by 2002:a25:cad1:: with SMTP id a200mr22061820ybg.183.1640848954194; Wed, 29 Dec 2021 23:22:34 -0800 (PST) Date: Wed, 29 Dec 2021 23:20:28 -0800 In-Reply-To: <20211230072030.302559-1-irogers@google.com> Message-Id: <20211230072030.302559-48-irogers@google.com> Mime-Version: 1.0 References: <20211230072030.302559-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog Subject: [PATCH v3 46/48] perf script: Fix flipped index and cpu From: Ian Rogers To: Andi Kleen , Jiri Olsa , Namhyung Kim , John Garry , Kajol Jain , "Paul A . Clarke" , Arnaldo Carvalho de Melo , Riccardo Mancini , Kan Liang , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh , James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, zhengjun.xing@intel.com Cc: eranian@google.com, Ian Rogers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211229_232236_068347_201D4224 X-CRM114-Status: GOOD ( 12.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org perf_counts are accessed by the densely packed index. Signed-off-by: Ian Rogers --- tools/perf/builtin-script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index ce9c3c5d881d..935a6edcdcdc 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2131,7 +2131,7 @@ static void __process_stat(struct evsel *counter, u64 tstamp) perf_cpu_map__for_each_cpu(cpu, idx, evsel__cpus(counter)) { struct perf_counts_values *counts; - counts = perf_counts(counter->counts, cpu, thread); + counts = perf_counts(counter->counts, idx, thread); printf("%3d %8d %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %s\n", cpu,