Skip to content

Instantly share code, notes, and snippets.

@liweinan
Created August 8, 2020 15:48
Show Gist options
  • Save liweinan/db1bf7a2063935a02f278b07761a61a9 to your computer and use it in GitHub Desktop.
Save liweinan/db1bf7a2063935a02f278b07761a61a9 to your computer and use it in GitHub Desktop.
fedora bcc

Fedora BCC Example

@liweinan
Copy link
Author

liweinan commented Aug 8, 2020

23121596901636_ pic_hd

@liweinan
Copy link
Author

liweinan commented Aug 8, 2020

CODE

https://github.com/iovisor/bcc/blob/master/examples/hello_world.py

#!/usr/bin/python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")

# run in project examples directory with:
# sudo ./hello_world.py"
# see trace_fields.py for a longer example

from bcc import BPF

# This may not work for 4.17 on x64, you need replace kprobe__sys_clone with kprobe____x64_sys_clone
BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print()

@liweinan
Copy link
Author

liweinan commented Aug 8, 2020

TODO

Write a Vagrantfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment