diff options
| author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2009-12-14 19:23:03 +0100 |
|---|---|---|
| committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2009-12-14 19:23:03 +0100 |
| commit | 559300bc0ef7ccd541656f1189d38e7088389559 (patch) | |
| tree | cd1682881ca4246e9c5a1e8632be4bdd9d9706c6 /tools/perf/builtin-record.c | |
| parent | 5416bf33f92a4104dbcd6062bf377c8421ca3cfd (diff) | |
| parent | 22763c5cf3690a681551162c15d34d935308c8d7 (diff) | |
| download | kernel-crypto-559300bc0ef7ccd541656f1189d38e7088389559.tar.gz kernel-crypto-559300bc0ef7ccd541656f1189d38e7088389559.tar.xz kernel-crypto-559300bc0ef7ccd541656f1189d38e7088389559.zip | |
Merge commit 'v2.6.32'
Conflicts:
arch/avr32/mach-at32ap/include/mach/cpu.h
Diffstat (limited to 'tools/perf/builtin-record.c')
| -rw-r--r-- | tools/perf/builtin-record.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index a5a050af8e7..a4be453fc8a 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -41,6 +41,7 @@ static int raw_samples = 0; static int system_wide = 0; static int profile_cpu = -1; static pid_t target_pid = -1; +static pid_t child_pid = -1; static int inherit = 1; static int force = 0; static int append_file = 0; @@ -184,6 +185,9 @@ static void sig_handler(int sig) static void sig_atexit(void) { + if (child_pid != -1) + kill(child_pid, SIGTERM); + if (signr == -1) return; @@ -422,7 +426,7 @@ try_again: if (fd[nr_cpu][counter] < 0) { int err = errno; - if (err == EPERM) + if (err == EPERM || err == EACCES) die("Permission error - are you root?\n"); else if (err == ENODEV && profile_cpu != -1) die("No such device - did you specify an out-of-range profile CPU?\n"); @@ -610,6 +614,8 @@ static int __cmd_record(int argc, const char **argv) exit(-1); } } + + child_pid = pid; } if (realtime_prio) { |
