HomeFreeBSD

dtrace_io.4: Use bio_length instead of bio_bcount in examples

Description

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)

Details

Provenance
0mpAuthored on Oct 26 2025, 4:52 PM
Reviewer
markj
Differential Revision
D53365: dtrace_io.4: Use bio_length instead of bio_bcount in examples
Parents
rG794a904b454b: ipfilter: Don't trust userland supplied iph_size
Branches
Unknown
Tags
Unknown