diff options
author | Mattias Andrée <maandree@kth.se> | 2020-05-30 22:58:04 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-05-30 22:58:04 +0200 |
commit | 783dc9ce1c729ce171a4a460703bdd413bce6364 (patch) | |
tree | af846446517b4c184e216fd82aa83a2c83034796 /sctrace.c | |
parent | Add todo about different (bad) behaviour under valgrind (diff) | |
download | sctrace-783dc9ce1c729ce171a4a460703bdd413bce6364.tar.gz sctrace-783dc9ce1c729ce171a4a460703bdd413bce6364.tar.bz2 sctrace-783dc9ce1c729ce171a4a460703bdd413bce6364.tar.xz |
Do not print PID numbers if only configured to trace one thread
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | sctrace.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -99,7 +99,7 @@ main(int argc, char **argv) char *outfile = NULL; FILE *outfp = stderr; const char *num = NULL; - int status, exit_value = 0, trace_event, with_argv0 = 0; + int status, exit_value = 0, trace_event, with_argv0 = 0, multiprocess = 0; unsigned long int trace_options = PTRACE_O_EXITKILL | PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC; struct process *proc, *proc2; unsigned long int event; @@ -118,6 +118,7 @@ main(int argc, char **argv) case 'f': trace_options |= PTRACE_O_TRACEFORK; trace_options |= PTRACE_O_TRACEVFORK; + multiprocess = 1; break; default: usage(); @@ -184,7 +185,7 @@ main(int argc, char **argv) } have_outfp: - set_trace_output(outfp); + setup_trace_output(outfp, multiprocess); for (;;) { pid = wait(&status); |