From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755501AbbDGXlP (ORCPT ); Tue, 7 Apr 2015 19:41:15 -0400 Received: from mail-ig0-f179.google.com ([209.85.213.179]:33857 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753679AbbDGXlK (ORCPT ); Tue, 7 Apr 2015 19:41:10 -0400 Message-ID: <55246B14.30906@gmail.com> Date: Tue, 07 Apr 2015 17:41:08 -0600 From: David Ahern User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: Stephane Eranian , Jiri Olsa , LKML Subject: Re: [BUG] perf script segfault References: <5519D376.6010509@gmail.com> <20150330234533.GA9438@kernel.org> <20150331125920.GE9438@kernel.org> <551AA2F8.9080205@gmail.com> In-Reply-To: <551AA2F8.9080205@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org what happened to this patch? not in your core or urgent branches and perf-script is still bombing On 3/31/15 7:36 AM, David Ahern wrote: > On 3/31/15 6:59 AM, Arnaldo Carvalho de Melo wrote: >> Em Mon, Mar 30, 2015 at 08:45:33PM -0300, Arnaldo Carvalho de Melo >> escreveu: >>> Em Mon, Mar 30, 2015 at 04:51:34PM -0600, David Ahern escreveu: >>>> tool was moved to ordered_events and is not initialized for pipe >>>> mode. I >>>> don't have time to look into it more than that before PTO on Wednesday. >> >>> I guess this one is enough, no? Checking with your example... >> >> So the following is better, can you give it a try, please? >> >> - Arnaldo >> >> >> From fbd7d154f01c47db71a3d8b0546911872aa1de54 Mon Sep 17 00:00:00 2001 >> From: Arnaldo Carvalho de Melo >> Date: Tue, 31 Mar 2015 09:53:50 -0300 >> Subject: [PATCH 1/1] perf session: Always initialize ordered_events >> >> Even when it is not used to actually reorder events, some of its fields >> are used, like session->ordered_events->tool, to shorten function >> signatures where tool, for instance, was being passed, as the tool is >> needed for the ordered_events code, we need it there and might as well >> use it for other perf_session needs. >> >> This fixes a problem where 'perf script' had some condition that made >> session->ordered_events not to be initialized even with its >> script->tool ordered_events related flags asking for it to be, which >> looks like another bug and needs to be investigated further. >> >> Always initializing session->ordered_events at least leaves the current >> assumptions in place, so do it now. >> >> Reported-by: David Ahern >> Cc: Adrian Hunter >> Cc: Borislav Petkov >> Cc: Don Zickus >> Cc: Frederic Weisbecker >> Cc: Jiri Olsa >> Cc: Namhyung Kim >> Cc: Stephane Eranian >> Link: >> http://lkml.kernel.org/n/tip-b1xxk0rwkz2a0gip1uufmjqg@git.kernel.org >> Signed-off-by: Arnaldo Carvalho de Melo >> --- >> tools/perf/util/session.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c >> index adf0740c563b..89c66797abe4 100644 >> --- a/tools/perf/util/session.c >> +++ b/tools/perf/util/session.c >> @@ -110,6 +110,8 @@ struct perf_session *perf_session__new(struct >> perf_data_file *file, >> >> session->repipe = repipe; >> machines__init(&session->machines); >> + ordered_events__init(&session->ordered_events, &session->machines, >> + session->evlist, tool, ordered_events__deliver_event); >> >> if (file) { >> if (perf_data_file__open(file)) >> @@ -139,9 +141,6 @@ struct perf_session *perf_session__new(struct >> perf_data_file *file, >> tool->ordered_events && >> !perf_evlist__sample_id_all(session->evlist)) { >> dump_printf("WARNING: No sample_id_all support, falling back >> to unordered processing\n"); >> tool->ordered_events = false; >> - } else { >> - ordered_events__init(&session->ordered_events, >> &session->machines, >> - session->evlist, tool, >> ordered_events__deliver_event); >> } >> >> return session; >> > > Works for me. Reviewed-and-Tested-by: David Ahern