summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-07-07 18:37:34 +1000
committerDave Airlie <airlied@redhat.com>2010-07-07 18:37:34 +1000
commit6dbe7465713f0e45f0e867105ca944978d57346e (patch)
tree448d7e5f08fa59ca15277d6567825abd74e08e60 /tools
parent023eb571a1d0eae738326042dcffa974257eb8c8 (diff)
parent815c4163b6c8ebf8152f42b0a5fd015cfdcedc78 (diff)
Merge tag 'v2.6.35-rc4' into drm-testing
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/thread.c11
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);