Rename C++ header files to .hpp
[lttng-tools.git] / src / bin / lttng / commands / add_context.cpp
index d078471d3d784ca88e041bddf96b5c2acc95b8c3..27d932c340ab8622225df5badd8ca1d99e5b3cce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * SPDX-License-Identifier: GPL-2.0-only
 
 #include <urcu/list.h>
 
-#include <lttng/domain-internal.h>
-#include <common/mi-lttng.h>
+#include <lttng/domain-internal.hpp>
+#include <common/mi-lttng.hpp>
 
-#include "../command.h"
+#include "../command.hpp"
 
 static char *opt_channel_name;
 static char *opt_session_name;
@@ -51,9 +51,10 @@ static struct lttng_handle *handle;
 static struct mi_writer *writer;
 
 /*
- * Taken from the LTTng ABI
+ * Taken from the LTTng ABI except for "UNKNOWN".
  */
 enum context_type {
+       CONTEXT_UNKNOWN      = -1,
        CONTEXT_PID          = 0,
        CONTEXT_PERF_COUNTER = 1,       /* Backward compat. */
        CONTEXT_PROCNAME     = 2,
@@ -220,7 +221,7 @@ static
 const struct ctx_opts {
        /* Needed for end-of-list item. */
        ctx_opts()
-               : symbol(nullptr)
+               : ctx_opts(nullptr, CONTEXT_UNKNOWN)
        {}
 
        ctx_opts(const char *symbol_, context_type ctx_type_, bool hide_help_ = false)
@@ -287,7 +288,7 @@ const struct ctx_opts {
        { (char *) "need_reschedule", CONTEXT_NEED_RESCHEDULE },
        { (char *) "migratable", CONTEXT_MIGRATABLE },
        { (char *) "callstack-kernel", CONTEXT_CALLSTACK_KERNEL },
-#if HAVE_MODULES_USERSPACE_CALLSTACK_CONTEXT
+#ifdef HAVE_MODULES_USERSPACE_CALLSTACK_CONTEXT
        { (char *) "callstack-user", CONTEXT_CALLSTACK_USER },
 #endif
        { (char *) "cgroup_ns", CONTEXT_CGROUP_NS },
This page took 0.024339 seconds and 4 git commands to generate.