aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r--tools/perf/util/thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 40399cbcca77..6feeb88eb5b0 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -7,17 +7,17 @@
7#include "util.h" 7#include "util.h"
8#include "debug.h" 8#include "debug.h"
9 9
10struct thread *thread__new(pid_t pid) 10struct thread *thread__new(pid_t tid)
11{ 11{
12 struct thread *self = zalloc(sizeof(*self)); 12 struct thread *self = zalloc(sizeof(*self));
13 13
14 if (self != NULL) { 14 if (self != NULL) {
15 map_groups__init(&self->mg); 15 map_groups__init(&self->mg);
16 self->pid = pid; 16 self->tid = tid;
17 self->ppid = -1; 17 self->ppid = -1;
18 self->comm = malloc(32); 18 self->comm = malloc(32);
19 if (self->comm) 19 if (self->comm)
20 snprintf(self->comm, 32, ":%d", self->pid); 20 snprintf(self->comm, 32, ":%d", self->tid);
21 } 21 }
22 22
23 return self; 23 return self;
@@ -57,7 +57,7 @@ int thread__comm_len(struct thread *self)
57 57
58size_t thread__fprintf(struct thread *thread, FILE *fp) 58size_t thread__fprintf(struct thread *thread, FILE *fp)
59{ 59{
60 return fprintf(fp, "Thread %d %s\n", thread->pid, thread->comm) + 60 return fprintf(fp, "Thread %d %s\n", thread->tid, thread->comm) +
61 map_groups__fprintf(&thread->mg, verbose, fp); 61 map_groups__fprintf(&thread->mg, verbose, fp);
62} 62}
63 63
@@ -84,7 +84,7 @@ int thread__fork(struct thread *self, struct thread *parent)
84 if (map_groups__clone(&self->mg, &parent->mg, i) < 0) 84 if (map_groups__clone(&self->mg, &parent->mg, i) < 0)
85 return -ENOMEM; 85 return -ENOMEM;
86 86
87 self->ppid = parent->pid; 87 self->ppid = parent->tid;
88 88
89 return 0; 89 return 0;
90} 90}