1tnfctl_register_funcs(3TNF) TNF Library Functions tnfctl_register_funcs(3TNF)
2
3
4
6 tnfctl_register_funcs - register callbacks for probe creation and
7 destruction
8
10 cc [ flag ... ] file ... -ltnfctl [ library ... ]
11 #include <tnf/tnfctl.h>
12
13 tnfctl_errcode_t tnfctl_register_funcs(tnfctl_handle_t *hndl, void * (*create_func)
14 (tnfctl_handle_t *, tnfctl_probe_t *), void (*destroy_func)(void *));
15
16
18 The function tnfctl_register_funcs() is used to store client-specific
19 data on a per-probe basis. It registers a creator and a destructor
20 function with hndl, either of which can be NULL. The creator function
21 is called for every probe that currently exists in hndl. Every time a
22 new probe is discovered, that is brought in by dlopen(3C), create_func
23 is called.
24
25
26 The return value of the creator function is stored as part of the
27 probe state and can be retrieved by tnfctl_probe_state_get(3TNF) in the
28 member field client_registered_data.
29
30
31 destroy_func is called for every probe handle that is freed. This does
32 not necessarily happen at the time dlclose(3C) frees the shared object.
33 The probe handles are freed only when hndl is closed by
34 tnfctl_close(3TNF). If tnfctl_register_funcs() is called a second time
35 for the same hndl, then the previously registered destructor function
36 is called first for all of the probes.
37
39 tnfctl_register_funcs() returns TNFCTL_ERR_NONE upon success.
40
42 TNFCTL_ERR_INTERNAL An internal error occurred.
43
44
46 See attributes(5) for descriptions of the following attributes:
47
48
49
50
51 ┌─────────────────────────────┬─────────────────────────────┐
52 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
53 ├─────────────────────────────┼─────────────────────────────┤
54 │Availability │SUNWtnfc │
55 ├─────────────────────────────┼─────────────────────────────┤
56 │MT Level │MT-Safe │
57 └─────────────────────────────┴─────────────────────────────┘
58
60 prex(1), TNF_PROBE(3TNF), dlclose(3C), dlopen(3C), libtnfctl(3TNF),
61 tnfctl_close(3TNF), tnfctl_probe_state_get(3TNF), tracing(3TNF),
62 tnf_kernel_probes(4), attributes(5)
63
64
65 Linker and Libraries Guide
66
67
68
69SunOS 5.11 1 Mar 2004 tnfctl_register_funcs(3TNF)