Fix: missing hostname context
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 23 Aug 2012 17:24:46 +0000 (13:24 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 24 Aug 2012 14:49:21 +0000 (10:49 -0400)
This context adds the hostname context field for the event(s) selected.
It is particularly useful when tracing a machine with containers (lxc),
that way we can easily distinguish events generated inside a container.

The API is extended but no features nor behaviors are changed.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
include/lttng/lttng.h
src/bin/lttng-sessiond/context.c
src/bin/lttng/commands/add_context.c
src/common/lttng-kernel.h

index 5d3362040d2004c395cb708fd735b76e85ca0da2..cb3562ffdf601f66274ffef2bd7252450184e3a2 100644 (file)
@@ -118,6 +118,7 @@ enum lttng_event_context_type {
        LTTNG_EVENT_CONTEXT_PPID              = 8,
        LTTNG_EVENT_CONTEXT_VPPID             = 9,
        LTTNG_EVENT_CONTEXT_PTHREAD_ID        = 10,
+       LTTNG_EVENT_CONTEXT_HOSTNAME          = 11,
 };
 
 enum lttng_calibrate_type {
index af1c32dea90b6f64078b08c36fcffa65d21441be..83085cfc8999ee0cf9e25b94016582b49648ee5a 100644 (file)
@@ -295,6 +295,9 @@ int context_kernel_add(struct ltt_kernel_session *ksession,
        case LTTNG_EVENT_CONTEXT_VPPID:
                kctx.ctx = LTTNG_KERNEL_CONTEXT_VPPID;
                break;
+       case LTTNG_EVENT_CONTEXT_HOSTNAME:
+               kctx.ctx = LTTNG_KERNEL_CONTEXT_HOSTNAME;
+               break;
        default:
                return LTTCOMM_KERN_CONTEXT_FAIL;
        }
index b580d037b9924dfbbea909c9561ab7587ed4b3f1..aec2d4df70d8ef991f3d54fdfa1fd4d315ffc019 100644 (file)
@@ -67,6 +67,7 @@ enum context_type {
        CONTEXT_PPID         = 8,
        CONTEXT_VPPID        = 9,
        CONTEXT_PTHREAD_ID   = 10,
+       CONTEXT_HOSTNAME     = 11,
 };
 
 /*
@@ -203,6 +204,7 @@ const struct ctx_opts {
        { "vtid", CONTEXT_VTID },
        { "ppid", CONTEXT_PPID },
        { "vppid", CONTEXT_VPPID },
+       { "hostname", CONTEXT_HOSTNAME },
        /* Perf options */
        PERF_HW(cpu-cycles, CPU_CYCLES),
        PERF_HW(cycles, CPU_CYCLES),
index cbeed1b1982c057d944d64c5ba2496a4f411e492..dbeb6aa0a9a7a4489fcc5d91adbdaf9d635f44e5 100644 (file)
@@ -51,6 +51,7 @@ enum lttng_kernel_context_type {
        LTTNG_KERNEL_CONTEXT_VTID           = 7,
        LTTNG_KERNEL_CONTEXT_PPID           = 8,
        LTTNG_KERNEL_CONTEXT_VPPID          = 9,
+       LTTNG_KERNEL_CONTEXT_HOSTNAME       = 10,
 };
 
 /* Perf counter attributes */
This page took 0.036603 seconds and 4 git commands to generate.