Skip to content

Commit a199bbc

Browse files
committed
Update for MQ 933 - see CHANGES.md for details
1 parent a6b8af7 commit a199bbc

21 files changed

+287
-31
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
History (newest at top)
33
=======================
4+
Jun 2023 (v5.4.3)
5+
* Update for MQ V9.3.3
6+
* Many more QQST fields
7+
* New "-f jsoncompact" option for single-line JSON records
8+
* Add Task_Index field to channel structures, to easier tie up with MP1B output
9+
* Correct a couple of column names in WQ structure
410

511
Feb 2023 (v5.4.2)
612
* Update for MQ V9.3.2

bin/aix/convH

-11 Bytes
Binary file not shown.

bin/aix/mqsmfcsv

7.91 KB
Binary file not shown.

bin/linux/convH

48 Bytes
Binary file not shown.

bin/linux/mqsmfcsv

4.08 KB
Binary file not shown.

bin/win/mqsmfcsv.exe

5 KB
Binary file not shown.

src/M

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plat=`uname`
44

55
if [ -z "$VERS" ]
66
then
7-
VERS="932"
7+
VERS="933"
88
fi
99

1010
if [ "$plat" = "AIX" ]

src/Makefile.gcc.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CC=i686-w64-mingw32-gcc
33
# CFLAGS= -I. -m32 -fpack-struct=8 -DPLATFORM_WINDOWS
44
CFLAGS= -I. -m32 -DPLATFORM_WINDOWS
55
PLATFLAGS=
6-
VERS=932
6+
VERS=933
77
SRC = mqsmf.c \
88
smfDDL.c \
99
smfDate.c \

src/Makefile.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CFLAGS=-nologo /D_CRT_SECURE_NO_WARNINGS /Zp1 /J /O2 /DPLATFORM_WINDOWS
2-
VERS=932
2+
VERS=933
33
SRC = mqsmf.c \
44
smfDDL.c \
55
smfDate.c \

