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

arcstat -p and fix for compatibility with py2/3 #12916

Closed
justinpryzby opened this issue Dec 27, 2021 · 1 comment · Fixed by #13767
Closed

arcstat -p and fix for compatibility with py2/3 #12916

justinpryzby opened this issue Dec 27, 2021 · 1 comment · Fixed by #13767
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@justinpryzby
Copy link

System information

Type Version/Name
Distribution Name CentOS Linux
Distribution Version 7
Kernel Version 3.10.0-1160.11.1.el7
Architecture x86_64
OpenZFS Version 2.0.6 and .7

Describe the problem you're observing

arcstat -p doesn't work with either version of python:

Describe how to reproduce the problem

$ /usr/bin/python3.6 /usr/bin/arcstat -p
time read miss miss% dmis dm% pmis pm% mmis mm% size c avail
Traceback (most recent call last):
File "/usr/bin/arcstat", line 521, in
main()
File "/usr/bin/arcstat", line 506, in main
print_values()
File "/usr/bin/arcstat", line 260, in print_values
sys.stdout.write(sep.join(fmt(col) for col in hdr))
TypeError: sequence item 1: expected str instance, float found

Also, arcstat without -p shows rounded values with only one significant figure when run with py2.7.
The rounding behavior changed in py3 (/ means FP division, and integer division is now //).

@justinpryzby justinpryzby added the Type: Defect Incorrect behavior (e.g. crash, hang) label Dec 27, 2021
@justinpryzby
Copy link
Author

justinpryzby commented Dec 27, 2021

-        num = num / scale
+        num = float(num) / scale
...
-        fmt = lambda col: v[col]
+        fmt = lambda col: str(v[col])

@r-ricci r-ricci mentioned this issue Aug 11, 2022
13 tasks
behlendorf pushed a commit that referenced this issue Aug 12, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes #12916 
Closes #13767
behlendorf pushed a commit that referenced this issue Aug 12, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes #12916 
Closes #13767
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Sep 13, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
beren12 pushed a commit to beren12/zfs that referenced this issue Sep 19, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
snajpa pushed a commit to vpsfreecz/zfs that referenced this issue Oct 22, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
snajpa pushed a commit to vpsfreecz/zfs that referenced this issue Oct 22, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
snajpa pushed a commit to vpsfreecz/zfs that referenced this issue Oct 23, 2022
When the -p option is used, a list of floats is passed to sep.join(),
which expects strings. Fix this by converting each value to a string.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Roberto Ricci <ricci@disroot.org>
Closes openzfs#12916 
Closes openzfs#13767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant