Ikaheimonen, JP | 20 May 2013 10:34
Favicon

[Babeltrace PATCH 00/01] Move strerror_r to compat directory

Hi,

I separated this patch from my MinGW-specific patch set into a separate (one-patch) set.
This particular change is not MinGW-specific, and should be applied separately.
The upcoming MinGW patch set will require this patch as well.

I hope to have implemented all the changes that were commented upon.
These include:

- The new function compat_strerror_r is a static inline function, completely defined in the header file.
- Because there are no new .c files, there are fewer changes to the build files.
- The new code follows the coding conventions of this community.

Cheers,
JP Ikaheimonen | SW Development Engineer http://go.mentor.com/sourceryanalyzer

Mentor Embedded(tm) | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Ikaheimonen, JP | 20 May 2013 10:34
Favicon

[Babeltrace PATCH 01/01] Move strerror_r to compat directory

The usage of strerror_r is platform dependent.
Add new function compat_strerror_r to include/babeltrace/compat/string.h,
and hide the platform-dependent usage there.
Use the aforementioned header file instead of standard string.h where
necessary.
---
 include/Makefile.am                      |  1 +
 include/babeltrace/babeltrace-internal.h | 32 +++-----------------------------
 include/babeltrace/compat/string.h       | 28 ++++++++++++++++++++++++++++
 3 files changed, 32 insertions(+), 29 deletions(-)
 create mode 100644 include/babeltrace/compat/string.h

diff --git a/include/Makefile.am b/include/Makefile.am
index eee2ac1..f121d84 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
 <at>  <at>  -33,5 +33,6  <at>  <at>  noinst_HEADERS = \
 	babeltrace/trace-handle-internal.h \
 	babeltrace/compat/uuid.h \
 	babeltrace/compat/memstream.h \
+	babeltrace/compat/string.h \
 	babeltrace/endian.h \
 	babeltrace/mmap-align.h
diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h
index 9b9ffbd..1f379ee 100644
--- a/include/babeltrace/babeltrace-internal.h
+++ b/include/babeltrace/babeltrace-internal.h
 <at>  <at>  -27,7 +27,7  <at>  <at> 
 #include <stdio.h>
 #include <glib.h>
(Continue reading)

Yang Wang | 17 May 2013 18:15
Picon

Mariadb+LTTng 2.x

I have ported Mariadb+UST1.0 to Mariadb+LTTng 2.0. 
but when I initialize system tables 

scripts/mysql_install_db --basedir=/usr/local/mysql --user=mysql

It reports

libust[7848/7853]: Error: incorrect message size: 292
 (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523)
libust[7848/7853]: Error: incorrect message size: 292
 (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523)
libust[7848/7853]: Error: incorrect message size: 292
 (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523)
130517 13:12:20 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

I am using lttng-ust-2.1.2

Could anyone help me figure out the reason?

Thanks

Yang
Stéphane ANCELOT | 17 May 2013 16:58
Picon
Favicon

newbie and kernel trace

Hi,

I am trying to reimplement LTTNG 2. in xenomai api.

the main problem is that I do not sea any of my new events available in 
lttng 2.

my kernel compiles fine and  here is what I done to set it up :

file include/trace/events/pod.h :

#undef TRACE_SYSTEM
#define TRACE_SYSTEM xenotrace

#if !defined(_XENOTRACE_H) || defined(TRACE_HEADER_MULTI_READ)

#define _XENOTRACE_H

#include <linux/tracepoint.h>

