aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lu <Patrick.Lu@intel.com>2018-10-16 21:57:39 -0700
committerPatrick Lu <Patrick.Lu@intel.com>2018-10-16 22:14:59 -0700
commit83631dfa4dcd54c951723f136485ac9b986b000d (patch)
tree4f73072eb4d2e6ca3b85d90e388f375e58a16dde
parent293b72d442d1e12a9ad8bff5fed89ddbfe1481f0 (diff)
jitter: added parser friendly output optionHEADmaster
Introduce '-f' flag for csv output, so it's easier to parse. Change-Id: I278a9fa919f04530f6288bbf3cfc41d4d733e76b Signed-off-by: Shemer, Karen <karen.shemer@intel.com> Signed-off-by: Patrick Lu <patrick.lu@intel.com>
-rw-r--r--jitter/jitter.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/jitter/jitter.c b/jitter/jitter.c
index 24bc3bd..77c2620 100644
--- a/jitter/jitter.c
+++ b/jitter/jitter.c
@@ -67,6 +67,7 @@ unsigned int displayUpdate = 20000;
unsigned int jitter_threshold = 15000;
#endif
unsigned int iterations = 200;
+int parseable = 0;
char *title = " Inst_Min Inst_Max Inst_jitter last_Exec Abs_min Abs_max tmp Interval Sample No\n";
@@ -143,6 +144,7 @@ void showhelp()
printf(" -t : jitter threshold for perf trigger. Default is > %d cycles\n", jitter_threshold);
#endif
printf(" -i : Sample counts after which program terminates. Default count is %u\n", iterations);
+ printf(" -f : Parser friendly output\n");
printf("For resetting statistics use: pkill -USR1 jitter\n");
printf("For elevating the priority of this program try: chrt -r -p 99 processId\n");
@@ -181,7 +183,7 @@ int main(int argc, char* argv[])
printf("Linux Jitter testing program version 1.9\n");
- while ((userinput = getopt(argc, argv, "c:l:r:hp:t:i:")) != EOF)
+ while ((userinput = getopt(argc, argv, "c:l:r:hp:t:i:f")) != EOF)
{
switch(userinput)
{
@@ -215,6 +217,11 @@ int main(int argc, char* argv[])
printf("jitter program did not compile with -DPROCESSOR_TRACE, cannot use Linux perf with Intel Processor Trace to record jitter source\n");
#endif
break;
+ case 'f' :
+ title="Inst_Min,Inst_Max,Inst_jitter,last_Exec,Abs_min,Abs_max,tmp,Interval,Sample No\n";
+ parseable=1;
+ break;
+
}
}
@@ -282,6 +289,7 @@ int main(int argc, char* argv[])
tref=1;
if(SampleNo > 0)
{
+ if(parseable==0){
printf("%10lu %10lu %10lu %10lu %10lu %10lu %13u %10lu %10u\n",
TransientMin,
TransientMax,
@@ -291,6 +299,19 @@ int main(int argc, char* argv[])
(endTime-lasttime),
SampleNo);
fflush(stdout);
+ }
+ else{
+ //parser friendly output
+ printf("%lu,%lu,%lu,%lu,%lu,%lu,%u,%lu,%u\n",
+ TransientMin,
+ TransientMax,
+ TransientMax-TransientMin,
+ currentExectime, absoluteMin,
+ absoluteMax,tmp,
+ (endTime-lasttime),
+ SampleNo);
+ fflush(stdout);
+ }
}
else
{
@@ -316,7 +337,7 @@ int main(int argc, char* argv[])
}
- if (!(SampleNo % 40)) // print the title every 40 lines
+ if (!(SampleNo % 40)& (parseable==0)) // print the title every 40 lines
printf("%s",title);
}