void printQJST(qjst *p) { int i,j; char index[32]; SMFPRINTSTART("QJST", p, conv16(p->qjstll)); ADDS32("WRT_Request_Wait" ,p->qjstwrw ); ADDS32("WRT_Request_NoWait" ,p->qjstwrnw); ADDS32("WRT_Request_Force" ,p->qjstwrf ); ADDS32("Unavailable_Buffer_Count",p->qjstwtb ); ADDS32("Log_Read_Output_Buffer",p->qjstrbuf); ADDS32("Log_Read_Active_Log" ,p->qjstract); ADDS32("Log_Read_Archive_Log" ,p->qjstrarh); ADDS32("Tape_Contention_Delays",p->qjsttvc ); ADDS32("BSDS_Access " ,p->qjstbsds); ADDS32("Active_Log_CI" ,p->qjstbffl); ADDS32("Buffer_Writes" ,p->qjstbfwr); ADDS32("Archive_Read" ,p->qjstalr ); ADDS32("Archive_Write" ,p->qjstalw ); ADDS32("CI_Offloads" ,p->qjstciof); ADDS32("Checkpoints" ,p->qjstllcp); ADDS32("Read_Delayed" ,p->qjstwur ); ADDS32("Lookahead_Mount_Attempts",p->qjstlama); ADDS32("Lookahead_Mount_Succeed",p->qjstlams); ADDS32("Log_Request_Suspends" ,p->qjstlsus); ADDS32("Log_Writes" ,p->qjstlogw); ADDS32("Log_CI" ,p->qjstciwr); ADDS32("Log_CI_Serial" ,p->qjstserw); ADDS32("Log_Write_Threshold" ,p->qjstthrw); ADDS32("Log_Write_Buffer_Paged",p->qjstbpag); if (conv16(p->qjstll)>=offsetof(qjst,qjstio)) { /* Array of 1 entry! Reserved space follows for 2 more, but they */ /* are not currently used. If the others are ever used, change the */ /* macro to use ADDSxxIDX */ for (i=0;i<1;i++) { if (first) sprintf(index,"%d",i+1); ADDS32("Comp_Requests" , p->qjstcompr[i].qjstcmpreq); ADDS32("Comp_Fail" , p->qjstcompr[i].qjstcmpfail); ADDS64("Comp_Uncompressed_Bytes" , p->qjstcompr[i].qjstcmpuncmp); ADDS64("Comp_Compressed_Bytes" , p->qjstcompr[i].qjstcmpcomp); ADDS32("Decomp_Requests" , p->qjstcompr[i].qjstdecreq); ADDS32("Decomp_Fail" , p->qjstcompr[i].qjstdecfail); ADDS64("Decomp_Uncompressed_Bytes", p->qjstcompr[i].qjstdecuncmp); ADDS64("Decomp_Compressed_Bytes" , p->qjstcompr[i].qjstdeccomp); } } if (conv16(p->qjstll)>=offsetof(qjst,qjstio[0])) { for (i=0;i<2;i++) { for (j=0;j<2;j++) { if (first) sprintf(index,"%d.%d",i+1,j+1); ADDU32IDX("IO_Count" , index , p->qjstio[i].qjstiotype[j].qjstiocount); ADDU32IDX("IO_CI" , index , p->qjstio[i].qjstiotype[j].qjstioci); ADDSTCKIDX("IO_Total_Time", index , p->qjstio[i].qjstiotype[j].qjstiototio); ADDSTCKIDX("IO_Total_Suspend_Time", index , p->qjstio[i].qjstiotype[j].qjstiototsus); ADDSTCKIDX("IO_Max_Duration" , index , p->qjstio[i].qjstiotype[j].qjstiomaxio); ADDTIMEIDX("IO_Max_Time" , index ,p->qjstio[i].qjstiotype[j].qjstiomaxioT); ADDSTRENIDX("IO_Max_Log_ID" , index , p->qjstio[i].qjstiotype[j].qjstiomaxiol,8); ADDSTCKIDX("IO_Max_Suspend_Dur" , index, p->qjstio[i].qjstiotype[j].qjstiomaxsus); ADDTIMEIDX("IO_Max_Suspend_Time" , index, p->qjstio[i].qjstiotype[j].qjstiomaxsusT); ADDSTRENIDX("IO_Max_Suspend_Log_ID" , index, p->qjstio[i].qjstiotype[j].qjstiomaxsusl,8); } } ADDTIME("Writer_Idle_Time" , p->qjstslptu); ADDU64 ("IO_Time_Sum_Squares_1", p->qjstiosqu[0]); ADDU64 ("IO_Time_Sum_Squares_2", p->qjstiosqu[1]); } /* MQ 9.1.2 added support for zHyperwrite logging */ if (conv16(p->qjstll)>=offsetof(qjst,qjstcp1n)) { ADDS32("Copy1_New_Logs" , p->qjstcp1n); ADDS32("Copy2_New_Logs" , p->qjstcp2n); ADDS32("New_Logs_ZHW_Capable" , p->qjsthwc); ADDS32("New_Logs_ZHW_Enabled" , p->qjsthwe); } SMFPRINTSTOP; return; }
FILE *smfPrintStart(FILE *fp, char *name, void *p, size_t l, BOOL *f, BOOL *newFile,columnHeader_t **h) { FILE *fpNew = fp; BOOL first = *f; int i; offsetH=0; offsetD=0; columnCount=0; tableName = name; columnHeadersTmp = h; localFirst = first; /* Dump the entire record in hex */ if (debugLevel >=1 ) { printDEBUG(name,p,(l)); } if (first) { switch (outputFormat) { case OF_CSV: case OF_SQL: fpNew = fopencsv(name,newFile); if (outputFormat == OF_SQL) openDDL(name); if (!fpNew) { exit(1); } break; case OF_JSON: if (!fpNew) { fpNew = fopenext("MQSMF","json",newFile); if (!fpNew) { exit(1); } } break; } for(i=0;i<HEADINGS_COUNT;i++) { h[i] = 0; } } if (outputFormat == OF_JSON) jsonNew(fpNew,name); ADDSTR ("Date",commonF.recordDate,8); ADDSTR ("Time",commonF.recordTime,16); ADDSTRN("LPAR",commonF.systemId,4,4); ADDSTRN("QMgr",commonF.qMgr,4,4); ADDSTRN("MQ_Version",commonF.mqVer,3,3); if (recordType == 115 && commonF.intstart != 0) { char *dt[2]; unsigned long long du = conv64(commonF.intduration)/1000000L; ADDTIME("Interval_Start",commonF.intstart); ADDHEAD("Interval_Duration",DDL_I,0); /* Not documented, but this subtype uses a different scale for */ /* measuring the duration. */ if (recordSubType == 231) { ADDDATA(ODT_I64,"%llu,",du/4096L); } else { ADDDATA(ODT_I64,"%llu,",du); } } *f = first; return fpNew; }
/* * Read results arrays for 'children' children from Logfile * and accumulate them in "Ops". * Complain about any problems we see with the log file. */ static void collect_counters( int children) { int i; int j; struct stat statb; sfs_results_report_type report; /* final results log */ int Saveerrno; if (fstat(Log_fd, &statb) == -1) { Saveerrno = errno; (void) fprintf(stderr, "%s: can't stat log %s ", sfs_Myname, Logname); errno = Saveerrno; perror(Logname); (void) generic_kill(0, SIGINT); exit(79); } if (statb.st_size != (children * sizeof(report))) { (void) fprintf(stderr, "%s: log file %s has bad format\n", sfs_Myname, Logname); (void) generic_kill(0, SIGINT); exit(80); } if (lseek(Log_fd, 0L, 0) == -1) { Saveerrno = errno; (void) fprintf(stderr, "%s: can't lseek log %s ", sfs_Myname, Logname); errno = Saveerrno; perror("lseek"); (void) generic_kill(0, SIGINT); exit(81); } for (j = 0; j < NOPS + 1; j++) { Ops[j].results.good_calls = 0; Ops[j].results.bad_calls = 0; Ops[j].results.fast_calls = 0; Ops[j].results.time.sec = 0; Ops[j].results.time.usec = 0; Ops[j].results.msec2 = 0; } Total_fss_bytes = 0; Least_fss_bytes = 0; Most_fss_bytes = 0; Base_fss_bytes = 0; for (i = 0; i < children; i++) { if (read(Log_fd, (char *) &report, sizeof(report)) == -1) { Saveerrno = errno; (void) fprintf(stderr, "%s: can't read log %s", sfs_Myname, Logname); errno = Saveerrno; perror("Logname"); (void) generic_kill(0, SIGINT); exit(82); } for (j = 0; j < NOPS + 1; j++) { Ops[j].results.good_calls += report.results_buf[j].good_calls; Ops[j].results.bad_calls += report.results_buf[j].bad_calls; Ops[j].results.fast_calls += report.results_buf[j].fast_calls; ADDTIME(Ops[j].results.time, report.results_buf[j].time); Ops[j].results.msec2 += report.results_buf[j].msec2; } Total_fss_bytes += report.total_fss_bytes; Least_fss_bytes += report.least_fss_bytes; Most_fss_bytes += report.most_fss_bytes; Base_fss_bytes += report.base_fss_bytes; } } /* collect_counters */