代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/bpftrace 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff -Nuar bpftrace-0.19.1/tools/biosnoop.bt bpftrace-0.19.1.new/tools/biosnoop.bt
--- bpftrace-0.19.1/tools/biosnoop.bt 2023-10-04 16:18:18.000000000 +0800
+++ bpftrace-0.19.1.new/tools/biosnoop.bt 2024-05-30 23:23:45.817005781 +0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env bpftrace
+#!/usr/bin/bpftrace
/*
* biosnoop.bt Block I/O tracing tool, showing per I/O latency.
* For Linux, uses bpftrace, eBPF.
@@ -7,6 +7,7 @@
*
* This is a bpftrace version of the bcc tool of the same name.
*
+ * 10-Dec-2023 Costa Shulyupin Switched to block tracepoints.
* 15-Nov-2017 Brendan Gregg Created this.
*/
@@ -17,32 +18,30 @@
BEGIN
{
- printf("%-12s %-7s %-16s %-6s %7s\n", "TIME(ms)", "DISK", "COMM", "PID", "LAT(ms)");
+ printf("%-12s %-7s %-16s %-6s %7s\n", "TIME(ms)", "DEVICE", "COMM", "PID", "LAT(ms)");
}
-kprobe:blk_account_io_start,
-kprobe:__blk_account_io_start
+tracepoint:block:block_bio_queue
{
- @start[arg0] = nsecs;
- @iopid[arg0] = pid;
- @iocomm[arg0] = comm;
- @disk[arg0] = ((struct request *)arg0)->q->disk->disk_name;
+ @start[args.dev, args.sector] = nsecs;
+ @iopid[args.dev, args.sector] = pid;
+ @iocomm[args.dev, args.sector] = comm;
}
-kprobe:blk_account_io_done,
-kprobe:__blk_account_io_done
-/@start[arg0] != 0 && @iopid[arg0] != 0 && @iocomm[arg0] != ""/
-
+tracepoint:block:block_rq_complete,
+tracepoint:block:block_bio_complete
+/@start[args.dev, args.sector]/
{
- $now = nsecs;
- printf("%-12u %-7s %-16s %-6d %7d\n",
- elapsed / 1e6, @disk[arg0], @iocomm[arg0], @iopid[arg0],
- ($now - @start[arg0]) / 1e6);
-
- delete(@start[arg0]);
- delete(@iopid[arg0]);
- delete(@iocomm[arg0]);
- delete(@disk[arg0]);
+ printf("%-12u %4d:%-2d %-16s %-6d %7d\n",
+ elapsed / 1e6,
+ // like MAJOR(dev), MINOR(dev):
+ args.dev >> 20, args.dev & 0xfffff,
+ @iocomm[args.dev, args.sector],
+ @iopid[args.dev, args.sector],
+ (nsecs - @start[args.dev, args.sector]) / 1e6);
+ delete(@start[args.dev, args.sector]);
+ delete(@iopid[args.dev, args.sector]);
+ delete(@iocomm[args.dev, args.sector]);
}
END
@@ -50,5 +49,4 @@
clear(@start);
clear(@iopid);
clear(@iocomm);
- clear(@disk);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。