diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-08-05 06:39:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-08-05 06:39:12 -0400 |
commit | 8a06bf14008fbf55a86105b8569494f4beeb8762 (patch) | |
tree | 74c0313294eb9dc2bb409ce5ea154b478c6628cd /tools/perf/util/symbol.c | |
parent | e7882d6c40874a5b5033ca85f7508a602a60b662 (diff) | |
parent | 7f309ed6453926a81e2a97d274f67f1e48f0d74c (diff) |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core fixes and some late updates from Arnaldo Carvalho de Melo:
* Make clean brace expansion fix for some shells, from Palmer Cox
* Warn user just once per guest kernel when not finding kernel info,
from David Ahern
* perf test fix from Jiri Olsa
* Fix error handling on event creation in perf top, from David Ahern
* Fix check on perf_target__strnerror, from Namhyung Kim
* Save the whole cmdline, from David Ahern
* Prep work for the DWARF CFI post unwinder, so that it doesn't
uses perf_session in lots of places, just evlist/evsel is enough.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index fdad4eeeb429..8b63b678e127 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -64,7 +64,7 @@ static enum dso_binary_type binary_type_symtab[] = { | |||
64 | DSO_BINARY_TYPE__NOT_FOUND, | 64 | DSO_BINARY_TYPE__NOT_FOUND, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | #define DSO_BINARY_TYPE__SYMTAB_CNT sizeof(binary_type_symtab) | 67 | #define DSO_BINARY_TYPE__SYMTAB_CNT ARRAY_SIZE(binary_type_symtab) |
68 | 68 | ||
69 | static enum dso_binary_type binary_type_data[] = { | 69 | static enum dso_binary_type binary_type_data[] = { |
70 | DSO_BINARY_TYPE__BUILD_ID_CACHE, | 70 | DSO_BINARY_TYPE__BUILD_ID_CACHE, |
@@ -72,7 +72,7 @@ static enum dso_binary_type binary_type_data[] = { | |||
72 | DSO_BINARY_TYPE__NOT_FOUND, | 72 | DSO_BINARY_TYPE__NOT_FOUND, |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #define DSO_BINARY_TYPE__DATA_CNT sizeof(binary_type_data) | 75 | #define DSO_BINARY_TYPE__DATA_CNT ARRAY_SIZE(binary_type_data) |
76 | 76 | ||
77 | int dso__name_len(const struct dso *dso) | 77 | int dso__name_len(const struct dso *dso) |
78 | { | 78 | { |
@@ -2875,6 +2875,7 @@ int machines__create_guest_kernel_maps(struct rb_root *machines) | |||
2875 | int i, items = 0; | 2875 | int i, items = 0; |
2876 | char path[PATH_MAX]; | 2876 | char path[PATH_MAX]; |
2877 | pid_t pid; | 2877 | pid_t pid; |
2878 | char *endp; | ||
2878 | 2879 | ||
2879 | if (symbol_conf.default_guest_vmlinux_name || | 2880 | if (symbol_conf.default_guest_vmlinux_name || |
2880 | symbol_conf.default_guest_modules || | 2881 | symbol_conf.default_guest_modules || |
@@ -2891,7 +2892,14 @@ int machines__create_guest_kernel_maps(struct rb_root *machines) | |||
2891 | /* Filter out . and .. */ | 2892 | /* Filter out . and .. */ |
2892 | continue; | 2893 | continue; |
2893 | } | 2894 | } |
2894 | pid = atoi(namelist[i]->d_name); | 2895 | pid = (pid_t)strtol(namelist[i]->d_name, &endp, 10); |
2896 | if ((*endp != '\0') || | ||
2897 | (endp == namelist[i]->d_name) || | ||
2898 | (errno == ERANGE)) { | ||
2899 | pr_debug("invalid directory (%s). Skipping.\n", | ||
2900 | namelist[i]->d_name); | ||
2901 | continue; | ||
2902 | } | ||
2895 | sprintf(path, "%s/%s/proc/kallsyms", | 2903 | sprintf(path, "%s/%s/proc/kallsyms", |
2896 | symbol_conf.guestmount, | 2904 | symbol_conf.guestmount, |
2897 | namelist[i]->d_name); | 2905 | namelist[i]->d_name); |