HPCToolkit
monitor.h File Reference
#include <stdio.h>
#include <unistd.h>
#include <inttypes.h>
#include <stdarg.h>
#include <sys/time.h>
#include <sys/profil.h>
#include <include/hpctoolkit-config.h>
#include <include/uint.h>
#include "hpcrun.h"
#include "hpcpapi.h"
Include dependency graph for monitor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hpcsys_profile_desc_t
 
struct  hpcsys_profile_desc_vec_t
 
struct  hpcrun_ofile_desc_t
 
struct  hpcrun_profiles_desc_t
 
struct  hpcrun_pthread_create_args_t
 

Macros

#define HPCRUN_DBG_LVL   0
 
#define MSG_str(fmt)   HPCRUN_NAME" [pid %d, tid 0x%lx]: " fmt "\n", getpid(), hpcrun_gettid()
 
#define MSG0(x, fmt)   { fprintf(x, MSG_str(fmt)); }
 
#define MSGx(x, fmt, ...)   { fprintf(x, MSG_str(fmt), __VA_ARGS__); }
 
#define ERRMSG0(fmt)
 
#define ERRMSGx(fmt, ...)
 
#define DIE0(fmt)   ERRMSG0(fmt); { exit(1); }
 
#define DIEx(fmt, ...)   ERRMSGx(fmt, __VA_ARGS__); { exit(1); }
 
#define HPC_GETL_SYSPROFS(x)   ((x)->sysprofs)
 
#define HPC_GET_SYSPROFS(x)   ((hpcsys_profile_desc_vec_t*)((x)->sysprofs))
 
#define HPC_GETL_PAPIPROFS(x)   ((x)->papiprofs)
 
#define HPC_GET_PAPIPROFS(x)   ((hpcpapi_profile_desc_vec_t*)((x)->papiprofs))
 
#define PARAMS_START_MAIN
 
#define PARAMS_EXECV   (const char *path, char *const argv[])
 
#define PARAMS_EXECVP   (const char *file, char *const argv[])
 
#define PARAMS_EXECVE
 
#define PARAMS_PTHREAD_CREATE
 

Typedefs

typedef int libc_start_main_fptr_t PARAMS_START_MAIN
 
typedef void(* libc_start_main_fini_fptr_t) (void)
 
typedef int execv_fptr_t PARAMS_EXECV
 
typedef int execvp_fptr_t PARAMS_EXECVP
 
typedef int execve_fptr_t PARAMS_EXECVE
 
typedef pid_t(* fork_fptr_t) (void)
 
typedef void *(* dlopen_fptr_t) (const char *filename, int flag)
 
typedef void(* _exit_fptr_t) (int)
 
typedef int pthread_create_fptr_t PARAMS_PTHREAD_CREATE
 
typedef pthread_t(* pthread_self_fptr_t) (void)
 

Functions

void init_library ()
 
void fini_library ()
 
void init_process ()
 
void fini_process ()
 
hpcrun_profiles_desc_tinit_thread (int is_thread)
 
void fini_thread (hpcrun_profiles_desc_t **profdesc, int is_thread)
 
long hpcrun_gettid ()
 
void hpcrun_parse_execl (const char ***argv, const char *const **envp, const char *arg, va_list arglist)
 
void handle_dlopen ()
 
void init_library_SPECIALIZED ()
 
void init_papi_for_process_SPECIALIZED ()
 
long hpcrun_gettid_SPECIALIZED ()
 

Variables

int opt_debug
 
int opt_recursive
 
hpc_threadprof_t opt_thread
 
char * opt_eventlist
 
char opt_outpath [PATH_MAX]
 
int opt_flagscode
 
const char * hpcrun_cmd
 

Macro Definition Documentation

◆ DIE0

#define DIE0 (   fmt)    ERRMSG0(fmt); { exit(1); }

Definition at line 137 of file monitor.h.

◆ DIEx

#define DIEx (   fmt,
  ... 
)    ERRMSGx(fmt, __VA_ARGS__); { exit(1); }

Definition at line 139 of file monitor.h.

◆ ERRMSG0

#define ERRMSG0 (   fmt)
Value:
{ if (HPCRUN_DBG_LVL) { \
fprintf(stderr, MSG_str("[%s:%d]: " fmt), __FILE__, __LINE__); } \
else { \
fprintf(stderr, MSG_str(fmt)); } \
}
#define HPCRUN_DBG_LVL
Definition: monitor.h:91
#define MSG_str(fmt)
Definition: monitor.h:102

Definition at line 116 of file monitor.h.

◆ ERRMSGx

#define ERRMSGx (   fmt,
  ... 
)
Value:
{ if (HPCRUN_DBG_LVL) { \
fprintf(stderr, MSG_str("[%s:%d]: " fmt), __FILE__, __LINE__, __VA_ARGS__); } \
else { \
fprintf(stderr, MSG_str(fmt), __VA_ARGS__); } \
}
#define HPCRUN_DBG_LVL
Definition: monitor.h:91
#define MSG_str(fmt)
Definition: monitor.h:102

Definition at line 123 of file monitor.h.

◆ HPC_GET_PAPIPROFS

#define HPC_GET_PAPIPROFS (   x)    ((hpcpapi_profile_desc_vec_t*)((x)->papiprofs))

Definition at line 197 of file monitor.h.

◆ HPC_GET_SYSPROFS

#define HPC_GET_SYSPROFS (   x)    ((hpcsys_profile_desc_vec_t*)((x)->sysprofs))

Definition at line 193 of file monitor.h.

◆ HPC_GETL_PAPIPROFS

#define HPC_GETL_PAPIPROFS (   x)    ((x)->papiprofs)

Definition at line 196 of file monitor.h.

◆ HPC_GETL_SYSPROFS

