I'm executing the following DTrace program on FreeBSD 13.1-RELEASE amd64 (the classic bitesize.d ported to FreeBSD): dtrace:::BEGIN { printf("Tracing... Hit Ctrl-C to end.\n"); } io:::start { @size[pid, execname] = quantize(args[0]->bio_bcount); } dtrace:::END { printf("\n%8s %s\n", "PID", "CMD"); printa("%8d %s\n%@d\n", @size); } and I'm getting a lot of the following log messages shorty after the script is started: dtrace: error on enabled probe ID 2 (ID 79710: io:kernel:none:start): invalid address (0x20) in action #4 at DIF offset 16 I tested that on multiple amd64 machines on 13.1-RELEASE. The result is the same. What could be causing that?
It's because there is a io:::start probe in devstat_start_transaction(), but there is no BIO to reference. I'll commit a patch to remove those probes, since I don't think they're very useful. BTW, this script isn't going to give you much information on FreeBSD. The io probes are too "deep" in the I/O path to retain any association with the process that initiated the I/O. That is, "execname" will not tell you much. In some cases it might, but that depends on the filesystem and GEOM providers in use.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51 commit 32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-08-29 17:22:36 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-08-29 17:22:36 +0000 devstat: Remove DTrace io probes lacking a BIO reference The io:::start and end probes trace individual I/O requests. Also remove the unimplemented wait-start and wait-done probes. PR: 266098 MFC after: 1 week sys/kern/subr_devstat.c | 10 ---------- 1 file changed, 10 deletions(-)
*** Bug 220965 has been marked as a duplicate of this bug. ***
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=22ea3be839edcc877c4199081147499065595d09 commit 22ea3be839edcc877c4199081147499065595d09 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-08-29 17:22:36 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-09-21 20:09:25 +0000 devstat: Remove DTrace io probes lacking a BIO reference The io:::start and end probes trace individual I/O requests. Also remove the unimplemented wait-start and wait-done probes. PR: 266098 (cherry picked from commit 32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51) sys/kern/subr_devstat.c | 10 ---------- 1 file changed, 10 deletions(-)