Commit 97fd5c4e authored by Krzesimir Nowak's avatar Krzesimir Nowak

Use env to find bpftrace

parent 8ec651e9
...@@ -170,10 +170,11 @@ iscsid is sleeping. ...@@ -170,10 +170,11 @@ iscsid is sleeping.
[...] [...]
``` ```
It can also be made executable to run stand-alone. Start by adding an interpreter line at the top (`#!`) with the path to your installed bpftrace (/usr/local/bin is the default): It can also be made executable to run stand-alone. Start by adding an interpreter line at the top (`#!`) with either the path to your installed bpftrace (/usr/local/bin is the default) or the path to `env` (usually just `/usr/bin/env`) followed by `bpftrace` (so it will find bpftrace in your `$PATH`):
``` ```
1 #!/usr/local/bin/bpftrace 1 #!/usr/local/bin/bpftrace
1 #!/usr/bin/env bpftrace
2 2
3 tracepoint:syscalls:sys_enter_nanosleep 3 tracepoint:syscalls:sys_enter_nanosleep
4 { 4 {
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* bashreadline Print entered bash commands from all running shells. * bashreadline Print entered bash commands from all running shells.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* biolatency.bt Block I/O latency as a histogram. * biolatency.bt Block I/O latency as a histogram.
* For Linux, uses bpftrace, eBPF. * For Linux, uses bpftrace, eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* biosnoop.bt Block I/O tracing tool, showing per I/O latency. * biosnoop.bt Block I/O tracing tool, showing per I/O latency.
* For Linux, uses bpftrace, eBPF. * For Linux, uses bpftrace, eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* bitesize Show disk I/O size as a histogram. * bitesize Show disk I/O size as a histogram.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* capable Trace security capabilitiy checks (cap_capable()). * capable Trace security capabilitiy checks (cap_capable()).
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* cpuwalk Sample which CPUs are executing processes. * cpuwalk Sample which CPUs are executing processes.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* dcsnoop Trace directory entry cache (dcache) lookups. * dcsnoop Trace directory entry cache (dcache) lookups.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* execsnoop.bt Trace new processes via exec() syscalls. * execsnoop.bt Trace new processes via exec() syscalls.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* gethostlatency Trace getaddrinfo/gethostbyname[2] calls. * gethostlatency Trace getaddrinfo/gethostbyname[2] calls.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* killsnoop Trace signals issued by the kill() syscall. * killsnoop Trace signals issued by the kill() syscall.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* loads Prints load averages. * loads Prints load averages.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* mdflush Trace md flush events. * mdflush Trace md flush events.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* oomkill Trace OOM killer. * oomkill Trace OOM killer.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* opensnoop Trace open() syscalls. * opensnoop Trace open() syscalls.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* pidpersec Count new procesess (via fork). * pidpersec Count new procesess (via fork).
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* runqlat.bt CPU scheduler run queue latency as a histogram. * runqlat.bt CPU scheduler run queue latency as a histogram.
* For Linux, uses bpftrace, eBPF. * For Linux, uses bpftrace, eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* runqlen.bt CPU scheduler run queue length as a histogram. * runqlen.bt CPU scheduler run queue length as a histogram.
* For Linux, uses bpftrace, eBPF. * For Linux, uses bpftrace, eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* statsnoop Trace stat() syscalls. * statsnoop Trace stat() syscalls.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* syncsnoop Trace sync() variety of syscalls. * syncsnoop Trace sync() variety of syscalls.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* syscount.bt Count system callls. * syscount.bt Count system callls.
* For Linux, uses bpftrace, eBPF. * For Linux, uses bpftrace, eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* vfscount Count VFS calls ("vfs_*"). * vfscount Count VFS calls ("vfs_*").
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* vfsstat Count some VFS calls, with per-second summaries. * vfsstat Count some VFS calls, with per-second summaries.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* writeback Trace file system writeback events with details. * writeback Trace file system writeback events with details.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
#!/usr/local/bin/bpftrace #!/usr/bin/env bpftrace
/* /*
* xfsdist Summarize XFS operation latency. * xfsdist Summarize XFS operation latency.
* For Linux, uses bpftrace and eBPF. * For Linux, uses bpftrace and eBPF.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment