summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-09-27 22:35:06 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-01 21:45:55 +0100
commit7aba4c930e94316a90ada6022792ecb00ff2cf86 (patch)
tree920a7654b5b8e4a3d02ac6c117d6d8885da62b03 /meta/recipes-devtools
parent4205c0befb65fcfc40db54d48f2556013a9b7e38 (diff)
downloadpoky-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')
-rw-r--r--meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch54
-rw-r--r--meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch53
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_1.8.1.bb2
3 files changed, 109 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 @@
1From eead8a505245a292c43f070c0e836cdfeb7bd7bd Mon Sep 17 00:00:00 2001
2From: Seebs <seebs@seebs.net>
3Date: Wed, 28 Sep 2016 17:05:17 -0500
4Subject: [PATCH 1/2] Quiet diagnostics during startup for pseudo -d
5
6When the client spawns a pseudo server, it starts out sending diagnostics
7to stderr. This can be spammy in some cases with races during startup;
8everything resolves, but we get scary-looking diagnostics. So shove
9those into a log file.
10
11Signed-off-by: Seebs <seebs@seebs.net>
12
13Upstream-Status: Backport
14Signed-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
20diff --git a/ChangeLog.txt b/ChangeLog.txt
21index 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
33diff --git a/pseudo_server.c b/pseudo_server.c
34index 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 @@
1From 7a0632cad851826d804db0540d9a59773e6bf29c Mon Sep 17 00:00:00 2001
2From: Seebs <seebs@seebs.net>
3Date: Wed, 28 Sep 2016 22:12:29 -0500
4Subject: [PATCH 2/2] Use correct file descriptor
5
6So it turns out that pseudo_logfile() was returning 0 or -1, and
7pseudo_debug_logfile() was expecting it to be the correct file descriptor
8to use. And it's basically a mystery that any of that ever worked.
9
10Signed-off-by: Seebs <seebs@seebs.net>
11
12Upstream-Status: Backport
13Signed-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
19diff --git a/ChangeLog.txt b/ChangeLog.txt
20index 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.
33diff --git a/pseudo_util.c b/pseudo_util.c
34index 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 }
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb b/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
index cec214986e..67eb298b22 100644
--- a/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
@@ -7,6 +7,8 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz
7 file://moreretries.patch \ 7 file://moreretries.patch \
8 file://Fix-xattr-performance.patch \ 8 file://Fix-xattr-performance.patch \
9 file://0001-Don-t-send-SIGUSR1-to-init.patch \ 9 file://0001-Don-t-send-SIGUSR1-to-init.patch \
10 file://0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch \
11 file://0002-Use-correct-file-descriptor.patch \
10 " 12 "
11 13
12SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7" 14SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7"