From: Sean Anderson <sean.anderson@linux.dev>
To: Steven Rostedt <rostedt@goodmis.org>,
Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH] libtraceevent: Have sizeof() parsing handle u8/s8 through u64/s64
Date: Thu, 17 Oct 2024 11:27:27 -0400 [thread overview]
Message-ID: <908e7b5f-5f9e-4ece-b000-cf88bfc0d0c3@linux.dev> (raw)
In-Reply-To: <20241011154801.6e237662@gandalf.local.home>
On 10/11/24 15:48, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> The sizeof() may be used for common types like:
>
> __u8, __s8, u8, s8,
> __u16, __s16, u16, s16,
> __u32, __s32, u32, s32,
> __u64, __s64, u64, s64
>
> Handle them.
>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> src/event-parse.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> 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, "__8") == 0 || strcmp(token, "s8") == 0) {
> + arg->atom.atom = strdup("1");
> +
> } else if (strcmp(token, "REC") == 0) {
>
> free_token(token);
Reviewed-by: Sean Anderson <sean.anderson@linux.dev>
Tested-by: Sean Anderson <sean.anderson@linux.dev>
prev parent reply other threads:[~2024-10-17 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 19:48 [PATCH] libtraceevent: Have sizeof() parsing handle u8/s8 through u64/s64 Steven Rostedt
2024-10-17 15:27 ` 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=908e7b5f-5f9e-4ece-b000-cf88bfc0d0c3@linux.dev \
--to=sean.anderson@linux.dev \
--cc=linux-trace-devel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).