aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2022-07-02 21:48:18 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-08-06 19:58:46 +0200
commitb108810601ff1976a0c33f9c20186e50f5a74e7d (patch)
treec8e26ae98f312fc174ef374c3a85e5b100f8230f /package
parent0cb1ce97485a051c9c526d92377769f8a083f7ef (diff)
downloadupstream-b108810601ff1976a0c33f9c20186e50f5a74e7d.tar.gz
upstream-b108810601ff1976a0c33f9c20186e50f5a74e7d.tar.bz2
upstream-b108810601ff1976a0c33f9c20186e50f5a74e7d.zip
libtraceevent: add Linux kernel trace event library
Needed by trace-cmd. Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'package')
-rw-r--r--package/libs/libtraceevent/Makefile74
1 files changed, 74 insertions, 0 deletions
diff --git a/package/libs/libtraceevent/Makefile b/package/libs/libtraceevent/Makefile
new file mode 100644
index 0000000000..9fb9304e76
--- /dev/null
+++ b/package/libs/libtraceevent/Makefile
@@ -0,0 +1,74 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libtraceevent
+PKG_VERSION:=1.6.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/
+PKG_HASH:=1aaeb12f5842a843a06b733e3f4230b0937ba9c2ecd39345edf6f66cc8cbe795
+
+PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libtraceevent
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Linux kernel trace event library
+ URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git
+ ABI_VERSION:=0
+endef
+
+define Package/libtraceevent/description
+The libtraceevent library provides APIs to access kernel tracepoint events, located in
+the tracefs file system under the events directory.
+endef
+
+define Package/libtraceevent-extra
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Extra plugins for libtraceevent
+ DEPENDS:=
+endef
+
+CONFIGURE_ARGS+= \
+ --enable-shared \
+ --enable-static
+
+PLUGINS_DIR := $(PKG_BUILD_DIR)/plugins
+PLUGINS_MAIN := function hrtimer mac80211 sched_switch
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_BUILD_DIR)/include/traceevent $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.{a,so*} $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_BUILD_DIR)/libtraceevent.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libtraceevent/install
+ $(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins
+ $(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.so.* $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) \
+ $(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \
+ $(1)/usr/lib/traceevent/plugins
+endef
+
+define Package/libtraceevent-extra/install
+ $(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins
+ $(CP) \
+ $$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \
+ $$(filter-out $(PLUGINS_MAIN), \
+ $$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \
+ $$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \
+ $(1)/usr/lib/traceevent/plugins
+endef
+
+$(eval $(call BuildPackage,libtraceevent))
+$(eval $(call BuildPackage,libtraceevent-extra))