Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1086326pxb; Fri, 26 Feb 2021 02:05:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDtq+UT78iwbhoQ6UX9vOt1zzoMRMO7fuXRHiJOsIs4jjIPjvOsxMbNq9YM4IfbH01JoAt X-Received: by 2002:a05:6402:5107:: with SMTP id m7mr2343991edd.155.1614333912330; Fri, 26 Feb 2021 02:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614333912; cv=none; d=google.com; s=arc-20160816; b=lCu6WphuaxF/6AsvmXeXw1iMonM7pBu0JuLsQJdNCw5Fj1O8wUqXeAWaGsqsOQkB3/ 0r67B76WVa6sTbCo858AbmxV3Vga3DhrTtA4Gqy0WhQgA8mySqLHHLlDhk6WzS20HEJL aW/wKk4y4EKhGKiPDwNpYTZiqJggK42KuBjwEZBnqnjMBuHz3XcMTjwClJKSR0V6LD8a xDbTLDg6cplrydH0LQ8qWdtjCjE/d0i+wgPXhlaWV+UBx74PHpSuCDxKktx2FYeUArkT 5cQ8IxApojcZXhUC89XEpEMFyqBz7mi8aTpWBZJgXsKNInl1dyWTGT/yJ52IH+M0wuor zzyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=Ql49sNw0nqaRyvOPgZgGj9zBoT131k8GvOBidnchuHQ=; b=KCs9xjjyHcrgBx9uioZPXHw2rscGFHWCDCEqzEs8IvoxmaK/GMEaAsiozYibfkZ89E zcTIc0MQNwO82bi5tTKoFpebA2HxJtS+6dpwymmOCOlpgOVfwpE3rG8BOSirb8p9gE1P ms9MqJNumuTytyr2Uq6zM/VHxTMDBnBmH1fE9lYDRMMv6SfDhSkN1Ip7TSpIoYPqLUzq Ik6TJQTM+G00fclaF4oAqZSoKm6BLiKzcqc1LR20GDZSYAuCf3Zo2XmQE55Kb9j9LW17 ZB8U1ApkHkcwp1JG3DDtOT/Z/Pu3f/SDXgVVTTxohU65iViRDS1OLsBUBc8/2180PFqd XrdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si4979838ejw.423.2021.02.26.02.04.49; Fri, 26 Feb 2021 02:05:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbhBZKB5 (ORCPT + 99 others); Fri, 26 Feb 2021 05:01:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:57896 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbhBZKBy (ORCPT ); Fri, 26 Feb 2021 05:01:54 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E667BAF3F; Fri, 26 Feb 2021 10:01:11 +0000 (UTC) Subject: Re: [PATCH] perf annotate: add --demangle and --demangle-kernel To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Fri, 26 Feb 2021 11:01:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------BEDBFE0A2EDD88A4D15A7E96" Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------BEDBFE0A2EDD88A4D15A7E96 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote: > Em Mon, Feb 22, 2021 at 09:29:22AM +0100, Martin Liška escreveu: >> Perf annotate supports --symbol but it's impossible to filter >> a C++ symbol. With --no-demangle one can filter easily by >> mangled function name. >> >> Signed-off-by: Martin Liška >> --- >> tools/perf/Documentation/perf-annotate.txt | 7 +++++++ >> tools/perf/builtin-annotate.c | 4 ++++ >> 2 files changed, 11 insertions(+) >> >> diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt >> index 1b5042f134a8..80c1be5d566c 100644 >> --- a/tools/perf/Documentation/perf-annotate.txt >> +++ b/tools/perf/Documentation/perf-annotate.txt >> @@ -124,6 +124,13 @@ OPTIONS >> --group:: >> Show event group information together >> +--demangle:: >> + Demangle symbol names to human readable form. It's enabled by default, >> + disable with --no-demangle. >> + >> +--demangle-kernel:: >> + Demangle kernel symbol names to human readable form (for C++ kernels). >> + >> --percent-type:: >> Set annotation percent type from following choices: >> global-period, local-period, global-hits, local-hits >> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c >> index a23ba6bb99b6..ef70a17b9b5b 100644 >> --- a/tools/perf/builtin-annotate.c >> +++ b/tools/perf/builtin-annotate.c >> @@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv) >> "Strip first N entries of source file path name in programs (with --prefix)"), >> OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path", >> "objdump binary to use for disassembly and annotations"), >> + OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, >> + "Disable symbol demangling"), > > Nope, this _enables_ demangling, i.e.: > > perf annotate --demangle Oh, yeah, you are right. > > Asks for symbol demangling, while: > > perf annotate --no-demangle > > As you correctly wrote in your commit message and on the > --demangle-kernel case, enables demangling. Fixed that in V2. Martin > > Please consider making this configurable (if not already) via > ~/.perfconfig, 'perf config', sure in a followup patch. > > Thanks, > > - Arnaldo > >> + OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, >> + "Enable kernel symbol demangling"), >> OPT_BOOLEAN(0, "group", &symbol_conf.event_group, >> "Show event group information together"), >> OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, >> -- >> 2.30.1 >> > --------------BEDBFE0A2EDD88A4D15A7E96 Content-Type: text/x-patch; charset=UTF-8; name="0001-perf-annotate-add-demangle-and-demangle-kernel.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="0001-perf-annotate-add-demangle-and-demangle-kernel.patch" From 336233abae5c539d7b2730cbbe35d0c7528bccc2 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 22 Feb 2021 09:24:22 +0100 Subject: [PATCH] perf annotate: add --demangle and --demangle-kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perf annotate supports --symbol but it's impossible to filter a C++ symbol. With --no-demangle one can filter easily by mangled function name. Signed-off-by: Martin Liška --- tools/perf/Documentation/perf-annotate.txt | 7 +++++++ tools/perf/builtin-annotate.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt index 1b5042f134a8..80c1be5d566c 100644 --- a/tools/perf/Documentation/perf-annotate.txt +++ b/tools/perf/Documentation/perf-annotate.txt @@ -124,6 +124,13 @@ OPTIONS --group:: Show event group information together +--demangle:: + Demangle symbol names to human readable form. It's enabled by default, + disable with --no-demangle. + +--demangle-kernel:: + Demangle kernel symbol names to human readable form (for C++ kernels). + --percent-type:: Set annotation percent type from following choices: global-period, local-period, global-hits, local-hits diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index a23ba6bb99b6..ea05d9f927cb 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv) "Strip first N entries of source file path name in programs (with --prefix)"), OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path", "objdump binary to use for disassembly and annotations"), + OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, + "Enable symbol demangling"), + OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, + "Enable kernel symbol demangling"), OPT_BOOLEAN(0, "group", &symbol_conf.event_group, "Show event group information together"), OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, -- 2.30.1 --------------BEDBFE0A2EDD88A4D15A7E96--