carta
bashreadline.bt(8)

bashreadline.bt8

Print bash commands system wide. uses bpftrace/ebpf.

Usage

bashreadline.bt

Overview

bashreadline traces the return of the readline() function using uretprobes, to show the bash commands that were entered interactively, system wide. The entered command may fail: this is just showing what was entered.

This program is also a basic example of bpftrace and uretprobes.

Since this uses BPF, only the root user can use this tool.

Requirements

CONFIG_BPF and bpftrace.

Examples

Trace bash commands system wide:

# bashreadline.bt

Fields

TIME

A timestamp on the output, in "HH:MM:SS" format.

PID

The process ID for bash.

COMMAND

Entered command.

Overhead

As the rate of interactive bash commands is expected to be very low (<<100/s), the overhead of this program is expected to be negligible.

Source

This is from bpftrace.

https://github.com/bpftrace/bpftrace

Also look in the bpftrace distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool.

This is a bpftrace version of the bcc tool of the same name. The bcc tool may provide more options and customizations.

https://github.com/iovisor/bcc

OS

Linux

Stability

Unstable - in development.

History

  • Arch Linux 2026-11-01 to Debian 13 (Trixie): the text shown here
  • Debian 11 (Bullseye) to Debian 10 (Buster)

Author

Brendan Gregg

From bpftrace 0.27.0-2 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.