Merge ~bhill/epics-base:camonitor-server-relative-ts-bug-3.14 into ~epics-core/epics-base/+git/epics-base:3.14

Proposed by Bruce Hill
Status: Merged
Approved by: Ralph Lange
Approved revision: 6cc623a7b40e255fa4b08918aec4d0a6a5fd4ca2
Merged at revision: b7d4609e57a2e904c2e83323ade146f84696d0a7
Proposed branch: ~bhill/epics-base:camonitor-server-relative-ts-bug-3.14
Merge into: ~epics-core/epics-base/+git/epics-base:3.14
Diff against target: 30 lines (+6/-6)
1 file modified
src/catools/tool_lib.c (+6/-6)
Reviewer Review Type Date Requested Status
Ralph Lange Approve
Review via email: mp+341104@code.launchpad.net

Description of the change

tsFirst needs to get initialized from the first server side
timestamp instead of the client side tsNow.

Discovered when I added a -P option to show SLAC pulseId which is in the
lower 17 bits of nsec on the server side but is just nsec on the client side.

Tested and working here at SLAC since Nov 2017.

To post a comment you must log in.
Revision history for this message
Ralph Lange (ralph-lange) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/catools/tool_lib.c b/src/catools/tool_lib.c
2index a29d7ef..ce7a049 100644
3--- a/src/catools/tool_lib.c
4+++ b/src/catools/tool_lib.c
5@@ -416,6 +416,12 @@ char *dbr2str (const void *value, unsigned type)
6 ptsNewS = &((struct TYPE *)value)->stamp; \
7 ptsNewC = &tsNow; \
8 \
9+ if (!tsInitS) \
10+ { \
11+ tsFirst = *ptsNewS; \
12+ tsInitS = 1; \
13+ } \
14+ \
15 switch (tsType) { \
16 case relative: \
17 ptsRefC = &tsStart; \
18@@ -508,12 +514,6 @@ void print_time_val_sts (pv* pv, unsigned long reqElems)
19 epicsTimeGetCurrent(&tsNow);
20 epicsTimeToStrftime(timeText, TIMETEXTLEN, timeFormatStr, &tsNow);
21
22- if (!tsInitS)
23- {
24- tsFirst = tsNow;
25- tsInitS = 1;
26- }
27-
28 if (pv->nElems <= 1 && fieldSeparator == ' ') printf("%-30s", pv->name);
29 else printf("%s", pv->name);
30 printf("%c", fieldSeparator);

Subscribers

People subscribed via source and target branches