diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-09-27 22:35:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-01 21:45:55 +0100 |
commit | 7aba4c930e94316a90ada6022792ecb00ff2cf86 (patch) | |
tree | 920a7654b5b8e4a3d02ac6c117d6d8885da62b03 /meta/recipes-devtools/pseudo/files | |
parent | 4205c0befb65fcfc40db54d48f2556013a9b7e38 (diff) | |
download | poky-7aba4c930e94316a90ada6022792ecb00ff2cf86.tar.gz |
pseudo: quiet diagnostics during startup for pseudo -d
When the client spawns a pseudo server, it starts out sending diagnostics
to stderr. This can be spammy in some cases with races during startup;
everything resolves, but we get scary-looking diagnostics. So shove
those into a log file.
(From OE-Core rev: efd0b0f604f9f498b9c20bc9a25708c493aa4f4a)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/pseudo/files')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch | 54 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch | 53 |
2 files changed, 107 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch b/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch new file mode 100644 index 0000000000..d4b9f6a0f8 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From eead8a505245a292c43f070c0e836cdfeb7bd7bd Mon Sep 17 00:00:00 2001 | ||
2 | From: Seebs <seebs@seebs.net> | ||
3 | Date: Wed, 28 Sep 2016 17:05:17 -0500 | ||
4 | Subject: [PATCH 1/2] Quiet diagnostics during startup for pseudo -d | ||
5 | |||
6 | When the client spawns a pseudo server, it starts out sending diagnostics | ||
7 | to stderr. This can be spammy in some cases with races during startup; | ||
8 | everything resolves, but we get scary-looking diagnostics. So shove | ||
9 | those into a log file. | ||
10 | |||
11 | Signed-off-by: Seebs <seebs@seebs.net> | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
15 | --- | ||
16 | ChangeLog.txt | 5 +++++ | ||
17 | pseudo_server.c | 4 +++- | ||
18 | 2 files changed, 8 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/ChangeLog.txt b/ChangeLog.txt | ||
21 | index d6359ca..4cc24de 100644 | ||
22 | --- a/ChangeLog.txt | ||
23 | +++ b/ChangeLog.txt | ||
24 | @@ -1,3 +1,8 @@ | ||
25 | +2016-09-28: | ||
26 | + * (seebs) Send errors to log when daemonizing, but do that a lot | ||
27 | + sooner to prevent startup messages which can show up spuriously | ||
28 | + with multiple clients. | ||
29 | + | ||
30 | 2016-07-28: | ||
31 | * (seebs) Fix performance issue on deletion with xattr changes. | ||
32 | |||
33 | diff --git a/pseudo_server.c b/pseudo_server.c | ||
34 | index 8731d20..7c2db2f 100644 | ||
35 | --- a/pseudo_server.c | ||
36 | +++ b/pseudo_server.c | ||
37 | @@ -162,6 +162,9 @@ pseudo_server_start(int daemonize) { | ||
38 | * SIGUSR1, or until too much time has passed. */ | ||
39 | if (daemonize) { | ||
40 | int child; | ||
41 | + | ||
42 | + /* make startup messages go away when invoked-as-daemon */ | ||
43 | + pseudo_debug_logfile(PSEUDO_LOGFILE, 2); | ||
44 | child = fork(); | ||
45 | if (child == -1) { | ||
46 | pseudo_diag("Couldn't fork child process: %s\n", | ||
47 | @@ -231,7 +234,6 @@ pseudo_server_start(int daemonize) { | ||
48 | setsid(); | ||
49 | fclose(stdin); | ||
50 | fclose(stdout); | ||
51 | - pseudo_debug_logfile(PSEUDO_LOGFILE, 2); | ||
52 | /* and then just execute the server code normally. */ | ||
53 | /* Any logging will presumably go to logfile, but | ||
54 | * exit status will make it back to the parent for | ||
diff --git a/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch b/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch new file mode 100644 index 0000000000..dd6fd87ae9 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 7a0632cad851826d804db0540d9a59773e6bf29c Mon Sep 17 00:00:00 2001 | ||
2 | From: Seebs <seebs@seebs.net> | ||
3 | Date: Wed, 28 Sep 2016 22:12:29 -0500 | ||
4 | Subject: [PATCH 2/2] Use correct file descriptor | ||
5 | |||
6 | So it turns out that pseudo_logfile() was returning 0 or -1, and | ||
7 | pseudo_debug_logfile() was expecting it to be the correct file descriptor | ||
8 | to use. And it's basically a mystery that any of that ever worked. | ||
9 | |||
10 | Signed-off-by: Seebs <seebs@seebs.net> | ||
11 | |||
12 | Upstream-Status: Backport | ||
13 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
14 | --- | ||
15 | ChangeLog.txt | 3 +++ | ||
16 | pseudo_util.c | 3 ++- | ||
17 | 2 files changed, 5 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/ChangeLog.txt b/ChangeLog.txt | ||
20 | index 4cc24de..49a6c36 100644 | ||
21 | --- a/ChangeLog.txt | ||
22 | +++ b/ChangeLog.txt | ||
23 | @@ -2,6 +2,9 @@ | ||
24 | * (seebs) Send errors to log when daemonizing, but do that a lot | ||
25 | sooner to prevent startup messages which can show up spuriously | ||
26 | with multiple clients. | ||
27 | + * (seebs) return file descriptor from pseudo_logfile, so we set | ||
28 | + pseudo_util_debug_fd to the right value instead of to stdin. | ||
29 | + Nice bug. | ||
30 | |||
31 | 2016-07-28: | ||
32 | * (seebs) Fix performance issue on deletion with xattr changes. | ||
33 | diff --git a/pseudo_util.c b/pseudo_util.c | ||
34 | index 0c156cf..a60c74b 100644 | ||
35 | --- a/pseudo_util.c | ||
36 | +++ b/pseudo_util.c | ||
37 | @@ -1569,7 +1569,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { | ||
38 | if (fd == -1) | ||
39 | return -1; | ||
40 | else | ||
41 | - return 0; | ||
42 | + return fd; | ||
43 | } | ||
44 | |||
45 | int | ||
46 | @@ -1579,6 +1579,7 @@ pseudo_debug_logfile(char *defname, int prefer_fd) { | ||
47 | |||
48 | fd = pseudo_logfile(filename, defname, prefer_fd); | ||
49 | if (fd > -1) { | ||
50 | + pseudo_diag("debug_logfile: fd %d\n", fd); | ||
51 | pseudo_util_debug_fd = fd; | ||
52 | return 0; | ||
53 | } | ||