liberty/support/specpriv-profile/api.cpp
// These functions are C-friendly front-ends
// They each produce their values over a queue to the profiler thread
// who in turn executes them off the critical path.
These functions are C-friendly front-ends
They each produce their values over a queue to the profiler thread
who in turn executes them off the critical path.
These functions are C - friendly front - ends They each produce their values over a queue to the profiler thread who in turn executes them off the critical path .
void __prof_begin()
{
  the_queue = sq_createQueue();
  __prof_capture_leading_thread_pid();
  if( fork() == 0 )
    thread_loop();
  struct sigaction action;
  action.sa_handler = *signal_helper;
  action.sa_flags = 0;
  sigemptyset( & action.sa_mask );
  sigaction( SIGHUP, &action, 0 );
  sigaction( SIGINT, &action, 0 );
  sigaction( SIGQUIT, &action, 0 );
  sigaction( SIGILL, &action, 0 );
  sigaction( SIGABRT, &action, 0 );
  sigaction( SIGFPE, &action, 0 );
  sigaction( SIGSEGV, &action, 0 );
  sigaction( SIGPIPE, &action, 0 );
  sigaction( SIGALRM, &action, 0 );
  sigaction( SIGTERM, &action, 0 );
  sigaction( SIGUSR1, &action, 0 );
  sigaction( SIGUSR2, &action, 0 );
  sigaction( SIGBUS, &action, 0 );
  sigaction( SIGPOLL, &action, 0 );
  sigaction( SIGPROF, &action, 0 );
  sigaction( SIGSYS, &action, 0 );
  sigaction( SIGTRAP, &action, 0 );
  sigaction( SIGVTALRM, &action, 0 );
  sigaction( SIGXCPU, &action, 0 );
  sigaction( SIGXFSZ, &action, 0 );
  sigaction( SIGIOT, &action, 0 );
  sigaction( SIGSTKFLT, &action, 0 );
  sigaction( SIGIO, &action, 0 );
  sigaction( SIGPWR, &action, 0 );
  sigaction( SIGSYS, &action, 0 );
  atexit( &end_helper );
}
void __prof_begin ( ) { the_queue = sq_createQueue ( ) ; __prof_capture_leading_thread_pid ( ) ; if ( fork ( ) == 0 ) thread_loop ( ) ; struct sigaction action ; action . sa_handler = * signal_helper ; action . sa_flags = 0 ; sigemptyset ( & action . sa_mask ) ; sigaction ( SIGHUP , & action , 0 ) ; sigaction ( SIGINT , & action , 0 ) ; sigaction ( SIGQUIT , & action , 0 ) ; sigaction ( SIGILL , & action , 0 ) ; sigaction ( SIGABRT , & action , 0 ) ; sigaction ( SIGFPE , & action , 0 ) ; sigaction ( SIGSEGV , & action , 0 ) ; sigaction ( SIGPIPE , & action , 0 ) ; sigaction ( SIGALRM , & action , 0 ) ; sigaction ( SIGTERM , & action , 0 ) ; sigaction ( SIGUSR1 , & action , 0 ) ; sigaction ( SIGUSR2 , & action , 0 ) ; sigaction ( SIGBUS , & action , 0 ) ; sigaction ( SIGPOLL , & action , 0 ) ; sigaction ( SIGPROF , & action , 0 ) ; sigaction ( SIGSYS , & action , 0 ) ; sigaction ( SIGTRAP , & action , 0 ) ; sigaction ( SIGVTALRM , & action , 0 ) ; sigaction ( SIGXCPU , & action , 0 ) ; sigaction ( SIGXFSZ , & action , 0 ) ; sigaction ( SIGIOT , & action , 0 ) ; sigaction ( SIGSTKFLT , & action , 0 ) ; sigaction ( SIGIO , & action , 0 ) ; sigaction ( SIGPWR , & action , 0 ) ; sigaction ( SIGSYS , & action , 0 ) ; atexit ( & end_helper ) ; }
These functions are C-friendly front-ends
They each produce their values over a queue to the profiler thread
who in turn executes them off the critical path.
These functions are C - friendly front - ends They each produce their values over a queue to the profiler thread who in turn executes them off the critical path .
// Trap any signal which will, by default, terminate the process. // According to 'man 7 signal', this is the // list of signals whose default behavior is TERM or CORE //  sigaction( SIGEMT, &action, 0 ); //  sigaction( SIGLOST, &action, 0 );