Skip to content

Commit

Permalink
restructuring the tests slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vignesh2208 committed Jul 19, 2020
1 parent df666ec commit b476ae0
Show file tree
Hide file tree
Showing 20 changed files with 416 additions and 513 deletions.
2 changes: 1 addition & 1 deletion src/core/hooked_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ asmlinkage long sys_sleep_new(struct timespec __user *rqtp,
wake_up_interruptible(&expstop_call_proc_wqueue);

rmt = ktime_to_timespec(rem);
if (copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
if (rmtp && copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
return -EFAULT;
return 0;

Expand Down
2 changes: 1 addition & 1 deletion src/tracer/libperf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/bin/x86_64-linux-gnu-ld -m elf_x86_64
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS =
LIBOBJS =
LIBPERF_API_VERSION = 1.0
Expand Down
722 changes: 361 additions & 361 deletions src/tracer/libperf/autom4te.cache/requests

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/tracer/libperf/config.status
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ Xsed='/bin/sed -e 1s/^X//'
GREP='/bin/grep'
EGREP='/bin/grep -E'
FGREP='/bin/grep -F'
LD='/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64'
LD='/usr/bin/ld -m elf_x86_64'
NM='/usr/bin/nm -B'
LN_S='ln -s'
max_cmd_len='1572864'
Expand Down Expand Up @@ -679,8 +679,8 @@ postuninstall_cmds=''
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
finish_eval=''
hardcode_into_libs='yes'
sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/6 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib '
configure_time_dlsearch_path='/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa-egl /usr/lib/x86_64-linux-gnu/mesa /lib32 /usr/lib32 '
sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/5 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib '
configure_time_dlsearch_path='/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa-egl /usr/lib/x86_64-linux-gnu/mesa '
configure_time_lt_sys_library_path=''
hardcode_action='immediate'
enable_dlopen='unknown'
Expand Down Expand Up @@ -839,7 +839,7 @@ S["LN_S"]="ln -s"
S["NM"]="/usr/bin/nm -B"
S["ac_ct_DUMPBIN"]=""
S["DUMPBIN"]=""
S["LD"]="/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64"
S["LD"]="/usr/bin/ld -m elf_x86_64"
S["FGREP"]="/bin/grep -F"
S["EGREP"]="/bin/grep -E"
S["GREP"]="/bin/grep"
Expand Down
6 changes: 3 additions & 3 deletions src/tracer/libperf/libtool
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ finish_eval=""
hardcode_into_libs=yes

# Compile-time system search path for libraries.
sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/6 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib "
sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/5 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib "

# Detected run-time system search path for libraries.
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa-egl /usr/lib/x86_64-linux-gnu/mesa /lib32 /usr/lib32 "
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa-egl /usr/lib/x86_64-linux-gnu/mesa "

# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
configure_time_lt_sys_library_path=""
Expand All @@ -305,7 +305,7 @@ striplib="strip --strip-unneeded"


# The linker used to build libraries.
LD="/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64"
LD="/usr/bin/ld -m elf_x86_64"

# How to create reloadable object files.
reload_flag=" -r"
Expand Down
12 changes: 6 additions & 6 deletions src/tracer/libperf/src/.deps/libperf.Plo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ libperf.lo: libperf.c /usr/include/stdc-predef.h /usr/include/assert.h \
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h /usr/include/time.h \
/usr/include/x86_64-linux-gnu/bits/stat.h \
/usr/include/x86_64-linux-gnu/bits/fcntl2.h /usr/include/inttypes.h \
/usr/lib/gcc/x86_64-linux-gnu/6/include/stdint.h /usr/include/stdint.h \
/usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h /usr/include/stdint.h \
/usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/math.h \
/usr/include/x86_64-linux-gnu/bits/math-vector.h \
/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
Expand All @@ -21,9 +21,9 @@ libperf.lo: libperf.c /usr/include/stdc-predef.h /usr/include/assert.h \
/usr/include/x86_64-linux-gnu/bits/mathdef.h \
/usr/include/x86_64-linux-gnu/bits/mathcalls.h \
/usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/stdio.h \
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h /usr/include/libio.h \
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-linux-gnu/6/include/stdarg.h \
/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
/usr/include/x86_64-linux-gnu/bits/stdio.h \
Expand Down Expand Up @@ -109,7 +109,7 @@ libperf.lo: libperf.c /usr/include/stdc-predef.h /usr/include/assert.h \

/usr/include/inttypes.h:

/usr/lib/gcc/x86_64-linux-gnu/6/include/stdint.h:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h:

/usr/include/stdint.h:

Expand Down Expand Up @@ -139,15 +139,15 @@ libperf.lo: libperf.c /usr/include/stdc-predef.h /usr/include/assert.h \

/usr/include/stdio.h:

/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:

/usr/include/libio.h:

/usr/include/_G_config.h:

/usr/include/wchar.h:

/usr/lib/gcc/x86_64-linux-gnu/6/include/stdarg.h:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:

/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:

Expand Down
2 changes: 1 addition & 1 deletion src/tracer/libperf/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/bin/x86_64-linux-gnu-ld -m elf_x86_64
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS =
LIBOBJS =
LIBPERF_API_VERSION = 1.0
Expand Down
1 change: 0 additions & 1 deletion src/tracer/tests/repeatability-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ build:
-I${tracer_dir}/utils ${test_dir}/insn_tester.c ${tracer_dir}/utils/linkedlist.c \
${tracer_dir}/utils/hashmap.c -o ${test_dir}/insn_tester -lperf
@gcc ${test_dir}/test.c -fno-asynchronous-unwind-tables -fno-dwarf2-cfi-asm -o ${test_dir}/test
@gcc ${test_dir}/test.c -S -fno-asynchronous-unwind-tables -fno-dwarf2-cfi-asm -o ${test_dir}/test.s
@echo ${test_dir}/test > cmds.txt
@chmod 777 ${test_dir}/test
@chmod 777 ${test_dir}/insn_tester
Expand Down
42 changes: 0 additions & 42 deletions src/tracer/tests/repeatability-test/test.s

This file was deleted.

7 changes: 1 addition & 6 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ clean:
@cd usleep_test && make clean
@cd socket_test && make clean
@cd timerfd_test && make clean
@cd alarm_test && make clean
@cd producer_consumer_test && make clean
@rm -f /usr/bin/run_test

Expand All @@ -20,13 +19,9 @@ build:
@cd integration_test && make build
@cd usleep_test && make build
@cd socket_test && make build
@cd alarm_test && make build
@cd timerfd_test && make build
@cd producer_consumer_test && make build

run_alarm_test:
@cd alarm_test && echo "Running Alarm Test: " && chmod 777 run_test.sh && sudo ./run_test.sh

run_timerfd_test:
@cd timerfd_test && echo "Running Timerfd Test: " && chmod 777 run_test.sh && sudo ./run_test.sh

Expand All @@ -44,5 +39,5 @@ run:
@cd usleep_test && echo "Running usleep Test: " && chmod 777 run_test.sh && sudo ./run_test.sh
@cd socket_test && echo "Running Socket Test: " && chmod 777 run_test.sh && sudo ./run_test.sh
@cd producer_consumer_test && echo "Running Producer Consumer Test: " && chmod 777 run_test.sh && sudo ./run_test.sh

@sudo chmod -R 775 /tmp/*_test

9 changes: 0 additions & 9 deletions tests/alarm_test/Makefile

This file was deleted.

40 changes: 0 additions & 40 deletions tests/alarm_test/alarm.c

This file was deleted.

8 changes: 0 additions & 8 deletions tests/alarm_test/run_test.sh

This file was deleted.

11 changes: 7 additions & 4 deletions tests/producer_consumer_test/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

sudo run_test 1 1 1000 1000000 > /tmp/pc_test.log
if grep -nr "Succeeded" /tmp/pc_test.log; then
echo "STATUS: COMPLETED. Check Logs at /tmp/pc_test.log"
sudo rm -f /tmp/tracer*
mkdir -p /tmp/pc_test
sudo run_test 1 1 1000 1000000 > /tmp/pc_test/pc_test.log
sudo cp /tmp/tracer* /tmp/pc_test 2> /dev/null
if grep -nr "Succeeded" /tmp/pc_test/pc_test.log; then
echo "STATUS: COMPLETED. Check Logs inside /tmp/pc_test"
else
echo "STATUS: FAILED. Check Logs at /tmp/pc_test.log"
echo "STATUS: FAILED. Check Logs inside /tmp/pc_test"
fi
13 changes: 8 additions & 5 deletions tests/socket_test/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

sudo ./socket_test > /tmp/socket_test.log
if grep -nr "Succeeded" /tmp/socket_test.log; then
echo "STATUS: COMPLETED. Check Logs at /tmp/socket_test.log"
sudo rm -f /tmp/tracer*
sudo mkdir -p /tmp/socket_test
sudo ./socket_test > /tmp/socket_test/socket_test.log
sudo cp /tmp/tracer* /tmp/socket_test 2> /dev/null
if grep -nr "Succeeded" /tmp/socket_test/socket_test.log; then
echo "STATUS: COMPLETED. Check Logs inside /tmp/socket_test"
else
echo "STATUS: FAILED. Check Logs at /tmp/socket_test.log"
fi
echo "STATUS: FAILED. Check Logs inside /tmp/socket_test"
fi
4 changes: 2 additions & 2 deletions tests/socket_test/socket_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ int main(int argc, char * argv[]) {

usleep(1000000);

printf("Progress Experiment for 200 Rounds !\n");
printf("Progress Experiment for 2000 Rounds !\n");
fflush(stdout);
for (i = 0; i < 200; i++) {
for (i = 0; i < 2000; i++) {
printf("%d,", i);
progress_n_rounds(1);
}
Expand Down
11 changes: 7 additions & 4 deletions tests/timerfd_test/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

sudo run_test 1 1 10000 1000000 > /tmp/tfd_test.log
if grep -nr "Succeeded" /tmp/tfd_test.log; then
echo "STATUS: COMPLETED. Check Logs at /tmp/tfd_test.log"
sudo rm -f /tmp/tracer*
sudo mkdir -p /tmp/tfd_test
sudo run_test 1 1 10000 1000000 > /tmp/tfd_test/tfd_test.log
sudo cp /tmp/tracer* /tmp/tfd_test 2> /dev/null
if grep -nr "Succeeded" /tmp/tfd_test/tfd_test.log; then
echo "STATUS: COMPLETED. Check Logs inside /tmp/tfd_test"
else
echo "STATUS: FAILED. Check Logs at /tmp/tfd_test.log"
echo "STATUS: FAILED. Check Logs at /tmp/tfd_test"
fi
13 changes: 8 additions & 5 deletions tests/usleep_test/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

sudo ./usleep_test 1 > /tmp/usleep_test.log
if grep -nr "Succeeded" /tmp/usleep_test.log; then
echo "STATUS: COMPLETED. Check Logs at /tmp/usleep_test.log"
sudo rm -f /tmp/tracer*
sudo mkdir -p /tmp/usleep_test
sudo ./usleep_test 1 > /tmp/usleep_test/usleep_test.log
sudo cp /tmp/tracer* /tmp/usleep_test 2> /dev/null
if grep -nr "Succeeded" /tmp/usleep_test/usleep_test.log; then
echo "STATUS: COMPLETED. Check Logs inside /tmp/usleep_test"
else
echo "STATUS: FAILED. Check Logs at /tmp/usleep_test.log"
fi
echo "STATUS: FAILED. Check Logs inside /tmp/usleep_test"
fi
10 changes: 3 additions & 7 deletions tests/usleep_test/usleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,11 @@ int main(int argc, char *argv[])
// printf("Sleeping for %d\n", sleep_usec);


if(usleep( sleep_usec ) == -1)
{
printf("Usleep Error\n");
printf("Oh dear, something went wrong with usleep()! %s\n", strerror(errno));

if (usleep( sleep_usec ) == -1) {
printf("Oh dear, something went wrong with usleep !\n");
fflush(stdout);
exit(1);
exit(0);
}

printf("Woke up after sleep\n");
fflush(stdout);

Expand Down
6 changes: 3 additions & 3 deletions tests/usleep_test/usleep_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int main(int argc, char * argv[]) {
pid_t ret_val;
int n_exited_tracers = 0;
int status;
int test_n_insns = 1000000;
int test_n_insns = 100000;

if (argc < 2 || !strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
fprintf(stderr, "\n");
Expand Down Expand Up @@ -213,9 +213,9 @@ int main(int argc, char * argv[]) {

usleep(1000000);

printf("Progress Experiment for 100000 Rounds !\n");
printf("Progress Experiment for 2000 Rounds !\n");
fflush(stdout);
progress_n_rounds(100000);
progress_n_rounds(2000);
fflush(stdout);
printf("Stopping Experiment ... \n");
fflush(stdout);
Expand Down

0 comments on commit b476ae0

Please sign in to comment.