Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754790AbZFTD5q (ORCPT ); Fri, 19 Jun 2009 23:57:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752180AbZFTD5h (ORCPT ); Fri, 19 Jun 2009 23:57:37 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:51776 "EHLO e23smtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbZFTD5h (ORCPT ); Fri, 19 Jun 2009 23:57:37 -0400 Date: Sat, 20 Jun 2009 09:27:25 +0530 From: "K.Prasad" To: Frederic Weisbecker Cc: Ingo Molnar , Linux Kernel Mailing List Subject: Re: [Patch 1/3] ksym_tracer: Eliminate trace concatenation and machine stall issues post removal Message-ID: <20090620035725.GA5540@in.ibm.com> Reply-To: prasad@linux.vnet.ibm.com References: <20090619172035.443923337@prasadkr_t60p.in.ibm.com> <20090619172453.GB26071@in.ibm.com> <20090619230348.GA4700@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090619230348.GA4700@nowhere> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2813 Lines: 67 On Sat, Jun 20, 2009 at 01:03:49AM +0200, Frederic Weisbecker wrote: > On Fri, Jun 19, 2009 at 10:54:53PM +0530, K.Prasad wrote: > > This patch fixes two issues reported with ksym tracer, seen after > > removal of a symbol from the tracer i) Concatenation of trace logs > > into a single line ii) Machine stall seen when logs are viewed > > using 'trace_pipe'. > > > > Known issue: Upon removal, 'cat trace_pipe' (without any preceding > > command and any further output in the trace buffer) responds to > > SIGTERM quickly but only after an indeterminate amount of delay > > for SIGINT. > > > > Signed-off-by: K.Prasad > > --- > > kernel/trace/trace.h | 12 +++++++++--- > > kernel/trace/trace_ksym.c | 11 ++++------- > > 2 files changed, 13 insertions(+), 10 deletions(-) > > > > Index: linux-2.6-tip.hbkpt/kernel/trace/trace_ksym.c > > =================================================================== > > --- linux-2.6-tip.hbkpt.orig/kernel/trace/trace_ksym.c > > +++ linux-2.6-tip.hbkpt/kernel/trace/trace_ksym.c > > @@ -71,7 +71,7 @@ void ksym_hbp_handler(struct hw_breakpoi > > { > > struct ring_buffer_event *event; > > struct trace_array *tr; > > - struct trace_ksym *entry; > > + struct trace_ksym_rb *entry; > > int pc; > > > > if (!ksym_tracing_enabled) > > @@ -87,7 +87,7 @@ void ksym_hbp_handler(struct hw_breakpoi > > > > entry = ring_buffer_event_data(event); > > strlcpy(entry->ksym_name, hbp->info.name, KSYM_SYMBOL_LEN); > > - entry->ksym_hbp = hbp; > > + memcpy(&(entry->ksym_hbp), hbp, sizeof(struct hw_breakpoint)); > > > That looks wasteful. You only need the type from the arch_hw_breakpoint > and there you copy the whole generic breakpoint. > > Frederic. > Well, the entire copy operation for ksym_name and p_name is indeed a much bigger waste (KSYM_SYMBOL_LEN and TASK_COMM_LEN bytes respetively) and the breakpoint structure size is tiny in comparison. The type information is an arch-specific field and it encapsulated within 'struct hw_breakpoint'. In any case this solution needs improvement more in terms of getting the tracer infrastructure to identify stale entries (belonging to removed symbols) and prevent their display. The existing trace logs contain huge redundant information due to multiple copies of the same data and it would yield much better results than such trivial optimisations. The ksym_tracer, I believe, has just unearthed the opportunity for the same as it is (is it?) the first such ftrace plugin to partially remove entries. Thanks, K.Prasad -- 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/