Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4605271pxf; Tue, 30 Mar 2021 11:56:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlQJBevpGuWRHIs3ZCvgl8qtvsHHos0sznfs0Kc+azKs2ypcYPdkw6zRVr+FIw4uPBXiyG X-Received: by 2002:a05:6402:438f:: with SMTP id o15mr35373681edc.123.1617130589835; Tue, 30 Mar 2021 11:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617130589; cv=none; d=google.com; s=arc-20160816; b=IeDv+Y7FUbNlOVAmagZ0pC//7Pxhq53NB2kbXlEiRyBG8xYiZdDvXHwUiPpbT/4BPd Q0F0e9vOfsmJ6Rou3QFVZp5zUWBxqoZcVmZpNVWz7nHoOTjvxRijiF1CEkoKHfatc1TB xwuvA8BEEEgSJgRGF0ykVVeC+97U8FpdVj7P4lmX6Fd8k/Q1fk3804npxfYp4SyWvRD0 J9xMuVr7SphLLdgZFxvsw0u8wyhUfEjbLWuvfjQRJNlTZVqBSCpzKY63oW+f+bElHw8k a+ouAsbtVDzlVDf82YgHnlBJ8diajDBkMgRAZ5bgh0Ogij7rkcbGJkgWIyDa7AthLrpA sBsA== 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 :in-reply-to:mime-version:user-agent:date:message-id:cc:to :references:subject:from; bh=4WnTT1dw3EDos3pSq17/XftbwYQFWgYet2Aio+SPf58=; b=Okovdd3dPEx1GdhG8ZGZpO37tqOuDXMLqpiDYz0Gy9iP6IzXT/P6+rtWsQk0BrVFBf xlLiAgLhcvTIvfrrlaGOzsMzPSJ5hnQSP3s3sbkj/VVBbd1Po+Ez+lQ+khIr57u7o8pc +gczfmvxR3/HD+YpqEAUc69pGDOKnjUecU7/p+z/VYOnZwmUR0B8UKqVTlokP49jiqaK CxyI8AfIIDBfpjUP1LwLm9sqh+8Gs6P2sRfpLf+ebIsKenrd0YVxESbi9eWcLKUzbHrq PBkKnAssM0REBMMgljCLcjcygAM2kAlyflfzgWKl4WVE5ZXZCIFt9Ee2uDxNcUPadUWM PY3w== 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 de13si14916835edb.525.2021.03.30.11.56.05; Tue, 30 Mar 2021 11:56:29 -0700 (PDT) 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 S232925AbhC3SyF (ORCPT + 99 others); Tue, 30 Mar 2021 14:54:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:42828 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232901AbhC3Sxj (ORCPT ); Tue, 30 Mar 2021 14:53:39 -0400 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 4D038B34F; Tue, 30 Mar 2021 18:33:56 +0000 (UTC) From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] perf annotate: add --demangle and --demangle-kernel References: <2327ca98-f2ee-3a9a-0e24-d52fc90bcf9b@suse.cz> To: linux-perf-users@vger.kernel.org, lkml Cc: Arnaldo Carvalho de Melo Message-ID: Date: Tue, 30 Mar 2021 20:33:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <2327ca98-f2ee-3a9a-0e24-d52fc90bcf9b@suse.cz> 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 0f3a196e5d6e..021d974c978e 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.2