Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of uninitialized value(s) under FreeBSD 14.1 #10

Open
ozgurkazancci opened this issue Jul 4, 2024 · 1 comment
Open

Use of uninitialized value(s) under FreeBSD 14.1 #10

ozgurkazancci opened this issue Jul 4, 2024 · 1 comment

Comments

@ozgurkazancci
Copy link

zfs-stats -a under FreeBSD 14.1 gives several warning/issue reports:

Use of uninitialized value $kdata in multiplication (*) at /usr/local/bin/zfs-stats line 329.
Use of uninitialized value $vdev_cache_hits in addition (+) at /usr/local/bin/zfs-stats line 628.
Use of uninitialized value $vdev_cache_misses in addition (+) at /usr/local/bin/zfs-stats line 628.
Use of uninitialized value $vdev_cache_delegations in addition (+) at /usr/local/bin/zfs-stats line 628.
Use of uninitialized value in numeric eq (==) at /usr/local/bin/zfs-stats line 630.

zfs-stats version 1.3.2

Regards.

@shegnauer
Copy link

correction for line 329 error:

--- /original/zfs-stats       2023-05-19 11:19:45.000000000 +0200
+++ /usr/local/bin/zfs-stats    2024-07-19 09:56:40.768547000 +0200
@@ -323,10 +323,9 @@
        my $ktext;
        $ktext += $_ for @ktext; # add the elements of size up

-       my @kdata = map { /([0-9]+)K/ } run('vmstat_m'); # retrieve the MemUse column
+       my @kdata = map { /([0-9]+)/ && (split)[3] } run('vmstat_m'); # retrieve the MemUse column
        my $kdata;
        $kdata += $_ for @kdata; # add the elements of MemUse up
-       $kdata *= 1024; # convert from KiB to Bytes

        my $kmem = ($ktext + $kdata);
        my $kmem_map_size = $Kstat->{"vm.kmem_map_size"};

lines 628-630:
in my case I have vdev cache switched off, therefore the sysctl oid's are missing. For me the easy solution is NOT to use -D when calling zfs-stats. Note that -D is included in -a. In my case zfs-stats -IMAELZ works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants