Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

UNLIMITED

Linux Format

Use eBPF to keep tabs on your CPU

OUR EXPERT

Mihalis Tsoukalos is a systems engineer and a technical writer. You can reach him at @mactsouk.

We’re continuing our dive into the notoriously complex Extended Berkeley Packet Filter (eBPF) feature of the Linux kernel. In this part we’ll be tackling processor monitoring and everything that involves. Bear in mind that you should read part one of this eBPF tutorial from the previous issue to learn how to enable eBPF and install the tools of the BCC project. Additionally, all commands discussed here need root privileges to be executed, which makes perfect sense because we’re working in kernel space.

We’ll be using the term observability in this series of tutorials, so let’s define it. Observability is about understanding a system by observing it, rather than modifying it, using sampling tools to trace it. So, in this tutorial we’ll observe the CPU and its cores. We’ll begin this tutorial by presenting a generic eBPF utility: bpftool.

Task listing

Let’s see how you can use bpftool for tracing active (loaded) BPF objects. This tool isn’t connected to just CPU observability, but if you’re using eBPF a lot then it provides a handy way of knowing how you’re making use of eBPF on your Linux machine.

Running bpftool without any command line arguments displays a help screen. Here you can see the supported object types: prog, map, cgroup, perf, net, feature and btf. You can get a help screen for each one of themcommand line utility as well as the output of bpftool prog help . Each command can have subcommands. This section is going to use the prog object type only, which enables you to print the BPF commands of a eBPF program.

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format3 min read
Intel Core Ultra 9 285K
Intel’s flagship £549 Core Ultra 9 285K headlines its new Arrow Lake Core Ultra 200S series, leading the charge with 24 cores melded into a completely new chiplet architecture that comes with plenty of new leading-edge tech, such as 3D Foveros packag
Linux Format1 min read
Your Digital Issue Access
» As a big thank you for subscribing to Linux Format Print Edition, we’ve always offered digital access to past issues. It seems The Management thought it was a good idea and has rolled out a new system using Pocketmags ! This means there are now two
Linux Format2 min read
Audacious
Version: 4.4.1 Web:https://audacious-media-player.org Sometimes you just need a simple music player. No music library, no streaming from privacy-invading proprietary services, no overcooked user interface. Just a lightweight tool that doesn’t make li

Related Books & Audiobooks