MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / signalHandler

Method signalHandler

src/perfEvents_linux.cpp:752–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

750}
751
752void PerfEvents::signalHandler(int signo, siginfo_t* siginfo, void* ucontext) {
753 if (siginfo->si_code <= 0) {
754 // Looks like an external signal; don't treat as a profiling event
755 return;
756 }
757
758 if (_ioc_enable == PERF_EVENT_IOC_ENABLE) {
759 ioctl(siginfo->si_fd, PERF_EVENT_IOC_DISABLE, 0);
760 }
761
762 if (_enabled) {
763 ExecutionEvent event(TSC::ticks());
764 u64 counter = readCounter(siginfo, ucontext);
765 Profiler::instance()->recordSample(ucontext, counter, PERF_SAMPLE, &event);
766 } else {
767 resetBuffer(OS::threadId());
768 }
769
770 ioctl(siginfo->si_fd, PERF_EVENT_IOC_RESET, 0);
771 ioctl(siginfo->si_fd, _ioc_enable, 1);
772}
773
774void PerfEvents::signalHandlerJ9(int signo, siginfo_t* siginfo, void* ucontext) {
775 if (siginfo->si_code <= 0) {

Callers

nothing calls this directly

Calls 1

recordSampleMethod · 0.80

Tested by

no test coverage detected