aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--util.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/util.c b/util.c
index 7ee9c51..521f73a 100644
--- a/util.c
+++ b/util.c
@@ -25,10 +25,17 @@ tprintf(struct process *proc, const char *fmt, ...)
fmt = &fmt[1];
}
if (multiproctrace) {
- if (last_char == '\n')
- fprintf(trace_fp, "[%ju] ", (uintmax_t)proc->pid);
- else if (proc->pid != last_pid)
- fprintf(trace_fp, "\n[%ju] ", (uintmax_t)proc->pid);
+ if (proc->thread_group_leader) {
+ if (last_char == '\n')
+ fprintf(trace_fp, "[%ju, %ju] ", (uintmax_t)proc->thread_group_leader, (uintmax_t)proc->pid);
+ else if (proc->pid != last_pid)
+ fprintf(trace_fp, "\n[%ju, %ju] ", (uintmax_t)proc->thread_group_leader, (uintmax_t)proc->pid);
+ } else {
+ if (last_char == '\n')
+ fprintf(trace_fp, "[%ju] ", (uintmax_t)proc->pid);
+ else if (proc->pid != last_pid)
+ fprintf(trace_fp, "\n[%ju] ", (uintmax_t)proc->pid);
+ }
}
va_start(ap, fmt);
vfprintf(trace_fp, fmt, ap);