Skip to contentSkip to conversation

irqsoff and preemptoff kernel contexts support

PATCH New Julien Desfossez 2 participants 2 messages Nov 11, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/2 irqsoff and preemptoff kernel contexts support

---
 include/lttng/event.h                  | 2 ++
 src/bin/lttng-sessiond/context.c       | 6 ++++++
 src/bin/lttng-sessiond/save.c          | 6 ++++++
 src/bin/lttng/commands/add_context.c   | 4 ++++
 src/common/config/config-session-abi.h | 2 ++
 src/common/config/session-config.c     | 8 ++++++++
 src/common/lttng-kernel.h              | 2 ++
 7 files changed, 30 insertions(+)
include/lttng/event.h +2 -0
index 3e8fbe3..e8b8d64 100644
@@ -136,6 +136,8 @@ enum lttng_event_context_type {
 	LTTNG_EVENT_CONTEXT_IP                = 12,
 	LTTNG_EVENT_CONTEXT_PERF_CPU_COUNTER  = 13,
 	LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER = 14,
+	LTTNG_EVENT_CONTEXT_IRQSOFF           = 15,
+	LTTNG_EVENT_CONTEXT_PREEMPTOFF        = 16,
 };
 
 enum lttng_event_field_type {
src/bin/lttng-sessiond/context.c +6 -0
index 0de1d06..799009a 100644
@@ -193,6 +193,12 @@ int context_kernel_add(struct ltt_kernel_session *ksession,
 	case LTTNG_EVENT_CONTEXT_HOSTNAME:
 		kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_HOSTNAME;
 		break;
+	case LTTNG_EVENT_CONTEXT_IRQSOFF:
+		kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_IRQSOFF;
+		break;
+	case LTTNG_EVENT_CONTEXT_PREEMPTOFF:
+		kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_PREEMPTOFF;
+		break;
 	case LTTNG_EVENT_CONTEXT_PERF_CPU_COUNTER:
 	case LTTNG_EVENT_CONTEXT_PERF_COUNTER:
 		kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_PERF_CPU_COUNTER;
src/bin/lttng-sessiond/save.c +6 -0
index a6fea46..74c055f 100644
@@ -232,6 +232,12 @@ const char *get_kernel_context_type_string(
 	case LTTNG_KERNEL_CONTEXT_HOSTNAME:
 		context_type_string = config_event_context_hostname;
 		break;
+	case LTTNG_KERNEL_CONTEXT_IRQSOFF:
+		context_type_string = config_event_context_irqsoff;
+		break;
+	case LTTNG_KERNEL_CONTEXT_PREEMPTOFF:
+		context_type_string = config_event_context_preemptoff;
+		break;
 	default:
 		context_type_string = NULL;
 	}
src/bin/lttng/commands/add_context.c +4 -0
index fb37c0a..81a73e4 100644
@@ -69,6 +69,8 @@ enum context_type {
 	CONTEXT_IP           = 12,
 	CONTEXT_PERF_CPU_COUNTER = 13,
 	CONTEXT_PERF_THREAD_COUNTER = 14,
+	CONTEXT_IRQSOFF      = 15,
+	CONTEXT_PREEMPTOFF   = 16,
 };
 
 /*
@@ -213,6 +215,8 @@ const struct ctx_opts {
 	{ "vppid", CONTEXT_VPPID },
 	{ "hostname", CONTEXT_HOSTNAME },
 	{ "ip", CONTEXT_IP },
+	{ "irqsoff", CONTEXT_IRQSOFF },
+	{ "preemptoff", CONTEXT_PREEMPTOFF },
 
 	/* Perf options */
 
src/common/config/config-session-abi.h +2 -0
index 9251b22..156346d 100644
@@ -116,5 +116,7 @@ extern const char * const config_event_context_pthread_id;
 extern const char * const config_event_context_hostname;
 extern const char * const config_event_context_ip;
 extern const char * const config_event_context_perf_thread_counter;
+extern const char * const config_event_context_irqsoff;
+extern const char * const config_event_context_preemptoff;
 
 #endif /* CONFIG_SESSION_INTERNAL_H */
src/common/config/session-config.c +8 -0
index 87e9c03..3945139 100644
@@ -165,6 +165,8 @@ const char * const config_event_context_pthread_id = "PTHREAD_ID";
 const char * const config_event_context_hostname = "HOSTNAME";
 const char * const config_event_context_ip = "IP";
 const char * const config_event_context_perf_thread_counter = "PERF_THREAD_COUNTER";
+const char * const config_event_context_irqsoff = "IRQSOFF";
+const char * const config_event_context_preemptoff = "PREEMPTOFF";
 
 struct consumer_output {
 	int enabled;
@@ -946,6 +948,12 @@ int get_context_type(xmlChar *context_type)
 	} else if (!strcmp((char *) context_type,
 		config_event_context_ip)) {
 		ret = LTTNG_EVENT_CONTEXT_IP;
+	} else if (!strcmp((char *) context_type,
+		config_event_context_irqsoff)) {
+		ret = LTTNG_EVENT_CONTEXT_IRQSOFF;
+	} else if (!strcmp((char *) context_type,
+		config_event_context_preemptoff)) {
+		ret = LTTNG_EVENT_CONTEXT_PREEMPTOFF;
 	} else {
 		goto error;
 	}
src/common/lttng-kernel.h +2 -0
index f58108f..55cb6f2 100644
@@ -54,6 +54,8 @@ enum lttng_kernel_context_type {
 	LTTNG_KERNEL_CONTEXT_VPPID          = 9,
 	LTTNG_KERNEL_CONTEXT_HOSTNAME       = 10,
 	LTTNG_KERNEL_CONTEXT_CPUID          = 11,
+	LTTNG_KERNEL_CONTEXT_IRQSOFF        = 12,
+	LTTNG_KERNEL_CONTEXT_PREEMPTOFF     = 13,
 };
 
 /* Perf counter attributes */
Signature · 1 line
1.9.1
#2 lore raw

Re: [LTTNG-TOOLS PATCH 1/2] fix: missing cpuid kernel context in the ABI

In reply to a message not in the archive

Merged in master with some changes. The second patch of this series remains unmerged as the lttng-modules part is still under review.

Removed "fix" as this does not address a bug (CPU id remains unused).

Quoted 10 lines · Julien Desfossez
---
 src/common/lttng-kernel.h | 1 +
 1 file changed, 1 insertion(+)
src/common/lttng-kernel.h +0 -0
index f1144de..f58108f 100644

src/common/lttng-kernel.h enum lttng_kernel_context_type { · line 56

Quoted 4 lines
src/common/lttng-kernel.h +1 -0
@@ -53,6 +53,7 @@ enum lttng_kernel_context_type {
        LTTNG_KERNEL_CONTEXT_PPID           = 8,
        LTTNG_KERNEL_CONTEXT_VPPID          = 9,
        LTTNG_KERNEL_CONTEXT_HOSTNAME       = 10,
+       LTTNG_KERNEL_CONTEXT_CPUID          = 11,

Changed to LTTNG_KERNEL_CONTEXT_CPU_ID to match the name used by lttng-modules.

Jérémie

Quoted 6 lines
src/common/lttng-kernel.h +0 -1
 };
 
 /* Perf counter attributes */
--

1.9.1

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev