From patchwork Fri Feb 6 22:43:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Huynh X-Patchwork-Id: 437490 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 047A914017B for ; Sat, 7 Feb 2015 10:02:16 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id DC2951A13A0 for ; Sat, 7 Feb 2015 10:02:15 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0109.outbound.protection.outlook.com [207.46.100.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id DC5831A0F20 for ; Sat, 7 Feb 2015 10:00:33 +1100 (AEDT) Received: from BN3PR0301CA0043.namprd03.prod.outlook.com (25.160.152.139) by CY1PR0301MB0713.namprd03.prod.outlook.com (25.160.159.143) with Microsoft SMTP Server (TLS) id 15.1.75.20; Fri, 6 Feb 2015 22:45:12 +0000 Received: from BN1AFFO11FD035.protection.gbl (2a01:111:f400:7c10::116) by BN3PR0301CA0043.outlook.office365.com (2a01:111:e400:401e::11) with Microsoft SMTP Server (TLS) id 15.1.87.13 via Frontend Transport; Fri, 6 Feb 2015 22:45:12 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD035.mail.protection.outlook.com (10.58.52.159) with Microsoft SMTP Server (TLS) id 15.1.87.10 via Frontend Transport; Fri, 6 Feb 2015 22:45:11 +0000 Received: from localhost (rivendell-010081033165.am.freescale.net [10.81.33.165]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t16MjAaq007326; Fri, 6 Feb 2015 15:45:10 -0700 From: Tom Huynh To: , , , , , 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 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; 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 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 Cc: Tom Huynh , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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, };