[DTrace-devel] [PATCH 1/3] dlibs: use explicit vmlinux`major_names

Eugene Loh eugene.loh at oracle.com
Mon Jul 21 16:54:38 UTC 2025


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

On 7/21/25 09:34, Kris Van Hees wrote:
> It is better to use explicit module`symbol references in dlibs so as
> to avoid loading modules needlessly.
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>   dlibs/aarch64/5.11/io.d | 2 +-
>   dlibs/aarch64/5.12/io.d | 2 +-
>   dlibs/aarch64/5.14/io.d | 2 +-
>   dlibs/aarch64/5.16/io.d | 2 +-
>   dlibs/aarch64/5.2/io.d  | 2 +-
>   dlibs/aarch64/5.6/io.d  | 2 +-
>   dlibs/aarch64/6.1/io.d  | 2 +-
>   dlibs/aarch64/6.10/io.d | 2 +-
>   dlibs/x86_64/5.11/io.d  | 2 +-
>   dlibs/x86_64/5.12/io.d  | 2 +-
>   dlibs/x86_64/5.14/io.d  | 2 +-
>   dlibs/x86_64/5.16/io.d  | 2 +-
>   dlibs/x86_64/5.2/io.d   | 2 +-
>   dlibs/x86_64/5.6/io.d   | 2 +-
>   dlibs/x86_64/6.1/io.d   | 2 +-
>   dlibs/x86_64/6.10/io.d  | 2 +-
>   libdtrace/io.d.in       | 8 ++++----
>   17 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/dlibs/aarch64/5.11/io.d b/dlibs/aarch64/5.11/io.d
> index c153d5a2..c968a7d3 100644
> --- a/dlibs/aarch64/5.11/io.d
> +++ b/dlibs/aarch64/5.11/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_disk == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_disk == NULL ? "nfs" :
> diff --git a/dlibs/aarch64/5.12/io.d b/dlibs/aarch64/5.12/io.d
> index 09968d5a..6f60ae05 100644
> --- a/dlibs/aarch64/5.12/io.d
> +++ b/dlibs/aarch64/5.12/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/aarch64/5.14/io.d b/dlibs/aarch64/5.14/io.d
> index 09968d5a..6f60ae05 100644
> --- a/dlibs/aarch64/5.14/io.d
> +++ b/dlibs/aarch64/5.14/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/aarch64/5.16/io.d b/dlibs/aarch64/5.16/io.d
> index 09968d5a..6f60ae05 100644
> --- a/dlibs/aarch64/5.16/io.d
> +++ b/dlibs/aarch64/5.16/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/aarch64/5.2/io.d b/dlibs/aarch64/5.2/io.d
> index 5111df28..10666806 100644
> --- a/dlibs/aarch64/5.2/io.d
> +++ b/dlibs/aarch64/5.2/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_disk == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
>   				   ]->name);
>   	dev_statname = B->bi_disk == NULL ? "nfs" :
> diff --git a/dlibs/aarch64/5.6/io.d b/dlibs/aarch64/5.6/io.d
> index 5111df28..10666806 100644
> --- a/dlibs/aarch64/5.6/io.d
> +++ b/dlibs/aarch64/5.6/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_disk == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
>   				   ]->name);
>   	dev_statname = B->bi_disk == NULL ? "nfs" :
> diff --git a/dlibs/aarch64/6.1/io.d b/dlibs/aarch64/6.1/io.d
> index 09968d5a..6f60ae05 100644
> --- a/dlibs/aarch64/6.1/io.d
> +++ b/dlibs/aarch64/6.1/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/aarch64/6.10/io.d b/dlibs/aarch64/6.10/io.d
> index a1458d6f..45e7aa63 100644
> --- a/dlibs/aarch64/6.10/io.d
> +++ b/dlibs/aarch64/6.10/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/5.11/io.d b/dlibs/x86_64/5.11/io.d
> index ae4b62c3..b9f33433 100644
> --- a/dlibs/x86_64/5.11/io.d
> +++ b/dlibs/x86_64/5.11/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_disk == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_disk == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/5.12/io.d b/dlibs/x86_64/5.12/io.d
> index 0432b02c..7ce005f9 100644
> --- a/dlibs/x86_64/5.12/io.d
> +++ b/dlibs/x86_64/5.12/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/5.14/io.d b/dlibs/x86_64/5.14/io.d
> index 0432b02c..7ce005f9 100644
> --- a/dlibs/x86_64/5.14/io.d
> +++ b/dlibs/x86_64/5.14/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/5.16/io.d b/dlibs/x86_64/5.16/io.d
> index 0432b02c..7ce005f9 100644
> --- a/dlibs/x86_64/5.16/io.d
> +++ b/dlibs/x86_64/5.16/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/5.2/io.d b/dlibs/x86_64/5.2/io.d
> index 415bbb4c..d2af79c8 100644
> --- a/dlibs/x86_64/5.2/io.d
> +++ b/dlibs/x86_64/5.2/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_disk == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
>   				   ]->name);
>   	dev_statname = B->bi_disk == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/5.6/io.d b/dlibs/x86_64/5.6/io.d
> index 415bbb4c..d2af79c8 100644
> --- a/dlibs/x86_64/5.6/io.d
> +++ b/dlibs/x86_64/5.6/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_disk == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
>   				   ]->name);
>   	dev_statname = B->bi_disk == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/6.1/io.d b/dlibs/x86_64/6.1/io.d
> index 0432b02c..7ce005f9 100644
> --- a/dlibs/x86_64/6.1/io.d
> +++ b/dlibs/x86_64/6.1/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/dlibs/x86_64/6.10/io.d b/dlibs/x86_64/6.10/io.d
> index 92704839..716727ce 100644
> --- a/dlibs/x86_64/6.10/io.d
> +++ b/dlibs/x86_64/6.10/io.d
> @@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
>   	dev_instance = 0;
>   	dev_name = B->bi_bdev == NULL
>   			? "nfs"
> -			: stringof(((struct blk_major_name **)&`major_names)[
> +			: stringof(((struct blk_major_name **)&vmlinux`major_names)[
>   					getmajor(B->bi_bdev->bd_dev) % 255
>   				   ]->name);
>   	dev_statname = B->bi_bdev == NULL ? "nfs" :
> diff --git a/libdtrace/io.d.in b/libdtrace/io.d.in
> index 6d43444a..a869ddae 100644
> --- a/libdtrace/io.d.in
> +++ b/libdtrace/io.d.in
> @@ -130,10 +130,10 @@ translator devinfo_t < struct bio *B > {
>   	dev_minor = B->__disk_chk == NULL ? 0 : getminor(B->__bio_part_dev);
>   	dev_instance = 0;
>   	dev_name = B->__disk_chk == NULL
> -			? "nfs"
> -			: stringof(((struct blk_major_name **)`major_names)[
> -					getmajor(B->__bio_part_dev) % 255
> -				   ]->name);
> +		? "nfs"
> +		: stringof(((struct blk_major_name **)vmlinux`major_names)[
> +				getmajor(B->__bio_part_dev) % 255
> +			   ]->name);
>   	dev_statname = B->__disk_chk == NULL ? "nfs" :
>   	    (B->__bio_partno) == 0 ? stringof(B->__disk->disk_name) :
>   	    strjoin(stringof(B->__disk->disk_name), lltostr(B->__bio_partno));



More information about the DTrace-devel mailing list