From: Steven Rostedt <rostedt@goodmis.org>
To: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
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: Tue, 26 Nov 2019 14:51:01 -0500 [thread overview]
Message-ID: <20191126145101.1e6c4e43@gandalf.local.home> (raw)
In-Reply-To: <61e34d88-bbf7-a2ff-e983-64dc9be1a482@linux.intel.com>
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
next prev parent reply other threads:[~2019-11-26 19:51 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 [this message]
2019-11-27 10:56 ` Piotr Maziarz
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=20191126145101.1e6c4e43@gandalf.local.home \
--to=rostedt@goodmis.org \
--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=piotrx.maziarz@linux.intel.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®