HPCToolkit
metrics.c File Reference
#include <stdbool.h>
#include <stdlib.h>
#include <assert.h>
#include "monitor.h"
#include "metrics.h"
#include <memory/hpcrun-malloc.h>
#include <messages/messages.h>
#include <cct/cct.h>
#include <lib/prof-lean/hpcio.h>
#include <lib/prof-lean/hpcfmt.h>
#include <lib/prof-lean/hpcrun-fmt.h>
Include dependency graph for metrics.c:

Go to the source code of this file.

Classes

struct  metric_set_t
 
struct  kind_info_t
 

Macros

#define OPERATION_ASSIGN   '='
 
#define OPERATION_INCREMENT   '+'
 
#define OPERATION_MIN   '<'
 
#define OPERATION_MAX   '>'
 

Functions

kind_info_thpcrun_metrics_new_kind (void)
 
void hpcrun_metrics_switch_kind (kind_info_t *kind)
 
bool hpcrun_metrics_finalized ()
 
void hpcrun_pre_allocate_metrics (size_t num)
 
int hpcrun_get_num_metrics ()
 
void hpcrun_finalize_metrics ()
 
metric_desc_thpcrun_id2metric (int metric_id)
 
metric_desc_p_tbl_t * hpcrun_get_metric_tbl ()
 
metric_list_thpcrun_get_metric_data ()
 
metric_upd_proc_thpcrun_get_metric_proc (int metric_id)
 
int hpcrun_new_metric_of_kind (kind_info_t *kind)
 
int hpcrun_new_metric (void)
 
metric_desc_thpcrun_set_metric_info_w_fn (int metric_id, const char *name, MetricFlags_ValFmt_t valFmt, size_t period, metric_upd_proc_t upd_fn, metric_desc_properties_t prop)
 
metric_desc_thpcrun_set_metric_and_attributes (int metric_id, const char *name, MetricFlags_ValFmt_t valFmt, size_t period, metric_desc_properties_t prop, uint8_t show, uint8_t show_percent)
 
metric_desc_thpcrun_set_metric_info_and_period (int metric_id, const char *name, MetricFlags_ValFmt_t valFmt, size_t period, metric_desc_properties_t prop)
 
metric_desc_thpcrun_set_metric_info (int metric_id, const char *name)
 
void hpcrun_set_metric_name (int metric_id, char *name)
 
metric_set_thpcrun_metric_set_new (void)
 
cct_metric_data_thpcrun_metric_set_loc (metric_set_t *s, int id)
 
void hpcrun_metric_std (int metric_id, metric_set_t *set, char operation, hpcrun_metricVal_t val)
 
void hpcrun_metric_std_set (int metric_id, metric_set_t *set, hpcrun_metricVal_t value)
 
void hpcrun_metric_std_inc (int metric_id, metric_set_t *set, hpcrun_metricVal_t incr)
 
void hpcrun_metric_std_min (int metric_id, metric_set_t *set, hpcrun_metricVal_t val)
 
void hpcrun_metric_std_max (int metric_id, metric_set_t *set, hpcrun_metricVal_t val)
 
void hpcrun_metric_set_dense_copy (cct_metric_data_t *dest, metric_set_t *set, int num_metrics)
 

Variables

static int n_metrics = 0
 
static hpcrun_metricVal_tnull_metrics
 
static metric_list_tmetric_data = NULL
 
static bool has_set_max_metrics = false
 
static metric_list_tpre_alloc = NULL
 
static metric_desc_t ** id2metric
 
static metric_desc_p_tbl_t metric_tbl
 
static kind_info_t kinds = {.idx = 0, .link = NULL }
 
static kind_info_tcurrent_kind = &kinds
 
static kind_info_tcurrent_insert = &kinds
 
static metric_upd_proc_t ** metric_proc_tbl = NULL
 
static metric_proc_map_tproc_map = NULL
 

Macro Definition Documentation

◆ OPERATION_ASSIGN

#define OPERATION_ASSIGN   '='

Definition at line 72 of file metrics.c.

◆ OPERATION_INCREMENT

#define OPERATION_INCREMENT   '+'

Definition at line 73 of file metrics.c.

◆ OPERATION_MAX

#define OPERATION_MAX   '>'

Definition at line 75 of file metrics.c.

◆ OPERATION_MIN

#define OPERATION_MIN   '<'

Definition at line 74 of file metrics.c.

Function Documentation

◆ hpcrun_finalize_metrics()

void hpcrun_finalize_metrics ( void  )

Definition at line 245 of file metrics.c.

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

◆ hpcrun_get_metric_data()

metric_list_t* hpcrun_get_metric_data ( void  )

Definition at line 271 of file metrics.c.

◆ hpcrun_get_metric_proc()

metric_upd_proc_t* hpcrun_get_metric_proc ( int  metric_id)

Definition at line 281 of file metrics.c.

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

◆ hpcrun_get_metric_tbl()

metric_desc_p_tbl_t* hpcrun_get_metric_tbl ( void  )

Definition at line 262 of file metrics.c.

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

◆ hpcrun_get_num_metrics()

int hpcrun_get_num_metrics ( void  )

Definition at line 209 of file metrics.c.

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

◆ hpcrun_id2metric()

metric_desc_t* hpcrun_id2metric ( int  metric_id)

Definition at line 251 of file metrics.c.

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

◆ hpcrun_metric_set_dense_copy()

