diff --git a/0025-btt-eliminate-redundant-separators-in-btt-p-display.patch b/0025-btt-eliminate-redundant-separators-in-btt-p-display.patch new file mode 100644 index 0000000000000000000000000000000000000000..6306219fcfecb9e59daecbd91ae6646a5cb69502 --- /dev/null +++ b/0025-btt-eliminate-redundant-separators-in-btt-p-display.patch @@ -0,0 +1,105 @@ +From 0c2fb104f4875a28af41072f457e0204171dd0fb Mon Sep 17 00:00:00 2001 +From: Kou Wenqi +Date: Wed, 9 Apr 2025 17:27:42 +0800 +Subject: [PATCH] btt: eliminate redundant separators in btt -p display + +8,0 1 1 0.000000000 5315 Q WS 0 + 375 [dd] +8,0 1 2 0.000005314 5315 X WS 0 / 128 [dd] +8,0 1 3 0.000012623 5315 G WS 0 + 128 [dd] +8,0 1 4 0.000030582 5315 I WS 0 + 128 [dd] +8,0 1 5 0.000046089 5315 X WS 128 / 256 [dd] +8,0 1 6 0.000047072 5315 G WS 128 + 128 [dd] +8,0 1 7 0.000047513 5315 I WS 128 + 128 [dd] +8,0 1 8 0.000051336 5315 G WS 256 + 119 [dd] +8,0 1 9 0.000051562 5315 I WS 256 + 119 [dd] +8,0 1 10 0.000079209 109 D WS 0 + 128 [kworker/1:1H] +8,0 1 11 0.000308966 109 D WS 128 + 128 [kworker/1:1H] +8,0 1 12 0.000467117 109 D WS 256 + 119 [kworker/1:1H] +8,0 2 1 0.000596478 0 C WS 0 + 128 [0] +8,0 2 2 0.000616049 0 C WS 0 + 256 [0] +8,0 2 3 0.000618701 0 C WS 0 + 375 [0] +8,0 1 13 0.000909790 5315 Q WS 375 + 375 [dd] +8,0 1 14 0.000913783 5315 X WS 375 / 503 [dd] +8,0 1 15 0.000918960 5315 G WS 375 + 128 [dd] +8,0 1 16 0.000933605 5315 I WS 375 + 128 [dd] +8,0 1 17 0.000945282 5315 X WS 503 / 631 [dd] +8,0 1 18 0.000946635 5315 G WS 503 + 128 [dd] +8,0 1 19 0.000947169 5315 I WS 503 + 128 [dd] +8,0 1 20 0.000950159 5315 G WS 631 + 119 [dd] +8,0 1 21 0.000950570 5315 I WS 631 + 119 [dd] +8,0 1 22 0.000973481 109 D WS 375 + 128 [kworker/1:1H] +8,0 1 23 0.001133980 109 D WS 503 + 128 [kworker/1:1H] +8,0 1 24 0.001228540 109 D WS 631 + 119 [kworker/1:1H] +8,0 2 4 0.001377897 0 C WS 375 + 128 [0] +8,0 2 5 0.001385818 0 C WS 375 + 256 [0] +8,0 2 6 0.001389308 0 C WS 375 + 375 [0] + +Before this patch, the output of btt -p is as follows: +----------------------------------------- +----------------------------------------- + 8,0 : 0.000000000 Q 0+375 + 0.000012623 G 0+375 + 0.000030582 I 0+375 + 0.000618701 C 0+375 + +----------------------------------------- +----------------------------------------- +----------------------------------------- + 8,0 : 0.000909790 Q 375+375 + 0.000918960 G 375+375 + 0.000933605 I 375+375 + 0.001389308 C 375+375 + +----------------------------------------- + +After this patch, the output of btt -p is as follows: + 8,0 : 0.000000000 Q 0+375 + 0.000012623 G 0+375 + 0.000030582 I 0+375 + 0.000618701 C 0+375 + +----------------------------------------- + 8,0 : 0.000909790 Q 375+375 + 0.000918960 G 375+375 + 0.000933605 I 375+375 + 0.001389308 C 375+375 + +----------------------------------------- + +Signed-off-by: Kou Wenqi +--- + btt/trace_complete.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/btt/trace_complete.c b/btt/trace_complete.c +index 44732c5..6fb2347 100644 +--- a/btt/trace_complete.c ++++ b/btt/trace_complete.c +@@ -56,6 +56,7 @@ static void handle_complete(struct io *c_iop) + __u64 d_time = (__u64)-1; + FILE *pit_fp = c_iop->dip->pit_fp; + double cur = BIT_TIME(c_iop->t.time); ++ int q_iop_matched = 0; + + update_blks(c_iop); + update_cregion(&all_regions, c_iop->t.time); +@@ -67,6 +68,7 @@ static void handle_complete(struct io *c_iop) + + dip_foreach_list(c_iop, IOP_Q, &head); + list_for_each_safe(p, q, &head) { ++ q_iop_matched = 1; + struct io *q_iop = list_entry(p, struct io, f_head); + __u64 q2c = tdelta(q_iop->t.time, c_iop->t.time); + +@@ -103,7 +105,7 @@ static void handle_complete(struct io *c_iop) + io_release(q_iop); + } + +- if (per_io_ofp) ++ if (per_io_ofp && q_iop_matched) + fprintf(per_io_ofp, + "-----------------------------------------\n"); + +-- +2.43.0 + diff --git a/blktrace.spec b/blktrace.spec index 2bae13af4b969a9cae6ae1ab8b8d020e5a5afd3f..ecf279a6a443a7c3ac62d227d23a57745e4a63bd 100644 --- a/blktrace.spec +++ b/blktrace.spec @@ -1,6 +1,6 @@ Name: blktrace Version: 1.2.0 -Release: 29 +Release: 30 Summary: Block IO tracer in the Linux kernel License: GPLv2+ Source: http://brick.kernel.dk/snaps/blktrace-%{version}.tar.bz2 @@ -35,6 +35,7 @@ Patch21: 0021-blkparse-fix-incorrectly-sized-memset-in-check_cpu_m.patch Patch22: 0022-fix-hang-when-BLKTRACESETUP-fails-and-o-is-used.patch Patch23: 0023-blkparse-Fix-up-the-sector-and-length-of-split-compl.patch Patch24: 0024-blkparse-Fix-a-potential-coredump-issue.patch +Patch25: 0025-btt-eliminate-redundant-separators-in-btt-p-display.patch %description blktrace is a block layer IO tracing mechanism which provides detailed @@ -69,6 +70,9 @@ make dest=%{buildroot} prefix=%{buildroot}/%{_prefix} mandir=%{buildroot}/%{_man %{_mandir}/man8/* %changelog +* Thu Apr 17 2025 kouwenqi - 1.2.0-30 +- btt: eliminate redundant separators in btt -p display + * Fri Mar 21 2025 kouwenqi - 1.2.0-29 - blkparse: Fix a potential coredump issue