X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-context-pid.c;fp=lttng-context-pid.c;h=698b242245a28b6e38484f65f21f129e53ab9774;hb=44252f0fd51fd4bf28926dcef525355bceb08c5f;hp=ee2c4f0f5c36ebb116cfa66a8ec46658cc217920;hpb=96ba7208aa8009345a525148e32f78cd8d4693ab;p=lttng-modules.git diff --git a/lttng-context-pid.c b/lttng-context-pid.c index ee2c4f0f..698b2422 100644 --- a/lttng-context-pid.c +++ b/lttng-context-pid.c @@ -44,6 +44,10 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx) field = lttng_append_context(ctx); if (!field) return -ENOMEM; + if (lttng_find_context(*ctx, "pid")) { + lttng_remove_context_field(ctx, field); + return -EEXIST; + } field->event_field.name = "pid"; field->event_field.type.atype = atype_integer; field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;