HPCToolkit
cct.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#include <memory/hpcrun-malloc.h>
#include <hpcrun/metrics.h>
#include <messages/messages.h>
#include <lib/prof-lean/splay-macros.h>
#include <lib/prof-lean/hpcrun-fmt.h>
#include <hpcrun/hpcrun_return_codes.h>
#include "cct.h"
#include "cct_addr.h"
#include "cct2metrics.h"
Include dependency graph for cct.c:

Go to the source code of this file.

Classes

struct  cct_node_t
 
struct  write_arg_t
 
struct  mjarg_t
 

Macros

#define l_lt(a, b)   cct_addr_lt(a, &(b))
 
#define l_gt(a, b)   cct_addr_gt(a, &(b))
 

Functions

static uint32_t new_persistent_id ()
 
static cct_node_tcct_node_create (cct_addr_t *addr, cct_node_t *parent)
 
static cct_node_tsplay (cct_node_t *cct, cct_addr_t *addr)
 
static void walk_child_lrs (cct_node_t *cct, cct_op_t op, cct_op_arg_t arg, size_t level, void(*wf)(cct_node_t *n, cct_op_t o, cct_op_arg_t a, size_t l))
 
static void walkset_l (cct_node_t *cct, cct_op_t fn, cct_op_arg_t arg, size_t level)
 
static void l_count (cct_node_t *n, cct_op_arg_t arg, size_t level)
 
static void walk_path_l (cct_node_t *node, cct_op_t op, cct_op_arg_t arg, size_t level)
 
static void lwrite (cct_node_t *node, cct_op_arg_t arg, size_t level)
 
cct_node_thpcrun_cct_new (void)
 
cct_node_thpcrun_cct_new_partial (void)
 
cct_node_thpcrun_cct_new_special (void *addr)
 
cct_node_thpcrun_cct_top_new (uint16_t lmid, uintptr_t lmip)
 
cct_node_thpcrun_cct_parent (cct_node_t *x)
 
int32_t hpcrun_cct_persistent_id (cct_node_t *x)
 
cct_addr_thpcrun_cct_addr (cct_node_t *node)
 
bool hpcrun_cct_no_children (cct_node_t *node)
 
bool hpcrun_cct_is_root (cct_node_t *node)
 
cct_node_thpcrun_cct_insert_addr (cct_node_t *node, cct_addr_t *frm)
 
void hpcrun_cct_terminate_path (cct_node_t *node)
 
bool hpcrun_cct_is_leaf (cct_node_t *node)
 
void hpcrun_cct_set_node_allocation (cct_node_t *node)
 
bool hpcrun_cct_is_node_allocation (cct_node_t *node)
 
void hpcrun_cct_set_node_variable (cct_node_t *node)
 
bool hpcrun_cct_is_node_variable (cct_node_t *node)
 
void hpcrun_cct_set_node_memaccess (cct_node_t *node)
 
bool hpcrun_cct_is_node_memaccess (cct_node_t *node)
 
void hpcrun_cct_set_node_root (cct_node_t *root)
 
bool hpcrun_cct_is_node_root (cct_node_t *node)
 
cct_node_thpcrun_cct_insert_node (cct_node_t *target, cct_node_t *src)
 
void hpcrun_cct_retain (cct_node_t *x)
 
int hpcrun_cct_retained (cct_node_t *x)
 
void hpcrun_cct_walk_child_1st_w_level (cct_node_t *cct, cct_op_t op, cct_op_arg_t arg, size_t level)
 
void hpcrun_cct_walk_node_1st_w_level (cct_node_t *cct, cct_op_t op, cct_op_arg_t arg, size_t level)
 
void hpcrun_cct_walkset (cct_node_t *cct, cct_op_t fn, cct_op_arg_t arg)
 
void hpcrun_walk_path (cct_node_t *node, cct_op_t op, cct_op_arg_t arg)
 
static void l_insert_path (cct_node_t *node, cct_op_arg_t arg, size_t level)
 
void hpcrun_cct_insert_path (cct_node_t **root, cct_node_t *path)
 
int hpcrun_cct_fwrite (cct2metrics_t *cct2metrics_map, cct_node_t *cct, FILE *fs, epoch_flags_t flags)
 
size_t hpcrun_cct_num_nodes (cct_node_t *cct)
 
cct_node_thpcrun_cct_find_addr (cct_node_t *cct, cct_addr_t *addr)
 
static void merge_or_join (cct_node_t *n, cct_op_arg_t a, size_t l)
 
static cct_node_tcct_child_find_cache (cct_node_t *cct, cct_addr_t *addr)
 
static void cct_disjoint_union_cached (cct_node_t *target, cct_node_t *src)
 
void hpcrun_cct_merge (cct_node_t *cct_a, cct_node_t *cct_b, merge_op_t merge, merge_op_arg_t arg)
 
static void help_cct_child_find_set_cache (cct_node_t *cct, cct_addr_t *addr)
 
