How To Install bpftrace.x86_64 on Amazon Linux 2

In this tutorial we learn how to install bpftrace.x86_64 in Amazon Linux 2. bpftrace.x86_64 is High-level tracing language for Linux eBPF

Introduction

In this tutorial we learn how to install bpftrace.x86_64 on Amazon Linux 2.

What is bpftrace.x86_64

BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet Filter (eBPF) available in recent Linux kernels (4.x). BPFtrace uses LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for interacting with the Linux BPF system, as well as existing Linux tracing capabilities dynamic tracing (kprobes), user-level dynamic tracing (uprobes), and tracepoints. The BPFtrace language is inspired by awk and C, and predecessor tracers such as DTrace and SystemTap

We can use yum to install bpftrace.x86_64 on Amazon Linux 2. In this tutorial we discuss both methods but you only need to choose one of method to install bpftrace.x86_64.

Install bpftrace.x86_64 on Amazon Linux 2 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install bpftrace.x86_64 using yum by running the following command:

sudo yum -y install bpftrace.x86_64

How To Uninstall bpftrace.x86_64 on Amazon Linux 2

To uninstall only the bpftrace.x86_64 package we can use the following command:

sudo yum remove bpftrace.x86_64

bpftrace.x86_64 Package Contents on Amazon Linux 2

