On Wed, 2 Jul 2025 14:47:10 -0400 Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote: > > AFAIR, one of the goals here is to save the cookie into the trace > to allow trace post-processing to link the event triggering the > unwinding with the deferred unwinding data. > > In order to make the trace analysis results reliable, we'd like > to avoid the following causes of uncertainty, which would > mistakenly cause the post-processing analysis to associate > a stack trace with the wrong event: > > - Thread ID re-use (exit + clone/fork), > - Thread migration, > - Events discarded (e.g. buffer full) causing missing > thread lifetime events or missing unwind-related events. > > Unless I'm missing something, the per-thread counter would have > issues with thread ID re-use during the trace lifetime. But you are missing one more thing that the trace can use, and that's the time sequence. As soon as the same thread has a new id you can assume all the older user space traces are not applicable for any new events for that thread, or any other thread with the same thread ID. Thus the only issue that can truly be a problem is if you have missed events where thread id wraps around. I guess that could be possible if a long running task finally exits and it's thread id is reused immediately. Is that a common occurrence? -- Steve.