Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694AbdHNRvD (ORCPT ); Mon, 14 Aug 2017 13:51:03 -0400 Received: from terminus.zytor.com ([65.50.211.136]:35079 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472AbdHNRvA (ORCPT ); Mon, 14 Aug 2017 13:51:00 -0400 Date: Mon, 14 Aug 2017 10:48:29 -0700 From: tip-bot for Milian Wolff Message-ID: Cc: mingo@kernel.org, yao.jin@linux.intel.com, acme@redhat.com, milian.wolff@kdab.com, tglx@linutronix.de, hpa@zytor.com, dsahern@gmail.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl Reply-To: namhyung@kernel.org, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, dsahern@gmail.com, hpa@zytor.com, yao.jin@linux.intel.com, acme@redhat.com, milian.wolff@kdab.com, mingo@kernel.org In-Reply-To: <20170806212446.24925-3-milian.wolff@kdab.com> References: <20170806212446.24925-3-milian.wolff@kdab.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf util: Take elf_name as const string in dso__demangle_sym Git-Commit-ID: 80c345b255cbb4e9dfb193bf0bf5536217237f6a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2495 Lines: 64 Commit-ID: 80c345b255cbb4e9dfb193bf0bf5536217237f6a Gitweb: http://git.kernel.org/tip/80c345b255cbb4e9dfb193bf0bf5536217237f6a Author: Milian Wolff AuthorDate: Sun, 6 Aug 2017 23:24:34 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 11 Aug 2017 16:06:31 -0300 perf util: Take elf_name as const string in dso__demangle_sym The input string is not modified and thus can be passed in as a pointer to const data. Signed-off-by: Milian Wolff Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Yao Jin Link: http://lkml.kernel.org/r/20170806212446.24925-3-milian.wolff@kdab.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/symbol-elf.c | 2 +- tools/perf/util/symbol-minimal.c | 2 +- tools/perf/util/symbol.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 502505c..7cf18f1 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -391,7 +391,7 @@ out_elf_end: return 0; } -char *dso__demangle_sym(struct dso *dso, int kmodule, char *elf_name) +char *dso__demangle_sym(struct dso *dso, int kmodule, const char *elf_name) { return demangle_sym(dso, kmodule, elf_name); } diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c index 40bf5d4..1a5aa35 100644 --- a/tools/perf/util/symbol-minimal.c +++ b/tools/perf/util/symbol-minimal.c @@ -377,7 +377,7 @@ void symbol__elf_init(void) char *dso__demangle_sym(struct dso *dso __maybe_unused, int kmodule __maybe_unused, - char *elf_name __maybe_unused) + const char *elf_name __maybe_unused) { return NULL; } diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 41ebba9..f0b0881 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -306,7 +306,7 @@ int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, int dso__synthesize_plt_symbols(struct dso *dso, struct symsrc *ss, struct map *map); -char *dso__demangle_sym(struct dso *dso, int kmodule, char *elf_name); +char *dso__demangle_sym(struct dso *dso, int kmodule, const char *elf_name); void __symbols__insert(struct rb_root *symbols, struct symbol *sym, bool kernel); void symbols__insert(struct rb_root *symbols, struct symbol *sym);