Re: perf test for daemon

From: John Garry
Date: Fri Feb 26 2021 - 04:19:35 EST


On 25/02/2021 19:35, Jiri Olsa wrote:
On Thu, Feb 25, 2021 at 08:13:07PM +0100, Jiri Olsa wrote:
On Thu, Feb 25, 2021 at 06:39:22PM +0000, John Garry wrote:
Hi,

I notice that "perf test" when run without root priviledges now hangs at the
daemon test - is this expected behaviour? Can we skip and warn the user
instead?

I'm checking acme perf/core today.
ugh, I'll check.. looks like control fifo files are created with wrong permissions
could you please try the fix below? it's passing with non-root user for me

thanks,
jirka


ok, it completes now. thanks

Tested-by: John Garry <john.garry@xxxxxxxxxx>


---
diff --git a/tools/perf/builtin-daemon.c b/tools/perf/builtin-daemon.c
index 617feaf020f6..8f0ed2e59280 100644
--- a/tools/perf/builtin-daemon.c
+++ b/tools/perf/builtin-daemon.c
@@ -373,12 +373,12 @@ static int daemon_session__run(struct daemon_session *session,
dup2(fd, 2);
close(fd);
- if (mkfifo(SESSION_CONTROL, O_RDWR) && errno != EEXIST) {
+ if (mkfifo(SESSION_CONTROL, 0600) && errno != EEXIST) {
perror("failed: create control fifo");
return -1;
}
- if (mkfifo(SESSION_ACK, O_RDWR) && errno != EEXIST) {
+ if (mkfifo(SESSION_ACK, 0600) && errno != EEXIST) {
perror("failed: create ack fifo");
return -1;
}
diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell/daemon.sh
index e5b824dd08d9..5ad3ca8d681b 100755