Fix benchmark programs by correcting program paths

This commit is contained in:
Tate, Hongliang Tian 2019-12-01 02:59:46 +00:00
parent e09c747b84
commit 7024fa81ec
6 changed files with 6 additions and 5 deletions

@ -3,7 +3,7 @@ PROJECT_DIR := $(realpath $(CUR_DIR)/../)
BUILD_DIR := $(PROJECT_DIR)/build
# Dependencies: need to be compiled but not to run by any Makefile target
TEST_DEPS := dev_null client
TEST_DEPS := client data_sink
# Tests: need to be compiled and run by test-% target
TESTS := empty env hello_world malloc mmap file fs_perms getpid spawn sched pipe time \
truncate readdir mkdir link tls pthread uname rlimit server \

@ -5,6 +5,7 @@
#define MIN(x, y) ((x) <= (y) ? (x) : (y))
// This program consumes a specific amount of data from stdin
int main(int argc, const char* argv[]) {
// Get the total number of bytes to read
size_t remain_bytes = 0;

@ -33,7 +33,7 @@ int main(int argc, const char* argv[]) {
posix_spawn_file_actions_addclose(&file_actions, pipe_wr_fd);
int child_pid;
if (posix_spawn(&child_pid, "dev_null", &file_actions,
if (posix_spawn(&child_pid, "/bin/data_sink", &file_actions,
NULL, NULL, NULL) < 0) {
printf("ERROR: failed to spawn a child process\n");
return -1;

@ -13,7 +13,7 @@ int main(int argc, const char* argv[]) {
gettimeofday(&tv_start, NULL);
for (unsigned long i = 0; i < NREPEATS; i++) {
int child_pid, status;
if (posix_spawn(&child_pid, "empty", NULL, NULL, NULL, NULL) <0) {
if (posix_spawn(&child_pid, "/bin/empty", NULL, NULL, NULL, NULL) <0) {
printf("ERROR: failed to spawn (# of repeats = %lu)\n", i);
return -1;
}

@ -110,8 +110,8 @@ int main(int argc, const char* argv[]) {
int child_pid;
extern char ** environ;
char* new_argv[] = {"./dev_null", NULL};
if (posix_spawn(&child_pid, "dev_null", &file_actions,
char* new_argv[] = {"/bin/data_sink", NULL};
if (posix_spawn(&child_pid, "/bin/data_sink", &file_actions,
NULL, new_argv, environ) < 0) {
printf("ERROR: failed to spawn a child process\n");
return -1;