lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Nov 2017 13:07:08 +0000
From:   Chris Wilson <chris@...is-wilson.co.uk>
To:     linux-kernel@...r.kernel.org
Cc:     intel-gfx@...ts.freedesktop.org,
        Chris Wilson <chris@...is-wilson.co.uk>,
        Steven Rostedt <srostedt@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...e.hu>,
        Tomi Sarvela <tomi.p.sarvela@...el.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Daniel Vetter <daniel.vetter@...ll.ch>
Subject: [PATCH] ftrace: Allow configuring global trace buffer size (for dump-on-oops)

We have recently turned on ftrace-dump-on-oops for i915's CI and an
issue we have encountered is that the trace buffer size greatly exceeds
the pstore capabilities; we get the tail of the oops but not the
introduction.

Currently the global buffer size is controllable on the cmdline, but at
the request of our CI sysadmin, we would like to add a control to the
Kconfig as well. The rationale being the cmdline carries the temporary
hacks that we want to eradicate, and we want to track the permanent
configuration in .config.

I have kept the Kconfig option hidden from the user as the default
should suffice for the majority of users; reserving the configuration
for those that eschew the cmdline option.

Signed-off-by: Chris Wilson <chris@...is-wilson.co.uk>
Cc: Steven Rostedt <srostedt@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Tomi Sarvela <tomi.p.sarvela@...el.com>
Cc: Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
---
 kernel/trace/Kconfig | 6 ++++++
 kernel/trace/trace.c | 4 +---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 434c840e2d82..d5b3b13a66b5 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -100,6 +100,12 @@ config TRACING
 	select EVENT_TRACING
 	select TRACE_CLOCK
 
+config GLOBAL_TRACE_BUF_SIZE
+	int
+	range 0 4194034
+	default 1441792 # 16384 * 88 (sizeof(struct print_entry))
+	depends on TRACING
+
 config GENERIC_TRACER
 	bool
 	select TRACING
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 752e5daf0896..b1e6ebd96da3 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -614,9 +614,7 @@ int tracing_is_enabled(void)
  * to not have to wait for all that output. Anyway this can be
  * boot time and run time configurable.
  */
-#define TRACE_BUF_SIZE_DEFAULT	1441792UL /* 16384 * 88 (sizeof(entry)) */
-
-static unsigned long		trace_buf_size = TRACE_BUF_SIZE_DEFAULT;
+static unsigned long		trace_buf_size = CONFIG_GLOBAL_TRACE_BUF_SIZE;
 
 /* trace_types holds a link list of available tracers. */
 static struct tracer		*trace_types __read_mostly;
-- 
2.15.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