Julien Desfossez | 21 Nov 22:55 2014

[BABELTRACE PATCH] Automatic Python trace parser generator

This script takes a trace in parameter and generates a ready to use
Python script customized for the events and fields present in the trace.

Signed-off-by: Julien Desfossez <jdesfossez <at> efficios.com>
---
 bindings/python/examples/parser_generator.py | 150 +++++++++++++++++++++++++++
 1 file changed, 150 insertions(+)
 create mode 100755 bindings/python/examples/parser_generator.py

diff --git a/bindings/python/examples/parser_generator.py b/bindings/python/examples/parser_generator.py
new file mode 100755
index 0000000..ad219bd
--- /dev/null
+++ b/bindings/python/examples/parser_generator.py
 <at>  <at>  -0,0 +1,150  <at>  <at> 
+#!/usr/bin/env python3
+#
+# Copyright 2014 Julien Desfossez <jdesfossez <at> efficios.com>
+#
+# This script takes a trace in argument and generates a Python parser ready to
+# process the events (and all the fields) of the trace. It is used to generate
+# all the boilerplate required to create an analysis script of a CTF trace in
+# Python and allow the user to focus on the core logic of the analysis.
+#
+# The default resulting script can process all the events of the trace, and
+# print all the fields for each event (except if you pass -q/--quiet). At the
+# end of the trace, it displays also global statistics about the number of each
+# event encountered.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
(Continue reading)

Mathieu Desnoyers | 21 Nov 18:49 2014

[PATCH lttng-tools] Fix: relayd viewer stream: unhandled out of memory error

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 src/bin/lttng-relayd/viewer-stream.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/bin/lttng-relayd/viewer-stream.c b/src/bin/lttng-relayd/viewer-stream.c
index 2f5d6f7..3748629 100644
--- a/src/bin/lttng-relayd/viewer-stream.c
+++ b/src/bin/lttng-relayd/viewer-stream.c
 <at>  <at>  -58,8 +58,16  <at>  <at>  struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
 	vstream->session_id = stream->session_id;
 	vstream->stream_handle = stream->stream_handle;
 	vstream->path_name = strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
+	if (vstream->path_name == NULL) {
+		PERROR("relay viewer path_name alloc");
+		goto error;
+	}
 	vstream->channel_name = strndup(stream->channel_name,
 			LTTNG_VIEWER_NAME_MAX);
+	if (vstream->channel_name == NULL) {
+		PERROR("relay viewer channel_name alloc");
+		goto error;
+	}
 	vstream->tracefile_count = stream->tracefile_count;
 	vstream->metadata_flag = stream->metadata_flag;
 	vstream->tracefile_count_last = -1ULL;
--

-- 
2.1.1
Mathieu Desnoyers | 21 Nov 18:47 2014

[PATCH lttng-tools] Fix: lttng-relayd: unhandled out of memory error

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 src/bin/lttng-relayd/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
index c9f2021..27a428a 100644
--- a/src/bin/lttng-relayd/main.c
+++ b/src/bin/lttng-relayd/main.c
 <at>  <at>  -234,6 +234,11  <at>  <at>  int set_option(int opt, const char *arg, const char *optname)
 		break;
 	case 'g':
 		tracing_group_name = strdup(arg);
+		if (tracing_group_name == NULL) {
+			ret = -errno;
+			PERROR("strdup");
+			goto end;
+		}
 		tracing_group_name_override = 1;
 		break;
 	case 'h':
--

-- 
2.1.1
Mathieu Desnoyers | 21 Nov 18:42 2014

