linux-tool-rtla.mk.in 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ################################################################################
  2. #
  3. # rtla
  4. #
  5. ################################################################################
  6. LINUX_TOOLS += rtla
  7. RTLA_DEPENDENCIES = host-pkgconf libtracefs
  8. RTLA_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
  9. CC=$(TARGET_CC) \
  10. EXTRA_CFLAGS="-D_GNU_SOURCE" \
  11. LDFLAGS="$(TARGET_LDFLAGS)" \
  12. PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
  13. ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
  14. define RTLA_DISABLE_STACK_PROTECTOR
  15. $(SED) 's/-fstack-protector.* //' $(LINUX_DIR)/tools/tracing/rtla/Makefile
  16. endef
  17. endif
  18. define RTLA_LINUX_CONFIG_FIXUPS
  19. $(call KCONFIG_ENABLE_OPT,CONFIG_FTRACE)
  20. $(call KCONFIG_ENABLE_OPT,CONFIG_TIMERLAT_TRACER)
  21. $(call KCONFIG_ENABLE_OPT,CONFIG_HIST_TRIGGERS)
  22. endef
  23. define RTLA_BUILD_CMDS
  24. $(Q)if ! grep install $(LINUX_DIR)/tools/tracing/rtla/Makefile >/dev/null 2>&1 ; then \
  25. echo "Your kernel version is too old and does not implement the rtla tool." ; \
  26. echo "At least kernel 5.19 must be used." ; \
  27. exit 1 ; \
  28. fi
  29. $(RTLA_DISABLE_STACK_PROTECTOR)
  30. $(TARGET_MAKE_ENV) $(MAKE) $(RTLA_MAKE_OPTS) \
  31. -C $(LINUX_DIR)/tools/tracing rtla
  32. endef
  33. # make rtla_install build and install by default documentation using rst2man
  34. # but it's not available in Buildroot and we don't want manual files in target
  35. # folder so let's simply install the resulting rtla binary and create symlinks
  36. # like Linux does in its tools/tracing/rtla/Makefile
  37. define RTLA_INSTALL_TARGET_CMDS
  38. $(INSTALL) -m 0755 -D $(LINUX_DIR)/tools/tracing/rtla/rtla $(TARGET_DIR)/usr/bin
  39. ln -sf rtla $(TARGET_DIR)/usr/bin/osnoise
  40. ln -sf rtla $(TARGET_DIR)/usr/bin/timerlat
  41. # Check if hwnoise is provided or not
  42. if grep -q hwnoise $(LINUX_DIR)/tools/tracing/rtla/Makefile; then \
  43. ln -sf rtla $(TARGET_DIR)/usr/bin/hwnoise ; \
  44. fi
  45. endef