Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/mod_init_exit_hooks_1.stp

raw
1 %{
2 #define STAP_MODULE_INIT_HOOK my_init
3
4 long my_global_var = 0;
5
6 static int my_init(void) {
7 my_global_var += 2;
8 return 0;
9 }
10 %}
11
12 function get_val:long() %{
13 STAP_RETURN(my_global_var);
14 %}
15
16 probe oneshot {
17 println("res: ", get_val());
18 }