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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index f53fad7c0a8d..8cb47f1d8a76 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -33,6 +33,17 @@ int thread__set_comm(struct thread *self, const char *comm)
33 return self->comm ? 0 : -ENOMEM; 33 return self->comm ? 0 : -ENOMEM;
34} 34}
35 35
36int thread__comm_len(struct thread *self)
37{
38 if (!self->comm_len) {
39 if (!self->comm)
40 return 0;
41 self->comm_len = strlen(self->comm);
42 }
43
44 return self->comm_len;
45}
46
36static size_t thread__fprintf(struct thread *self, FILE *fp) 47static size_t thread__fprintf(struct thread *self, FILE *fp)
37{ 48{
38 struct rb_node *nd; 49 struct rb_node *nd;