doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/sdt_casm.c
raw| 1 | #include <sys/sdt.h> |
| 2 | |
| 3 | int main() |
| 4 | { |
| 5 | int x = 42; |
| 6 | int y = 43; |
| 7 | __asm__ __volatile__ ( |
| 8 | STAP_PROBE_ASM(testsuite, probe0, STAP_PROBE_ASM_TEMPLATE(0)) |
| 9 | ); |
| 10 | __asm__ __volatile__ ( |
| 11 | STAP_PROBE_ASM(testsuite, probe1, STAP_PROBE_ASM_TEMPLATE(1)) |
| 12 | :: STAP_PROBE_ASM_OPERANDS(1, x) |
| 13 | ); |
| 14 | // Create a template to test explicit template support |
| 15 | __asm__ __volatile__ ( |
| 16 | STAP_PROBE_ASM(testsuite, probe2, -4@%[ARG1] -4@%[ARG2]) |
| 17 | :: [ARG1] "rm" (x), [ARG2] "rm" (y)); |
| 18 | return 0; |
| 19 | } |