perf util: Take elf_name as const string in dso__demangle_sym
authorMilian Wolff <milian.wolff@kdab.com>
Sun, 6 Aug 2017 21:24:34 +0000 (23:24 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 11 Aug 2017 19:06:31 +0000 (16:06 -0300)
The input string is not modified and thus can be passed in as a pointer
to const data.

Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Yao Jin <yao.jin@linux.intel.com>
Link: http://lkml.kernel.org/r/20170806212446.24925-3-milian.wolff@kdab.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol-elf.c
tools/perf/util/symbol-minimal.c
tools/perf/util/symbol.h

index 502505cf236af30226b22ff82878098060f19862..7cf18f14e1528e86b8a25eefd9848606c770065d 100644 (file)
@@ -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);
 }
index 40bf5d4c0bfd4a6bc9aa4564dc9613e66ca1d7b6..1a5aa35b0100d0a47bc5f904b5809dec3c033cbb 100644 (file)
@@ -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;
 }
index 41ebba9a2eb2f3849635daf67125a851ff717d95..f0b08810d7fa0d43000e4edfef3823a0bc4718df 100644 (file)
@@ -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);