mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Javi Merino <javi.merino@arm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Dave P Martin <Dave.Martin@arm.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [RESEND PATCH v2 1/2] tracing: Add array printing helpers
Date: Fri, 16 Jan 2015 08:30:49 -0500	[thread overview]
Message-ID: <20150116083049.706f8f16@grimm.local.home> (raw)
In-Reply-To: <20150116101413.GA2898@e104805>

On Fri, 16 Jan 2015 10:14:14 +0000
Javi Merino <javi.merino@arm.com> wrote:


> > BUG() is a bit extreme don't you think? I'm not sure it even
> > deserves a WARN_ON().
> 
> Ok, I used BUG() because that's what you suggested:
> 
> http://article.gmane.org/gmane.linux.kernel/1846749
> 

Whoever suggested that was an idiot ;-)

I know why I suggested that but looking at it again with a clearer head
I think it's better not to bug, or even warn. It's on the output side,
for some reason I was thinking it was on the input (saving to buffer)
side.

> The only way I could think of turning it into a BUILD_BUG was by
> moving it to the __print_array macro, but I think it's ugly.

BUILD_BUG is probably better even if it is ugly. But for now, as this
is only to output the data not to save it, printing is better.

> 
> > I would suggest doing:
> > 
> > 			trace_seq_printf(p, "BAD SIZE:%d 0x%x",
> > el_size, *(u8 *)ptr);
> > 			el_size = 8;
> > 
> > No need to go crashing the kernel or even messing with dmesg over
> > somebody's tracepoint mistake.
> 
> Ok, I'll change it to that.
> 
> > The rest looks fine.
> > 
> > > +		}
> > > +		prefix = ",";
> > > +		ptr += el_size / 8;
> > > +	}
> > > +
> > > +	trace_seq_putc(p, '}');
> > > +	trace_seq_putc(p, 0);
> > 
> > I need to add a trace_seq_terminate() for this.
> 
> That would make it more readable.  Cheers,

It's on my todo list :-)

Thanks!

-- Steve


      reply	other threads:[~2015-01-16 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 16:50 Javi Merino
2015-01-15 16:50 ` [RESEND PATCH v2 2/2] tools lib traceevent: Add support for __print_array() Javi Merino
2015-01-16  2:35   ` Steven Rostedt
2015-01-16 11:18     ` Javi Merino
2015-01-16  2:22 ` [RESEND PATCH v2 1/2] tracing: Add array printing helpers Steven Rostedt
2015-01-16 10:14   ` Javi Merino
2015-01-16 13:30     ` Steven Rostedt [this message]

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=20150116083049.706f8f16@grimm.local.home \
    --to=rostedt@goodmis.org \
    --cc=Dave.Martin@arm.com \
    --cc=javi.merino@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®