Skip to content

Commit

Permalink
Update for MQ 933 - see CHANGES.md for details
Browse files Browse the repository at this point in the history
  • Loading branch information
ibmmqmet committed Jun 15, 2023
1 parent a6b8af7 commit a199bbc
Show file tree
Hide file tree
Showing 21 changed files with 287 additions and 31 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

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

Feb 2023 (v5.4.2)
* Update for MQ V9.3.2
Expand Down
Binary file modified bin/aix/convH
Binary file not shown.
Binary file modified bin/aix/mqsmfcsv
Binary file not shown.
Binary file modified bin/linux/convH
Binary file not shown.
Binary file modified bin/linux/mqsmfcsv
Binary file not shown.
Binary file modified bin/win/mqsmfcsv.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/M
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plat=`uname`

if [ -z "$VERS" ]
then
VERS="932"
VERS="933"
fi

if [ "$plat" = "AIX" ]
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.gcc.win
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CC=i686-w64-mingw32-gcc
# CFLAGS= -I. -m32 -fpack-struct=8 -DPLATFORM_WINDOWS
CFLAGS= -I. -m32 -DPLATFORM_WINDOWS
PLATFLAGS=
VERS=932
VERS=933
SRC = mqsmf.c \
smfDDL.c \
smfDate.c \
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.win
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CFLAGS=-nologo /D_CRT_SECURE_NO_WARNINGS /Zp1 /J /O2 /DPLATFORM_WINDOWS
VERS=932
VERS=933
SRC = mqsmf.c \
smfDDL.c \
smfDate.c \
Expand Down
19 changes: 13 additions & 6 deletions src/mqsmf.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,19 @@ int main( int argc, char *argv[] )
case 'f':
for (i=0;i<strlen(mqoptarg);i++)
mqoptarg[i] = toupper(mqoptarg[i]);

if (strstr(mqoptarg,"NORDW"))
useRDW = FALSE;
else if (strstr(mqoptarg,"RDW"))
useRDW = TRUE;
if (strstr(mqoptarg,"JSON"))

