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 Fri, Mar 22, 2019 at 2:16 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Fri, 22 Mar 2019 11:33:47 +0000
> Tzvetomir Stoyanov <tstoyanov@xxxxxxxxxx> wrote:
>
>
> > > >
> > > > 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.
> >
>
> I hate the word "host" here. Because what would you get if you run this
> on a guest? You get the "guest" endianess (which may possibly be not
> the same as the host (if emulated)).
>
>
> I want to keep this as "tep_is_bigendian()" as it doesn't take a
> parameter, and is obvious to what it is returning.
>
> > > > 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()
> > >
>
> Let's rename this to:
>
> void tep_set_local_bigendian()
> bool tep_is_local_bigendian()
>
> It can be argued that this could be for the above (test this machine),
> but since the "test this machine" doesn't take a parameter, but "test
> the pevent bigendian" does, I want it to be consistent with
> tep_is_file_bigendian(), which also takes a parameter.
>
>    bool tep_is_bigendian(void);
>    bool tep_is_file_bigendian(struct tep_handle *tep);
>    bool tep_is_local_bigendian(struct tep_handle *tep);
>
> seems more consistent than:
>
>    bool tep_is_local_bigendian(void);
>    bool tep_is_file_bigendian(struct tep_handle *tep);
>    bool tep_is_bigendian(struct tep_handle *tep);
>
> So lets go with the first one.
>
> Make sense?
>
> -- Steve

Yes, thanks Steven

-- 

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