Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for master branches of lttng #25

Merged
merged 9 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/babeltrace2/d2d2e6cc_cpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.cpp b/src/plugins/ctf/common/msg-iter/msg-iter.cpp
index eed75853..e314e38e 100644
--- a/src/plugins/ctf/common/msg-iter/msg-iter.cpp
+++ b/src/plugins/ctf/common/msg-iter/msg-iter.cpp
@@ -1909,11 +1909,6 @@ static enum bt_bfcr_status bfcr_unsigned_int_char_cb(uint64_t value, struct ctf_
goto end;
}

- if (value == 0) {
- msg_it->done_filling_string = true;
- goto end;
- }
-
string_field = stack_top(msg_it->stack)->base;
BT_ASSERT_DBG(bt_field_get_class_type(string_field) == BT_FIELD_CLASS_TYPE_STRING);

13 changes: 13 additions & 0 deletions packages/babeltrace2/git_shallow_version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/common/gen-version-i.sh b/src/common/gen-version-i.sh
index 938d70c5..a8249d47 100755
--- a/src/common/gen-version-i.sh
+++ b/src/common/gen-version-i.sh
@@ -42,7 +42,7 @@ fi
# configurations leading to different results.
if test -r "$TOP_SRCDIR/bootstrap" && test -r "$TOP_SRCDIR/.git" &&
(command -v git > /dev/null 2>&1); then
- GIT_VERSION_STR="$(cd "$TOP_SRCDIR" && git describe --tags --dirty --abbrev=12)"
+ GIT_VERSION_STR="$(cd "$TOP_SRCDIR" && git describe --tags --dirty --abbrev=12 --always)"
GIT_CURRENT_TAG="$(cd "$TOP_SRCDIR" && (git describe --tags --exact-match --match="v[0-9]*" HEAD || true) 2> /dev/null)"
echo "#define BT_VERSION_GIT \"$GIT_VERSION_STR\"" > version.i.tmp

52 changes: 39 additions & 13 deletions packages/babeltrace2/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ class Babeltrace2(AutotoolsPackage):

homepage = "https://babeltrace.org/"
url = "https://www.efficios.com/files/babeltrace/babeltrace2-2.0.2.tar.bz2"
git = "https://github.com/efficios/babeltrace.git"

maintainers = ['Kerilk']

version('master', branch='master')
version('2.0.5', sha256='7b8f9ef2a7ee7c9ec292d4568811cf6926089b25e49cdaab449e2cb724edf2b4')
version('2.0.4', sha256='774f116685dab5db9c51577dde43c8c1df482aae6bb78a089b1e9e7c8b489bca')
version('2.0.3', sha256='a53625152554102d868ba8395347d0daba0bec9c4b854c3e9bd97c77b0bf04a0')
Expand All @@ -27,25 +29,46 @@ class Babeltrace2(AutotoolsPackage):
variant('built-in-plugins', default=False, description='Statically-link in-tree plug-ins into the babeltrace2 executable')
variant('built-in-python-plugin-support', default=False, description='Statically-link Python plugin support into the babeltrace library')
variant('man-pages', default=False, description='Build man pages')
variant('asan', default=False, description='Build with AddressSanitizer', when='@2.1:')
variant('ubsan', default=False, description='Build with UndefinedBehaviorSanitizer', when='@2.1:')
variant('Werror', default=False, description='Enable -Werror')

depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('pkg-config')

depends_on('glib@2.28:', type=('build', 'link'))
depends_on('elfutils@0.154:')
depends_on('python@3.4:', when='+python-bindings')
depends_on('python@3.4:', when='+python-plugins')
depends_on('python@3.4:', when='+built-in-python-plugin-support')
depends_on('swig@3.0:', when='+python-bindings')
depends_on('swig@3.0:', when='+python-plugins')
depends_on('swig@3.0:', when='+built-in-python-plugin-support')
depends_on('doxygen@1.8.6:', when='+api-doc')
depends_on('asciidoc@8.6.8:', when='+man-pages')
depends_on('xmlto@0.0.25:', when='+man-pages')
depends_on('pkg-config')

patch('d2d2e6cc.patch')
with when("+python-bindings"):
depends_on('python@3.4:')
depends_on('swig@3.0:')

with when('+python-plugins'):
depends_on('python@3.4:')
depends_on('swig@3.0:')

with when('+built-in-python-plugin-support'):
depends_on('python@3.4:')
depends_on('swig@3.0:')

with when('+api-doc'):
depends_on('asciidoc@8.6.8:')

with when('+man-pages'):
depends_on('asciidoc@8.6.8:')
depends_on('xmlto@0.0.25:')

# Add varient pour esam
patch('d2d2e6cc.patch', when='@:2.0.999')
patch('d2d2e6cc_cpp.patch', when='@2.1:')

patch('0db1832.patch', when='@:2.0.4')
patch('3079913.patch')
patch('0001-ctf-grow-stored_values-array-when-necessary.patch', when='@:2.0.5')
patch('3079913.patch', when='@:2.0.999')
patch('0001-ctf-grow-stored_values-array-when-necessary.patch', when='@:2.0.999')

patch('git_shallow_version.patch', when='@master')

def configure_args(self):
args = []
Expand All @@ -56,6 +79,9 @@ def configure_args(self):
args.extend(self.enable_or_disable('built-in-plugins'))
args.extend(self.enable_or_disable('built-in-python-plugin-support'))
args.extend(self.enable_or_disable('man-pages'))
with when('@2.1:'):
args.extend(self.enable_or_disable('asan'))
args.extend(self.enable_or_disable('ubsan'))
args.extend(self.enable_or_disable('Werror'))

