From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935743AbdEWHaY (ORCPT ); Tue, 23 May 2017 03:30:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47050 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933273AbdEWHaX (ORCPT ); Tue, 23 May 2017 03:30:23 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3A87E80C1B Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3A87E80C1B Date: Tue, 23 May 2017 09:30:18 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , kernel-team@lge.com, Frederic Weisbecker , Milian Wolff Subject: Re: [PATCH] perf tools: Fix to put caller above callee in children mode Message-ID: <20170523073018.GA28417@krava> References: <20170522125029.32525-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170522125029.32525-1-namhyung@kernel.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 May 2017 07:30:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 22, 2017 at 09:50:29PM +0900, Namhyung Kim wrote: > The __hpp__sort_acc() sorts entries using callchain depth in order to > put callers above in children mode. But it assumed the callchain order > was callee-first. Now default (for children) is caller-first so the > order of entries is reverted. > > For example, consider following case. > > $ perf report --no-children > ..l > # Overhead Command Shared Object Symbol > # ........ ....... ................... .......................... > # > 99.44% a.out a.out [.] main > | > ---main > __libc_start_main > _start > > Then children mode should show 'start' above '__libc_start_main' since > it's the caller (parent) of the __libc_start_main. But it's reversed: > > # Children Self Command Shared Object Symbol > # ........ ........ ....... ............... ..................... > # > 99.61% 0.00% a.out libc-2.25.so [.] __libc_start_main > 99.61% 0.00% a.out a.out [.] _start > 99.54% 99.44% a.out a.out [.] main > > This patch fixes it. > > # Children Self Command Shared Object Symbol > # ........ ........ ....... ............... ..................... > # > 99.61% 0.00% a.out a.out [.] _start > 99.61% 0.00% a.out libc-2.25.so [.] __libc_start_main > 99.54% 99.44% a.out a.out [.] main > > Cc: Frederic Weisbecker > Cc: Milian Wolff > Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa thanks, jirka