From patchwork Thu Dec 30 07:20:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12701297 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 0D753C433F5 for ; Thu, 30 Dec 2021 07:49:18 +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=V54Dc74eY9F8kn7HzOUHG/qlVYdLTYbTXxOl3zvjt5c=; b=2B38o98+srrSsJrsTK9o6cMKxI QQ41CAe6tj4LDcdX/CSyVYOnauDITR6/MX7Uy/nsMUz6c1KCjgWkU+WjClsxmYceiBWwtCkn2SZOg fDs2rI3vYI08IasQACcR7elcwJgmYxVQj5FVeieYG8Z1np4nrZaltaxK82RaNCJfv+uaanCpJbcUg eSc9g0pnDC74K9IdyBlxhN3mqSYurDmqu9DQZo9T6AHT23nxIwccNuOs904UDdubLeBI/bD980GwB qyZ6+WY2VHDQqcv297DQgtXo8g0YbS3woUYhSHO9ReIGAO+YgPjcskTKEqCsrp55Z0bKrUJqr9CmL Gn+rs04g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2qA5-003tFR-0w; Thu, 30 Dec 2021 07:47:45 +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 1n2plH-003k8i-Nm for linux-arm-kernel@lists.infradead.org; Thu, 30 Dec 2021 07:22:09 +0000 Received: by mail-yb1-xb49.google.com with SMTP id s84-20020a254557000000b0060ac37f4bb1so29562033yba.5 for ; Wed, 29 Dec 2021 23:22:06 -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=dr21UIWlWh08GpstPSt0DXreHsY1rvRjUlHXGQMgUUQ=; b=EzlOdQL0P3mQ5LLCjUBdScAdR4k8fbx3t1xiYbAGiLzrvhfYRNamUq3myYjTNbMt1z z1iM60q9zjlaQAcoCGdA/MylPvkoXxci2/mhvMITTMVzxFMmy1kLRBKwKSdlzO0kFLac rmX36ofvYh41GcgwoFMXtS3/igsv10WDIviUoefVvtAGryPH4lySTaSqzi51hQVUXRp+ ocpdbQPHx5fHXPwVKhz5QvLiwYbqfx4x5Q5vidzBlB7alneeRNnVq+/RWxS64bjPHZdY MsTjekbO8bobE8pPkFVDaDAAyl1NvvRu7QWxrniO69RQBLBeqhVDpkbID3vcTO0EI6LS iryQ== 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=dr21UIWlWh08GpstPSt0DXreHsY1rvRjUlHXGQMgUUQ=; b=TB8xvrRn9PTjzbdFxwTUfhkR6UqUK4gNir979Ci+9zhMvv5Wg91o0duwX8o8+IvNhA XRRPagE9JqFIHPfRUMQjzbY/rDMvSWa90bPglHBRN4t5Gg2k5NHIHSsYkAqnX3Dr56h+ 4/O7X5yEj8WwtFatp8iRjueKKapvvMh8Req1wU9h+BM8rLHgoFSlkUuHvi4MY4+sQH8L JHL8Lv2ST72wTXvJq6sF1ZllM10T31ZHFfkbBcSORffWlHuuRzmSdSy+ghDE0N2ez/sd QzfFSftgG4Gwq8Wm0mK8q3yOhNwMRnm8UXfVeoAdcdVabslMs4IOi30utv309pSglHC1 Wk2w== X-Gm-Message-State: AOAM53148jywVOfxkXjmfJnFpMTk4HjibnroETh3waZ73yscC0TfINB7 aQBSRq2WHXM+NOaKO2e1DG6lugYcu2+N X-Google-Smtp-Source: ABdhPJyRfLGpoQ9H9fJ2Morzmd7n7bmZUL51X8hObRibMpoPCIExOKmteY86oNxmXqhmcVFjCo2lIJ4u9b0N X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:31c4:9539:dba1:a82b]) (user=irogers job=sendgmr) by 2002:a25:7287:: with SMTP id n129mr36420396ybc.351.1640848926039; Wed, 29 Dec 2021 23:22:06 -0800 (PST) Date: Wed, 29 Dec 2021 23:20:17 -0800 In-Reply-To: <20211230072030.302559-1-irogers@google.com> Message-Id: <20211230072030.302559-37-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 35/48] perf evsel: Pass cpu not cpu map index to synthesize 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_232207_851508_36F74431 X-CRM114-Status: GOOD ( 12.48 ) 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 evsel__write_stat_event was incorrectly passing a cpu map index rather than a CPU to perf_event__synthesize_stat. Signed-off-by: Ian Rogers --- tools/perf/builtin-stat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index f31bc34bd4cc..ec252579b587 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -327,10 +327,11 @@ static int write_stat_round_event(u64 tm, u64 type) #define SID(e, x, y) xyarray__entry(e->core.sample_id, x, y) -static int evsel__write_stat_event(struct evsel *counter, u32 cpu, u32 thread, +static int evsel__write_stat_event(struct evsel *counter, int cpu_map_idx, u32 thread, struct perf_counts_values *count) { - struct perf_sample_id *sid = SID(counter, cpu, thread); + struct perf_sample_id *sid = SID(counter, cpu_map_idx, thread); + int cpu = perf_cpu_map__cpu(evsel__cpus(counter), cpu_map_idx); return perf_event__synthesize_stat(NULL, cpu, thread, sid->id, count, process_synthesized_event, NULL);