cct_node_thpcrun_insert_special_node (cct_node_t *root, void *addr)
 
cct_node_thpcrun_cct_insert_path_return_leaf (cct_node_t *path, cct_node_t *root)
 
cct_node_thpcrun_cct_get_root (cct_node_t *node)
 

Variables

struct {
   cct_node_t *   node
 
   bool   found
 
   cct_addr_t *   addr
 
splay_cache
 
static cct_addr_t dc = ADDR2_I(-1, -1)
 

Macro Definition Documentation

◆ l_gt

#define l_gt (   a,
 
)    cct_addr_gt(a, &(b))

Definition at line 199 of file cct.c.

◆ l_lt

#define l_lt (   a,
 
)    cct_addr_lt(a, &(b))

Definition at line 198 of file cct.c.

Function Documentation

◆ cct_child_find_cache()

static cct_node_t * cct_child_find_cache ( cct_node_t cct,
cct_addr_t addr 
)
static

Definition at line 830 of file cct.c.

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

◆ cct_disjoint_union_cached()

static void cct_disjoint_union_cached ( cct_node_t target,
cct_node_t src 
)
static

Definition at line 841 of file cct.c.

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

◆ cct_node_create()

static cct_node_t* cct_node_create ( cct_addr_t addr,
cct_node_t parent 
)
static

Definition at line 149 of file cct.c.

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

◆ help_cct_child_find_set_cache()

static void help_cct_child_find_set_cache ( cct_node_t cct,
cct_addr_t addr 
)
static

Definition at line 800 of file cct.c.

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

◆ hpcrun_cct_addr()

cct_addr_t* hpcrun_cct_addr ( cct_node_t node)

Definition at line 369 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_find_addr()

cct_node_t* hpcrun_cct_find_addr ( cct_node_t cct,
cct_addr_t addr 
)

Definition at line 719 of file cct.c.

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

◆ hpcrun_cct_fwrite()

int hpcrun_cct_fwrite ( cct2metrics_t cct2metrics_map,
cct_node_t cct,
FILE *  fs,
epoch_flags_t  flags 
)

Definition at line 672 of file cct.c.

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

◆ hpcrun_cct_get_root()

cct_node_t* hpcrun_cct_get_root ( cct_node_t node)

Definition at line 882 of file cct.c.

Here is the call graph for this function:

◆ hpcrun_cct_insert_addr()

cct_node_t* hpcrun_cct_insert_addr ( cct_node_t node,
cct_addr_t frm 
)

Definition at line 405 of file cct.c.

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

◆ hpcrun_cct_insert_node()

cct_node_t* hpcrun_cct_insert_node ( cct_node_t target,
cct_node_t src 
)

Definition at line 537 of file cct.c.

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

◆ hpcrun_cct_insert_path()

void hpcrun_cct_insert_path ( cct_node_t **  root,
cct_node_t path 
)

Definition at line 662 of file cct.c.

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

◆ hpcrun_cct_insert_path_return_leaf()

cct_node_t* hpcrun_cct_insert_path_return_leaf ( cct_node_t path,
cct_node_t root 
)

Definition at line 871 of file cct.c.

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

◆ hpcrun_cct_is_leaf()

bool hpcrun_cct_is_leaf ( cct_node_t node)

Definition at line 458 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_is_node_allocation()

bool hpcrun_cct_is_node_allocation ( cct_node_t node)

Definition at line 474 of file cct.c.

◆ hpcrun_cct_is_node_memaccess()

bool hpcrun_cct_is_node_memaccess ( cct_node_t node)

Definition at line 504 of file cct.c.

◆ hpcrun_cct_is_node_root()

bool hpcrun_cct_is_node_root ( cct_node_t node)

Definition at line 520 of file cct.c.

Here is the call graph for this function:

◆ hpcrun_cct_is_node_variable()

bool hpcrun_cct_is_node_variable ( cct_node_t node)

Definition at line 486 of file cct.c.

◆ hpcrun_cct_is_root()

bool hpcrun_cct_is_root ( cct_node_t node)

Definition at line 387 of file cct.c.

◆ hpcrun_cct_merge()

void hpcrun_cct_merge ( cct_node_t cct_a,
cct_node_t cct_b,
merge_op_t  merge,
merge_op_arg_t  arg 
)

Definition at line 769 of file cct.c.

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

◆ hpcrun_cct_new()

cct_node_t* hpcrun_cct_new ( void  )

Definition at line 326 of file cct.c.

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

◆ hpcrun_cct_new_partial()

cct_node_t* hpcrun_cct_new_partial ( void  )

Definition at line 332 of file cct.c.

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

◆ hpcrun_cct_new_special()

cct_node_t* hpcrun_cct_new_special ( void *  addr)

Definition at line 338 of file cct.c.

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

◆ hpcrun_cct_no_children()

bool hpcrun_cct_no_children ( cct_node_t node)

