From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753139Ab2DEI7g (ORCPT ); Thu, 5 Apr 2012 04:59:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34552 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653Ab2DEI7e (ORCPT ); Thu, 5 Apr 2012 04:59:34 -0400 Date: Thu, 5 Apr 2012 10:59:11 +0200 From: Jiri Olsa To: Stephane Eranian Cc: acme@redhat.com, a.p.zijlstra@chello.nl, mingo@elte.hu, paulus@samba.org, cjashfor@linux.vnet.ibm.com, fweisbec@gmail.com, linux-kernel@vger.kernel.org, David Ahern Subject: Re: [PATCH 5/8] perf, tool: Add pmu event parse support for branch_sample_type values Message-ID: <20120405085911.GC1624@m.brq.redhat.com> References: <1333570898-10505-1-git-send-email-jolsa@redhat.com> <1333570898-10505-6-git-send-email-jolsa@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 04, 2012 at 09:50:12PM -0700, Stephane Eranian wrote: > On Wed, Apr 4, 2012 at 1:21 PM, Jiri Olsa wrote: > > Adding a support to specify branch_type as a hardcoded term > > inside the pmu event definition. > > > > It is possible to specify pmu event like: > >  "cpu/config=1,branch_type=hv|any_ret|1,config2=2/u" > > > > Following string values could be used as value for branch_type: > >  u (PERF_SAMPLE_BRANCH_USER) > >  k (PERF_SAMPLE_BRANCH_KERNEL) > >  hv (PERF_SAMPLE_BRANCH_HV) > >  any (PERF_SAMPLE_BRANCH_ANY) > >  any_call (PERF_SAMPLE_BRANCH_ANY_CALL) > >  any_ret (PERF_SAMPLE_BRANCH_ANY_RETURN) > >  ind_call (PERF_SAMPLE_BRANCH_IND_CALL) > > > > Also a number could be specified as value. > > > Although it would be nice to have, the current kernel sampling > buffer layout + perf would not be able to parse the RECORD_SAMPLE > if you were to sample different things for different events: > > perf record -e > cpu/event=0xc0,umask=1:branch_type=any/,cpu/event=0x3c,umask=0x1/ hi, for some reason I thought there might be sense to have multiple branch types enabled in a single event.. I misread the code probably > > Perf report/annotate would not be able to distinguish a RECORD_SAMPLE > generated by the first or the second event. That's because the RECORD_SAMPLE > fixed header does not contain enough info to determine which event caused the > record to be generated. You need to event ID to decode the sample. The event ID > gives you the attr struct which gives you the attr->sample_type which drives the > layout of the RECORD_SAMPLE variable size body. The event ID is currently > saved "somewhere" in the variable-size body of the sample. You have a chicken > and egg problem here. yep, I'm aware of this.. cool you're preparing fix thanks, jirka