linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v6 3/5] libtraceevent: Improve tep_print_field()
Date: Thu, 19 Aug 2021 12:48:09 -0400	[thread overview]
Message-ID: <20210819124809.6e789f1a@oasis.local.home> (raw)
In-Reply-To: <20210812085929.54832-4-y.karadz@gmail.com>

On Thu, 12 Aug 2021 11:59:27 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> The existing method tep_print_fields() gets upgraded to use the
> printing formats provided by the tokens.
> 
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
> ---
>  src/event-parse.c | 115 +++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 87 insertions(+), 28 deletions(-)
> 
> diff --git a/src/event-parse.c b/src/event-parse.c
> index 02ec677..ff7337f 100644
> --- a/src/event-parse.c
> +++ b/src/event-parse.c
> @@ -3913,7 +3913,6 @@ eval_num_arg(void *data, int size, struct tep_event *event, struct tep_print_arg
>  			arg->field.field = tep_find_any_field(event, arg->field.name);
>  			if (!arg->field.field)
>  				goto out_warning_field;
> -			
>  		}
>  		/* must be a number */
>  		val = tep_read_number(tep, data + arg->field.field->offset,
> @@ -5326,8 +5325,8 @@ static int is_printable_array(char *p, unsigned int len)
>  	return 1;
>  }
>  
> -void tep_print_field(struct trace_seq *s, void *data,
> -		     struct tep_format_field *field)
> +static void tep_print_field_raw(struct trace_seq *s, void *data,
> +			     struct tep_format_field *field)

As this is static, lets call it just "print_field_raw()" as the "tep_"
prefix should be reserved for the API only.

We may need to clean up any existing static function that start with
"tep_", but that can be a separate patch (if any exist, I haven't
looked). But let's not add new ones.

-- Steve



>  {
>  	struct tep_handle *tep = field->event->tep;
>  	unsigned int offset, len, i;
> @@ -5389,6 +5388,56 @@ void tep_print_field(struct trace_seq *s, void *data,
>  	}
>  }
>  
> +static int print_parse_data(struct tep_print_parse *parse, struct trace_seq *s,
> +			    void *data, int size, struct tep_event *event);
> +
> +void tep_print_field(struct trace_seq *s, void *data,
> +		     struct tep_format_field *field)
> +{
> +	struct tep_event *event = field->event;
> +	struct tep_print_parse *parse;
> +	bool has_0x;
> +
> +

  reply	other threads:[~2021-08-19 16:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12  8:59 [PATCH v6 0/5] libtraceevent: Optimize the print of tep fields Yordan Karadzhov (VMware)
2021-08-12  8:59 ` [PATCH v6 1/5] libtraceevent: Add dynamic_offset() Yordan Karadzhov (VMware)
2021-08-12  8:59 ` [PATCH v6 2/5] libtraceevent: Have all field args point to the field they represent Yordan Karadzhov (VMware)
2021-08-12  8:59 ` [PATCH v6 3/5] libtraceevent: Improve tep_print_field() Yordan Karadzhov (VMware)
2021-08-19 16:48   ` Steven Rostedt [this message]
2021-08-12  8:59 ` [PATCH v6 4/5] libtraceevent: Optimize tep_print_fields() Yordan Karadzhov (VMware)
2021-08-19 16:49   ` Steven Rostedt
2021-08-12  8:59 ` [PATCH v6 5/5] libtraceevent: Add tep_print_selected_fields() Yordan Karadzhov (VMware)
2021-08-19 16:55   ` Steven Rostedt
2021-08-20 13:36     ` Yordan Karadzhov
2021-08-20 14:35       ` Steven Rostedt
2021-08-20 15:05         ` Yordan Karadzhov
2021-08-20 16:01           ` 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=20210819124809.6e789f1a@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=y.karadz@gmail.com \
    /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).