1、1|2023 Micron Technology,Inc.All Rights Reserved.Virtual ConferenceSeptember 28-29,2021Understanding Applications Through NVMe Driver Tracing Using BPFJohn MazzieMember of Technical Staff,Systems Performance EngineerMicron Technology,Inc.2|2023 Micron Technology,Inc.All Rights Reserved.AgendaBPF and
2、 the NVMe DriverApplication Analysis:MLPerf Storage3|2021 Storage Developer Conference.Insert Company Name Here.All Rights Reserved.BPF and the NVMe Driver4|2023 Micron Technology,Inc.All Rights Reserved.BPF Overview4 Originally“Berkeley Packet Filter”Developed to analyze network traffic Integrated
3、with kernel Executes sandbox programs in kernel Used to trace,profile and monitor Utilizes a just-in-time compiler Verification Engine to protect kernel space Various features supported in different kernel versions Kernel 3.18 eBPF VM Kernel 5.5 BPF Trampoline support BPF stack(Kernel)is limited to
4、512 bytes Use maps to increase memory availability5|2023 Micron Technology,Inc.All Rights Reserved.Methods of Tracing Kernel/Drivers5 Tracepoints Stable interface Managed by developers over multiple kernel versions Limited to the data provided by tracepoint.Kprobes(Kernel Probes kprobe/kretprobe)Can
5、 attach/register probe to virtually any instruction.Attachment to none kernel methods/functions requires debug kernel.Can access data not directly provided.Unstable interface Kernel Functions are not stable across versions BPF Trampoline(kfunc/kretfunc and fentry/fexit)Interface is similar to kprobe
6、s Reduced overhead from kprobes Doesnt cause events to be missed due to interruption Requires kernel support(Added in mainline kernel 5.5)6|2023 Micron Technology,Inc.All Rights Reserved.Need6Original Multiple Tools Blktrace Used to analyze read/write pattern that was going to the device at the bloc