Message ID | 1518032219-28072-1-git-send-email-francis.deslauriers@efficios.com |
---|---|
Headers |
From: francis.deslauriers at efficios.com (Francis Deslauriers) Date: Wed, 7 Feb 2018 14:36:54 -0500 Subject: [lttng-dev] [PATCH lttng-tools 0/5] Support probes with the same name but different event payload Message-ID: <1518032219-28072-1-git-send-email-francis.deslauriers@efficios.com> |
Series |
Support probes with the same name but different event payload
|
|
Message
Francis Deslauriers
Feb. 7, 2018, 7:36 p.m. UTC
This patch set allows for multiple probes with the same name to be hooked on the same callsite. Right now, the Session Daemon only considers the name and signature of the events to determine if two events are identical. This could lead to trace corruptions when two probes would have the same name and signature but really different binary trace layouts. We now compare probes by doing a deep compare of every field. If two events are _exactly_ the same then the same event ID will be used, if they are different a new event ID is created. When used with this UST patch set[1], it is possible to dlclose probe provider and callsite libraries during tracing. This patch set also includes regression tests for both the deep comparaison and the newly added dlclose capability. [1]: https://github.com/frdeso/lttng-ust/tree/dlclose-support Francis Deslauriers (5): Fix: probes should not be compared by their names and callsite signatures Fix: should pass the reg_enum_lookup pointer directly Tests: allow the use of regular expressions to match events Tests: add function to validate the number of an event name in metadata Tests: add duplicated providers tests configure.ac | 1 + src/bin/lttng-sessiond/Makefile.am | 3 +- src/bin/lttng-sessiond/ust-field-utils.c | 261 +++++++++++++++++++++++ src/bin/lttng-sessiond/ust-field-utils.h | 29 +++ src/bin/lttng-sessiond/ust-registry.c | 44 +++- tests/fast_regression | 1 + tests/regression/ust/multi-lib/Makefile.am | 114 +++++++++++ tests/regression/ust/multi-lib/README | 21 ++ tests/regression/ust/multi-lib/callsites.c | 34 +++ tests/regression/ust/multi-lib/callsites.h | 21 ++ tests/regression/ust/multi-lib/multi-lib-test.c | 251 +++++++++++++++++++++++ tests/regression/ust/multi-lib/probes.c | 18 ++ tests/regression/ust/multi-lib/probes.h | 195 ++++++++++++++++++ tests/regression/ust/multi-lib/test_multi_lib | 262 ++++++++++++++++++++++++ tests/unit/Makefile.am | 1 + tests/utils/utils.sh | 27 ++- 16 files changed, 1270 insertions(+), 13 deletions(-) create mode 100644 src/bin/lttng-sessiond/ust-field-utils.c create mode 100644 src/bin/lttng-sessiond/ust-field-utils.h create mode 100644 tests/regression/ust/multi-lib/Makefile.am create mode 100644 tests/regression/ust/multi-lib/README create mode 100644 tests/regression/ust/multi-lib/callsites.c create mode 100644 tests/regression/ust/multi-lib/callsites.h create mode 100644 tests/regression/ust/multi-lib/multi-lib-test.c create mode 100644 tests/regression/ust/multi-lib/probes.c create mode 100644 tests/regression/ust/multi-lib/probes.h create mode 100755 tests/regression/ust/multi-lib/test_multi_lib
Comments
This patch set allows for multiple probes with the same name to be hooked on the same callsite. Right now, the Session Daemon only considers the name and signature of the events to determine if two events are identical. This could lead to trace corruptions when two probes would have the same name and signature but really different binary trace layouts. We now compare probes by doing a deep compare of every field. If two events are _exactly_ the same and have the same metadata then the same event ID will be used, if they are different a new event ID is created. When used with its corresponding UST patch set[1], it allows for dynamic library upgrade scenarios during tracing. The user can now dlopen a new version of a provider library and dlclose an old version without restarting the process. This patch set also includes regression tests for both the deep comparaison and the newly added dlclose capability. [1]: https://github.com/frdeso/lttng-ust/tree/dlclose-support Francis Deslauriers (5): Fix: probes should be compared strictly by events metadata Fix: calling ht_{hash, match}_enum with wrong argument Tests: allow the use of regular expressions to match events Tests: add function to validate the number of an event name in metadata Tests: add duplicated providers tests configure.ac | 1 + src/bin/lttng-sessiond/Makefile.am | 3 +- src/bin/lttng-sessiond/ust-field-utils.c | 289 ++++++++++++++++++++++++ src/bin/lttng-sessiond/ust-field-utils.h | 29 +++ src/bin/lttng-sessiond/ust-registry.c | 46 +++- tests/fast_regression | 1 + tests/regression/ust/multi-lib/Makefile.am | 114 ++++++++++ tests/regression/ust/multi-lib/README | 21 ++ tests/regression/ust/multi-lib/callsites.c | 34 +++ tests/regression/ust/multi-lib/callsites.h | 21 ++ tests/regression/ust/multi-lib/multi-lib-test.c | 251 ++++++++++++++++++++ tests/regression/ust/multi-lib/probes.c | 18 ++ tests/regression/ust/multi-lib/probes.h | 195 ++++++++++++++++ tests/regression/ust/multi-lib/test_multi_lib | 262 +++++++++++++++++++++ tests/unit/Makefile.am | 1 + tests/utils/utils.sh | 27 ++- 16 files changed, 1299 insertions(+), 14 deletions(-) create mode 100644 src/bin/lttng-sessiond/ust-field-utils.c create mode 100644 src/bin/lttng-sessiond/ust-field-utils.h create mode 100644 tests/regression/ust/multi-lib/Makefile.am create mode 100644 tests/regression/ust/multi-lib/README create mode 100644 tests/regression/ust/multi-lib/callsites.c create mode 100644 tests/regression/ust/multi-lib/callsites.h create mode 100644 tests/regression/ust/multi-lib/multi-lib-test.c create mode 100644 tests/regression/ust/multi-lib/probes.c create mode 100644 tests/regression/ust/multi-lib/probes.h create mode 100755 tests/regression/ust/multi-lib/test_multi_lib