git: 2bce3c9fcd57 - stable/15 - dtrace_io.4: Use bio_length instead of bio_bcount in examples

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Fri, 14 Nov 2025 14:27:04 UTC
The branch stable/15 has been updated by 0mp:

URL: https://cgit.FreeBSD.org/src/commit/?id=2bce3c9fcd574654681a81a23e31eca991815686

commit 2bce3c9fcd574654681a81a23e31eca991815686
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2025-10-26 16:52:11 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2025-11-14 14:27:01 +0000

    dtrace_io.4: Use bio_length instead of bio_bcount in examples
    
    Tracing bio_bcount makes little sense for some devices like for example
    md(4), as it is set to "0" instead of to the actual I/O length.
    
    markj@ suggested the following DTrace one-liner to identify some cases
    where bio_length is set but bio_bcount is not:
    
        dtrace -n 'io:::start /args[0]->bio_length != args[0]->bio_bcount/{printf("%d %d", args[0]->bio_length, args[0]->bio_bcount); stack();}'
    
    For future reference in the context of bio_length vs bio_bcount,
    phk@ mentioned in the code review that:
    
    > the original intent was to get rid of of bio_bcount
    
    Reviewed by:    markj
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D53365
    
    (cherry picked from commit db25448ab9ffa8bfe52d852674cc466494b849d1)
---
 share/man/man4/dtrace_io.4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/man/man4/dtrace_io.4 b/share/man/man4/dtrace_io.4
index 30ec44768fbf..1699cebab8e9 100644
--- a/share/man/man4/dtrace_io.4
+++ b/share/man/man4/dtrace_io.4
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 18, 2015
+.Dd October 26, 2025
 .Dt DTRACE_IO 4
 .Os
 .Sh NAME
@@ -84,7 +84,7 @@ The following script shows a per-process breakdown of total I/O by disk device:
 
 io:::start
 {
-        @[args[1]->device_name, execname, pid] = sum(args[0]->bio_bcount);
+        @[args[1]->device_name, execname, pid] = sum(args[0]->bio_length);
 }
 
 END