bpftrace one line 工具

bpftrace 检查 vfs_write buffer 大小的 histogram 1 bpftrace -e 'kprobe:vfs_write { @bytes=hist(arg2); }' 如果希望过滤某一个进程的 write 操作,加 filter: 1 bpftrace -e 'kprobe:vfs_write /pid=={进程号}/ { @bytes=hist(arg2); }' bpftrace 检查 vfw_write 的延迟: 1 bpftrace -e 'kprobe:vfs_write { @start[tid] = nsecs; }

linux IO 简介

sector 硬盘上的数据最小单位是 sector,每个 sector 大小为 512 byte。所有的文件在硬盘上占用的大小都是 512 byte 的整数倍,一个文件在硬盘上可能是连续的 se

LVM 简介

传统的文件系统安装模式 传统的文件系统,是直接安装在分区之上。当你拿到一块存储设备,比如硬盘,或固态硬盘,首先要做的,是在设备上建立分区。 一个

linux 网络收包流程(NAPI)

linux 通过软中断机制调用网络协议栈代码,处理数据。 在 net_dev 模块初始化时,注册网络收发数据的软中断处理函数: 1 2 3 4 5 static int __init net_dev_init(void) { open_softirq(NET_TX_SOFTIRQ, net_tx_action); open_softirq(NET_RX_SOFTIRQ, net_rx_action); } kernel 为每个 cpu 创