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 3C759C433EF for ; Tue, 3 May 2022 04:18:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbiECEVg (ORCPT ); Tue, 3 May 2022 00:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230478AbiECEVf (ORCPT ); Tue, 3 May 2022 00:21:35 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59A9938D89 for ; Mon, 2 May 2022 21:18:03 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id b33-20020a25aea1000000b0064588c45fbaso9435245ybj.16 for ; Mon, 02 May 2022 21:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=ee22ixTfu/Bo012jZkIOZL6TsTz0iHERQm9vZ3yNsWA=; b=c8+KF+puppDi7Lwvw69cneahhD++zr4NEDsXpTi/mbLS2AKKBkP449Kc0H39TfyusD rGS7nYvVmd0IO++AvCmX3pwBA21d4FbnMDE+VHfCtJDbnWAzYuehEE/jD28a+rtTw1WS ux/R151hvTK6KMNEpsZMRByIeNXPleMidgeoi1A26GnIOX77Jrfjr+7cAmoaykr/XiGb hCCw7mEmiFsufy129uTPQh49ZFjArF4+VwTzMUBr3swQ7kiyI1lU+H6YmfdN+Q1dH0TX iaEeKu8mDoIgeZXpn8zCMLnup4qF04jTxjPmo/dPc/jwWPFaEaMHkx9CJXsKFdbdgtkt Hcvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=ee22ixTfu/Bo012jZkIOZL6TsTz0iHERQm9vZ3yNsWA=; b=g4zMJmm+vXhbla0fzNFwr9dytH6p1vyDVpMbLEBzbDf8oXNMUTN6zbZmzfWfFyc7cX xeV58GQ/zEgDzH/uOzuy0WASx3UG2TzJ3R4OzpD3PJnsUdH6YkaDJJMiqOwXRAVJAr04 zierzyzfrTu0UA/N4N7j2PNgrbAckoVOuObrRXiLZXme6cwDZDpvJrBHydlSD1StLaz+ 9nJgJ4rY8u3bTk4Ajel91q2FtiWtL2+8STYgduz9Unfk/Rc3lC0V57+QtyYl+fi2OlKY C64B3bWCQMCmLjYNlCB8pXl3qQ+CV6/jANdgfpKqhwFpXckw33dppGkxVO4PW1EYHtHA fzGw== X-Gm-Message-State: AOAM530o+P0f7Ys2WotPDW7OhaXQPKG1shpSPpLg9KAn/OvxHFnF/fMx QEiPS2TGtILt/Xx5a23ILXqrfUWFfQq3 X-Google-Smtp-Source: ABdhPJxBNoT4Bgk+Mh2KRGQMD1T6e9TCCImbP6hv4oF9fx/eapszNDXOvROriMl8LV1gxKC/gKQTBSZfJQws X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:dd4b:52bb:771d:7bb4]) (user=irogers job=sendgmr) by 2002:a25:4944:0:b0:648:a796:a2 with SMTP id w65-20020a254944000000b00648a79600a2mr13187740yba.123.1651551482390; Mon, 02 May 2022 21:18:02 -0700 (PDT) Date: Mon, 2 May 2022 21:17:51 -0700 Message-Id: <20220503041757.2365696-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog Subject: [PATCH v5 0/6] Make evlist CPUs more accurate From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Kajol Jain , James Clark , German Gomez , Adrian Hunter , Riccardo Mancini , Andi Kleen , Alexey Bayduraev , Alexander Antonov , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Based on the thread: https://lore.kernel.org/linux-perf-users/CAP-5=fVMHzTfKdpWMXtbtx7t14u2f4WzNak+F0Q93cQ7CZfhbg@mail.gmail.com/ First patch is a cherry-pick to avoid a conflict of: https://lore.kernel.org/linux-perf-users/20220414014642.3308206-2-irogers@google.com/ Second patch makes all_cpus more accurate when there are command line CPUs. The third patch fixes perf stat metric-only output for uncore metrics. The fourth patch makes cleans up merging of dummy CPU maps. The fifth and sixth patch try to make user_requested_cpus and all_cpus clearer with documentation and by renaming all_cpus. The code no longer needs to add an intersect function and so the API is removed and the merged API left unchanged. v5. Fixes the 1st patch as pointed out by Namhyung Kim , adds some further clean-up to it and adds reviewed-by Adrian Hunter to patch 3. Ian Rogers (6): perf cpumap: Switch to using perf_cpu_map API perf evlist: Clear all_cpus before propagating perf stat: Avoid printing cpus with no counters perf cpumap: Handle dummy maps as empty in subset perf evlist: Add to user_requested_cpus documentation perf evlist: Rename all_cpus tools/lib/perf/cpumap.c | 4 +-- tools/lib/perf/evlist.c | 14 +++++--- tools/lib/perf/include/internal/evlist.h | 5 +-- tools/perf/builtin-record.c | 13 +++---- tools/perf/tests/cpumap.c | 10 +++++- tools/perf/util/bpf_counter_cgroup.c | 46 +++++++++++------------- tools/perf/util/evlist.c | 6 ++-- tools/perf/util/evlist.h | 4 +-- tools/perf/util/stat-display.c | 7 ++-- 9 files changed, 60 insertions(+), 49 deletions(-) -- 2.36.0.464.gb9c8b46e94-goog