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 | |
Brendan Gregg | af98a1d | 2016-07-24 16:19:20 -0700 | [diff] [blame] | 11 | BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print() |