#define HPC_GETL_SYSPROFS (   x)    ((x)->sysprofs)

Definition at line 192 of file monitor.h.

◆ HPCRUN_DBG_LVL

#define HPCRUN_DBG_LVL   0

Definition at line 91 of file monitor.h.

◆ MSG0

#define MSG0 (   x,
  fmt 
)    { fprintf(x, MSG_str(fmt)); }

Definition at line 106 of file monitor.h.

◆ MSG_str

#define MSG_str (   fmt)    HPCRUN_NAME" [pid %d, tid 0x%lx]: " fmt "\n", getpid(), hpcrun_gettid()

Definition at line 102 of file monitor.h.

◆ MSGx

#define MSGx (   x,
  fmt,
  ... 
)    { fprintf(x, MSG_str(fmt), __VA_ARGS__); }

Definition at line 109 of file monitor.h.

◆ PARAMS_EXECV

#define PARAMS_EXECV   (const char *path, char *const argv[])

Definition at line 218 of file monitor.h.

◆ PARAMS_EXECVE

#define PARAMS_EXECVE
Value:
(const char *path, char *const argv[], \
char *const envp[])

Definition at line 220 of file monitor.h.

◆ PARAMS_EXECVP

#define PARAMS_EXECVP   (const char *file, char *const argv[])

Definition at line 219 of file monitor.h.

◆ PARAMS_PTHREAD_CREATE

Value:
(pthread_t* thread, \
const pthread_attr_t* attr, \
void *(*start_routine)(void*), \
void* arg)

Definition at line 234 of file monitor.h.

◆ PARAMS_START_MAIN

Value:
(int (*main) (int, char **, char **), \
int argc, \
char *__unbounded *__unbounded ubp_av, \
void (*init) (void), \
void (*fini) (void), \
void (*rtld_fini) (void), \
void *__unbounded stack_end)
int main(int argc, char *argv[])
Definition: main.cpp:125

Definition at line 206 of file monitor.h.

Typedef Documentation

◆ _exit_fptr_t

typedef void(* _exit_fptr_t) (int)

Definition at line 230 of file monitor.h.

◆ dlopen_fptr_t

typedef void*(* dlopen_fptr_t) (const char *filename, int flag)

Definition at line 228 of file monitor.h.

◆ fork_fptr_t

typedef pid_t(* fork_fptr_t) (void)

Definition at line 227 of file monitor.h.

◆ libc_start_main_fini_fptr_t

typedef void(* libc_start_main_fini_fptr_t) (void)

Definition at line 215 of file monitor.h.

◆ PARAMS_EXECV

typedef int execv_fptr_t PARAMS_EXECV

Definition at line 223 of file monitor.h.

◆ PARAMS_EXECVE

typedef int execve_fptr_t PARAMS_EXECVE

Definition at line 225 of file monitor.h.

◆ PARAMS_EXECVP

typedef int execvp_fptr_t PARAMS_EXECVP

Definition at line 224 of file monitor.h.

◆ PARAMS_PTHREAD_CREATE

typedef int pthread_create_fptr_t PARAMS_PTHREAD_CREATE

Definition at line 246 of file monitor.h.

◆ PARAMS_START_MAIN

typedef int libc_start_main_fptr_t PARAMS_START_MAIN

Definition at line 214 of file monitor.h.

◆ pthread_self_fptr_t

typedef pthread_t(* pthread_self_fptr_t) (void)

Definition at line 248 of file monitor.h.

Function Documentation

◆ fini_library()

void fini_library ( )

Definition at line 183 of file monitor.c.

Here is the caller graph for this function:

◆ fini_process()

void fini_process ( )

Definition at line 1466 of file monitor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fini_thread()

void fini_thread ( hpcrun_profiles_desc_t **  profdesc,
int  is_thread 
)

Definition at line 1491 of file monitor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_dlopen()

void handle_dlopen ( )

Definition at line 455 of file monitor.c.

Here is the call graph for this function:

◆ hpcrun_gettid()

long hpcrun_gettid ( )

Definition at line 1864 of file monitor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_gettid_SPECIALIZED()

long hpcrun_gettid_SPECIALIZED ( )

Definition at line 246 of file monitor_static.cpp.

Here is the caller graph for this function:

◆ hpcrun_parse_execl()

void hpcrun_parse_execl ( const char ***  argv,
const char *const **  envp,
const char *  arg,
va_list  arglist 
)

Definition at line 1874 of file monitor.c.

Here is the call graph for this function:

◆ init_library()

void init_library ( )

Definition at line 164 of file monitor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_library_SPECIALIZED()

void init_library_SPECIALIZED ( )

Definition at line 144 of file monitor_static.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_papi_for_process_SPECIALIZED()

void init_papi_for_process_SPECIALIZED ( )

Definition at line 236 of file monitor_static.cpp.

Here is the caller graph for this function:

◆ init_process()

void init_process ( )

Definition at line 430 of file monitor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_thread()

hpcrun_profiles_desc_t* init_thread ( int  is_thread)

Definition at line 510 of file monitor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ hpcrun_cmd

const char* hpcrun_cmd

Definition at line 136 of file monitor.c.

◆ opt_debug

int opt_debug

Definition at line 126 of file monitor.c.

◆ opt_eventlist

char* opt_eventlist

Definition at line 129 of file monitor.c.

◆ opt_flagscode

int opt_flagscode

Definition at line 133 of file monitor.c.

◆ opt_outpath

char opt_outpath[PATH_MAX]

Definition at line 130 of file monitor.c.

◆ opt_recursive

int opt_recursive

Definition at line 127 of file monitor.c.

◆ opt_thread

hpc_threadprof_t opt_thread

Definition at line 128 of file monitor.c.