Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage test changes #449

Merged
merged 2 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/fusedav.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ static int get_stat_from_cache(const char *path, struct stat *stbuf, enum ignore
// If st_mode is 0, this is a negative (non-existing) entry
else if (response->st.st_mode == 0) {
log_print(LOG_INFO, SECTION_FUSEDAV_STAT, "get_stat_from_cache: negative entry response from stat_cache_value_get for path %s.", path);
free(response);
return -ENOENT;
}

Expand Down Expand Up @@ -1657,7 +1658,7 @@ static int dav_release(const char *path, __unused struct fuse_file_info *info) {
else {
st_size = value->st.st_size;
}
free(value);
if (value) free(value);

// sdata now carries a has_error field. If we detect an error on the file,
// we carry it forward. filecache_sync will detect and cause gerr if it sees an error.
Expand Down
3 changes: 2 additions & 1 deletion src/statcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ struct stat_cache_value *stat_cache_value_get(stat_cache_t *cache, const char *p
directory = path_parent(path);
if (directory == NULL) {
log_print(LOG_DEBUG, SECTION_STATCACHE_CACHE, "stat_cache_value_get: Stat entry for directory %s is NULL.", path);
free(value);
stats_counter("statcache_stale", 1, pfsamplerate);
return NULL;
}
Expand Down Expand Up @@ -690,7 +691,7 @@ void stat_cache_value_set(stat_cache_t *cache, const char *path, struct stat_cac
if (errptr != NULL || inject_error(statcache_error_setldb)) {
g_set_error (gerr, leveldb_quark(), E_SC_LDBERR, "%s: leveldb_set error: %s", funcname, errptr ? errptr : "inject-error");
free(errptr);
log_print(LOG_ALERT, SECTION_STATCACHE_CACHE, "%s: leveldb_get error, kill fusedav process", funcname);
log_print(LOG_ALERT, SECTION_STATCACHE_CACHE, "%s: leveldb_set error, kill fusedav process", funcname);
kill(getpid(), SIGTERM);
return;
}
Expand Down
4 changes: 0 additions & 4 deletions src/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ void dump_stats(bool log, const char *cache_path) {
}
}

mallctl("prof.dump", NULL, NULL, NULL, 0);
mallctl("prof_leak", NULL, NULL, NULL, 0);
mallctl("prof.gdump", NULL, NULL, NULL, 0);

snprintf(str, MAX_LINE_LEN, "Caught SIGUSR2. Printing status.");
print_line(log, fd, LOG_NOTICE, SECTION_FUSEDAV_OUTPUT, str);

Expand Down
25 changes: 15 additions & 10 deletions tests/continualtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ This script runs the command line tests
OPTIONS:
-h Show this message
-i Number of iterations
-d Directory name (default is fusedav)
-t Directory name (default is /opt/fusedav/tests)
-b Binary name (default is /opt/fusedav/src/fusedav)
-p pid of fusedav instance
-v Verbose
EOF
Expand All @@ -23,8 +24,9 @@ pid=0
iters=64
verbose=0
# assuming we are using base fusedav; but allow for override
fusedavdir="fusedav"
while getopts "hi:d:p:v" OPTION
fusedavtestdir="/opt/fusedav/tests"
fusedavbinary="/opt/fusedav/src/fusedav"
while getopts "hi:t:b:p:v" OPTION
do
case $OPTION in
h)
Expand All @@ -34,8 +36,11 @@ do
i)
iters=$OPTARG
;;
d)
fusedavdir=$OPTARG
t)
fusedavtestdir=$OPTARG
;;
b)
fusedavbinary=$OPTARG
;;
p)
pid=$OPTARG
Expand Down Expand Up @@ -74,11 +79,11 @@ do
echo "$iter: before make: $res"
echo "$iter: before make: $res" >> $pprof_out

echo "$iter: make -f /opt/$fusedavdir/tests/Makefile run-continual-tests testdir=/opt/$fusedavdir/tests"
echo "$iter: make -f /opt/$fusedavdir/tests/Makefile run-continual-tests testdir=/opt/$fusedavdir/tests" >> $pprof_out
echo "$iter: make -f $fusedavtestdir/Makefile run-continual-tests testdir=$fusedavtestdir"
echo "$iter: make -f $fusedavtestdir/Makefile run-continual-tests testdir=$fusedavtestdir" >> $pprof_out

# run the tests
make -f /opt/$fusedavdir/tests/Makefile run-continual-tests testdir=/opt/$fusedavdir/tests
make -f $fusedavtestdir/Makefile run-continual-tests testdir=$fusedavtestdir

if [ $iter -gt 0 ]; then
# get the most recent heap to use as base to pprof
Expand All @@ -94,8 +99,8 @@ do

if [ $iter -gt 0 ]; then
# do a pprof comparison between latest and previous heap filees
echo "pprof --text --lines --inuse_space --base=$prevheap /opt/$fusedavdir/src/fusedav $newheap >> $pprof_out 2>&1"
pprof --text --lines --inuse_space --base=$prevheap /opt/$fusedavdir/src/fusedav $newheap >> $pprof_out 2>&1
echo "pprof --text --lines --inuse_space --base=$prevheap $fusedavbinary $newheap >> $pprof_out 2>&1"
pprof --text --lines --inuse_space --base=$prevheap $fusedavbinary $newheap >> $pprof_out 2>&1
fi

res=$(ps aux | grep valhalla | grep -v grep | grep $pid | awk '{printf "%5d %d\n", $2, $6}')
Expand Down