From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F37B1C43381 for ; Wed, 13 Mar 2019 13:47:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDAAA2171F for ; Wed, 13 Mar 2019 13:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726698AbfCMNrE (ORCPT ); Wed, 13 Mar 2019 09:47:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:52518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbfCMNrD (ORCPT ); Wed, 13 Mar 2019 09:47:03 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A239A2087C; Wed, 13 Mar 2019 13:47:02 +0000 (UTC) Date: Wed, 13 Mar 2019 09:47:01 -0400 From: Steven Rostedt To: Douglas Anderson Cc: Ingo Molnar , Jason Wessel , Daniel Thompson , kgdb-bugreport@lists.sourceforge.net, Brian Norris , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] tracing: kdb: Allow ftdump to skip all but the last few lines Message-ID: <20190313094701.06b4e93d@gandalf.local.home> In-Reply-To: <20190312232528.4fa0b806@oasis.local.home> References: <20190308193205.213659-1-dianders@chromium.org> <20190308193205.213659-2-dianders@chromium.org> <20190312232528.4fa0b806@oasis.local.home> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Mar 2019 23:25:28 -0400 Steven Rostedt wrote: > On Fri, 8 Mar 2019 11:32:05 -0800 > Douglas Anderson wrote: > > > The 'ftdump' command in kdb is currently a bit of a last resort, at > > least if you have lots of traces turned on. It's going to print a > > whole boatload of lines out your serial port which is probably running > > at 115200. This could easily take many, many minutes. > > > > Usually you're most interested in what's at the _end_ of the ftrace > > buffer, AKA what happened most recently. That means you've got to > > wait the full time for the dump. The 'ftdump' command does attempt to > > help you a little bit by allowing you to skip a fixed number of lines. > > Unfortunately it provides no way for you to know how many lines you > > should skip. > > > > Let's do similar to python and allow you to use a negative number to > > indicate that you want to skip all lines except the last few. This > > allows you to quickly see what you want. > > Why not just read how many entries are in the ring buffer and return that? > > cnt = 0; > for_each_cpu(cpu, tr->tracing_cpumask) > cnt += ring_buffer_entries_cpu(tr->trace_buffer, cpu); > return cnt; > > The output will print out one entry per line. > Note, I pulled in patch 1 into my queue. So you only need to resend this patch. -- Steve