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
This commit is contained in:
Mateusz Piotrowski
2025-10-26 17:52:11 +01:00
parent bd27bd1f51
commit db25448ab9
+2 -2
View File
@@ -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