From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932498AbcCIMqB (ORCPT ); Wed, 9 Mar 2016 07:46:01 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34052 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932075AbcCIMpx (ORCPT ); Wed, 9 Mar 2016 07:45:53 -0500 Date: Wed, 9 Mar 2016 21:44:28 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Andi Kleen , Stephane Eranian , Wang Nan Subject: Re: [PATCH 3/6] perf tools: Fix command line filters in hierarchy mode Message-ID: <20160309124428.GA7678@danjae.kornet> References: <1457449603-7124-1-git-send-email-namhyung@kernel.org> <1457449603-7124-3-git-send-email-namhyung@kernel.org> <20160309091356.GA25692@krava.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160309091356.GA25692@krava.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On Wed, Mar 09, 2016 at 10:13:56AM +0100, Jiri Olsa wrote: > On Wed, Mar 09, 2016 at 12:06:40AM +0900, Namhyung Kim wrote: > > When a command-line filter was applied in hierarchy mode, output was > > broken especially when filtering on lower level. The higher level > > entries didn't show up so it's hard to see the result. > > > > Also it needs to handle multi sort keys in a single level of hierarchy. > > > > Before: > > > > $ perf report --hierarchy -s 'cpu,{dso,comm}' --comms swapper --stdio > > ... > > # Overhead CPU / Shared Object+Command > > # ........... ........................... > > # > > 13.79% [kernel.vmlinux] swapper > > 31.71% 000 > > 13.80% [kernel.vmlinux] swapper > > 0.43% [e1000e] swapper > > 11.89% [kernel.vmlinux] swapper > > 9.18% [kernel.vmlinux] swapper > > > > After: > > > > # Overhead CPU / Shared Object+Command > > # ........... ............................... > > # > > 33.09% 003 > > 13.79% [kernel.vmlinux] swapper > > 31.71% 000 > > 13.80% [kernel.vmlinux] swapper > > 0.43% [e1000e] swapper > > 21.90% 002 > > 11.89% [kernel.vmlinux] swapper > > 13.30% 001 > > 9.18% [kernel.vmlinux] swapper > > I'm getting funny numbers when using 'F' toggle in tui mode > > [jolsa@krava perf]$ ./perf report --hierarchy -s 'cpu,{dso,comm}' --comms swapper > > Samples: 254 of event 'cycles:pp', Event count (approx.): 132263887 > Overhead CPU / Shared Object+Command ◆ > + 69.85% 001 ▒ > + 44.28% 000 ▒ > + 41.62% 002 ▒ > + 36.80% 003 > > > [jolsa@krava perf]$ sudo ./perf top --hierarchy -s 'cpu,{dso,comm}' --comms swapper > > Overhead CPU / Shared O+Command > + 320.64% 000 > + 179.91% 002 > + 137.05% 003 > + 88.37% 001 Hmm.. I think it's because that the total period is a sum of periods of leaf nodes. But if a filter is applied, sum of periods of upper level entries can be different than sum of the lower level entries. So it should use top-level entries periods instead IMHO. I will send a fix. Thanks, Namhyung