From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793674924; b=Pn7WnfAR5UtVnZpFjQcq65OTO+ae/Obd3zRAGZAmlaJk8fp4lOAJ93x9n3Jnve9H89iO cLfEPZW57DpLA1YvIEjqQNLGXDLcGHmuzQhQ112/uhEfME063JVCkmQBJeQeFRE8Dw8qd FfLPwSnnd5IiNfwrIcZNx2jahIwx1QdLCjhHTuXz5xhXB2bxTcl058VxsRFCAtcuoMQjj dIq14sgKqEO7vnsQ4ouKwBR8XP+iUMhKRSSTsFFP8QSHB1wBbiHpGcFvDs4KhQweujtx9 ff8DcGsbkbPaVL3fxg3smSDhD9B1OPfYXV1l3FbxyyPiUlFppx9ppdXtwjaZUih66Ug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793674924; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key; bh=t/6UJdmTXHa5CFtPmZ35mg3YaxIUiqdjrGgBWpPFHWo=; b=GqB1Q2cHPIVA3CUjl9bT4VFkJ2IcnBRgpDkTlHMgN3GsAoqgjn+Kweq+ZX3jkrv3IimO +My6TZ0/25gu/Fjn1V+SQPpH1U4rxlvsn1mBDaxMEIiJ1+BqFiYN3iMBifeoqFdH31TWa mAffigOy9t5LwzdhXS5lZ9yFlQQ4nqCoIP6pL77GYTkpx9Tk/gWrViyh1xDxGbswvTbyc ORF9PLrKzlXCS3Qhy4hfBUqcFIuvvVH95GsamUQ3YqmU75dc2zx8GmIwNp0wt03JwckUv 91lYGpnVB/M/xW6nihTZQlrc9mcV2+o8Q0fsWlyXE2EDaizrgZB7KjubtcQXrkQzqbQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cI+YxjPw; arc=none smtp.remote-ip=209.85.128.178 Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 229A5606A326 for ; Tue, 3 Nov 2026 03:02:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 229A5606A326 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cI+YxjPw Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-8b2d149b483so13963837b3.0 for ; Mon, 02 Nov 2026 19:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793674923; x=1794279723; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=t/6UJdmTXHa5CFtPmZ35mg3YaxIUiqdjrGgBWpPFHWo=; b=cI+YxjPwQPj2Xf957E27Wp+XxIb4yChJzZbZYX8kq66xhBbz2plXjwmpFC12zqpmfh MP/ezqfYqBKNlIsQGumTNE+dbj/6fzo9edXGzgN0553QGo0wVdzQuKBRwRMeE1a74/tu KrWYNk1IrRxg6P53t7d0isgAi05mboS8HzHK373q/1hrqJc7zo4eo6gKScKmBf9emJWM utHAbg2rQjHfMwJN6gbuMQAQnYcfdl0aaJrS7Pa1JKT+5QkzOMNMmGaWwSHAJpmhiavC fOZ79BsVJcEqKWr86o0a/Xh8kcIHLPCPizWBrQLQqkmmfRPqmmuKKooS1bkZ/2prHxtj qiHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793674923; x=1794279723; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=t/6UJdmTXHa5CFtPmZ35mg3YaxIUiqdjrGgBWpPFHWo=; b=fAVgOjTizXpfjw/N/sT/aqioM6eYUHUNwZFxvJ7HqXdNv6Nr/226D7Fy8DcllDXYSx HBrLZ7PyIuh71qpcMqFHLLoB/0qmsKoKkcyqDgbOf130uOkGnvJotJnIBZWggDhkmpCz c8kI7BOCUDcKKuk/WHLLzlMLgl03GM6JqzpvaHgxavZEp16yYdmhpbjFMi2VADjYEZn6 7+qtL50/uDf0zdVPhu+qOWdiNAk47iT3kpN9hZ2+SnR6GJy+FiQxNPwClU6T5xK4c+HF jecFHmuQatz7D8uJ4ruYaMjxdnpxD9fAQ4e69gpz2sla34hwN3DzikvDV4DSqKYXqm2P z6ag== X-Forwarded-Encrypted: i=1; AKwUvByynF+ATtERRDO6LYYNrXN15SnICGdcc+tmsPy3SDreXwpKe2ZMt94lFi9JoEN/aifxOW5gDkvBREz42+4=@vger.kernel.org X-Gm-Message-State: APuU4Z+a/rpdr1+9tSvHgpFoiZKsIxX8Lt4JtYBJ3QYcWK5rXRL0ZNml tJWoOlpsY5ukzH8N9v6CY2sQHbWkBo5xzKdf6knmrIKctnr6f7E1yF74 X-Gm-Gg: AYBFou1moOAjbOTCkkcQr0i0IdayEV6xtia+yYUBHXig42SSZrJhKEJHOJYmcj/g0X4 Q9jbF5XtB+stgU8dhwua5rdR8EUHOQ374ODIAV83EslsLwcak0/ForsHiavActcT1SgRUZBE9/B esrkFgC4tGHKcqhBDtdrItL3HMPCExoiO/5OSf5PiTBqrteqMOoJ7H16SAXsg+i7/r1Hz2EwMFp 3I7CXJrQb8k2znOM3KLakJ8p4Rnc0ILSqHRJo3PjgU6tvCtBCkfuMS0mCeYUvWeNeGIaldQhozK XzDdtJ8YlST0Eqg+nfShNtNh8d6Wwp50INhEJ6i+XTFWbqWjg+z31RL4TVxCHshWnZcopU36eV2 oe4HwZO09U2Pyif8K5EYzCFbHb+UdvpTUZ1n9vP2HZ5HZA3GIDJg6u+WMCyCB+5vy/pM4/tvYHC eQfK545c7/ixsU1XzLBWaSND7lWy0cGwj7sGNTnbNg/22mqdpDrgCNH+B94VehiO0N+eZDMrEGe j5v823bTRP4JrjUh6ophw/BN6+ePW/IU1zKpH7S5ILA0EuaRbgCIjRgcgD+vl0pyJtA5IfMbaEV 20BjjL04161jJg60xm8O9S1l929/kbjtStL9Y/djk1gc2iZ9YXw8pPGefbi5XkFVXD2A2mayIY+ 9Anidy7Z3Xw== X-Received: by 2002:a05:690c:c4e5:b0:8b0:8b34:ede3 with SMTP id 00721157ae682-8b2b6594f0cmr82898097b3.3.1793674923045; Mon, 02 Nov 2026 19:02:03 -0800 (PST) Received: from localhost ([2600:1702:7a90:6f9f:8bc4:8aec:108d:7a04]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b2b704d699sm64247177b3.5.2026.11.02.19.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2026 19:02:01 -0800 (PST) From: Matt Turner Date: Mon, 02 Nov 2026 22:01:57 -0500 Subject: [PATCH v4 2/7] alpha/perf: add sysfs format and event attributes X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261102-alpha-profileme-v4-2-61e00f5e1da8@gmail.com> References: <20261102-alpha-profileme-v4-0-61e00f5e1da8@gmail.com> In-Reply-To: <20261102-alpha-profileme-v4-0-61e00f5e1da8@gmail.com> To: Richard Henderson , Magnus Lindholm , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Matt Turner X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2352; i=mattst88@gmail.com; h=from:subject:message-id; bh=nsB8jInGhmdIwF4AteMUmNQCWwgxX1qv6DhmPNtskC4=; b=owGbwMvMwCW25rVmCc8sv+mMp9WSGLJe+i3+9Pn5Wi+fGY8PTw9ZJ53Dva5N4K2M/4clx5bbX TVbo/HtXcdHFgYxLoaZYooscesVWWa17Vjqc1r6F8wcViaQIdIiDQxAwMLAl5uYV2qkY6Rnqm2o Zwhk6BjFQ+T0GDQyi4tLU4t00wqKHPLySxJLMvPzivXyC1LzCtIL9NIy00oyMvKLilOBRujlpZa Yujq6GRkamFg6Wpg5WTiamjg7Oxk6uTk6Ors6GVmamxg4WzqauFqaM3BxCsBcw/2RkaF3GeNkHf 3nx1Vu8z0/WbnvyqtzdnNfaZUkvT7EWje/+4oEw/+shSW67a+jnQ/O+C7WMf0xc1hXDVsIk3N+t cKdxRlvJ3ABAA== X-Developer-Key: i=mattst88@gmail.com; a=openpgp; fpr=3BB639E56F861FA2E86505690FDD682D974CA72A The Alpha PMU registers with no attribute groups, so the perf tool has no way to learn the raw config layout, and the PMU's own events can only be named as raw hex numbers. Describe the event field in format/event and export aliases for the four EV67 event types. mbox-replay has no generic hardware event, and can now be named as cpu/mbox-replay/. Signed-off-by: Matt Turner Reviewed-by: Magnus Lindholm Tested-by: Magnus Lindholm --- arch/alpha/kernel/perf_event.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 2d9383425357..70840c05d39b 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c @@ -212,6 +212,44 @@ static int ev67_raw_event_valid(u64 config) }; +PMU_FORMAT_ATTR(event, "config:0-7"); + +static struct attribute *ev67_format_attrs[] = { + &format_attr_event.attr, + NULL, +}; + +static const struct attribute_group ev67_format_group = { + .name = "format", + .attrs = ev67_format_attrs, +}; + +/* Values must match enum ev67_pmc_event_type. */ +PMU_EVENT_ATTR_STRING(cycles, ev67_event_cycles, "event=0x01"); +PMU_EVENT_ATTR_STRING(instructions, ev67_event_instructions, "event=0x02"); +PMU_EVENT_ATTR_STRING(bcache-misses, ev67_event_bcache_misses, "event=0x03"); +PMU_EVENT_ATTR_STRING(mbox-replay, ev67_event_mbox_replay, "event=0x04"); + +static struct attribute *ev67_event_attrs[] = { + &ev67_event_cycles.attr.attr, + &ev67_event_instructions.attr.attr, + &ev67_event_bcache_misses.attr.attr, + &ev67_event_mbox_replay.attr.attr, + NULL, +}; + +static const struct attribute_group ev67_events_group = { + .name = "events", + .attrs = ev67_event_attrs, +}; + +static const struct attribute_group *ev67_attr_groups[] = { + &ev67_format_group, + &ev67_events_group, + NULL, +}; + + static const struct alpha_pmu_t ev67_pmu = { .event_map = ev67_perfmon_event_map, .max_events = ARRAY_SIZE(ev67_perfmon_event_map), @@ -761,6 +799,7 @@ static struct pmu pmu = { .start = alpha_pmu_start, .stop = alpha_pmu_stop, .read = alpha_pmu_read, + .attr_groups = ev67_attr_groups, .capabilities = PERF_PMU_CAP_NO_EXCLUDE, }; -- 2.55.0