From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751529AbdGZHau (ORCPT ); Wed, 26 Jul 2017 03:30:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57978 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbdGZHas (ORCPT ); Wed, 26 Jul 2017 03:30:48 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 336A3356F5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com Date: Wed, 26 Jul 2017 09:30:44 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , lkml , Ingo Molnar , Peter Zijlstra , Alexander Shishkin , Namhyung Kim , David Ahern , Andi Kleen Subject: Re: [PATCH 3/4] perf tools: Add perf_evsel__read_counter function Message-ID: <20170726073044.GA17134@krava> References: <20170721121212.21414-1-jolsa@kernel.org> <20170721121212.21414-4-jolsa@kernel.org> <20170726014148.GD23846@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170726014148.GD23846@kernel.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 26 Jul 2017 07:30:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 25, 2017 at 10:41:48PM -0300, Arnaldo Carvalho de Melo wrote: SNIP > > diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c > > index 53b9a994a3dc..2c258554f94d 100644 > > --- a/tools/perf/util/stat.c > > +++ b/tools/perf/util/stat.c > > @@ -128,6 +128,9 @@ static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) > > > > static void perf_evsel__free_stat_priv(struct perf_evsel *evsel) > > { > > + struct perf_stat_evsel *ps = evsel->priv; > > + > > + free(ps->group_data); > > Humm, are you sure you can always do that, i.e. that evsel->priv is not > NULL? > > Program received signal SIGSEGV, Segmentation fault. > 0x000000000054ca04 in perf_evsel__free_stat_priv (evsel=0x2454be0) at util/stat.c:133 > 133 free(ps->group_data); > Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.7.7-1.fc25.x86_64 elfutils-libelf-0.169-1.fc25.x86_64 elfutils-libs-0.169-1.fc25.x86_64 libunwind-1.2-1.fc25.x86_64 perl-libs-5.24.1-386.fc25.x86_64 python-libs-2.7.13-2.fc25.x86_64 slang-2.3.0-7.fc25.x86_64 > (gdb) bt > #0 0x000000000054ca04 in perf_evsel__free_stat_priv (evsel=0x2454be0) at util/stat.c:133 > #1 0x000000000054cc93 in perf_evlist__free_stats (evlist=0x24541a0) at util/stat.c:189 > #2 0x0000000000460311 in cmd_script (argc=0, argv=0x7fffffffe170) at builtin-script.c:3075 > #3 0x00000000004be56c in run_builtin (p=0xa359f8 , argc=1, argv=0x7fffffffe170) at perf.c:296 > #4 0x00000000004be7d9 in handle_internal_command (argc=1, argv=0x7fffffffe170) at perf.c:348 > #5 0x00000000004be92b in run_argv (argcp=0x7fffffffdfcc, argv=0x7fffffffdfc0) at perf.c:392 > #6 0x00000000004bed05 in main (argc=1, argv=0x7fffffffe170) at perf.c:530 > (gdb) > > I'm dropping the series, please retest with 'perf script'. hum, will check thanks, jirka