* tep_*host_bigendian()
@ 2018-11-08 18:30 Steven Rostedt
2018-11-08 19:40 ` tep_*host_bigendian() Tzvetomir Stoyanov
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2018-11-08 18:30 UTC (permalink / raw)
To: Tzvetomir Stoyanov, Linux Trace Devel
Hi Tzvetomir,
I was looking at the code for tep_is_file_bigendian(),
tep_is_host_bigendian() and tep_host_bigendian().
The tep_host_bigendian() checks if the current machine that is
executing is bigendian or not.
tep_is_host_bigendian() looks at the pevent to see what it has, which
should be the same as tep_host_bigendian().
tep_is_file_bigendian() is if the raw file format is bigendian or not.
If the file does not mach the host, byte swapping needs to be made.
Looking at this deeper, I think the names are backwards.
Let's rename tep_host_bigendian() to tep_is_host_bigendian()
rename tep_is_host_bigendian() to tep_host_bigendian()
rename tep_is_file_bigendian() to tep_file_bigendian()
The "is_host" to me sounds more like we are testing the actual host,
where as just saying 'tep_host_bigendian' sounds to me that it's what
the pevent has the host set as.
-- Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: tep_*host_bigendian()
2018-11-08 18:30 tep_*host_bigendian() Steven Rostedt
@ 2018-11-08 19:40 ` Tzvetomir Stoyanov
2018-11-08 22:23 ` tep_*host_bigendian() Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Tzvetomir Stoyanov @ 2018-11-08 19:40 UTC (permalink / raw)
To: rostedt@goodmis.org; +Cc: linux-trace-devel@vger.kernel.org
Hi Steven,
Ok, I''ll rename tep_is_file_bigendian() to tep_file_bigendian().
But about tep_is_host_bigendian() - I think it makes sense to remove completely
tep_is_host_bigendian() / tep_set_host_bigendian() APIs, what do you think ?
The tep_set_host_bigendian() API is used only in perf code, to set the
order in tep handler - and it uses tep_host_bigendian() to get the
local host byte order.
I think it is safe to the remove tep_set_host_bigendian() API and
replace tep_is_host_bigendian() with tep_host_bigendian().
On Thu, Nov 8, 2018 at 8:30 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> Hi Tzvetomir,
>
> I was looking at the code for tep_is_file_bigendian(),
> tep_is_host_bigendian() and tep_host_bigendian().
>
> The tep_host_bigendian() checks if the current machine that is
> executing is bigendian or not.
>
> tep_is_host_bigendian() looks at the pevent to see what it has, which
> should be the same as tep_host_bigendian().
>
> tep_is_file_bigendian() is if the raw file format is bigendian or not.
> If the file does not mach the host, byte swapping needs to be made.
>
> Looking at this deeper, I think the names are backwards.
>
> Let's rename tep_host_bigendian() to tep_is_host_bigendian()
> rename tep_is_host_bigendian() to tep_host_bigendian()
> rename tep_is_file_bigendian() to tep_file_bigendian()
>
>
> The "is_host" to me sounds more like we are testing the actual host,
> where as just saying 'tep_host_bigendian' sounds to me that it's what
> the pevent has the host set as.
>
> -- Steve
--
--
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: tep_*host_bigendian()
2018-11-08 19:40 ` tep_*host_bigendian() Tzvetomir Stoyanov
@ 2018-11-08 22:23 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2018-11-08 22:23 UTC (permalink / raw)
To: Tzvetomir Stoyanov; +Cc: linux-trace-devel@vger.kernel.org
On Thu, 8 Nov 2018 19:40:32 +0000
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:
> Hi Steven,
> Ok, I''ll rename tep_is_file_bigendian() to tep_file_bigendian().
> But about tep_is_host_bigendian() - I think it makes sense to remove completely
> tep_is_host_bigendian() / tep_set_host_bigendian() APIs, what do you think ?
> The tep_set_host_bigendian() API is used only in perf code, to set the
> order in tep handler - and it uses tep_host_bigendian() to get the
> local host byte order.
> I think it is safe to the remove tep_set_host_bigendian() API and
> replace tep_is_host_bigendian() with tep_host_bigendian().
I'm fine with this, as long as we don't calculate the endianess each
time. We still need the tep->host_bigendian setting. But we can set it
when we allocate a tep handle.
-- Steve
>
> On Thu, Nov 8, 2018 at 8:30 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > Hi Tzvetomir,
> >
> > I was looking at the code for tep_is_file_bigendian(),
> > tep_is_host_bigendian() and tep_host_bigendian().
> >
> > The tep_host_bigendian() checks if the current machine that is
> > executing is bigendian or not.
> >
> > tep_is_host_bigendian() looks at the pevent to see what it has, which
> > should be the same as tep_host_bigendian().
> >
> > tep_is_file_bigendian() is if the raw file format is bigendian or not.
> > If the file does not mach the host, byte swapping needs to be made.
> >
> > Looking at this deeper, I think the names are backwards.
> >
> > Let's rename tep_host_bigendian() to tep_is_host_bigendian()
> > rename tep_is_host_bigendian() to tep_host_bigendian()
> > rename tep_is_file_bigendian() to tep_file_bigendian()
> >
> >
> > The "is_host" to me sounds more like we are testing the actual host,
> > where as just saying 'tep_host_bigendian' sounds to me that it's what
> > the pevent has the host set as.
> >
> > -- Steve
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-09 8:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-08 18:30 tep_*host_bigendian() Steven Rostedt
2018-11-08 19:40 ` tep_*host_bigendian() Tzvetomir Stoyanov
2018-11-08 22:23 ` tep_*host_bigendian() Steven Rostedt
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).