From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CBB3C433FE for ; Wed, 16 Nov 2022 12:41:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233806AbiKPMlu (ORCPT ); Wed, 16 Nov 2022 07:41:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233467AbiKPMls (ORCPT ); Wed, 16 Nov 2022 07:41:48 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A00D264E3; Wed, 16 Nov 2022 04:41:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0A2A861D9C; Wed, 16 Nov 2022 12:41:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39BFCC433C1; Wed, 16 Nov 2022 12:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668602506; bh=+QffJf1vwrSa5biws9YQZuWvKi77WepE94W+OP8tWMY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UtBdDPbTy4enk9E+85aqEX15Ll2dJ+oJdm/xOnS5d0HTuttPNQSOTNG7Ny7nkd9GU v8c6AVuspW12CNmzp+aNe7eCYmEVQ56N+qNJ/B6Z61Jdg1SLahHxzWnHEmbKDznL4c WMtgorBMTI3f5yFTW/PS0LZvpW55kIrxzLXeWzrBLakmGijPJp2muEjiSVSlevD++w s1pmAPjoggY9Vtui259Vgo3lgVv1dtyOPyRtrhUx1szqn5yeNSo/FWsXQxDRk67mBp J3/ymAhAs7P6qFOZIshxsrwSpCYVICW/x2ieuYDXC6pZfDI9PiGYAwIsAoxBfPxoIX 8SkI8qdtT9ZfA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BB4E14034E; Wed, 16 Nov 2022 09:41:43 -0300 (-03) Date: Wed, 16 Nov 2022 09:41:43 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Weilin Wang , Perry Taylor , Caleb Biggers , Leo Yan , Adrian Hunter , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Sandipan Das , Kajol Jain , Zhengjun Xing , Kan Liang , Ravi Bangoria , Xin Gao , Rob Herring , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Stephane Eranian Subject: Re: [PATCH v3 10/10] perf list: Add json output option Message-ID: References: <20221114210723.2749751-1-irogers@google.com> <20221114210723.2749751-11-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Wed, Nov 16, 2022 at 08:51:29AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Nov 16, 2022 at 08:35:28AM -0300, Arnaldo Carvalho de Melo escreveu: > > > Please always run 'perf test' before and after your patches and before > > > sending it upstream. > > > Running as !root on a different machine I get some other interesting > > info: > > > ⬢[acme@toolbox perf]$ perf list syscalls:sys_enter_open* > > double free or corruption (fasttop) > > Aborted (core dumped) > > ⬢[acme@toolbox perf]$ > > > > That is: > > > > free(ps.pmu_glob); > > > > > > at the end of cmd_list(). > > This plus the change to default_ps in the subsequent patch cures the > double free, now working on the segfault. The segfault is "cured" with: diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c index 3183c0351cda6cee..5eb9ed4a5cd0ad71 100644 --- a/tools/perf/builtin-list.c +++ b/tools/perf/builtin-list.c @@ -104,7 +104,7 @@ static void default_print_event(void *ps, const char *pmu_name, const char *topi if (deprecated && !print_state->deprecated) return; - if (print_state->pmu_glob && !strglobmatch(pmu_name, print_state->pmu_glob)) + if (print_state->pmu_glob && pmu_name && !strglobmatch(pmu_name, print_state->pmu_glob)) return; if (print_state->event_glob && ---------------------------- But then: [root@five ~]# perf list syscalls:sys_enter_open* |& grep syscalls: syscalls:sys_enter_open [Tracepoint event] syscalls:sys_enter_open_by_handle_at [Tracepoint event] syscalls:sys_enter_open_tree [Tracepoint event] syscalls:sys_enter_openat [Tracepoint event] syscalls:sys_enter_openat2 [Tracepoint event] [root@five ~]# This stops working, looking into it. - Arnaldo