aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2013-03-13 01:07:28 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-03-15 12:06:08 -0400
commited8996a6d59b9eb00a50d7d30887ba9f28eb4bb0 (patch)
tree18362dcebb3eb506a42c8cf2910e770eb67b8dca /tools/perf
parentc1ad050caad5fbff13fd2f54f49e184bd71de90d (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.c22
-rw-r--r--tools/perf/util/machine.h1
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
1006static 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
1006int machine__process_exit_event(struct machine *machine, union perf_event *event) 1017int 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
1042void 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
1053static bool symbol__match_parent_regex(struct symbol *sym) 1053static 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
99struct thread *machine__findnew_thread(struct machine *machine, pid_t pid); 99struct thread *machine__findnew_thread(struct machine *machine, pid_t pid);
100void machine__remove_thread(struct machine *machine, struct thread *th);
101 100
102size_t machine__fprintf(struct machine *machine, FILE *fp); 101size_t machine__fprintf(struct machine *machine, FILE *fp);
103 102