diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-05 07:20:53 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-05 07:20:53 +0400 |
commit | 3f7d7b4bded5bd2cc9934a2ed9a7ce68feb636b0 (patch) | |
tree | 2667a923fedcbf8324dde93f0acc17879fa7d862 /tools/perf | |
parent | ff49d74ad383f54041378144ca1a229ee9aeaa59 (diff) | |
parent | f287d332ce835f77a4f5077d2c0ef1e3f9ea42d2 (diff) | |
download | linux-3f7d7b4bded5bd2cc9934a2ed9a7ce68feb636b0.tar.xz |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf, x86: Fix incorrect branches event on AMD CPUs
perf tools: Fix find tids routine by excluding "." and ".."
x86: Send a SIGTRAP for user icebp traps
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/thread.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 1f7ecd47f499..9a448b47400c 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -7,6 +7,15 @@ #include "util.h" #include "debug.h" +/* Skip "." and ".." directories */ +static int filter(const struct dirent *dir) +{ + if (dir->d_name[0] == '.') + return 0; + else + return 1; +} + int find_all_tid(int pid, pid_t ** all_tid) { char name[256]; @@ -16,7 +25,7 @@ int find_all_tid(int pid, pid_t ** all_tid) int i; sprintf(name, "/proc/%d/task", pid); - items = scandir(name, &namelist, NULL, NULL); + items = scandir(name, &namelist, filter, NULL); if (items <= 0) return -ENOENT; *all_tid = malloc(sizeof(pid_t) * items); |