Skip to main content
Version: main

trace_fsslower

The trace fsslower gadget streams file operations (open, read, write and fsync) that are slower than a threshold.

Requirements

  • Minimum Kernel Version : 5.4

Getting started

Running the gadget:

$ kubectl gadget run ghcr.io/inspektor-gadget/gadget/trace_fsslower:latest [flags]

Flags

--min

Minimum latency in µs to trace

Default value: "10000"

--pid

Show only bind events generated by this particular PID

Default value: ""

--filesystem

Filesystem to trace. Possible values are: btrfs, ext4, fuse, nfs, nfts3 or xfs.

Default value: "ext4"

Guide

In this guide you'll deploy an example workload that performs some open(), read() write() and sync() calls and will trace which ones are slower than 1 ms.

Let's start the gadget before running our workload:

$ kubectl gadget run trace_fsslower:latest --podname test-trace-fsslower --filesystem ext4 --min 1000
K8S.NODE K8S.NAMESPACE K8S.PODNAME K8S.CONTAINERNAME COMM PID TID TID DELTA_US OFFSET SIZE FILE OP

Launch a container that will perform input/output operations:

$ kubectl run test-trace-fsslower --restart=Never --image=debian -- /bin/sh -c "apt-get update && apt-get install -y git"
pod/test-trace-fsslower created

The tool will list the I/O operations that were slower than 1ms:

$ kubectl gadget run trace_fsslower:latest --podname test-trace-fsslower --filesystem ext4 --min 1000
K8S.NODE K8S.NAMESPACE K8S.PODNAME K8S.CONTAINERNAME COMM PID TID TID DELTA_US OFFSET SIZE FILE OP
minikube default test-trace-fsslower test-trace-fsslower http 60778 60778 60775 5832 3857488 8520 deb.debian.org_… F_WRITE
minikube default test-trace-fsslower test-trace-fsslower http 60778 60778 60775 1387 6647227 1688 deb.debian.org_… F_WRITE
minikube default test-trace-fsslower test-trace-fsslower store 60786 60786 60775 2085 14163567 25817 deb.debian.org_… F_WRITE
minikube default test-trace-fsslower test-trace-fsslower dpkg-preconfigu 60898 60898 60897 3077 0 9223372#56749 F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg-preconfigu 60898 60898 60897 2464 0 9223372#56751 F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg-preconfigu 60898 60898 60897 3393 0 9223372… config.dat-new F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg-preconfigu 60898 60898 60897 2077 0 9223372… templates.dat-n… F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 3669 0 9223372… triggers F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 3031 0 9223372… shlibs F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 3348 0 9223372… symbols F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 3064 0 9223372… md5sums F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 3108 0 9223372… control F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 2271 0 9223372… tmp.ci F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 1837 0 9223372… tmp.i F_FSYNC
minikube default test-trace-fsslower test-trace-fsslower dpkg 60985 60985 60849 1570 0 9223372… updates F_FSYNC