From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932406AbcG0T0q (ORCPT ); Wed, 27 Jul 2016 15:26:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53962 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756845AbcG0T0p (ORCPT ); Wed, 27 Jul 2016 15:26:45 -0400 Date: Wed, 27 Jul 2016 21:26:39 +0200 From: Jiri Olsa To: Mathieu Poirier Cc: Arnaldo Carvalho de Melo , jolsa@kernel.org, Peter Zijlstra , Ingo Molnar , Alexander Shishkin , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH V2 3/6] perf tools: add infrastructure for PMU specific configuration Message-ID: <20160727192639.GC23264@krava> References: <1469047100-18131-1-git-send-email-mathieu.poirier@linaro.org> <1469047100-18131-4-git-send-email-mathieu.poirier@linaro.org> <20160721074722.GB7192@krava> <20160721145434.GA15915@krava> <20160726204139.GA13377@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 27 Jul 2016 19:26:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 27, 2016 at 11:59:50AM -0600, Mathieu Poirier wrote: SNIP > > -PE_DRV_CFG_TERM > > +'@' PE_NAME '=' PE_NAME > > { > > struct parse_events_term *term; > > > > ABORT_ON(parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_DRV_CFG, > > - $1, $1, &@1, NULL)); > > + $2, $4, &@2, &@4)); > > $$ = term; > > } > > > > The problem here is that the correlation between the first and the > second PE_NAME is lost and instead of seeing "PE_NAME=PE_NAME", the > kernel only gets the value associated with the second PE_NAME. > > For example, > > -e event/@cfg1=value1,@cfg2=value2/ ... > > The above code will send "value1" and "value2" to the kernel driver > where there is no way to know what configurable the values correspond hum.. you get the 'cfg1' and 'cfg2' strings in $1 no? jirka > to. To go around that we'd have to concatenate $2 and $4 in function > parse_events_term__str() (or new_term()) when @type_term == > PARSE_EVENTS__TERM_TYPE_DRV_CFG, something that definitely looks > hackish to me. > > Thanks, > Mathieu