git: db25448ab9ff - main - dtrace_io.4: Use bio_length instead of bio_bcount in examples
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 31 Oct 2025 15:52:23 UTC
The branch main has been updated by 0mp:
URL: https://cgit.FreeBSD.org/src/commit/?id=db25448ab9ffa8bfe52d852674cc466494b849d1
commit db25448ab9ffa8bfe52d852674cc466494b849d1
Author: Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2025-10-26 16:52:11 +0000
Commit: Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2025-10-31 15:52:20 +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
---
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