runtime/linux/common_session_state.h - systemtap
Global variables defined
Functions defined
Macros defined
Source code
#define DEFINE_SESSION_ATOMIC(name, init) \
static atomic_t g_##name = ATOMIC_INIT (init); \
static inline atomic_t *name(void) { \
return &g_##name; \
}
DEFINE_SESSION_ATOMIC(session_state, STAP_SESSION_STARTING);
DEFINE_SESSION_ATOMIC(error_count, 0);
DEFINE_SESSION_ATOMIC(skipped_count, 0);
DEFINE_SESSION_ATOMIC(skipped_count_lowstack, 0);
DEFINE_SESSION_ATOMIC(skipped_count_reentrant, 0);
DEFINE_SESSION_ATOMIC(skipped_count_uprobe_reg, 0);
DEFINE_SESSION_ATOMIC(skipped_count_uprobe_unreg, 0);
#undef DEFINE_SESSION_ATOMIC
#ifdef STP_ALIBI
atomic_t g_probe_alibi[STP_PROBE_COUNT];
static inline atomic_t *probe_alibi(size_t index)
{
index = clamp_t(size_t, index, 0, STP_PROBE_COUNT - 1);
return &g_probe_alibi[index];
}
#endif
#ifdef STP_TIMING
Stat g_probe_timing[STP_PROBE_COUNT];
static inline Stat probe_timing(size_t index)
{
index = clamp_t(size_t, index, 0, STP_PROBE_COUNT - 1);
return g_probe_timing[index];
}
Stat g_refresh_timing;
#endif
static struct stp_globals stp_global;
#define global(name) (stp_global.name)
#define global_set(name, val) (global(name) = (val))
#define global_lock(name) (&global(name ## _lock))
#define global_lock_init(name) rwlock_init(global_lock(name))
#ifdef STP_TIMING
#define global_skipped(name) (&global(name ## _lock_skip_count))
#endif
static int stp_session_init(void)
{
size_t i;
#ifdef STP_ALIBI
for (i = 0; i < STP_PROBE_COUNT; ++i)
atomic_set(probe_alibi(i), 0);
#endif
#ifdef STP_TIMING
for (i = 0; i < STP_PROBE_COUNT; ++i)
g_probe_timing[i] = _stp_stat_init(HIST_NONE);
g_refresh_timing = _stp_stat_init(HIST_NONE);
#endif
return 0;
}