doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/bpf-target.c
raw| 1 | // XXX compile with -g without -O |
| 2 | |
| 3 | //#include <stdio.h> |
| 4 | |
| 5 | // for user_long.stp, user_atvar_error.stp |
| 6 | long a = 3; |
| 7 | |
| 8 | // for user_long.stp |
| 9 | int i = -3; // 0x |
| 10 | short j = -2; // 0xfffe |
| 11 | char k = -1; // 0xff |
| 12 | |
| 13 | void foo(long *b) { |
| 14 | (*b)++; |
| 15 | } |
| 16 | |
| 17 | void bar(int *b, short *c, char *d) { |
| 18 | (void)b; (void)c; (void)d; |
| 19 | } |
| 20 | |
| 21 | int main(void) { |
| 22 | //printf("initial a: %d\n", a); |
| 23 | a++; |
| 24 | foo(&a); |
| 25 | bar(&i,&j,&k); |
| 26 | //printf("final a: %d\n", a); |
| 27 | return 0; |
| 28 | } |