summaryrefslogtreecommitdiffstats
path: root/pcp/PCPProcessList.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-10-05 13:20:13 +1100
committerNathan Scott <nathans@redhat.com>2021-10-05 15:53:18 +1100
commit8ac8542b6e710fde88aa444f8379a4ddfdfce6d3 (patch)
treefa86211c84bdede4d93866fe5c418ded41d3c44a /pcp/PCPProcessList.c
parentf75a8bc3a1131151181d6794000b10063400221e (diff)
Handle interrupted sampling from within libpcp PDU transfers
This situation can arise if pcp-htop screen is resized right at the same time sampling from pmcd(1) is happening. Have a couple more goes at it before giving up entirely; once there is no data available though we cannot proceed into accessing the sample result data structure (segv will result) so a new short-circuit guard is added there also.
Diffstat (limited to 'pcp/PCPProcessList.c')
-rw-r--r--pcp/PCPProcessList.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pcp/PCPProcessList.c b/pcp/PCPProcessList.c
index e324e337..554e43d4 100644
--- a/pcp/PCPProcessList.c
+++ b/pcp/PCPProcessList.c
@@ -680,7 +680,8 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
PCPMetric_enable(PCP_PROC_SMAPS_SWAPPSS, smaps_flag && enabled);
struct timeval timestamp;
- PCPMetric_fetch(&timestamp);
+ if (PCPMetric_fetch(&timestamp) != true)
+ return;
double sample = this->timestamp;
this->timestamp = pmtimevalToReal(&timestamp);

© 2014-2024 Faster IT GmbH | imprint | privacy policy