diff options
| -rw-r--r-- | tools/perf/util/build-id.c | 8 | ||||
| -rw-r--r-- | tools/perf/util/machine.c | 4 | ||||
| -rw-r--r-- | tools/perf/util/machine.h | 1 |
3 files changed, 4 insertions, 9 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index f7fb2587df69..61867dff5d5a 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
| @@ -59,12 +59,8 @@ static int perf_event__exit_del_thread(struct perf_tool *tool __maybe_unused, | |||
| 59 | dump_printf("(%d:%d):(%d:%d)\n", event->fork.pid, event->fork.tid, | 59 | dump_printf("(%d:%d):(%d:%d)\n", event->fork.pid, event->fork.tid, |
| 60 | event->fork.ppid, event->fork.ptid); | 60 | event->fork.ppid, event->fork.ptid); |
| 61 | 61 | ||
| 62 | if (thread) { | 62 | if (thread) |
| 63 | rb_erase(&thread->rb_node, &machine->threads); | 63 | machine__remove_thread(machine, thread); |
| 64 | if (machine->last_match == thread) | ||
| 65 | thread__zput(machine->last_match); | ||
| 66 | thread__put(thread); | ||
| 67 | } | ||
| 68 | 64 | ||
| 69 | return 0; | 65 | return 0; |
| 70 | } | 66 | } |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 9c380a2caa54..527e032e24f6 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
| @@ -14,8 +14,6 @@ | |||
| 14 | #include "unwind.h" | 14 | #include "unwind.h" |
| 15 | #include "linux/hash.h" | 15 | #include "linux/hash.h" |
| 16 | 16 | ||
| 17 | static void machine__remove_thread(struct machine *machine, struct thread *th); | ||
| 18 | |||
| 19 | static void dsos__init(struct dsos *dsos) | 17 | static void dsos__init(struct dsos *dsos) |
| 20 | { | 18 | { |
| 21 | INIT_LIST_HEAD(&dsos->head); | 19 | INIT_LIST_HEAD(&dsos->head); |
| @@ -1256,7 +1254,7 @@ out_problem: | |||
| 1256 | return 0; | 1254 | return 0; |
| 1257 | } | 1255 | } |
| 1258 | 1256 | ||
| 1259 | static void machine__remove_thread(struct machine *machine, struct thread *th) | 1257 | void machine__remove_thread(struct machine *machine, struct thread *th) |
| 1260 | { | 1258 | { |
| 1261 | if (machine->last_match == th) | 1259 | if (machine->last_match == th) |
| 1262 | thread__zput(machine->last_match); | 1260 | thread__zput(machine->last_match); |
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index e2faf3b47e7b..6d64cedb9d1e 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h | |||
| @@ -120,6 +120,7 @@ int machine__init(struct machine *machine, const char *root_dir, pid_t pid); | |||
| 120 | void machine__exit(struct machine *machine); | 120 | void machine__exit(struct machine *machine); |
| 121 | void machine__delete_threads(struct machine *machine); | 121 | void machine__delete_threads(struct machine *machine); |
| 122 | void machine__delete(struct machine *machine); | 122 | void machine__delete(struct machine *machine); |
| 123 | void machine__remove_thread(struct machine *machine, struct thread *th); | ||
| 123 | 124 | ||
| 124 | struct branch_info *sample__resolve_bstack(struct perf_sample *sample, | 125 | struct branch_info *sample__resolve_bstack(struct perf_sample *sample, |
| 125 | struct addr_location *al); | 126 | struct addr_location *al); |
