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
Eric Wong | 18 Aug 07:02 2014
Picon

[PATCH urcu] wfstack: implement mutex-free wfstack with transparent union

This saves space for users who use alternative synchronization
mechanisms.

Signed-off-by: Eric Wong <normalperson <at> yhbt.net>
Cc: Paul E. McKenney <paulmck <at> linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs <at> cn.fujitsu.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers <at> efficios.com>
---
 urcu/static/wfstack.h | 18 +++++++++++++++---
 urcu/wfstack.h        | 23 +++++++++++++++++++++--
 wfstack.c             |  9 +++++++--
 3 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/urcu/static/wfstack.h b/urcu/static/wfstack.h
index db0d5b8..eb12f37 100644
--- a/urcu/static/wfstack.h
+++ b/urcu/static/wfstack.h
 <at>  <at>  -77,6 +77,14  <at>  <at>  void _cds_wfs_node_init(struct cds_wfs_node *node)
 }

 /*
+ * __cds_wfs_init: initialize wait-free stack.
+ */
+static inline void ___cds_wfs_init(struct __cds_wfs_stack *s)
+{
+	s->head = CDS_WFS_END;
+}
+
+/*
  * cds_wfs_init: initialize wait-free stack.
  */
 static inline
 <at>  <at>  -99,8 +107,10  <at>  <at>  static inline bool ___cds_wfs_end(void *node)
  *
  * No memory barrier is issued. No mutual exclusion is required.
  */
-static inline bool _cds_wfs_empty(struct cds_wfs_stack *s)
+static inline bool _cds_wfs_empty(cds_wfs_stack_ptr_t u_stack)
 {
+	struct __cds_wfs_stack *s = u_stack._s;
+
 	return ___cds_wfs_end(CMM_LOAD_SHARED(s->head));
 }

 <at>  <at>  -114,8 +124,9  <at>  <at>  static inline bool _cds_wfs_empty(struct cds_wfs_stack *s)
  * Returns non-zero otherwise.
  */
 static inline