[PATCH lttng-tools] Fix: relayd: unbalanced RCU read lock/unlock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 src/bin/lttng-relayd/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
index 03ea108..c9f2021 100644
--- a/src/bin/lttng-relayd/main.c
+++ b/src/bin/lttng-relayd/main.c
 <at>  <at>  -2616,6 +2616,7  <at>  <at>  restart:

 				if (revents & LPOLLIN) {
 					if (conn->type != RELAY_DATA) {
+						rcu_read_unlock();
 						continue;
 					}

--

-- 
2.1.1
Mathieu Desnoyers | 21 Nov 18:38 2014

[PATCH lttng-tools] Fix: relayd: unbalanced RCU read-side lock/unlock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 src/bin/lttng-relayd/live.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c
index a76f530..93d458b 100644
--- a/src/bin/lttng-relayd/live.c
+++ b/src/bin/lttng-relayd/live.c
 <at>  <at>  -1318,7 +1318,7  <at>  <at>  int viewer_get_next_index(struct relay_connection *conn)
 	ret = check_index_status(vstream, rstream, ctf_trace, &viewer_index);
 	pthread_mutex_unlock(&rstream->viewer_stream_rotation_lock);
 	if (ret < 0) {
-		goto end;
+		goto end_unlock;
 	} else if (ret == 1) {
 		/*
 		 * This means the viewer index data structure has been populated by the
--

-- 
2.1.1
Mathieu Desnoyers | 21 Nov 18:36 2014

[PATCH lttng-tools] Cleanup: spaghetti function return path

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 src/bin/lttng-relayd/live.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c
index 2940b2c..a76f530 100644
--- a/src/bin/lttng-relayd/live.c
+++ b/src/bin/lttng-relayd/live.c
 <at>  <at>  -804,14 +804,9  <at>  <at>  int viewer_list_sessions(struct relay_connection *conn)
 	}
 	health_code_update();

-	rcu_read_unlock();
 	ret = 0;
-	goto end;
-
 end_unlock:
 	rcu_read_unlock();
-
-end:
 	return ret;
 }

--

-- 
2.1.1
Mathieu Desnoyers | 21 Nov 18:31 2014

[PATCH lttng-tools] Fix: Live tracing does not honor live timer after first tracefile with tracefile rotation

When we pass to the 2nd sub-file (or following sub-files) of a stream in
relayd, the live timer has no visible effect from a live reader
perspective, and then everything is flushed when we reach the following
sub-file.

This is caused by the reset of stream->total_index_received after each
tracefile rotation. It should keep on incrementing to match what is
expected by check in check_index_status():

  (rstream->total_index_received <= vstream->last_sent_index)

Fixes #863

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 src/bin/lttng-relayd/main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
index 00b8735..03ea108 100644
--- a/src/bin/lttng-relayd/main.c
+++ b/src/bin/lttng-relayd/main.c
 <at>  <at>  -2333,7 +2333,6  <at>  <at>  int relay_process_data(struct relay_connection *conn)
 				stream->tracefile_size, stream->tracefile_count,
 				relayd_uid, relayd_gid, stream->fd,
 				&(stream->tracefile_count_current), &stream->fd);
-		stream->total_index_received = 0;
 		pthread_mutex_unlock(&stream->viewer_stream_rotation_lock);
 		if (ret < 0) {
 			ERR("Rotating stream output file");
(Continue reading)

Jérémie Galarneau | 20 Nov 20:27 2014

Re: CTF stress tests

CC-ing lttng-dev since this applies to Babeltrace.

On Tue, Nov 18, 2014 at 9:50 AM, Matthew Khouzam
<matthew.khouzam <at> ericsson.com> wrote:
> Hi,
> I was looking into the CTF stress tests.
> They are good, but I don't know if we want them in our standard test
> cases. They basically check the scalability of the computer it is being
> run on in most cases and in all cases, the test of reading 12g of files

I respectfully disagree.

In most tests, there is definitely a smart way to deal with the trace.
That is not to say that all implementations are expected to support
every imaginable test cases. However, they should strive to, at the
very least, gracefully handle failures to read traces and document their
limitations as the spec imposes very few.

While I agree that some of these tests are far-fetched (you're not likely
to see a CTF trace with a 32 768 level deep structure any time soon),
traces with enough streams to exhaust the max fd count are not
far-fetched at all. In fact, tracing any decently-sized cluster will bust
that limit in no time.

Handling a multi-megabyte sequence (~100mb), something that
Babeltrace can't do at the moment, may seem unreasonable at first.
It quickly becomes very pertinent when people start talking of core
dumping to a CTF trace.

> is rather prohibitive. That being said, maybe having this as a weekly
(Continue reading)

Mathieu Desnoyers | 20 Nov 07:40 2014

[PATCH lttng-tools v2] Fix: add missing synchronization point for before app test case

Fixes a race where the application could generate all its events before
trace start.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 .../regression/tools/snapshots/test_ust_streaming  |  2 +-
 tests/regression/tools/snapshots/ust_test          |  2 +-
 tests/regression/tools/streaming/test_ust          | 21 ++++++--
 .../regression/ust/before-after/test_before_after  | 11 ++--
 tests/regression/ust/buffers-pid/test_buffers_pid  | 26 ++++++---
 tests/regression/ust/java-jul/test_java_jul        | 11 +++-
 tests/regression/ust/java-log4j/test_java_log4j    | 11 +++-
 tests/regression/ust/nprocesses/test_nprocesses    | 14 +++--
 .../test_periodical_metadata_flush                 |  2 +-
 .../utils/testapp/gen-ust-events/gen-ust-events.c  | 63 +++++++++++++++++-----
 10 files changed, 126 insertions(+), 37 deletions(-)

diff --git a/tests/regression/tools/snapshots/test_ust_streaming b/tests/regression/tools/snapshots/test_ust_streaming
index 55c1087..ef38bd5 100755
--- a/tests/regression/tools/snapshots/test_ust_streaming
+++ b/tests/regression/tools/snapshots/test_ust_streaming
 <at>  <at>  -58,7 +58,7  <at>  <at>  function snapshot_add_output ()
 # Start trace application and return once one event has been hit.
 function start_test_app()
 {
-	local tmp_file="/tmp/lttng_test_ust.42.file"
+	local tmp_file=$(mktemp -u)

 	# Start application with a temporary file.
 	$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $tmp_file &
(Continue reading)

Mathieu Desnoyers | 19 Nov 22:40 2014

[PATCH lttng-tools 0/8] Fix racy lttng-tools tests

Mathieu Desnoyers (8):
  Fix: tests: don't use pidof to wait for test apps
  Fix: test flaky sleep and wait patterns
  Document test anti-patterns
  Fix: tests: add missing wait, document missing synchro
  Fix: high throughput test: reset bw limit on sigterm
  Fix: tests: remove killall, add missing SIGTERM handlers
  Fix: tests: wait output hide Terminate errors
  Fix: add missing synchronization point for before app test case

 tests/Makefile.am                                  |  2 +-
 tests/README                                       | 63 +++++++++++++++++
 tests/regression/tools/live/test_kernel            | 12 ++--
 tests/regression/tools/live/test_ust               | 12 ++--
 .../regression/tools/live/test_ust_tracefile_count | 12 ++--
 tests/regression/tools/mi/test_mi                  |  6 +-
 .../regression/tools/snapshots/test_ust_streaming  | 45 +++++++------
 tests/regression/tools/snapshots/ust_test          | 28 +++++---
 .../tools/streaming/test_high_throughput_limits    | 16 ++---
 tests/regression/tools/streaming/test_kernel       |  7 --
 tests/regression/tools/streaming/test_ust          | 26 +++++++-
 .../regression/ust/before-after/test_before_after  | 14 +++-
 tests/regression/ust/buffers-pid/test_buffers_pid  | 50 ++++++++------
 .../ust/high-throughput/test_high_throughput       |  9 ++-
 tests/regression/ust/java-jul/test_java_jul        | 19 +++++-
 tests/regression/ust/java-log4j/test_java_log4j    | 19 ++++--
 .../ust/multi-session/test_multi_session           |  2 +-
 tests/regression/ust/nprocesses/test_nprocesses    | 37 ++++++----
 tests/regression/ust/overlap/test_overlap          |  3 +-
 .../test_periodical_metadata_flush                 | 78 ++++++++++++++++------
(Continue reading)

Eugene Ivanov | 19 Nov 12:35 2014

Question about TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE

Hi,

I found description of TRACEPOINT_EVENT_CLASS on the website and in ust-tracepoint-event.h as well, but it is not documented in the lttng-ust man page. According the header TRACEPOINT_EVENT_INSTANCE declares an instance of a tracepoint, with its own provider and name. Does it mean that I can define classes for usage in different providers? Why do we need provider in _CLASS then? According the code on the first glance it seems that it is required that CLASS and INSTANCE must share in same provider.

--
Eugene
_______________________________________________
lttng-dev mailing list
lttng-dev <at> lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Gmane