if (strstr(mqoptarg,"JSON")) {
outputFormat = OF_JSON;
if (strstr(mqoptarg,"COMPACT"))
jsonCompact = TRUE;
else
jsonCompact = FALSE;
}
else if (strstr(mqoptarg,"SQL")) {
outputFormat = OF_SQL;
printHeaders = FALSE;
Expand Down Expand Up @@ -926,14 +933,14 @@ int main( int argc, char *argv[] )
switch(i)
{
case 1: printQCCT((qcct *)p);break;
case 2: printQCTDSP((qct_dsp *)p);break;
case 3: printQCTADP((qct_adp *)p);break;
case 4: printQCTSSL((qct_ssl *)p);break;
case 2: printQCTDSP((qct_dsp *)p,(uint32_t)j);break;
case 3: printQCTADP((qct_adp *)p,(uint32_t)j);break;
case 4: printQCTSSL((qct_ssl *)p,(uint32_t)j);break;
/* If nothing has been done with DNS in this interval, the
record seems to be present but contain garbage.
*/
case 5: if (triplet[i].l == sizeof(qct_dns))
printQCTDNS((qct_dns *)p);
printQCTDNS((qct_dns *)p,(uint32_t)j);
break;
default: break;
}
Expand Down Expand Up @@ -1483,7 +1490,7 @@ static void Usage(void)
{
fprintf(infoStream,"Usage: mqsmfcsv [-o <output dir>] [-a] [ -d <level> ]\n");
fprintf(infoStream," [-h yes|no] [ -i <input file> [-m <max records>]\n");
fprintf(infoStream," [-f RDW | NORDW | JSON | SQL | CSV ] \n");
fprintf(infoStream," [-f RDW | NORDW | JSON | JSON_COMPACT | SQL | CSV ] \n");
fprintf(infoStream," [-b Db2 | MySQL ] \n");
fprintf(infoStream," [-p <template DDL file prefix> ] \n");
fprintf(infoStream," [-e <template DDL file ending> ] \n");
Expand Down
18 changes: 13 additions & 5 deletions src/mqsmf.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ extern void printDEBUG (char *title, void *,int);
extern void printQ5ST (q5st *);
extern void printQCCT (qcct *);
extern void printQCST (qcst *);
extern void printQCTADP(qct_adp *);
extern void printQCTDNS(qct_dns *);
extern void printQCTDSP(qct_dsp *);
extern void printQCTSSL(qct_ssl *);
extern void printQCTADP(qct_adp *,uint32_t);
extern void printQCTDNS(qct_dns *,uint32_t);
extern void printQCTDSP(qct_dsp *,uint32_t);
extern void printQCTSSL(qct_ssl *,uint32_t);
extern void printQESD (qesd *);
extern void printQEST (qest *);
#ifdef QIS1IDV
Expand Down Expand Up @@ -384,9 +384,15 @@ extern void checkStructureSizes(FILE *);
ADDHEAD(h,DDL_I,0); \
ADDDATA(ODT_I,"%u,",conv32(v))

/* Add a number that does not need to be byte-swapped */
#define ADDU32NC(h,v) \
ADDHEAD(h,DDL_I,0); \
ADDDATA(ODT_I,"%u,",v)

/* Print this as decimal, not hex */
#define ADDX32(h,v) \
ADDHEAD(h,DDL_I,0); \
ADDDATA(ODT_I,"%X,",conv32(v))
ADDDATA(ODT_I,"%u,",conv32(v))

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

extern BOOL jsonCompact;

enum outputFormat_e { OF_CSV=0, OF_SQL=1, OF_JSON=2 };
extern enum outputFormat_e outputFormat;

Expand Down
59 changes: 58 additions & 1 deletion src/mqsmfstrucU.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file was generated from cqsdsmfc.h version 932
* This file was generated from cqsdsmfc.h version 933
* by the convH program (convH64.c) in the src directory
* Do not try to edit this header manually.
*
Expand Down Expand Up @@ -650,6 +650,63 @@ uint32_t qqstqtst;
uint32_t qqstqtlt;
uint64_t qqstlput;
uint64_t qqstlget;
uint32_t qqstdphi;
uint32_t qqstdplo;
uint64_t qqstputs;
uint64_t qqstput1;
uint64_t qqstnppt;
uint64_t qqstppt;
uint64_t qqstnpp1;
uint64_t qqstpp1;
uint64_t qqstputb;
uint64_t qqstpt1b;
uint64_t qqstnppb;
uint64_t qqstppb;
uint64_t qqstnp1b;
uint64_t qqstp1b;
uint64_t qqstflpt;
uint64_t qqstflp1;
uint64_t qqstfptc;
uint64_t qqstfptb;
uint64_t qqststrm;
uint64_t qqstmsmi;
uint64_t qqstmsma;
uint64_t qqstmsav;
uint64_t qqstgets;
uint64_t qqstnpdg;
uint64_t qqstpdg;
uint64_t qqstgetb;
uint64_t qqstnpdb;
uint64_t qqstpdb;
uint64_t qqstbrws;
uint64_t qqstnpbr;
uint64_t qqstpbr;
uint64_t qqstbrwb;
uint64_t qqstnpbb;
uint64_t qqstpbb;
uint64_t qqstflgt;
uint64_t qqstnmag;
uint64_t qqsttmfg;
uint64_t qqstflbr;
uint64_t qqstnmab;
uint64_t qqsttmfb;
uint64_t qqstflgw;
uint64_t qqstrdgw;
uint64_t qqstflbw;
uint64_t qqstrdbw;
uint64_t qqstsagt;
uint64_t qqstsabr;
uint32_t qqstiphi;
uint32_t qqstiplo;
uint32_t qqstophi;
uint32_t qqstoplo;
uint64_t qqstopen;
uint64_t qqstclos;
uint64_t qqstinqr;
uint64_t qqstset;
uint64_t qqstexpr;
uint64_t qqstrbpt;
uint64_t qqstrbgt;
} qqst;
#define QQSTIDV 0xD80F
#define QQSTEYEV "QQST"
Expand Down
59 changes: 58 additions & 1 deletion src/mqsmfstrucW.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file was generated from cqsdsmfc.h version 932
* This file was generated from cqsdsmfc.h version 933
* by the convH program (convH64.c) in the src directory
* Do not try to edit this header manually.
*
Expand Down Expand Up @@ -650,6 +650,63 @@ uint32_t qqstqtst;
uint32_t qqstqtlt;
uint64_t qqstlput;
uint64_t qqstlget;
uint32_t qqstdphi;
uint32_t qqstdplo;
uint64_t qqstputs;
uint64_t qqstput1;
uint64_t qqstnppt;
uint64_t qqstppt;
uint64_t qqstnpp1;
uint64_t qqstpp1;
uint64_t qqstputb;
uint64_t qqstpt1b;
uint64_t qqstnppb;
uint64_t qqstppb;
uint64_t qqstnp1b;
uint64_t qqstp1b;
uint64_t qqstflpt;
uint64_t qqstflp1;
uint64_t qqstfptc;
uint64_t qqstfptb;
uint64_t qqststrm;
uint64_t qqstmsmi;
uint64_t qqstmsma;
uint64_t qqstmsav;
uint64_t qqstgets;
uint64_t qqstnpdg;
uint64_t qqstpdg;
uint64_t qqstgetb;
uint64_t qqstnpdb;
uint64_t qqstpdb;
uint64_t qqstbrws;
uint64_t qqstnpbr;
uint64_t qqstpbr;
uint64_t qqstbrwb;
uint64_t qqstnpbb;
uint64_t qqstpbb;
uint64_t qqstflgt;
uint64_t qqstnmag;
uint64_t qqsttmfg;
uint64_t qqstflbr;
uint64_t qqstnmab;
uint64_t qqsttmfb;
uint64_t qqstflgw;
uint64_t qqstrdgw;
uint64_t qqstflbw;
uint64_t qqstrdbw;
uint64_t qqstsagt;
uint64_t qqstsabr;
uint32_t qqstiphi;
uint32_t qqstiplo;
uint32_t qqstophi;
uint32_t qqstoplo;
uint64_t qqstopen;
uint64_t qqstclos;
uint64_t qqstinqr;
uint64_t qqstset;
uint64_t qqstexpr;
uint64_t qqstrbpt;
uint64_t qqstrbgt;
} qqst;
#define QQSTIDV 0xD80F
#define QQSTEYEV "QQST"
Expand Down
40 changes: 40 additions & 0 deletions src/sizes.master.933
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
q5st : 672
qcct : 48
qct_dsp : 36
qct_adp : 32
qct_ssl : 48
qct_dns : 48
qcst : 324
qest : 4104
qesd : 336
qist : 80
qis1 : 104
qjst : 596
qlst : 32
qmac : 48
qmst : 104
qpst : 104
qqst : 552
qsgm : 48
qsph : 88
qsrs : 232
qsst : 72
qtst : 96
qwac : 176
qwhc : 92
qwhs : 52
wtas : 2344
wtid : 208
qwst : 28
qws0 : 96
qws1 : 72
qws5 : 16
qws8 : 16
qws9 : 16
qwsx : 48
qwas : 28
qwa0 : 56
wq : 2800
wq->maxqdpth: 588
wq->z__001 : 594
qqst->qqstdpth : 80
13 changes: 11 additions & 2 deletions src/smfJson.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ char *jsonPtr = NULL; /* Where to add next line to EventBuf */
char *jsonOutputStart = NULL;
size_t jsonOutputSize;

