aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/thread.c2
-rw-r--r--tools/perf/util/thread.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 12c4341078f..45efb5db0d1 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -8,7 +8,7 @@
static struct thread *thread__new(pid_t pid)
{
- struct thread *self = malloc(sizeof(*self));
+ struct thread *self = calloc(1, sizeof(*self));
if (self != NULL) {
self->pid = pid;
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 665d1f3dc97..32aea3c1c2a 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -7,6 +7,7 @@ struct thread {
struct rb_node rb_node;
struct list_head maps;
pid_t pid;
+ char shortname[3];
char *comm;
};