From 97778777189afe306aafd6e11f2929bf72e0d317 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 31 Mar 2019 00:27:01 -0700 Subject: [PATCH 1/2] lttng-tools: Update to 2.10.6 Signed-off-by: Rosen Penev --- devel/lttng-tools/Makefile | 16 +- .../010-fix-compile-fails-for-x32-arch.patch | 45 ++ ...tgrnam-is-not-MT-Safe-use-getgrnam_r.patch | 345 ++++++++++++++ .../lttng-tools/patches/100-musl-compat.patch | 23 - .../lttng-tools/patches/200-use-extern.patch | 423 ------------------ 5 files changed, 398 insertions(+), 454 deletions(-) create mode 100644 devel/lttng-tools/patches/010-fix-compile-fails-for-x32-arch.patch create mode 100644 devel/lttng-tools/patches/020-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch delete mode 100644 devel/lttng-tools/patches/100-musl-compat.patch delete mode 100644 devel/lttng-tools/patches/200-use-extern.patch diff --git a/devel/lttng-tools/Makefile b/devel/lttng-tools/Makefile index dfce72c84..eb40f6027 100644 --- a/devel/lttng-tools/Makefile +++ b/devel/lttng-tools/Makefile @@ -8,18 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lttng-tools -PKG_VERSION:=2.6.0 +PKG_VERSION:=2.10.6 PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/ -PKG_HASH:=128166445126d76da7d9f42a56dec12716732a1ed697a6cfdf40c9e135384f32 +PKG_HASH:=f05df52bbebf8ce88d1b29e9e98cfc957d2ed738a345118018237ebdb581537c +PKG_MAINTAINER:= PKG_LICENSE:=LGPL-2.1 GPL-2.0 PKG_LICENSE_FILES:=COPYING -PKG_MAINTAINER:=Nicolas Thill -PKG_FIXUP:=autoreconf PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -34,11 +33,12 @@ define Package/lttng-tools DEPENDS:= +lttng-ust +libpopt +libxml2 endef -CONFIGURE_ARGS += --disable-kmod +TARGET_CFLAGS += $(FPIC) -TARGET_LDFLAGS += -lurcu-bp - -MAKE_FLAGS += V="$(V)" +CONFIGURE_ARGS += \ + --enable-epoll \ + --without-kmod \ + --without-pic define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include diff --git a/devel/lttng-tools/patches/010-fix-compile-fails-for-x32-arch.patch b/devel/lttng-tools/patches/010-fix-compile-fails-for-x32-arch.patch new file mode 100644 index 000000000..becb4330b --- /dev/null +++ b/devel/lttng-tools/patches/010-fix-compile-fails-for-x32-arch.patch @@ -0,0 +1,45 @@ +From e0212fb3278ca54ac6d3beecf990297670f2612f Mon Sep 17 00:00:00 2001 +From: Kai Kang +Date: Thu, 13 Dec 2018 10:55:36 +0800 +Subject: [PATCH] Fix: compile fails for x32 arch + +It fails to compile for x32 arch: + +| .../src/common/utils.c: Assembler messages: +| .../src/common/utils.c:1026: Error: register type mismatch for `bsr' +| .../src/common/utils.c:1028: Error: operand type mismatch for `movq' + +Add macro check that not to define that fls_u64() for x32. + +Signed-off-by: Kai Kang +--- + src/bin/lttng/utils.c | 2 +- + src/common/utils.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c +index 0e96ef0c3..5c79c8c7e 100644 +--- a/src/bin/lttng/utils.c ++++ b/src/bin/lttng/utils.c +@@ -158,7 +158,7 @@ unsigned int fls_u32(uint32_t x) + #define HAS_FLS_U32 + #endif + +-#if defined(__x86_64) ++#if defined(__x86_64) && !defined(__ILP32__) + static inline + unsigned int fls_u64(uint64_t x) + { +diff --git a/src/common/utils.c b/src/common/utils.c +index 08139e5e2..3c3899819 100644 +--- a/src/common/utils.c ++++ b/src/common/utils.c +@@ -1223,7 +1223,7 @@ static inline unsigned int fls_u32(uint32_t x) + #define HAS_FLS_U32 + #endif + +-#if defined(__x86_64) ++#if defined(__x86_64) && !defined(__ILP32__) + static inline + unsigned int fls_u64(uint64_t x) + { diff --git a/devel/lttng-tools/patches/020-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch b/devel/lttng-tools/patches/020-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch new file mode 100644 index 000000000..5437de26e --- /dev/null +++ b/devel/lttng-tools/patches/020-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch @@ -0,0 +1,345 @@ +From 10e8001ad876d8cb3b5a17c7492e713bbc047975 Mon Sep 17 00:00:00 2001 +From: Jonathan Rajotte +Date: Thu, 28 Mar 2019 18:31:29 -0400 +Subject: [PATCH] Fix: getgrnam is not MT-Safe, use getgrnam_r + +Running the test suite under a Yocto musl build resulted in musl +coredump due to double freeing. + +We get the following backtraces: + +0 a_crash () at ./arch/x86_64/atomic_arch.h:108 +1 unmap_chunk (self=) at src/malloc/malloc.c:515 +2 free (p=) at src/malloc/malloc.c:526 +3 0x00007f46d9dc3849 in __getgrent_a (f=f@entry=0x7f46d9d1f7e0, gr=gr@entry=0x7f46d9e24460 , line=line@entry=0x7f46d9e26058 , size=size@entry=0x7f46d92db550, mem=mem@entry=0x7f46d9e26050 , nmem=nmem@entry=0x7f46d92db558, res=0x7f46d92db548) at src/passwd/getgrent_a.c:45 +4 0x00007f46d9dc2e6b in __getgr_a (name=0x487242 "tracing", gid=gid@entry=0, gr=gr@entry=0x7f46d9e24460 , buf=buf@entry=0x7f46d9e26058 , size=size@entry=0x7f46d92db550, mem=mem@entry=0x7f46d9e26050 , nmem=0x7f46d92db558, res=0x7f46d92db548) at src/passwd/getgr_a.c:30 +5 0x00007f46d9dc3733 in getgrnam (name=) at src/passwd/getgrent.c:37 +6 0x0000000000460b29 in utils_get_group_id (name=) at ../../../lttng-tools-2.10.6/src/common/utils.c:1241 +7 0x000000000044ee69 in thread_manage_health (data=) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/main.c:4115 +8 0x00007f46d9de1541 in start (p=) at src/thread/pthread_create.c:195 +9 0x00007f46d9dee661 in __clone () at src/thread/x86_64/clone.s:22 + +From another run: + +0 a_crash () at ./arch/x86_64/atomic_arch.h:108 +1 unmap_chunk (self=) at src/malloc/malloc.c:515 +2 free (p=) at src/malloc/malloc.c:526 +3 0x00007f5abc210849 in __getgrent_a (f=f@entry=0x7f5abc2733e0, gr=gr@entry=0x7f5abc271460 , line=line@entry=0x7f5abc273058 , size=size@entry=0x7f5abaef5510, mem=mem@entry=0x7f5abc273050 , nmem=nmem@entry=0x7f5abaef5518, res=0x7f5abaef5508) at src/passwd/getgrent_a.c:45 +4 0x00007f5abc20fe6b in __getgr_a (name=0x487242 "tracing", gid=gid@entry=0, gr=gr@entry=0x7f5abc271460 , buf=buf@entry=0x7f5abc273058 , size=size@entry=0x7f5abaef5510, mem=mem@entry=0x7f5abc273050 , nmem=0x7f5abaef5518, res=0x7f5abaef5508) at src/passwd/getgr_a.c:30 +5 0x00007f5abc210733 in getgrnam (name=) at src/passwd/getgrent.c:37 +6 0x0000000000460b29 in utils_get_group_id (name=) at ../../../lttng-tools-2.10.6/src/common/utils.c:1241 +7 0x000000000042dee4 in notification_channel_socket_create () at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:238 +8 init_thread_state (state=0x7f5abaef5560, handle=0x7f5abbf9be40) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:375 +9 thread_notification (data=0x7f5abbf9be40) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:495 +10 0x00007f5abc22e541 in start (p=) at src/thread/pthread_create.c:195 +11 0x00007f5abc23b661 in __clone () at src/thread/x86_64/clone.s:22 + +The problem was easily reproducible (~6 crash on ~300 runs). A prototype fix +using mutex around the getgrnam yielded no crash in over 1000 runs. This +patch yielded the same results as the prototype fix. + +Unfortunately we cannot rely on a mutex in liblttng-ctl since we cannot +enforce the locking for the application using the lib. + +Use getgrnam_r instead. + +The previous implementation of utils_get_group_id returned the gid of +the root group (0) on error/not found. lttng_check_tracing_group needs +to know if an error/not found occured, returning the root group is not +enough. We now return the gid via the passed parameter. The caller is +responsible for either defaulting to the root group or propagating the +error. + +We also do not want to warn when used in liblttng-ctl context. We might +want to move the warning elsewhere in the future. For now, pass a bool +if we need to warn or not. + +Signed-off-by: Jonathan Rajotte +--- + src/bin/lttng-consumerd/health-consumerd.c | 10 ++- + src/bin/lttng-relayd/health-relayd.c | 20 ++++-- + src/bin/lttng-sessiond/main.c | 24 +++++-- + src/bin/lttng-sessiond/notification-thread.c | 10 ++- + src/common/utils.c | 75 +++++++++++++++++--- + src/common/utils.h | 4 +- + src/lib/lttng-ctl/lttng-ctl.c | 8 +-- + 7 files changed, 122 insertions(+), 29 deletions(-) + +diff --git a/src/bin/lttng-consumerd/health-consumerd.c b/src/bin/lttng-consumerd/health-consumerd.c +index 1e2f31e4..6045401a 100644 +--- a/src/bin/lttng-consumerd/health-consumerd.c ++++ b/src/bin/lttng-consumerd/health-consumerd.c +@@ -184,8 +184,14 @@ void *thread_manage_health(void *data) + is_root = !getuid(); + if (is_root) { + /* lttng health client socket path permissions */ +- ret = chown(health_unix_sock_path, 0, +- utils_get_group_id(tracing_group_name)); ++ gid_t gid; ++ ++ ret = utils_get_group_id(tracing_group_name, true, &gid); ++ if (ret) { ++ gid = 0; /* Default to root group. */ ++ } ++ ++ ret = chown(health_unix_sock_path, 0, gid); + if (ret < 0) { + ERR("Unable to set group on %s", health_unix_sock_path); + PERROR("chown"); +diff --git a/src/bin/lttng-relayd/health-relayd.c b/src/bin/lttng-relayd/health-relayd.c +index ba996621..962e88c4 100644 +--- a/src/bin/lttng-relayd/health-relayd.c ++++ b/src/bin/lttng-relayd/health-relayd.c +@@ -105,8 +105,14 @@ static int create_lttng_rundir_with_perm(const char *rundir) + int is_root = !getuid(); + + if (is_root) { +- ret = chown(rundir, 0, +- utils_get_group_id(tracing_group_name)); ++ gid_t gid; ++ ++ ret = utils_get_group_id(tracing_group_name, true, &gid); ++ if (ret) { ++ gid = 0; /* Default to root group.*/ ++ } ++ ++ ret = chown(rundir, 0, gid); + if (ret < 0) { + ERR("Unable to set group on %s", rundir); + PERROR("chown"); +@@ -256,8 +262,14 @@ void *thread_manage_health(void *data) + is_root = !getuid(); + if (is_root) { + /* lttng health client socket path permissions */ +- ret = chown(health_unix_sock_path, 0, +- utils_get_group_id(tracing_group_name)); ++ gid_t gid; ++ ++ ret = utils_get_group_id(tracing_group_name, true, &gid); ++ if (ret) { ++ gid = 0; /* Default to root group */ ++ } ++ ++ ret = chown(health_unix_sock_path, 0, gid); + if (ret < 0) { + ERR("Unable to set group on %s", health_unix_sock_path); + PERROR("chown"); +diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c +index fa6fa483..49307064 100644 +--- a/src/bin/lttng-sessiond/main.c ++++ b/src/bin/lttng-sessiond/main.c +@@ -4112,8 +4112,14 @@ static void *thread_manage_health(void *data) + + if (is_root) { + /* lttng health client socket path permissions */ +- ret = chown(config.health_unix_sock_path.value, 0, +- utils_get_group_id(config.tracing_group_name.value)); ++ gid_t gid; ++ ++ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); ++ if (ret) { ++ gid = 0; /* Default to root group */ ++ } ++ ++ ret = chown(config.health_unix_sock_path.value, 0, &gid); + if (ret < 0) { + ERR("Unable to set group on %s", config.health_unix_sock_path.value); + PERROR("chown"); +@@ -5238,7 +5244,10 @@ static int set_permissions(char *rundir) + int ret; + gid_t gid; + +- gid = utils_get_group_id(config.tracing_group_name.value); ++ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); ++ if (ret) { ++ gid = 0; /* Default to root group */ ++ } + + /* Set lttng run dir */ + ret = chown(rundir, 0, gid); +@@ -5349,7 +5358,14 @@ static int set_consumer_sockets(struct consumer_data *consumer_data) + goto error; + } + if (is_root) { +- ret = chown(path, 0, utils_get_group_id(config.tracing_group_name.value)); ++ gid_t gid; ++ ++ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); ++ if (ret) { ++ gid = 0; /* Default to root group */ ++ } ++ ++ ret = chown(path, 0, gid); + if (ret < 0) { + ERR("Unable to set group on %s", path); + PERROR("chown"); +diff --git a/src/bin/lttng-sessiond/notification-thread.c b/src/bin/lttng-sessiond/notification-thread.c +index 92ac597f..18a264d9 100644 +--- a/src/bin/lttng-sessiond/notification-thread.c ++++ b/src/bin/lttng-sessiond/notification-thread.c +@@ -235,8 +235,14 @@ int notification_channel_socket_create(void) + } + + if (getuid() == 0) { +- ret = chown(sock_path, 0, +- utils_get_group_id(config.tracing_group_name.value)); ++ gid_t gid; ++ ++ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); ++ if (ret) { ++ gid = 0; /* Default to root group. */ ++ } ++ ++ ret = chown(sock_path, 0, gid); + if (ret) { + ERR("Failed to set the notification channel socket's group"); + ret = -1; +diff --git a/src/common/utils.c b/src/common/utils.c +index c0bb031e..778bc00f 100644 +--- a/src/common/utils.c ++++ b/src/common/utils.c +@@ -1231,24 +1231,77 @@ size_t utils_get_current_time_str(const char *format, char *dst, size_t len) + } + + /* +- * Return the group ID matching name, else 0 if it cannot be found. ++ * Return 0 on success and set *gid to the group_ID matching the passed name. ++ * Else -1 if it cannot be found or an error occurred. + */ + LTTNG_HIDDEN +-gid_t utils_get_group_id(const char *name) ++int utils_get_group_id(const char *name, bool warn, gid_t *gid) + { +- struct group *grp; ++ static volatile int warn_once; + +- grp = getgrnam(name); +- if (!grp) { +- static volatile int warn_once; ++ int ret; ++ long sys_len; ++ size_t len; ++ struct group grp; ++ struct group *result; ++ char *buffer = NULL; + +- if (!warn_once) { +- WARN("No tracing group detected"); +- warn_once = 1; ++ /* Get the system limit if it exists */ ++ sys_len = sysconf(_SC_GETGR_R_SIZE_MAX); ++ if (sys_len == -1) { ++ len = 1024; ++ } else { ++ len = (size_t) sys_len; ++ } ++ ++ buffer = malloc(len); ++ if (!buffer) { ++ PERROR("getgrnam_r malloc"); ++ ret = -1; ++ goto error; ++ } ++ ++ while ((ret = getgrnam_r(name, &grp, buffer, len, &result)) == ERANGE) ++ { ++ /* Buffer is not big enough, increase its size. */ ++ size_t new_len = 2 * len; ++ char *new_buffer = NULL; ++ if (new_len < len) { ++ ERR("getgrnam_r buffer size overflow"); ++ ret = -1; ++ goto error; ++ } ++ len = new_len; ++ new_buffer = realloc(buffer, len); ++ if (!new_buffer) { ++ PERROR("getgrnam_r realloc"); ++ ret = -1; ++ goto error; + } +- return 0; ++ buffer = new_buffer; ++ } ++ if (ret != 0) { ++ PERROR("getgrnam_r"); ++ ret = -1; ++ goto error; ++ } ++ ++ /* Group not found. */ ++ if (!result) { ++ ret = -1; ++ goto error; ++ } ++ ++ *gid = result->gr_gid; ++ ret = 0; ++ ++error: ++ free(buffer); ++ if (ret && warn && !warn_once) { ++ WARN("No tracing group detected"); ++ warn_once = 1; + } +- return grp->gr_gid; ++ return ret; + } + + /* +diff --git a/src/common/utils.h b/src/common/utils.h +index 18f19ef1..9c72431d 100644 +--- a/src/common/utils.h ++++ b/src/common/utils.h +@@ -22,6 +22,8 @@ + #include + #include + #include ++#include ++#include + + #define KIBI_LOG2 10 + #define MEBI_LOG2 20 +@@ -52,7 +54,7 @@ int utils_get_count_order_u64(uint64_t x); + char *utils_get_home_dir(void); + char *utils_get_user_home_dir(uid_t uid); + size_t utils_get_current_time_str(const char *format, char *dst, size_t len); +-gid_t utils_get_group_id(const char *name); ++int utils_get_group_id(const char *name, bool warn, gid_t *gid); + char *utils_generate_optstring(const struct option *long_options, + size_t opt_count); + int utils_create_lock_file(const char *filepath); +diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c +index 2d84aad9..561b0bcf 100644 +--- a/src/lib/lttng-ctl/lttng-ctl.c ++++ b/src/lib/lttng-ctl/lttng-ctl.c +@@ -208,15 +208,13 @@ end: + LTTNG_HIDDEN + int lttng_check_tracing_group(void) + { +- struct group *grp_tracing; /* no free(). See getgrnam(3) */ +- gid_t *grp_list; ++ gid_t *grp_list, tracing_gid; + int grp_list_size, grp_id, i; + int ret = -1; + const char *grp_name = tracing_group; + + /* Get GID of group 'tracing' */ +- grp_tracing = getgrnam(grp_name); +- if (!grp_tracing) { ++ if (utils_get_group_id(grp_name, false, &tracing_gid)) { + /* If grp_tracing is NULL, the group does not exist. */ + goto end; + } +@@ -241,7 +239,7 @@ int lttng_check_tracing_group(void) + } + + for (i = 0; i < grp_list_size; i++) { +- if (grp_list[i] == grp_tracing->gr_gid) { ++ if (grp_list[i] == tracing_gid) { + ret = 1; + break; + } +-- +2.17.1 + diff --git a/devel/lttng-tools/patches/100-musl-compat.patch b/devel/lttng-tools/patches/100-musl-compat.patch deleted file mode 100644 index 8813f837b..000000000 --- a/devel/lttng-tools/patches/100-musl-compat.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/common/compat/poll.h -+++ b/src/common/compat/poll.h -@@ -55,6 +55,10 @@ static inline void __lttng_poll_free(voi - #include - #include - -+#ifndef __GLIBC_PREREQ -+#define __GLIBC_PREREQ(maj, min) (0) -+#endif -+ - /* See man epoll(7) for this define path */ - #define COMPAT_EPOLL_PROC_PATH "/proc/sys/fs/epoll/max_user_watches" - ---- a/src/common/runas.h -+++ b/src/common/runas.h -@@ -21,6 +21,7 @@ - - #include - #include -+#include - - int run_as_mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid); - int run_as_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid); diff --git a/devel/lttng-tools/patches/200-use-extern.patch b/devel/lttng-tools/patches/200-use-extern.patch deleted file mode 100644 index 180c0611f..000000000 --- a/devel/lttng-tools/patches/200-use-extern.patch +++ /dev/null @@ -1,423 +0,0 @@ ---- a/src/common/mi-lttng.h -+++ b/src/common/mi-lttng.h -@@ -49,133 +49,133 @@ struct mi_lttng_version { - }; - - /* Strings related to command */ --const char * const mi_lttng_element_command; --const char * const mi_lttng_element_command_action; --const char * const mi_lttng_element_command_add_context; --const char * const mi_lttng_element_command_calibrate; --const char * const mi_lttng_element_command_create; --const char * const mi_lttng_element_command_destroy; --const char * const mi_lttng_element_command_disable_channel; --const char * const mi_lttng_element_command_disable_event; --const char * const mi_lttng_element_command_enable_channels; --const char * const mi_lttng_element_command_enable_event; --const char * const mi_lttng_element_command_list; --const char * const mi_lttng_element_command_load; --const char * const mi_lttng_element_command_name; --const char * const mi_lttng_element_command_output; --const char * const mi_lttng_element_command_save; --const char * const mi_lttng_element_command_set_session; --const char * const mi_lttng_element_command_snapshot; --const char * const mi_lttng_element_command_snapshot_add; --const char * const mi_lttng_element_command_snapshot_del; --const char * const mi_lttng_element_command_snapshot_list; --const char * const mi_lttng_element_command_snapshot_record; --const char * const mi_lttng_element_command_start; --const char * const mi_lttng_element_command_stop; --const char * const mi_lttng_element_command_success; --const char * const mi_lttng_element_command_version; -+extern const char * const mi_lttng_element_command; -+extern const char * const mi_lttng_element_command_action; -+extern const char * const mi_lttng_element_command_add_context; -+extern const char * const mi_lttng_element_command_calibrate; -+extern const char * const mi_lttng_element_command_create; -+extern const char * const mi_lttng_element_command_destroy; -+extern const char * const mi_lttng_element_command_disable_channel; -+extern const char * const mi_lttng_element_command_disable_event; -+extern const char * const mi_lttng_element_command_enable_channels; -+extern const char * const mi_lttng_element_command_enable_event; -+extern const char * const mi_lttng_element_command_list; -+extern const char * const mi_lttng_element_command_load; -+extern const char * const mi_lttng_element_command_name; -+extern const char * const mi_lttng_element_command_output; -+extern const char * const mi_lttng_element_command_save; -+extern const char * const mi_lttng_element_command_set_session; -+extern const char * const mi_lttng_element_command_snapshot; -+extern const char * const mi_lttng_element_command_snapshot_add; -+extern const char * const mi_lttng_element_command_snapshot_del; -+extern const char * const mi_lttng_element_command_snapshot_list; -+extern const char * const mi_lttng_element_command_snapshot_record; -+extern const char * const mi_lttng_element_command_start; -+extern const char * const mi_lttng_element_command_stop; -+extern const char * const mi_lttng_element_command_success; -+extern const char * const mi_lttng_element_command_version; - - /* Strings related to version command */ --const char * const mi_lttng_element_version; --const char * const mi_lttng_element_version_commit; --const char * const mi_lttng_element_version_description; --const char * const mi_lttng_element_version_license; --const char * const mi_lttng_element_version_major; --const char * const mi_lttng_element_version_minor; --const char * const mi_lttng_element_version_patch_level; --const char * const mi_lttng_element_version_str; --const char * const mi_lttng_element_version_web; -+extern const char * const mi_lttng_element_version; -+extern const char * const mi_lttng_element_version_commit; -+extern const char * const mi_lttng_element_version_description; -+extern const char * const mi_lttng_element_version_license; -+extern const char * const mi_lttng_element_version_major; -+extern const char * const mi_lttng_element_version_minor; -+extern const char * const mi_lttng_element_version_patch_level; -+extern const char * const mi_lttng_element_version_str; -+extern const char * const mi_lttng_element_version_web; - - /* String related to a lttng_event_field */ --const char * const mi_lttng_element_event_field; --const char * const mi_lttng_element_event_fields; -+extern const char * const mi_lttng_element_event_field; -+extern const char * const mi_lttng_element_event_fields; - - /* String related to lttng_event_context */ --const char * const mi_lttng_context_type_perf_counter; --const char * const mi_lttng_context_type_perf_cpu_counter; --const char * const mi_lttng_context_type_perf_thread_counter; -+extern const char * const mi_lttng_context_type_perf_counter; -+extern const char * const mi_lttng_context_type_perf_cpu_counter; -+extern const char * const mi_lttng_context_type_perf_thread_counter; - - /* String related to lttng_event_perf_counter_ctx */ --const char * const mi_lttng_element_perf_counter_context; -+extern const char * const mi_lttng_element_perf_counter_context; - - /* Strings related to pid */ --const char * const mi_lttng_element_pids; --const char * const mi_lttng_element_pid; --const char * const mi_lttng_element_pid_id; -+extern const char * const mi_lttng_element_pids; -+extern const char * const mi_lttng_element_pid; -+extern const char * const mi_lttng_element_pid_id; - - /* Strings related to save command */ --const char * const mi_lttng_element_save; -+extern const char * const mi_lttng_element_save; - - /* Strings related to load command */ --const char * const mi_lttng_element_load; -+extern const char * const mi_lttng_element_load; - - /* General element of mi_lttng */ --const char * const mi_lttng_element_empty; --const char * const mi_lttng_element_id; --const char * const mi_lttng_element_nowrite; --const char * const mi_lttng_element_success; --const char * const mi_lttng_element_type_enum; --const char * const mi_lttng_element_type_float; --const char * const mi_lttng_element_type_integer; --const char * const mi_lttng_element_type_other; --const char * const mi_lttng_element_type_string; -+extern const char * const mi_lttng_element_empty; -+extern const char * const mi_lttng_element_id; -+extern const char * const mi_lttng_element_nowrite; -+extern const char * const mi_lttng_element_success; -+extern const char * const mi_lttng_element_type_enum; -+extern const char * const mi_lttng_element_type_float; -+extern const char * const mi_lttng_element_type_integer; -+extern const char * const mi_lttng_element_type_other; -+extern const char * const mi_lttng_element_type_string; - - /* String related to loglevel */ --const char * const mi_lttng_loglevel_str_alert; --const char * const mi_lttng_loglevel_str_crit; --const char * const mi_lttng_loglevel_str_debug; --const char * const mi_lttng_loglevel_str_debug_function; --const char * const mi_lttng_loglevel_str_debug_line; --const char * const mi_lttng_loglevel_str_debug_module; --const char * const mi_lttng_loglevel_str_debug_process; --const char * const mi_lttng_loglevel_str_debug_program; --const char * const mi_lttng_loglevel_str_debug_system; --const char * const mi_lttng_loglevel_str_debug_unit; --const char * const mi_lttng_loglevel_str_emerg; --const char * const mi_lttng_loglevel_str_err; --const char * const mi_lttng_loglevel_str_info; --const char * const mi_lttng_loglevel_str_notice; --const char * const mi_lttng_loglevel_str_unknown; --const char * const mi_lttng_loglevel_str_warning; -+extern const char * const mi_lttng_loglevel_str_alert; -+extern const char * const mi_lttng_loglevel_str_crit; -+extern const char * const mi_lttng_loglevel_str_debug; -+extern const char * const mi_lttng_loglevel_str_debug_function; -+extern const char * const mi_lttng_loglevel_str_debug_line; -+extern const char * const mi_lttng_loglevel_str_debug_module; -+extern const char * const mi_lttng_loglevel_str_debug_process; -+extern const char * const mi_lttng_loglevel_str_debug_program; -+extern const char * const mi_lttng_loglevel_str_debug_system; -+extern const char * const mi_lttng_loglevel_str_debug_unit; -+extern const char * const mi_lttng_loglevel_str_emerg; -+extern const char * const mi_lttng_loglevel_str_err; -+extern const char * const mi_lttng_loglevel_str_info; -+extern const char * const mi_lttng_loglevel_str_notice; -+extern const char * const mi_lttng_loglevel_str_unknown; -+extern const char * const mi_lttng_loglevel_str_warning; - - /* String related to loglevel JUL */ --const char * const mi_lttng_loglevel_str_jul_all; --const char * const mi_lttng_loglevel_str_jul_config; --const char * const mi_lttng_loglevel_str_jul_fine; --const char * const mi_lttng_loglevel_str_jul_finer; --const char * const mi_lttng_loglevel_str_jul_finest; --const char * const mi_lttng_loglevel_str_jul_info; --const char * const mi_lttng_loglevel_str_jul_off; --const char * const mi_lttng_loglevel_str_jul_severe; --const char * const mi_lttng_loglevel_str_jul_warning; -+extern const char * const mi_lttng_loglevel_str_jul_all; -+extern const char * const mi_lttng_loglevel_str_jul_config; -+extern const char * const mi_lttng_loglevel_str_jul_fine; -+extern const char * const mi_lttng_loglevel_str_jul_finer; -+extern const char * const mi_lttng_loglevel_str_jul_finest; -+extern const char * const mi_lttng_loglevel_str_jul_info; -+extern const char * const mi_lttng_loglevel_str_jul_off; -+extern const char * const mi_lttng_loglevel_str_jul_severe; -+extern const char * const mi_lttng_loglevel_str_jul_warning; - - /* String related to loglevel Log4j */ --const char * const mi_lttng_loglevel_str_log4j_off; --const char * const mi_lttng_loglevel_str_log4j_fatal; --const char * const mi_lttng_loglevel_str_log4j_error; --const char * const mi_lttng_loglevel_str_log4j_warn; --const char * const mi_lttng_loglevel_str_log4j_info; --const char * const mi_lttng_loglevel_str_log4j_debug; --const char * const mi_lttng_loglevel_str_log4j_trace; --const char * const mi_lttng_loglevel_str_log4j_all; -+extern const char * const mi_lttng_loglevel_str_log4j_off; -+extern const char * const mi_lttng_loglevel_str_log4j_fatal; -+extern const char * const mi_lttng_loglevel_str_log4j_error; -+extern const char * const mi_lttng_loglevel_str_log4j_warn; -+extern const char * const mi_lttng_loglevel_str_log4j_info; -+extern const char * const mi_lttng_loglevel_str_log4j_debug; -+extern const char * const mi_lttng_loglevel_str_log4j_trace; -+extern const char * const mi_lttng_loglevel_str_log4j_all; - - /* String related to loglevel type */ --const char * const mi_lttng_loglevel_type_all; --const char * const mi_lttng_loglevel_type_range; --const char * const mi_lttng_loglevel_type_single; --const char * const mi_lttng_loglevel_type_unknown; -+extern const char * const mi_lttng_loglevel_type_all; -+extern const char * const mi_lttng_loglevel_type_range; -+extern const char * const mi_lttng_loglevel_type_single; -+extern const char * const mi_lttng_loglevel_type_unknown; - - /* Sting related to lttng_calibrate */ --const char * const mi_lttng_element_calibrate; --const char * const mi_lttng_element_calibrate_function; -+extern const char * const mi_lttng_element_calibrate; -+extern const char * const mi_lttng_element_calibrate_function; - - /* String related to a lttng_snapshot */ --const char * const mi_lttng_element_snapshot_ctrl_url; --const char * const mi_lttng_element_snapshot_data_url; --const char * const mi_lttng_element_snapshot_max_size; --const char * const mi_lttng_element_snapshot_n_ptr; --const char * const mi_lttng_element_snapshot_session_name; --const char * const mi_lttng_element_snapshots; -+extern const char * const mi_lttng_element_snapshot_ctrl_url; -+extern const char * const mi_lttng_element_snapshot_data_url; -+extern const char * const mi_lttng_element_snapshot_max_size; -+extern const char * const mi_lttng_element_snapshot_n_ptr; -+extern const char * const mi_lttng_element_snapshot_session_name; -+extern const char * const mi_lttng_element_snapshots; - - /* Utility string function */ - const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain); ---- a/src/common/config/config-session-abi.h -+++ b/src/common/config/config-session-abi.h -@@ -18,95 +18,95 @@ - #ifndef CONFIG_SESSION_INTERNAL_H - #define CONFIG_SESSION_INTERNAL_H - --const char * const config_element_channel; --const char * const config_element_channels; --const char * const config_element_domain; --const char * const config_element_domains; --const char * const config_element_event; --const char * const config_element_events; --const char * const config_element_context; --const char * const config_element_contexts; --const char * const config_element_attributes; --const char * const config_element_exclusion; --const char * const config_element_exclusions; --const char * const config_element_function_attributes; --const char * const config_element_probe_attributes; --const char * const config_element_symbol_name; --const char * const config_element_address; --const char * const config_element_offset; --const char * const config_element_name; --const char * const config_element_enabled; --const char * const config_element_overwrite_mode; --const char * const config_element_subbuf_size; --const char * const config_element_num_subbuf; --const char * const config_element_switch_timer_interval; --const char * const config_element_read_timer_interval; --const char * const config_element_output; --const char * const config_element_output_type; --const char * const config_element_tracefile_size; --const char * const config_element_tracefile_count; --const char * const config_element_live_timer_interval; --const char * const config_element_type; --const char * const config_element_buffer_type; --const char * const config_element_session; --const char * const config_element_sessions; --const char * const config_element_perf; --const char * const config_element_config; --const char * const config_element_started; --const char * const config_element_snapshot_mode; --const char * const config_element_loglevel; --const char * const config_element_loglevel_type; --const char * const config_element_filter; --const char * const config_element_snapshot_outputs; --const char * const config_element_consumer_output; --const char * const config_element_destination; --const char * const config_element_path; --const char * const config_element_net_output; --const char * const config_element_control_uri; --const char * const config_element_data_uri; --const char * const config_element_max_size; -- --const char * const config_domain_type_kernel; --const char * const config_domain_type_ust; --const char * const config_domain_type_jul; --const char * const config_domain_type_log4j; -- --const char * const config_buffer_type_per_pid; --const char * const config_buffer_type_per_uid; --const char * const config_buffer_type_global; -- --const char * const config_overwrite_mode_discard; --const char * const config_overwrite_mode_overwrite; -- --const char * const config_output_type_splice; --const char * const config_output_type_mmap; -- --const char * const config_loglevel_type_all; --const char * const config_loglevel_type_range; --const char * const config_loglevel_type_single; -- --const char * const config_event_type_all; --const char * const config_event_type_tracepoint; --const char * const config_event_type_probe; --const char * const config_event_type_function; --const char * const config_event_type_function_entry; --const char * const config_event_type_noop; --const char * const config_event_type_syscall; --const char * const config_event_type_kprobe; --const char * const config_event_type_kretprobe; -- --const char * const config_event_context_pid; --const char * const config_event_context_procname; --const char * const config_event_context_prio; --const char * const config_event_context_nice; --const char * const config_event_context_vpid; --const char * const config_event_context_tid; --const char * const config_event_context_vtid; --const char * const config_event_context_ppid; --const char * const config_event_context_vppid; --const char * const config_event_context_pthread_id; --const char * const config_event_context_hostname; --const char * const config_event_context_ip; --const char * const config_event_context_perf_thread_counter; -+extern const char * const config_element_channel; -+extern const char * const config_element_channels; -+extern const char * const config_element_domain; -+extern const char * const config_element_domains; -+extern const char * const config_element_event; -+extern const char * const config_element_events; -+extern const char * const config_element_context; -+extern const char * const config_element_contexts; -+extern const char * const config_element_attributes; -+extern const char * const config_element_exclusion; -+extern const char * const config_element_exclusions; -+extern const char * const config_element_function_attributes; -+extern const char * const config_element_probe_attributes; -+extern const char * const config_element_symbol_name; -+extern const char * const config_element_address; -+extern const char * const config_element_offset; -+extern const char * const config_element_name; -+extern const char * const config_element_enabled; -+extern const char * const config_element_overwrite_mode; -+extern const char * const config_element_subbuf_size; -+extern const char * const config_element_num_subbuf; -+extern const char * const config_element_switch_timer_interval; -+extern const char * const config_element_read_timer_interval; -+extern const char * const config_element_output; -+extern const char * const config_element_output_type; -+extern const char * const config_element_tracefile_size; -+extern const char * const config_element_tracefile_count; -+extern const char * const config_element_live_timer_interval; -+extern const char * const config_element_type; -+extern const char * const config_element_buffer_type; -+extern const char * const config_element_session; -+extern const char * const config_element_sessions; -+extern const char * const config_element_perf; -+extern const char * const config_element_config; -+extern const char * const config_element_started; -+extern const char * const config_element_snapshot_mode; -+extern const char * const config_element_loglevel; -+extern const char * const config_element_loglevel_type; -+extern const char * const config_element_filter; -+extern const char * const config_element_snapshot_outputs; -+extern const char * const config_element_consumer_output; -+extern const char * const config_element_destination; -+extern const char * const config_element_path; -+extern const char * const config_element_net_output; -+extern const char * const config_element_control_uri; -+extern const char * const config_element_data_uri; -+extern const char * const config_element_max_size; -+ -+extern const char * const config_domain_type_kernel; -+extern const char * const config_domain_type_ust; -+extern const char * const config_domain_type_jul; -+extern const char * const config_domain_type_log4j; -+ -+extern const char * const config_buffer_type_per_pid; -+extern const char * const config_buffer_type_per_uid; -+extern const char * const config_buffer_type_global; -+ -+extern const char * const config_overwrite_mode_discard; -+extern const char * const config_overwrite_mode_overwrite; -+ -+extern const char * const config_output_type_splice; -+extern const char * const config_output_type_mmap; -+ -+extern const char * const config_loglevel_type_all; -+extern const char * const config_loglevel_type_range; -+extern const char * const config_loglevel_type_single; -+ -+extern const char * const config_event_type_all; -+extern const char * const config_event_type_tracepoint; -+extern const char * const config_event_type_probe; -+extern const char * const config_event_type_function; -+extern const char * const config_event_type_function_entry; -+extern const char * const config_event_type_noop; -+extern const char * const config_event_type_syscall; -+extern const char * const config_event_type_kprobe; -+extern const char * const config_event_type_kretprobe; -+ -+extern const char * const config_event_context_pid; -+extern const char * const config_event_context_procname; -+extern const char * const config_event_context_prio; -+extern const char * const config_event_context_nice; -+extern const char * const config_event_context_vpid; -+extern const char * const config_event_context_tid; -+extern const char * const config_event_context_vtid; -+extern const char * const config_event_context_ppid; -+extern const char * const config_event_context_vppid; -+extern const char * const config_event_context_pthread_id; -+extern const char * const config_event_context_hostname; -+extern const char * const config_event_context_ip; -+extern const char * const config_event_context_perf_thread_counter; - - #endif /* CONFIG_SESSION_INTERNAL_H */ From a944e267b93ced357ff6e23849173ffc316b8406 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 31 Mar 2019 00:19:19 -0700 Subject: [PATCH 2/2] lttng-ust: Update to 2.10.3 Unlike the current version, this one has support for aarch64. aarch64 is necessary for several 64-bit targets. Signed-off-by: Rosen Penev --- libs/lttng-ust/Makefile | 16 ++++++++++++---- libs/lttng-ust/patches/001-no_docs_tests.patch | 4 ++-- libs/lttng-ust/patches/002-examples.patch | 18 ------------------ 3 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 libs/lttng-ust/patches/002-examples.patch diff --git a/libs/lttng-ust/Makefile b/libs/lttng-ust/Makefile index 7b88f0ce4..2fe374040 100644 --- a/libs/lttng-ust/Makefile +++ b/libs/lttng-ust/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lttng-ust -PKG_VERSION:=2.6.1 +PKG_VERSION:=2.10.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/ -PKG_HASH:=a75c3ea6cbfa3a89107a2141b27ebabf13964e628855566571f09459bbbc8cb3 +PKG_HASH:=9e8420f90d5f963f7aa32bc6d44adc1e491136f687c69ffb7a3075d33b40852b +PKG_MAINTAINER:= PKG_LICENSE:=LGPL-2.1 GPL-2.0 PKG_LICENSE_FILES:=COPYING -PKG_MAINTAINER:=Nicolas Thill PKG_FIXUP:=autoreconf PKG_USE_MIPS16:=0 @@ -34,11 +34,19 @@ define Package/lttng-ust DEPENDS:= +liburcu +libuuid +librt endef +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --without-pic + +CONFIGURE_VARS += \ + ac_cv_prog_BUILD_GEN_TP_EXAMPLES=no + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/lttng $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblttng-ust*.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblttng-ust*.so* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lttng-ust.pc $(1)/usr/lib/pkgconfig/ endef diff --git a/libs/lttng-ust/patches/001-no_docs_tests.patch b/libs/lttng-ust/patches/001-no_docs_tests.patch index e1c20c6e5..6dee80341 100644 --- a/libs/lttng-ust/patches/001-no_docs_tests.patch +++ b/libs/lttng-ust/patches/001-no_docs_tests.patch @@ -1,7 +1,7 @@ --- a/Makefile.am +++ b/Makefile.am -@@ -20,8 +20,6 @@ if BUILD_JAVA_AGENT - SUBDIRS += liblttng-ust-java-agent +@@ -26,8 +26,6 @@ SUBDIRS += python-lttngust \ + liblttng-ust-python-agent endif -SUBDIRS += tests doc diff --git a/libs/lttng-ust/patches/002-examples.patch b/libs/lttng-ust/patches/002-examples.patch deleted file mode 100644 index 46449b781..000000000 --- a/libs/lttng-ust/patches/002-examples.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -350,7 +350,14 @@ AC_ARG_WITH([lttng-system-rundir], - AC_DEFINE_UNQUOTED([LTTNG_SYSTEM_RUNDIR], ["$lttng_system_rundir"], - [LTTng system runtime directory]) - --AM_PATH_PYTHON([2.7],BUILD_GEN_TP_EXAMPLES=1,[:]) -+AC_ARG_ENABLE([examples], -+ [AS_HELP_STRING([--enable-examples],[build examples [default=no]])], -+ [enable_examples=$enableval], -+ [enable_examples=no] -+) -+if test "x$enable_examples" = "xyes"; then -+ AM_PATH_PYTHON([2.7],BUILD_GEN_TP_EXAMPLES=1,[:]) -+fi - AM_CONDITIONAL([BUILD_GEN_TP_EXAMPLES], [test $BUILD_GEN_TP_EXAMPLES], [Build examples requiring lttng-gen-tp]) - - AC_CONFIG_FILES([