From 2b329d7e196f00c2e54225a3ffb82dc97894a3eb Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 27 May 2009 10:10:51 +0200 Subject: [PATCH] --- yaml --- r: 147545 b: refs/heads/master c: ef65b2a0b3a2f82850144df6e6a7796f6d66da6b h: refs/heads/master i: 147543: e467ba9ad3c9c81c5fa6f1a9628110c314b1d663 v: v3 --- [refs] | 2 +- trunk/Documentation/perf_counter/builtin-record.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 36b8ae4874a1..4d0d414503dd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a930d2c0d0a685ab955472b08baad041cc5edb4a +refs/heads/master: ef65b2a0b3a2f82850144df6e6a7796f6d66da6b diff --git a/trunk/Documentation/perf_counter/builtin-record.c b/trunk/Documentation/perf_counter/builtin-record.c index 431077a6fb77..4a068664a32a 100644 --- a/trunk/Documentation/perf_counter/builtin-record.c +++ b/trunk/Documentation/perf_counter/builtin-record.c @@ -354,7 +354,7 @@ static int __cmd_record(int argc, const char **argv) signal(SIGCHLD, sig_handler); signal(SIGINT, sig_handler); - if (target_pid == -1) { + if (target_pid == -1 && argc) { pid = fork(); if (pid < 0) perror("failed to fork"); @@ -430,7 +430,7 @@ int cmd_record(int argc, const char **argv, const char *prefix) create_events_help(events_help_msg); argc = parse_options(argc, argv, options, record_usage, 0); - if (!argc) + if (!argc && target_pid == -1 && !system_wide) usage_with_options(record_usage, options); if (!nr_counters) {