Skip to content

Commit 743a823

Browse files
committed
Deal with undocumented difference in qwhsdurn field for subtype 231
1 parent c57b88c commit 743a823

File tree

6 files changed

+11
-3
lines changed

6 files changed

+11
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ July 2016
5151

5252
August 2016
5353
* Add correlator field to better link WQ/WTID/WTAS
54-
* Add user-written content in docs directory. How to use SQL.
54+
* Add user-written content in docs directory. How to use SQL.
5555

5656
October 2016
5757
* Support reading from large (>2GB) files
58+
* SMF 115 subtype 231 (CHIN) records do not use same scale for qwhsdurn
59+
(though this seems to be undocumented)
5860

5961

6062
Pull requests

bin/aix/mqsmfcsv

4.1 KB
Binary file not shown.

bin/linux/mqsmfcsv

32 Bytes
Binary file not shown.

bin/win/mqsmfcsv.exe

4 KB
Binary file not shown.

src/mqsmf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ char headings[HEADINGS_LEN]; /* Ensure these are big enough for any line*/
108108
char dataline[DATA_LEN];
109109
char tmpHead[64]; /* Working space for a column heading*/
110110
unsigned int recordType;
111+
unsigned short recordSubType;
111112

112113
/********************************************************************/
113114
/* Variables scoped to this module */
@@ -153,7 +154,6 @@ int main( int argc, char *argv[] )
153154
unsigned int maxRecords = 0xFFFFFFFF;
154155
unsigned int unknownCount = 0;
155156
unsigned int ignoredCount = 0;
156-
unsigned short recordSubType;
157157
unsigned short nextLength;
158158
int subTypesValid = 0;
159159
int qTriplet;

src/mqsmf.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,14 @@ extern char *strCfStatType (int v);
362362
ADDSTRN("QMgr",commonF.qMgr,4,4); \
363363
ADDSTRN("MQ_Version",commonF.mqVer,3,3) \
364364
if (recordType == 115 && commonF.intstart != 0) { \
365+
unsigned long long du = conv64(commonF.intduration)/1000000L; \
365366
ADDTIME("Interval_Start",commonF.intstart) \
366367
ADDHEAD("Interval_Duration",DDL_I,0); \
367-
ADDDATA("%llu,",conv64(commonF.intduration)/1000000L) \
368+
if (recordSubType == 231) { \
369+
ADDDATA("%llu,",du/4096L); \
370+
} else { \
371+
ADDDATA("%llu,",du); \
372+
} \
368373
}
369374

370375
#define SMFPRINTSTART(n,p,l) \
@@ -424,6 +429,7 @@ extern BOOL addEquals;
424429
extern BOOL printHeaders;
425430
extern BOOL sqlMode;
426431
extern unsigned int recordType;
432+
extern unsigned short recordSubType;
427433
extern commonFields_t commonF;
428434

429435
#endif

0 commit comments

Comments
 (0)