From: Roland McGrath Date: Tue, 25 Apr 2006 07:48:03 +0000 (+0000) Subject: 2006-04-25 Roland McGrath X-Git-Tag: v4.5.18~280 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb9def6975f28933ada9d35f05c6fba9ab3fe1fd;p=strace 2006-04-25 Roland McGrath * strace.c (main): Fail when -c is given with -ff. * strace.1: Note their incompatibility. Fixes RH#187847. --- diff --git a/strace.1 b/strace.1 index 31c0a984..aa79d6e8 100644 --- a/strace.1 +++ b/strace.1 @@ -220,7 +220,8 @@ Here the second argument represents the full set of all signals. .B \-c Count time, calls, and errors for each system call and report a summary on program exit. On Linux, this attempts to show system time (CPU time spent -running in the kernel) independent of wall clock time. +running in the kernel) independent of wall clock time. If -c is used with +-f or -F (below), only aggregate totals for all traced processes are kept. .TP .B \-d Show some debugging output of @@ -254,6 +255,7 @@ If the option is in effect, each processes trace is written to .I filename.pid where pid is the numeric process id of each process. +This is incompatible with -c, since no per-process counts are kept. .TP .B \-F Attempt to follow diff --git a/strace.c b/strace.c index 95ab48de..1553fb59 100644 --- a/strace.c +++ b/strace.c @@ -314,6 +314,13 @@ char *argv[]; if ((optind == argc) == !pflag_seen) usage(stderr, 1); + if (followfork > 1 && cflag) { + fprintf(stderr, + "%s: -c and -ff are mutually exclusive options\n", + progname); + exit(1); + } + /* See if they want to run as another user. */ if (username != NULL) { struct passwd *pent;