Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1406081pxb; Mon, 22 Feb 2021 00:32:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0Jo4j0vKjgg67Bl3v4xXRTZiDjXt9xAhsl80gsrCpJOygAmyu048Qu2SxJvZNZbCO5Qr0 X-Received: by 2002:a17:906:7f16:: with SMTP id d22mr3046379ejr.5.1613982779706; Mon, 22 Feb 2021 00:32:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613982779; cv=none; d=google.com; s=arc-20160816; b=Dzk+HhRnUh7d6XMXDtHWYgOKG3FyFHhwrCCDt6DDDqHH+NhkNE9g6VG708W+aXaex2 QxhFDH23lq3frcgZWvPdqlIckcsxDR7gj3rRpMfpyjxtJWS5jfU75yMG3QWOl02S8epH MD+CJoNj2HSVahSd4uW9p+bzylJ2WyMGPBorxOvMxFR1Z0CPRs0zEqHCWrAKk5cGVe5O 73FXzX3vGUwm5TwwgRJARdaGtuCq1iGDt85MQQih09PMeB6aue9V7EO55sOS7TZ/aJDH VYrgzyBBdaJnI2aTu9FoLqdjU4Lz8EMd204FLvFUe79BevxEjoppw7YlGUslQfovnWlM MhWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:cc:to:subject:from; bh=tGWE/dJo8Rdp31WDg+sYOm+fUEba5d+b/Gpd11ju60k=; b=jkwIEYHe64ot/j1VldqlOPIO8fBTcSkUk5QxPw7ObAcTEQOrweBPrunzQGaabMwRV9 YqSYViHtf+oa4QIN0DnD4siiryZ968ESe4s6/dNKteeB4kdumtSlaT1083q9FJK0jZiw 0nCXj0srMuXd792kN1aNRPgzjl+s42W2sStTYFzCu72qZE+W7czCJOL4UwcAlVX33xcV /Dp83JcWePw25GayIbIaXU8m0MWJqG4RUzE8AydiG29qoUlUF5Gmn2vyOiPGkKBkNobl fGYi6+ULzgtx3W/Vh/b2FeLK6xt9rsgr/Y8RDqLeiNucdkABN2OlGc1lP5IAwp+sKB/U 6FTQ== 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 ld19si10857803ejb.273.2021.02.22.00.32.36; Mon, 22 Feb 2021 00:32:59 -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 S229918AbhBVIaF (ORCPT + 99 others); Mon, 22 Feb 2021 03:30:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:33568 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbhBVIaE (ORCPT ); Mon, 22 Feb 2021 03:30:04 -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 05140AD57; Mon, 22 Feb 2021 08:29:23 +0000 (UTC) From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] perf annotate: add --demangle and --demangle-kernel To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Arnaldo Carvalho de Melo Message-ID: Date: Mon, 22 Feb 2021 09:29:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"), + 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