void hpcrun_metric_set_dense_copy ( cct_metric_data_t dest,
metric_set_t set,
int  num_metrics 
)

Definition at line 560 of file metrics.c.

Here is the caller graph for this function:

◆ hpcrun_metric_set_loc()

cct_metric_data_t* hpcrun_metric_set_loc ( metric_set_t s,
int  id 
)

Definition at line 465 of file metrics.c.

Here is the caller graph for this function:

◆ hpcrun_metric_set_new()

metric_set_t* hpcrun_metric_set_new ( void  )

Definition at line 456 of file metrics.c.

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

◆ hpcrun_metric_std()

void hpcrun_metric_std ( int  metric_id,
metric_set_t set,
char  operation,
hpcrun_metricVal_t  val 
)

Definition at line 475 of file metrics.c.

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

◆ hpcrun_metric_std_inc()

void hpcrun_metric_std_inc ( int  metric_id,
metric_set_t set,
hpcrun_metricVal_t  incr 
)

Definition at line 534 of file metrics.c.

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

◆ hpcrun_metric_std_max()

void hpcrun_metric_std_max ( int  metric_id,
metric_set_t set,
hpcrun_metricVal_t  val 
)

Definition at line 549 of file metrics.c.

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

◆ hpcrun_metric_std_min()

void hpcrun_metric_std_min ( int  metric_id,
metric_set_t set,
hpcrun_metricVal_t  val 
)

Definition at line 542 of file metrics.c.

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

◆ hpcrun_metric_std_set()

void hpcrun_metric_std_set ( int  metric_id,
metric_set_t set,
hpcrun_metricVal_t  value 
)

Definition at line 525 of file metrics.c.

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

◆ hpcrun_metrics_finalized()

bool hpcrun_metrics_finalized ( void  )

Definition at line 183 of file metrics.c.

◆ hpcrun_metrics_new_kind()

kind_info_t* hpcrun_metrics_new_kind ( void  )

Definition at line 147 of file metrics.c.

Here is the call graph for this function:

◆ hpcrun_metrics_switch_kind()

void hpcrun_metrics_switch_kind ( kind_info_t kind)

Definition at line 158 of file metrics.c.

◆ hpcrun_new_metric()

int hpcrun_new_metric ( void  )

Definition at line 333 of file metrics.c.

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

◆ hpcrun_new_metric_of_kind()

int hpcrun_new_metric_of_kind ( kind_info_t kind)

Definition at line 296 of file metrics.c.

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

◆ hpcrun_pre_allocate_metrics()

void hpcrun_pre_allocate_metrics ( size_t  num)

Definition at line 190 of file metrics.c.

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

◆ hpcrun_set_metric_and_attributes()

metric_desc_t* hpcrun_set_metric_and_attributes ( int  metric_id,
const char *  name,
MetricFlags_ValFmt_t  valFmt,
size_t  period,
metric_desc_properties_t  prop,
uint8_t  show,
uint8_t  show_percent 
)

Definition at line 397 of file metrics.c.

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

◆ hpcrun_set_metric_info()

metric_desc_t* hpcrun_set_metric_info ( int  metric_id,
const char *  name 
)

Definition at line 423 of file metrics.c.

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

◆ hpcrun_set_metric_info_and_period()

metric_desc_t* hpcrun_set_metric_info_and_period ( int  metric_id,
const char *  name,
MetricFlags_ValFmt_t  valFmt,
size_t  period,
metric_desc_properties_t  prop 
)

Definition at line 411 of file metrics.c.

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

◆ hpcrun_set_metric_info_w_fn()

metric_desc_t* hpcrun_set_metric_info_w_fn ( int  metric_id,
const char *  name,
MetricFlags_ValFmt_t  valFmt,
size_t  period,
metric_upd_proc_t  upd_fn,
metric_desc_properties_t  prop 
)

Definition at line 339 of file metrics.c.

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

◆ hpcrun_set_metric_name()

void hpcrun_set_metric_name ( int  metric_id,
char *  name 
)

Definition at line 439 of file metrics.c.

Here is the call graph for this function:

Variable Documentation

◆ current_insert

kind_info_t* current_insert = &kinds
static

Definition at line 144 of file metrics.c.

◆ current_kind

kind_info_t* current_kind = &kinds
static

Definition at line 143 of file metrics.c.

◆ has_set_max_metrics

bool has_set_max_metrics = false
static

Definition at line 101 of file metrics.c.

◆ id2metric

metric_desc_t** id2metric
static

Definition at line 107 of file metrics.c.

◆ kinds

kind_info_t kinds = {.idx = 0, .link = NULL }
static

Definition at line 142 of file metrics.c.

◆ metric_data

metric_list_t* metric_data = NULL
static

Definition at line 98 of file metrics.c.

◆ metric_proc_tbl

metric_upd_proc_t** metric_proc_tbl = NULL
static

Definition at line 168 of file metrics.c.

◆ metric_tbl

metric_desc_p_tbl_t metric_tbl
static

Definition at line 114 of file metrics.c.

◆ n_metrics

int n_metrics = 0
static

Definition at line 92 of file metrics.c.

◆ null_metrics

hpcrun_metricVal_t* null_metrics
static

Definition at line 95 of file metrics.c.

◆ pre_alloc

metric_list_t* pre_alloc = NULL
static

Definition at line 104 of file metrics.c.

◆ proc_map

metric_proc_map_t* proc_map = NULL
static

Definition at line 170 of file metrics.c.