All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests
@ 2023-07-12 21:22 Pauli Virtanen
  2023-07-12 21:22 ` [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pauli Virtanen @ 2023-07-12 21:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

It is useful to see WARN_ON etc. messages when running the tests.

The 'quiet' in cmdline suppresses levels >= WARN, so re-enable them
explicitly after boot, so that it is on by default and doesn't need to
be handled in local test scripts.
---

Notes:
    v2: add comment. Suppress level>=INFO, to hide "Bluetooth: MGMT ver" etc.
    
    It could be useful to also check for BUG/WARNING in the bluez test bot.

 tools/test-runner.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/test-runner.c b/tools/test-runner.c
index d74bb1087..119e1cfbc 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -136,6 +136,24 @@ static const char *config_table[] = {
 	NULL
 };
 
+static void enable_printk(void)
+{
+	FILE *f;
+
+	f = fopen("/proc/sys/kernel/printk", "w");
+	if (!f) {
+		perror("Failed to set printk");
+		return;
+	}
+
+	/* Restore printk loglevel, undoing 'quiet' in cmdline (suppress early
+	 * on-boot messages), to show WARN_ON etc. Suppress level>=6(INFO), set
+	 * default_msg:4(WARN) & min:1, default:7. See man 2 syslog.
+	 */
+	fprintf(f, "6 4 1 7");
+	fclose(f);
+}
+
 static void prepare_sandbox(void)
 {
 	int i;
@@ -181,6 +199,8 @@ static void prepare_sandbox(void)
 				"mode=0755") < 0)
 			perror("Failed to create filesystem");
 	}
+
+	enable_printk();
 }
 
 static char *const qemu_argv[] = {
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-13 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 21:22 [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
2023-07-12 21:22 ` [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
2023-07-12 22:44 ` [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests bluez.test.bot
2023-07-13 19:26 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.