From 7c612c2e69f7b4ebf77fd369126befb71e561a8f Mon Sep 17 00:00:00 2001 From: "Woegerer, Paul" Date: Wed, 10 Jul 2013 11:06:45 +0200 Subject: [PATCH] Callsite: add "ip" context Support ip context in lttng add-context -t. Acked-by: Mathieu Desnoyers Signed-off-by: David Goulet --- include/lttng/lttng.h | 1 + src/bin/lttng-sessiond/lttng-ust-abi.h | 1 + src/bin/lttng-sessiond/trace-ust.c | 3 +++ src/bin/lttng/commands/add_context.c | 2 ++ 4 files changed, 7 insertions(+) diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 83232454f..3e7fb6316 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -126,6 +126,7 @@ enum lttng_event_context_type { LTTNG_EVENT_CONTEXT_VPPID = 9, LTTNG_EVENT_CONTEXT_PTHREAD_ID = 10, LTTNG_EVENT_CONTEXT_HOSTNAME = 11, + LTTNG_EVENT_CONTEXT_IP = 12, }; enum lttng_calibrate_type { diff --git a/src/bin/lttng-sessiond/lttng-ust-abi.h b/src/bin/lttng-sessiond/lttng-ust-abi.h index 03d2e65f6..6326b1e6c 100644 --- a/src/bin/lttng-sessiond/lttng-ust-abi.h +++ b/src/bin/lttng-sessiond/lttng-ust-abi.h @@ -139,6 +139,7 @@ enum lttng_ust_context_type { LTTNG_UST_CONTEXT_VPID = 1, LTTNG_UST_CONTEXT_PTHREAD_ID = 2, LTTNG_UST_CONTEXT_PROCNAME = 3, + LTTNG_UST_CONTEXT_IP = 4, }; #define LTTNG_UST_CONTEXT_PADDING1 16 diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 65fe84b7d..77f5e2510 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -432,6 +432,9 @@ struct ltt_ust_context *trace_ust_create_context( case LTTNG_EVENT_CONTEXT_PROCNAME: utype = LTTNG_UST_CONTEXT_PROCNAME; break; + case LTTNG_EVENT_CONTEXT_IP: + utype = LTTNG_UST_CONTEXT_IP; + break; default: ERR("Invalid UST context"); return NULL; diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index 4904d2772..fad85b50a 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -67,6 +67,7 @@ enum context_type { CONTEXT_VPPID = 9, CONTEXT_PTHREAD_ID = 10, CONTEXT_HOSTNAME = 11, + CONTEXT_IP = 12, }; /* @@ -203,6 +204,7 @@ const struct ctx_opts { { "ppid", CONTEXT_PPID }, { "vppid", CONTEXT_VPPID }, { "hostname", CONTEXT_HOSTNAME }, + { "ip", CONTEXT_IP }, /* Perf options */ PERF_HW(cpu-cycles, CPU_CYCLES), PERF_HW(cycles, CPU_CYCLES), -- 2.34.1