TRACE_EVENT(    xn_nucleus_thread_init,
                 TP_PROTO(struct xnthread *thread,char 
*thread_name,xnflags_t flags,const char *class,int prio),
                 TP_ARGS(thread,thread_name,flags,class,prio),

                 TP_STRUCT__entry(
                  __field(struct xnthread *,thread)
                  __array(char ,thread_name,      XNOBJECT_NAME_LEN   )
                  __field(xnflags_t,flags)
                  __array(char,class,      XNOBJECT_NAME_LEN  )
(Continue reading)

Ionut D. | 17 May 2013 07:32
Picon

LTTNG on Android ICS

Hello all,

Recently I started to integrate LTTNG in Android ICS by compiling each package, each dependency, by using the Android build system. It is a lot of work because I met different problems and to be sincere, I do not know if at the end will work and I do not know how much I will need to modify the sources in order to work.

My questions are about this integration. I mention that I read a lot of discussions about this on Internet, on this mailing list, but the things are still not very clear for me.

It is ok? what I am trying to do ? to integrate and build by using the Android build system.
Could you give me some guidelines, indications about how I should proceed, maybe a tutorial or maybe some android make files/patches that would help me to see how the job must be done and if I am doing it right ?

Until now I managed to build lttng-modules, liburcu, libuuid from util-linux and configure lttng-ust by using the android toolchain for arm. I got a lot of errors but until now I managed to configure/make these packages.

I mention that I am trying to build lttng 2.x on ICS 4.0.3.

Would be great if you will give me a tutorial about how to do it.

Ionut
_______________________________________________
lttng-dev mailing list
lttng-dev <at> lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
David Goulet | 16 May 2013 16:42

[PATCH 2/3 lttng-tools v2] Change consumer_metadata_pipe to be a lttng_pipe

The read() call in the metadata thread is also changed to use the lttng
pipe read wrapper.

Signed-off-by: David Goulet <dgoulet <at> efficios.com>
---
 src/common/consumer.c                        |   58 +++++++++-----------------
 src/common/consumer.h                        |    2 +-
 src/common/kernel-consumer/kernel-consumer.c |    2 +-
 src/common/ust-consumer/ust-consumer.c       |    2 +-
 4 files changed, 22 insertions(+), 42 deletions(-)

diff --git a/src/common/consumer.c b/src/common/consumer.c
index ca51ce0..c63e6e6 100644
--- a/src/common/consumer.c
+++ b/src/common/consumer.c
 <at>  <at>  -77,21 +77,6  <at>  <at>  static struct lttng_ht *metadata_ht;
 static struct lttng_ht *data_ht;

 /*
- * Notify a thread pipe to poll back again. This usually means that some global
- * state has changed so we just send back the thread in a poll wait call.
- */
-static void notify_thread_pipe(int wpipe)
-{
-	int ret;
-
-	do {
-		struct lttng_consumer_stream *null_stream = NULL;
-
-		ret = write(wpipe, &null_stream, sizeof(null_stream));
-	} while (ret < 0 && errno == EINTR);
-}
-
-/*
  * Notify a thread lttng pipe to poll back again. This usually means that some
  * global state has changed so we just send back the thread in a poll wait
  * call.
 <at>  <at>  -423,7 +408,7  <at>  <at>  static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd,
 	 */
 	if (ctx) {
 		notify_thread_lttng_pipe(ctx->consumer_data_pipe);
-		notify_thread_pipe(ctx->consumer_metadata_pipe[1]);
+		notify_thread_lttng_pipe(ctx->consumer_metadata_pipe);
 	}
 }

 <at>  <at>  -1206,8 +1191,8  <at>  <at>  struct lttng_consumer_local_data *lttng_consumer_create(
 		goto error_channel_pipe;
 	}

-	ret = utils_create_pipe(ctx->consumer_metadata_pipe);
-	if (ret < 0) {
+	ctx->consumer_metadata_pipe = lttng_pipe_open(0);
+	if (!ctx->consumer_metadata_pipe) {
 		goto error_metadata_pipe;
 	}

 <at>  <at>  -1219,7 +1204,7  <at>  <at>  struct lttng_consumer_local_data *lttng_consumer_create(
 	return ctx;

 error_splice_pipe:
-	utils_close_pipe(ctx->consumer_metadata_pipe);
+	lttng_pipe_destroy(ctx->consumer_metadata_pipe);
 error_metadata_pipe:
 	utils_close_pipe(ctx->consumer_channel_pipe);
 error_channel_pipe:
 <at>  <at>  -1254,6 +1239,7  <at>  <at>  void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx)
 	utils_close_pipe(ctx->consumer_thread_pipe);
 	utils_close_pipe(ctx->consumer_channel_pipe);
 	lttng_pipe_destroy(ctx->consumer_data_pipe);
+	lttng_pipe_destroy(ctx->consumer_metadata_pipe);
 	utils_close_pipe(ctx->consumer_should_quit);
 	utils_close_pipe(ctx->consumer_splice_metadata_pipe);

 <at>  <at>  -2134,7 +2120,8  <at>  <at>  void *consumer_thread_metadata_poll(void *data)
 		goto end_poll;
 	}

-	ret = lttng_poll_add(&events, ctx->consumer_metadata_pipe[0], LPOLLIN);
+	ret = lttng_poll_add(&events,
+			lttng_pipe_get_readfd(ctx->consumer_metadata_pipe), LPOLLIN);
 	if (ret < 0) {
 		goto end;
 	}
 <at>  <at>  -2172,30 +2159,26  <at>  <at>  restart:
 				continue;
 			}

