[Buildroot] [PATCH 2/3] Add Perf tools support

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu Jan 3 10:23:06 UTC 2013


Dear Kaiwan Billimoria,

On Thu, 3 Jan 2013 13:20:39 +0530, Kaiwan Billimoria wrote:

> + # FIXME: Where should we place the perf kernel patch? Online?
> + # Temporarily, at least, it's under linux/
> + BR2_LINUX_KERNEL_PATCH += "$(HOST_DIR)/../../linux/perf.patch"

No, we don't modify BR2 variables.

> +all:

Arggh, this is *horrible*. Why do you believe you are allowed to
overload the "all" target?

> +	$(info Building Perf...)
> +	$(TARGET_MAKE_ENV) $(MAKE) ARCH=$(ARCH)
> CROSS_COMPILE=$(TARGET_CROSS) NO_LIBELF=1 -C $(LINUX_DIR)/tools/perf

This should be part of LINUX_BUILD_CMDS

> +	# Perf: Copy the perf binary executable to the target rootfs
> +	cp -f $(LINUX_DIR)/tools/perf/perf $(TARGET_DIR)/usr/sbin

This should be part of LINUX_INSTALL_TARGET_CMDS

And doing that will help you solve the problem you mentioned in your
cover letter ("the 'perf' binary executable is being built after the
root filesystem is tar-red").

That said, I am not sure we want this thing in linux/linux.mk. Maybe
I'd prefer a package/perf/perf.mk, which depends on BR2_LINUX_KERNEL
and re-uses the source code extracted in $(LINUX_DIR).

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com


More information about the buildroot mailing list