From: Yordan Karadzhov <y.karadz@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [RFC PATCH] libtraceevent: Add tep_print_selected_fields()
Date: Tue, 3 Aug 2021 15:42:02 +0300 [thread overview]
Message-ID: <75f05e4c-49bb-a2d9-cdae-58d801e58179@gmail.com> (raw)
In-Reply-To: <20210802122933.1873b6f8@oasis.local.home>
On 2.08.21 г. 19:29, Steven Rostedt wrote:
> What I was talking about is to change tep_print_field() to do something like:
>
> Take the current tep_print_field() and turn it into static _tep_print_field().
>
> [ Not even compiled tested ]
>
Hi Steven,
I am not able to make sense from the code below.
> void tep_print_field(struct trace_seq *s, void *data,
> struct tep_format_field *field)
> {
> struct tep_event = field->event;
> struct tep_print_parse = event->print_fmt.print_cache;
> struct tep_handle *tep = event->tep;
> unsigned int offset, len;
>
> if (event->flags & TEP_EVENT_FL_FAILED)
> goto out;
>
> if (field->flags & TEP_FIELD_IS_DYNAMIC)
> dynamic_offset(tep, field, data, &offset, &len);
>
> for (;parse; parse = parse->next) {
You need
if (!parse->arg)
continue;
> if (parse->type == PRINT_FMT_STRING)
> continue;
> if (parse->arg->type != TEP_PRINT_FIELD)
> continue;
I can't understand the idea of those two checks. I printed the values and they don't seem to have any selective power.
> if (parse->arg->field.field->field != field)
> continue;
>
This does not compile. I guess you mean
if (parse->arg->field.field != field)
continue;
however "parse->arg->field.field" looks like unused memory (NULL or 0xffffffff) and this check always fails.
Maybe we must call some of the process_XXX()static functions first in order to make your new version of
tep_print_field() works?
Thanks!
Yordan
> print_parse_data(parse, s, data, size, event);
> return;
> }
>
> out:
> /* Not found */
>
next prev parent reply other threads:[~2021-08-03 12:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-02 11:27 [RFC PATCH] libtraceevent: Add tep_print_selected_fields() Yordan Karadzhov (VMware)
2021-08-02 11:39 ` Yordan Karadzhov
2021-08-02 16:30 ` Steven Rostedt
2021-08-02 16:29 ` Steven Rostedt
2021-08-03 12:42 ` Yordan Karadzhov [this message]
2021-08-03 13:48 ` 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=75f05e4c-49bb-a2d9-cdae-58d801e58179@gmail.com \
--to=y.karadz@gmail.com \
--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).