-			if (pollfd == ctx->consumer_metadata_pipe[0]) {
+			if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) {
 				if (revents & (LPOLLERR | LPOLLHUP )) {
 					DBG("Metadata thread pipe hung up");
 					/*
 					 * Remove the pipe from the poll set and continue the loop
 					 * since their might be data to consume.
 					 */
-					lttng_poll_del(&events, ctx->consumer_metadata_pipe[0]);
-					ret = close(ctx->consumer_metadata_pipe[0]);
-					if (ret < 0) {
-						PERROR("close metadata pipe");
-					}
+					lttng_poll_del(&events,
+							lttng_pipe_get_readfd(ctx->consumer_metadata_pipe));
+					lttng_pipe_read_close(ctx->consumer_metadata_pipe);
 					continue;
 				} else if (revents & LPOLLIN) {
-					do {
-						/* Get the stream pointer received */
-						ret = read(pollfd, &stream, sizeof(stream));
-					} while (ret < 0 && errno == EINTR);
-					if (ret < 0 ||
-							ret < sizeof(struct lttng_consumer_stream *)) {
-						PERROR("read metadata stream");
+					ssize_t pipe_len;
+
+					pipe_len = lttng_pipe_read(ctx->consumer_metadata_pipe,
+							&stream, sizeof(stream));
+					if (pipe_len < 0) {
+						ERR("read metadata stream, ret: %ld", pipe_len);
 						/*
-						 * Let's continue here and hope we can still work
-						 * without stopping the consumer. XXX: Should we?
+						 * Continue here to handle the rest of the streams.
 						 */
 						continue;
 					}
 <at>  <at>  -2543,10 +2526,7  <at>  <at>  end:
 	 * only tracked fd in the poll set. The thread will take care of closing
 	 * the read side.
 	 */
-	ret = close(ctx->consumer_metadata_pipe[1]);
-	if (ret < 0) {
-		PERROR("close data pipe");
-	}
+	(void) lttng_pipe_write_close(ctx->consumer_metadata_pipe);

 	destroy_data_stream_ht(data_ht);

diff --git a/src/common/consumer.h b/src/common/consumer.h
index 91039e8..3726fd1 100644
--- a/src/common/consumer.h
+++ b/src/common/consumer.h
 <at>  <at>  -351,7 +351,7  <at>  <at>  struct lttng_consumer_local_data {
 	/* to let the signal handler wake up the fd receiver thread */
 	int consumer_should_quit[2];
 	/* Metadata poll thread pipe. Transfer metadata stream to it */
-	int consumer_metadata_pipe[2];
+	struct lttng_pipe *consumer_metadata_pipe;
 };

 /*
diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c
index d8aec49..f23fc9c 100644
--- a/src/common/kernel-consumer/kernel-consumer.c
+++ b/src/common/kernel-consumer/kernel-consumer.c
 <at>  <at>  -288,7 +288,7  <at>  <at>  int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,

 		/* Get the right pipe where the stream will be sent. */
 		if (new_stream->metadata_flag) {
-			stream_pipe = ctx->consumer_metadata_pipe[1];
+			stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe);
 		} else {
 			stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe);
 		}
diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
index ddf80da..a81e9d4 100644
--- a/src/common/ust-consumer/ust-consumer.c
+++ b/src/common/ust-consumer/ust-consumer.c
 <at>  <at>  -189,7 +189,7  <at>  <at>  static int send_stream_to_thread(struct lttng_consumer_stream *stream,

 	/* Get the right pipe where the stream will be sent. */
 	if (stream->metadata_flag) {
-		stream_pipe = ctx->consumer_metadata_pipe[1];
+		stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe);
 	} else {
 		stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe);
 	}
