Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qa/1321
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ done

# When new dynamic metrics are detected, the _next_ fetch will fetch them.
# So wait for a bit so pmlogger has a chance to fetch the new metrics.
sleep 2
sleep 3

# now kill pmlogger and check the new metrics appeared dynamically
$sudo $PCP_BINADM_DIR/pmsignal -s TERM $pmlogger_pid >/dev/null 2>&1
Expand Down
8 changes: 4 additions & 4 deletions src/libpcp_pmda/src/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,18 +476,18 @@ pmdaInstance(pmInDom indom, int inst, char *name, pmInResult **result, pmdaExt *
* The first byte of the (unused) timestamp field has been
* co-opted as a flags byte - now indicating state changes
* that have happened within a PMDA and that need to later
* be propogated through to any connected clients.
* be propagated through to any connected clients.
*/

static void
__pmdaEncodeStatus(pmdaResult *result, unsigned char byte)
{
unsigned char *flags;
uint64_t *flags;

memset(&result->timestamp, 0, sizeof(result->timestamp));
if (byte) {
flags = (unsigned char *)&result->timestamp;
*flags |= byte;
flags = (uint64_t *)&result->timestamp;
*flags = byte;
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/pmcd/src/dofetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,11 @@ SendFetch(DomPmidList *dpList, AgentInfo *aPtr, ClientInfo *cPtr, int ctxnum)
static int
ExtractState(int i, void *timestamp)
{
unsigned char byte;
uint64_t full_value;

memcpy(&full_value, timestamp, sizeof(uint64_t));
unsigned char byte = (unsigned char)full_value;

memcpy(&byte, timestamp, sizeof(unsigned char));
/*
* integrity checks on the state change ...
* - only 7 bits defined in pmapi.h (so max value is 0x3f)
Expand Down
Loading