src/mqsmf.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,19 @@ int main( int argc, char *argv[] )
281281
case 'f':
282282
for (i=0;i<strlen(mqoptarg);i++)
283283
mqoptarg[i] = toupper(mqoptarg[i]);
284+
284285
if (strstr(mqoptarg,"NORDW"))
285286
useRDW = FALSE;
286287
else if (strstr(mqoptarg,"RDW"))
287288
useRDW = TRUE;
288-
if (strstr(mqoptarg,"JSON"))
289+
290+
if (strstr(mqoptarg,"JSON")) {
289291
outputFormat = OF_JSON;
292+
if (strstr(mqoptarg,"COMPACT"))
293+
jsonCompact = TRUE;
294+
else
295+
jsonCompact = FALSE;
296+
}
290297
else if (strstr(mqoptarg,"SQL")) {
291298
outputFormat = OF_SQL;
292299
printHeaders = FALSE;
@@ -926,14 +933,14 @@ int main( int argc, char *argv[] )
926933
switch(i)
927934
{
928935
case 1: printQCCT((qcct *)p);break;
929-
case 2: printQCTDSP((qct_dsp *)p);break;
930-
case 3: printQCTADP((qct_adp *)p);break;
931-
case 4: printQCTSSL((qct_ssl *)p);break;
936+
case 2: printQCTDSP((qct_dsp *)p,(uint32_t)j);break;
937+
case 3: printQCTADP((qct_adp *)p,(uint32_t)j);break;
938+
case 4: printQCTSSL((qct_ssl *)p,(uint32_t)j);break;
932939
/* If nothing has been done with DNS in this interval, the
933940
record seems to be present but contain garbage.
934941
*/
935942
case 5: if (triplet[i].l == sizeof(qct_dns))
936-
printQCTDNS((qct_dns *)p);
943+
printQCTDNS((qct_dns *)p,(uint32_t)j);
937944
break;
938945
default: break;
939946
}
@@ -1483,7 +1490,7 @@ static void Usage(void)
14831490
{
14841491
fprintf(infoStream,"Usage: mqsmfcsv [-o <output dir>] [-a] [ -d <level> ]\n");
14851492
fprintf(infoStream," [-h yes|no] [ -i <input file> [-m <max records>]\n");
1486-
fprintf(infoStream," [-f RDW | NORDW | JSON | SQL | CSV ] \n");
1493+
fprintf(infoStream," [-f RDW | NORDW | JSON | JSON_COMPACT | SQL | CSV ] \n");
14871494
fprintf(infoStream," [-b Db2 | MySQL ] \n");
14881495
fprintf(infoStream," [-p <template DDL file prefix> ] \n");
14891496
fprintf(infoStream," [-e <template DDL file ending> ] \n");

src/mqsmf.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ extern void printDEBUG (char *title, void *,int);
183183
extern void printQ5ST (q5st *);
184184
extern void printQCCT (qcct *);
185185
extern void printQCST (qcst *);
186-
extern void printQCTADP(qct_adp *);
187-
extern void printQCTDNS(qct_dns *);
188-
extern void printQCTDSP(qct_dsp *);
189-
extern void printQCTSSL(qct_ssl *);
186+
extern void printQCTADP(qct_adp *,uint32_t);
187+
extern void printQCTDNS(qct_dns *,uint32_t);
188+
extern void printQCTDSP(qct_dsp *,uint32_t);
189+
extern void printQCTSSL(qct_ssl *,uint32_t);
190190
extern void printQESD (qesd *);
191191
extern void printQEST (qest *);
192192
#ifdef QIS1IDV
@@ -384,9 +384,15 @@ extern void checkStructureSizes(FILE *);
384384
ADDHEAD(h,DDL_I,0); \
385385
ADDDATA(ODT_I,"%u,",conv32(v))
386386

387+
/* Add a number that does not need to be byte-swapped */
388+
#define ADDU32NC(h,v) \
389+
ADDHEAD(h,DDL_I,0); \
390+
ADDDATA(ODT_I,"%u,",v)
391+
392+
/* Print this as decimal, not hex */
387393
#define ADDX32(h,v) \
388394
ADDHEAD(h,DDL_I,0); \
389-
ADDDATA(ODT_I,"%X,",conv32(v))
395+
ADDDATA(ODT_I,"%u,",conv32(v))
390396

391397
#define ADDS32IDX(h,idx, v) \
392398
if (first) sprintf(tmpHead,"%s {%s}",h,idx); \
@@ -529,6 +535,8 @@ extern char *ddlTemplateOpen;
529535
extern char *ddlTemplateClose;
530536
extern char *ddlQuote;
531537

538+
extern BOOL jsonCompact;
539+
532540
enum outputFormat_e { OF_CSV=0, OF_SQL=1, OF_JSON=2 };
533541
extern enum outputFormat_e outputFormat;
534542

src/mqsmfstrucU.h

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* This file was generated from cqsdsmfc.h version 932
2+
* This file was generated from cqsdsmfc.h version 933
33
* by the convH program (convH64.c) in the src directory
44
* Do not try to edit this header manually.
55
*
@@ -650,6 +650,63 @@ uint32_t qqstqtst;
650650
uint32_t qqstqtlt;
651651
uint64_t qqstlput;
652652
uint64_t qqstlget;
653+
uint32_t qqstdphi;
654+
uint32_t qqstdplo;
655+
uint64_t qqstputs;
656+
uint64_t qqstput1;
657+
uint64_t qqstnppt;
658+
uint64_t qqstppt;
659+
uint64_t qqstnpp1;
660+
uint64_t qqstpp1;
661+
uint64_t qqstputb;
662+
uint64_t qqstpt1b;
663+
uint64_t qqstnppb;
664+
uint64_t qqstppb;
665+
uint64_t qqstnp1b;
666+
uint64_t qqstp1b;
667+
uint64_t qqstflpt;
668+
uint64_t qqstflp1;
669+
uint64_t qqstfptc;
670+
uint64_t qqstfptb;
671+
uint64_t qqststrm;
672+
uint64_t qqstmsmi;
673+
uint64_t qqstmsma;
674+
uint64_t qqstmsav;
675+
uint64_t qqstgets;
676+
uint64_t qqstnpdg;
677+
uint64_t qqstpdg;
678+
uint64_t qqstgetb;
679+
uint64_t qqstnpdb;
680+
uint64_t qqstpdb;
681+
uint64_t qqstbrws;
682+
uint64_t qqstnpbr;
683+
uint64_t qqstpbr;
684+
uint64_t qqstbrwb;
685+
uint64_t qqstnpbb;
686+
uint64_t qqstpbb;
687+
uint64_t qqstflgt;
688+
uint64_t qqstnmag;
689+
uint64_t qqsttmfg;
690+
uint64_t qqstflbr;
691+
uint64_t qqstnmab;
692+
uint64_t qqsttmfb;
693+
uint64_t qqstflgw;
694+
uint64_t qqstrdgw;
695+
uint64_t qqstflbw;
696+
uint64_t qqstrdbw;
697+
uint64_t qqstsagt;
698+
uint64_t qqstsabr;
699+
uint32_t qqstiphi;
700+
uint32_t qqstiplo;
701+
uint32_t qqstophi;
702+
uint32_t qqstoplo;
703+
uint64_t qqstopen;
704+
uint64_t qqstclos;
705+
uint64_t qqstinqr;
706+
uint64_t qqstset;
707+
uint64_t qqstexpr;
708+
uint64_t qqstrbpt;
709+
uint64_t qqstrbgt;
653710
} qqst;
654711
#define QQSTIDV 0xD80F
655712
#define QQSTEYEV "QQST"

src/mqsmfstrucW.h

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* This file was generated from cqsdsmfc.h version 932
2+
* This file was generated from cqsdsmfc.h version 933
33
* by the convH program (convH64.c) in the src directory
44
* Do not try to edit this header manually.
55
*
@@ -650,6 +650,63 @@ uint32_t qqstqtst;
650650
uint32_t qqstqtlt;
651651
uint64_t qqstlput;
652652
uint64_t qqstlget;
653+
uint32_t qqstdphi;
654+
uint32_t qqstdplo;
655+
uint64_t qqstputs;
656+
uint64_t qqstput1;
657+
uint64_t qqstnppt;
658+
uint64_t qqstppt;
659+
uint64_t qqstnpp1;
660+
uint64_t qqstpp1;
661+
uint64_t qqstputb;
662+
uint64_t qqstpt1b;
663+
uint64_t qqstnppb;
664+
uint64_t qqstppb;
665+
uint64_t qqstnp1b;
666+
uint64_t qqstp1b;
667+
uint64_t qqstflpt;
668+
uint64_t qqstflp1;
669+
uint64_t qqstfptc;
670+
uint64_t qqstfptb;
671+
uint64_t qqststrm;
672+
uint64_t qqstmsmi;
673+
uint64_t qqstmsma;
674+
uint64_t qqstmsav;
675+
uint64_t qqstgets;
676+
uint64_t qqstnpdg;
677+
uint64_t qqstpdg;
678+
uint64_t qqstgetb;
679+
uint64_t qqstnpdb;
680+
uint64_t qqstpdb;
681+
uint64_t qqstbrws;
682+
uint64_t qqstnpbr;
683+
uint64_t qqstpbr;
684+
uint64_t qqstbrwb;
685+
uint64_t qqstnpbb;
686+
uint64_t qqstpbb;
687+
uint64_t qqstflgt;
688+
uint64_t qqstnmag;
689+
uint64_t qqsttmfg;
690+
uint64_t qqstflbr;
691+
uint64_t qqstnmab;
692+
uint64_t qqsttmfb;
693+
uint64_t qqstflgw;
694+
uint64_t qqstrdgw;
695+
uint64_t qqstflbw;
696+
uint64_t qqstrdbw;
697+
uint64_t qqstsagt;
698+
uint64_t qqstsabr;
699+
uint32_t qqstiphi;
700+
uint32_t qqstiplo;
701+
uint32_t qqstophi;
702+
uint32_t qqstoplo;
703+
uint64_t qqstopen;
704+
uint64_t qqstclos;
705+
uint64_t qqstinqr;
706+
uint64_t qqstset;
707+
uint64_t qqstexpr;
708+
uint64_t qqstrbpt;
709+
uint64_t qqstrbgt;
653710
} qqst;
654711
#define QQSTIDV 0xD80F
655712
#define QQSTEYEV "QQST"

