Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755218AbYLEA2S (ORCPT ); Thu, 4 Dec 2008 19:28:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750966AbYLEA2F (ORCPT ); Thu, 4 Dec 2008 19:28:05 -0500 Received: from terminus.zytor.com ([198.137.202.10]:53574 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750720AbYLEA2E (ORCPT ); Thu, 4 Dec 2008 19:28:04 -0500 Message-ID: <49387463.5070100@zytor.com> Date: Thu, 04 Dec 2008 16:22:59 -0800 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Thomas Gleixner CC: LKML , linux-arch@vger.kernel.org, Andrew Morton , Ingo Molnar , Stephane Eranian , Eric Dumazet , Robert Richter , Arjan van de Veen , Peter Zijlstra , Steven Rostedt , David Miller , Paul Mackerras Subject: Re: [patch 0/3] [Announcement] Performance Counters for Linux References: <20081204225345.654705757@linutronix.de> In-Reply-To: <20081204225345.654705757@linutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1596 Lines: 40 Thomas Gleixner wrote: > > We'd like to announce a brand new implementation of performance counter > support for Linux. It is a very simple and extensible design that has the > potential to implement the full range of features we would expect from such > a subsystem. > First of all, let me say I really like what I've seen so far. The file descriptor paradigm seems really elegant to me. > - Only one single new system call is needed: sys_perf_counter_open(). > All performance-counter operations are implemented via standard > VFS APIs such as read() / fcntl() and poll(). As previously discussed, I think this should be a filesystem rather than a system call. There are a couple of advantages to doing it that way, IMO: - Strings, rather than numbers, which means fewer constraints across architectures. - The events available can be exported in the filesystem itself (via readdir) rather than via sysfs. - Compatibility with existing tools, esp. non-C tools. I'm thinking of something like: /dev/perfctr/3/cache_misses/all/simple/300 i.e. /dev/perfctr/////. I am putting ahead of in the hierarchy, so a readdir() on the directory can show the events available by name on that CPU. Raw hardware events can be accessed by something like /dev/perfctr//0x4064/... -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/