[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <80820d36-d372-ed46-3c86-9b7e0a722b81@linux.intel.com>
Date: Wed, 27 Nov 2019 11:56:37 +0100
From: Piotr Maziarz <piotrx.maziarz@...ux.intel.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, mingo@...hat.com,
andriy.shevchenko@...el.com, cezary.rojewski@...el.com,
gustaw.lewandowski@...el.com
Subject: Re: [PATCH v2 2/2] tracing: Use seq_buf_hex_dump() to dump buffers
On 2019-11-26 20:51, Steven Rostedt wrote:
> On Tue, 26 Nov 2019 15:53:26 +0100
> Piotr Maziarz <piotrx.maziarz@...ux.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
Powered by blists - more mailing lists