Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp694761rdh; Thu, 26 Oct 2023 13:02:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEU2CNNCK/XCh5KiFh9TTgSZwwTnwwE2i8ExUd7SXOfMyaRmnCNHkJU3VBf/pBqpT2K0q5 X-Received: by 2002:a25:fc12:0:b0:d9a:3a83:98e0 with SMTP id v18-20020a25fc12000000b00d9a3a8398e0mr400668ybd.52.1698350544672; Thu, 26 Oct 2023 13:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698350544; cv=none; d=google.com; s=arc-20160816; b=Yv5p8zOGJRBaI/O5ugSwUKIwYlWC4K6souJtgpKAoL5LIHXZcRO8RVrKXhOQu2Vq+N ulkCFUcqfybjgyUZfbP9q8ILXybcoq9YetmWIk991jlng/AyE9ueaRd9Iww6jVnLDy8l 1brgw17dLIuVqcjK9naQIdBZYtwjMEQaxDC5k4rYg4WTsZVN3JRTX1uTJKMrPMaa2qLx 15ccABDZQgXm2dsKEkpairFsgSoV3LV+tb8mcFG1AaepriLd7dJsLhI5liKlsNWO3PBh lDriUk2BvCR6SZo6HeUjlApC+XRjJoEdosqbtjAVBmdw1op8LMylwHL4fU6w4LX7XRnE Jh5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bXiTyq5N5ltFb71GrQmnntzjGz8RkCVUW+tLRQ0fYrM=; fh=VDTHGXR9/mVtc9wiDBMEMCCnGHUVej22+Hh4r4N+nzw=; b=Eyy3Z17l/JoL7VBSBwRVsm1b9pLPQEV3DLaBCKD+igtga3QoC4nL095EoVgXiWH+7M fApokpXvwgq8y7GmFJuM2VAqbm0Jcwd/0kTCSw1oLog9pai2mqBmt86a9kRnnbIWayNi yX85khU+iMprev4R2qOIJPuj8XUMFBruhfXQeMUfwLypeQWxXTbdjxfCHvAvzjMlc3Hx pFxd7cVerYEZmPfPIQXYbTjs/GaOG3SwdKWgpVC3M82P6D1G8JbkzUomIMblzkvGwWCK Xqn3U243cW9BwgKB1bq3/5Wto7o363YAq0tWMsoCJ1JikNg27qBnnWOQ0h52tSjl7Rvt Ajnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=erBoNsW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c203-20020a254ed4000000b00da037b7c155si154519ybb.528.2023.10.26.13.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 13:02:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=erBoNsW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 791B3823CE91; Thu, 26 Oct 2023 13:02:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbjJZUCW (ORCPT + 99 others); Thu, 26 Oct 2023 16:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbjJZUCT (ORCPT ); Thu, 26 Oct 2023 16:02:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EBF9129 for ; Thu, 26 Oct 2023 13:02:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C1EAC433C8; Thu, 26 Oct 2023 20:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698350536; bh=czHelUu63Qcb/7CFa/wjzYwxegwjY0q96Bz6H8eb0JI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=erBoNsW49lYlb649aajpNOZEeJ/Sr0WUNyesTIT7wyEepaRzs1rHUVmCZ7qoPlEN4 bpzW8wPu41MZjB/zi8ATP2rqUVPRq1FMrTlQycxX/oKpUpDIOj3R3xOTpvu00SJzGG fkshws07lnwdC6MLctArf/BJDDtoVLTU8ul+4IkfhhrF6HwwGw4Un+XYWXkgpysTQy ce2KXymv1YFCiCD/CsUVtZVvSQfo8+cnjlvgeFGT4i/yggbs0O3lW+jjuUFX5a9zWQ T30nzpK3fx1xSm8OMkQJDKge2ONkty1y+Oh7YtTogeSOcdLTrjtiZffRgfk/4lDzDr pibzmcC3trwiQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id A19EC4035D; Thu, 26 Oct 2023 17:02:13 -0300 (-03) Date: Thu, 26 Oct 2023 17:02:13 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim , Adrian Hunter Cc: Jiri Olsa , Ian Rogers , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: Re: [PATCH] perf tools: Add -H short option for --hierarchy Message-ID: References: <20231026062615.3096537-1-namhyung@kernel.org> <5a153604-3e9c-4ae9-b216-64f24199efc4@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a153604-3e9c-4ae9-b216-64f24199efc4@intel.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 26 Oct 2023 13:02:23 -0700 (PDT) Em Thu, Oct 26, 2023 at 09:46:02AM +0300, Adrian Hunter escreveu: > On 26/10/23 09:26, Namhyung Kim wrote: > > I found the hierarchy mode useful, but it's easy to make a typo when > > using it. Let's add a short option for that. > > Also update the documentation. :) > Perhaps it would also be possible to support bash-completions for > long options It works: # . ~acme/git/linux/tools/perf/perf-completion.sh # perf top --hi --hide_kernel_symbols --hide_user_symbols --hierarchy # And: perf top --hie works as it is unambiguous (so far). What we don't have is a way to use hierachy by default, i.e. we should have: perf config top.hierarchy=1 and then: perf top would always use the hierarchy view. tools/perf/Documentation/perf-config.txt has the options that can be set, like: # perf report | head -15 # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 373K of event 'cycles:P' # Event count (approx.): 205365133495 # # Overhead Command Shared Object Symbol # ........ ............... ................. ................................... # 3.17% MediaDe~hine #6 libc.so.6 [.] pthread_mutex_lock@@GLIBC_2.2.5 2.31% swapper [kernel.vmlinux] [k] psi_group_change 1.87% MediaSu~sor #10 libc.so.6 [.] pthread_mutex_lock@@GLIBC_2.2.5 1.84% MediaSu~isor #7 libc.so.6 [.] pthread_mutex_lock@@GLIBC_2.2.5 # Then: # perf config report.sort_order=dso # perf report | head -15 # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 373K of event 'cycles:P' # Event count (approx.): 205365133495 # # Overhead Shared Object # ........ .............................................. # 59.52% [kernel.vmlinux] 19.79% libc.so.6 8.07% libxul.so 5.25% libopenh264.so.2.3.1 # # cat ~/.perfconfig # this file is auto-generated. [report] sort_order = dso [root@five ~]# perf config report.sort_order report.sort_order=dso # Right now 'perf top' has only: static int perf_top_config(const char *var, const char *value, void *cb __maybe_unused) { if (!strcmp(var, "top.call-graph")) { var = "call-graph.record-mode"; return perf_default_config(var, value, cb); } if (!strcmp(var, "top.children")) { symbol_conf.cumulate_callchain = perf_config_bool(var, value); return 0; } return 0; } This would be similar to what was done for --no-children on: https://git.kernel.org/torvalds/c/104ac991bd821773cba6f262f97a4a752ed76dd5 $ git show --pretty=full 104ac991bd821773cba6f262f97a4a752ed76dd5 | head -5 commit 104ac991bd821773cba6f262f97a4a752ed76dd5 Author: Namhyung Kim Commit: Jiri Olsa perf top: Add top.children config option - Arnaldo