From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757412AbbBFWpS (ORCPT ); Fri, 6 Feb 2015 17:45:18 -0500 Received: from mail-bn1bn0105.outbound.protection.outlook.com ([157.56.110.105]:65144 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751331AbbBFWpQ (ORCPT ); Fri, 6 Feb 2015 17:45:16 -0500 From: Tom Huynh To: , , , , , CC: , , , Tom Huynh , "Kim Phillips" Subject: [PATCH 2/3] perf/e6500: Create a sysfs format entry for e6500 events Date: Fri, 6 Feb 2015 16:43:55 -0600 Message-ID: <1423262636-12053-3-git-send-email-tom.huynh@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423262636-12053-1-git-send-email-tom.huynh@freescale.com> References: <1423262636-12053-1-git-send-email-tom.huynh@freescale.com> X-EOPAttributedMessage: 0 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=tom.huynh@freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(50986999)(50466002)(36756003)(86362001)(229853001)(62966003)(77156002)(2201001)(2950100001)(76176999)(87936001)(106466001)(6806004)(92566002)(48376002)(77096005)(19580395003)(19580405001)(46102003)(33646002)(50226001)(76506005)(104016003)(105606002)(47776003)(57986006)(85426001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB0713;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0713; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:CY1PR0301MB0713; X-Forefront-PRVS: 047999FF16 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0713; X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2015 22:45:11.7641 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0713 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Create a sysfs entry, '/sys/bus/event_source/devices/cpu/format/event' which describes the format of the e6500 PMU events. e6500 has <= 512 events, so use the 9 lsb to specify the raw event code. $ cat /sys/devices/cpu/format/event config:0-8 Similar to commit 3bf7b07ece6e ("perf/POWER7: Create a sysfs format entry for Power7 events"). Signed-off-by: Kim Phillips Signed-off-by: Tom Huynh --- arch/powerpc/perf/e6500-pmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/powerpc/perf/e6500-pmu.c b/arch/powerpc/perf/e6500-pmu.c index abaa6d7..4bbdbb0 100644 --- a/arch/powerpc/perf/e6500-pmu.c +++ b/arch/powerpc/perf/e6500-pmu.c @@ -133,7 +133,20 @@ static struct attribute_group e6500_pmu_events_group = { .attrs = e6500_events_attr, }; +PMU_FORMAT_ATTR(event, "config:0-8"); + +static struct attribute *e6500_pmu_format_attr[] = { + &format_attr_event.attr, + NULL, +}; + +struct attribute_group e6500_pmu_format_group = { + .name = "format", + .attrs = e6500_pmu_format_attr, +}; + static const struct attribute_group *e6500_pmu_attr_groups[] = { + &e6500_pmu_format_group, &e6500_pmu_events_group, NULL, }; -- 1.9.1