X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lttng%2Fcommands%2Fadd_context.c;h=edc8f37ac3724a488b1935c48ad4ff60eb892156;hb=31e43e7f5bb5143687462b08a3eef10782694577;hp=1e6a807effb7393a30091bfb68e9a69c1d0cdeef;hpb=636167b6d43e1b9e9e96c90672001c735dd61087;p=lttng-tools.git diff --git a/lttng/commands/add_context.c b/lttng/commands/add_context.c index 1e6a807ef..edc8f37ac 100644 --- a/lttng/commands/add_context.c +++ b/lttng/commands/add_context.c @@ -3,8 +3,8 @@ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * as published by the Free Software Foundation; only version 2 + * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -25,9 +25,9 @@ #include #include -#include "cmd.h" -#include "conf.h" -#include "utils.h" +#include "../cmd.h" +#include "../conf.h" +#include "../utils.h" static char *opt_event_name; static char *opt_channel_name; @@ -123,7 +123,8 @@ static void usage(FILE *ofp) static int add_context(int type) { int ret = CMD_SUCCESS; - struct lttng_kernel_context context; + struct lttng_event_context context; + struct lttng_domain dom; if (set_session_name(opt_session_name) < 0) { ret = CMD_ERROR; @@ -139,8 +140,12 @@ static int add_context(int type) } if (opt_kernel) { + /* Create kernel domain */ + dom.type = LTTNG_DOMAIN_KERNEL; + DBG("Adding kernel context"); - ret = lttng_kernel_add_context(&context, opt_event_name, opt_channel_name); + ret = lttng_add_context(&dom, &context, opt_event_name, + opt_channel_name); if (ret < 0) { goto error; } else {