Skip to content

Remove kernel-compile and add perf package#2047

Merged
rn merged 8 commits intolinuxkit:masterfrom
rn:perf
Jun 15, 2017
Merged

Remove kernel-compile and add perf package#2047
rn merged 8 commits intolinuxkit:masterfrom
rn:perf

Conversation

@rn
Copy link
Copy Markdown
Member

@rn rn commented Jun 15, 2017

The first part of the PR replaces the kernel-compile package with the alpine base image from which the build tools are installed during the kernel build.

The second adds compilation and packaging of the Linux perf utility to the kernel build. perf is typically matched with the kernel so we create a kernel-perf package which is tagged the same as the kernel packages. Compiling perf required a few cherry picks for 4.9 and 4.11 kernels. The perf tools is not compiled for the 4.4 kernels as it was too tedious to get it to compile.

resolves #1613

image

rn added 7 commits June 15, 2017 10:39
iAdd a bunch of packages which are useful for compiling
some of the tools shipped with the Linux kernel source code.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
Also add additional tools and libraries useful/needed for
compiling some of the ./tools in the kernel source.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
projects are still using it, but it's still on hub so no
impact.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This cherry-picks 120010cb1eea151d38a3e66f5ffc79a0c3110292 ("tools build:
Add test for sched_getcpu()") which replaces a #ifdef based test with
a proper test for the sched_getcpu() function. The macro based condition
does not work on Alpine as it is conditional on GLIBC.

For 4.9 the cherry-pick needed some manual adjustment and also required
commit ef2c3e76d98dfb69a46d870b47656e8e5bac6e2b ("perf jit: Avoid returning
garbage for a ret variable")

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
The perf utility is somewhat kernel specific so might as well
compile it when we compile the kernel. The resulting binary
is statically linked (and stripped for size) and is added the
resulting kernel packages.

Although we add alpine packages such as libunwind and other,
it seems that the config detection code for perf/tools does
not detect them.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
Extract the perf binary from the kernel package and create
a new perf package for each kernel. The perf package uses the
same tags as the kernel package and only contains the perf
binary under /usr/bin. The perf package can be added to the
init section or included as a stage in a multi-stage build
for other packages.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
It's not build as part of the kernel build.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
@rn rn mentioned this pull request Jun 15, 2017
@rn rn merged commit ad3456d into linuxkit:master Jun 15, 2017
@rn rn deleted the perf branch June 15, 2017 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

./tools/perf does not compile with newer kernels

3 participants