diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-07-05 08:30:55 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-07-05 08:30:58 +0200 |
commit | 08f8ba07998ab1b9efcdd3f28dadf6866a605ddb (patch) | |
tree | 8e09855446f7b0312bb729d4b539090756e57927 /tools | |
parent | 0879b100f3c187257729f36cba33d96ec2875766 (diff) | |
parent | 815c4163b6c8ebf8152f42b0a5fd015cfdcedc78 (diff) |
Merge commit 'v2.6.35-rc4' into perf/core
Merge reason: Pick up the latest perf fixes
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-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 1f7ecd47f49..9a448b47400 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); |