Jonathan Rajotte Julien | 28 Aug 22:51 2014
Picon

[PATCH lttng-tool] Fix: mi print of probe attributes + validation

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien <at> gmail.com>
---
 src/common/mi-lttng.c   | 37 ++++++++++++++++++++++++++++++++++++-
 src/common/mi_lttng.xsd |  6 +++---
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
index 83df149..a250546 100644
--- a/src/common/mi-lttng.c
+++ b/src/common/mi-lttng.c
 <at>  <at>  -914,6 +914,16  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 {
 	int ret;

+	ret = mi_lttng_writer_open_element(writer, config_element_attributes);
+	if (ret) {
+		goto end;
+	}
+
+	ret = mi_lttng_writer_open_element(writer, config_element_probe_attributes);
+	if (ret) {
+		goto end;
+	}
+
 	if (event->attr.probe.addr != 0) {
 		/* event probe address */
 		ret = mi_lttng_writer_write_element_unsigned_int(writer,
 <at>  <at>  -936,6 +946,9  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 			goto end;
 		}
(Continue reading)

Jérémie Galarneau | 28 Aug 18:53 2014

[PATCH lttng-tools 1/2] Fix: Parenthesize previous statement when adding conditions to a filter

Not parenthesizing the clauses in a filter string causes JUL events to be
traced even though they are not enabled when an enable-event command is
issued with a filter and the --loglevel-only option.

For instance,

lttng enable-event -j "my_event" --loglevel-only JUL_CONFIG -f "int_loglevel > 0 || int_loglevel < 0"

results in the following filter being applied:

int_loglevel > 0 || int_loglevel < 0 && logger_name == "my_event" && int_loglevel == 700

The resulting expression will always evaluate to true, regardless of the logger
name.

This fix parenthesizes each clause to ensure they are all independently
evaluated and not unintuitively affected by operator precedence.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau <at> efficios.com>
---
 src/lib/lttng-ctl/lttng-ctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c
index 9686b7d..f83d053 100644
--- a/src/lib/lttng-ctl/lttng-ctl.c
+++ b/src/lib/lttng-ctl/lttng-ctl.c
 <at>  <at>  -705,7 +705,7  <at>  <at>  static char *set_jul_filter(const char *filter, struct lttng_event *ev)
 	/* Don't add filter for the '*' event. */
 	if (ev->name[0] != '*') {
(Continue reading)

Jonathan Rajotte Julien | 27 Aug 22:56 2014
Picon

[PATCH v2] mi: Fix event attributes printing under attributes element

The event attributes (symbol name, address, and offset) where not
printed under the good element. Furthermore the xsd semantic was invalid
on attributes validation

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien <at> gmail.com>
---
 src/common/mi-lttng.c   | 23 ++++++++++++++++++++++-
 src/common/mi_lttng.xsd | 25 +++++--------------------
 2 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
index 83df149..1f8c4ee 100644
--- a/src/common/mi-lttng.c
+++ b/src/common/mi-lttng.c
 <at>  <at>  -914,6 +914,11  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 {
 	int ret;

+	ret = mi_lttng_writer_open_element(writer, config_element_attributes);
+	if (ret) {
+		goto end;
+	}
+
 	if (event->attr.probe.addr != 0) {
 		/* event probe address */
 		ret = mi_lttng_writer_write_element_unsigned_int(writer,
 <at>  <at>  -936,6 +941,8  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 			goto end;
 		}
 	}
(Continue reading)

Jonathan Rajotte Julien | 27 Aug 22:51 2014
Picon

[PATCH v2] mi: Fix event attributes printing under attributes element

The event attributes (symbol name, address, and offset) where not
printed under the good element. Furthermore the xsd semantic was invalid
on attributes validation

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien <at> gmail.com>
---
 src/common/mi-lttng.c   | 23 ++++++++++++++++++++++-
 src/common/mi_lttng.xsd | 23 ++++-------------------
 2 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
index 83df149..1f8c4ee 100644
--- a/src/common/mi-lttng.c
+++ b/src/common/mi-lttng.c
 <at>  <at>  -914,6 +914,11  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 {
 	int ret;

+	ret = mi_lttng_writer_open_element(writer, config_element_attributes);
+	if (ret) {
+		goto end;
+	}
+
 	if (event->attr.probe.addr != 0) {
 		/* event probe address */
 		ret = mi_lttng_writer_write_element_unsigned_int(writer,
 <at>  <at>  -936,6 +941,8  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 			goto end;
 		}
 	}
(Continue reading)

Jonathan Rajotte Julien | 27 Aug 21:46 2014
Picon

[PATCH lttng-tool] Fix: parse_prob_opts return the actual success of the function

This bug have been triggered by the mi merging and the use of a
command_ret in enable_events functions. Previously, enable_events was
reusing the ret variable for another operation and always replacing ret.
Parse_probe_event returned the last output of sscanf which represent
the number of match and not the success of the operation.

Fixes #830

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien <at> gmail.com>
---
 src/bin/lttng/commands/enable_events.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c
index f62dadb..3263c58 100644
--- a/src/bin/lttng/commands/enable_events.c
+++ b/src/bin/lttng/commands/enable_events.c
 <at>  <at>  -247,26 +247,27  <at>  <at>  static void usage(FILE *ofp)
  */
 static int parse_probe_opts(struct lttng_event *ev, char *opt)
 {
-	int ret;
+	int ret = CMD_SUCCESS;
+	int match;
 	char s_hex[19];
 #define S_HEX_LEN_SCANF_IS_A_BROKEN_API "18"	/* 18 is (19 - 1) (\0 is extra) */
 	char name[LTTNG_SYMBOL_NAME_LEN];

 	if (opt == NULL) {
-		ret = -1;
(Continue reading)

Jonathan Rajotte Julien | 27 Aug 19:07 2014
Picon

[PATCH lttng-tool] mi: Fix event attributes printing under attributes element

The event attributes (symbol name, address, and offset) where not
printed under the good element. Furthermore the xsd semantic was invalid
on attributes validation

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien <at> gmail.com>
---
 src/common/mi-lttng.c   | 23 ++++++++++++++++++++++-
 src/common/mi_lttng.xsd | 23 ++++-------------------
 2 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
index 83df149..1f8c4ee 100644
--- a/src/common/mi-lttng.c
+++ b/src/common/mi-lttng.c
 <at>  <at>  -914,6 +914,11  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 {
 	int ret;

+	ret = mi_lttng_writer_open_element(writer, config_element_attributes);
+	if (ret) {
+		goto end;
+	}
+
 	if (event->attr.probe.addr != 0) {
 		/* event probe address */
 		ret = mi_lttng_writer_write_element_unsigned_int(writer,
 <at>  <at>  -936,6 +941,8  <at>  <at>  int mi_lttng_event_function_probe(struct mi_writer *writer,
 			goto end;
 		}
 	}
(Continue reading)

Jessica Foest | 27 Aug 05:21 2014
Picon

PERF PARAMETERS

Hi 

i tried to retrieve system calls traces with all perf context parameters . the problem is that only a few PERF counters are activated and lttng fails to activate  the other perf context parameters.
how can i solve it ?

regards 
_______________________________________________
lttng-dev mailing list
lttng-dev <at> lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Umut Tezduyar Lindskog | 26 Aug 16:27 2014
Picon

[PATCH lttng-tools] Load modules through kmod

Instead of forking processes, load modules through libkmod.

This adds a package dependency to kmod but can be disabled
by --disable-kmod option in ./configure.

The startup time has decreased by %36 on our embedded mips
product. The measurement is done by cgroup cpu shares.
---
 configure.ac                      |   34 ++++++++++++++++++++++++
 src/bin/lttng-sessiond/modprobe.c |   53 +++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+)

diff --git a/configure.ac b/configure.ac
index a8e04f5..b36a95d 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -200,6 +200,32  <at>  <at>  AC_CHECK_DECL([cmm_smp_mb__before_uatomic_or], [],
         [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
 )

+# Check kmod library
+AC_ARG_WITH(kmod-prefix,
+  AS_HELP_STRING([--with-kmod-prefix=PATH],
+                 [Specify the installation prefix of the kmod library.
+	          Headers must be in PATH/include; libraries in PATH/lib.]),
+		  [
+		    CPPFLAGS="$CPPFLAGS -I${withval}/include"
+		    LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib"
+		  ])
+
+AC_ARG_ENABLE(kmod,
+	AS_HELP_STRING([--disable-kmod],[build without kmod support]),
+	kmod_support=$enableval, kmod_support=yes)
+
+AS_IF([test "x$kmod_support" = "xyes"], [
+	AC_CHECK_LIB([kmod], [kmod_module_probe_insert_module],
+		[
+			AC_DEFINE([HAVE_KMOD], [1], [has kmod support])
+			LIBS="$LIBS -lkmod"
+			kmod_found=yes
+		],
+		[AC_MSG_ERROR([Cannot find kmod >= 5. Use --with-kmod-prefix=PREFIX to specify its location, or
specify --disable-kmod to build lttng-tools without kmod support.])]
+	)
+])
+AM_CONDITIONAL([HAVE_KMOD], [test "x$kmod_found" = xyes])
+
 AC_ARG_WITH(lttng-ust-prefix,
   AS_HELP_STRING([--with-lttng-ust-prefix=PATH],
                  [Specify the installation prefix of the lttng-ust library.
 <at>  <at>  -483,6 +509,14  <at>  <at>  done
 AS_ECHO_N("Target architecture: ")
 AS_ECHO($target_arch)

+# kmod enabled/disabled
+AS_ECHO_N("kmod support: ")
+AS_IF([test "x$kmod_support" = "xyes"],[
+	AS_ECHO("Enabled")
+],[
+	AS_ECHO("Disabled")
+])
+
 # LTTng-UST enabled/disabled
 AS_ECHO_N("Lttng-UST support: ")
 AS_IF([test "x$lttng_ust_support" = "xyes"],[
diff --git a/src/bin/lttng-sessiond/modprobe.c b/src/bin/lttng-sessiond/modprobe.c
index 3cc67f0..40a2ee0 100644
--- a/src/bin/lttng-sessiond/modprobe.c
+++ b/src/bin/lttng-sessiond/modprobe.c
 <at>  <at>  -164,6 +164,58  <at>  <at>  void modprobe_remove_lttng_all(void)
 	modprobe_remove_lttng_control();
 }

+#if HAVE_KMOD
+#include <libkmod.h>
+static void log_kmod(void *data, int priority, const char *file, int line,
+		     const char *fn, const char *format, va_list args)
+{
+	char *str;
+	if (vasprintf(&str, format, args) < 0)
+		return;
+	DBG("libkmod: %s", str);
+	free(str);
+}
+static int modprobe_lttng(struct kern_modules_param *modules,
+			  int entries, int required)
+{
+	int ret = 0, i;
+	struct kmod_ctx *ctx;
+
+	ctx = kmod_new(NULL, NULL);
+	if (!ctx) {
+		PERROR("Unable to create kmod library context");
+		ret = -ENOMEM;
+		goto error;
+	}
+
+	kmod_set_log_fn(ctx, log_kmod, NULL);
+	kmod_load_resources(ctx);
+
+	for (i = 0; i < entries; i++) {
+		struct kmod_module *mod = NULL;
+
+		ret = kmod_module_new_from_name(ctx, modules[i].name, &mod);
+		if (ret < 0) {
+			PERROR("Failed to create kmod module for %s", modules[i].name);
+			goto error;
+		}
+
+		ret = kmod_module_probe_insert_module(mod, KMOD_PROBE_IGNORE_LOADED, NULL, NULL, NULL, NULL);
+		if (required && ret < 0) {
+			ERR("Unable to load module %s", modules[i].name);
+		} else {
+			DBG("Modprobe successfully %s", modules[i].name);
+		}
+
+		kmod_module_unref(mod);
+	}
+
+error:
+	if (ctx)
+		kmod_unref(ctx);
+	return ret;
+}
+#else
 static int modprobe_lttng(struct kern_modules_param *modules,
 			  int entries, int required)
 {
 <at>  <at>  -194,6 +246,7  <at>  <at>  static int modprobe_lttng(struct kern_modules_param *modules,
 error:
 	return ret;
 }
+#endif

 /*
  * Load control kernel module(s).
--

-- 
1.7.10.4
Jonathan Rajotte Julien | 22 Aug 22:25 2014
Picon

[PATCH lttng-tool] Fix: list without a name is not an error

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien <at> gmail.com>
---
 src/bin/lttng/commands/list.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c
index ccffdc7..bd96f88 100644
--- a/src/bin/lttng/commands/list.c
+++ b/src/bin/lttng/commands/list.c
 <at>  <at>  -1251,7 +1251,6  <at>  <at>  static int list_sessions(const char *session_name)
 		/* Pretty print */
 		if (count == 0) {
 			MSG("Currently no available tracing session");
-			ret = CMD_ERROR;
 			goto end;
 		}

--

-- 
2.0.4
tarek slaymia | 21 Aug 01:15 2014
Picon

Question about how to retrieve ip value of a syscall

Hi all ,
i tried to implement an event in statedump in order to compare the runtime syscall address and the syscall symbol address ( the same address displayed in ip field when i use lttng kprobe ).

did you know how can i retrieve the syscall symbol value using my function in lttng-statedump-impl.c file ?
i have an other issue when i tried to list all kernel event , the new event that i add in lttng-module isn't displayed . did i miss something ?

you find in attachment the additional code .

BR
Attachment (lttng-statedump.h): text/x-chdr, 7173 bytes
_______________________________________________
lttng-dev mailing list
lttng-dev <at> lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
ChitlurSrinivasa, Venkatesh | 20 Aug 20:58 2014
Picon

Cost of user space tracepoint()

I am sure you guys will do regular performance runs on different versions of LTTng, but I couldn't find any links to the latest results. I was trying to find the cost of a tracepoint() recording one integer. On CPU Intel Xeon E5-2680 v2 <at> 2.80GHz​, running Linux 3.6.11​ and lttng 2.4.1,  I am getting about 927 cycles (9270692144 cycles for 10000000​ iterations). This seems to be lot higher than the documented results . In the paper https://lttng.org/files/papers/desnoyers.pdf  the average cost of tracepoint() with older ltt-usertrace-fast tracepoint is 297 cycles. Another link http://lttng.org/files/thesis/desnoyers-thesis-defense-2009-12-e1.pdf says cache hot tracepoint() cost is 238 cycles.


It appears that in spite of better cpu, and newer version of lttng and kernel I am seeing higher cost. Am I missing something here? Do I need to enable certain features of kernel/cpu ?


VBabu

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

Gmane