Add namespace contexts
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 12 Feb 2019 14:43:24 +0000 (09:43 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 1 May 2019 21:29:07 +0000 (17:29 -0400)
commitc3315ccd6f3fc3847d72829363305309e1b9295b
treedd34f6eeff3ad35de299e3d3e48de97e5d8ef810
parent2485a4307679e11711443483a5eb307639f955ed
Add namespace contexts

Add a context for each available kernel namespace which currently are :
cgroup, ipc, mnt, net, pid, user and uts. The id chosen to identify the
namespaces is the inode number of the file representing each one of them
in the proc filesystem. This was instroduced in v3.8.0 in this commit :

  commit 98f842e675f96ffac96e6c50315790912b2812be
  Author: Eric W. Biederman <ebiederm@xmission.com>
  Date:   Wed Jun 15 10:21:48 2011 -0700

    proc: Usable inode numbers for the namespace file descriptors.

    Assign a unique proc inode to each namespace, and use that
    inode number to ensure we only allocate at most one proc
    inode for every namespace in proc.

    A single proc inode per namespace allows userspace to test
    to see if two processes are in the same namespace.

    ...

Prior to this there is no unique identifier for a namespace that is
available to both the kernel and userspace. Enabling any of these
contexts on a kernel that is too old or doesn't have the proper features
enabled will fail and return -ENOSYS.

Per namespace particularities :

  - Cgroup
    - Introduced in 4.6.0
    - CONFIG_CGROUPS

  - IPC
    - Introduced in 2.6.25
    - CONFIG_IPC_NS

  - MNT
    - Introduced in 2.6.20
    - The mnt_namespace struct is defined in a private header

  - NET
    - Introduced in 2.6.24
    - CONFIG_NET_NS

  - PID
    - Introduced in 2.6.20
    - CONFIG_PID_NS

  - User
    - Introduced in 2.6.23
    - CONFIG_USER_NS

  - UTS
    - Introduced in 2.6.19
    - CONFIG_UTS_NS

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
15 files changed:
Kbuild.common
Makefile
instrumentation/events/lttng-module/sched.h
lttng-abi.c
lttng-abi.h
lttng-context-cgroup-ns.c [new file with mode: 0644]
lttng-context-ipc-ns.c [new file with mode: 0644]
lttng-context-mnt-ns.c [new file with mode: 0644]
lttng-context-net-ns.c [new file with mode: 0644]
lttng-context-pid-ns.c [new file with mode: 0644]
lttng-context-user-ns.c [new file with mode: 0644]
lttng-context-uts-ns.c [new file with mode: 0644]
lttng-context.c
lttng-events.h
wrapper/namespace.h [new file with mode: 0644]
This page took 0.02829 seconds and 5 git commands to generate.