Skip to content

Commit

Permalink
perf util: Take elf_name as const string in dso__demangle_sym
Browse files Browse the repository at this point in the history
The input string is not modified and thus can be passed in as a pointer
to const data.

Signed-off-by: Milian Wolff <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Yao Jin <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
milianw authored and acmel committed Aug 11, 2017
1 parent e498f33 commit 80c345b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/perf/util/symbol-elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ int dso__synthesize_plt_symbols(struct dso *dso, struct symsrc *ss, struct map *
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);
}
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/symbol-minimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 80c345b

Please sign in to comment.