Shelton, Ben | 31 Aug 21:13 2015
Picon

Instrumenting code that's common between user and kernel space

Hi all,

I'm working on using LTTng to instrument a driver that has both a kernel
space portion and a user space portion.  There is quite a bit of code
that's common between the two.  Is there a recommended way to handle
generating both the user space template files and the kernel space
tracepoints / probes for the same code, or is this something we would
need to build ourselves?

Thanks,
Ben
Michael Jeanson | 31 Aug 15:57 2015

[PATCH lttng-modules v3] Fix: build failure on 2.6.36

Fixes build failure on the 2.6.36 kernel branch which misses the
vzalloc() function.

Signed-off-by: Michael Jeanson <mjeanson <at> efficios.com>
---
 lttng-events.c    |  5 +++--
 wrapper/vzalloc.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 wrapper/vzalloc.h

diff --git a/lttng-events.c b/lttng-events.c
index b49851b..c49174d 100644
--- a/lttng-events.c
+++ b/lttng-events.c
 <at>  <at>  -50,6 +50,7  <at>  <at> 
 #include "lttng-events.h"
 #include "lttng-tracer.h"
 #include "lttng-abi-old.h"
+#include "wrapper/vzalloc.h"

 #define METADATA_CACHE_DEFAULT_SIZE 4096

 <at>  <at>  -133,7 +134,7  <at>  <at>  struct lttng_session *lttng_session_create(void)
 			GFP_KERNEL);
 	if (!metadata_cache)
 		goto err_free_session;
-	metadata_cache->data = vzalloc(METADATA_CACHE_DEFAULT_SIZE);
+	metadata_cache->data = lttng_vzalloc(METADATA_CACHE_DEFAULT_SIZE);
 	if (!metadata_cache->data)
 		goto err_free_cache;
(Continue reading)

Julien Desfossez | 31 Aug 05:05 2015

[GIT PULL v2] Regenerate the metadata file after a major NTP correction

This patchset for LTTng 2.8 is composed of commits in lttng-tools and
lttng-modules it allows the user to regenerate the metadata file of a
running session. This allows to fix the NTP offset located in the
metadata after a major NTP correction. Works for kernel and per-uid UST
sessions, local or remote but not live.

Please pull from:
https://github.com/jdesfossez/lttng-tools-dev/tree/regenmeta
b12c6ba Tests for metadata regenerate
b0eb2fd Command metadata regenerate
5983098 Store the relay protocol version in the consumer_output
ce3ea6b Store the version of the tracer in the UID registry

https://github.com/jdesfossez/lttng-modules-dev/tree/regenmeta
a728303 Command to regenerate the metadata of a session

Changes from v1:
- Addressed Mathieu's comments
- Added documentation in the manpage for the new command
- Send the metadata version to the relay now
- Implemented the check on the relay protocol version before allowing
the command
- Still missing the MI but I can't seem to find the willpower to want to
do it, it will come as a separate commit if this gets merged next week.

These commits are on top of my seqnum branch which is now located on top
of Mathieu's staging-test-fixes-v2 branch.
When these branches will be merged in master, I will rebase on master as
well, but in the meantime it is now ready for review.

(Continue reading)

Julien Desfossez | 30 Aug 02:38 2015

[GIT PULL] Regenerate the metadata file after a major NTP correction

This patchset for LTTng 2.8 is composed of commits in lttng-tools and
lttng-modules it allows the user to regenerate the metadata file of a
running session. This allows to fix the NTP offset located in the
metadata after a major NTP correction. Works for kernel and per-uid UST
sessions, local or remote but not live.

Please pull from:
https://github.com/jdesfossez/lttng-tools-dev/tree/regenmeta
d060d4c Tests for metadata regenerate
e646827 Command metadata regenerate
ce3ea6b Store the version of the tracer in the UID registry

https://github.com/jdesfossez/lttng-modules-dev/tree/regenmeta
6b87bf9 Command to regenerate the metadata of a session

These commits are on top of my seqnum branch which is now located on top
of Mathieu's staging-test-fixes-v2 branch.
When these branches will be merged in master, I will rebase on master as
well, but in the meantime it is now ready for review.

Julien
Michael Jeanson | 29 Aug 23:55 2015

[PATCH lttng-modules v2] Fix: build failure on 2.6.36

Fixes build failure on the 2.6.36 kernel branch which misses the
vzalloc() function.

