LWN.net Logo

A perf ABI fix

A perf ABI fix

Posted Sep 24, 2013 20:12 UTC (Tue) by kugel (subscriber, #70540)
Parent article: A perf ABI fix

Why is the API break required? If the fields were not renamed from usr to user the same code would comopile under both.

As for keeping ABI compatible; can bit0 not still have the same buggy value that it has in the old code instead of always-zero?


(Log in to post comments)

A perf ABI fix

Posted Sep 24, 2013 20:50 UTC (Tue) by smurf (subscriber, #17840) [Link]

You need to check the _bit0* fields to determine the kernel's version of this interface, so you have to code for new struct anyway.

Old code would probably compile, but it shouldn't -- it should use the new API. The rename make sure of that.

A perf ABI fix

Posted Sep 24, 2013 20:55 UTC (Tue) by cuviper (subscriber, #56273) [Link]

Perhaps a decent compromise would have bit0 = (time && rdpmc). This way, old userspace can keep its full performance advantage when both bits really are true, but it will never have a misinterpretation when only one was supposed to be set.

A perf ABI fix

Posted Sep 24, 2013 21:16 UTC (Tue) by khim (subscriber, #9252) [Link]

Why is the API break required? If the fields were not renamed from usr to user the same code would comopile under both.

And that is exactly the problem: now you can have a code which can be compiled with old headers and new headers but which will only work if old headers are used. Not fun. It's much better to introduce explicit API breakage in such cases.

You see, API and ABI are different. APIs are used by programmers when they write programs and if they are changed (subtly or not so subtly) then the best way to communicate the problem is to introduce deliberate breakage (programmer will fix the problem or will use old version of headers), ABIs breakage is handled by the end-user (or system administrator who's only marginally more clueless then end-user) and they don't have any sane means of handling it. Instead they will just change random stuff around till the damn thing will start.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds