From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752571AbcF2BtJ (ORCPT ); Tue, 28 Jun 2016 21:49:09 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:48653 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbcF2BtH (ORCPT ); Tue, 28 Jun 2016 21:49:07 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 165.244.98.203 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org Date: Wed, 29 Jun 2016 10:49:03 +0900 From: Namhyung Kim To: Rabin Vincent CC: , Steven Rostedt , "linux-kernel@vger.kernel.org" , Minchan Kim Subject: Re: [QUESTION] Is there a better way to get ftrace dump on guest? Message-ID: <20160629014903.GB1628@sejong> References: <20160628062514.GA4674@danjae.aot.lge.com> <20160628164634.GA4202@debian> MIME-Version: 1.0 In-Reply-To: <20160628164634.GA4202@debian> User-Agent: Mutt/1.6.1 (2016-04-27) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/06/29 10:49:03, Serialize by Router on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/06/29 10:49:03, Serialize complete at 2016/06/29 10:49:03 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Jun 28, 2016 at 06:46:34PM +0200, Rabin Vincent wrote: > On Tue, Jun 28, 2016 at 03:33:18PM +0900, Namhyung Kim wrote: > > On Tue, Jun 28, 2016 at 3:25 PM, Namhyung Kim wrote: > > > I'm running some guest machines for kernel development. For debugging > > > purpose, I use lots of trace_printk() since it's faster than normal > > > printk(). When kernel crash happens the trace buffer is printed on > > > console (I set ftrace_dump_on_oops) but it takes too much time. I > > > don't want to reduce the size of ring buffer as I want to collect the > > > debug info as much as possible. And I also want to see trace from all > > > cpu so 'ftrace_dump_on_oop = 2' is not an option. > > > > > > I know the kexec/kdump (and the crash tool) can dump and analyze the > > > trace buffer later. But it's cumbersome to do it everytime and more > > > importantly, I don't want to spend the memory for the crashkernel. > > Assuming you're using QEMU: > > QEMU has a dump-guest-memory command which can be used to dump the > guest's entire memory to an ELF which can be loaded by the crash utility > to extract the trace buffer. This doesn't require kexec/kdump or any > other support from the guest kernel. Thanks for the info. Not requiring kexec/kdump step is a big win for me. Although I mostly use kvmtool (lkvm), I'll give it a try. > > It's apparently even possible to run QEMU with the guest memory in a > file and load that to crash directly, although this is not something > I've had a chance to try out myself: > > https://github.com/crash-utility/crash/commit/89ed9d0a7f7da4578294a492c1ad857244ce7352 Interesting, I'll take a look but wouldn't it impact the performance? And even if the crash tool is good, it'd be great if I can work without it (if possible). Thanks, Namhyung