src/sizes.master.933

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
q5st : 672
2+
qcct : 48
3+
qct_dsp : 36
4+
qct_adp : 32
5+
qct_ssl : 48
6+
qct_dns : 48
7+
qcst : 324
8+
qest : 4104
9+
qesd : 336
10+
qist : 80
11+
qis1 : 104
12+
qjst : 596
13+
qlst : 32
14+
qmac : 48
15+
qmst : 104
16+
qpst : 104
17+
qqst : 552
18+
qsgm : 48
19+
qsph : 88
20+
qsrs : 232
21+
qsst : 72
22+
qtst : 96
23+
qwac : 176
24+
qwhc : 92
25+
qwhs : 52
26+
wtas : 2344
27+
wtid : 208
28+
qwst : 28
29+
qws0 : 96
30+
qws1 : 72
31+
qws5 : 16
32+
qws8 : 16
33+
qws9 : 16
34+
qwsx : 48
35+
qwas : 28
36+
qwa0 : 56
37+
wq : 2800
38+
wq->maxqdpth: 588
39+
wq->z__001 : 594
40+
qqst->qqstdpth : 80

src/smfJson.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ char *jsonPtr = NULL; /* Where to add next line to EventBuf */
2222
char *jsonOutputStart = NULL;
2323
size_t jsonOutputSize;
2424

