aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-08 15:05:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-08 15:05:00 -0400
commitb9d40b7b1e349bdc5c174b4ef1a333e62f7d749c (patch)
treef5c2d85ffb1f1dd21ae8254723ea9c595cf200d5
parent7c1632ba76d94b4847fde79f67faa91ef8571fe9 (diff)
parente13dbd7d75d1ecc315c6e3071b3c4e8fba4f6bec (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/Kbuild1
-rw-r--r--kernel/trace/trace_syscalls.c4
-rw-r--r--tools/perf/builtin-record.c6
-rw-r--r--tools/perf/builtin-stat.c8
-rw-r--r--tools/perf/builtin-trace.c6
-rw-r--r--tools/perf/util/symbol.c3
-rw-r--r--tools/perf/util/trace-event-parse.c9
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
126header-y += nl80211.h 126header-y += nl80211.h
127header-y += param.h 127header-y += param.h
128header-y += pci_regs.h 128header-y += pci_regs.h
129header-y += perf_event.h
129header-y += pfkeyv2.h 130header-y += pfkeyv2.h
130header-y += pg.h 131header-y += pg.h
131header-y += phantom.h 132header-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;
41static int system_wide = 0; 41static int system_wide = 0;
42static int profile_cpu = -1; 42static int profile_cpu = -1;
43static pid_t target_pid = -1; 43static pid_t target_pid = -1;
44static pid_t child_pid = -1;
44static int inherit = 1; 45static int inherit = 1;
45static int force = 0; 46static int force = 0;
46static int append_file = 0; 47static int append_file = 0;
@@ -184,6 +185,9 @@ static void sig_handler(int sig)
184 185
185static void sig_atexit(void) 186static 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;
69static int run_count = 1; 69static int run_count = 1;
70static int inherit = 1; 70static int inherit = 1;
71static int scale = 1; 71static int scale = 1;
72static int target_pid = -1; 72static pid_t target_pid = -1;
73static pid_t child_pid = -1;
73static int null_run = 0; 74static int null_run = 0;
74 75
75static int fd[MAX_NR_CPUS][MAX_COUNTERS]; 76static 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
434static void sig_atexit(void) 437static 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:
219more: 219more:
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
331static inline int elf_sym__is_label(const GElf_Sym *sym) 330static 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 },