Brenden Blanco | 41d10e2 | 2015-06-05 13:28:17 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (c) PLUMgrid, Inc. |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License") |
| 4 | |
Brenden Blanco | 6bf723d | 2015-06-18 17:53:31 -0700 | [diff] [blame] | 5 | # run in project examples directory with: |
| 6 | # sudo ./hello_world.py" |
Brendan Gregg | e845c52 | 2015-09-07 14:51:53 -0700 | [diff] [blame] | 7 | # see trace_fields.py for a longer example |
Brenden Blanco | 41d10e2 | 2015-06-05 13:28:17 -0700 | [diff] [blame] | 8 | |
Brenden Blanco | c35989d | 2015-09-02 18:04:07 -0700 | [diff] [blame] | 9 | from bcc import BPF |
Brenden Blanco | 41d10e2 | 2015-06-05 13:28:17 -0700 | [diff] [blame] | 10 | |
Yonghong Song | 83b49ad | 2018-04-24 10:15:24 -0700 | [diff] [blame] | 11 | # This may not work for 4.17 on x64, you need replace kprobe__sys_clone with kprobe____x64_sys_clone |
Brendan Gregg | af98a1d | 2016-07-24 16:19:20 -0700 | [diff] [blame] | 12 | BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print() |