From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932374Ab0GTPTf (ORCPT ); Tue, 20 Jul 2010 11:19:35 -0400 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:8201 "EHLO TX2EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932185Ab0GTPTe (ORCPT ); Tue, 20 Jul 2010 11:19:34 -0400 X-SpamScore: -16 X-BigFish: VPS-16(zz1432N98dN936eMzz1202hzzz32i2a8h43h61h) X-Spam-TCS-SCL: 0:0 X-WSS-ID: 0L5V3W9-01-64R-02 X-M-MSG: Date: Tue, 20 Jul 2010 17:19:20 +0200 From: Robert Richter To: Lin Ming CC: Corey Ashford , Ingo Molnar , Johannes Berg , Peter Zijlstra , Greg KH , Frederic Weisbecker , Paul Mundt , "eranian@gmail.com" , "Gary.Mohr@Bull.com" , "arjan@linux.intel.com" , "Zhang, Yanmin" , Paul Mackerras , "David S. Miller" , Russell King , Arnaldo Carvalho de Melo , Will Deacon , Maynard Johnson , Carl Love , Kay Sievers , lkml , Thomas Gleixner , Steven Rostedt Subject: Re: [rfc] Describe events in a structured way via sysfs Message-ID: <20100720151920.GC21909@erda.amd.com> References: <20100624093625.GA26931@elte.hu> <1277396053.3870.16.camel@jlt3.sipsolutions.net> <20100624173315.GA30403@elte.hu> <1277792114.5400.5.camel@minggr.sh.intel.com> <20100629085532.GE22344@elte.hu> <1277803248.5400.16.camel@minggr.sh.intel.com> <20100629102656.GA25512@elte.hu> <1278057996.3841.26.camel@minggr.sh.intel.com> <4C40F750.4000607@linux.vnet.ibm.com> <1279604908.23815.21.camel@minggr.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1279604908.23815.21.camel@minggr.sh.intel.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Reverse-DNS: unknown Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.07.10 01:48:28, Lin Ming wrote: The caller reads config and type and pass them into perf_event_attr. > > 1. Hardware events > /sys/devices/system/cpu/cpu0...cpuN/events > |-- L1-dcache-load-misses ===> event name > | |-- config ===> config value for the event > | `-- type ===> event type Wouldn't it be much easier to have a unique sysfs id (could be an u64): > |-- L1-dcache-load-misses ===> event name > | `-- id ===> event id ... and then extend the syscall to enable an event by its sysfs id: memset(&attr, 0, sizeof(attr)); attr.type = PERF_TYPE_SYSFS; attr.sysfs_id = sysfs_id; attr.sample_type = PERF_SAMPLE_CPU | PERF_SAMPLE_RAW; attr.config = config; ... The kerrnel then knows which event is meant and the don't have to provide event specific paramaters such as type/config that requires an event specific setup. The advantage would be that we can open an event file descriptor of every kind of event in a standardized way. -Robert -- Advanced Micro Devices, Inc. Operating System Research Center