--

-- 
1.7.10.4
Jérémie Galarneau | 15 May 2013 21:21
Gravatar

[PATCH lttng-tools] Tests: Remove temporary trace directory on bail-out

Signed-off-by: Jérémie Galarneau <jeremie.galarneau <at> efficios.com>
---
 tests/utils/test_utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py
index 5e00de4..4b38630 100644
--- a/tests/utils/test_utils.py
+++ b/tests/utils/test_utils.py
 <at>  <at>  -48,8 +48,8  <at>  <at>  def bail(diag, session_info = None):
     if session_info is not None:
         stop_session(session_info, True)

-        if os.path.exists(session_info.trace_path):
-            shutil.rmtree(session_info.trace_path)
+        if os.path.exists(session_info.tmp_directory):
+            shutil.rmtree(session_info.tmp_directory)
     exit(-1)

 def print_test_result(result, number, description):
--

-- 
1.8.2.2

_______________________________________________
lttng-dev mailing list
lttng-dev <at> lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Jérémie Galarneau | 15 May 2013 18:39
Gravatar

[PATCH babeltrace] Fix: Remove extra quote after an include directive

Signed-off-by: Jérémie Galarneau <jeremie.galarneau <at> efficios.com>
---
 formats/ctf/ctf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
index b27f2ec..bb94e52 100644
--- a/formats/ctf/ctf.c
+++ b/formats/ctf/ctf.c
 <at>  <at>  -51,7 +51,7  <at>  <at> 
 #include "metadata/ctf-parser.h"
 #include "metadata/ctf-ast.h"
 #include "events-private.h"
-#include <babeltrace/compat/memstream.h>"
+#include <babeltrace/compat/memstream.h>

 #define LOG2_CHAR_BIT	3

--

-- 
1.8.2.2

_______________________________________________
lttng-dev mailing list
lttng-dev <at> lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
David OShea | 15 May 2013 13:38

Patches to enable building on CentOS 5.x (glibc 2.5)

Hi,

Would contributions of patches to enable lttng-tools and lttng-ust to build with glibc 2.5 (as is shipped
with CentOS 5.x) and to enable lttng-gen-tp to run with Python 2.4 (as shipped on CentOS 5.x) be accepted?

What is missing from glibc 2.5 is:

- a system call wrapper for sched_getcpu()
- a system call wrapper for sync_file_range()
- htobe32() and other similar endian conversion functions

babeltrace and userspace-rcu did not require patching.

Thanks in advance,
David

P.S. If you see this, thanks for all your recent replies, Mathieu, I will try to get back to you soon!

----------------------------------------------------------------------
The information contained in this transmission may be confidential. Any disclosure, copying, or further
distribution of confidential information is not permitted unless such privilege is explicitly granted
in writing by Quantum. Quantum reserves the right to have electronic communications, including email
and attachments, sent across its networks filtered through anti virus and spam software programs and
retain such messages in order to comply with applicable data security and retention requirements.
Quantum is not responsible for the proper and complete transmission of the substance of this
communication or for any delay in its receipt.
Jérémie Galarneau | 15 May 2013 00:13
Gravatar

[PATCH babeltrace] Remove unused array in bt_context_add_traces_recursive


Signed-off-by: Jérémie Galarneau <jeremie.galarneau <at> efficios.com>
---
 converter/babeltrace.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/converter/babeltrace.c b/converter/babeltrace.c
