blob: 49c55353bea121f7a6c512adfb390883071f24d6 [file] [log] [blame]
Brenden Blanco41d10e22015-06-05 13:28:17 -07001#!/usr/bin/env python
2# Copyright (c) PLUMgrid, Inc.
3# Licensed under the Apache License, Version 2.0 (the "License")
4
Brenden Blanco6bf723d2015-06-18 17:53:31 -07005# run in project examples directory with:
6# sudo ./hello_world.py"
Brendan Gregge845c522015-09-07 14:51:53 -07007# see trace_fields.py for a longer example
Brenden Blanco41d10e22015-06-05 13:28:17 -07008
Brenden Blancoc35989d2015-09-02 18:04:07 -07009from bcc import BPF
Brenden Blanco41d10e22015-06-05 13:28:17 -070010
Yonghong Song83b49ad2018-04-24 10:15:24 -070011# This may not work for 4.17 on x64, you need replace kprobe__sys_clone with kprobe____x64_sys_clone
Brendan Greggaf98a1d2016-07-24 16:19:20 -070012BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print()