Re: [PATCH 3/3] tools/lib/traceevent: Implement new traceevent APIs for accessing struct tep_handler fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 21, 2019 at 9:46 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Wed, 20 Mar 2019 16:32:25 +0000
> Matt Helsley <mhelsley@xxxxxxxxxx> wrote:
>
> > >                                 unsigned long long *addrp, char **modp);
> > > -void tep_set_flag(struct tep_handle *tep, int flag);
> > > +void tep_set_flag(struct tep_handle *tep, enum tep_flag flag);
> > > +void tep_reset_flag(struct tep_handle *tep, enum tep_flag flag);
> > > +int tep_check_flag(struct tep_handle *tep, enum tep_flag flag);
> > >
> > > static inline int tep_host_bigendian(void)
> > > {
> >
> > Does another series rename this to: tep_is_host_bigendian() ?
>
> I've been looking at the API and I think we do need to make it more
> consistent. What we currently have is:
>
>
> > void tep_set_flag(struct tep_handle *tep, enum tep_flag flag);
> > void tep_reset_flag(struct tep_handle *tep, enum tep_flag flag);
>
> (I'll ignore parameters)
>
> Rename to: void tep_clear_flag()
>
> > int tep_check_flag(struct tep_handle *tep, enum tep_flag flag);
>
> Rename to: bool tep_test_flag()
>
>
> >
> > int tep_host_bigendian(void);
>
> Rename to: bool tep_is_bigendian()

Steven, int tep_host_bigendian(void) actually checks the endianness of
the host -
I think it makes sens "host" to be part of API's name. The other one:
int tep_is_host_bigendian(struct tep_handle *pevent) checks the
endianness stored
in the tep_handle, I think we should remove "host" from its name.

>
> (Break from the confusion to what a "host" is)
>
> >
> > int tep_set_function_resolver(struct tep_handle *pevent,
> >                             tep_func_resolver_t *func, void *priv);
> > void tep_reset_function_resolver(struct tep_handle *pevent);
> > int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid);
> > int tep_override_comm(struct tep_handle *pevent, const char *comm, int pid);
> > int tep_register_trace_clock(struct tep_handle *pevent, const char *trace_clock);
> > int tep_register_function(struct tep_handle *pevent, char *name,
> >                         unsigned long long addr, char *mod);
> > int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
> >                             unsigned long long addr);
> > int tep_pid_is_registered(struct tep_handle *pevent, int pid);
>
> Rename to: bool tep_is_pid_registered()
>
>
> >
> > int tep_get_cpus(struct tep_handle *pevent);
> > void tep_set_cpus(struct tep_handle *pevent, int cpus);
> > int tep_get_long_size(struct tep_handle *pevent);
> > void tep_set_long_size(struct tep_handle *pevent, int long_size);
> > int tep_get_page_size(struct tep_handle *pevent);
> > void tep_set_page_size(struct tep_handle *pevent, int _page_size);
> > int tep_file_bigendian(struct tep_handle *pevent);
>
> Rename to: bool tep_is_file_bigendian()
>
> > void tep_set_file_bigendian(struct tep_handle *pevent, enum tep_endian endian);
> > int tep_is_host_bigendian(struct tep_handle *pevent);
>
> Rename to: bool tep_is_host_bigendian()
>
> > void tep_set_host_bigendian(struct tep_handle *pevent, enum tep_endian endian);
> > int tep_is_latency_format(struct tep_handle *pevent);
>
> Rename to: bool tep_is_latency_format()
>
> > void tep_set_latency_format(struct tep_handle *pevent, int lat);
> > int tep_get_header_page_size(struct tep_handle *pevent);
> > void tep_set_parsing_failures(struct tep_handle *tep, int parsing_failures);
> > int tep_get_parsing_failures(struct tep_handle *tep);
> > int tep_get_header_page_ts_size(struct tep_handle *tep);
>
> Rename to: int tep_get_header_timestamp_size()
>
> > int tep_is_old_format(struct tep_handle *pevent);
>
> Rename to: bool tep_is_old_format()
>
> These changes may need to be broken up into separate patches.
>
> -- Steve



-- 

Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux