Commit b9d40b7b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'perf-fixes-for-linus-2' of...

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
parents 7c1632ba e13dbd7d
...@@ -126,6 +126,7 @@ header-y += nfs_mount.h ...@@ -126,6 +126,7 @@ header-y += nfs_mount.h
header-y += nl80211.h header-y += nl80211.h
header-y += param.h header-y += param.h
header-y += pci_regs.h header-y += pci_regs.h
header-y += perf_event.h
header-y += pfkeyv2.h header-y += pfkeyv2.h
header-y += pg.h header-y += pg.h
header-y += phantom.h header-y += phantom.h
......
...@@ -166,7 +166,7 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s) ...@@ -166,7 +166,7 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n",
SYSCALL_FIELD(int, nr), SYSCALL_FIELD(int, nr),
SYSCALL_FIELD(unsigned long, ret)); SYSCALL_FIELD(long, ret));
if (!ret) if (!ret)
return 0; return 0;
...@@ -212,7 +212,7 @@ int syscall_exit_define_fields(struct ftrace_event_call *call) ...@@ -212,7 +212,7 @@ int syscall_exit_define_fields(struct ftrace_event_call *call)
if (ret) if (ret)
return ret; return ret;
ret = trace_define_field(call, SYSCALL_FIELD(unsigned long, ret), 0, ret = trace_define_field(call, SYSCALL_FIELD(long, ret), 0,
FILTER_OTHER); FILTER_OTHER);
return ret; return ret;
......
...@@ -41,6 +41,7 @@ static int raw_samples = 0; ...@@ -41,6 +41,7 @@ static int raw_samples = 0;
static int system_wide = 0; static int system_wide = 0;
static int profile_cpu = -1; static int profile_cpu = -1;
static pid_t target_pid = -1; static pid_t target_pid = -1;
static pid_t child_pid = -1;
static int inherit = 1; static int inherit = 1;
static int force = 0; static int force = 0;
static int append_file = 0; static int append_file = 0;
...@@ -184,6 +185,9 @@ static void sig_handler(int sig) ...@@ -184,6 +185,9 @@ static void sig_handler(int sig)
static void sig_atexit(void) static void sig_atexit(void)
{ {
if (child_pid != -1)
kill(child_pid, SIGTERM);
if (signr == -1) if (signr == -1)
return; return;
...@@ -610,6 +614,8 @@ static int __cmd_record(int argc, const char **argv) ...@@ -610,6 +614,8 @@ static int __cmd_record(int argc, const char **argv)
exit(-1); exit(-1);
} }
} }
child_pid = pid;
} }
if (realtime_prio) { if (realtime_prio) {
......
...@@ -69,7 +69,8 @@ static int run_idx = 0; ...@@ -69,7 +69,8 @@ static int run_idx = 0;
static int run_count = 1; static int run_count = 1;
static int inherit = 1; static int inherit = 1;
static int scale = 1; static int scale = 1;
static int target_pid = -1; static pid_t target_pid = -1;
static pid_t child_pid = -1;
static int null_run = 0; static int null_run = 0;
static int fd[MAX_NR_CPUS][MAX_COUNTERS]; static int fd[MAX_NR_CPUS][MAX_COUNTERS];
...@@ -285,6 +286,8 @@ static int run_perf_stat(int argc __used, const char **argv) ...@@ -285,6 +286,8 @@ static int run_perf_stat(int argc __used, const char **argv)
exit(-1); exit(-1);
} }
child_pid = pid;
/* /*
* Wait for the child to be ready to exec. * Wait for the child to be ready to exec.
*/ */
...@@ -433,6 +436,9 @@ static void skip_signal(int signo) ...@@ -433,6 +436,9 @@ static void skip_signal(int signo)
static void sig_atexit(void) static void sig_atexit(void)
{ {
if (child_pid != -1)
kill(child_pid, SIGTERM);
if (signr == -1) if (signr == -1)
return; return;
......
...@@ -219,10 +219,6 @@ static int __cmd_trace(void) ...@@ -219,10 +219,6 @@ static int __cmd_trace(void)
more: more:
event = (event_t *)(buf + head); event = (event_t *)(buf + head);
size = event->header.size;
if (!size)
size = 8;
if (head + event->header.size >= page_size * mmap_window) { if (head + event->header.size >= page_size * mmap_window) {
unsigned long shift = page_size * (head / page_size); unsigned long shift = page_size * (head / page_size);
int res; int res;
...@@ -237,7 +233,6 @@ static int __cmd_trace(void) ...@@ -237,7 +233,6 @@ static int __cmd_trace(void)
size = event->header.size; size = event->header.size;
if (!size || process_event(event, offset, head) < 0) { if (!size || process_event(event, offset, head) < 0) {
/* /*
...@@ -290,7 +285,6 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used) ...@@ -290,7 +285,6 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
usage_with_options(annotate_usage, options); usage_with_options(annotate_usage, options);
} }
setup_pager(); setup_pager();
return __cmd_trace(); return __cmd_trace();
......
...@@ -324,8 +324,7 @@ static inline int elf_sym__is_function(const GElf_Sym *sym) ...@@ -324,8 +324,7 @@ static inline int elf_sym__is_function(const GElf_Sym *sym)
{ {
return elf_sym__type(sym) == STT_FUNC && return elf_sym__type(sym) == STT_FUNC &&
sym->st_name != 0 && sym->st_name != 0 &&
sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_UNDEF;
sym->st_size != 0;
} }
static inline int elf_sym__is_label(const GElf_Sym *sym) static inline int elf_sym__is_label(const GElf_Sym *sym)
......
...@@ -1968,10 +1968,11 @@ static const struct flag flags[] = { ...@@ -1968,10 +1968,11 @@ static const struct flag flags[] = {
{ "NET_TX_SOFTIRQ", 2 }, { "NET_TX_SOFTIRQ", 2 },
{ "NET_RX_SOFTIRQ", 3 }, { "NET_RX_SOFTIRQ", 3 },
{ "BLOCK_SOFTIRQ", 4 }, { "BLOCK_SOFTIRQ", 4 },
{ "TASKLET_SOFTIRQ", 5 }, { "BLOCK_IOPOLL_SOFTIRQ", 5 },
{ "SCHED_SOFTIRQ", 6 }, { "TASKLET_SOFTIRQ", 6 },
{ "HRTIMER_SOFTIRQ", 7 }, { "SCHED_SOFTIRQ", 7 },
{ "RCU_SOFTIRQ", 8 }, { "HRTIMER_SOFTIRQ", 8 },
{ "RCU_SOFTIRQ", 9 },
{ "HRTIMER_NORESTART", 0 }, { "HRTIMER_NORESTART", 0 },
{ "HRTIMER_RESTART", 1 }, { "HRTIMER_RESTART", 1 },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment