mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
	andriy.shevchenko@intel.com, cezary.rojewski@intel.com,
	gustaw.lewandowski@intel.com
Subject: Re: [PATCH v2 2/2] tracing: Use seq_buf_hex_dump() to dump buffers
Date: Wed, 27 Nov 2019 11:56:37 +0100	[thread overview]
Message-ID: <80820d36-d372-ed46-3c86-9b7e0a722b81@linux.intel.com> (raw)
In-Reply-To: <20191126145101.1e6c4e43@gandalf.local.home>

On 2019-11-26 20:51, Steven Rostedt wrote:
> On Tue, 26 Nov 2019 15:53:26 +0100
> Piotr Maziarz <piotrx.maziarz@linux.intel.com> wrote:
>> Hello Steven,
>>
>> I'm writing handle in event-parse and I came across some technical
>> problems. I have an event which print function looks like that:
>> TP_printk("%s",
>> 	  __print_hex_dump("", DUMP_PREFIX_OFFSET, 16, 4,
>> 			   __get_dynamic_array(buf),
>> 			   __get_dynamic_array_len(buf), false))
>> It works properly when printing events to debugfs.
>> I'm testing my implementation with trace-cmd and it has problem with
>> parsing DUMP_PREFIX_OFFSET and false (I'm using
>> alloc_and_process_delim()). Instead of having numerical values
>> tep_print_args are of type TEP_PRINT_ATOM and have char array
>> "DUMP_PREFIX_OFFSET" or "true".
>> Am I doing something incorrect? Parsing it this way is problematic
>> because instead of false someone may use 0 or logic expression. And
>> writing it to support all possible scenarios may be tedious and prone to
>> errors.
> 
> You can force the enum to be a number by including the following in the
> trace event header:
> 
> TRACE_DEFINE_ENUM(DUMP_PREFIX_OFFSET);
> TRACE_DEFINE_ENUM(DUMP_PREFIX_ADDRESS);
> TRACE_DEFINE_ENUM(DUMP_PREFIX_NONE);
> 
> and the format files will convert these to their actual numbers when
> displaying it to user space.
> 
> -- Steve
> 
Thanks, that's what I was looking for.

Best regards,
Piotr Maziarz

  reply	other threads:[~2019-11-27 10:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07 12:45 [PATCH v2 1/2] seq_buf: Add printing formatted hex dumps Piotr Maziarz
2019-11-07 12:45 ` [PATCH v2 2/2] tracing: Use seq_buf_hex_dump() to dump buffers Piotr Maziarz
2019-11-13 21:09   ` Steven Rostedt
2019-11-26 14:53     ` Piotr Maziarz
2019-11-26 19:51       ` Steven Rostedt
2019-11-27 10:56         ` Piotr Maziarz [this message]
2019-11-13 21:02 ` [PATCH v2 1/2] seq_buf: Add printing formatted hex dumps Steven Rostedt
2019-11-14  8:00   ` Cezary Rojewski
2019-11-14 14:35     ` 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=80820d36-d372-ed46-3c86-9b7e0a722b81@linux.intel.com \
    --to=piotrx.maziarz@linux.intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=cezary.rojewski@intel.com \
    --cc=gustaw.lewandowski@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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

all inboxes | Powered by JetHome®