Bug 1764748

Summary: pcp atopsar ignores 'samples' count
Product: Red Hat Enterprise Linux 7 Reporter: Charles Haithcock <chaithco>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED ERRATA QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.8CC: agerstmayr, jkurik, mgoodwin, nathans, patrickm
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: 7.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:24:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1782202    

Description Charles Haithcock 2019-10-23 17:19:01 UTC
Description of problem:


When providing the samples argument, the samples argument is ignored:


 r7 # pcp atopsar 1 1

r7  3.10.0-1062.4.1.el7.x86_64  #1 SMP Wed Sep 25 09:42:57 EDT 2019  x86_64  2019/10/23

-------------------------- analysis date: 2019/10/23 --------------------------

13:16:29  cpu  %usr %nice %sys %irq %softirq  %steal %guest  %wait %idle  _cpu_
13:16:30  all     1     0    2    0        0       0      0      0   197
            0     1     0    1    0        1       0      0      0    97
            1     0     0    0    0        0       0      0      0   100
13:16:31  all     3     0    4    0        0       0      0      0   193
            0     2     0    5    0        0       0      0      0    93
            1     1     0    0    0        0       0      0      0    99
13:16:32  all     2     0    4    0        0       0      0      0   194
            0     1     0    3    0        0       0      0      0    96
            1     0     0    0    0        0       0      0      0   100
^C


Version-Release number of selected component (if applicable):

 r7 # rpm -q pcp
pcp-4.3.2-3.el7_7.x86_64



How reproducible:

100%


Steps to Reproduce:
1. run a pcp atopsar command with both a sample and interval
2.
3.

Actual results:

pcp atopsar runs as if ignoring the samples argument


Expected results:

'samples' amount of samples are printed and then pcp atopsar terminates. 



Additional info:

Comment 2 Nathan Scott 2019-10-28 15:31:11 UTC
This is now fixed upstream (will be in upstream pcp-5.0.1), can be back-ported during next RHEL7 devel phase.

commit 2ab1cf5d1e547f991c64dde97749a666c045fc25
Author: Nathan Scott <nathans>
Date:   Tue Oct 29 02:28:10 2019 +1100

    pcp-atopsar: fix mishandling of some command line arguments
    
    Cleanup several aspects of command line handling in pcp-atopsar,
    and resolve a reported bug where the samples argument was not
    honoured due to shadowing of a same-named variable with atop.
    
    Resolves Red Hat BZ 1764748.

Comment 6 errata-xmlrpc 2020-09-29 19:24:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: pcp security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3869