diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-08 15:05:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-08 15:05:00 -0400 |
commit | b9d40b7b1e349bdc5c174b4ef1a333e62f7d749c (patch) | |
tree | f5c2d85ffb1f1dd21ae8254723ea9c595cf200d5 | |
parent | 7c1632ba76d94b4847fde79f67faa91ef8571fe9 (diff) | |
parent | e13dbd7d75d1ecc315c6e3071b3c4e8fba4f6bec (diff) |
Merge branch 'perf-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf_events: Make ABI definitions available to userspace
perf tools: elf_sym__is_function() should accept "zero" sized functions
tracing/syscalls: Use long for syscall ret format and field definitions
perf trace: Update eval_flag() flags array to match interrupt.h
perf trace: Remove unused code in builtin-trace.c
perf: Propagate term signal to child
-rw-r--r-- | include/linux/Kbuild | 1 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 6 | ||||
-rw-r--r-- | tools/perf/builtin-stat.c | 8 | ||||
-rw-r--r-- | tools/perf/builtin-trace.c | 6 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 3 | ||||
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 9 |
7 files changed, 22 insertions, 15 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index cff4a101f266..3f384d4b163a 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -126,6 +126,7 @@ header-y += nfs_mount.h | |||
126 | header-y += nl80211.h | 126 | header-y += nl80211.h |
127 | header-y += param.h | 127 | header-y += param.h |
128 | header-y += pci_regs.h | 128 | header-y += pci_regs.h |
129 | header-y += perf_event.h | ||
129 | header-y += pfkeyv2.h | 130 | header-y += pfkeyv2.h |
130 | header-y += pg.h | 131 | header-y += pg.h |
131 | header-y += phantom.h | 132 | header-y += phantom.h |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 9fbce6c9d2e1..527e17eae575 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -166,7 +166,7 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s) | |||
166 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" | 166 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" |
167 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", | 167 | "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", |
168 | SYSCALL_FIELD(int, nr), | 168 | SYSCALL_FIELD(int, nr), |
169 | SYSCALL_FIELD(unsigned long, ret)); | 169 | SYSCALL_FIELD(long, ret)); |
170 | if (!ret) | 170 | if (!ret) |
171 | return 0; | 171 | return 0; |
172 | 172 | ||
@@ -212,7 +212,7 @@ int syscall_exit_define_fields(struct ftrace_event_call *call) | |||
212 | if (ret) | 212 | if (ret) |
213 | return ret; | 213 | return ret; |
214 | 214 | ||
215 | ret = trace_define_field(call, SYSCALL_FIELD(unsigned long, ret), 0, | 215 | ret = trace_define_field(call, SYSCALL_FIELD(long, ret), 0, |
216 | FILTER_OTHER); | 216 | FILTER_OTHER); |
217 | 217 | ||
218 | return ret; | 218 | return ret; |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index a5a050af8e7d..3eeef339c787 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -41,6 +41,7 @@ static int raw_samples = 0; | |||
41 | static int system_wide = 0; | 41 | static int system_wide = 0; |
42 | static int profile_cpu = -1; | 42 | static int profile_cpu = -1; |
43 | static pid_t target_pid = -1; | 43 | static pid_t target_pid = -1; |
44 | static pid_t child_pid = -1; | ||
44 | static int inherit = 1; | 45 | static int inherit = 1; |
45 | static int force = 0; | 46 | static int force = 0; |
46 | static int append_file = 0; | 47 | static int append_file = 0; |
@@ -184,6 +185,9 @@ static void sig_handler(int sig) | |||
184 | 185 | ||
185 | static void sig_atexit(void) | 186 | static void sig_atexit(void) |
186 | { | 187 | { |
188 | if (child_pid != -1) | ||
189 | kill(child_pid, SIGTERM); | ||
190 | |||
187 | if (signr == -1) | 191 | if (signr == -1) |
188 | return; | 192 | return; |
189 | 193 | ||
@@ -610,6 +614,8 @@ static int __cmd_record(int argc, const char **argv) | |||
610 | exit(-1); | 614 | exit(-1); |
611 | } | 615 | } |
612 | } | 616 | } |
617 | |||
618 | child_pid = pid; | ||
613 | } | 619 | } |
614 | 620 | ||
615 | if (realtime_prio) { | 621 | if (realtime_prio) { |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index e5f6ece65a13..3db31e7bf173 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -69,7 +69,8 @@ static int run_idx = 0; | |||
69 | static int run_count = 1; | 69 | static int run_count = 1; |
70 | static int inherit = 1; | 70 | static int inherit = 1; |
71 | static int scale = 1; | 71 | static int scale = 1; |
72 | static int target_pid = -1; | 72 | static pid_t target_pid = -1; |
73 | static pid_t child_pid = -1; | ||
73 | static int null_run = 0; | 74 | static int null_run = 0; |
74 | 75 | ||
75 | static int fd[MAX_NR_CPUS][MAX_COUNTERS]; | 76 | static int fd[MAX_NR_CPUS][MAX_COUNTERS]; |
@@ -285,6 +286,8 @@ static int run_perf_stat(int argc __used, const char **argv) | |||
285 | exit(-1); | 286 | exit(-1); |
286 | } | 287 | } |
287 | 288 | ||
289 | child_pid = pid; | ||
290 | |||
288 | /* | 291 | /* |
289 | * Wait for the child to be ready to exec. | 292 | * Wait for the child to be ready to exec. |
290 | */ | 293 | */ |
@@ -433,6 +436,9 @@ static void skip_signal(int signo) | |||
433 | 436 | ||
434 | static void sig_atexit(void) | 437 | static void sig_atexit(void) |
435 | { | 438 | { |
439 | if (child_pid != -1) | ||
440 | kill(child_pid, SIGTERM); | ||
441 | |||
436 | if (signr == -1) | 442 | if (signr == -1) |
437 | return; | 443 | return; |
438 | 444 | ||
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index e9d256e2f47d..0c5e4f72f2ba 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -219,10 +219,6 @@ remap: | |||
219 | more: | 219 | more: |
220 | event = (event_t *)(buf + head); | 220 | event = (event_t *)(buf + head); |
221 | 221 | ||
222 | size = event->header.size; | ||
223 | if (!size) | ||
224 | size = 8; | ||
225 | |||
226 | if (head + event->header.size >= page_size * mmap_window) { | 222 | if (head + event->header.size >= page_size * mmap_window) { |
227 | unsigned long shift = page_size * (head / page_size); | 223 | unsigned long shift = page_size * (head / page_size); |
228 | int res; | 224 | int res; |
@@ -237,7 +233,6 @@ more: | |||
237 | 233 | ||
238 | size = event->header.size; | 234 | size = event->header.size; |
239 | 235 | ||
240 | |||
241 | if (!size || process_event(event, offset, head) < 0) { | 236 | if (!size || process_event(event, offset, head) < 0) { |
242 | 237 | ||
243 | /* | 238 | /* |
@@ -290,7 +285,6 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used) | |||
290 | usage_with_options(annotate_usage, options); | 285 | usage_with_options(annotate_usage, options); |
291 | } | 286 | } |
292 | 287 | ||
293 | |||
294 | setup_pager(); | 288 | setup_pager(); |
295 | 289 | ||
296 | return __cmd_trace(); | 290 | return __cmd_trace(); |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 559fb06210f5..47ea0609a760 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -324,8 +324,7 @@ static inline int elf_sym__is_function(const GElf_Sym *sym) | |||
324 | { | 324 | { |
325 | return elf_sym__type(sym) == STT_FUNC && | 325 | return elf_sym__type(sym) == STT_FUNC && |
326 | sym->st_name != 0 && | 326 | sym->st_name != 0 && |
327 | sym->st_shndx != SHN_UNDEF && | 327 | sym->st_shndx != SHN_UNDEF; |
328 | sym->st_size != 0; | ||
329 | } | 328 | } |
330 | 329 | ||
331 | static inline int elf_sym__is_label(const GElf_Sym *sym) | 330 | static inline int elf_sym__is_label(const GElf_Sym *sym) |
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index f6a8437141c8..55b41b9e3834 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -1968,10 +1968,11 @@ static const struct flag flags[] = { | |||
1968 | { "NET_TX_SOFTIRQ", 2 }, | 1968 | { "NET_TX_SOFTIRQ", 2 }, |
1969 | { "NET_RX_SOFTIRQ", 3 }, | 1969 | { "NET_RX_SOFTIRQ", 3 }, |
1970 | { "BLOCK_SOFTIRQ", 4 }, | 1970 | { "BLOCK_SOFTIRQ", 4 }, |
1971 | { "TASKLET_SOFTIRQ", 5 }, | 1971 | { "BLOCK_IOPOLL_SOFTIRQ", 5 }, |
1972 | { "SCHED_SOFTIRQ", 6 }, | 1972 | { "TASKLET_SOFTIRQ", 6 }, |
1973 | { "HRTIMER_SOFTIRQ", 7 }, | 1973 | { "SCHED_SOFTIRQ", 7 }, |
1974 | { "RCU_SOFTIRQ", 8 }, | 1974 | { "HRTIMER_SOFTIRQ", 8 }, |
1975 | { "RCU_SOFTIRQ", 9 }, | ||
1975 | 1976 | ||
1976 | { "HRTIMER_NORESTART", 0 }, | 1977 | { "HRTIMER_NORESTART", 0 }, |
1977 | { "HRTIMER_RESTART", 1 }, | 1978 | { "HRTIMER_RESTART", 1 }, |