On Tue, Aug 25, 2020 at 12:22 PM Jiri Olsa <jolsa@xxxxxxxxxx> wrote: > + > +static int trigger_fstat_events(pid_t pid) > +{ > + int sockfd = -1, procfd = -1, devfd = -1; > + int localfd = -1, indicatorfd = -1; > + int pipefd[2] = { -1, -1 }; > + struct stat fileStat; > + int ret = -1; > + > + /* unmountable pseudo-filesystems */ > + if (CHECK(pipe(pipefd) < 0, "trigger", "pipe failed\n")) > + return ret; > + /* unmountable pseudo-filesystems */ > + sockfd = socket(AF_INET, SOCK_STREAM, 0); > + if (CHECK(sockfd < 0, "trigger", "scoket failed\n")) > + goto out_close; > + /* mountable pseudo-filesystems */ > + procfd = open("/proc/self/comm", O_RDONLY); > + if (CHECK(procfd < 0, "trigger", "open /proc/self/comm failed\n")) > + goto out_close; > + devfd = open("/dev/urandom", O_RDONLY); > + if (CHECK(devfd < 0, "trigger", "open /dev/urandom failed\n")) > + goto out_close; > + localfd = open("/tmp/d_path_loadgen.txt", O_CREAT | O_RDONLY); The work-in-progress CI caught a problem here: In file included from /usr/include/fcntl.h:290:0, 4814 from ./test_progs.h:29, 4815 from /home/travis/build/tsipa/bpf-next/tools/testing/selftests/bpf/prog_tests/d_path.c:3: 4816In function ‘open’, 4817 inlined from ‘trigger_fstat_events’ at /home/travis/build/tsipa/bpf-next/tools/testing/selftests/bpf/prog_tests/d_path.c:50:10, 4818 inlined from ‘test_d_path’ at /home/travis/build/tsipa/bpf-next/tools/testing/selftests/bpf/prog_tests/d_path.c:119:6: 4819/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments 4820 __open_missing_mode (); 4821 ^~~~~~~~~~~~~~~~~~~~~~ I don't see this bug in my setup, since I'm using an older glibc that doesn't have this check, so I've pushed it anyway since it was taking a bit long to land and folks were eagerly waiting for the allowlist and d_path features. But some other folks may complain about build breakage really soon. So please follow up asap.