Received: by 10.223.164.202 with SMTP id h10csp206155wrb; Mon, 13 Nov 2017 05:15:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMYMEKUPRUazs5KKdYQELV22Q7sOyGBFhzYptPkwAwBcLh6MpRG0W7wI/w2rY/g3/K3b2I/K X-Received: by 10.101.71.132 with SMTP id e4mr8505553pgs.206.1510578938322; Mon, 13 Nov 2017 05:15:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510578938; cv=none; d=google.com; s=arc-20160816; b=W48faz/9k1nSL3sHcwmKGkllqsdfkY+s7LCr7GYT+hq53h1SKXjf5nizVhjyxXMeLL R7aJ01M63B3LSljnRDMsNBVuSvPKYdhobHoZoYa+KhZjzELkY2Rdk1G3byGVxASkQ5rA AKNZywJXB9wrHM3lkeFSSBWOW0I0NzyE/eOqVX56g4tYN3oO4TNOYFnJI5S4adBopyBZ zekaOAP4SyUnLLiT/p070f+JjTuLA3rfdgxxPXMQ0I+qf6I4z1f+06dtnk8V7VG5PVMp UIloo4Rymw9uf78xJBILW1cG3E3KhfAYQfuP/tS2PPutzUIaxzFHP/Bz3d9SOg/ODHYo S05Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+IQTVgVyTVUHmUg9BDipCYVswFiYy7WMrEXv7xEHxhQ=; b=WKpM4soVAc8a6y8utFyssX4MnDVAkhZl6iDqIo0JGQq+AJQgwfcHzT3W+Yjc/Cnl8H FygUYFtE7S95zTYBBUTJjV/BowBrZo2MyEjSvspd+cw3CIHemZDHro5NBeHCWNfOiPCf PKwb0iIlZlx+BXy/444Qg/ioJuupoyo0LrpllziVLZTMKXEU/SLLwDFkqlgcnOhlbwbT Z95gMEq6JXaTjAzQ0QnsxyyiSRVxcazsQx0cpSHCMp7i/Y2bt1WBVS7fjz7U2hj2Ia1S CTAzxploTgjGR/Z3Fs5sBADI8syF2HT96ZZrEQj/NqDnA3eOknDtMIs5LUnsrp6AmpJT msdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si14417464pli.472.2017.11.13.05.15.25; Mon, 13 Nov 2017 05:15:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754837AbdKMNNk (ORCPT + 95 others); Mon, 13 Nov 2017 08:13:40 -0500 Received: from mail.fireflyinternet.com ([109.228.58.192]:62611 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752638AbdKMNNi (ORCPT ); Mon, 13 Nov 2017 08:13:38 -0500 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 9574312-1500050 for multiple; Mon, 13 Nov 2017 13:07:27 +0000 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Mon, 13 Nov 2017 13:07:17 +0000 From: Chris Wilson To: linux-kernel@vger.kernel.org Cc: intel-gfx@lists.freedesktop.org, Chris Wilson , Steven Rostedt , Peter Zijlstra , Ingo Molnar , Tomi Sarvela , Joonas Lahtinen , Daniel Vetter Subject: [PATCH] ftrace: Allow configuring global trace buffer size (for dump-on-oops) Date: Mon, 13 Nov 2017 13:07:08 +0000 Message-Id: <20171113130708.17790-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.15.0 X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Steven Rostedt Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Tomi Sarvela Cc: Joonas Lahtinen Cc: Daniel Vetter --- 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 From 1584052638603460814@xxx Tue Nov 14 14:38:37 +0000 2017 X-GM-THRID: 1584052638603460814 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread