51 #include <sys/types.h> 63 #include <linux/unistd.h> 64 #include <linux/limits.h> 80 #include <include/hpctoolkit-config.h> 144 #endif // ! USE_LIBUNW 170 void (* func) (
void *);
206 #ifndef HPCRUN_STATIC_LINK 234 #if defined(__PPC64__) || defined(HOST_CPU_IA64) 235 main_addr = *((
void**) main_addr);
240 #ifndef HPCRUN_STATIC_LINK 260 char tmp[PATH_MAX] = {
'\0'};
261 char* rpath = realpath(process_name, tmp);
262 char* src = (rpath !=
NULL) ? rpath : process_name;
264 strncpy(execname, src,
sizeof(execname));
287 int in_static_main = (main_lower <=
addr) & (addr <= main_upper);
288 int in_main = in_static_main;
290 #ifndef HPCRUN_STATIC_LINK 292 int in_dynamic_main = (main_lower_dl <=
addr) & (addr <= main_upper_dl);
293 in_main |= in_dynamic_main;
322 safe_to_sync_sample =
true;
346 EEMSG(
"hpcrun: abort timeout activated - context pc %p",
357 char *error_timeout = getenv(
"HPCRUN_ABORT_TIMEOUT");
359 int seconds = atoi(error_timeout);
361 EEMSG(
"hpcrun: abort timeout armed");
406 main_addr = monitor_get_addr_main();
408 TMSG(MAIN_BOUNDS,
"main addr %p ==> lower %p, upper %p", main_addr, main_lower, main_upper);
423 TMSG(MALLOC,
" -init_internal-: lush allocation");
440 if (getenv(
"HPCRUN_ONLY_DUMP_INTERVALS")) {
442 TMSG(INTERVALS_PRINT,
"table data = %p", table.
table);
443 TMSG(INTERVALS_PRINT,
"table length = %d", table.
len);
446 fprintf(stderr,
"Could not install dump interval segv handler\n");
447 monitor_real_exit(1);
450 for (
void** e = table.
table; e < table.
table + table.
len - 1; e++) {
451 fprintf(stderr,
"======== %p Intervals ========\n", *e);
452 if (e > table.
table || ! sigsetjmp(ivd_jb, 1))
455 fprintf(stderr,
"--Error: skipped--\n");
456 fprintf(stderr,
"\n");
461 #endif // ! USE_LIBUNW 468 TMSG(PROCESS,
"Sample source setup");
481 TMSG(EPOCH,
"process init setting up initial epoch/loadmap");
484 #ifdef SPECIAL_DUMP_INTERVALS 489 char* addr1 = getenv(
"ADDR1");
490 char* addr2 = getenv(
"ADDR2");
493 addr1 = (
void*) (uintptr_t) strtol(addr1,
NULL, 0);
494 fprintf(stderr,
"address 1 = %p\n", addr1);
500 addr2 = (
void*) (uintptr_t) strtol(addr2,
NULL, 0);
501 fprintf(stderr,
"address 2 = %p\n", addr2);
505 if (addr1 || addr2) monitor_real_exit(0);
521 hpcrun_is_initialized_private =
true;
524 #define GET_NEW_AUX_CLEANUP_NODE(node_ptr) do { \ 525 if (hpcrun_aux_cleanup_free_list_head) { \ 526 node_ptr = hpcrun_aux_cleanup_free_list_head; \ 527 hpcrun_aux_cleanup_free_list_head = hpcrun_aux_cleanup_free_list_head->next; \ 529 node_ptr = (hpcrun_aux_cleanup_t *) hpcrun_malloc(sizeof(hpcrun_aux_cleanup_t)); \ 533 #define ADD_TO_FREE_AUX_CLEANUP_LIST(node_ptr) do { (node_ptr)->next = hpcrun_aux_cleanup_free_list_head; \ 534 hpcrun_aux_cleanup_free_list_head = (node_ptr); }while(0) 550 if (hpcrun_aux_cleanup_list_head) {
551 hpcrun_aux_cleanup_list_head->
prev =
node;
553 hpcrun_aux_cleanup_list_head =
node;
562 assert (node !=
NULL);
573 hpcrun_aux_cleanup_list_head = node->
next;
592 hpcrun_aux_cleanup_list_head =
NULL;
607 TMSG(FINI,
"process");
612 hpcrun_is_initialized_private =
false;
614 TMSG(FINI,
"process attempting sample shutdown");
649 #ifdef USE_GCC_THREAD 650 extern __thread monitor_tid;
651 #endif // USE_GCC_THREAD 666 int iarg = (int) (intptr_t)
arg;
667 TMSG(THREAD_CTXT,
"thr %d -- %d: lm-id: %d lm-ip: %p",
693 if (! thr_ctxt)
EMSG(
"Thread id %d passes null context",
id);
709 if (! hpcrun_thread_suppress_sample)
712 return (
void*) epoch;
724 TMSG(FINI,
"thread fini");
727 if (hpcrun_thread_suppress_sample)
return;
730 TMSG(FINI,
"thread finit stops sampling");
746 TMSG(PROCESS,
"End of thread");
760 HPCRUN_DEBUGGER_WAIT = 0;
767 const char* HPCRUN_WAIT = getenv(
"HPCRUN_WAIT");
769 while (HPCRUN_DEBUGGER_WAIT);
774 unsetenv(
"HPCRUN_WAIT");
790 hpcrun_thread_suppress_sample =
false;
793 bool is_child = data && fork_data->
is_child;
801 putenv(
"PAMID_COLLECTIVES=0");
802 #endif // defined(HOST_SYSTEM_IBM_BLUEGENE) 808 process_name =
"unknown";
809 if (argv !=
NULL && argv[0] !=
NULL) {
810 process_name = argv[0];
813 int len = readlink(
"/proc/self/exe", buf,
PROC_NAME_LEN - 1);
832 char* life = getenv(
"HPCRUN_LIFETIME");
834 int seconds = atoi(life);
835 if (seconds > 0) alarm((
unsigned int) seconds);
852 TMSG(PROCESS,
"hpcrun_files_set_executable called w process name = %s", process_name);
854 TMSG(PROCESS,
"init");
859 TMSG(PROCESS,
"I am a %s process", is_child ?
"child" :
"parent");
864 EEMSG(
"TST debug ctl is active!");
899 TMSG(PRE_FORK,
"pre_fork call");
902 TMSG(PRE_FORK,
"sources shutdown");
907 TMSG(PRE_FORK,
"finished pre_fork call");
924 TMSG(POST_FORK,
"Post fork call");
927 TMSG(POST_FORK,
"sample sources re-init+re-start");
933 TMSG(POST_FORK,
"Finished post fork");
956 TMSG(
MPI,
"Stopping Sample Sources");
971 TMSG(
MPI,
"Restart Sample Sources");
987 TMSG(THREAD,
"REALLY init_thread_support ---");
990 TMSG(THREAD,
"Init thread support done");
1009 TMSG(THREAD,
"pre create");
1018 int ret = getcontext(&context);
1020 EMSG(
"error: monitor_thread_pre_create: getcontext = %d", ret);
1026 TMSG(THREAD,
"before lush malloc");
1027 TMSG(MALLOC,
" -thread_precreate: lush malloc");
1030 TMSG(THREAD,
"after lush malloc, thr_ctxt = %p",thr_ctxt);
1039 TMSG(THREAD,
"->finish pre create");
1054 TMSG(THREAD,
"post create");
1055 TMSG(THREAD,
"done post create");
1063 #ifdef USE_GCC_THREAD 1067 hpcrun_thread_suppress_sample =
false;
1073 if (atoi(tok) == tid) {
1074 hpcrun_thread_suppress_sample =
true;
1079 TMSG(THREAD,
"init thread %d",tid);
1081 TMSG(THREAD,
"back from init thread %d",tid);
1111 static const size_t MEG = (1024 * 1024);
1113 size_t new_size = old_size + MEG;
1115 if (new_size < 2 * MEG)
1155 typedef void longjmp_fcn(jmp_buf,
int);
1157 #ifdef HPCRUN_STATIC_LINK 1158 extern longjmp_fcn __real_longjmp;
1162 static longjmp_fcn *real_longjmp =
NULL;
1185 (*real_longjmp)(
buf, val);
1188 EEMSG(
"return from real longjmp(), should never get here");
1200 (*real_siglongjmp)(
buf, val);
1203 EEMSG(
"return from real siglongjmp(), should never get here");
1216 #ifdef LUSH_PTHREADS 1218 typedef int mutex_lock_fcn(pthread_mutex_t *);
1220 #ifdef HPCRUN_STATIC_LINK 1222 extern mutex_lock_fcn __real_pthread_mutex_trylock;
1223 extern mutex_lock_fcn __real_pthread_mutex_unlock;
1224 #endif // HPCRUN_STATIC_LINK 1227 static mutex_lock_fcn *real_mutex_trylock =
NULL;
1228 static mutex_lock_fcn *real_mutex_unlock =
NULL;
1237 extern int __pthread_mutex_lock(pthread_mutex_t*
lock);
1240 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1246 int ret = __pthread_mutex_lock(lock);
1260 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1262 int ret = (*real_mutex_trylock)(
lock);
1276 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1278 int ret = (*real_mutex_unlock)(
lock);
1287 #endif // LUSH_PTHREADS 1294 #ifdef LUSH_PTHREADS 1296 typedef int spinlock_fcn(pthread_spinlock_t *);
1298 #ifdef HPCRUN_STATIC_LINK 1299 extern spinlock_fcn __real_pthread_spin_lock;
1300 extern spinlock_fcn __real_pthread_spin_trylock;
1301 extern spinlock_fcn __real_pthread_spin_unlock;
1302 extern spinlock_fcn __real_pthread_spin_destroy;
1303 #endif // HPCRUN_STATIC_LINK 1305 static spinlock_fcn *real_spin_lock =
NULL;
1306 static spinlock_fcn *real_spin_trylock =
NULL;
1307 static spinlock_fcn *real_spin_unlock =
NULL;
1308 static spinlock_fcn *real_spin_destroy =
NULL;
1315 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1317 pthread_spinlock_t* real_lock =
lock;
1322 #if (LUSH_PTHR_FN_TY == 3) 1325 int ret = (*real_spin_lock)(real_lock);
1340 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1342 pthread_spinlock_t* real_lock =
lock;
1347 #if (LUSH_PTHR_FN_TY == 3) 1350 int ret = (*real_spin_trylock)(real_lock);
1365 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1367 pthread_spinlock_t* real_lock =
lock;
1372 #if (LUSH_PTHR_FN_TY == 3) 1375 int ret = (*real_spin_unlock)(real_lock);
1390 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1392 pthread_spinlock_t* real_lock =
lock;
1397 int ret = (*real_spin_destroy)(real_lock);
1406 #endif // LUSH_PTHREADS 1413 #ifdef LUSH_PTHREADS 1415 typedef int cond_init_fcn(pthread_cond_t *,
const pthread_condattr_t *);
1416 typedef int cond_destroy_fcn(pthread_cond_t *);
1417 typedef int cond_wait_fcn(pthread_cond_t *, pthread_mutex_t *);
1418 typedef int cond_timedwait_fcn(pthread_cond_t *, pthread_mutex_t *,
1419 const struct timespec *);
1420 typedef int cond_signal_fcn(pthread_cond_t *);
1422 #ifdef HPCRUN_STATIC_LINK 1423 extern cond_init_fcn __real_pthread_cond_init;
1424 extern cond_destroy_fcn __real_pthread_cond_destroy;
1426 extern cond_timedwait_fcn __real_pthread_cond_timedwait;
1427 extern cond_signal_fcn __real_pthread_cond_signal;
1428 extern cond_signal_fcn __real_pthread_cond_broadcast;
1429 #endif // HPCRUN_STATIC_LINK 1431 static cond_init_fcn *real_cond_init =
NULL;
1432 static cond_destroy_fcn *real_cond_destroy =
NULL;
1433 static cond_wait_fcn *real_cond_wait =
NULL;
1434 static cond_timedwait_fcn *real_cond_timedwait =
NULL;
1435 static cond_signal_fcn *real_cond_signal =
NULL;
1436 static cond_signal_fcn *real_cond_broadcast =
NULL;
1447 const pthread_condattr_t* attr)
1450 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1451 return (*real_cond_init)(cond, attr);
1459 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1460 return (*real_cond_destroy)(cond);
1466 pthread_mutex_t* mutex)
1469 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1475 int ret = (*real_cond_wait)(cond, mutex);
1487 pthread_mutex_t* mutex,
1488 const struct timespec* tspec)
1491 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1497 int ret = (*real_cond_timedwait)(cond, mutex, tspec);
1511 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1512 return (*real_cond_signal)(cond);
1520 if (0) {
TMSG(MONITOR_EXTS,
"%s", __func__); }
1521 return (*real_cond_broadcast)(cond);
1524 #endif // LUSH_PTHREADS 1532 #ifndef HPCRUN_STATIC_LINK #define Token_iterate(tok, s, delim, b)
void monitor_fini_thread(void *init_thread_data)
int OVERRIDE_NM() pthread_cond_broadcast(pthread_cond_t *cond)
int __real_pthread_cond_wait(pthread_cond_t *c, pthread_mutex_t *m)
static void lushPthr_spinLock_post(lushPthr_t *restrict x, atomic_pthread_spinlock_t *restrict lock)
void hpcrun_init_pthread_key(void)
void hpcrun_files_set_executable(char *execname)
static fork_data_t from_fork
void monitor_fini_process(int how, void *data)
size_t monitor_reset_stacksize(size_t old_size)
static void logit(cct_node_t *n, cct_op_arg_t arg, size_t l)
void hpcrun_set_thread0_data(void)
static void hpcrun_process_aux_cleanup_action()
#define SAMPLE_SOURCES(op,...)
void hpcrun_threadMgr_data_fini(thread_data_t *td)
void monitor_dlclose(void *handle)
static int dump_interval_handler(int sig, siginfo_t *info, void *ctxt) __attribute__((unused))
static int lushPthr_spin_unlock(atomic_pthread_spinlock_t *lock)
void hpcrun_set_thread_data(thread_data_t *td)
static int abort_timeout_handler(int sig, siginfo_t *siginfo, void *context)
void hpcrun_process_sample_source_none(void)
void hpcrun_memory_reinit(void)
void hpcrun_mmap_init(void)
void hpcrun_process_aux_cleanup_remove(hpcrun_aux_cleanup_t *node)
static void hpcrun_safe_exit(void)
int hpcrun_options__getopts(hpcrun_options_t *x)
static atomic_pthread_spinlock_t * lushPthr_spinLock_pre(lushPthr_t *restrict x, atomic_pthread_spinlock_t *lock)
void hpcrun_trace_open(core_profile_trace_data_t *cptd)
void monitor_post_dlclose(void *handle, int ret)
void messages_logfile_create()
void * hpcrun_get_addr_main(void)
void monitor_thread_post_create(void *data)
static atomic_pthread_spinlock_t * lushPthr_spinUnlock_pre(lushPthr_t *restrict x, atomic_pthread_spinlock_t *restrict lock)
void * monitor_init_thread(int tid, void *data)
void hpcrun_files_set_directory()
void hpcrun_sample_sources_from_eventlist(char *evl)
void monitor_init_thread_support(void)
void hpcrun_threadmgr_thread_delete()
void hpcrun_init_internal(bool is_child)
static void lushPthr_mutexLock_pre(lushPthr_t *restrict x, pthread_mutex_t *restrict lock)
static void lushPthr_spinTrylock_post(lushPthr_t *restrict x, atomic_pthread_spinlock_t *restrict lock, int result)
#define MONITOR_EXT_WRAP_NAME(name)
static void spinlock_unlock(spinlock_t *l)
void hpcrun_stats_reinit(void)
const char * HPCRUN_EVENT_LIST
void hpcrun_threadMgr_data_put(epoch_t *epoch, thread_data_t *data)
void hpcrun_sample_prob_mesg(void)
bool hpcrun_is_initialized()
hpcrun_aux_cleanup_t * hpcrun_process_aux_cleanup_add(void(*func)(void *), void *arg)
size_t hpcrun_get_num_sample_sources(void)
void hpcrun_pre_dlopen(const char *path, int flags)
void * monitor_init_process(int *argc, char **argv, void *data)
struct fork_data_t fork_data_t
void hpcrun_walk_path(cct_node_t *node, cct_op_t op, cct_op_arg_t arg)
void * monitor_thread_pre_create(void)
void hpcrun_thread_data_init(int id, cct_ctxt_t *thr_ctxt, int is_child, size_t n_sources)
static void lushPthr_spinDestroy_post(lushPthr_t *restrict x, atomic_pthread_spinlock_t *restrict lock)
void hpcrun_do_custom_init(void)
static void lushPthr_condwait_pre(lushPthr_t *x)
char lush_agent_paths[CSPROF_PATH_SZ]
void hpcrun_itimer_wallclock_ok(bool flag)
#define hpcrun_get_thread_epoch()
void hpcrun_stats_print_summary(void)
void hpcrun_registered_sources_init(void)
bool hpcrun_is_safe_to_sync(const char *fn)
static spinlock_t hpcrun_aux_cleanup_lock
static void * main_upper_dl
int lush_agent_pool__fini(lush_agent_pool_t *x)
void monitor_init_mpi(int *argc, char ***argv)
bool hpcrun_threadMgr_data_get(int id, cct_ctxt_t *thr_ctxt, thread_data_t **data)
static void lushPthr_mutexLock_post(lushPthr_t *restrict x, pthread_mutex_t *restrict lock)
void hpcrun_threadmgr_thread_new()
static siglongjmp_fcn * real_siglongjmp
void hpcrun_dump_intervals(void *addr)
void hpcrun_epoch_init(cct_ctxt_t *ctxt)
fnbounds_table_t fnbounds_fetch_executable_table(void)
static void hpcrun_set_abort_timeout()
struct local_thread_data_t local_thread_data_t
void hpcrun_threaded_data(void)
#define MONITOR_EXT_GET_NAME_WRAP(var, name)
static atomic_pthread_spinlock_t * lushPthr_spinDestroy_pre(lushPthr_t *restrict x, atomic_pthread_spinlock_t *restrict lock)
void hpcrun_init_thread_support()
void hpcrun_post_dlclose(void *handle, int ret)
int hpcrun_options__init(hpcrun_options_t *x)
void monitor_post_fork(pid_t child, void *data)
void hpcrun_set_real_siglongjmp(void)
void hpcrun_sample_prob_init(void)
int OVERRIDE_NM() pthread_spin_lock(pthread_spinlock_t *lock)
static hpcrun_aux_cleanup_t * hpcrun_aux_cleanup_list_head
static void setup_main_bounds_check(void *main_addr)
void hpcrun_set_retain_recursion_mode(bool mode)
#define GET_NEW_AUX_CLEANUP_NODE(node_ptr)
void lushPthr_processInit()
void monitor_pre_dlopen(const char *path, int flags)
void * hpcrun_malloc(size_t size)
static void lushPthr_mutexUnlock_post(lushPthr_t *restrict x, pthread_mutex_t *restrict lock)
void * monitor_pre_fork(void)
void hpcrun_fini_internal()
static int lushPthr_spin_lock(atomic_pthread_spinlock_t *lock)
static void spinlock_lock(spinlock_t *l)
static bool hpcrun_is_initialized_private
void hpcrun_start_stop_internal_init(void)
struct hpcrun_aux_cleanup_t * next
void hpcrun_set_safe_to_sync(void)
int32_t hpcrun_cct_persistent_id(cct_node_t *x)
void hpcrun_set_using_threads(bool flag)
void hpcrun_thread_fini(epoch_t *epoch)
void siglongjmp_fcn(sigjmp_buf, int)
static char execname[PATH_MAX]
int OVERRIDE_NM() pthread_spin_unlock(pthread_spinlock_t *lock)
static bool safe_to_sync_sample
int OVERRIDE_NM() pthread_cond_wait(pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex)
static void hpcrun_enable_sampling(void)
static atomic_pthread_spinlock_t * lushPthr_spinTrylock_pre(lushPthr_t *restrict x, atomic_pthread_spinlock_t *restrict lock)
int OVERRIDE_NM() pthread_mutex_lock(pthread_mutex_t *mutex)
void hpcrun_unthreaded_data(void)
static void lushPthr_condwait_post(lushPthr_t *x)
cct_node_t * hpcrun_gen_thread_ctxt(void *context)
static hpcrun_options_t opts
#define ADD_TO_FREE_AUX_CLEANUP_LIST(node_ptr)
void monitor_mpi_pre_init(void)
static int lushPthr_spin_trylock(atomic_pthread_spinlock_t *lock)
char * hpcrun_get_execname(void)
static void lushPthr_mutexTrylock_post(lushPthr_t *restrict x, pthread_mutex_t *restrict lock, int result)
static void hpcrun_disable_sampling(void)
static void lushPthr_thread_fini(lushPthr_t *x)
void * hpcrun_thread_init(int id, local_thread_data_t *local_thread_data)
static void * main_lower_dl
int OVERRIDE_NM() pthread_cond_signal(pthread_cond_t *cond)
static void * main_addr_dl
void monitor_dlopen(const char *path, int flags, void *handle)
bool hpcrun_get_disabled(void)
void hpcrun_initLoadmap()
siglongjmp_fcn * hpcrun_get_real_siglongjmp(void)
static void lushPthr_spinUnlock_post(lushPthr_t *restrict x, atomic_pthread_spinlock_t *restrict lock)
<!-- ********************************************************************--> n<!-- HPCToolkit Experiment DTD --> n<!-- Version 2.1 --> n<!-- ********************************************************************--> n<!ELEMENT HPCToolkitExperiment(Header,(SecCallPathProfile|SecFlatProfile) *)> n<!ATTLIST HPCToolkitExperiment\n version CDATA #REQUIRED > n n<!-- ******************************************************************--> n n<!-- Info/NV:flexible name-value pairs:(n) ame;(t) ype;(v) alue --> n<!ELEMENT Info(NV *)> n<!ATTLIST Info\n n CDATA #IMPLIED > n<!ELEMENT NV EMPTY > n<!ATTLIST NV\n n CDATA #REQUIRED\n t CDATA #IMPLIED\n v CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Header --> n<!-- ******************************************************************--> n<!ELEMENT Header(Info *)> n<!ATTLIST Header\n n CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Section Header --> n<!-- ******************************************************************--> n<!ELEMENT SecHeader(MetricTable?, MetricDBTable?, TraceDBTable?, LoadModuleTable?, FileTable?, ProcedureTable?, Info *)> n n<!-- MetricTable:--> n<!ELEMENT MetricTable(Metric) * > n n<!-- Metric:(i) d;(n) ame --> n<!--(v) alue-type:transient type of values --> n<!--(t) ype:persistent type of metric --> n<!-- fmt:format;show;--> n<!ELEMENT Metric(MetricFormula *, Info?)> n<!ATTLIST Metric\n i CDATA #REQUIRED\n n CDATA #REQUIRED\n es CDATA #IMPLIED\n em CDATA #IMPLIED\n ep CDATA #IMPLIED\n v(raw|final|derived-incr|derived) \"raw\\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ fmt CDATA #IMPLIED\ show (1|0) \1\\ show-percent (1|0) \1> n n<!-- MetricFormula represents derived metrics: (t)ype; (frm): formula --> n<!ELEMENT MetricFormula (Info?)> n<!ATTLIST MetricFormula\ t (combine|finalize) \finalize\\ i CDATA #IMPLIED\ frm CDATA #REQUIRED> n n<!-- Metric data, used in sections: (n)ame [from Metric]; (v)alue --> n<!ELEMENT M EMPTY> n<!ATTLIST M\ n CDATA #REQUIRED\ v CDATA #REQUIRED> n n<!-- MetricDBTable: --> n<!ELEMENT MetricDBTable (MetricDB)*> n n<!-- MetricDB: (i)d; (n)ame --> n<!-- (t)ype: persistent type of metric --> n<!-- db-glob: file glob describing files in metric db --> n<!-- db-id: id within metric db --> n<!-- db-num-metrics: number of metrics in db --> n<!-- db-header-sz: size (in bytes) of a db file header --> n<!ELEMENT MetricDB EMPTY> n<!ATTLIST MetricDB\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ db-glob CDATA #IMPLIED\ db-id CDATA #IMPLIED\ db-num-metrics CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- TraceDBTable: --> n<!ELEMENT TraceDBTable (TraceDB)> n n<!-- TraceDB: (i)d --> n<!-- db-min-time: min beginning time stamp (global) --> n<!-- db-max-time: max ending time stamp (global) --> n<!ELEMENT TraceDB EMPTY> n<!ATTLIST TraceDB\ i CDATA #REQUIRED\ db-glob CDATA #IMPLIED\ db-min-time CDATA #IMPLIED\ db-max-time CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- LoadModuleTable assigns a short name to a load module --> n<!ELEMENT LoadModuleTable (LoadModule)*> n n<!ELEMENT LoadModule (Info?)> n<!ATTLIST LoadModule\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- FileTable assigns a short name to a file --> n<!ELEMENT FileTable (File)*> n n<!ELEMENT File (Info?)> n<!ATTLIST File\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- ProcedureTable assigns a short name to a procedure --> n<!ELEMENT ProcedureTable (Procedure)*> n n<!-- Info/NV: flexible name-value pairs: (n)ame; (t)ype; (v)alue --> n<!-- f: family of the procedure (fake, root, ...)--> n<!ELEMENT Procedure (Info?)> n<!ATTLIST Procedure\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ f CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Call path profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecCallPathProfile (SecHeader, SecCallPathProfileData)> n<!ATTLIST SecCallPathProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecCallPathProfileData (PF|M)*> n<!-- Procedure frame --> n<!-- (i)d: unique identifier for cross referencing --> n<!-- (s)tatic scope id --> n<!-- (n)ame: a string or an id in ProcedureTable --> n<!-- (lm) load module: a string or an id in LoadModuleTable --> n<!-- (f)ile name: a string or an id in LoadModuleTable --> n<!-- (l)ine range: \beg-end\ (inclusive range) --> n<!-- (a)lien: whether frame is alien to enclosing P --> n<!-- (str)uct: hpcstruct node id --> n<!-- (t)ype: hpcrun node type: memory access, variable declaration, ... --> n<!-- (v)ma-range-set: \{[beg-end), [beg-end)...}\ --> n<!ELEMENT PF (PF|Pr|L|C|S|M)*> n<!ATTLIST PF\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Procedure (static): GOAL: replace with 'P' --> n<!ELEMENT Pr (Pr|L|C|S|M)*> n<!ATTLIST Pr\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ a (1|0) \0\\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Callsite (a special StatementRange) --> n<!ELEMENT C (PF|M)*> n<!ATTLIST C\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Flat profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecFlatProfile (SecHeader, SecFlatProfileData)> n<!ATTLIST SecFlatProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecFlatProfileData (LM|M)*> n<!-- Load module: (i)d; (n)ame; (v)ma-range-set --> n<!ELEMENT LM (F|P|M)*> n<!ATTLIST LM\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ v CDATA #IMPLIED> n<!-- File --> n<!ELEMENT F (P|L|S|M)*> n<!ATTLIST F\ i CDATA #IMPLIED\ n CDATA #REQUIRED> n<!-- Procedure (Note 1) --> n<!ELEMENT P (P|A|L|S|C|M)*> n<!ATTLIST P\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Alien (Note 1) --> n<!ELEMENT A (A|L|S|C|M)*> n<!ATTLIST A\ i CDATA #IMPLIED\ f CDATA #IMPLIED\ n CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Loop (Note 1,2) --> n<!ELEMENT L (A|Pr|L|S|C|M)*> n<!ATTLIST L\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ f CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Statement (Note 2) --> n<!-- (it): trace record identifier --> n<!ELEMENT S (S|M)*> n<!ATTLIST S\ i CDATA #IMPLIED\ it CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Note 1: Contained Cs may not contain PFs --> n<!-- Note 2: The 's' attribute is not used for flat profiles --> n
void monitor_real_abort(void)
void hpcrun_dlopen(const char *module_name, int flags, void *handle)
static void copy_execname(char *process_name)
void * hpcrun_context_pc(void *context)
struct hpcrun_aux_cleanup_t * prev
static hpcrun_aux_cleanup_t * hpcrun_aux_cleanup_free_list_head
int lush_agent_pool__init(lush_agent_pool_t *x, const char *path)
__thread bool hpcrun_thread_suppress_sample
#define SPINLOCK_UNLOCKED
lush_agent_pool_t * lush_agents
bool fnbounds_enclosing_addr(void *ip, void **start, void **end, load_module_t **lm)
#define MONITOR_EXT_GET_NAME(var, name)
static int hpcrun_safe_enter(void)
bool hpcrun_inbounds_main(void *addr)
int OVERRIDE_NM() pthread_mutex_unlock(pthread_mutex_t *mutex)
void hpcrun_dlclose(void *handle)
thread_data_t *(* hpcrun_get_thread_data)(void)
volatile int HPCRUN_DEBUGGER_WAIT
static void hpcrun_logicalUnwind(bool x)
cct_addr_t * hpcrun_cct_addr(cct_node_t *node)