Skip to content

Commit f50ce15

Browse files
committed
Track creator_tid in RecordTask
1 parent 2a740f6 commit f50ce15

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/RecordTask.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ RecordTask::RecordTask(RecordSession& session, pid_t _tid, uint32_t serial,
178178
emulated_ptrace_seized(false),
179179
in_wait_type(WAIT_TYPE_NONE),
180180
in_wait_pid(0),
181+
creator_tid(0),
181182
emulated_stop_type(NOT_STOPPED),
182183
blocked_sigs_dirty(true),
183184
syscallbuf_blocked_sigs_generation(0),
@@ -333,6 +334,9 @@ Task* RecordTask::clone(CloneReason reason, int flags, remote_ptr<void> stack,
333334
} else {
334335
LOG(debug) << "(clone child not enabling CLEARTID)";
335336
}
337+
if (reason == TRACEE_CLONE) {
338+
rt->creator_tid = tid;
339+
}
336340
}
337341
return t;
338342
}

src/RecordTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ class RecordTask final : public Task {
720720
WaitType in_wait_type;
721721
int in_wait_options;
722722
pid_t in_wait_pid;
723+
pid_t creator_tid;
723724

724725
// Signal handler state
725726

0 commit comments

Comments
 (0)