diff options
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/string.c | 11 | ||||
-rw-r--r-- | tools/perf/util/string.h | 1 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 3 |
3 files changed, 14 insertions, 1 deletions
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c index c93eca9a7be3..04743d3e9039 100644 --- a/tools/perf/util/string.c +++ b/tools/perf/util/string.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <string.h> | ||
1 | #include "string.h" | 2 | #include "string.h" |
2 | 3 | ||
3 | static int hex(char ch) | 4 | static int hex(char ch) |
@@ -32,3 +33,13 @@ int hex2u64(const char *ptr, u64 *long_val) | |||
32 | 33 | ||
33 | return p - ptr; | 34 | return p - ptr; |
34 | } | 35 | } |
36 | |||
37 | char *strxfrchar(char *s, char from, char to) | ||
38 | { | ||
39 | char *p = s; | ||
40 | |||
41 | while ((p = strchr(p, from)) != NULL) | ||
42 | *p++ = to; | ||
43 | |||
44 | return s; | ||
45 | } | ||
diff --git a/tools/perf/util/string.h b/tools/perf/util/string.h index 15c827475e7d..2c84bf65ba0f 100644 --- a/tools/perf/util/string.h +++ b/tools/perf/util/string.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include "types.h" | 4 | #include "types.h" |
5 | 5 | ||
6 | int hex2u64(const char *ptr, u64 *val); | 6 | int hex2u64(const char *ptr, u64 *val); |
7 | char *strxfrchar(char *s, char from, char to); | ||
7 | 8 | ||
8 | #define _STR(x) #x | 9 | #define _STR(x) #x |
9 | #define STR(x) _STR(x) | 10 | #define STR(x) _STR(x) |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 4dfdefd5ec7e..e3eebdd682d9 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -189,7 +189,7 @@ struct symbol *dso__find_symbol(struct dso *self, u64 ip) | |||
189 | 189 | ||
190 | size_t dso__fprintf(struct dso *self, FILE *fp) | 190 | size_t dso__fprintf(struct dso *self, FILE *fp) |
191 | { | 191 | { |
192 | size_t ret = fprintf(fp, "dso: %s\n", self->long_name); | 192 | size_t ret = fprintf(fp, "dso: %s\n", self->short_name); |
193 | 193 | ||
194 | struct rb_node *nd; | 194 | struct rb_node *nd; |
195 | for (nd = rb_first(&self->syms); nd; nd = rb_next(nd)) { | 195 | for (nd = rb_first(&self->syms); nd; nd = rb_next(nd)) { |
@@ -977,6 +977,7 @@ static int dsos__load_modules_sym_dir(char *dirname, | |||
977 | snprintf(dso_name, sizeof(dso_name), "[%.*s]", | 977 | snprintf(dso_name, sizeof(dso_name), "[%.*s]", |
978 | (int)(dot - dent->d_name), dent->d_name); | 978 | (int)(dot - dent->d_name), dent->d_name); |
979 | 979 | ||
980 | strxfrchar(dso_name, '-', '_'); | ||
980 | map = kernel_maps__find_by_dso_name(dso_name); | 981 | map = kernel_maps__find_by_dso_name(dso_name); |
981 | if (map == NULL) | 982 | if (map == NULL) |
982 | continue; | 983 | continue; |