diff options
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r-- | tools/perf/util/thread.c | 11 |
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 | ||
36 | int 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 | |||
36 | static size_t thread__fprintf(struct thread *self, FILE *fp) | 47 | static size_t thread__fprintf(struct thread *self, FILE *fp) |
37 | { | 48 | { |
38 | struct rb_node *nd; | 49 | struct rb_node *nd; |