LTTNG_EVENT_CONTEXT_VGID = 38,
LTTNG_EVENT_CONTEXT_VEGID = 39,
LTTNG_EVENT_CONTEXT_VSGID = 40,
+ LTTNG_EVENT_CONTEXT_TIME_NS = 41,
};
enum lttng_event_field_type {
case LTTNG_EVENT_CONTEXT_PID_NS:
kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_PID_NS;
break;
+ case LTTNG_EVENT_CONTEXT_TIME_NS:
+ kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_TIME_NS;
+ break;
case LTTNG_EVENT_CONTEXT_USER_NS:
kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_USER_NS;
break;
case LTTNG_KERNEL_CONTEXT_PID_NS:
context_type_string = config_event_context_pid_ns;
break;
+ case LTTNG_KERNEL_CONTEXT_TIME_NS:
+ context_type_string = config_event_context_time_ns;
+ break;
case LTTNG_KERNEL_CONTEXT_USER_NS:
context_type_string = config_event_context_user_ns;
break;
case LTTNG_UST_CONTEXT_NET_NS:
context_type_string = config_event_context_net_ns;
break;
+ case LTTNG_UST_CONTEXT_TIME_NS:
+ context_type_string = config_event_context_time_ns;
+ break;
case LTTNG_UST_CONTEXT_PID_NS:
context_type_string = config_event_context_pid_ns;
break;
case LTTNG_EVENT_CONTEXT_PID_NS:
utype = LTTNG_UST_CONTEXT_PID_NS;
break;
+ case LTTNG_EVENT_CONTEXT_TIME_NS:
+ utype = LTTNG_UST_CONTEXT_TIME_NS;
+ break;
case LTTNG_EVENT_CONTEXT_USER_NS:
utype = LTTNG_UST_CONTEXT_USER_NS;
break;
LTTNG_UST_CONTEXT_VGID = 18,
LTTNG_UST_CONTEXT_VEGID = 19,
LTTNG_UST_CONTEXT_VSGID = 20,
+ LTTNG_UST_CONTEXT_TIME_NS = 21,
};
struct lttng_ust_perf_counter_ctx {
CONTEXT_VGID = 38,
CONTEXT_VEGID = 39,
CONTEXT_VSGID = 40,
+ CONTEXT_TIME_NS = 41,
};
/*
{ (char *) "mnt_ns", CONTEXT_MNT_NS },
{ (char *) "net_ns", CONTEXT_NET_NS },
{ (char *) "pid_ns", CONTEXT_PID_NS },
+ { (char *) "time_ns", CONTEXT_TIME_NS },
{ (char *) "user_ns", CONTEXT_USER_NS },
{ (char *) "uts_ns", CONTEXT_UTS_NS },
{ (char *) "uid", CONTEXT_UID },
extern const char * const config_event_context_mnt_ns;
extern const char * const config_event_context_net_ns;
extern const char * const config_event_context_pid_ns;
+extern const char * const config_event_context_time_ns;
extern const char * const config_event_context_user_ns;
extern const char * const config_event_context_uts_ns;
extern const char * const config_event_context_uid;
LTTNG_HIDDEN const char * const config_event_context_mnt_ns = "MNT_NS";
LTTNG_HIDDEN const char * const config_event_context_net_ns = "NET_NS";
LTTNG_HIDDEN const char * const config_event_context_pid_ns = "PID_NS";
+LTTNG_HIDDEN const char * const config_event_context_time_ns = "TIME_NS";
LTTNG_HIDDEN const char * const config_event_context_user_ns = "USER_NS";
LTTNG_HIDDEN const char * const config_event_context_uts_ns = "UTS_NS";
LTTNG_HIDDEN const char * const config_event_context_uid = "UID";
} else if (!strcmp((char *) context_type,
config_event_context_pid_ns)) {
ret = LTTNG_EVENT_CONTEXT_PID_NS;
+ } else if (!strcmp((char *) context_type,
+ config_event_context_time_ns)) {
+ ret = LTTNG_EVENT_CONTEXT_TIME_NS;
} else if (!strcmp((char *) context_type,
config_event_context_user_ns)) {
ret = LTTNG_EVENT_CONTEXT_USER_NS;
LTTNG_KERNEL_CONTEXT_VGID = 34,
LTTNG_KERNEL_CONTEXT_VEGID = 35,
LTTNG_KERNEL_CONTEXT_VSGID = 36,
+ LTTNG_KERNEL_CONTEXT_TIME_NS = 37,
};
/* Perf counter attributes */
<xs:enumeration value="MNT_NS" />
<xs:enumeration value="NET_NS" />
<xs:enumeration value="PID_NS" />
+ <xs:enumeration value="TIME_NS" />
<xs:enumeration value="USER_NS" />
<xs:enumeration value="UTS_NS" />
<xs:enumeration value="UID" />
return config_event_context_net_ns;
case LTTNG_EVENT_CONTEXT_PID_NS:
return config_event_context_pid_ns;
+ case LTTNG_EVENT_CONTEXT_TIME_NS:
+ return config_event_context_time_ns;
case LTTNG_EVENT_CONTEXT_USER_NS:
return config_event_context_user_ns;
case LTTNG_EVENT_CONTEXT_UTS_NS:
TESTS_PER_NS=11
-NUM_TESTS=$((TESTS_PER_NS * 7))
+NUM_TESTS=$((TESTS_PER_NS * 8))
source "$TESTDIR/utils/utils.sh"
test_ns mnt
test_ns net
test_ns pid
+test_ns time
test_ns user
test_ns uts
test_ns mnt
test_ns net
#test_ns pid # pid_ns is special, can't be changed that way
+#test_ns time # time_ns is special, can't be changed that way
test_ns user
test_ns uts
TESTS_PER_NS=13
-NUM_TESTS=$((TESTS_PER_NS * 7))
+NUM_TESTS=$((TESTS_PER_NS * 8))
source "$TESTDIR/utils/utils.sh"
test_ns mnt
test_ns net
test_ns pid
+test_ns time
test_ns user
test_ns uts
test_ns mnt
test_ns net
#test_ns pid # pid_ns is special, can't be changed that way
+#test_ns time # time_ns is special, can't be changed that way
#test_ns user # user_ns can only be change when the app is single threaded, this is always false for an ust instrumented app
test_ns uts
#ifndef CLONE_NEWNET
#define CLONE_NEWNET 0x40000000
#endif
+#ifndef CLONE_NEWTIME
+#define CLONE_NEWTIME 0x00000080
+#endif
static int debug = 0;
static char *ns_opt = NULL;
goto end;
}
- if (strncmp(ns_opt, "cgroup", 3) == 0) {
+ if (strncmp(ns_opt, "cgroup", 6) == 0) {
ret = do_the_needful(CLONE_NEWCGROUP, "cgroup");
} else if (strncmp(ns_opt, "ipc", 3) == 0) {
ret = do_the_needful(CLONE_NEWIPC, "ipc");
ret = do_the_needful(CLONE_NEWNET, "net");
} else if (strncmp(ns_opt, "pid", 3) == 0) {
ret = do_the_needful(CLONE_NEWPID, "pid");
- } else if (strncmp(ns_opt, "user", 3) == 0) {
+ } else if (strncmp(ns_opt, "time", 4) == 0) {
+ ret = do_the_needful(CLONE_NEWTIME, "time");
+ } else if (strncmp(ns_opt, "user", 4) == 0) {
/*
* Will always fail, requires a single threaded application,
* which can't happen with UST.
#ifndef CLONE_NEWNET
#define CLONE_NEWNET 0x40000000
#endif
+#ifndef CLONE_NEWTIME
+#define CLONE_NEWTIME 0x00000080
+#endif
static int nr_iter = 100;
static int debug = 0;
goto end;
}
- if (strncmp(ns_opt, "cgroup", 3) == 0) {
+ if (strncmp(ns_opt, "cgroup", 6) == 0) {
ret = do_the_needful(CLONE_NEWCGROUP, "cgroup");
} else if (strncmp(ns_opt, "ipc", 3) == 0) {
ret = do_the_needful(CLONE_NEWIPC, "ipc");
ret = do_the_needful(CLONE_NEWNET, "net");
} else if (strncmp(ns_opt, "pid", 3) == 0) {
ret = do_the_needful(CLONE_NEWPID, "pid");
- } else if (strncmp(ns_opt, "user", 3) == 0) {
+ } else if (strncmp(ns_opt, "time", 4) == 0) {
+ ret = do_the_needful(CLONE_NEWTIME, "time");
+ } else if (strncmp(ns_opt, "user", 4) == 0) {
/*
* Will always fail, requires a single threaded application,
* which can't happen with UST.