mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
fix profiling on linux
This commit is contained in:
parent
9b9fe1bfb4
commit
7641dfad01
24
n/t.c
24
n/t.c
@ -349,7 +349,29 @@ u3t_boot(void)
|
||||
}
|
||||
#endif
|
||||
#elif defined(U3_OS_linux)
|
||||
// TODO: support profiling on linux
|
||||
{
|
||||
struct itimerval itm_v;
|
||||
struct sigaction sig_s;
|
||||
sigset_t set;
|
||||
|
||||
sig_s.sa_handler = _ct_sigaction;
|
||||
sigemptyset(&(sig_s.sa_mask));
|
||||
sig_s.sa_flags = 0;
|
||||
sigaction(SIGPROF, &sig_s, 0);
|
||||
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIGPROF);
|
||||
if ( 0 != pthread_sigmask(SIG_UNBLOCK, &set, NULL) ) {
|
||||
perror("pthread_sigmask");
|
||||
}
|
||||
|
||||
itm_v.it_interval.tv_sec = 0;
|
||||
itm_v.it_interval.tv_usec = 10000;
|
||||
// itm_v.it_interval.tv_usec = 100000;
|
||||
itm_v.it_value = itm_v.it_interval;
|
||||
|
||||
setitimer(ITIMER_PROF, &itm_v, 0);
|
||||
}
|
||||
#elif defined(U3_OS_bsd)
|
||||
// TODO: support profiling on bsd
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user