Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1651536 - pcp-system-tools's dstat does not parse arguments correctly
Summary: pcp-system-tools's dstat does not parse arguments correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: 29
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Scott
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-20 09:52 UTC by Doncho Gunchev
Modified: 2019-01-02 02:36 UTC (History)
8 users (show)

Fixed In Version: pcp-4.3.0-1.fc29 pcp-4.3.0-2.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-24 06:07:29 UTC
Type: Bug


Attachments (Terms of Use)

Description Doncho Gunchev 2018-11-20 09:52:51 UTC
Description of problem:
The command line parameters handling does not work (ex: dstat -df does not show all disks as it used to). I tried several other options and none worked (-D sda,sdb...).
I am reporting new bug as instructed in https://bugzilla.redhat.com/show_bug.cgi?id=1640913


Version-Release number of selected component (if applicable):
rpm -qf /usr/bin/dstat
pcp-system-tools-4.2.0-1.fc29.x86_64


How reproducible:
Always

Steps to Reproduce:
1. dstat -df

Actual results:
 read  writ
   0     0 
   0    58k


Expected results:
dsk/nvme0n1---dsk/sda-----dsk/sdb-----dsk/sdc-----dsk/sdd--
 read  writ: read  writ: read  writ: read  writ: read  writ
9766B   34k:  12M   40k:  12M   40k:7620k   73B:7640k   73B


Additional info:

pminfo -f disk.dev.read_bytes

disk.dev.read_bytes
    inst [0 or "sda"] value 3519973122
    inst [1 or "sdb"] value 3588425725
    inst [2 or "sdc"] value 589698742
    inst [3 or "sdd"] value 602937679
    inst [4 or "nvme0n1"] value 6138667



cat /proc/diskstats
   8       0 sda 116076445 6132356 15629880836 630989586 5487535 96987 50799937 129597889 0 73330839 808355224
   8       1 sda1 116076402 6132356 15629878284 630989538 4532937 96987 50799937 117527503 0 66135096 796042048
   8      16 sdb 132842953 6250473 15766786043 926817121 5487203 97308 50799937 128864543 2 87369385 1113130727
   8      17 sdb1 132842910 6250473 15766783491 926817067 4532607 97308 50799937 116728374 0 80239723 1100744241
   8      32 sdc 73754431 2562057 9769332076 863153459 19809 212 91275 1215119 0 37382814 892776251
   8      48 sdd 73859546 2563113 9795809950 674850663 19809 212 91275 1192997 0 33023625 702324803
 259       0 nvme0n1 362143 157 12236206 73297 683930 452663 44603590 7462121 0 289812222 297601587
 259       1 nvme0n1p1 372 0 11890 448 47 0 94 2 0 34 578
 259       2 nvme0n1p2 151 0 12954 22 371 53 161512 3761 0 173 3967
 259       3 nvme0n1p3 360595 2 12184498 72769 668610 451073 44415696 7452446 0 156678 7658388
 259       4 nvme0n1p4 902 155 18688 58 1749 1537 26288 809 0 802 1103
   9     127 md127 125269 0 30609572 0 340 0 2448 0 0 0 0
   9       1 md1 17096373 0 140988146 0 4239348 0 43782440 0 0 0 0
 253       0 dm-0 17096273 0 140985712 11934584 4237011 0 44548824 477424809 2 43705177 489361429
 253       1 dm-1 124959 0 30582010 646255 340 0 2552 94838 0 340887 741088

However the following command works as expected:

dstat -d -D sda,sdb
--dsk/sda-----dsk/sdb--
 read  writ: read  writ
  12M   40k:  12M   40k
   0     0 :   0     0 
   0     0 :   0     0 
   0    17k:   0    17k^C

However old dstat command:
dstat -d -D sda,sdb -o /dev/stdout 


"Host:","pc1.dsg.lan",,,,"User:","root"
"Cmdline:","dstat -d -D sda,sdb -o /dev/stdout",,,,"Date:","20 Nov 2018 11:51:18 EET"
"dsk/sda",,"dsk/sdb",
"dsk/sda:read","dsk/sda:writ","dsk/sdb:read","dsk/sdb:writ"
--dsk/sda-----dsk/sdb--
 read  writ: read  writ
12465851.488,40532.887,12575042.339,40532.887
  12M   40k:  12M   40k
0,0,0,0
   0     0 :   0     0 
0,21504,0,21504
   0    21k:   0    21k^C

