gem5: benchmark hdf5 stats

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-03-16 00:00:02 +00:00
parent 91d6315e8a
commit 33f9862974
5 changed files with 49 additions and 20 deletions

View File

@@ -1,34 +1,42 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#m5ops-instructions */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define LKMC_M5OPS_ENABLE 1
#include <lkmc/m5ops.h>
int main(int argc, char **argv) {
char action;
unsigned long long loops;
if (argc > 1) {
action = argv[1][0];
} else {
action = 'e';
}
switch (action) {
case 'c':
LKMC_M5OPS_CHECKPOINT;
break;
case 'd':
LKMC_M5OPS_DUMPSTATS;
break;
case 'e':
LKMC_M5OPS_EXIT;
break;
case 'f':
LKMC_M5OPS_FAIL_1;
break;
case 'r':
LKMC_M5OPS_RESETSTATS;
break;
if (argc > 2) {
loops = strtoull(argv[2], NULL, 0);
} else {
loops = 1;
}
for (unsigned long long i = 0; i < loops; i++) {
switch (action) {
case 'c':
LKMC_M5OPS_CHECKPOINT;
break;
case 'd':
LKMC_M5OPS_DUMPSTATS;
break;
case 'e':
LKMC_M5OPS_EXIT;
break;
case 'f':
LKMC_M5OPS_FAIL_1;
break;
case 'r':
LKMC_M5OPS_RESETSTATS;
break;
}
}
return EXIT_SUCCESS;
}