Bug 1857121
| Summary: | `pcp atopsar` misinterprets `-H` option | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Denis Volkov <dvolkov> |
| Component: | pcp | Assignee: | Nathan Scott <nathans> |
| Status: | CLOSED ERRATA | QA Contact: | Jan Kurik <jkurik> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.2 | CC: | agerstmayr, cww, jkurik, mgoodwin, nathans, patrickm |
| Target Milestone: | rc | Keywords: | Bugfix, Triaged |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | pcp-5.2.1 | Doc Type: | No Doc Update |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-05-18 15:19:32 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: | 1854035 | ||
| Bug Blocks: | |||
Hi Denis, (In reply to Denis Volkov from comment #0) > Description of problem: > `pcp atopsar` has `-H` option: > > -H repeat report headers (in case of tty: depending on screen > lines) > > But it changes behaviour of pcp-atopsar instead of just adding the headers. Hmm, I don't think it does and I suspect confusion lies elsewhere, as follows: > > As shown, `pcp atopsar` interprets `-H 3` as `--interval 3` making it show > the current data every 3 seconds > --interval DELTA sampling interval The -H option does not take an argument, as per the man page: -H Repeat the header line within a report for every N detail lines. The value of N is determined dynami‐ cally in case of output to a tty/window (depending on the number of lines); for output to a file or pipe this value is 23. The documentations use of 'N' (as if it can be set) but then later saying 'determined dynamically' may be the source of confusion here? So, the '3' is a separate argument entirely, and that is the interpreted as (again from the man page): atopsar [-flags...] interval [ samples ] i.e. the '3' becomes the interval, correctly, and we sample every 3 seconds. > Additional info: > At the same time if run with `-r` option, `pcp atopsar` interprets `-H` > correctly - it starts adding header lines: > > # pcp atopsar -r /var/log/pcp/pmlogger/fastvm-rhel-8-1-189/ -H But that's different again - now you're not using the '3' (interval) anymore. I think there may be no bug here after all - can you check the above and confirm? Thanks. Sorry for confusion with interval. Still, the `-H` header changes behavior:
########################################################################################################
Initial command (no `-H`).
Output starts with first available PCP archive - from 2020/07/20. Header is shown only once
# pcp atopsar
fastvm-rhel-8-1-189 4.18.0-193.6.3.el8_2.x86_64 #1 SMP Mon Jun 1 20:24:55 UTC 2020 x86_64 2020/07/21
-------------------------- analysis date: 2020/07/20 --------------------------
00:10:32 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_
00:10:52 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_
00:10:52 all 29 29 29 29 29 29 0 29 -2
0 13 13 13 13 13 13 0 13 6
1 13 13 13 13 13 13 0 13 6
00:11:02 all 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
00:11:12 all 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
00:11:22 all 0 0 0 0 0 0 0 0 0
########################################################################################################
Command with `-H`.
Output starts from the current time, header is repeated
# -------------------------- analysis date: 2020/07/21 --------------------------
10:13:06 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_
10:13:16 all 0 0 0 0 0 0 0 0 200
0 0 0 0 0 0 0 0 0 100
1 0 0 0 0 0 0 0 0 100
10:13:26 all 0 0 0 0 0 0 0 0 199
0 0 0 0 0 0 0 0 0 100
1 0 0 0 0 0 0 0 0 99
10:13:36 all 0 0 0 0 0 0 0 0 200
0 0 0 0 0 0 0 0 0 100
1 0 0 0 0 0 0 0 0 100
10:13:46 all 0 0 0 0 0 0 0 0 200
0 0 0 0 0 0 0 0 0 100
1 0 0 0 0 0 0 0 0 100
10:13:56 all 0 0 0 0 0 0 0 0 199
0 0 0 0 0 0 0 0 0 100
1 0 0 0 0 0 0 0 0 100
########################################################################################################
Command with `-H` and `-r`.
Output starts with first available PCP archive - from 2020/07/20. Header is repeated.
# pcp atopsar -r /var/log/pcp/pmlogger/$(hostname)/ -H
fastvm-rhel-8-1-189 4.18.0-193.6.3.el8_2.x86_64 #1 SMP Mon Jun 1 20:24:55 UTC 2020 x86_64 2020/07/21
-------------------------- analysis date: 2020/07/20 --------------------------
00:10:32 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_
00:10:52 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_
00:10:52 all 29 29 29 29 29 29 0 29 -2
0 13 13 13 13 13 13 0 13 6
1 13 13 13 13 13 13 0 13 6
00:11:02 all 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
00:11:12 all 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
00:11:22 all 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
00:11:32 all 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Hi Denis, Aha, I think I understand this - you're referring to the two headers reported immediately in succession sometimes, AIUI, from reading your above cases. This depends on the sample timestamp proximity to the start of the PCP archive, and has been resolved (yesterday!) as part of the changes relating to some unrelated issues (BZs #1806824, #1847925 and #1806927) - this will be in upstream pcp-5.2.0. The new code is in pcp git master branch now, will be in Fedora in a couple of weeks, and RHEL 8 in a few months. I've verified each of the cases you listed above and each behaves correctly now with the latest code. Hello, Nathan Sorry for a long delay in response. The original question is not about two headers. The question is about the start of the data: - in the first case (without `-H` option) output starts from the first pcp archive (2020/07/10 00:10:32) - in the second case (with `-H` option) output starts from the current time, the moment when the `pcp atopsar` was run (2020/07/15 08:35:04) Description of the `-H` option says that it should only add the header, not `add the headers and start collecting new data from the current time` I can reproduce the behavior Denis described in Comment #5 on pcp-5.2.0 build currently available in Fedora-32. Thanks for the reminder Jan - yes, I see it too and can see where the
problem is in the code now. Fix will be in pcp-5.2.1 in a few weeks.
nathans@shard:/source/git/pcp/src/pcp/atop$ ./pcp-atopsar -H | head
shard 5.8.4-200.fc32.x86_64 #1 SMP Wed Aug 26 22:28:08 UTC 2020 x86_64 2020/09/12
-------------------------- analysis date: 2020/09/08 --------------------------
14:55:25 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_
14:55:25 all 21 0 10 38 2 0 0 1 726
0 3 0 2 5 0 0 0 0 90
1 2 0 1 5 0 0 0 0 92
2 4 0 2 5 0 0 0 0 89
nathans@shard:/source/git/pcp/src/pcp/atop$ ./pcp-atopsar | head
shard 5.8.4-200.fc32.x86_64 #1 SMP Wed Aug 26 22:28:08 UTC 2020 x86_64 2020/09/12
-------------------------- analysis date: 2020/09/08 --------------------------
14:55:25 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_
14:55:25 all 21 0 10 38 2 0 0 1 726
0 3 0 2 5 0 0 0 0 90
1 2 0 1 5 0 0 0 0 92
2 4 0 2 5 0 0 0 0 89
This issue is fixed and regression tested upstream via:
commit 4f721ea5dba84d29fe360eced32b57eee9859555
Author: Nathan Scott <nathans>
Date: Mon Sep 14 15:16:31 2020 +1000
pcp-atopsar: fix a command line args handling issue
Resolves Red Hat BZ #1857121
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 (pcp 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/RHBA-2021:1754 |
Description of problem: `pcp atopsar` has `-H` option: -H repeat report headers (in case of tty: depending on screen lines) But it changes behaviour of pcp-atopsar instead of just adding the headers. Version-Release number of selected component (if applicable): pcp-5.0.2-5.el8.x86_64 Steps to Reproduce: 1. run `pcp atopsar`. The output is the data from the beginning of pmlogger: # pcp atopsar |head fastvm-rhel-8-1-189 4.18.0-193.6.3.el8_2.x86_64 #1 SMP Mon Jun 1 20:24:55 UTC 2020 x86_64 2020/07/15 -------------------------- analysis date: 2020/07/10 -------------------------- 00:10:22 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_ 00:10:42 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_ 00:10:42 all 5 0 4 0 0 0 0 0 190 0 3 0 2 0 0 0 0 0 94 2. run `pcp atopsar -H` (added -H flag). The output changes to output of current data: # pcp atopsar -H 3 fastvm-rhel-8-1-189 4.18.0-193.6.3.el8_2.x86_64 #1 SMP Mon Jun 1 20:24:55 UTC 2020 x86_64 2020/07/15 -------------------------- analysis date: 2020/07/15 -------------------------- 08:35:04 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_ 08:35:07 all 0 0 1 0 0 0 0 0 199 0 0 0 0 0 0 0 0 0 100 1 0 0 1 0 0 0 0 0 99 08:35:10 all 0 0 1 0 0 0 0 0 199 0 0 0 0 0 0 0 0 0 100 1 0 0 1 0 0 0 0 0 99 08:35:13 all 0 0 1 0 0 0 0 0 199 0 0 0 0 0 0 0 0 0 100 1 0 0 1 0 0 0 0 0 99 08:35:16 all 0 0 1 0 0 0 0 0 199 0 0 0 0 0 0 0 0 0 100 1 0 0 1 0 0 0 0 0 99 08:35:19 all 0 0 1 0 0 0 0 0 199 0 0 0 0 0 0 0 0 0 100 1 0 0 1 0 0 0 0 0 99 08:35:22 all 0 0 1 0 0 0 0 0 199 0 0 0 0 0 0 0 0 0 100 As shown, `pcp atopsar` interprets `-H 3` as `--interval 3` making it show the current data every 3 seconds --interval DELTA sampling interval Additional info: At the same time if run with `-r` option, `pcp atopsar` interprets `-H` correctly - it starts adding header lines: # pcp atopsar -r /var/log/pcp/pmlogger/fastvm-rhel-8-1-189/ -H fastvm-rhel-8-1-189 4.18.0-193.6.3.el8_2.x86_64 #1 SMP Mon Jun 1 20:24:55 UTC 2020 x86_64 2020/07/15 -------------------------- analysis date: 2020/07/10 -------------------------- 00:10:22 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_ 00:10:42 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_ 00:10:42 all 5 0 4 0 0 0 0 0 190 0 3 0 2 0 0 0 0 0 94 1 2 0 2 0 0 0 0 0 96 ... 00:13:22 cpu %usr %nice %sys %irq %softirq %steal %guest %wait %idle _cpu_ 00:13:22 all 0 0 0 0 0 0 0 0 200 0 0 0 0 0 0 0 0 0 100 1 0 0 0 0 0 0 0 0 100 00:13:32 all 0 0 0 0 0 0 0 0 200 0 0 0 0 0 0 0 0 0 100 1 0 0 0 0 0 0 0 0 100