Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3112128lqo; Tue, 14 May 2024 23:02:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzTc2OANPerv2/UYx6ITcU2We9LTC3xMWVpz48M/iD/XHfjd6O47RJR7qcNnNLvGUzjM2BRc1QO0DRYFXjj0F7O9PCOBZVYhH/lKqIiQ== X-Google-Smtp-Source: AGHT+IFIB6Wys510KPYNyzYqdWDk2hbgxf3Jp0KtsFnZIptEJARhb+VFoHNpe/8J5Sql0U4sJvyx X-Received: by 2002:a50:d599:0:b0:574:eb43:3862 with SMTP id 4fb4d7f45d1cf-574eb43395cmr1960870a12.5.1715752927692; Tue, 14 May 2024 23:02:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715752927; cv=pass; d=google.com; s=arc-20160816; b=NU1zlz1JquMnBwc9Ws+57he6ULA+jSTUvOE1wAMWccQGiYrRQRNIW1oY+b+NTDBIK1 urQiX6iBxhJOc0VXaCIDb4OIRw4k7zL00ZfsIII2bHHG9ZsOXyb32G8fT7HJjkllMmW4 +utIxoQ3UVo1Kqn+UTC6Cs+Jd26X9E5E263uaPGNLzJ5OfSD9ddtrHT9UKKntEKpQWpy kP9yVwQBMkwSGphYOgpWyFvRm8yQHyB0BspnWhz+nnmowKpAoMbBiGGsu/Gu3SQRJgtI C2D+fPqxeLQUMwapkMSw+ouhT0WBGt70xA2NuUKo5EnG1eoMQ9bWJ6HkBiIz8SaBREhG T6Tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date:dkim-signature; bh=X4R5s9OJ/uGB6XbGrKz0Wv7rjDRBvcB0bapwlYPxoLM=; fh=6TpC1UMxy/mo2OgwvAoCKlsafg/IJnGLHll3iXj0m/w=; b=LJ3tHfQKhmrVeixnep7Ll7aHZrw/OvX0xWBTdNGy7egfo3oAZ02jsagZCiTlNG2obJ /Ef8uWXosIimTOK7X7QRwIL9++u/Xkc1duAL2M7rkAIqThB5wbg+5N+Pm2s6vLLRyKB2 BxhM4llK6RH4qnUrN1dzhTnlFiIyXTNXpYXO8omr9ENJmwJ7qyG8oSgXW7PdBjbRJ/Sr rQm08/k50/vblya6vXU1oDM8DEKXdYa0i8w7DVawGM5hjCYLYN2xJR0Y/pd+yTL9mUqt ppGm+ckmvQI7Rhs9DQ26rJZsTG8qFsUmOBuLkwll10nnysTffLFRfQLUEVPjGxb7ipen ZgdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=zmpd2wIx; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-179498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179498-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574f7fc83bfsi416255a12.106.2024.05.14.23.02.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 23:02:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=zmpd2wIx; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-179498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179498-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 17F791F21231 for ; Wed, 15 May 2024 06:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0618642ABD; Wed, 15 May 2024 06:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="zmpd2wIx" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C15BE42058 for ; Wed, 15 May 2024 06:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752880; cv=none; b=esVEO8ZCsBJqf9iaj8KINCD9wuKma/X5zcWdgZAge8331drE8oprltVDJBXTOTzeXlSEOaZ0M4dN+wli23DoDkDtFIOq56xAGY5VitPV/XHLHEXUCIkItqN9tOuS4IKQZ0wvWpeKYiByEid/F9BW7sPlx2VXunzTmYJEkVwhuqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752880; c=relaxed/simple; bh=GiXxAHFN2GD4CXggEYA/tGtT5/RanUB+p73pbxTb67E=; h=Date:Message-Id:Mime-Version:Subject:From:To:Content-Type; b=HDOL+cUZI1arOPMCSR68eTmex7vFG56V+LaZHhRrWepltoPGkYldC59FdCkvhIWr4G+f0NKWeTQGfIGhXIgC6zirYCs6A2V8t6mcfsyNyJtQ75/kxPU4PAa+XBQyuw3wOjcWqw3avxjBQwbdnFddcYIpAp92zkdDFNExMsBMRCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=zmpd2wIx; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6207c483342so113816847b3.1 for ; Tue, 14 May 2024 23:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715752878; x=1716357678; darn=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=X4R5s9OJ/uGB6XbGrKz0Wv7rjDRBvcB0bapwlYPxoLM=; b=zmpd2wIxB7IFCLe+3wEliwe9DkUK01+DlgvQQMQQs9b32JrGgNUUN/XSILM6sti331 7CeODtG3rPsiYbnHf1eA97ODROTUZRTnjZlnK6Bii/R2BUmProHchsBiHRtqB8SPdAOU PE/n3yWlPniWtouVqCPuw8FT9NH5gdSYczNUhQuWH3w9oY0hXREAL6YPQ4S7JzTsBxjK ow/22eKTwQTAPuKks/efrVvCcb9/ClQeQrXDMvJO/cVn9OBigSG+2AkaDtFFAonPhHTO EaQZmKf6A7gWQ3JQNkMcmdnFPN47g+SPeGEHyjFUjxa2IfofLNMndHNqRHAhdzxYeFmx NOtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715752878; x=1716357678; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=X4R5s9OJ/uGB6XbGrKz0Wv7rjDRBvcB0bapwlYPxoLM=; b=Zt0ahJJ/IZHVWalsuyHAK2HCTrTMB2qxWPNVD/OcUtuWHc515kSlIpjnPbl0JxUMMf lF8fxsZEP6dgl5aQYy1VIkEJTnB2CgycnSq6ci9nR90T/evvAcas1djFH5Q45o7XYex4 smYKGQEYiuDtZLp46/gpdXJ6kpHrjuJOCqpr80iiMmIOTSezHVjs/6DBuhwS+NWQdBMt ZSmB8ktnqmP8tUCBg5FnKL60zJMCdH7cgu2TBdy9V6B8WVg0btTRsYNt30qA/7ayQjix RYLoecLjzA74cPJWMaoIEFbXu+uFbz6odATCoYOHSJDtWFqy2dJUU65dqQ8T4kRgZfgb qNsg== X-Forwarded-Encrypted: i=1; AJvYcCUChnzcQhlGP/tUiyBd+2CDGPmwKiIWEG4UAx6x2iW1659/7xeA7DrKS8XWTgDm0QPjqwTiDGaHuy0gJQ6MGqBKLwz+n87Pk3N+dGs+ X-Gm-Message-State: AOJu0Ywfv1U5j5aQwVlfarZJiavGALH2Rg8RxJDrLB+flDiBBq1beqxh 1DMBNEE4U6IxyiPFXn+Gm4YM8AWL9IHF21n9pcSmUy5gvgUT1UivOwY7wpdeL/z5IoisF0oge7u s1hDpIA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:bac3:cca1:c362:572]) (user=irogers job=sendgmr) by 2002:a0d:eb57:0:b0:622:cd98:3b89 with SMTP id 00721157ae682-622cd983e47mr25481097b3.9.1715752877742; Tue, 14 May 2024 23:01:17 -0700 (PDT) Date: Tue, 14 May 2024 23:01:12 -0700 Message-Id: <20240515060114.3268149-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Subject: [PATCH v6 0/2] perf pmus: Sort/merge/aggregate PMUs like mrvl_ddr_pmu From: Ian Rogers To: Tuan Phan , Robin Murphy , Thomas Richter , Bhaskara Budiredla , Bharat Bhushan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Ravi Bangoria , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Stephane Eranian Content-Type: text/plain; charset="UTF-8" The mrvl_ddr_pmu is uncore and has a hexadecimal address suffix. Current PMU sorting/merging code assumes uncore PMU names start with uncore_ and have a decimal suffix. Add support for hexadecimal suffixes and add tests. v6. Add necessary fix in pmu.c to perf_pmu__match_ignoring_suffix that also needs to ignore hex suffixes. v5. In pmus.h remove needless addition of #include list.h but add stddef.h for size_t. v4. Workaround GCC build error by using unsigned types. Don't consider short hex suffixes as suffixes (e.g. cpum_cf) and test this behavior. v3. Rebase and move tests from pmus.c to the existing pmu.c. Ian Rogers (2): perf pmus: Sort/merge/aggregate PMUs like mrvl_ddr_pmu perf tests: Add some pmu core functionality tests tools/perf/tests/pmu.c | 99 ++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/pmu.c | 33 ++++++++------ tools/perf/util/pmus.c | 67 ++++++++++++++++------------ tools/perf/util/pmus.h | 7 ++- 4 files changed, 164 insertions(+), 42 deletions(-) -- 2.45.0.rc1.225.g2a3ae87e7f-goog