HPCToolkit
tst.c File Reference
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <signal.h>
#include <sys/time.h>
#include <ucontext.h>
#include <monitor.h>
#include "sample_source_obj.h"
#include "common.h"
#include "ss-errno.h"
#include <hpcrun/hpcrun_options.h>
#include <hpcrun/hpcrun_stats.h>
#include <hpcrun/metrics.h>
#include <hpcrun/safe-sampling.h>
#include <hpcrun/sample_event.h>
#include <hpcrun/sample_sources_registered.h>
#include <hpcrun/thread_data.h>
#include <lush/lush-backtrace.h>
#include <messages/messages.h>
#include <utilities/tokenize.h>
#include <utilities/arch/context-pc.h>
#include <unwind/common/unwind.h>
#include <lib/support-lean/timer.h>
#include "ss_obj.h"
Include dependency graph for tst.c:

Go to the source code of this file.

Macros

#define HPCRUN_PROFILE_SIGNAL   SIGPROF
 
#define HPCRUN_PROFILE_TIMER   ITIMER_PROF
 
#define SECONDS_PER_HOUR   3600
 
#define USE_ELAPSED_TIME_FOR_WALLCLOCK
 
#define RESET_ITIMER_EACH_SAMPLE
 
#define AUTOMATIC_ITIMER_RESET_SECONDS(x)   (0)
 
#define AUTOMATIC_ITIMER_RESET_MICROSECONDS(x)   (0)
 
#define DEFAULT_THRESHOLD   5000L
 
#define sample_period   1
 
#define ss_name   _tst
 
#define ss_cls   SS_HARDWARE
 

Enumerations

enum  _local_const { PROC_NAME_LEN = 2048, ITIMER_EVENT = 0, _TST_EVENT = 0 }
 

Functions

static int _tst_signal_handler (int sig, siginfo_t *siginfo, void *context)
 
static void METHOD_FN (init)
 
static void METHOD_FN (thread_init)
 
static void METHOD_FN (thread_init_action)
 
static void METHOD_FN (start)
 
static void METHOD_FN (thread_fini_action)
 
static void METHOD_FN (stop)
 
static void METHOD_FN (shutdown)
 
static bool METHOD_FN (supports_event, const char *ev_str)
 
static void METHOD_FN (process_event_list, int lush_metrics)
 
static void METHOD_FN (gen_event_set, int lush_metrics)
 
static void METHOD_FN (display_events)
 

Variables

static struct itimerval itimer
 
static const struct itimerval zerotimer
 
static long period = DEFAULT_THRESHOLD
 
static sigset_t sigset_itimer
 

Macro Definition Documentation

◆ AUTOMATIC_ITIMER_RESET_MICROSECONDS

#define AUTOMATIC_ITIMER_RESET_MICROSECONDS (   x)    (0)

Definition at line 132 of file tst.c.

◆ AUTOMATIC_ITIMER_RESET_SECONDS

#define AUTOMATIC_ITIMER_RESET_SECONDS (   x)    (0)

Definition at line 131 of file tst.c.

◆ DEFAULT_THRESHOLD

#define DEFAULT_THRESHOLD   5000L

Definition at line 142 of file tst.c.

◆ HPCRUN_PROFILE_SIGNAL

#define HPCRUN_PROFILE_SIGNAL   SIGPROF

Definition at line 107 of file tst.c.

◆ HPCRUN_PROFILE_TIMER

#define HPCRUN_PROFILE_TIMER   ITIMER_PROF

Definition at line 108 of file tst.c.

◆ RESET_ITIMER_EACH_SAMPLE

#define RESET_ITIMER_EACH_SAMPLE

Definition at line 117 of file tst.c.

◆ sample_period

#define sample_period   1

◆ SECONDS_PER_HOUR

#define SECONDS_PER_HOUR   3600

Definition at line 111 of file tst.c.

◆ ss_cls

#define ss_cls   SS_HARDWARE

Definition at line 370 of file tst.c.

◆ ss_name

#define ss_name   _tst

Definition at line 369 of file tst.c.

◆ USE_ELAPSED_TIME_FOR_WALLCLOCK

#define USE_ELAPSED_TIME_FOR_WALLCLOCK

Definition at line 114 of file tst.c.

Enumeration Type Documentation

◆ _local_const

Enumerator
PROC_NAME_LEN 
ITIMER_EVENT 
_TST_EVENT 

Definition at line 148 of file tst.c.

Function Documentation

◆ _tst_signal_handler()

static int _tst_signal_handler ( int  sig,
siginfo_t *  siginfo,
void *  context 
)
static

Definition at line 379 of file tst.c.

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

◆ METHOD_FN() [1/11]

static void METHOD_FN ( init  )
static

Definition at line 186 of file tst.c.

◆ METHOD_FN() [2/11]

static void METHOD_FN ( thread_init  )
static

Definition at line 192 of file tst.c.

◆ METHOD_FN() [3/11]

static void METHOD_FN ( thread_init_action  )
static

Definition at line 197 of file tst.c.

◆ METHOD_FN() [4/11]

static void METHOD_FN ( start  )
static

Definition at line 202 of file tst.c.

Here is the call graph for this function:

◆ METHOD_FN() [5/11]

static void METHOD_FN ( thread_fini_action  )
static

Definition at line 232 of file tst.c.

◆ METHOD_FN() [6/11]

static void METHOD_FN ( stop  )
static

Definition at line 237 of file tst.c.

◆ METHOD_FN() [7/11]

static void METHOD_FN ( shutdown  )
static

Definition at line 248 of file tst.c.

◆ METHOD_FN() [8/11]

static bool METHOD_FN ( supports_event  ,
const char *  ev_str 
)
static

Definition at line 255 of file tst.c.

Here is the call graph for this function:

◆ METHOD_FN() [9/11]

static void METHOD_FN ( process_event_list  ,
int  lush_metrics 
)
static

Definition at line 261 of file tst.c.

Here is the call graph for this function:

◆ METHOD_FN() [10/11]

static void METHOD_FN ( gen_event_set  ,
int  lush_metrics 
)
static

Definition at line 339 of file tst.c.

Here is the call graph for this function:

◆ METHOD_FN() [11/11]

static void METHOD_FN ( display_events  )
static

Definition at line 347 of file tst.c.

Variable Documentation

◆ itimer

struct itimerval itimer
static

Definition at line 164 of file tst.c.

◆ period

long period = DEFAULT_THRESHOLD
static

Definition at line 179 of file tst.c.

◆ sigset_itimer

sigset_t sigset_itimer
static

Definition at line 181 of file tst.c.

◆ zerotimer

const struct itimerval zerotimer
static
Initial value:
= {
.it_interval = {
.tv_sec = 0L,
.tv_usec = 0L
},
.it_value = {
.tv_sec = 0L,
.tv_usec = 0L
}
}

Definition at line 166 of file tst.c.