Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1905758rdf; Sun, 5 Nov 2023 20:44:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxo0ujh/tai+na8j7rT0XcNypN3p4MzuW/YW5UGmp1Mj9+ip2lxvkhUlhYSyvW6mNqi3OM X-Received: by 2002:a05:6a00:414f:b0:68f:a92a:8509 with SMTP id bv15-20020a056a00414f00b0068fa92a8509mr15198859pfb.7.1699245856213; Sun, 05 Nov 2023 20:44:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699245856; cv=none; d=google.com; s=arc-20160816; b=dyPPNobE0lavoRAD+v4+oqL0osGi8TN3LjreSqmxdJ9JvOrbYK1hSp2XEgpwffvt+7 rgZlIKNUkqH+8xz4hxG68Zge62gOOFWJgccAA+1Nj2DwAoLX9MCN+znMJiA1ynjeLISu ZkDglnamSb0TyFObiv1vqnldeBsrT87G0wI9cOi54zJwYHi+w+w4fhW4to92BAgHnVbr FXZTHk5LQVVfrbetPHpMY6feh16wtYx6j6tiJau/YWQUw9a6i+OVQtuSfaGEyy1Ob152 wqzIe69A8wtU4NHCJvIy2AN+ogyMHznPf7J7fSP7P926jdXlpvJwvr3bnsynA8LwwYaW NTCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=J5cnov2NSWCOOldQGPUHgsFihsW9x2PGj/2F9dc/ZQ4=; fh=7L0JCuSGURW58CmeJN1bUCvMQwDztB/DO+Bhn0TaOTE=; b=tJRSzUiE+elJ40afWGRgEGbLqKUIOLhVGXDhRewOHGz/lgErIHiJWT4V7bMwh7EP1N KpfveiVtyXfBzdEfUHYD2oUjRvjVxBvQIDIyImy9km3O8KH3DQRyAHuVmi1p03ylgNuj hMQGSgAZcU1wRxrTgzsk+x4OXT/5VLZ2OJNnS2a6CD6m46Mca4IDXYPz4wf7I+2RWMHn l/sCiPEhUrAwaqkemTO9NyvZi0dd8WXKi9yG/KXkiynpRLk7tkztvXCc8JUyvrjy92Ih yfrzV2Z34r7lvRB3nTRkrVUFP0N6Ox2jWgDUN1snUwhX6lxKfCOb4Qwjaw8qPApXeaaa dmyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id az12-20020a056a02004c00b0055be9543340si7666054pgb.872.2023.11.05.20.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 20:44:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 6B5C5805DC6C; Sun, 5 Nov 2023 20:43:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbjKFEng convert rfc822-to-8bit (ORCPT + 99 others); Sun, 5 Nov 2023 23:43:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbjKFEnf (ORCPT ); Sun, 5 Nov 2023 23:43:35 -0500 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50B99DB; Sun, 5 Nov 2023 20:43:32 -0800 (PST) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-5bbd3eb2f8fso4002441a12.1; Sun, 05 Nov 2023 20:43:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699245812; x=1699850612; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6C2jeN2Odetxmw6gVUouX0/vQcl2vGThHkHjs3za6HY=; b=hnUR3JNJiiHPJczW84UkZkHBAYJddT3uE+qTGXBj2w5HJKvc5CiOtwUCCLjMUYzq9L XZaOVwI4J+vVhEd25TL+A1kVNXa9jyV1nU6vSwHoPd2/EqJHNWyiKfhXFdHrewQuZ345 KDAaQOBOjp9L5H0Dhhq+Zxh/VTqw9lzNeYY3RemursMzotP19dOzvQk4/+U4aXRmyQlf 1EClSEPvAq5QfR1a5+MwjxyEoi5+BVAwzovD0VwIleyziGoGBzYHkO+QCy7ZqWVcSdR7 dihOI00JSM2uO7U+PGd5UyeZpmVsc+0k73gu0wrcZ8L1UVhlIAKv7fLuTX6BWv45ip0M j3DQ== X-Gm-Message-State: AOJu0YxXXMMfSxvE2pgTKN1ZkPG1UBWBtn6JSROhFhWxE8HsQaELx6Xy D51Hmwf7yJnIIHPY0HI2jZaym+4CMwkeP/OrOeUCElU3 X-Received: by 2002:a17:90b:3ec9:b0:27d:1369:515e with SMTP id rm9-20020a17090b3ec900b0027d1369515emr13446086pjb.22.1699245811686; Sun, 05 Nov 2023 20:43:31 -0800 (PST) MIME-Version: 1.0 References: <20231026062615.3096537-1-namhyung@kernel.org> <5a153604-3e9c-4ae9-b216-64f24199efc4@intel.com> In-Reply-To: From: Namhyung Kim Date: Sun, 5 Nov 2023 20:43:20 -0800 Message-ID: Subject: Re: [PATCH] perf tools: Add -H short option for --hierarchy To: Arnaldo Carvalho de Melo Cc: Adrian Hunter , Jiri Olsa , Ian Rogers , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Sun, 05 Nov 2023 20:43:45 -0800 (PST) Hi Arnaldo, On Thu, Oct 26, 2023 at 1:02 PM Arnaldo Carvalho de Melo wrote: > > 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). Thanks for the test! > > 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: Sure, I can add the config option later. But it's not compatible with some options that change the output like --children and --fields. Maybe it needs to handle some kind of priority of settings for incompatible one. Thanks, Namhyung > > 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