aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2020-09-21 13:31:15 +0000
committerDmitry Vyukov <dvyukov@google.com>2020-09-28 11:14:36 +0200
commitbc26d8bddd75c191e3aa61babd0138d9a07b009c (patch)
treed174a3776d7d64ce8026803c845e3b20582599a1 /executor
parent6bfdbe8950b22b1c832478bd397754f3108df040 (diff)
executor/linux: stop dumping mount information when failed to open kcov file
Since ENOENT problem was solved by commit 318430cbb3b2ceef ("executor/linux: change mount propagation type to private"), remove the debug code for this problem.
Diffstat (limited to 'executor')
-rw-r--r--executor/executor_linux.h41
1 files changed, 1 insertions, 40 deletions
diff --git a/executor/executor_linux.h b/executor/executor_linux.h
index f8aed1791..e4e3ab56b 100644
--- a/executor/executor_linux.h
+++ b/executor/executor_linux.h
@@ -93,50 +93,11 @@ static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs])
return res;
}
-static void dump_dir(const char* path)
-{
- DIR* dir = opendir(path);
- struct dirent* d = NULL;
- if (!dir)
- return;
- fprintf(stderr, "Index of %s\n", path);
- while ((d = readdir(dir)) != NULL)
- fprintf(stderr, " %s\n", d->d_name);
- closedir(dir);
-}
-
static void cover_open(cover_t* cov, bool extra)
{
int fd = open("/sys/kernel/debug/kcov", O_RDWR);
- if (fd == -1) {
- const int err = errno;
- dump_dir("/");
- dump_dir("/proc/");
- dump_dir("/sys/");
- if (mount("/proc/", "/proc/", "proc", 0, NULL))
- fprintf(stderr, "Can't mount proc on /proc/\n");
- if (chdir("/sys/"))
- fprintf(stderr, "/sys/ does not exist.\n");
- else if (chdir("/sys/kernel/"))
- fprintf(stderr, "/sys/kernel/ does not exist.\n");
- else if (chdir("/sys/kernel/debug/"))
- fprintf(stderr, "/sys/kernel/debug/ does not exist.\n");
- fd = open("/proc/mounts", O_RDONLY);
- if (fd == -1) {
- fprintf(stderr, "open of /proc/mounts failed.\n");
- if (chdir("/proc/"))
- fprintf(stderr, "/proc/ does not exist.\n");
- } else {
- static char buffer[4096];
- int len;
- fprintf(stderr, "Content of /proc/mounts\n");
- while ((len = read(fd, buffer, sizeof(buffer))) > 0)
- fwrite(buffer, 1, len, stderr);
- close(fd);
- }
- errno = err;
+ if (fd == -1)
fail("open of /sys/kernel/debug/kcov failed");
- }
if (dup2(fd, cov->fd) < 0)
fail("filed to dup2(%d, %d) cover fd", fd, cov->fd);
close(fd);