Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2379379lqo; Mon, 13 May 2024 17:28:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXbWBkPDInq59G+IVyCbShoSnt5WxXLQOu/DzY0DWjRhkXaauWYPJVkHKpdkZDjFx3Q7WZnQ+bq1iXqeVFzaw0LXfwWY0Is/RXM9h3Lw== X-Google-Smtp-Source: AGHT+IH/EzLIupQ0vMvHZzUI187aJrNooZHJxbGNhxT+W/eb7I2klHcZAaPpvncm+cCt6Wnh3Eme X-Received: by 2002:a05:6a20:a125:b0:1af:6911:7ff4 with SMTP id adf61e73a8af0-1afde0b71c3mr12285227637.7.1715646514135; Mon, 13 May 2024 17:28:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715646514; cv=pass; d=google.com; s=arc-20160816; b=qpWpsth5KiAPUsHbZhbtugfpm1ZVjK8JGToLDjmAB1yysGyFDBjeo29BlOT5nG47yk IXstHMwM3yK4muMDYvh3IDVRcDNq1fMGmBUh5czrhh/OCpxfpysfzt516QjSKnQWy5S/ 3OK9U5vROEjac21x9Nl3OcLGfZoV575kEVho7vrVBI0nm+DVyQKvvvCT0mT5uWj5DJAf I5AaRtF8V7vWOtRLHkmMfEj5IQhv0klkM+7804h47qe4phPVJKzUz5L9kjmhJCfmhO9h hPcjBaO/4zato4aleK5MWPWtfnyKg9BctFPgz6y1m20SE4IY6jfv58/MeGYcgtypK++P pgxQ== 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=UQNrFfmCY/F9lJfCct9y2gwd0jA2l7EIFDK4kqkig5c=; fh=GtODOXSzVfVgwenO69JP5AOOisGMEMO/LMR4QdmAAIo=; b=XEn7nTYc+qZ7BzKWxgjZAq8eVxmIT8M6l08EtcFCaNFxK59twVP99LT6vCnoERUoob /fYHAk3O5T1PyqTUmtAAFCAqcV9T3Uu8UaO1ILUgbktdVYddE1v5gyU+jl3S6y3AV+hJ 2tfCYvWcT61NiZgw0evSa2OG0N2R2rGJRFKtPktFf5VI3ynWPnKp3y9+y4T8AAAJf9bd 6ac/MGvKVBZ8xymfZQfsqXtNexhtWLoU9lUKmxOWWzYf+uDwC+MeiV29/jfgsekOINW3 ENRkgePnABHviLp8iPEfD4bgGeu0h+sxAZSv/6EHCAA8DUqvdgVOT1Rn2vsUcD7k6hHv krzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=hXGBBIdx; 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-178208-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178208-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c133418si104812485ad.436.2024.05.13.17.28.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 17:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178208-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=hXGBBIdx; 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-178208-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178208-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BB189284EC8 for ; Tue, 14 May 2024 00:28:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD483803; Tue, 14 May 2024 00:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hXGBBIdx" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.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 896C837B for ; Tue, 14 May 2024 00:28:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715646506; cv=none; b=rznB3+ud/tjGaCuXFLQ3IXRUMEAHlFeVlDKIPapKBxny8o4sVYxcvJi92Z/TqJUg70sp4Y9DMjuj1ZFgCGy6VF+LF8KYz9P1Xf+TeFimUFxp5vAQfKxCIwVoFkO/yOnFj/9BqTlLwk0iCNb64mxPN7HzVE6Vi7JfCg5cxxePevI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715646506; c=relaxed/simple; bh=5a8er6sN7WB7QIJ9lSXZpimqvDl+BduXwFtMIlDMSPU=; h=Date:Message-Id:Mime-Version:Subject:From:To:Content-Type; b=ekGcBms/2kAF+lBmmDxj9utloO3bzirLkQopEaCy1Qz14Lw56ZHXaJpPYfTOT/CI6GjQENJ1MqtcCNhqRjYSbLGMj5Iku0MEbAteaFWfENSXjtXNDX8Cahxq/VFY0D5H/jIC2WvK/zhMTs4muJn9ofmTT0yBpWccX59461DQYjY= 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=hXGBBIdx; arc=none smtp.client-ip=209.85.219.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-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc647f65573so10965140276.2 for ; Mon, 13 May 2024 17:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715646504; x=1716251304; darn=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=UQNrFfmCY/F9lJfCct9y2gwd0jA2l7EIFDK4kqkig5c=; b=hXGBBIdxvbjvdiNSE+4Yxg7FiBgf8eAENJMdivmqrtS4DFQyHvcZ2rZCW+iW7+orpS RLGf7DxciE4l+tkb8rZvyZVTx3pML7Mk2DeJW/I0+AvC6VbI2HlM8pkerJx/zkFLHAA8 MQI3BxwwuRYx+WRmMdZoEYOG41K4GiplPLnGsxhMGZ/4ZveSORItmKRt5UyyviexdPOF zBIVTY5naSxoQkRpxTe5u8BBmceSPCiq7r5Bd116AdSZEMkyWzyhxp7UYXVhxcxbrsEZ jbbSSZGHev4pt+l4YWxM9kc7JRNHPIAYlCqsUoSP+WF1irG3Pey9EskqhiiJXsz4GZF0 L2Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715646504; x=1716251304; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UQNrFfmCY/F9lJfCct9y2gwd0jA2l7EIFDK4kqkig5c=; b=Qzys2zYjhjBTShycaFQsPgfh41o8pH+f4aWXHfmLL0xS/nGWKU7UyNUse0IATeBVWr tJshHfnCJIJz6e8a49U5JJuwAhbEp6Tg+XsGsnU6N4+JUF4RsIaMAvsDRV7NyLXSJE/S YaP6DpQmr0MInBFBybREb4NUTtCZ2PIoyt20xNGaSPa30dRqi7TNiBCpYSpG7wOM922c N8hTKVspBTnrqZkXLCnVUBwd4vpK8XiQ6/P1HicD58uEk+jXMg+YK+6b4uQZKGsuGZ66 lyDmtWojyM1iTfUBAFzE9FGIPGmczHf3JZgPINH9+Lfcb/3yY6cBPrGwicy+NAoufz56 lu2g== X-Forwarded-Encrypted: i=1; AJvYcCVqC5rTNggLGS2s6meYe52O8US35jfjJrtATP2csQcM83Djy+ud08uZZklE2voD7Lqwm/1jtQh0A81Kb5gpH8Jt6knN4IDCCQsQdC5w X-Gm-Message-State: AOJu0YwSSPqgxs18xEikG2oLPsLa4BxqTKl4QhBTsIcVw31rdmHEGKEA H89vosG8IHRXr+5PDZWQ5ZUBf8/p5ZAZ07L9y45g9GzTSuFkmG1d2/YKnNRsYlVpdIH8O6CjaB3 gvd6Kqw== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:6e66:3031:b400:2dc8]) (user=irogers job=sendgmr) by 2002:a05:6902:100f:b0:dee:5d43:a0f3 with SMTP id 3f1490d57ef6-dee5d43c91fmr2523877276.6.1715646504489; Mon, 13 May 2024 17:28:24 -0700 (PDT) Date: Mon, 13 May 2024 17:28:15 -0700 Message-Id: <20240514002817.2896240-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 v5 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. 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 | 17 ++++---- tools/perf/util/pmus.c | 67 ++++++++++++++++------------ tools/perf/util/pmus.h | 7 ++- 4 files changed, 152 insertions(+), 38 deletions(-) -- 2.45.0.rc1.225.g2a3ae87e7f-goog