On Wed, 29 Aug 2018 15:34:16 +0100
Robert Walker <robert.walker@xxxxxxx> wrote:
Hi Kim,Hi Robert,
On 29/08/18 14:49, Kim Phillips wrote:It should still compile, and with CoreSight trace support, just
On Wed, 29 Aug 2018 10:44:23 +0100I'll change it to 0.9.1 if there's another version of the patch (it was
Robert Walker <robert.walker@xxxxxxx> wrote:
This patch adds support for generating instruction samples from trace of...
AArch32 programs using the A32 and T32 instruction sets.
T32 has variable 2 or 4 byte instruction size, so the conversion between
addresses and instruction counts requires extra information from the trace
decoder, requiring version 0.9.1 of OpenCSD. A check for the new struct
member has been added to the feature check for OpenCSD.
Signed-off-by: Robert Walker <robert.walker@xxxxxxx>
---
+++ b/tools/build/feature/test-libopencsd.c0.9 != 0.9.1 in the above commit text: which is it?
@@ -3,6 +3,13 @@
int main(void)
{
+ /*
+ * Requires ocsd_generic_trace_elem.num_instr_range introduced in
+ * OpenCSD 0.9
introduced in 0.9, but 0.9.1 has a necessary bug fix)
The intention is to fail the feature detection check if the older+ */This breaks building against older versions of OpenCSD, right?
+ ocsd_generic_trace_elem elem;
+ (void)elem.num_instr_range;
+
(void)ocsd_get_version();Why don't we maintain building against older versions of the library,
and use the version information to make the decision on whether to use
the new feature being introduced in this patch?
version is installed - perf will still compile, but without the
CoreSight trace support.
not support for A32/T32 instruction sets. The user shouldn't be denied
CoreSight trace support if they don't care for A32/T32 ISA support.
OpenCSD is still in development, so new features like this are beingEven adding #ifdefs, that won't survive taking one perf executable
added and it would add a lot of #ifdef mess to the perf code to continue
to support any machines with the old library version installed - there
built on one machine and running it on another machine with a different
version of the OpenCSD library: it'll break inconspicuously, not
gracefully!
There needs to be a run-time means of working with older versions ofI mean the 0.8.x version as the old version.
the library.
Consider checking the sizeof some of the structs? IIRC, some of the
structs sizes changed in the library. See e.g., the 'size' field of
perf_event_attr:
size
The size of the perf_event_attr structure for forward/backward
compatibility. Set this using sizeof(struct perf_event_attr)
to allow the kernel to see the struct size at the time
of compilation.
or, likely better, the 'version' and 'compat_version' of the
perf_event_mmap_page structure:
struct perf_event_mmap_page {
__u32 version; /* version number of this structure */
__u32 compat_version; /* lowest version this is compat with */
...
will only be a handful of machines affected and it's trivial to upgradeThis is upstream linux, so I don't know how you know only a 'handful'
them (the new Debian packages are available).
of machines affected, and I wouldn't assume everyone's using Debian.
For one, I'd hate to see a single user affected if it isn't necessary,
as is in this case - not everyone wants A32/T32 ISA support, and
library compatibility needn't be broken.
This 'screw compatibility' mentality needs to be dropped *now* if
CoreSight support is to have a successful future.
Otherwise, I suggest keeping this feature in downstream trees for the
'handful', until the library and perf code are rewritten in a state
where they properly interoperate, and do not break each other.
How long would weWhat do you mean such an older version? The project's v0.9.0 commit
continue to support such an older version?
was on 20 June 2018, the one that's usable - v0.9.1 - has a July 27
2018 commit date! One month is *not* *old*!
This patch picks up a new feature that's been added - I notice the feature detection checks for other libraries check a number of features and emit warnings about required versions. I also don't see anyThat's because perf doesn't have a precedent on depending on libraries
precedent for supporting multiple dependent library versions in perf.
that flat-out break their own users compatibility across versions ;)
Thanks,
Kim