25+
BOOL jsonCompact = FALSE;
26+
2527
static char *jsonEscape(char *s, size_t l);
2628
static char *removeSuffix(char *s);
2729
static int removeIndex(char *s);
@@ -92,8 +94,9 @@ columnHeader_t *jsonFormatHeader(BOOL idx, char *name)
9294
/* And remove any trailing _ */
9395
for (o = nameNoDup + strlen(nameNoDup) -1;
9496
(o >= nameNoDup) && ((*o == '_') || (*o == ' '));
95-
o--)
97+
o--) {
9698
*o = 0;
99+
}
97100

98101

99102
if (idx)
@@ -140,7 +143,6 @@ columnHeader_t *jsonFormatHeader(BOOL idx, char *name)
140143
return ch;
141144
}
142145

143-
144146
static void jsonAddLine(columnHeader_t *h ,int type, const char *fmt,...)
145147
{
146148
size_t offset;
@@ -332,6 +334,13 @@ void jsonDump(FILE *fp, columnHeader_t **columnHeaders)
332334

333335
jsonAddLine(NULL,ODT_VAR,"}");
334336
if (jsonOutputStart) {
337+
if (jsonCompact) {
338+
char *p;
339+
for (p =jsonOutputStart;p<jsonPtr-1;p++) {
340+
if (*p == '\n')
341+
*p=' ';
342+
}
343+
}
335344
fwrite(jsonOutputStart,1,jsonPtr-jsonOutputStart,fp);
336345
fflush(fp);
337346
}

src/t115/printQCTADP.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016 IBM Corporation and other Contributors.
2+
* Copyright (c) 2016,2023 IBM Corporation and other Contributors.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -16,11 +16,12 @@
1616

1717
SMFPRINTGLOB;
1818

19-
void printQCTADP(qct_adp *p)
19+
void printQCTADP(qct_adp *p,uint32_t idx)
2020
{
2121
SMFPRINTSTART("QCTADP", p, sizeof(qct_adp));
2222

2323
ADDU32 ("Task_Number" ,p->qcttskn);
24+
ADDU32NC("Task_Index" ,idx);
2425
ADDU32 ("Request_Count" ,p->qctreqn);
2526
ADDSTCK("Task_CPU_Time" ,p->qctcptm);
2627
ADDSTCK("Task_Elapsed_Time",p->qcteltm);

src/t115/printQCTDNS.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016 IBM Corporation and other Contributors.
2+
* Copyright (c) 2016,2023 IBM Corporation and other Contributors.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -15,11 +15,12 @@
1515

1616
SMFPRINTGLOB;
1717

18-
void printQCTDNS(qct_dns *p)
18+
void printQCTDNS(qct_dns *p, uint32_t idx)
1919
{
2020
SMFPRINTSTART("QCTDNS", p, sizeof(qct_dns));
2121

2222
ADDU32 ("Task_Number" ,p->qcttskn);
23+
ADDU32NC("Task_Index" ,idx);
2324
ADDU32 ("Request_Count" ,p->qctreqn);
2425
ADDSTCK("Task_CPU_Time" ,p->qctcptm);
2526
ADDSTCK("Task_Elapsed_Time",p->qcteltm);

0 commit comments

Comments
 (0)