[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3559cb54-b19a-4650-afc0-fcfb261dd876@linux.dev>
Date: Thu, 5 Sep 2024 12:59:50 -0400
From: Sean Anderson <sean.anderson@...ux.dev>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH v3] dma: Trace API
On 9/3/24 20:53, Steven Rostedt wrote:
> On Tue, 3 Sep 2024 10:36:29 -0400
> Sean Anderson <sean.anderson@...ux.dev> wrote:
>
>> This doesn't apply for arrays:
>>
>> field:__data_loc u64[] addrs; offset:12; size:4; signed:0;
>>
>> Here the size is not for the data type but for the array. And so the
>> type is parsed by process_sizeof in src/event-parse.c.
>
> Ah, I see what you are talking about:
>
> + TP_printk("%s dir=%s phys_addrs=%s attrs=%s",
> + __get_str(device),
> + decode_dma_data_direction(__entry->dir),
> + __print_array(__get_dynamic_array(addrs),
> + __get_dynamic_array_len(addrs) /
> + sizeof(unsigned long long), sizeof(unsigned long long)),
> + decode_dma_attrs(__entry->attrs))
>
> That part.
>
> Yeah, the "sizeof()" parsing is somewhat of a hack. It would be trivial to
> add u64 and all the variants to that.
>
> This should do. I could get it into the next minor version.
>
> diff --git a/src/event-parse.c b/src/event-parse.c
> index ddeb3b9909c0..73563c8e9dea 100644
> --- a/src/event-parse.c
> +++ b/src/event-parse.c
> @@ -3571,6 +3571,23 @@ process_sizeof(struct tep_event *event, struct tep_print_arg *arg, char **tok)
> /* The token is the next token */
> token_has_paren = true;
> }
> +
> + } else if (strcmp(token, "__u64") == 0 || strcmp(token, "u64") == 0 ||
> + strcmp(token, "__s64") == 0 || strcmp(token, "s64") == 0) {
> + arg->atom.atom = strdup("8");
> +
> + } else if (strcmp(token, "__u32") == 0 || strcmp(token, "u32") == 0 ||
> + strcmp(token, "__s32") == 0 || strcmp(token, "s32") == 0) {
> + arg->atom.atom = strdup("4");
> +
> + } else if (strcmp(token, "__u16") == 0 || strcmp(token, "u16") == 0 ||
> + strcmp(token, "__s16") == 0 || strcmp(token, "s16") == 0) {
> + arg->atom.atom = strdup("2");
> +
> + } else if (strcmp(token, "__u8") == 0 || strcmp(token, "u8") == 0 ||
> + strcmp(token, "__s8") == 0 || strcmp(token, "s8") == 0) {
> + arg->atom.atom = strdup("1");
> +
> } else if (strcmp(token, "REC") == 0) {
>
> free_token(token);
The above patch fixes the issue for me. Feel free to add
Tested-by: Sean Anderson <sean.anderson@...ux.dev>
when you send it.
--Sean
Powered by blists - more mailing lists