Re: [PATCH v12 06/14] unwind_user/deferred: Add deferred unwinding interface

From
Steven Rostedt <rostedt@goodmis.org>
Date
2025-07-02 16:42:24
Also in
bpf, lkml
Reply to
Peter Zijlstra, 2025-07-02
On Wed, 2 Jul 2025 18:36:09 +0200
Peter Zijlstra [off-list ref] wrote:
quoted
+static u64 get_timestamp(struct unwind_task_info *info)
+{
+	lockdep_assert_irqs_disabled();
+
+	if (!info->timestamp)
+		info->timestamp = local_clock();
+
+	return info->timestamp;
+}  
I'm very hesitant about this. Modern hardware can do this, but older
hardware (think Intel Core and AMD Bulldozer etc hardware) might
struggle with this. They don't have stable TSC and as such will use
the magic in kernel/sched/clock.c; which can get stuck on a window
edge for a little bit and re-use timestamps.
Well, the idea of using timestamps came from Microsoft as that's what
they do for a similar feature. It just seemed like an easier approach.
But I could definitely go back to the "cookie" idea that is just a per
cpu counter (with the CPU number as part of the cookie).

As the timestamp is likely not going to be as useful as it is with
Microsoft as there's no guarantee that the timestamp counter used is
the same as the timestamp used by the tracer asking for this, the cookie
approach may indeed be better.

-- Steve
Thread (51 messages) 51 messages, 6 authors, last reply 2025-07-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help