index 2fd371c..1008351 100644
--- a/converter/babeltrace.c
+++ b/converter/babeltrace.c
 <at>  <at>  -490,15 +490,11  <at>  <at>  int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path,
 		void (*packet_seek)(struct bt_stream_pos *pos,
 			size_t offset, int whence))
 {
-
-	GArray *trace_ids;
-	int ret = 0;
+	int ret = 0, trace_ids = 0;

 	/* Should lock traversed_paths mutex here if used in multithread */

 	traversed_paths = g_ptr_array_new();
-	trace_ids = g_array_new(FALSE, TRUE, sizeof(int));
-
 	ret = nftw(path, traverse_trace_dir, 10, 0);

 	/* Process the array if ntfw did not return a fatal error */
 <at>  <at>  -520,7 +516,7  <at>  <at>  int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path,
 				/* Allow to skip erroneous traces. */
 				ret = 1;	/* partial error */
 			} else {
-				g_array_append_val(trace_ids, trace_id);
+				trace_ids++;
 			}
 			g_string_free(trace_path, TRUE);
 		}
 <at>  <at>  -534,11 +530,10  <at>  <at>  int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path,
 	/*
 	 * Return an error if no trace can be opened.
 	 */
-	if (trace_ids->len == 0) {
+	if (trace_ids == 0) {
 		fprintf(stderr, "[error] Cannot open any trace for reading.\n\n");
 		ret = -ENOENT;		/* failure */
 	}
-	g_array_free(trace_ids, TRUE);
 	return ret;
 }

--

-- 
1.8.2.2

_______________________________________________
lttng-dev mailing list
lttng-dev <at> lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Jérémie Galarneau | 15 May 2013 00:08
Gravatar

[PATCH babeltrace] Fix: Suppress a compiler warning (always-false condition)

Clang reports an always-false condition (checking if an unsigned value < 0)
caused by a type mismatch in ctf-visitor-generate-io-struct.c.

Remove trailing whitespaces.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau <at> efficios.com>
---
 formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
index 0002fe4..c4208b7 100644
--- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
+++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
 <at>  <at>  -649,7 +649,7  <at>  <at>  int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope,
 	bt_list_for_each_entry(iter, type_declarators, siblings) {
 		struct bt_declaration *type_declaration;
 		int ret;
-	
+
 		type_declaration = ctf_type_declarator_visit(fd, depth,
 					type_specifier_list,
 					&identifier, iter,
 <at>  <at>  -865,7 +865,6  <at>  <at>  struct bt_declaration *ctf_declaration_struct_visit(FILE *fd,
 		if (name) {
 			if (bt_lookup_struct_declaration(g_quark_from_string(name),
 						      declaration_scope)) {
-				
 				fprintf(fd, "[error] %s: struct %s already declared in scope\n", __func__, name);
 				return NULL;
 			}
 <at>  <at>  -936,7 +935,6  <at>  <at>  struct bt_declaration *ctf_declaration_variant_visit(FILE *fd,
 		if (name) {
 			if (bt_lookup_variant_declaration(g_quark_from_string(name),
 						       declaration_scope)) {
-				
 				fprintf(fd, "[error] %s: variant %s already declared in scope\n", __func__, name);
 				return NULL;
 			}
 <at>  <at>  -1105,7 +1103,6  <at>  <at>  struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
 		if (name) {
 			if (bt_lookup_enum_declaration(g_quark_from_string(name),
 						    declaration_scope)) {
-				
 				fprintf(fd, "[error] %s: enum %s already declared in scope\n", __func__, name);
 				return NULL;
 			}
 <at>  <at>  -1233,7 +1230,7  <at>  <at>  int get_boolean(FILE *fd, int depth, struct ctf_node *unary_expression)
 		fprintf(fd, "[error] %s: unexpected unary expression type\n",
 			__func__);
 		return -EINVAL;
-	} 
+	}

 }

 <at>  <at>  -1479,9 +1476,9  <at>  <at>  struct bt_declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth,
 		struct ctf_trace *trace)
 {
 	struct ctf_node *expression;
-	uint64_t alignment = 1, exp_dig = 0, mant_dig = 0,
-		byte_order = trace->byte_order;
-	int has_alignment = 0, has_exp_dig = 0, has_mant_dig = 0;
+	uint64_t alignment = 1, exp_dig = 0, mant_dig = 0;
+	int byte_order = trace->byte_order, has_alignment = 0,
+		has_exp_dig = 0, has_mant_dig = 0;
 	struct declaration_float *float_declaration;

 	bt_list_for_each_entry(expression, expressions, siblings) {
--

-- 
1.8.2.2

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

Gmane