From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753455AbbJVApJ (ORCPT ); Wed, 21 Oct 2015 20:45:09 -0400 Received: from mail-ig0-f170.google.com ([209.85.213.170]:33778 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752161AbbJVAov (ORCPT ); Wed, 21 Oct 2015 20:44:51 -0400 MIME-Version: 1.0 In-Reply-To: <20151021192350.GC32514@kernel.org> References: <20151009215626.GM14409@kernel.org> <20151009222504.GN14409@kernel.org> <20151020120033.GB5119@kernel.org> <20151020121948.GA29289@lerouge> <20151020130651.GC5119@kernel.org> <20151021192350.GC32514@kernel.org> From: Brendan Gregg Date: Wed, 21 Oct 2015 17:44:20 -0700 Message-ID: Subject: Re: [PATCH 13/16] perf callchain: Switch default to 'graph,0.5,caller' To: Arnaldo Carvalho de Melo Cc: Chandler Carruth , Frederic Weisbecker , Ingo Molnar , LKML , Adrian Hunter , Borislav Petkov , David Ahern , Jiri Olsa , Namhyung Kim , Stephane Eranian , Wang Nan Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2015 at 12:23 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Oct 21, 2015 at 11:28:54AM -0700, Brendan Gregg escreveu: >> On Tue, Oct 20, 2015 at 7:21 PM, Chandler Carruth wrote: >> > Since Arnaldo asked, I thought I should actually try to respond specifically >> > to the question of why I favor the 'caller' view as the default. >> > >> > On Tue, Oct 20, 2015 at 3:06 AM Arnaldo Carvalho de Melo >> > wrote: >> >> >> >> > IMHO changing that order is not a good idea. Unless many users >> >> > complained >> >> > about it. >> >> >> >> Perhaps there are not that many users of callchains because the default >> >> is not what they're used to see? >> >> >> >> Motivation for the change came from a video from Chandler, that >> >> resurfaced the callchain default issue, Chandler? >> > >> > >> > So, first and foremost, thanks for fixing some of my gripes about the >> > usability of the perf tool, I'm super excited about the changes you're >> > making, even if this one isn't among them. >> > >> > I think the default of caller vs. callee is probably the hardest judgement >> > call to make about the right defaults. I can see it going both ways. >> > >> > When profiling my *system*, or a diverse group of programs or tasks, I often >> > find callee useful. Were I a kernel developer, I suspect callee would be >> > *dramatically* more common than caller. >> > >> > For me, what makes the caller view much more frequently desired is that I'm >> > usually profiling a fairly isolated application, or benchmark for an >> > isolated library. While I always start off with some more system-level >> > performance problem, I rarely need a detailed profile to get a reasonable >> > idea of what subsystem to stare at, and then I spend days looking at a >> > relatively isolated reproduction. >> > >> > Anyways, for profiling user-land applications, I suspect from my >> > conversations with users that "caller" is the more common expectation. >> [...] >> >> I would have said callee is the more common expectation, certainly for >> system profilers. I quickly checked various tools to see what their >> defaults are: >> >> callee: >> >> gdb >> lldb >> pstack >> jstack >> perf >> stap >> ktap >> dtrace >> kernel oops message >> jvm crash >> node.js/v8 crash >> >> caller: >> >> python traceback > > sysprof -> http://sysprof.com/screen-shot-4.png Right, GUIs with tree views do this. I've thought about it more, and how does the following 3 changes sound?: 1. perf top: change to caller default - Since it's dumping a tree view, this ordering is intuitive, and this is the convention from other interactive GUIs that do tree views. Optionally add a hotkey to change it live. Could also add -G from perf report (--inverted) to easily call the old behavior. 2. perf report: change to caller default - I'd like to leave it callee, but as Ingo said, "top" and "report" should be unified. I can always run -G, or -g, or edit ~/.perfconfig. 3. perf script: leave callee default. - Since it's dumping a full stack, that's the convention with other tools that dump full stacks (as I listed), and I think that's useful ordering anyway when reading a full stack: show me event context first, followed by history next. "perf script" should have -G and -g added, to adjust behavior. I'd also like different UIs from perf report (folded and json), but that's a different thread. :) Brendan