Skip to content

Commit

Permalink
Add BTF example
Browse files Browse the repository at this point in the history
  • Loading branch information
mephi42 committed Aug 4, 2020
1 parent 3e49640 commit d40504d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -7,10 +7,10 @@ lines in specified kernel functions by using kernel debuginfo and kprobes.
# Installation

```
# Fedora: sudo dnf install --enablerepo=updates-debuginfo -y git "kernel-debuginfo-$(uname -r)" pypy3 trace-cmd
# Ubuntu: sudo apt install -y git "linux-image-$(uname -r)-dbgsym" pypy3 trace-cmd
git clone https://github.com/mephi42/linetrace-cmd-record.git
cd linetrace-cmd-record
# Fedora: sudo dnf install --enablerepo=updates-debuginfo -y "kernel-debuginfo-$(uname -r)" pypy3 trace-cmd
# Ubuntu: sudo apt install -y "linux-image-$(uname -r)-dbgsym" pypy3 trace-cmd
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo pypy3 get-pip.py --user
sudo pypy3 -m pip install --upgrade --user -r requirements.txt
Expand Down Expand Up @@ -50,3 +50,9 @@ $ trace-cmd report | grep -v -e ^CPU -e ^cpus= | head -n 20
<...>-1571473 [005] 1198357.632256: funcgraph_entry: 0.179 us | raw_copy_from_user();
<...>-1571473 [005] 1198357.632256: funcgraph_exit: 1.112 us | }
```

Debugging BTF loading:

```
# pypy3 ~/linetrace-cmd-record/linetrace-cmd-record -L btf_new_fd -p function_graph -g btf_new_fd bpftool prog load flow.o /sys/fs/bpf/flow
```

0 comments on commit d40504d

Please sign in to comment.