HPCToolkit
blame-shift.c
Go to the documentation of this file.
1 #include "blame-shift.h"
2 
3 static bs_fn_entry_t *bs_fns = 0;
4 
5 static int bs_type_registered[] = {0,0};
6 
7 void
9 {
10  entry->next = bs_fns;
11  bs_fns = entry;
12 }
13 
14 void
15 blame_shift_apply(int metric_id, cct_node_t *node, int metric_incr)
16 {
17  bs_fn_entry_t* fn = bs_fns;
18  while(fn != 0) {
19  fn->fn(fn->arg, metric_id, node, metric_incr);
20  fn = fn->next;
21  }
22 }
23 
24 void
26 {
27  bs_type_registered[bst] = 1;
28 }
29 
30 
31 int
33 {
34  return bs_type_registered[bst];
35 }
36 
static bs_fn_entry_t * bs_fns
Definition: blame-shift.c:3
struct bs_fn_entry_t * next
Definition: blame-shift.h:9
void blame_shift_source_register(bs_type bst)
Definition: blame-shift.c:25
cct_node_t * node
Definition: cct.c:128
Definition: blame-shift.h:8
void blame_shift_apply(int metric_id, cct_node_t *node, int metric_incr)
Definition: blame-shift.c:15
void blame_shift_register(bs_fn_entry_t *entry)
Definition: blame-shift.c:8
void * arg
Definition: blame-shift.h:11
bs_fn_t fn
Definition: blame-shift.h:10
static int bs_type_registered[]
Definition: blame-shift.c:5
int blame_shift_source_available(bs_type bst)
Definition: blame-shift.c:32
Definition: cct.c:96
bs_type
Definition: blame-shift.h:14