From: Sean Anderson <sean.anderson@linux.dev>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v3] dma: Trace API
Date: Thu, 5 Sep 2024 12:59:50 -0400 [thread overview]
Message-ID: <3559cb54-b19a-4650-afc0-fcfb261dd876@linux.dev> (raw)
In-Reply-To: <20240903205322.69d7638c@gandalf.local.home>
On 9/3/24 20:53, Steven Rostedt wrote:
> On Tue, 3 Sep 2024 10:36:29 -0400
> Sean Anderson <sean.anderson@linux.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@linux.dev>
when you send it.
--Sean
prev parent reply other threads:[~2024-09-05 17:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 20:32 Sean Anderson
2024-08-29 4:19 ` Christoph Hellwig
2024-08-29 14:24 ` Sean Anderson
2024-09-03 7:25 ` Christoph Hellwig
2024-09-03 13:21 ` Steven Rostedt
2024-09-03 14:36 ` Sean Anderson
2024-09-04 0:53 ` Steven Rostedt
2024-09-04 4:15 ` Christoph Hellwig
2024-09-05 17:00 ` Sean Anderson
2024-09-05 16:59 ` Sean Anderson [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=3559cb54-b19a-4650-afc0-fcfb261dd876@linux.dev \
--to=sean.anderson@linux.dev \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=robin.murphy@arm.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
Powered by JetHome