Skip to content

Conversation

@YangKeao
Copy link
Member

@YangKeao YangKeao commented Oct 13, 2025

close #281

  1. Initialize the FramehopUnwinder before the first call to the perf_signal_handler.
  2. Add a test to make sure the signal handler doesn't have memory allocation.
  3. Modify the github action to run related tests for framehop. I believe framehop will be a better choice (than backtrace-rs) in the future.
  4. Modify the code to use spin::RwLock instead of the static mut, though there is no safety issue actually.

Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@YangKeao YangKeao merged commit 01cff82 into tikv:master Oct 15, 2025
24 checks passed
{
unsafe { UNWINDER.iter_frames(ctx, cb) };
// For Linux, this `try_write` should always succeed, because `SIGPROF` will never be delivered to
// another thread while the signal handler is running. However, I'm not sure about other OSes, so

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SIGPROF will never be delivered to another thread while the signal handler is running

Why? Do you have any pointers to source/documentation how we can double check that?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SIGPROF seem to be delivered concurrently to multiple threads , can you double check please https://gist.github.com/korniltsev-grafanista/340064ee2a80b0fe9f95f64b29b13879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allocation in perf perf_signal_handler

3 participants