linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yordan Karadzhov <y.karadz@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v6 5/5] libtraceevent: Add tep_print_selected_fields()
Date: Fri, 20 Aug 2021 18:05:37 +0300	[thread overview]
Message-ID: <f4169550-33ec-46a0-ff25-3b05217d312b@gmail.com> (raw)
In-Reply-To: <20210820103510.6125dda1@oasis.local.home>



On 20.08.21 г. 17:35, Steven Rostedt wrote:
> On Fri, 20 Aug 2021 16:36:12 +0300
> Yordan Karadzhov <y.karadz@gmail.com> wrote:
> 		if (field_mask & ignore_mask)
>>>> +			continue;
>>>> +
>>>>    		trace_seq_printf(s, " %s=", field->name);
>>>>    		_tep_print_field(s, data, field, &parse);
>>>> -		field = field->next;
>>>>    	}
>>>>    }
>>>>    
>>>> +void tep_print_selected_fields(struct trace_seq *s, void *data,
>>>
>>> As the above is an API, it needs a kernel doc type comment, and also an
>>> addition to the man pages. The man page may be a separate patch.
>>>    
>>
>> I was thinking of maybe changing the second argument of the function to
>>
>> void tep_print_selected_fields(struct trace_seq *s,
>> 			       struct tep_record *record,
>> 			       struct tep_event *event,
>> 			       unsigned long long ignore_mask)
>>
>>
>>> -- Steve
>>>
>>>    
>>>> +			       struct tep_event *event,
>>>> +			       unsigned long long ignore_mask)
>>>> +{
>>>> +	print_selected_fields(s, data, event, ignore_mask);
>>
>> respectively here we will have
>>
>> 	print_selected_fields(s, record->data, event, ignore_mask);
>>>> +}
>>
>> This way the call will look cleaner.
>>
>> 	tep_print_selected_fields(s, record, event, mask);
>>
>> instead of
>>
>> 	tep_print_selected_fields(s, record->data, event, mask);
>>
>> But on the other hand, this will make the new API inconsistent with the existing
>> "tep_print_fields()" API bellow.
> 
> I think we rushed the libtraceevent APIs :-(
> 
> There's a lot of them I hate, and I agree, passing record would have made more sense.
> 
> I've been thinking of reworking a lot of them, but we need to add new APIs.
> 
> tep_print_record_fields()
> tep_print_record_selected_fields()


OK I can add those two.
Thanks!
Y.


> 
> ??
> 
> -- Steve
> 

  reply	other threads:[~2021-08-20 15:05 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
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 [this message]
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=f4169550-33ec-46a0-ff25-3b05217d312b@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).