/usr/bin/bpftrace
/usr/share/bpftrace
/usr/share/bpftrace/tools
/usr/share/bpftrace/tools/bashreadline.bt
/usr/share/bpftrace/tools/biolatency.bt
/usr/share/bpftrace/tools/biosnoop.bt
/usr/share/bpftrace/tools/biostacks.bt
/usr/share/bpftrace/tools/bitesize.bt
/usr/share/bpftrace/tools/capable.bt
/usr/share/bpftrace/tools/cpuwalk.bt
/usr/share/bpftrace/tools/dcsnoop.bt
/usr/share/bpftrace/tools/doc
/usr/share/bpftrace/tools/doc/bashreadline_example.txt
/usr/share/bpftrace/tools/doc/biolatency_example.txt
/usr/share/bpftrace/tools/doc/biosnoop_example.txt
/usr/share/bpftrace/tools/doc/biostacks_example.txt
/usr/share/bpftrace/tools/doc/bitesize_example.txt
/usr/share/bpftrace/tools/doc/capable_example.txt
/usr/share/bpftrace/tools/doc/cpuwalk_example.txt
/usr/share/bpftrace/tools/doc/dcsnoop_example.txt
/usr/share/bpftrace/tools/doc/execsnoop_example.txt
/usr/share/bpftrace/tools/doc/gethostlatency_example.txt
/usr/share/bpftrace/tools/doc/killsnoop_example.txt
/usr/share/bpftrace/tools/doc/loads_example.txt
/usr/share/bpftrace/tools/doc/mdflush_example.txt
/usr/share/bpftrace/tools/doc/naptime_example.txt
/usr/share/bpftrace/tools/doc/oomkill_example.txt
/usr/share/bpftrace/tools/doc/opensnoop_example.txt
/usr/share/bpftrace/tools/doc/pidpersec_example.txt
/usr/share/bpftrace/tools/doc/runqlat_example.txt
/usr/share/bpftrace/tools/doc/runqlen_example.txt
/usr/share/bpftrace/tools/doc/setuids_example.txt
/usr/share/bpftrace/tools/doc/statsnoop_example.txt
/usr/share/bpftrace/tools/doc/swapin_example.txt
/usr/share/bpftrace/tools/doc/syncsnoop_example.txt
/usr/share/bpftrace/tools/doc/syscount_example.txt
/usr/share/bpftrace/tools/doc/tcpaccept_example.txt
/usr/share/bpftrace/tools/doc/tcpconnect_example.txt
/usr/share/bpftrace/tools/doc/tcpdrop_example.txt
/usr/share/bpftrace/tools/doc/tcplife_example.txt
/usr/share/bpftrace/tools/doc/tcpretrans_example.txt
/usr/share/bpftrace/tools/doc/tcpsynbl_example.txt
/usr/share/bpftrace/tools/doc/threadsnoop_example.txt
/usr/share/bpftrace/tools/doc/vfscount_example.txt
/usr/share/bpftrace/tools/doc/vfsstat_example.txt
/usr/share/bpftrace/tools/doc/writeback_example.txt
/usr/share/bpftrace/tools/doc/xfsdist_example.txt
/usr/share/bpftrace/tools/execsnoop.bt
/usr/share/bpftrace/tools/gethostlatency.bt
/usr/share/bpftrace/tools/killsnoop.bt
/usr/share/bpftrace/tools/loads.bt
/usr/share/bpftrace/tools/mdflush.bt
/usr/share/bpftrace/tools/naptime.bt
/usr/share/bpftrace/tools/oomkill.bt
/usr/share/bpftrace/tools/opensnoop.bt
/usr/share/bpftrace/tools/pidpersec.bt
/usr/share/bpftrace/tools/runqlat.bt
/usr/share/bpftrace/tools/runqlen.bt
/usr/share/bpftrace/tools/setuids.bt
/usr/share/bpftrace/tools/statsnoop.bt
/usr/share/bpftrace/tools/swapin.bt
/usr/share/bpftrace/tools/syncsnoop.bt
/usr/share/bpftrace/tools/syscount.bt
/usr/share/bpftrace/tools/tcpaccept.bt
/usr/share/bpftrace/tools/tcpconnect.bt
/usr/share/bpftrace/tools/tcpdrop.bt
/usr/share/bpftrace/tools/tcplife.bt
/usr/share/bpftrace/tools/tcpretrans.bt
/usr/share/bpftrace/tools/tcpsynbl.bt
/usr/share/bpftrace/tools/threadsnoop.bt
/usr/share/bpftrace/tools/vfscount.bt
/usr/share/bpftrace/tools/vfsstat.bt
/usr/share/bpftrace/tools/writeback.bt
/usr/share/bpftrace/tools/xfsdist.bt
/usr/share/doc/bpftrace-0.11.4
/usr/share/doc/bpftrace-0.11.4/CONTRIBUTING-TOOLS.md
/usr/share/doc/bpftrace-0.11.4/README.md
/usr/share/doc/bpftrace-0.11.4/reference_guide.md
/usr/share/doc/bpftrace-0.11.4/tutorial_one_liners.md
/usr/share/licenses/bpftrace-0.11.4
/usr/share/licenses/bpftrace-0.11.4/LICENSE
/usr/share/man/man8/bashreadline.8.gz
/usr/share/man/man8/biolatency.8.gz
/usr/share/man/man8/biosnoop.8.gz
/usr/share/man/man8/biostacks.8.gz
/usr/share/man/man8/bitesize.8.gz
/usr/share/man/man8/bpftrace.8.gz
/usr/share/man/man8/capable.8.gz
/usr/share/man/man8/cpuwalk.8.gz
/usr/share/man/man8/dcsnoop.8.gz
/usr/share/man/man8/execsnoop.8.gz
/usr/share/man/man8/gethostlatency.8.gz
/usr/share/man/man8/killsnoop.8.gz
/usr/share/man/man8/loads.8.gz
/usr/share/man/man8/mdflush.8.gz
/usr/share/man/man8/naptime.8.gz
/usr/share/man/man8/oomkill.8.gz
/usr/share/man/man8/opensnoop.8.gz
/usr/share/man/man8/pidpersec.8.gz
/usr/share/man/man8/runqlat.8.gz
/usr/share/man/man8/runqlen.8.gz
/usr/share/man/man8/setuids.8.gz
/usr/share/man/man8/statsnoop.8.gz
/usr/share/man/man8/swapin.8.gz
/usr/share/man/man8/syncsnoop.8.gz
/usr/share/man/man8/syscount.8.gz
/usr/share/man/man8/tcpaccept.8.gz
/usr/share/man/man8/tcpconnect.8.gz
/usr/share/man/man8/tcpdrop.8.gz
/usr/share/man/man8/tcplife.8.gz
/usr/share/man/man8/tcpretrans.8.gz
/usr/share/man/man8/tcpsynbl.8.gz
/usr/share/man/man8/threadsnoop.8.gz
/usr/share/man/man8/vfscount.8.gz
/usr/share/man/man8/vfsstat.8.gz
/usr/share/man/man8/writeback.8.gz
/usr/share/man/man8/xfsdist.8.gz

References

Summary

In this tutorial we learn how to install bpftrace.x86_64 on Amazon Linux 2 using yum.