BOOL jsonCompact = FALSE;

static char *jsonEscape(char *s, size_t l);
static char *removeSuffix(char *s);
static int removeIndex(char *s);
Expand Down Expand Up @@ -92,8 +94,9 @@ columnHeader_t *jsonFormatHeader(BOOL idx, char *name)
/* And remove any trailing _ */
for (o = nameNoDup + strlen(nameNoDup) -1;
(o >= nameNoDup) && ((*o == '_') || (*o == ' '));
o--)
o--) {
*o = 0;
}


if (idx)
Expand Down Expand Up @@ -140,7 +143,6 @@ columnHeader_t *jsonFormatHeader(BOOL idx, char *name)
return ch;
}


static void jsonAddLine(columnHeader_t *h ,int type, const char *fmt,...)
{
size_t offset;
Expand Down Expand Up @@ -332,6 +334,13 @@ void jsonDump(FILE *fp, columnHeader_t **columnHeaders)

jsonAddLine(NULL,ODT_VAR,"}");
if (jsonOutputStart) {
if (jsonCompact) {
char *p;
for (p =jsonOutputStart;p<jsonPtr-1;p++) {
if (*p == '\n')
*p=' ';
}
}
fwrite(jsonOutputStart,1,jsonPtr-jsonOutputStart,fp);
fflush(fp);
}
Expand Down
5 changes: 3 additions & 2 deletions src/t115/printQCTADP.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 IBM Corporation and other Contributors.
* Copyright (c) 2016,2023 IBM Corporation and other Contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -16,11 +16,12 @@

SMFPRINTGLOB;

void printQCTADP(qct_adp *p)
void printQCTADP(qct_adp *p,uint32_t idx)
{
SMFPRINTSTART("QCTADP", p, sizeof(qct_adp));

ADDU32 ("Task_Number" ,p->qcttskn);
ADDU32NC("Task_Index" ,idx);
ADDU32 ("Request_Count" ,p->qctreqn);
ADDSTCK("Task_CPU_Time" ,p->qctcptm);
ADDSTCK("Task_Elapsed_Time",p->qcteltm);
Expand Down
5 changes: 3 additions & 2 deletions src/t115/printQCTDNS.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 IBM Corporation and other Contributors.
* Copyright (c) 2016,2023 IBM Corporation and other Contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -15,11 +15,12 @@

SMFPRINTGLOB;

void printQCTDNS(qct_dns *p)
void printQCTDNS(qct_dns *p, uint32_t idx)
{
SMFPRINTSTART("QCTDNS", p, sizeof(qct_dns));

ADDU32 ("Task_Number" ,p->qcttskn);
ADDU32NC("Task_Index" ,idx);
ADDU32 ("Request_Count" ,p->qctreqn);
ADDSTCK("Task_CPU_Time" ,p->qctcptm);
ADDSTCK("Task_Elapsed_Time",p->qcteltm);
Expand Down
Loading

0 comments on commit a199bbc

Please sign in to comment.