HPCToolkit
cct_backtrace_finalize.c
Go to the documentation of this file.
1
//******************************************************************************
2
// local includes
3
//******************************************************************************
4
5
#include "
cct_backtrace_finalize.h
"
6
7
8
9
//******************************************************************************
10
// global variables
11
//******************************************************************************
12
13
static
cct_backtrace_finalize_entry_t
*
finalizers
;
14
15
static
cct_cursor_finalize_fn
cursor_finalize
;
16
17
18
19
//******************************************************************************
20
// interface operations
21
//******************************************************************************
22
23
void
24
cct_backtrace_finalize_register
(
25
cct_backtrace_finalize_entry_t
*e
26
)
27
{
28
// enqueue finalizer on list
29
e->
next
=
finalizers
;
30
finalizers = e;
31
}
32
33
34
void
35
cct_cursor_finalize_register
(
36
cct_cursor_finalize_fn
fn
37
)
38
{
39
cursor_finalize
= fn;
40
}
41
42
43
void
44
cct_backtrace_finalize
(
45
backtrace_info_t
*bt,
46
int
isSync
47
)
48
{
49
cct_backtrace_finalize_entry_t
*e =
finalizers
;
50
while
(e) {
51
e->
fn
(bt, isSync);
52
e = e->
next
;
53
}
54
}
55
56
57
cct_node_t
*
58
cct_cursor_finalize
(
59
cct_bundle_t
*cct,
60
backtrace_info_t
*bt,
61
cct_node_t
*cursor
62
)
63
{
64
if
(
cursor_finalize
)
return
cursor_finalize
(cct, bt, cursor);
65
else
return
cursor;
66
}
67
finalizers
static cct_backtrace_finalize_entry_t * finalizers
Definition:
cct_backtrace_finalize.c:13
cursor_finalize
static cct_cursor_finalize_fn cursor_finalize
Definition:
cct_backtrace_finalize.c:15
cct_cursor_finalize_fn
cct_node_t *(* cct_cursor_finalize_fn)(cct_bundle_t *cct, backtrace_info_t *bt, cct_node_t *cursor)
Definition:
cct_backtrace_finalize.h:30
cct_backtrace_finalize_register
void cct_backtrace_finalize_register(cct_backtrace_finalize_entry_t *e)
Definition:
cct_backtrace_finalize.c:24
cct_cursor_finalize_register
void cct_cursor_finalize_register(cct_cursor_finalize_fn fn)
Definition:
cct_backtrace_finalize.c:35
cct_bundle_t
Definition:
cct_bundle.h:61
cct_cursor_finalize
cct_node_t * cct_cursor_finalize(cct_bundle_t *cct, backtrace_info_t *bt, cct_node_t *cursor)
Definition:
cct_backtrace_finalize.c:58
cct_backtrace_finalize_entry_s
Definition:
cct_backtrace_finalize.h:24
cct_backtrace_finalize_entry_s::fn
cct_backtrace_finalize_fn fn
Definition:
cct_backtrace_finalize.h:25
backtrace_info_t
Definition:
backtrace_info.h:18
cct_node_t
Definition:
cct.c:96
cct_backtrace_finalize
void cct_backtrace_finalize(backtrace_info_t *bt, int isSync)
Definition:
cct_backtrace_finalize.c:44
cct_backtrace_finalize.h
cct_backtrace_finalize_entry_s::next
struct cct_backtrace_finalize_entry_s * next
Definition:
cct_backtrace_finalize.h:26
src
tool
hpcrun
cct_backtrace_finalize.c
Generated by
1.8.13