]> granicus.if.org Git - strace/commitdiff
2006-04-25 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Tue, 25 Apr 2006 07:48:03 +0000 (07:48 +0000)
committerRoland McGrath <roland@redhat.com>
Tue, 25 Apr 2006 07:48:03 +0000 (07:48 +0000)
* strace.c (main): Fail when -c is given with -ff.
* strace.1: Note their incompatibility.
Fixes RH#187847.

strace.1
strace.c

index 31c0a984d427fa51b509ab62ef08e2a197272e14..aa79d6e8afedd78a014a21fe2f5b2a58207617c2 100644 (file)
--- 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
index 95ab48dec777dfbb8ebcc2325ec9c41d526b181f..1553fb59aff577323db030ed32a38faff45562d2 100644 (file)
--- 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;