diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-28 15:24:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-28 15:24:43 -0400 |
commit | 5904b3b81d25166e5e39b9727645bb47937618e3 (patch) | |
tree | 2a306f8b0cdea354b3ebc157623dededcf471091 | |
parent | f3866db8f7534ba8bbb342bebcf5ede542035528 (diff) | |
parent | b70e4f0529c089b00d0a6da13106db4de1ada4c7 (diff) |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
tracing: Fix undeclared ENOSYS in include/linux/tracepoint.h
perf record: prevent kill(0, SIGTERM);
perf session: Remove threads from tree on PERF_RECORD_EXIT
perf/tracing: Fix regression of perf losing kprobe events
perf_events: Fix Intel Westmere event constraints
perf record: Don't call newt functions when not initialized
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_intel.c | 1 | ||||
-rw-r--r-- | include/linux/tracepoint.h | 1 | ||||
-rw-r--r-- | kernel/trace/trace_event_perf.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 2 | ||||
-rw-r--r-- | tools/perf/util/event.c | 4 | ||||
-rw-r--r-- | tools/perf/util/newt.c | 15 | ||||
-rw-r--r-- | tools/perf/util/session.c | 11 | ||||
-rw-r--r-- | tools/perf/util/session.h | 2 | ||||
-rw-r--r-- | tools/perf/util/thread.h | 5 |
9 files changed, 39 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index fdbc652d3feb..214ac860ebe0 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -72,6 +72,7 @@ static struct event_constraint intel_westmere_event_constraints[] = | |||
72 | INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */ | 72 | INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */ |
73 | INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */ | 73 | INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */ |
74 | INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */ | 74 | INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */ |
75 | INTEL_EVENT_CONSTRAINT(0xb3, 0x1), /* SNOOPQ_REQUEST_OUTSTANDING */ | ||
75 | EVENT_CONSTRAINT_END | 76 | EVENT_CONSTRAINT_END |
76 | }; | 77 | }; |
77 | 78 | ||
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 9a59d1f98cd4..103d1b61aacb 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -14,6 +14,7 @@ | |||
14 | * See the file COPYING for more details. | 14 | * See the file COPYING for more details. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/errno.h> | ||
17 | #include <linux/types.h> | 18 | #include <linux/types.h> |
18 | #include <linux/rcupdate.h> | 19 | #include <linux/rcupdate.h> |
19 | 20 | ||
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index e6f65887842c..8a2b73f7c068 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c | |||
@@ -96,7 +96,9 @@ int perf_trace_init(struct perf_event *p_event) | |||
96 | mutex_lock(&event_mutex); | 96 | mutex_lock(&event_mutex); |
97 | list_for_each_entry(tp_event, &ftrace_events, list) { | 97 | list_for_each_entry(tp_event, &ftrace_events, list) { |
98 | if (tp_event->event.type == event_id && | 98 | if (tp_event->event.type == event_id && |
99 | tp_event->class && tp_event->class->perf_probe && | 99 | tp_event->class && |
100 | (tp_event->class->perf_probe || | ||
101 | tp_event->class->reg) && | ||
100 | try_module_get(tp_event->mod)) { | 102 | try_module_get(tp_event->mod)) { |
101 | ret = perf_trace_event_init(tp_event, p_event); | 103 | ret = perf_trace_event_init(tp_event, p_event); |
102 | break; | 104 | break; |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index dc3435e18bde..711745f56bba 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -193,7 +193,7 @@ static void sig_handler(int sig) | |||
193 | 193 | ||
194 | static void sig_atexit(void) | 194 | static void sig_atexit(void) |
195 | { | 195 | { |
196 | if (child_pid != -1) | 196 | if (child_pid > 0) |
197 | kill(child_pid, SIGTERM); | 197 | kill(child_pid, SIGTERM); |
198 | 198 | ||
199 | if (signr == -1) | 199 | if (signr == -1) |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 1f08f008d289..2fbf6a463c81 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -538,8 +538,10 @@ int event__process_task(event_t *self, struct perf_session *session) | |||
538 | dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid, | 538 | dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid, |
539 | self->fork.ppid, self->fork.ptid); | 539 | self->fork.ppid, self->fork.ptid); |
540 | 540 | ||
541 | if (self->header.type == PERF_RECORD_EXIT) | 541 | if (self->header.type == PERF_RECORD_EXIT) { |
542 | perf_session__remove_thread(session, thread); | ||
542 | return 0; | 543 | return 0; |
544 | } | ||
543 | 545 | ||
544 | if (thread == NULL || parent == NULL || | 546 | if (thread == NULL || parent == NULL || |
545 | thread__fork(thread, parent) < 0) { | 547 | thread__fork(thread, parent) < 0) { |
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index cf182ca132fe..7537ca15900b 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c | |||
@@ -43,6 +43,9 @@ struct ui_progress *ui_progress__new(const char *title, u64 total) | |||
43 | 43 | ||
44 | if (self != NULL) { | 44 | if (self != NULL) { |
45 | int cols; | 45 | int cols; |
46 | |||
47 | if (use_browser <= 0) | ||
48 | return self; | ||
46 | newtGetScreenSize(&cols, NULL); | 49 | newtGetScreenSize(&cols, NULL); |
47 | cols -= 4; | 50 | cols -= 4; |
48 | newtCenteredWindow(cols, 1, title); | 51 | newtCenteredWindow(cols, 1, title); |
@@ -67,14 +70,22 @@ out_free_self: | |||
67 | 70 | ||
68 | void ui_progress__update(struct ui_progress *self, u64 curr) | 71 | void ui_progress__update(struct ui_progress *self, u64 curr) |
69 | { | 72 | { |
73 | /* | ||
74 | * FIXME: We should have a per UI backend way of showing progress, | ||
75 | * stdio will just show a percentage as NN%, etc. | ||
76 | */ | ||
77 | if (use_browser <= 0) | ||
78 | return; | ||
70 | newtScaleSet(self->scale, curr); | 79 | newtScaleSet(self->scale, curr); |
71 | newtRefresh(); | 80 | newtRefresh(); |
72 | } | 81 | } |
73 | 82 | ||
74 | void ui_progress__delete(struct ui_progress *self) | 83 | void ui_progress__delete(struct ui_progress *self) |
75 | { | 84 | { |
76 | newtFormDestroy(self->form); | 85 | if (use_browser > 0) { |
77 | newtPopWindow(); | 86 | newtFormDestroy(self->form); |
87 | newtPopWindow(); | ||
88 | } | ||
78 | free(self); | 89 | free(self); |
79 | } | 90 | } |
80 | 91 | ||
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 8f83a1835766..c422cd676313 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -90,6 +90,7 @@ struct perf_session *perf_session__new(const char *filename, int mode, bool forc | |||
90 | 90 | ||
91 | memcpy(self->filename, filename, len); | 91 | memcpy(self->filename, filename, len); |
92 | self->threads = RB_ROOT; | 92 | self->threads = RB_ROOT; |
93 | INIT_LIST_HEAD(&self->dead_threads); | ||
93 | self->hists_tree = RB_ROOT; | 94 | self->hists_tree = RB_ROOT; |
94 | self->last_match = NULL; | 95 | self->last_match = NULL; |
95 | self->mmap_window = 32; | 96 | self->mmap_window = 32; |
@@ -131,6 +132,16 @@ void perf_session__delete(struct perf_session *self) | |||
131 | free(self); | 132 | free(self); |
132 | } | 133 | } |
133 | 134 | ||
135 | void perf_session__remove_thread(struct perf_session *self, struct thread *th) | ||
136 | { | ||
137 | rb_erase(&th->rb_node, &self->threads); | ||
138 | /* | ||
139 | * We may have references to this thread, for instance in some hist_entry | ||
140 | * instances, so just move them to a separate list. | ||
141 | */ | ||
142 | list_add_tail(&th->node, &self->dead_threads); | ||
143 | } | ||
144 | |||
134 | static bool symbol__match_parent_regex(struct symbol *sym) | 145 | static bool symbol__match_parent_regex(struct symbol *sym) |
135 | { | 146 | { |
136 | if (sym->name && !regexec(&parent_regex, sym->name, 0, NULL, 0)) | 147 | if (sym->name && !regexec(&parent_regex, sym->name, 0, NULL, 0)) |
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 55c6881b218d..9fa0fc2a863f 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -26,6 +26,7 @@ struct perf_session { | |||
26 | unsigned long size; | 26 | unsigned long size; |
27 | unsigned long mmap_window; | 27 | unsigned long mmap_window; |
28 | struct rb_root threads; | 28 | struct rb_root threads; |
29 | struct list_head dead_threads; | ||
29 | struct thread *last_match; | 30 | struct thread *last_match; |
30 | struct machine host_machine; | 31 | struct machine host_machine; |
31 | struct rb_root machines; | 32 | struct rb_root machines; |
@@ -99,6 +100,7 @@ int perf_session__create_kernel_maps(struct perf_session *self); | |||
99 | 100 | ||
100 | int do_read(int fd, void *buf, size_t size); | 101 | int do_read(int fd, void *buf, size_t size); |
101 | void perf_session__update_sample_type(struct perf_session *self); | 102 | void perf_session__update_sample_type(struct perf_session *self); |
103 | void perf_session__remove_thread(struct perf_session *self, struct thread *th); | ||
102 | 104 | ||
103 | static inline | 105 | static inline |
104 | struct machine *perf_session__find_host_machine(struct perf_session *self) | 106 | struct machine *perf_session__find_host_machine(struct perf_session *self) |
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 1dfd9ff8bdcd..ee6bbcf277ca 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -6,7 +6,10 @@ | |||
6 | #include "symbol.h" | 6 | #include "symbol.h" |
7 | 7 | ||
8 | struct thread { | 8 | struct thread { |
9 | struct rb_node rb_node; | 9 | union { |
10 | struct rb_node rb_node; | ||
11 | struct list_head node; | ||
12 | }; | ||
10 | struct map_groups mg; | 13 | struct map_groups mg; |
11 | pid_t pid; | 14 | pid_t pid; |
12 | char shortname[3]; | 15 | char shortname[3]; |