| 1 |
#pragma once |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#include "vmprof.h" |
| 24 |
|
| 25 |
#include "vmprof_mt.h" |
| 26 |
|
| 27 |
#ifdef __FreeBSD__ |
| 28 |
#include <ucontext.h> |
| 29 |
#endif |
| 30 |
#include <signal.h> |
| 31 |
|
| 32 |
RPY_EXTERN void vmprof_ignore_signals(int ignored); |
| 33 |
RPY_EXTERN long vmprof_enter_signal(void); |
| 34 |
RPY_EXTERN long vmprof_exit_signal(void); |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
#ifndef RPYTHON_VMPROF |
| 42 |
PY_THREAD_STATE_T * _get_pystate_for_this_thread(void); |
| 43 |
#endif |
| 44 |
int get_stack_trace(PY_THREAD_STATE_T * current, void** result, int max_depth, intptr_t pc); |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
#include <setjmp.h> |
| 52 |
|
| 53 |
void segfault_handler(int arg); |
| 54 |
int _vmprof_sample_stack(struct profbuf_s *p, PY_THREAD_STATE_T * tstate, ucontext_t * uc); |
| 55 |
void sigprof_handler(int sig_nr, siginfo_t* info, void *ucontext); |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
int install_sigprof_handler(void); |
| 64 |
int remove_sigprof_handler(void); |
| 65 |
int install_sigprof_timer(void); |
| 66 |
int remove_sigprof_timer(void); |
| 67 |
void atfork_disable_timer(void); |
| 68 |
void atfork_enable_timer(void); |
| 69 |
void atfork_close_profile_file(void); |
| 70 |
int install_pthread_atfork_hooks(void); |
| 71 |
|
| 72 |
#ifdef VMP_SUPPORTS_NATIVE_PROFILING |
| 73 |
void init_cpyprof(int native); |
| 74 |
static void disable_cpyprof(void); |
| 75 |
#endif |
| 76 |
|
| 77 |
int close_profile(void); |
| 78 |
|
| 79 |
RPY_EXTERN |
| 80 |
int vmprof_enable(int memory, int native, int real_time); |
| 81 |
RPY_EXTERN |
| 82 |
int vmprof_disable(void); |
| 83 |
RPY_EXTERN |
| 84 |
int vmprof_register_virtual_function(char *code_name, intptr_t code_uid, |
| 85 |
int auto_retry); |
| 86 |
|
| 87 |
|
| 88 |
void vmprof_aquire_lock(void); |
| 89 |
void vmprof_release_lock(void); |