From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755028AbZHLUyd (ORCPT ); Wed, 12 Aug 2009 16:54:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753198AbZHLUyc (ORCPT ); Wed, 12 Aug 2009 16:54:32 -0400 Received: from mail-fx0-f228.google.com ([209.85.220.228]:33335 "EHLO mail-fx0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752188AbZHLUyc (ORCPT ); Wed, 12 Aug 2009 16:54:32 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=XwQQ0hFU/ENESlK+ge6uxp4vdSrjZrshxRvmZdmqUHdHVeEZ/6M0IBympWOmNQvgdT allXqRb5qhrTevogNmcbk9hCtmg2eiwLDb3iOTIKAp1jZe8Uyn0U6F7ciGgl1T68E2uh Qvo959tba1X0bxBV2ukHEMdogiaStfFyrSIKw= MIME-Version: 1.0 Reply-To: eranian@gmail.com In-Reply-To: <1250024143.7091.7.camel@laptop> References: <7c86c4470908110841wca07382gf7487c0ed55909f2@mail.gmail.com> <1250006744.10001.29.camel@twins> <7c86c4470908111240s58385748wdb3c3e4a0d66a1ea@mail.gmail.com> <1250024143.7091.7.camel@laptop> Date: Wed, 12 Aug 2009 22:54:31 +0200 Message-ID: <7c86c4470908121354q33a82914x6cf63eb375b6fb59@mail.gmail.com> Subject: Re: perf_counters issue with PERF_SAMPLE_GROUP From: stephane eranian To: Peter Zijlstra Cc: Ingo Molnar , LKML , Andrew Morton , Thomas Gleixner , Robert Richter , Paul Mackerras , Andi Kleen , Maynard Johnson , Carl Love , Corey J Ashford , Philip Mucci , Dan Terpstra , perfmon2-devel 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 Hi, Another thing that occurred to me while using PERF_SAMPLE_GROUP is about that unique ID which you get out of read() with PERF_FORMAT_ID. That number if generated by the kernel and it is a globally incrementing 64-bit counter. An application may not get subsequent numbers even though it is issuing perf_open_counter() in sequence. Another applications may cause the number to change. I believe this is not very convenient because imagine in your signal handler you parse the GROUP and you want to relate id to the event. You need to have a lookup table. I believe it would be more convenient if the tool could pass a 64-bit number itself when the event is created. It would get it back as part of PERF_SAMPLE_GROUP. The id could then be more related to the tool's data structure, no need for a lookup table, overall more efficient. If I recall, this is what epoll() can do and this is very convenient.