mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Ingo Molnar <mingo@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] tools lib traceevent: Use helper trace-seq in print functions like kernel does
Date: Wed, 20 Nov 2013 14:27:49 +0100	[thread overview]
Message-ID: <20131120132749.GE1415@krava.brq.redhat.com> (raw)
In-Reply-To: <20131119182937.401668e3@gandalf.local.home>

On Tue, Nov 19, 2013 at 06:29:37PM -0500, Steven Rostedt wrote:
> Jiri Olso reported that his plugin for scsi was chopping off part of

s/Olso/Olsa/ 

;-)

> the output. Investigating this, I found that Jiri used the same
> functions as what is in the kernel, which adds the following:
> 
> 	trace_seq_putc(p, 0);
> 
> This adds a '\0' to the output string. The reason this works in the
> kernel is that the "p" that is passed to the function helper is a
> temporary trace_seq. But in the libtraceevent library, it's the pointer
> to the trace_seq used to output. By adding the '\0', it truncates the
> line and nothing added after that will be printed.
> 
> We can solve this in two ways. One is to have the helper functions for
> the library not add the unnecessary '\0'. The other is to change the
> library to also use a helper trace_seq structure that gets copied to
> the main trace_seq just like the kernel does.
> 
> The latter allows the helper functions in the plugins to be the same as
> the kernel, which is the better solution.
> 
> Reported-by: Jiri Olsa <jolsa@redhat.com>

Tested-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

  reply	other threads:[~2013-11-20 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 23:29 Steven Rostedt
2013-11-20 13:27 ` Jiri Olsa [this message]
2013-11-30 12:49 ` [tip:perf/core] " tip-bot for Steven Rostedt

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=20131120132749.GE1415@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@ghostprotocols.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome