aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2009-05-27 04:10:51 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-27 06:31:03 -0400
commitef65b2a0b3a2f82850144df6e6a7796f6d66da6b (patch)
tree14ad25a63330c8f43d91f9f211188b0e5baa9e72 /Documentation
parenta930d2c0d0a685ab955472b08baad041cc5edb4a (diff)
perf record: Fix the profiling of existing pid or whole box
Perf record bails if no command argument is provided, so you can't use naked -a or -p to profile a running task or the whole box. Allow foreground profiling of an existing pid or the entire system. [ Impact: fix command option handling bug ] Signed-off-by: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: John Kacur <jkacur@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/perf_counter/builtin-record.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index 431077a6fb77..4a068664a32a 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -354,7 +354,7 @@ static int __cmd_record(int argc, const char **argv)
354 signal(SIGCHLD, sig_handler); 354 signal(SIGCHLD, sig_handler);
355 signal(SIGINT, sig_handler); 355 signal(SIGINT, sig_handler);
356 356
357 if (target_pid == -1) { 357 if (target_pid == -1 && argc) {
358 pid = fork(); 358 pid = fork();
359 if (pid < 0) 359 if (pid < 0)
360 perror("failed to fork"); 360 perror("failed to fork");
@@ -430,7 +430,7 @@ int cmd_record(int argc, const char **argv, const char *prefix)
430 create_events_help(events_help_msg); 430 create_events_help(events_help_msg);
431 431
432 argc = parse_options(argc, argv, options, record_usage, 0); 432 argc = parse_options(argc, argv, options, record_usage, 0);
433 if (!argc) 433 if (!argc && target_pid == -1 && !system_wide)
434 usage_with_options(record_usage, options); 434 usage_with_options(record_usage, options);
435 435
436 if (!nr_counters) { 436 if (!nr_counters) {