new pcp:
dstat -d -D sda,sdb -o /dev/stdout 
Traceback (most recent call last):
  File "/usr/bin/dstat", line 1616, in <module>
    dstat.execute()
  File "/usr/bin/dstat", line 1600, in execute
    scheduler.run()
  File "/usr/lib64/python3.7/sched.py", line 151, in run
    action(*argument, **kwargs)
  File "/usr/bin/dstat", line 1609, in perform
    op.perform(update)
  File "/usr/bin/dstat", line 1513, in perform
    oline = oline + sep + self.gshowcsv(plugin, results)
  File "/usr/bin/dstat", line 1204, in gshowcsv
    line = line + self.roundcsv(value)
  File "/usr/bin/dstat", line 1107, in roundcsv
    if var != round(var):
TypeError: type NoneType doesn't define __round__ method

Comment 1 Nathan Scott 2018-11-21 01:20:36 UTC
Thanks Doncho - I have fixes for the -f/--full option problem and the TypeError issue in roundcsv().  I've CC'd yuokada who wrote the CSV code though, as I've noticed there's some other small inconsistencies there we should fix up too.

Comment 2 Fedora Update System 2018-12-21 04:11:18 UTC
pcp-4.3.0-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-3dc05c6d19

Comment 3 Fedora Update System 2018-12-21 04:12:17 UTC
pcp-4.3.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-3d0256193e

Comment 4 Fedora Update System 2018-12-22 01:33:24 UTC
pcp-4.3.0-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-3d0256193e

Comment 5 Fedora Update System 2018-12-22 02:58:11 UTC
pcp-4.3.0-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-3dc05c6d19

Comment 6 Edgar Hoch 2018-12-23 23:33:32 UTC
pcp-4.3.0-1.fc29:

This works as expected:

# dstat -d -f
--dsk/sda-----dsk/sdb-----dsk/sdc--
 read  writ: read  writ: read  writ
   0     0 :2810k    0 :2770k   74M
   0     0 :2707k 1508k:7374k   37M
   0    44k:3311k    0 :  16M   48M

# dstat -d -n -f 
--dsk/sda-----dsk/sdb-----dsk/sdc-- net/enp1s0f--net/virbr0-net/virbr0--net/enp1s0f----net/lo--
 read  writ: read  writ: read  writ| recv  send: recv  send: recv  send: recv  send: recv  send
   0     0 :4098k    0 :9450k 1002k| 581  1076 :   0     0 :   0     0 :   0     0 
   0     0 :4040k    0 :8612k 3192k|2876k   21k:   0     0 :   0     0 :   0     0 
   0     0 :4534k 2763k:  14M 5686k|7278k   91k:   0     0 :   0     0 :   0     0 


This is strange, but may be ok:

# dstat -d -D -f
No matching instances found.



But this crashes:

# dstat -D -f
You did not select any stats, using -cdngy by default.
Traceback (most recent call last):
  File "/usr/bin/dstat", line 1632, in <module>
    dstat.execute()
  File "/usr/bin/dstat", line 1616, in execute
    scheduler.run()
  File "/usr/lib64/python3.7/sched.py", line 151, in run
    action(*argument, **kwargs)
  File "/usr/bin/dstat", line 1625, in perform
    op.perform(update)
  File "/usr/bin/dstat", line 1509, in perform
    line = line + sep + self.gshow(plugin, results)
  File "/usr/bin/dstat", line 1148, in gshow
    metric = op.metrics[plugin.mgroup[0]]
IndexError: list index out of range

# dstat -d -f -a
Traceback (most recent call last):
  File "/usr/bin/dstat", line 1632, in <module>
    dstat.execute()
  File "/usr/bin/dstat", line 1616, in execute
    scheduler.run()
  File "/usr/lib64/python3.7/sched.py", line 151, in run
    action(*argument, **kwargs)
  File "/usr/bin/dstat", line 1625, in perform
    op.perform(update)
  File "/usr/bin/dstat", line 1509, in perform
    line = line + sep + self.gshow(plugin, results)
  File "/usr/bin/dstat", line 1148, in gshow
    metric = op.metrics[plugin.mgroup[0]]
IndexError: list index out of range

Comment 7 Fedora Update System 2018-12-24 06:07:29 UTC
pcp-4.3.0-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Zbigniew Jędrzejewski-Szmek 2018-12-24 10:51:53 UTC
Edgar, it's best to file a new bug. With the backtrace it'll be easy to fix.

Comment 9 Edgar Hoch 2018-12-24 11:23:47 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #8)
> Edgar, it's best to file a new bug. With the backtrace it'll be easy to fix.

Thanks. I have created bug 1661912.

Comment 10 Fedora Update System 2018-12-26 10:40:20 UTC
pcp-4.3.0-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-0913e3af78

Comment 11 Fedora Update System 2018-12-27 02:57:56 UTC
pcp-4.3.0-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-0913e3af78

Comment 12 Fedora Update System 2019-01-02 02:36:56 UTC
pcp-4.3.0-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.