if ('+python-bindings' in self.spec or
Expand Down
88 changes: 88 additions & 0 deletions packages/lttng-tools/71540e4.ring_buffer_lost.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
From 71540e46aef1da5595b817563ee231c6a3aae3df Mon Sep 17 00:00:00 2001
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Sat, 14 Oct 2023 09:36:58 -0400
Subject: [PATCH] consumer: Fix discarded events aggregation

- Print error message if overflow is detected on 64-bit,
- Do not update the channel counter if overflow is detected on 64-bit,
so the situation can be recovered on the next aggregation if it was
caused by a spurious race condition,
- Change (1ULL << (CAA_BITS_PER_LONG - 1)) for (1ULL << 32), thus fixing
an off-by-one in the shift on 32-bit.
- Use an explicit shift of 32 rather than CAA_BITS_PER_LONG to eliminate
too-large shift warnings on 64-bit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I1a0fca2dcf6e3fe5ec37509838515545b5ee9062
---

diff --git a/src/common/consumer/consumer-stream.cpp b/src/common/consumer/consumer-stream.cpp
index 0742c86..2801f1d 100644
--- a/src/common/consumer/consumer-stream.cpp
+++ b/src/common/consumer/consumer-stream.cpp
@@ -77,13 +77,42 @@
consumer_stream_data_assert_locked_all(stream);
}

+static void aggregate_discarded_events(uint64_t *_chan_discarded_events,
+ uint64_t *_stream_last_discarded_events,
+ uint64_t stream_discarded_events)
+{
+ uint64_t stream_last_discarded_events = *_stream_last_discarded_events;
+ uint64_t stream_delta = 0;
+
+ if (stream_discarded_events < stream_last_discarded_events) {
+ if (CAA_BITS_PER_LONG >= 64) {
+ ERR("Unexpected events discarded counter 64-bit overflow: prev = %" PRIu64 " current = %" PRIu64,
+ stream_last_discarded_events, stream_discarded_events);
+ /*
+ * Unexpected counter overflow: don't update the counter,
+ * so if this is caused by a race condition, we can
+ * recover on the next aggregation.
+ */
+ return;
+ } else {
+ /*
+ * A 32-bit overflow is detected. We assume only one
+ * wrap-around has occurred.
+ */
+ stream_delta += 1ULL << 32;
+ }
+ }
+ stream_delta += stream_discarded_events - stream_last_discarded_events;
+ *_chan_discarded_events += stream_delta;
+ *_stream_last_discarded_events = stream_discarded_events;
+}
+
/* Only used for data streams. */
static int consumer_stream_update_stats(struct lttng_consumer_stream *stream,
const struct stream_subbuffer *subbuf)
{
int ret = 0;
uint64_t sequence_number;
- const uint64_t discarded_events = subbuf->info.data.events_discarded;

if (!subbuf->info.data.sequence_number.is_set) {
/* Command not supported by the tracer. */
@@ -111,18 +140,9 @@
goto end;
}
stream->last_sequence_number = sequence_number;
-
- if (discarded_events < stream->last_discarded_events) {
- /*
- * Overflow has occurred. We assume only one wrap-around
- * has occurred.
- */
- stream->chan->discarded_events += (1ULL << (CAA_BITS_PER_LONG - 1)) -
- stream->last_discarded_events + discarded_events;
- } else {
- stream->chan->discarded_events += discarded_events - stream->last_discarded_events;
- }
- stream->last_discarded_events = discarded_events;
+ aggregate_discarded_events(&stream->chan->discarded_events,
+ &stream->last_discarded_events,
+ subbuf->info.data.events_discarded);
ret = 0;

end:
20 changes: 20 additions & 0 deletions packages/lttng-tools/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,43 @@ class LttngTools(AutotoolsPackage):

homepage = "https://lttng.org"
url = "https://lttng.org/files/lttng-tools/lttng-tools-2.12.0.tar.bz2"
git = "https://github.com/lttng/lttng-tools.git"

maintainers = ['Kerilk']

version('master', branch='master')
version('2.13.9', sha256='8d94dc95b608cf70216b01203a3f8242b97a232db2e23421a2f43708da08f337')
version('2.12.11', sha256='40a394400aa751231116602a0a53f6943237c56f25c53f422b5b4b38361b96b8')
version('2.12.0', sha256='405661d27617dc79a42712174a051a45c7ca12d167576c0d93f2de708ed29445')
version('2.11.3', sha256='d7e50f5fe3782e4d2d95ed7021c11a703ab8a3272d8473e0bdb4e37c1990a2c2')
version('2.10.11', sha256='3cb7341d2802ba154f6863c5c20368f8273173ab7080c3ae1ae7180ac7a6f8c5')

variant('man-pages', default=False, description='Build man pages')

depends_on('lttng-ust@master', when='@master')
depends_on('lttng-ust@2.13.0:2.13.999', when='@2.13')
depends_on('lttng-ust@2.12.0:2.12.999', when='@2.12')
depends_on('lttng-ust@2.11.0:2.11.999', when='@2.11')
depends_on('lttng-ust@2.10.0:2.10.999', when='@2.10')

with when("+man-pages"):
depends_on('asciidoc@8.6.8:', type='build')
depends_on('xmlto@0.0.25:', type='build')

depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('libuuid')
depends_on('popt@1.13:')
depends_on('userspace-rcu@0.14.0:', when='@2.14:')
depends_on('userspace-rcu@0.11.0:', when='@2.11:')
depends_on('userspace-rcu@0.9.0:', when='@:2.10.999')
depends_on('libxml2@2.7.6:')
depends_on('pkg-config')

patch('71540e4.ring_buffer_lost.diff', when='@2.14:')

def configure_args(self):
args = []
args.extend(self.enable_or_disable("man-pages"))
return args
Loading
Loading