| 1 | /* |
| 2 | * test-trace.c |
| 3 | * |
| 4 | * Test tracepoint probes. |
| 5 | */ |
| 6 | |
| 7 | #include <linux/module.h> |
| 8 | #include "tp-test.h" |
| 9 | #include <linux/ltt-type-serializer.h> |
| 10 | |
| 11 | /* kernel_trap_entry specialized tracepoint probe */ |
| 12 | |
| 13 | struct serialize_long_long { |
| 14 | unsigned long f1; |
| 15 | unsigned long f2; |
| 16 | unsigned char end_field[0]; |
| 17 | } LTT_ALIGN; |
| 18 | |
| 19 | void probe_test(void *a, void *b); |
| 20 | |
| 21 | DEFINE_MARKER_TP(kernel, test, kernel_test, |
| 22 | probe_test, "f1 %p f2 %p"); |
| 23 | |
| 24 | notrace void probe_test(void *a, void *b) |
| 25 | { |
| 26 | struct marker *marker; |
| 27 | struct serialize_long_long data; |
| 28 | |
| 29 | data.f1 = (long)a; |
| 30 | data.f2 = (long)b; |
| 31 | |
| 32 | marker = &GET_MARKER(kernel, test); |
| 33 | ltt_specialized_trace(marker, marker->single.probe_private, |
| 34 | &data, serialize_sizeof(data), sizeof(long)); |
| 35 | } |
| 36 | |
| 37 | MODULE_LICENSE("GPL"); |
| 38 | MODULE_AUTHOR("Mathieu Desnoyers"); |
| 39 | MODULE_DESCRIPTION("Test Tracepoint Probes"); |