Signed-off-by: Michael Jeanson <mjeanson <at> efficios.com>
---
 lttng-events.c    |  5 +++--
 wrapper/vzalloc.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 2 deletions(-)
 create mode 100644 wrapper/vzalloc.h

diff --git a/lttng-events.c b/lttng-events.c
index b49851b..c49174d 100644
--- a/lttng-events.c
+++ b/lttng-events.c
 <at>  <at>  -50,6 +50,7  <at>  <at> 
 #include "lttng-events.h"
 #include "lttng-tracer.h"
 #include "lttng-abi-old.h"
+#include "wrapper/vzalloc.h"

 #define METADATA_CACHE_DEFAULT_SIZE 4096

 <at>  <at>  -133,7 +134,7  <at>  <at>  struct lttng_session *lttng_session_create(void)
 			GFP_KERNEL);
 	if (!metadata_cache)
 		goto err_free_session;
-	metadata_cache->data = vzalloc(METADATA_CACHE_DEFAULT_SIZE);
+	metadata_cache->data = lttng_vzalloc(METADATA_CACHE_DEFAULT_SIZE);
 	if (!metadata_cache->data)
 		goto err_free_cache;
(Continue reading)

Michael Jeanson | 29 Aug 19:03 2015

[PATCH lttng-modules] Fix: build failure on 2.6.36

Fixes build failure on the 2.6.36 kernel branch which misses the
vzalloc() function.

Signed-off-by: Michael Jeanson <mjeanson <at> efficios.com>
---
 lttng-events.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lttng-events.c b/lttng-events.c
index b49851b..422a2dd 100644
--- a/lttng-events.c
+++ b/lttng-events.c
 <at>  <at>  -133,7 +133,12  <at>  <at>  struct lttng_session *lttng_session_create(void)
 			GFP_KERNEL);
 	if (!metadata_cache)
 		goto err_free_session;
+#if LTTNG_KERNEL_RANGE(2,6,36, 2,6,37)
+	metadata_cache->data = vmalloc(METADATA_CACHE_DEFAULT_SIZE);
+	memset(metadata_cache->data, 0, METADATA_CACHE_DEFAULT_SIZE);
+#else
 	metadata_cache->data = vzalloc(METADATA_CACHE_DEFAULT_SIZE);
+#endif
 	if (!metadata_cache->data)
 		goto err_free_cache;
 	metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE;
 <at>  <at>  -1531,7 +1536,12  <at>  <at>  int lttng_metadata_printf(struct lttng_session *session,
 		tmp_cache_alloc_size = max_t(unsigned int,
 				session->metadata_cache->cache_alloc + len,
 				session->metadata_cache->cache_alloc << 1);
+#if LTTNG_KERNEL_RANGE(2,6,36, 2,6,37)
(Continue reading)

Antoine Busque | 29 Aug 06:25 2015

Re: Userspace C++ Fucntion entry exit insert tracepoints

On Fri, Aug 28, 2015 at 10:12 PM, Farhan Shariff
<farhan.shariff <at> hotmail.com> wrote:
> Hi Antoine,
>
> Thank you for your reply:)
>
> What is the major dependency or reason that lttng modules build on 2.6.38
> and higher and not on lower 2.6.32
>

There have been changes in the kernel's tracepoint API between
2.6.32 and 2.6.36, amongst other changes, causing
incompatibilities. Patches to support kernel versions lower than
2.6.36 were at one point maintained, under `linux-patches/`
within the lttng-modules source tree, but as discrepancies
between older and newer kernels grew it became too burdensome to
actively maintain them.

> btw  ‑cyg‑profile library  provides only function call graph and NOT the I/O
> arguments. I prefer using it with tracepoints();
>

Right, the generated instrumentation only has information about
the function's address and its callsite. I do not believe there are
ready-made facilities to generate similar entry/exit
instrumentation that also accounts for all the current arguments.

Also, I've added back lttng-dev in CC to this message. Please try
to keep the discussion on the public mailing list.

(Continue reading)

Jonathan Rajotte | 27 Aug 21:58 2015

[PATCH lttng-tools] Fix: use pid element instead of process element

For stable 2.7

This revert part of changes introduced by [1] and [2].

The use of process element break the existing MI xml api.

[1] 46ef4d0715faeef52cd2242b5b895c74507e223a
[2] a585578f837d992f00eba4f090c8ba251d9de94e

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien <at> efficios.com>
---
 src/bin/lttng/commands/list.c     | 18 ++++++++---------
 src/common/mi-lttng.c             | 41 +++++++++++++++++++++++++++++++++++++++
 src/common/mi-lttng.h             | 19 ++++++++++++++++++
 tests/regression/tools/mi/test_mi |  2 +-
 4 files changed, 70 insertions(+), 10 deletions(-)

diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c
index f7f3852..3198eca 100644
--- a/src/bin/lttng/commands/list.c
+++ b/src/bin/lttng/commands/list.c
 <at>  <at>  -340,8 +340,8  <at>  <at>  static int mi_list_agent_ust_events(struct lttng_event *events, int count,
 		goto end;
 	}

-	/* Open processes element */
-	ret = mi_lttng_processes_open(writer);
+	/* Open pids element element */
+	ret = mi_lttng_pids_open(writer);
 	if (ret) {
(Continue reading)

Jonathan Rajotte | 26 Aug 00:06 2015

[PATCH lttng-tools] Fix: race between kconsumerd and sessiond on tear down

Kconsumerd and sessiond both have reference on lttng-module. This can lead to a race
on modprobe_remove_lttng_all which might fail to unload modules due to
certain modules not having a ref count equal to zero at the time.

waitpid is used to force a synchronization on the child (kconsumer) termination.

This also have been applied to ust consumers for the sake of consistency.

Fixes: #878

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien <at> efficios.com>
---
 src/bin/lttng-sessiond/main.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
index d284deb..efb00c7 100644
--- a/src/bin/lttng-sessiond/main.c
+++ b/src/bin/lttng-sessiond/main.c
 <at>  <at>  -587,6 +587,28  <at>  <at>  static int generate_lock_file_path(char *path, size_t len)
 }

 /*
+ * Wait on consumer process termination
+ */
+static void wait_consumer(struct consumer_data *consumer_data)
+{
+	pid_t ret;
+	int status;
+	if (consumer_data->pid > 0) {
(Continue reading)

Khem Raj | 23 Aug 06:38 2015
Picon

[PATCH] uatomic: Specify complete types for atomic function calls

This was unearthed by clang compiler where it complained about parameter
mismatch, gcc doesnt notice this

urcu/uatomic/generic.h:190:10: error: address argument to atomic builtin
must be a pointer to integer or pointer ('void *' invalid)
                return __sync_add_and_fetch_4(addr, val);

Fixed all instances thusly

Signed-off-by: Khem Raj <raj.khem <at> gmail.com>
---
 urcu/uatomic/generic.h | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/urcu/uatomic/generic.h b/urcu/uatomic/generic.h
index 37f59cc..0046ffd 100644
--- a/urcu/uatomic/generic.h
+++ b/urcu/uatomic/generic.h
 <at>  <at>  -65,17 +65,17  <at>  <at>  unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
 	switch (len) {
 #ifdef UATOMIC_HAS_ATOMIC_BYTE
 	case 1:
-		return __sync_val_compare_and_swap_1(addr, old, _new);
+		return __sync_val_compare_and_swap_1((unsigned char *)addr, old, _new);
 #endif
 #ifdef UATOMIC_HAS_ATOMIC_SHORT
 	case 2:
-		return __sync_val_compare_and_swap_2(addr, old, _new);
+		return __sync_val_compare_and_swap_2((unsigned short int *)addr, old, _new);
 #endif
(Continue reading)

Michael Jeanson | 21 Aug 20:57 2015

[PATCH lttng-modules 2.6] Fix: writeback instrumentation for 4.2 kernels

Bandwidth related fields were moved by this commit:

commit a88a341a73be4ef035ca26170c849f002797da27
Author: Tejun Heo <tj <at> kernel.org>
Date:   Fri, 22 May 2015 17:13:28 -0400

    writeback: move bandwidth related fields from backing_dev_info into
    bdi_writeback

Signed-off-by: Michael Jeanson <mjeanson <at> efficios.com>
---
 instrumentation/events/lttng-module/writeback.h | 51 +++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/instrumentation/events/lttng-module/writeback.h b/instrumentation/events/lttng-module/writeback.h
index 7ea3f8a..dc88886 100644
--- a/instrumentation/events/lttng-module/writeback.h
+++ b/instrumentation/events/lttng-module/writeback.h
 <at>  <at>  -523,6 +523,55  <at>  <at>  LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,

 #define KBps(x)			((x) << (PAGE_SHIFT - 10))

+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit,
+
+	writeback_bdi_dirty_ratelimit,
+
+	TP_PROTO(struct backing_dev_info *bdi,
+		 unsigned long dirty_rate,
(Continue reading)


Gmane