lttng_statedump_process_state for each PID NS
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 23 Aug 2012 21:11:35 +0000 (17:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Aug 2012 21:11:35 +0000 (17:11 -0400)
commit73e8ba371039bc05745a739db4d69b4220a1c03e
tree4504821ccd1a525fccf68f567eff1363d27aa01f
parent975da2c003441a8a16a36947e9500237c197e91b
lttng_statedump_process_state for each PID NS

When a process is in a namespace, its pid, tid and ppid are relative to
the namespace. Since namespaces can be nested, we need to know the
representation of each process in each namespace.

This patch changes the lttng_enumerate_task_fd to iterate over each
PID namespace of a process if any, that way we generate, in the
statedump, an entry for each process in each namespace it belongs.
To know the nesting level, the field "level" is added to the
lttng_statedump_process_state event, 0 being the top-level.
For processes running on the top-level namespace, the statedump
behaviour is unchanged (except the added "level" field).

For example (no nesting, just one level of namespace) :
lttng_statedump_process_state: {
        tid = 32185, vtid = 1, pid = 32185,
        vpid = 1, ppid = 32173, vppid = 0,
        level = 1, name = "init" }
lttng_statedump_process_state: {
        tid = 32185, vtid = 32185, pid = 32185,
        vpid = 32185, ppid = 32173, vppid = 32173,
        level = 0, name = "init" }

Confirmed that the process 32173 in the top-level namespace is indeed
the lxc-start command that created the container and its namespace.

[ Edit by Mathieu Desnoyers: Minor cleanups ]

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/lttng-statedump.h
lttng-statedump-impl.c
This page took 0.026961 seconds and 4 git commands to generate.