From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934261AbcIVNgY (ORCPT ); Thu, 22 Sep 2016 09:36:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52988 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933658AbcIVNgV (ORCPT ); Thu, 22 Sep 2016 09:36:21 -0400 Date: Thu, 22 Sep 2016 15:36:17 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Stephane Eranian , Arnaldo Carvalho de Melo , LKML , Peter Zijlstra , "mingo@elte.hu" , "ak@linux.intel.com" , Vince Weaver , Arnaldo Carvalho de Melo Subject: Re: [BUG] perf report --pid not reporting correctly Message-ID: <20160922133617.GA4903@krava> References: <20160921153753.GA2501@redhat.com> <20160921163453.GA28844@krava> <20160922013456.GA4969@sejong> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160922013456.GA4969@sejong> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 22 Sep 2016 13:36:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 22, 2016 at 10:34:57AM +0900, Namhyung Kim wrote: SNIP > $ perf report -s pid,cpu --stdio --hierarchy > # > # Overhead Pid:Command / CPU > # ........... ....................... > # > 31.21% 0:swapper > 12.16% 000 > 3.09% 001 > 2.76% 002 > 2.23% 003 > 1.65% 007 > 1.65% 008 > 1.52% 009 > 1.51% 006 > 1.46% 004 > 1.34% 005 > 0.94% 010 > 0.90% 011 > 19.15% 8618:getmail > ... > > > > > > -----------------------8<------------------------------- > diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h > index 8d363d5e65a2..42b1bfd29ef8 100644 > --- a/tools/perf/util/event.h > +++ b/tools/perf/util/event.h > @@ -262,6 +262,7 @@ enum auxtrace_error_type { > */ > struct events_stats { > u64 total_period; > + u64 total_early_filtered_period; looks good, but why the word early? wouldn't total_filtered_period be just fine? thanks, jirka > u64 total_non_filtered_period; > u64 total_lost; > u64 total_lost_samples; > diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c > index 37a08f20730a..c7045411cce2 100644 > --- a/tools/perf/util/hist.c > +++ b/tools/perf/util/hist.c > @@ -1017,12 +1017,21 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al, > int max_stack_depth, void *arg) > { > int err, err2; > + struct hists *hists = evsel__hists(iter->evsel); > > err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent, > iter->evsel, al, max_stack_depth); > if (err) > return err; > > + if (symbol__parent_filter(iter->parent)) > + al->filtered |= symbol__parent_filter(iter->parent); > + > + if (al->filtered) { > + hists->stats.total_early_filtered_period += iter->sample->period; SNIP