[LITMUS^RT] Building tools/perf under LITMUS^RT

Christopher Kenna cjk at cs.unc.edu
Wed Apr 18 05:04:35 CEST 2012


*Problem*

If one tries to build tools at tools/perf by invoking make in this
directory, the build barfs with the error:

In file included from util/../../../arch/x86/include/asm/unistd.h:11:0,
                 from util/../perf.h:15,
                 from util/cache.h:7,
                 from perf.c:12:
util/../../../arch/x86/include/asm/unistd_64.h:687:30: fatal error:
litmus/unistd_64.h: No such file or directory
compilation terminated.
make: *** [perf.o] Error 1

*Explanation*

The problem is because we have #include "litmus/unistd_64.h" inside of the
asm/unistd_64.h. When building the kernel, (I assume) the location of
litmus/unistd_64.h is resolved because gcc is invoked with -Iinclude/litmus;
however, invoking make for tools/perf causes the error because it doesn't
know anything about our LITMUS unistd_64.h.

*Ways to Fix*

If I simply paste litmus/unistd_64.h in asm/unistd_64.h, then the build
works. Also, if I change the #include "litmus/unistd_64.h" to a much
uglier #include "../../../../include/litmus/unistd_64.h", then both the
kernel and the tools/perf tools will build.

*Alternatives*

I'd like to permanently fix this because I am using performance monitoring
for work on caching. Do you think the ugly relative include is a good fix,
or would you a modification to the tools/perf Makefile be more appropriate?
My rationale for not touching tools/perf/Makefile is that I don't want to
change a utility that is "external" to LITMUS and the kernel. That would
just be one more Makefile to worry about in the future.

 -- Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20120417/a8310413/attachment.html>


More information about the litmus-dev mailing list