doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/const_value_func.c
raw| 1 | #include "sys/sdt.h" |
| 2 | |
| 3 | static int |
| 4 | bar (int i, long j) |
| 5 | { |
| 6 | return i * j; |
| 7 | } |
| 8 | |
| 9 | static int |
| 10 | func (int (*f) (int, long)) |
| 11 | { |
| 12 | volatile int i = 2; |
| 13 | volatile long j = 21; |
| 14 | STAP_PROBE (test, constvalues); |
| 15 | return f(i, j); |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main (int argc, char *argv[], char *envp[]) |
| 20 | { |
| 21 | return func (&bar) - 42; |
| 22 | } |