Re: [PATCH 4/7] tracing: timer: Add deferrable flag to timer_start

Ingo Molnar
2015-05-23T08:17:43Z

* Thomas Gleixner <tglx@linutronix.de> wrote:

> On Thu, 21 May 2015, Ingo Molnar wrote:
> > * John Stultz <john.stultz@linaro.org> wrote:
> > > - TP_PROTO(struct timer_list *timer, unsigned long expires),
> > > + TP_PROTO(struct timer_list *timer,
> > > + unsigned long expires,
> >
> > This isn't compat safe, should any tooling rely on this.
>
> I can't see how that matters. [...]

It's good practice for any user facing ABI to not be bit depende. We
it for (almost) all the syscall ABIs.

> [...] The binary trace tells you from which machine (32 or 64 bit)
> it comes. [...]

Yeah, tooling can almost always fix up a crappy interface, but that's
no good reason to not do it right in the first place. That's one of
the reasons why (most) network protocols and most filesystems don't
have a 'bitness' nor an 'endianness' field in their formats. It's a
fundamentally fragile concept ...

> [...] So the field size is available for the tool. If the tool
> blindly applies the format string, it's hardly a fault of the
> kernel. And there is no point to bloat 32bit tracing with 64bit
> entries just because some random tool might be stupid.

Yeah, in a perfect world and so we could define arbitrarily complex
interfaces and expect tooling to follow it.

In a not so perfect world we are conservative in defining our ABIs to
be as simple as possible and are liberal in accepting them, not the
other way around.

And it's not just about tooling - just to give a simple technical
example: parsing a partly corrupted file is a lot easier if there's no
dependency on some header area defining a 'bitness value' - you can
just take any part of the stream and eventually have robust decoding
even if you lost part of the stream.

Thanks,

Ingo