Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libtracefs for openSUSE:Factory checked in at 2022-01-23 16:25:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libtracefs (Old) and /work/SRC/openSUSE:Factory/.libtracefs.new.1938 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libtracefs" Sun Jan 23 16:25:44 2022 rev:2 rq:948227 version:1.2.5 Changes: -------- --- /work/SRC/openSUSE:Factory/libtracefs/libtracefs.changes 2021-05-15 23:17:09.312509358 +0200 +++ /work/SRC/openSUSE:Factory/.libtracefs.new.1938/libtracefs.changes 2022-01-23 16:25:51.624523424 +0100 @@ -1,0 +2,6 @@ +Wed Jan 19 13:13:55 UTC 2022 - Dario Faggioli <[email protected]> + +- Update to latest upstream version (1.2.5) + * No changelog provided again + +------------------------------------------------------------------- Old: ---- libtracefs-1.2.0.tar.gz New: ---- libtracefs-1.2.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libtracefs.spec ++++++ --- /var/tmp/diff_new_pack.cByYnG/_old 2022-01-23 16:25:52.084520280 +0100 +++ /var/tmp/diff_new_pack.cByYnG/_new 2022-01-23 16:25:52.092520225 +0100 @@ -1,7 +1,7 @@ # # spec file for package libtracefs # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,16 +18,16 @@ Name: libtracefs %define lname libtracefs1 -Version: 1.2.0 +Version: 1.2.5 Release: 0 Summary: Linux kernel trace file system library License: LGPL-2.1-only Group: Development/Libraries/C and C++ URL: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ Source: https://git.kernel.org/pub/scm/libs/libtrace/%name.git/snapshot/%name-%version.tar.gz -BuildRequires: pkgconfig(libtraceevent) >= 1.3 BuildRequires: pkg-config BuildRequires: xz +BuildRequires: pkgconfig(libtraceevent) >= 1.3 %description This library provides C APIs to access the kernel trace file system. ++++++ libtracefs-1.2.0.tar.gz -> libtracefs-1.2.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/Documentation/libtracefs-option-misc.txt new/libtracefs-1.2.5/Documentation/libtracefs-option-misc.txt --- old/libtracefs-1.2.0/Documentation/libtracefs-option-misc.txt 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/Documentation/libtracefs-option-misc.txt 2021-08-04 02:54:08.000000000 +0200 @@ -3,7 +3,7 @@ NAME ---- -tracefs_option_enable, tracefs_option_diasble, tracefs_option_name - +tracefs_option_enable, tracefs_option_disable, tracefs_option_name - Various trace option functions. SYNOPSIS @@ -13,7 +13,7 @@ *#include <tracefs.h>* int *tracefs_option_enable*(struct tracefs_instance pass:[*]_instance_, enum tracefs_option_id _id_); -int *tracefs_option_diasble*(struct tracefs_instance pass:[*]_instance_, enum tracefs_option_id _id_); +int *tracefs_option_disable*(struct tracefs_instance pass:[*]_instance_, enum tracefs_option_id _id_); const char pass:[*]*tracefs_option_name*(enum tracefs_option_id _id_); -- @@ -24,7 +24,7 @@ The _tracefs_option_enable()_ function enables the option with _id_ in the given _instance_. If _instance_ is NULL, the option is enabled in the top trace instance. -The _tracefs_option_diasble()_ function disables the option with _id_ in the given _instance_. If +The _tracefs_option_disable()_ function disables the option with _id_ in the given _instance_. If _instance_ is NULL, the option is disabled in the top trace instance. The _tracefs_option_name()_ function returns a string, representing the option with _id_. The string @@ -33,7 +33,7 @@ RETURN VALUE ------------ -The _tracefs_option_enable()_ and _tracefs_option_diasble()_ functions return 0 if the state of the +The _tracefs_option_enable()_ and _tracefs_option_disable()_ functions return 0 if the state of the option is set successfully, or -1 in case of an error. The _tracefs_option_name()_ function returns string with option name, or "unknown" in case of an @@ -49,7 +49,7 @@ /* Failed to enable annotate option in top trace instance */ } ... -if (tracefs_option_diasble(NULL, TRACEFS_OPTION_CONTEXT_INFO)) { +if (tracefs_option_disable(NULL, TRACEFS_OPTION_CONTEXT_INFO)) { /* Failed to disable context info option in top trace instance */ } ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/Makefile new/libtracefs-1.2.5/Makefile --- old/libtracefs-1.2.0/Makefile 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/Makefile 2021-08-04 02:54:08.000000000 +0200 @@ -2,7 +2,7 @@ # libtracefs version TFS_VERSION = 1 TFS_PATCHLEVEL = 2 -TFS_EXTRAVERSION = 0 +TFS_EXTRAVERSION = 5 TRACEFS_VERSION = $(TFS_VERSION).$(TFS_PATCHLEVEL).$(TFS_EXTRAVERSION) export TFS_VERSION @@ -182,11 +182,28 @@ libs: libtracefs.a libtracefs.so +VALGRIND = $(shell which valgrind) +UTEST_DIR = utest +UTEST_BINARY = trace-utest + test: force $(LIBTRACEFS_STATIC) ifneq ($(CUNIT_INSTALLED),1) $(error CUnit framework not installed, cannot build unit tests)) endif - $(Q)$(MAKE) -C $(src)/utest $@ + $(Q)$(MAKE) -C $(src)/$(UTEST_DIR) $@ + +test_mem: test +ifeq (, $(VALGRIND)) + $(error "No valgrind in $(PATH), cannot run memory test") +endif +ifneq ($(shell id -u), 0) + $(error "The unit test should be run as root, as it reuqires full access to tracefs") +endif + CK_FORK=no LD_LIBRARY_PATH=$(bdir) $(VALGRIND) \ + --show-leak-kinds=all --leak-resolution=high \ + --leak-check=full --show-possibly-lost=yes \ + --track-origins=yes -s \ + $(src)/$(UTEST_DIR)/$(UTEST_BINARY) define find_tag_files find . -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' \ @@ -198,7 +215,8 @@ sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \ sed -i "s|LIB_VERSION|${TRACEFS_VERSION}|g" ${PKG_CONFIG_FILE}; \ sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \ - sed -i "s|HEADER_DIR|$(includedir_relative)|g" ${PKG_CONFIG_FILE}; + sed -i "s|HEADER_DIR|$(includedir_relative)|g" ${PKG_CONFIG_FILE}; \ + sed -i "s|LIBTRACEEVENT_MIN|$(LIBTRACEEVENT_MIN_VERSION)|g" ${PKG_CONFIG_FILE}; endef BUILD_PREFIX := $(BUILD_OUTPUT)/build_prefix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/include/tracefs.h new/libtracefs-1.2.5/include/tracefs.h --- old/libtracefs-1.2.0/include/tracefs.h 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/include/tracefs.h 2021-08-04 02:54:08.000000000 +0200 @@ -9,7 +9,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <sched.h> -#include <traceevent/event-parse.h> +#include <event-parse.h> char *tracefs_get_tracing_file(const char *name); void tracefs_put_tracing_file(char *name); @@ -159,7 +159,7 @@ const struct tracefs_options_mask *tracefs_options_get_enabled(struct tracefs_instance *instance); bool tracefs_option_is_enabled(struct tracefs_instance *instance, enum tracefs_option_id id); int tracefs_option_enable(struct tracefs_instance *instance, enum tracefs_option_id id); -int tracefs_option_diasble(struct tracefs_instance *instance, enum tracefs_option_id id); +int tracefs_option_disable(struct tracefs_instance *instance, enum tracefs_option_id id); const char *tracefs_option_name(enum tracefs_option_id id); enum tracefs_option_id tracefs_option_id(const char *name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/libtracefs.pc.template new/libtracefs-1.2.5/libtracefs.pc.template --- old/libtracefs-1.2.0/libtracefs.pc.template 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/libtracefs.pc.template 2021-08-04 02:54:08.000000000 +0200 @@ -6,5 +6,6 @@ URL: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ Description: Library for accessing ftrace file system Version: LIB_VERSION +Requires: libtraceevent > LIBTRACEEVENT_MIN Cflags: -I${includedir} Libs: -L${libdir} -ltracefs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/src/tracefs-events.c new/libtracefs-1.2.5/src/tracefs-events.c --- old/libtracefs-1.2.0/src/tracefs-events.c 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/src/tracefs-events.c 2021-08-04 02:54:08.000000000 +0200 @@ -15,7 +15,7 @@ #include <fcntl.h> #include <limits.h> -#include <traceevent/kbuffer.h> +#include <kbuffer.h> #include "tracefs.h" #include "tracefs-local.h" @@ -822,8 +822,30 @@ bool enable) { const char *str = enable ? "1" : "0"; + int ret; + + ret = tracefs_instance_file_write(instance, "events/enable", str); + return ret < 0 ? ret : 0; +} + +static int make_regex(regex_t *re, const char *match) +{ + int len = strlen(match); + char str[len + 3]; + char *p = &str[0]; + + if (!len || match[0] != '^') + *(p++) = '^'; + + strcpy(p, match); + p += len; + + if (!len || match[len-1] != '$') + *(p++) = '$'; + + *p = '\0'; - return tracefs_instance_file_write(instance, "events/enable", str); + return regcomp(re, str, REG_ICASE|REG_NOSUB); } static int event_enable_disable(struct tracefs_instance *instance, @@ -845,12 +867,13 @@ goto out_free; if (system) { + ret = make_regex(&system_re, system); ret = regcomp(&system_re, system, REG_ICASE|REG_NOSUB); if (ret < 0) goto out_free; } if (event) { - ret = regcomp(&event_re, event, REG_ICASE|REG_NOSUB); + ret = make_regex(&event_re, event); if (ret < 0) { if (system) regfree(&system_re); @@ -858,6 +881,7 @@ } } + ret = -1; for (s = 0; systems[s]; s++) { if (system && !match(systems[s], &system_re)) continue; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/src/tracefs-tools.c new/libtracefs-1.2.5/src/tracefs-tools.c --- old/libtracefs-1.2.0/src/tracefs-tools.c 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/src/tracefs-tools.c 2021-08-04 02:54:08.000000000 +0200 @@ -307,13 +307,13 @@ } /** - * tracefs_option_diasble - Disable trace option + * tracefs_option_disable - Disable trace option * @instance: ftrace instance, can be NULL for the top instance * @id: trace option id * * Returns -1 in case of an error or 0 otherwise */ -int tracefs_option_diasble(struct tracefs_instance *instance, enum tracefs_option_id id) +int tracefs_option_disable(struct tracefs_instance *instance, enum tracefs_option_id id) { return trace_config_option(instance, id, false); } @@ -816,7 +816,8 @@ } out_free: - regfree(&func_filter.re); + if (filter) + regfree(&func_filter.re); free_func_list(func_list); out: pthread_mutex_unlock(lock); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/src/tracefs-utils.c new/libtracefs-1.2.5/src/tracefs-utils.c --- old/libtracefs-1.2.0/src/tracefs-utils.c 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/src/tracefs-utils.c 2021-08-04 02:54:08.000000000 +0200 @@ -15,8 +15,8 @@ #include <unistd.h> #include <errno.h> -#include <traceevent/event-parse.h> -#include <traceevent/event-utils.h> +#include <event-parse.h> +#include <event-utils.h> #include "tracefs.h" #include "tracefs-local.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libtracefs-1.2.0/utest/tracefs-utest.c new/libtracefs-1.2.5/utest/tracefs-utest.c --- old/libtracefs-1.2.0/utest/tracefs-utest.c 2021-05-13 04:59:12.000000000 +0200 +++ new/libtracefs-1.2.5/utest/tracefs-utest.c 2021-08-04 02:54:08.000000000 +0200 @@ -729,7 +729,7 @@ CU_TEST(!tracefs_option_is_supported(instance, TRACEFS_OPTION_INVALID)); CU_TEST(!tracefs_option_is_enabled(instance, TRACEFS_OPTION_INVALID)); CU_TEST(tracefs_option_enable(instance, TRACEFS_OPTION_INVALID) == -1); - CU_TEST(tracefs_option_diasble(instance, TRACEFS_OPTION_INVALID) == -1); + CU_TEST(tracefs_option_disable(instance, TRACEFS_OPTION_INVALID) == -1); name = tracefs_option_name(TRACEFS_OPTION_INVALID); CU_TEST(!strcmp(name, "unknown")); /* Test all valid options */ @@ -751,7 +751,7 @@ CU_TEST(check_option(instance, i, true, 1)); CU_TEST(tracefs_option_is_supported(instance, i)); CU_TEST(tracefs_option_is_enabled(instance, i)); - CU_TEST(tracefs_option_diasble(instance, i) == 0); + CU_TEST(tracefs_option_disable(instance, i) == 0); CU_TEST(check_option(instance, i, true, 0)); CU_TEST(tracefs_option_enable(instance, i) == 0); CU_TEST(check_option(instance, i, true, 1)); @@ -761,7 +761,7 @@ CU_TEST(!tracefs_option_is_enabled(instance, i)); CU_TEST(tracefs_option_enable(instance, i) == 0); CU_TEST(check_option(instance, i, true, 1)); - CU_TEST(tracefs_option_diasble(instance, i) == 0); + CU_TEST(tracefs_option_disable(instance, i) == 0); CU_TEST(check_option(instance, i, true, 0)); } }
