update sysCall test program and disable MEASURE_SYS_CALLS in ioLib.c (#51)
Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/51 Co-authored-by: siddhant <siddhant.singh@neominds.in> Co-committed-by: siddhant <siddhant.singh@neominds.in>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "sysCallStat.h"
|
||||
#ifdef MEASURE_SYS_CALLS
|
||||
extern KRNL_API_STATS API_STATS[sysCallMax];
|
||||
/* "enc", "-pbkdf2 -aes-256-cbc -in plain.txt -out cipher.enc -kfile keyfile.key" */
|
||||
void clearSysTableData()
|
||||
@@ -51,16 +52,33 @@ void CaptureSysCallMetrics(const char* cmd, const char* arg)
|
||||
semDelete(sysCallSemID);
|
||||
}
|
||||
|
||||
|
||||
void displayStats()
|
||||
{
|
||||
printf("------------------------------------------------------------------\n");
|
||||
printf("%-15s %-15s %-15s %-20s\n","crypto cmd","system call","Invocations","Total time (USec)");
|
||||
printf("------------------------------------------------------------------\n");
|
||||
printf("%-15s %-15s %-15d %-20lu\n","enc","open",API_STATS[openCall].sysCallCount,((API_STATS[openCall].execTimeUsec)*1000000ULL)/tsFreq);
|
||||
printf("%-15s %-15s %-15d %-20lu\n","enc","close",API_STATS[closeCall].sysCallCount,((API_STATS[closeCall].execTimeUsec)*1000000ULL)/tsFreq);
|
||||
printf("%-15s %-15s %-15d %-20lu\n","enc","read",API_STATS[readCall].sysCallCount,((API_STATS[readCall].execTimeUsec)*1000000ULL)/tsFreq );
|
||||
printf("%-15s %-15s %-15d %-20lu\n","enc","write",API_STATS[writeCall].sysCallCount,((API_STATS[writeCall].execTimeUsec)*1000000ULL)/tsFreq);
|
||||
printf("-------------------------------------------------------------------\n");
|
||||
UINT64 openTimeUsec = 0;
|
||||
UINT64 closeTimeUsec = 0;
|
||||
UINT64 readTimeUsec = 0;
|
||||
UINT64 writeTimeUsec = 0;
|
||||
|
||||
if (tsFreq == 0)
|
||||
{
|
||||
printf("ERROR: tsFreq is zero\n");
|
||||
return;
|
||||
}
|
||||
openTimeUsec = (API_STATS[openCall].execTimeUsec * 1000000ULL) / (UINT64)tsFreq;
|
||||
closeTimeUsec = (API_STATS[closeCall].execTimeUsec * 1000000ULL) / (UINT64)tsFreq;
|
||||
readTimeUsec = (API_STATS[readCall].execTimeUsec * 1000000ULL) / (UINT64)tsFreq;
|
||||
writeTimeUsec = (API_STATS[writeCall].execTimeUsec * 1000000ULL) / (UINT64)tsFreq;
|
||||
|
||||
printf("------------------------------------------------------------------\n");
|
||||
printf("%-15s %-15s %-15s %-20s\n","crypto cmd","system call","Invocations","Total time (USec)");
|
||||
printf("------------------------------------------------------------------\n");
|
||||
printf("%-15s %-15s %-15u %-20llu\n","enc","open",API_STATS[openCall].sysCallCount,openTimeUsec);
|
||||
printf("%-15s %-15s %-15u %-20llu\n","enc","close",API_STATS[closeCall].sysCallCount,closeTimeUsec);
|
||||
printf("%-15s %-15s %-15u %-20llu\n","enc","read",API_STATS[readCall].sysCallCount,readTimeUsec);
|
||||
printf("%-15s %-15s %-15u %-20llu\n","enc","write",API_STATS[writeCall].sysCallCount,writeTimeUsec);
|
||||
printf("------------------------------------------------------------------\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user