diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-05-13 05:35:12 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-05-13 05:35:12 (GMT) |
commit | 636fa4a7b0d2987b7395cd2e259962cdca16e887 (patch) | |
tree | 94e3776eeff15c96c30f32a09d63ad3bcb9fdc84 /tools/perf/util/thread_map.c | |
parent | 9f448cd3cbcec8995935e60b27802ae56aac8cc0 (diff) | |
parent | 42ef8a78c1f49f53f29f0f3a6f9a5bcbc653233e (diff) | |
download | linux-636fa4a7b0d2987b7395cd2e259962cdca16e887.tar.xz |
Merge tag 'perf-urgent-for-mingo-20160512' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
- Fallback to usermode-only counters when perf_event_paranoid > 1, which
is the case now (Arnaldo Carvalho de Melo)
- Do not reassign parg after collapse_tree() in libtraceevent, which
may cause tool crashes (Steven Rostedt)
- Fix the build on Fedora Rawhide, where readdir_r() is deprecated and
also wrt -Werror=unused-const-variable= + x86_32_regoffset_table on
!x86_64 (Arnaldo Carvalho de Melo)
- Fix the build on Ubuntu 12.04.5, where dwarf_getlocations() isn't
available, i.e. libdw-dev < 0.157 (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/thread_map.c')
-rw-r--r-- | tools/perf/util/thread_map.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index 08afc690..267112b 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c @@ -94,7 +94,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid) DIR *proc; int max_threads = 32, items, i; char path[256]; - struct dirent dirent, *next, **namelist = NULL; + struct dirent *dirent, **namelist = NULL; struct thread_map *threads = thread_map__alloc(max_threads); if (threads == NULL) @@ -107,16 +107,16 @@ struct thread_map *thread_map__new_by_uid(uid_t uid) threads->nr = 0; atomic_set(&threads->refcnt, 1); - while (!readdir_r(proc, &dirent, &next) && next) { + while ((dirent = readdir(proc)) != NULL) { char *end; bool grow = false; struct stat st; - pid_t pid = strtol(dirent.d_name, &end, 10); + pid_t pid = strtol(dirent->d_name, &end, 10); if (*end) /* only interested in proper numerical dirents */ continue; - snprintf(path, sizeof(path), "/proc/%s", dirent.d_name); + snprintf(path, sizeof(path), "/proc/%s", dirent->d_name); if (stat(path, &st) != 0) continue; |