-int _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
+int _cds_wfs_push(cds_wfs_stack_ptr_t u_stack, struct cds_wfs_node *node)
 {
+	struct __cds_wfs_stack *s = u_stack._s;
 	struct cds_wfs_head *old_head, *new_head;

 	assert(node->next == NULL);
 <at>  <at>  -269,8 +280,9  <at>  <at>  ___cds_wfs_pop_nonblocking(struct cds_wfs_stack *s)
  */
 static inline
 struct cds_wfs_head *
-___cds_wfs_pop_all(struct cds_wfs_stack *s)
+___cds_wfs_pop_all(cds_wfs_stack_ptr_t u_stack)
 {
+	struct __cds_wfs_stack *s = u_stack._s;
 	struct cds_wfs_head *head;

 	/*
diff --git a/urcu/wfstack.h b/urcu/wfstack.h
index fc0b44b..8d6f22c 100644
--- a/urcu/wfstack.h
+++ b/urcu/wfstack.h
 <at>  <at>  -83,11 +83,25  <at>  <at>  struct cds_wfs_head {
 	struct cds_wfs_node node;
 };

+struct __cds_wfs_stack {
+	struct cds_wfs_head *head;
+};
+
 struct cds_wfs_stack {
 	struct cds_wfs_head *head;
 	pthread_mutex_t lock;
 };

+/*
+ * The transparent union allows calling functions that work on both
+ * struct cds_wfcq_head and struct __cds_wfcq_head on any of those two
+ * types.
+ */
+typedef union __attribute__((__transparent_union__)) {
+	struct __cds_wfs_stack *_s;
+	struct cds_wfs_stack *s;
+} cds_wfs_stack_ptr_t;
+
 #ifdef _LGPL_SOURCE

 #include <urcu/static/wfstack.h>
 <at>  <at>  -136,11 +150,16  <at>  <at>  extern void cds_wfs_node_init(struct cds_wfs_node *node);
 extern void cds_wfs_init(struct cds_wfs_stack *s);

 /*
+ * __cds_wfs_init: initialize wait-free stack.
+ */
+extern void __cds_wfs_init(struct __cds_wfs_stack *s);
+
+/*
  * cds_wfs_empty: return whether wait-free stack is empty.
  *
  * No memory barrier is issued. No mutual exclusion is required.
  */
-extern bool cds_wfs_empty(struct cds_wfs_stack *s);
+extern bool cds_wfs_empty(cds_wfs_stack_ptr_t u_stack);

 /*
  * cds_wfs_push: push a node into the stack.
 <at>  <at>  -151,7 +170,7  <at>  <at>  extern bool cds_wfs_empty(struct cds_wfs_stack *s);
  * Returns 0 if the stack was empty prior to adding the node.
  * Returns non-zero otherwise.
  */
-extern int cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node);
+extern int cds_wfs_push(cds_wfs_stack_ptr_t u_stack, struct cds_wfs_node *node);

 /*
  * cds_wfs_pop_blocking: pop a node from the stack.
diff --git a/wfstack.c b/wfstack.c
index c8bd7e6..fec9e47 100644
--- a/wfstack.c
+++ b/wfstack.c
 <at>  <at>  -38,6 +38,11  <at>  <at>  void cds_wfs_init(struct cds_wfs_stack *s)
 	_cds_wfs_init(s);
 }

+void __cds_wfs_init(struct __cds_wfs_stack *s)
+{
+	___cds_wfs_init(s);
+}
+
 bool cds_wfs_empty(struct cds_wfs_stack *s)
 {
 	return _cds_wfs_empty(s);
 <at>  <at>  -112,7 +117,7  <at>  <at>  struct cds_wfs_node *
 	return ___cds_wfs_pop_with_state_nonblocking(s, state);
 }

-struct cds_wfs_head *__cds_wfs_pop_all(struct cds_wfs_stack *s)
+struct cds_wfs_head *__cds_wfs_pop_all(cds_wfs_stack_ptr_t u_stack)
 {
-	return ___cds_wfs_pop_all(s);
+	return ___cds_wfs_pop_all(u_stack);
 }
--

-- 
EW
Jonathan Rajotte | 16 Aug 22:59 2014
Picon

Fwd: [PATCH lttng-tool] Fix: list command: revert merge error made when adding mi on pretty printing

Actually if you want to preserve the original behaviour from 2.5 you
want to remove them.

This code path is for listing all the sessions. Not for the individual listing.

Here the code from the "all listing" path in 2.5

MSG("  %d) %s (%s) [%s%s]", i + 1, sessions[i].name, sessions[i].path,
active_string(sessions[i].enabled),
snapshot_string(sessions[i].snapshot_mode));

I don't mind you telling me that we can add the trace path and the
live timer now that we have mi.
But as long as we talk about this patch, it revert to the original
behaviour from 2.5 and fix my incompetence. Notice the removal of the
break statement too... if you are on master and do a lttng list with
multiple sessions only the first one show up.

Or am I missing something ?

> On Sat, Aug 16, 2014 at 10:45 AM, David Goulet <dgoulet <at> efficios.com> wrote:
>>
>> On 12 Aug (13:55:40), Jonathan Rajotte Julien wrote:
>> > Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien <at> gmail.com>
>> > ---
>> >  src/bin/lttng/commands/list.c | 8 ++------
>> >  1 file changed, 2 insertions(+), 6 deletions(-)
>> >
>> > diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c
>> > index e3ff4f1..ccffdc7 100644
>> > --- a/src/bin/lttng/commands/list.c
>> > +++ b/src/bin/lttng/commands/list.c
>> >  <at>  <at>  -1271,14 +1271,10  <at>  <at>  static int list_sessions(const char *session_name)
>> >                                       break;
>> >                               }
>> >                       } else {
>> > -                             MSG("  %d) %s (%s) [%s%s]", i + 1,
>> > -                                             sessions[i].name, sessions[i].path,
>> > +                             MSG("  %d) %s (%s) [%s%s]", i + 1, sessions[i].name,
>> > +                                             sessions[i].path,
>> >                                               active_string(sessions[i].enabled),
>> >                                               snapshot_string(sessions[i].snapshot_mode));
>> > -                             MSG("%sTrace path: %s", indent4, sessions[i].path);
>> > -                             MSG("%sLive timer interval (usec): %u\n", indent4,
>> > -                                             sessions[i].live_timer_interval);
>> > -                             break;
>>
>> Not sure removing that is wanted here. The "trace path" and "live timer
>> interval" lines are in stable-2.5 thus removing them here, you need a
>> real good reason ;)
>>
>> David
>>
>> >                       }
>> >               }
>> >
>> > --
>> > 2.0.4
>> >
>> >
>> > _______________________________________________
>> > lttng-dev mailing list
>> > lttng-dev <at> lists.lttng.org
>> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
>
>
>
> --
> Jonathan Rajotte Julien
> Chargé de laboratoire, INF1995
> Polytechnique Montréal

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

Gmane