Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755391AbYKUNOa (ORCPT ); Fri, 21 Nov 2008 08:14:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752110AbYKUNOW (ORCPT ); Fri, 21 Nov 2008 08:14:22 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:51173 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbYKUNOV (ORCPT ); Fri, 21 Nov 2008 08:14:21 -0500 Date: Fri, 21 Nov 2008 08:14:18 -0500 (EST) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Liming Wang cc: Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] function tracing: fix wrong position computing of stack_trace In-Reply-To: <1227236418-6023-2-git-send-email-liming.wang@windriver.com> Message-ID: References: <1227236418-6023-1-git-send-email-liming.wang@windriver.com> <1227236418-6023-2-git-send-email-liming.wang@windriver.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1345 Lines: 34 On Fri, 21 Nov 2008, Liming Wang wrote: > Impact: make output of stack_trace complete if buffer overflow > > When read buffer overflows, the output of stack_trace isn't complete. > > When printing records with seq_printf in t_show, if the read buffer > has overflowed by the current record, then this record won't be printed > to user space through read buffer, it will just be dropped in this printing. > > When next printing, t_start should return the "*pos"th record, which is the one > dropped by previous printing, but it just returns (m->private + *pos)th record. > > Here we use a more sane method to implement seq_operations which can be found > in kernel code. Thus we needn't initialize m->private. > > About testing, it's not easy to overflow read buffer, but we can use > seq_printf to print more padding bytes in t_show, then it's easy to check > whether or not records are lost. > > This commit has been tested on both condition of overflow and non overflow. > > Signed-off-by: Liming Wang Acked-by: Steven Rostedt -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/