context: document and check that only last context is removed
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 23 Jul 2011 16:37:54 +0000 (12:37 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 23 Jul 2011 16:37:54 +0000 (12:37 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-context.c

index e9a45f3c50a4de6480a7fc3528d80c40a8895ff1..154e9966e861073e694bd9e95bb21368d90cefa2 100644 (file)
@@ -60,6 +60,9 @@ struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p)
 }
 EXPORT_SYMBOL_GPL(lttng_append_context);
 
+/*
+ * Remove last context field.
+ */
 void lttng_remove_context_field(struct lttng_ctx **ctx_p,
                                struct lttng_ctx_field *field)
 {
@@ -67,6 +70,7 @@ void lttng_remove_context_field(struct lttng_ctx **ctx_p,
 
        ctx = *ctx_p;
        ctx->nr_fields--;
+       WARN_ON_ONCE(&ctx->fields[ctx->nr_fields] != field);
        memset(&ctx->fields[ctx->nr_fields], 0, sizeof(struct lttng_ctx_field));
 }
 EXPORT_SYMBOL_GPL(lttng_remove_context_field);
This page took 0.025844 seconds and 4 git commands to generate.