Definition at line 381 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_num_nodes()

size_t hpcrun_cct_num_nodes ( cct_node_t cct)

Definition at line 707 of file cct.c.

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

◆ hpcrun_cct_parent()

cct_node_t* hpcrun_cct_parent ( cct_node_t x)

Definition at line 357 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_persistent_id()

int32_t hpcrun_cct_persistent_id ( cct_node_t x)

Definition at line 363 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_retain()

void hpcrun_cct_retain ( cct_node_t x)

Definition at line 567 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_retained()

int hpcrun_cct_retained ( cct_node_t x)

Definition at line 576 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_set_node_allocation()

void hpcrun_cct_set_node_allocation ( cct_node_t node)

Definition at line 468 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_set_node_memaccess()

void hpcrun_cct_set_node_memaccess ( cct_node_t node)

Definition at line 495 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_set_node_root()

void hpcrun_cct_set_node_root ( cct_node_t root)

Definition at line 513 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_set_node_variable()

void hpcrun_cct_set_node_variable ( cct_node_t node)

Definition at line 480 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_terminate_path()

void hpcrun_cct_terminate_path ( cct_node_t node)

Definition at line 452 of file cct.c.

Here is the caller graph for this function:

◆ hpcrun_cct_top_new()

cct_node_t* hpcrun_cct_top_new ( uint16_t  lmid,
uintptr_t  lmip 
)

Definition at line 348 of file cct.c.

Here is the call graph for this function:

◆ hpcrun_cct_walk_child_1st_w_level()

void hpcrun_cct_walk_child_1st_w_level ( cct_node_t cct,
cct_op_t  op,
cct_op_arg_t  arg,
size_t  level 
)

Definition at line 599 of file cct.c.

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

◆ hpcrun_cct_walk_node_1st_w_level()

void hpcrun_cct_walk_node_1st_w_level ( cct_node_t cct,
cct_op_t  op,
cct_op_arg_t  arg,
size_t  level 
)

Definition at line 611 of file cct.c.

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

◆ hpcrun_cct_walkset()

void hpcrun_cct_walkset ( cct_node_t cct,
cct_op_t  fn,
cct_op_arg_t  arg 
)

Definition at line 623 of file cct.c.

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

◆ hpcrun_insert_special_node()

cct_node_t* hpcrun_insert_special_node ( cct_node_t root,
void *  addr 
)

Definition at line 861 of file cct.c.

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

◆ hpcrun_walk_path()

void hpcrun_walk_path ( cct_node_t node,
cct_op_t  op,
cct_op_arg_t  arg 
)

Definition at line 636 of file cct.c.

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

◆ l_count()

static void l_count ( cct_node_t n,
cct_op_arg_t  arg,
size_t  level 
)
static

Definition at line 243 of file cct.c.

Here is the caller graph for this function:

◆ l_insert_path()

static void l_insert_path ( cct_node_t node,
cct_op_arg_t  arg,
size_t  level 
)
static

Definition at line 646 of file cct.c.

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

◆ lwrite()

static void lwrite ( cct_node_t node,
cct_op_arg_t  arg,
size_t  level 
)
static

Definition at line 274 of file cct.c.

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

◆ merge_or_join()

static void merge_or_join ( cct_node_t n,
cct_op_arg_t  a,
size_t  l 
)
static

Definition at line 787 of file cct.c.

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

◆ new_persistent_id()

static uint32_t new_persistent_id ( )
static

Definition at line 137 of file cct.c.

Here is the caller graph for this function:

◆ splay()

static cct_node_t* splay ( cct_node_t cct,
cct_addr_t addr 
)
static

Definition at line 202 of file cct.c.

Here is the caller graph for this function:

◆ walk_child_lrs()

static void walk_child_lrs ( cct_node_t cct,
cct_op_t  op,
cct_op_arg_t  arg,
size_t  level,
void(*)(cct_node_t *n, cct_op_t o, cct_op_arg_t a, size_t l)  wf 
)
static

Definition at line 219 of file cct.c.

Here is the caller graph for this function:

◆ walk_path_l()

static void walk_path_l ( cct_node_t node,
cct_op_t  op,
cct_op_arg_t  arg,
size_t  level 
)
static

Definition at line 253 of file cct.c.

Here is the caller graph for this function:

◆ walkset_l()

static void walkset_l ( cct_node_t cct,
cct_op_t  fn,
cct_op_arg_t  arg,
size_t  level 
)
static

Definition at line 231 of file cct.c.

Here is the caller graph for this function:

Variable Documentation

◆ addr

cct_addr_t* addr

Definition at line 130 of file cct.c.

◆ dc

cct_addr_t dc = ADDR2_I(-1, -1)
static

Definition at line 797 of file cct.c.

◆ found

bool found

Definition at line 129 of file cct.c.

◆ node

cct_node_t* node

Definition at line 128 of file cct.c.

◆ splay_cache

struct { ... } splay_cache