Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756131Ab0KJOKN (ORCPT ); Wed, 10 Nov 2010 09:10:13 -0500 Received: from canuck.infradead.org ([134.117.69.58]:42120 "EHLO canuck.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755816Ab0KJOKK convert rfc822-to-8bit (ORCPT ); Wed, 10 Nov 2010 09:10:10 -0500 Subject: Re: [RFC][PATCH] perf: sysfs type id From: Peter Zijlstra To: Stephane Eranian Cc: LKML , Ingo Molnar , Lin Ming , "robert.richter" , Corey Ashford , fweisbec , paulus , Greg Kroah-Hartman , Kay Sievers , "H. Peter Anvin" In-Reply-To: References: <1289339119.2191.92.camel@laptop> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Wed, 10 Nov 2010 15:10:07 +0100 Message-ID: <1289398207.2191.117.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 931 Lines: 33 On Wed, 2010-11-10 at 14:01 +0100, Stephane Eranian wrote: > Peter, > > 6 > > And then, what do you do with 6? > I assume you have to pass it in the attr struct. perf_event_attr::type, as said in the initial changelog. > How do you plan on doing this while keeping what is already there? + if (type < 0) { + err = idr_get_new_above(&pmu_idr, pmu, PERF_TYPE_MAX, &type); and + rcu_read_lock(); + pmu = idr_find(&pmu_idr, event->attr.type); + rcu_read_unlock(); + if (pmu) + goto unlock; So we start dynamic IDs at the top of the static range, and only do dynamic IDs for those that don't already have a static number. -- 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/