@@ -151,7 +151,7 @@ unsigned char *alloc_buffer(size_t buf_size, int memflush)
return buf;
}
-int run_fill_buf(size_t buf_size, int memflush, int op, bool once)
+int run_fill_buf(size_t buf_size, int memflush, int op)
{
unsigned char *buf;
@@ -160,9 +160,10 @@ int run_fill_buf(size_t buf_size, int memflush, int op, bool once)
return -1;
if (op == 0)
- fill_cache_read(buf, buf_size, once);
+ fill_cache_read(buf, buf_size, false);
else
- fill_cache_write(buf, buf_size, once);
+ fill_cache_write(buf, buf_size, false);
+
free(buf);
return 0;
@@ -142,7 +142,7 @@ int perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu,
unsigned char *alloc_buffer(size_t buf_size, int memflush);
void mem_flush(unsigned char *buf, size_t buf_size);
void fill_cache_read(unsigned char *buf, size_t buf_size, bool once);
-int run_fill_buf(size_t buf_size, int memflush, int op, bool once);
+int run_fill_buf(size_t buf_size, int memflush, int op);
int initialize_mem_bw_imc(void);
int measure_mem_bw(const struct user_params *uparams,
struct resctrl_val_param *param, pid_t bm_pid,
@@ -266,8 +266,13 @@ int main(int argc, char **argv)
uparams.benchmark_cmd[1] = span_str;
uparams.benchmark_cmd[2] = "1";
uparams.benchmark_cmd[3] = "0";
- uparams.benchmark_cmd[4] = "false";
- uparams.benchmark_cmd[5] = NULL;
+ /*
+ * Fourth parameter was previously used to indicate
+ * how long "fill_buf" should run for, with "false"
+ * ("fill_buf" will keep running until terminated)
+ * the only option that works.
+ */
+ uparams.benchmark_cmd[4] = NULL;
}
ksft_set_plan(tests);
@@ -625,7 +625,6 @@ static void run_benchmark(int signum, siginfo_t *info, void *ucontext)
int operation, ret, memflush;
char **benchmark_cmd;
size_t span;
- bool once;
FILE *fp;
benchmark_cmd = info->si_ptr;
@@ -645,16 +644,8 @@ static void run_benchmark(int signum, siginfo_t *info, void *ucontext)
span = strtoul(benchmark_cmd[1], NULL, 10);
memflush = atoi(benchmark_cmd[2]);
operation = atoi(benchmark_cmd[3]);
- if (!strcmp(benchmark_cmd[4], "true")) {
- once = true;
- } else if (!strcmp(benchmark_cmd[4], "false")) {
- once = false;
- } else {
- ksft_print_msg("Invalid once parameter\n");
- parent_exit(ppid);
- }
- if (run_fill_buf(span, memflush, operation, once))
+ if (run_fill_buf(span, memflush, operation))
fprintf(stderr, "Error in running fill buffer\n");
} else {
/* Execute specified benchmark */