Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752546AbaFEVfA (ORCPT ); Thu, 5 Jun 2014 17:35:00 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:32857 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbaFEVe6 (ORCPT ); Thu, 5 Jun 2014 17:34:58 -0400 MIME-Version: 1.0 In-Reply-To: <20140605204117.GA1771@krava.redhat.com> References: <20140605170011.GA13372@krava.brq.redhat.com> <20140605202102.GE2311@infradead.org> <20140605204117.GA1771@krava.redhat.com> Date: Thu, 5 Jun 2014 23:34:58 +0200 Message-ID: Subject: Re: [PATCHv2] perf tools: Fix pipe check regression in attr event callback From: Stephane Eranian To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , LKML , Namhyung Kim , David Ahern , Peter Zijlstra , "mingo@elte.hu" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 5, 2014 at 10:41 PM, Jiri Olsa wrote: > On Thu, Jun 05, 2014 at 05:21:02PM -0300, Arnaldo Carvalho de Melo wrote: >> Em Thu, Jun 05, 2014 at 07:00:11PM +0200, Jiri Olsa escreveu: >> > On Thu, Jun 05, 2014 at 06:06:41PM +0200, Stephane Eranian wrote: >> > > Hi Jiri, >> > > >> > > Somehow, I thought you had written a fix to avoid the problem below. >> > > But when I try with tip.git, the problem is still there. >> > > Could you push your fix ASAP. >> > > >> > > Thanks. >> > > >> > > $ perf record -o - noploop 2 | perf inject -b | perf report -i - >> > > # To display the perf.data header info, please use >> > > --header/--header-only options. >> > > # >> > > noploop for 2 seconds >> > > 0x1bd0 [0x28]: failed to process type: 9 >> > >> > hum, I remember fixing another issue.. this one is >> > separated one, please try attached patch. >> > >> > thanks, >> > jirka >> > >> > >> > --- >> > The file factoring in builtin-inject.c object introduced regression >> > in attr event callback. The commit is: >> > 3406912 perf inject: Handle output file via perf_data_file object >> > >> > Following hunk reversed the logic: >> > - if (!inject->pipe_output) >> > + if (&inject->output.is_pipe) >> >> Why do we need this '&'? this will always evaluate to true, as it will >> get the address of a variable, also adding a ! before it will just it >> eval to false always, or am I missing something? :-) >> >> I think this should really be: >> >> if (!inject->output.is_pipe) >> >> No? > > aaarhg.. yes ;-) v2 attached > Had the same reaction as Arnaldo. Now, it makes more sense... > thanks, > jirka > > --- > The file factoring in builtin-inject.c object introduced regression > in attr event callback. The commit is: > 3406912 perf inject: Handle output file via perf_data_file object > > Following hunk reversed the logic: > - if (!inject->pipe_output) > + if (&inject->output.is_pipe) > > putting it back, following example now works: > $ perf record -o - kill | perf inject -b | perf report -i - > > Plus removing extra '&' (kudos to Arnaldo) > > Reported-by: Stephane Eranian > Cc: Arnaldo Carvalho de Melo > Cc: Corey Ashford > Cc: David Ahern > Cc: Frederic Weisbecker > Cc: Ingo Molnar > Cc: Namhyung Kim > Cc: Paul Mackerras > Cc: Peter Zijlstra > Signed-off-by: Jiri Olsa > --- > tools/perf/builtin-inject.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c > index 6a3af00..16c7c11 100644 > --- a/tools/perf/builtin-inject.c > +++ b/tools/perf/builtin-inject.c > @@ -72,7 +72,7 @@ static int perf_event__repipe_attr(struct perf_tool *tool, > if (ret) > return ret; > > - if (&inject->output.is_pipe) > + if (!inject->output.is_pipe) > return 0; > > return perf_event__repipe_synth(tool, event); > -- > 1.8.3.1 > -- 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/