All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Patch 1/2] ksym_tracer:Fix line-wrapping after removal of ksym tracer entry
Date: Wed, 17 Jun 2009 07:06:07 +0200	[thread overview]
Message-ID: <20090617050605.GC7411@nowhere> (raw)
In-Reply-To: <20090616230504.GB14753@in.ibm.com>

On Wed, Jun 17, 2009 at 04:35:04AM +0530, K.Prasad wrote:
> Removal of a ksym entry results in missing information and an early return with
> TRACE_TYPE_PARTIAL_LINE code (minus the line return). This patch modifies the
> output function to unconditionally add a line return irrespective of the
> return code. 
> 
> Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
> ---
>  kernel/trace/trace_ksym.c |   27 +++++++++++++++------------
>  1 file changed, 15 insertions(+), 12 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
> @@ -391,29 +391,32 @@ static enum print_line_t ksym_trace_outp
>  
>  	ret = trace_seq_printf(s, "%-15s %-5d %-3d %-20s ", field->p_name,
>  				entry->pid, iter->cpu, field->ksym_name);
> -	if (!ret)
> -		return TRACE_TYPE_PARTIAL_LINE;
> +	if (!ret) {
> +		ret = TRACE_TYPE_PARTIAL_LINE;
> +		goto err_ret;
> +	}
>  
> +	ret = TRACE_TYPE_PARTIAL_LINE;
>  	switch (field->ksym_hbp->info.type) {
>  	case HW_BREAKPOINT_WRITE:
> -		ret = trace_seq_printf(s, " W  ");
> +		if (!trace_seq_printf(s, " W  "))
> +			goto err_ret;
>  		break;
>  	case HW_BREAKPOINT_RW:
> -		ret = trace_seq_printf(s, " RW ");
> +		if (!trace_seq_printf(s, " RW  "))
> +			goto err_ret;
>  		break;
>  	default:
> -		return TRACE_TYPE_PARTIAL_LINE;
> +		goto err_ret;
>  	}
>  
> -	if (!ret)
> -		return TRACE_TYPE_PARTIAL_LINE;
> -
>  	sprint_symbol(str, field->ip);
>  	ret = trace_seq_printf(s, "%-20s\n", str);
> -	if (!ret)
> -		return TRACE_TYPE_PARTIAL_LINE;
> -
> -	return TRACE_TYPE_HANDLED;
> +	if (ret)
> +		return TRACE_TYPE_HANDLED;
> +err_ret:
> +	trace_seq_printf(s, "\n");
> +	return ret;


As told in my email just before, TRACE_TYPE_PARTIAL_LINE
won't print a truncated line or a partial line. Instead, it
will be ignored and entirely retried later.
Then your newline will be ignored.

..unless we have a bug in trace.c

I'm not sure what it the origin of the concatenated printed entries
Ingo has reported.

Did you reproduce it and then this patch fixed it?



>  }
>  
>  struct tracer ksym_tracer __read_mostly =
> 


  reply	other threads:[~2009-06-17  5:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090616225257.041883212@prasadkr_t60p.in.ibm.com>
2009-06-16 23:05 ` [Patch 1/2] ksym_tracer:Fix line-wrapping after removal of ksym tracer entry K.Prasad
2009-06-17  5:06   ` Frederic Weisbecker [this message]
2009-06-18  8:38     ` K.Prasad
2009-06-19  3:19       ` Frederic Weisbecker
2009-06-16 23:05 ` [Patch 2/2] ksym_tracer:Handle machine stall when cat trace_pipe for ksym tracer K.Prasad
2009-06-17  5:12   ` Frederic Weisbecker
2009-06-18 17:25     ` K.Prasad
2009-06-19  3:30       ` Frederic Weisbecker
2009-06-19  5:36         ` K.Prasad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090617050605.GC7411@nowhere \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=prasad@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.