diff options
author | David Ahern <dsahern@gmail.com> | 2013-03-13 01:07:28 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-03-15 12:06:08 -0400 |
commit | ed8996a6d59b9eb00a50d7d30887ba9f28eb4bb0 (patch) | |
tree | 18362dcebb3eb506a42c8cf2910e770eb67b8dca /tools/perf | |
parent | c1ad050caad5fbff13fd2f54f49e184bd71de90d (diff) |
perf machine: Move machine__remove_thread and make static
As the now only user, machine__process_exit_event, that is what tools
use to process PERF_RECORD_EXIT events, is on the same object file.
Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1363151248-16674-5-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/machine.c | 22 | ||||
-rw-r--r-- | tools/perf/util/machine.h | 1 |
2 files changed, 11 insertions, 12 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index efdb38e65a92..c5e3b123782b 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1003,6 +1003,17 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event | |||
1003 | return 0; | 1003 | return 0; |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | static void machine__remove_thread(struct machine *machine, struct thread *th) | ||
1007 | { | ||
1008 | machine->last_match = NULL; | ||
1009 | rb_erase(&th->rb_node, &machine->threads); | ||
1010 | /* | ||
1011 | * We may have references to this thread, for instance in some hist_entry | ||
1012 | * instances, so just move them to a separate list. | ||
1013 | */ | ||
1014 | list_add_tail(&th->node, &machine->dead_threads); | ||
1015 | } | ||
1016 | |||
1006 | int machine__process_exit_event(struct machine *machine, union perf_event *event) | 1017 | int machine__process_exit_event(struct machine *machine, union perf_event *event) |
1007 | { | 1018 | { |
1008 | struct thread *thread = machine__find_thread(machine, event->fork.tid); | 1019 | struct thread *thread = machine__find_thread(machine, event->fork.tid); |
@@ -1039,17 +1050,6 @@ int machine__process_event(struct machine *machine, union perf_event *event) | |||
1039 | return ret; | 1050 | return ret; |
1040 | } | 1051 | } |
1041 | 1052 | ||
1042 | void machine__remove_thread(struct machine *machine, struct thread *th) | ||
1043 | { | ||
1044 | machine->last_match = NULL; | ||
1045 | rb_erase(&th->rb_node, &machine->threads); | ||
1046 | /* | ||
1047 | * We may have references to this thread, for instance in some hist_entry | ||
1048 | * instances, so just move them to a separate list. | ||
1049 | */ | ||
1050 | list_add_tail(&th->node, &machine->dead_threads); | ||
1051 | } | ||
1052 | |||
1053 | static bool symbol__match_parent_regex(struct symbol *sym) | 1053 | static bool symbol__match_parent_regex(struct symbol *sym) |
1054 | { | 1054 | { |
1055 | if (sym->name && !regexec(&parent_regex, sym->name, 0, NULL, 0)) | 1055 | if (sym->name && !regexec(&parent_regex, sym->name, 0, NULL, 0)) |
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index 5ac5892f2326..e0b2c00b2e75 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h | |||
@@ -97,7 +97,6 @@ static inline bool machine__is_host(struct machine *machine) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | struct thread *machine__findnew_thread(struct machine *machine, pid_t pid); | 99 | struct thread *machine__findnew_thread(struct machine *machine, pid_t pid); |
100 | void machine__remove_thread(struct machine *machine, struct thread *th); | ||
101 | 100 | ||
102 | size_t machine__fprintf(struct machine *machine, FILE *fp); | 101 | size_t machine__fprintf(struct machine *machine, FILE *fp); |
103 | 102 | ||