Fix: sessiond: ODR violation results in memory corruption
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 14 Apr 2022 23:01:25 +0000 (19:01 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 14 Apr 2022 23:19:50 +0000 (19:19 -0400)
Issue observed
==============

Address sanitizer reports the following invalid accesses while running
the test_mi test.

❯ ASAN_OPTIONS=detect_odr_violation=0 lttng-sessiond
=================================================================
==289173==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400000e280 at pc 0x55cbbe35e2e0 bp 0x7f01672f1550 sp 0x7f01672f1540
WRITE of size 4 at 0x60400000e280 thread T13
    #0 0x55cbbe35e2df in mark_thread_as_ready /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/manage-consumer.cpp:32
    #1 0x55cbbe360160 in thread_consumer_management /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/manage-consumer.cpp:267
    #2 0x55cbbe336ac4 in launch_thread /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/thread.cpp:66
    #3 0x7f01729c15c1 in start_thread (/usr/lib/libc.so.6+0x8d5c1)
    #4 0x7f0172a46583 in __clone (/usr/lib/libc.so.6+0x112583)

0x60400000e280 is located 8 bytes to the right of 40-byte region [0x60400000e250,0x60400000e278)
allocated by thread T7 here:
    #0 0x7f01733b1fb9 in __interceptor_calloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x55cbbe33adf3 in zmalloc_internal ../../../src/common/macros.hpp:60
    #2 0x55cbbe33ae03 in thread_notifiers* zmalloc<thread_notifiers>() ../../../src/common/macros.hpp:89
    #3 0x55cbbe3617f9 in launch_consumer_management_thread(consumer_data*) /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/manage-consumer.cpp:440
    #4 0x55cbbe33cf49 in spawn_consumer_thread /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:188
    #5 0x55cbbe33f7cf in start_consumerd /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:394
    #6 0x55cbbe345713 in process_client_msg /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:1277
    #7 0x55cbbe34d74b in thread_manage_clients /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:2622
    #8 0x55cbbe336ac4 in launch_thread /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/thread.cpp:66
    #9 0x7f01729c15c1 in start_thread (/usr/lib/libc.so.6+0x8d5c1)

Thread T13 created by T7 here:
    #0 0x7f0173353eb7 in __interceptor_pthread_create /usr/src/debug/gcc/libsanitizer/asan/asan_interceptors.cpp:216
    #1 0x55cbbe336f9e in lttng_thread_create(char const*, void* (*)(void*), bool (*)(void*), void (*)(void*), void*) /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/thread.cpp:106
    #2 0x55cbbe3618cc in launch_consumer_management_thread(consumer_data*) /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/manage-consumer.cpp:453
    #3 0x55cbbe33cf49 in spawn_consumer_thread /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:188
    #4 0x55cbbe33f7cf in start_consumerd /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:394
    #5 0x55cbbe345713 in process_client_msg /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:1277
    #6 0x55cbbe34d74b in thread_manage_clients /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:2622
    #7 0x55cbbe336ac4 in launch_thread /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/thread.cpp:66
    #8 0x7f01729c15c1 in start_thread (/usr/lib/libc.so.6+0x8d5c1)

Thread T7 created by T0 here:
    #0 0x7f0173353eb7 in __interceptor_pthread_create /usr/src/debug/gcc/libsanitizer/asan/asan_interceptors.cpp:216
    #1 0x55cbbe336f9e in lttng_thread_create(char const*, void* (*)(void*), bool (*)(void*), void (*)(void*), void*) /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/thread.cpp:106
    #2 0x55cbbe34eebf in launch_client_thread() /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/client.cpp:2756
    #3 0x55cbbe27f31a in main /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/main.cpp:1838
    #4 0x7f017296130f in __libc_start_call_main (/usr/lib/libc.so.6+0x2d30f)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/jgalar/EfficiOS/src/lttng-tools/src/bin/lttng-sessiond/manage-consumer.cpp:32 in mark_thread_as_ready
Shadow bytes around the buggy address:
  0x0c087fff9c00: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa
  0x0c087fff9c10: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa
  0x0c087fff9c20: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa
  0x0c087fff9c30: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa
  0x0c087fff9c40: fa fa fd fd fd fd fd fa fa fa 00 00 00 00 00 fa
=>0x0c087fff9c50:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9ca0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==289173==ABORTING

Cause
=====

The start functions of the various worker threads of the session daemon
are implemented in separate translation units (TU). To make use of the
lttng_thread API, they all define different control structures to
control their shutdown.

Those structures are all named 'thread_notifiers' and are all allocated
using zmalloc<>. The various instances of zmalloc<thread_notifiers> all
end up having the same mangled name (e.g.
_Z7zmallocI16thread_notifiersEPT_v).

At link time, only one instance of zmalloc<thread_notifiers> is kept.
Since those structures all have different layout/sizes, this is
problematic. However, it is an acceptable behaviour according to the ODR
[1].

I first considered making the various memory allocation functions in
macros.hpp 'static' which results in each TU holding the appropriate
specialization of the various functions. While this works, it doesn't
make us ODR-compliant. To make a long story short, a program defining
multiple types sharing the same name, in the same namespace, is
ill-formed.

Another concern is that marking all templated free-functions as static
will eventually result in code bloat.

Solution
========

All structures defined in TUs (but not in a header) are placed in
unnamed namespaces (also called anonymous namespaces) [2].

This results in separate copies of the templated functions being
generated when specialized using a structure in an anonymous
namespace (e.g. _Z7zmallocIN12_GLOBAL__N_116thread_notifiersEEPT_v).

We could have renamed the various `thread_notifiers` structures to give
them different names. However, I found those are not the only structures
sharing a name in different TUs. For instance, the same problem applies
to `struct lttng_index` (index in a stream, index in a map).

I propose we systematically namespace structures defined in TUs in the
future.

This will also save us trouble if those POD structures eventually become
non-POD: we would experience the same "clashes" if those structures had
constructors, for example.

References
==========

[1] https://en.cppreference.com/w/cpp/language/definition
[2] https://en.cppreference.com/w/cpp/language/namespace

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I867e5a287ad8cf3ada617335bc1a80b800bf0833

64 files changed:
src/bin/lttng-crash/lttng-crash.cpp
src/bin/lttng-relayd/sessiond-trace-chunks.cpp
src/bin/lttng-relayd/tcp_keep_alive.cpp
src/bin/lttng-sessiond/action-executor.cpp
src/bin/lttng-sessiond/agent-thread.cpp
src/bin/lttng-sessiond/agent.cpp
src/bin/lttng-sessiond/clear.cpp
src/bin/lttng-sessiond/client.cpp
src/bin/lttng-sessiond/cmd.cpp
src/bin/lttng-sessiond/dispatch.cpp
src/bin/lttng-sessiond/event-notifier-error-accounting.cpp
src/bin/lttng-sessiond/health.cpp
src/bin/lttng-sessiond/manage-apps.cpp
src/bin/lttng-sessiond/manage-consumer.cpp
src/bin/lttng-sessiond/manage-kernel.cpp
src/bin/lttng-sessiond/notification-thread-events.cpp
src/bin/lttng-sessiond/notify-apps.cpp
src/bin/lttng-sessiond/register.cpp
src/bin/lttng-sessiond/rotation-thread.cpp
src/bin/lttng-sessiond/session.cpp
src/bin/lttng-sessiond/thread.cpp
src/bin/lttng-sessiond/timer.cpp
src/bin/lttng-sessiond/tracker.cpp
src/bin/lttng-sessiond/ust-metadata.cpp
src/bin/lttng/commands/add_context.cpp
src/bin/lttng/commands/add_trigger.cpp
src/bin/lttng/commands/track-untrack.cpp
src/bin/lttng/loglevel.cpp
src/common/actions/list.cpp
src/common/actions/path.cpp
src/common/actions/rate-policy.cpp
src/common/actions/rotate-session.cpp
src/common/actions/snapshot-session.cpp
src/common/actions/start-session.cpp
src/common/actions/stop-session.cpp
src/common/compat/directory-handle.cpp
src/common/config/session-config.cpp
src/common/consumer/consumer.cpp
src/common/error-query.cpp
src/common/event.cpp
src/common/fd-tracker/fd-tracker.cpp
src/common/fd-tracker/inode.cpp
src/common/fd-tracker/utils-poll.cpp
src/common/fd-tracker/utils.cpp
src/common/index-allocator.cpp
src/common/ini-config/ini-config.cpp
src/common/lttng-elf.cpp
src/common/runas.cpp
src/common/session-descriptor.cpp
src/common/snapshot.cpp
src/common/spawn-viewer.cpp
src/common/trace-chunk.cpp
src/common/tracker.cpp
src/common/uri.cpp
tests/regression/kernel/select_poll_epoll.cpp
tests/regression/tools/live/live_test.cpp
tests/regression/tools/notification/notification.cpp
tests/unit/ini_config/ini_config.cpp
tests/unit/test_event_rule.cpp
tests/unit/test_relayd_backward_compat_group_by_session.cpp
tests/unit/test_utils_expand_path.cpp
tests/unit/test_utils_parse_size_suffix.cpp
tests/unit/test_utils_parse_time_suffix.cpp
tests/utils/xml-utils/validate_xml.cpp

index f63ececc09d861049342883c65a4afb86df263e3..3987a60ddac334d2e75fabf213102c7d4d1ea0f6 100644 (file)
@@ -98,6 +98,7 @@ enum rb_modes {
        RING_BUFFER_DISCARD = 1,        /* Discard when buffer full */
 };
 
+namespace {
 struct crash_abi_unknown {
        uint8_t magic[RB_CRASH_DUMP_ABI_MAGIC_LEN];
        uint64_t mmap_length;   /* Overall length of crash record */
@@ -177,6 +178,7 @@ struct lttng_crash_layout {
        uint64_t num_subbuf;    /* Number of sub-buffers for writer */
        uint32_t mode;          /* Buffer mode: 0: overwrite, 1: discard */
 };
+} /* namespace */
 
 /* Variables */
 static const char *progname;
index 68a5e454f8afba796a4aeaa3e86a0ddcbe2cfdaf..34f14f187fbe5d615cc0fd849a9fb3855722bced 100644 (file)
@@ -56,6 +56,7 @@ struct sessiond_trace_chunk_registry {
        struct cds_lfht *ht;
 };
 
+namespace {
 struct trace_chunk_registry_ht_key {
        lttng_uuid sessiond_uuid;
 };
@@ -70,6 +71,7 @@ struct trace_chunk_registry_ht_element {
        struct lttng_trace_chunk_registry *trace_chunk_registry;
        struct sessiond_trace_chunk_registry *sessiond_trace_chunk_registry;
 };
+} /* namespace */
 
 static
 unsigned long trace_chunk_registry_ht_key_hash(
index 885b2a6a5617391e4a430674e37f4c4459cfca34..d632b77426966c7bbc80c7659e93b88cf3660455 100644 (file)
@@ -61,6 +61,7 @@
 
 #endif /* ! defined (__linux__) && ! defined (__sun__) */
 
+namespace {
 struct tcp_keep_alive_support {
        /* TCP keep-alive is supported by this platform. */
        bool supported;
@@ -105,17 +106,18 @@ struct tcp_keep_alive_config {
        int abort_threshold;
 };
 
-static struct tcp_keep_alive_config the_config = {.enabled = false,
+struct tcp_keep_alive_config the_config = {.enabled = false,
                .idle_time = -1,
                .probe_interval = -1,
                .max_probe_count = -1,
                .abort_threshold = -1};
 
-static struct tcp_keep_alive_support the_support = {.supported = false,
+struct tcp_keep_alive_support the_support = {.supported = false,
                .idle_time_supported = false,
                .probe_interval_supported = false,
                .max_probe_count_supported = false,
                .abort_threshold_supported = false};
+} /* namespace */
 
 /*
  * Common parser for string to positive int conversion where the value must be
index 0b910d474ca3c01c0ee01c245d0c4c25c52b8a85..23a99a1acbbb7ec94458ad79a5dc7d9a85ba68ee 100644 (file)
 #define THREAD_NAME "Action Executor"
 #define MAX_QUEUED_WORK_COUNT 8192
 
+struct action_executor {
+       struct lttng_thread *thread;
+       struct notification_thread_handle *notification_thread_handle;
+       struct {
+               uint64_t pending_count;
+               struct cds_list_head list;
+               pthread_cond_t cond;
+               pthread_mutex_t lock;
+       } work;
+       bool should_quit;
+       uint64_t next_work_item_id;
+};
+
+namespace {
 /*
  * A work item is composed of a dynamic array of sub-items which
  * represent a flattened, and augmented, version of a trigger's actions.
@@ -69,7 +83,6 @@
  * trigger object at the moment of execution, if the trigger is found to be
  * unregistered, the execution is skipped.
  */
-
 struct action_work_item {
        uint64_t id;
 
@@ -94,19 +107,8 @@ struct action_work_subitem {
                LTTNG_OPTIONAL(uint64_t) session_id;
        } context;
 };
+} /* namespace */
 
-struct action_executor {
-       struct lttng_thread *thread;
-       struct notification_thread_handle *notification_thread_handle;
-       struct {
-               uint64_t pending_count;
-               struct cds_list_head list;
-               pthread_cond_t cond;
-               pthread_mutex_t lock;
-       } work;
-       bool should_quit;
-       uint64_t next_work_item_id;
-};
 
 /*
  * Only return non-zero on a fatal error that should shut down the action
index 704f21d65b4add91b1e885269271228ab1759a71..c8fab6164f0c68b05b9545aab7abe25bbb192749 100644 (file)
@@ -22,6 +22,7 @@
 #include "utils.hpp"
 #include "thread.hpp"
 
+namespace {
 struct thread_notifiers {
        struct lttng_pipe *quit_pipe;
        sem_t ready;
@@ -36,15 +37,15 @@ struct agent_protocol_version {
        unsigned int major, minor;
 };
 
-static int agent_tracing_enabled = -1;
+int agent_tracing_enabled = -1;
 
 /*
  * Note that there is not port here. It's set after this URI is parsed so we
  * can let the user define a custom one. However, localhost is ALWAYS the
  * default listening address.
  */
-static const char *default_reg_uri =
-       "tcp://" DEFAULT_NETWORK_VIEWER_BIND_ADDRESS;
+const char *default_reg_uri = "tcp://" DEFAULT_NETWORK_VIEWER_BIND_ADDRESS;
+} /* namespace */
 
 /*
  * Update agent application using the given socket. This is done just after
index 08785235623d5d312d14b95960c1efaaac003f68..2a880a19c800722a6f3bc4c785f43632e61aef28 100644 (file)
@@ -39,6 +39,7 @@ typedef enum lttng_event_rule_status (*event_rule_logging_get_log_level_rule)(
 /*
  * Agent application context representation.
  */
+namespace {
 struct agent_app_ctx {
        char *provider_name;
        char *ctx_name;
@@ -49,6 +50,7 @@ struct agent_app_ctx {
        /* For call_rcu teardown. */
        struct rcu_head rcu_node;
 };
+} /* namespace */
 
 /*
  * Human readable agent return code.
index 04f2a368e44252152dba51c3ed868227e38df9cf..38268edd2e4362fb7dbdf1361c030a7de89e170a 100644 (file)
 #include "kernel.hpp"
 #include "cmd.hpp"
 
+namespace {
 struct cmd_clear_session_reply_context {
        int reply_sock_fd;
 };
+} /* namespace */
 
 static
 void cmd_clear_session_reply(const struct ltt_session *session,
index 37ea0509a2c3a71b8897b30d24a77b0859ff5064..1f94bdad8954f94a7aa06c1576dec4668b6141e0 100644 (file)
 #include "testpoint.hpp"
 #include "utils.hpp"
 
-static bool is_root;
+namespace {
+bool is_root;
 
-static struct thread_state {
+struct thread_state {
        sem_t ready;
        bool running;
        int client_sock;
 } thread_state;
+} /* namespace */
 
 static void set_thread_status(bool running)
 {
index aea78167160be7abc349758af1ad776d45b3c988..07898138ad479fa493546ac45a176d80373a05a0 100644 (file)
@@ -74,6 +74,9 @@
 /* Sleep for 100ms between each check for the shm path's deletion. */
 #define SESSION_DESTROY_SHM_PATH_CHECK_DELAY_US 100000
 
+static enum lttng_error_code wait_on_path(void *path);
+
+namespace {
 struct cmd_destroy_session_reply_context {
        int reply_sock_fd;
        bool implicit_rotation_on_destroy;
@@ -84,15 +87,13 @@ struct cmd_destroy_session_reply_context {
        enum lttng_error_code destruction_status;
 };
 
-static enum lttng_error_code wait_on_path(void *path);
-
 /*
  * Command completion handler that is used by the destroy command
  * when a session that has a non-default shm_path is being destroyed.
  *
  * See comment in cmd_destroy_session() for the rationale.
  */
-static struct destroy_completion_handler {
+struct destroy_completion_handler {
        struct cmd_completion_handler handler;
        char shm_path[member_sizeof(struct ltt_session, shm_path)];
 } destroy_completion_handler = {
@@ -103,17 +104,17 @@ static struct destroy_completion_handler {
        .shm_path = { 0 },
 };
 
-static struct cmd_completion_handler *current_completion_handler;
-
 /*
  * Used to keep a unique index for each relayd socket created where this value
  * is associated with streams on the consumer so it can match the right relayd
  * to send to. It must be accessed with the relayd_net_seq_idx_lock
  * held.
  */
-static pthread_mutex_t relayd_net_seq_idx_lock = PTHREAD_MUTEX_INITIALIZER;
-static uint64_t relayd_net_seq_idx;
+pthread_mutex_t relayd_net_seq_idx_lock = PTHREAD_MUTEX_INITIALIZER;
+uint64_t relayd_net_seq_idx;
+} /* namespace */
 
+static struct cmd_completion_handler *current_completion_handler;
 static int validate_ust_event_name(const char *);
 static int cmd_enable_event_internal(struct ltt_session *session,
                const struct lttng_domain *domain,
index 89d7c7c2e0d1fb894b02f10d7b17223ebbef9bee..8e80c29855e934576b0a17f8814433d835f0114f 100644 (file)
 #include "lttng-sessiond.hpp"
 #include "thread.hpp"
 
+namespace {
 struct thread_notifiers {
        struct ust_cmd_queue *ust_cmd_queue;
        int apps_cmd_pipe_write_fd;
        int apps_cmd_notify_pipe_write_fd;
        int dispatch_thread_exit;
 };
+} /* namespace */
 
 /*
  * For each tracing session, update newly registered apps. The session list
index d42f5802d4c677238ece78c7314fc110cf7e4e9b..285cdbf5992376d9a975af2049f6ed9894876787 100644 (file)
@@ -25,6 +25,7 @@
 
 #define ERROR_COUNTER_INDEX_HT_INITIAL_SIZE 16
 
+namespace {
 struct index_ht_entry {
        struct lttng_ht_node_u64 node;
        uint64_t error_counter_index;
@@ -53,10 +54,10 @@ struct kernel_error_accounting_entry {
        int error_counter_fd;
 };
 
-static struct kernel_error_accounting_entry kernel_error_accounting_entry;
+struct kernel_error_accounting_entry kernel_error_accounting_entry;
 
 /* Hashtable mapping uid to error_account_entry. */
-static struct lttng_ht *error_counter_uid_ht;
+struct lttng_ht *error_counter_uid_ht;
 
 struct error_accounting_state {
        struct lttng_index_allocator *index_allocator;
@@ -65,8 +66,9 @@ struct error_accounting_state {
        uint64_t number_indices;
 };
 
-static struct error_accounting_state ust_state;
-static struct error_accounting_state kernel_state;
+struct error_accounting_state ust_state;
+struct error_accounting_state kernel_state;
+} /* namespace */
 
 static inline void get_trigger_info_for_log(const struct lttng_trigger *trigger,
                const char **trigger_name,
@@ -113,12 +115,14 @@ const char *error_accounting_status_str(
 }
 
 #ifdef HAVE_LIBLTTNG_UST_CTL
+namespace {
 struct event_notifier_counter {
        pthread_mutex_t lock;
        long count;
 };
 
-static struct event_notifier_counter the_event_notifier_counter;
+struct event_notifier_counter the_event_notifier_counter;
+} /* namespace */
 
 static void free_ust_error_accounting_entry(struct rcu_head *head)
 {
index 9a4dee8610b0deeb6b4c3527bc5da84b6ee140c5..0735907a26ad3ae67d9fc26d6f543e8f7f0c98fa 100644 (file)
 #include "utils.hpp"
 #include "thread.hpp"
 
+namespace {
 struct thread_notifiers {
        struct lttng_pipe *quit_pipe;
        sem_t ready;
 };
+} /* namespace */
 
 static
 void mark_thread_as_ready(struct thread_notifiers *notifiers)
index 93d3b93cc12a0699b724ca7f36966ca7539c4640..f8297a6df82820a975bf514702d692de7057ba21 100644 (file)
 #include "utils.hpp"
 #include "thread.hpp"
 
+namespace {
 struct thread_notifiers {
        struct lttng_pipe *quit_pipe;
        int apps_cmd_pipe_read_fd;
 };
+} /* namespace */
 
 static void cleanup_application_management_thread(void *data)
 {
index 47ce9d16a60b2b7d59c7b1104fa1ea62886947fb..a3bb816f9459457ab0a1a74379bab796283a228b 100644 (file)
 #include "thread.hpp"
 #include "ust-consumer.hpp"
 
+namespace {
 struct thread_notifiers {
        struct lttng_pipe *quit_pipe;
        struct consumer_data *consumer_data;
        sem_t ready;
        int initialization_result;
 };
+} /* namespace */
 
 static void mark_thread_as_ready(struct thread_notifiers *notifiers)
 {
index a6393b6c0832bce45c903446c8de28df4cb4f1b9..8d2795466bb32400beda37fd2757aa1b94cb5441 100644 (file)
 #include "kernel.hpp"
 #include "kernel-consumer.hpp"
 
+namespace {
 struct thread_notifiers {
        struct lttng_pipe *quit_pipe;
        int kernel_poll_pipe_read_fd;
 };
+} /* namespace */
 
 /*
  * Update the kernel poll set of all channel fd available over all tracing
index 95932b972e424273ccae84b56fea671af751262e..d6c0d813550a21398a8e6e1987e4f2d437697c83 100644 (file)
@@ -60,12 +60,6 @@ enum lttng_object_type {
        LTTNG_OBJECT_TYPE_SESSION,
 };
 
-struct lttng_trigger_list_element {
-       /* No ownership of the trigger object is assumed. */
-       struct lttng_trigger *trigger;
-       struct cds_list_head node;
-};
-
 struct lttng_channel_trigger_list {
        struct channel_key channel_key;
        /* List of struct lttng_trigger_list_element. */
@@ -117,6 +111,13 @@ struct lttng_session_trigger_list {
        struct rcu_head rcu_node;
 };
 
+namespace {
+struct lttng_trigger_list_element {
+       /* No ownership of the trigger object is assumed. */
+       struct lttng_trigger *trigger;
+       struct cds_list_head node;
+};
+
 struct lttng_trigger_ht_element {
        struct lttng_trigger *trigger;
        struct cds_lfht_node node;
@@ -140,6 +141,7 @@ struct channel_state_sample {
        /* call_rcu delayed reclaim. */
        struct rcu_head rcu_node;
 };
+} /* namespace */
 
 static unsigned long hash_channel_key(struct channel_key *key);
 static int evaluate_buffer_condition(const struct lttng_condition *condition,
index 80c7fb143f06d0e88768428cd392ad4c602122d6..1fff92d071ba01f1f70aac518493194c791485e0 100644 (file)
 #include "utils.hpp"
 #include "thread.hpp"
 
+namespace {
 struct thread_notifiers {
        struct lttng_pipe *quit_pipe;
        int apps_cmd_notify_pipe_read_fd;
 };
+} /* namespace */
 
 /*
  * This thread manage application notify communication.
index aac16b183cfb3aae0f6b6519e4b946cbf6bfe289..f6aaef623f23369328ec1fc61b1748b12ed177e0 100644 (file)
@@ -24,6 +24,7 @@
 #include "utils.hpp"
 #include "thread.hpp"
 
+namespace {
 struct thread_state {
        struct lttng_pipe *quit_pipe;
        struct ust_cmd_queue *ust_cmd_queue;
@@ -31,6 +32,7 @@ struct thread_state {
        bool running;
        int application_socket;
 };
+} /* namespace */
 
 /*
  * Creates the application socket.
index ee924ba98f042ee83a7f80f5d0737c95630d867a..ac75f58abab75bf24e0a25b817070c0bfc2aa5ca 100644 (file)
@@ -47,13 +47,6 @@ struct rotation_thread {
        struct lttng_poll_event events;
 };
 
-struct rotation_thread_job {
-       enum rotation_thread_job_type type;
-       struct ltt_session *session;
-       /* List member in struct rotation_thread_timer_queue. */
-       struct cds_list_head head;
-};
-
 /*
  * The timer thread enqueues jobs and wakes up the rotation thread.
  * When the rotation thread wakes up, it empties the queue.
@@ -72,6 +65,15 @@ struct rotation_thread_handle {
        struct lttng_pipe *quit_pipe;
 };
 
+namespace {
+struct rotation_thread_job {
+       enum rotation_thread_job_type type;
+       struct ltt_session *session;
+       /* List member in struct rotation_thread_timer_queue. */
+       struct cds_list_head head;
+};
+} /* namespace */
+
 static
 const char *get_job_type_str(enum rotation_thread_job_type job_type)
 {
index 3dc8065569d2dfd850e7949912bc9e4dece9b3da..f01f3439cb8f6ca7b53aaf2828c59ad67800181b 100644 (file)
@@ -31,6 +31,7 @@
 #include "timer.hpp"
 #include "cmd.hpp"
 
+namespace {
 struct ltt_session_destroy_notifier_element {
        ltt_session_destroy_notifier notifier;
        void *user_data;
@@ -50,25 +51,26 @@ struct ltt_session_clear_notifier_element {
  * using session_lock() and session_unlock().
  */
 
+/* These characters are forbidden in a session name. Used by validate_name. */
+const char *forbidden_name_chars = "/";
+
+/* Global hash table to keep the sessions, indexed by id. */
+struct lttng_ht *ltt_sessions_ht_by_id = NULL;
+/* Global hash table to keep the sessions, indexed by name. */
+struct lttng_ht *ltt_sessions_ht_by_name = NULL;
+
 /*
  * Init tracing session list.
  *
  * Please see session.h for more explanation and correct usage of the list.
  */
-static struct ltt_session_list ltt_session_list = {
+struct ltt_session_list the_session_list = {
        .lock = PTHREAD_MUTEX_INITIALIZER,
        .removal_cond = PTHREAD_COND_INITIALIZER,
        .next_uuid = 0,
-       .head = CDS_LIST_HEAD_INIT(ltt_session_list.head),
+       .head = CDS_LIST_HEAD_INIT(the_session_list.head),
 };
-
-/* These characters are forbidden in a session name. Used by validate_name. */
-static const char *forbidden_name_chars = "/";
-
-/* Global hash table to keep the sessions, indexed by id. */
-static struct lttng_ht *ltt_sessions_ht_by_id = NULL;
-/* Global hash table to keep the sessions, indexed by name. */
-static struct lttng_ht *ltt_sessions_ht_by_name = NULL;
+} /* namespace */
 
 /*
  * Validate the session name for forbidden characters.
@@ -113,8 +115,8 @@ static uint64_t add_session_list(struct ltt_session *ls)
 {
        LTTNG_ASSERT(ls);
 
-       cds_list_add(&ls->list, &ltt_session_list.head);
-       return ltt_session_list.next_uuid++;
+       cds_list_add(&ls->list, &the_session_list.head);
+       return the_session_list.next_uuid++;
 }
 
 /*
@@ -134,7 +136,7 @@ static void del_session_list(struct ltt_session *ls)
  */
 struct ltt_session_list *session_get_list(void)
 {
-       return &ltt_session_list;
+       return &the_session_list;
 }
 
 /*
@@ -142,12 +144,12 @@ struct ltt_session_list *session_get_list(void)
  */
 void session_list_wait_empty(void)
 {
-       pthread_mutex_lock(&ltt_session_list.lock);
-       while (!cds_list_empty(&ltt_session_list.head)) {
-               pthread_cond_wait(&ltt_session_list.removal_cond,
-                               &ltt_session_list.lock);
+       pthread_mutex_lock(&the_session_list.lock);
+       while (!cds_list_empty(&the_session_list.head)) {
+               pthread_cond_wait(&the_session_list.removal_cond,
+                               &the_session_list.lock);
        }
-       pthread_mutex_unlock(&ltt_session_list.lock);
+       pthread_mutex_unlock(&the_session_list.lock);
 }
 
 /*
@@ -155,7 +157,7 @@ void session_list_wait_empty(void)
  */
 void session_lock_list(void)
 {
-       pthread_mutex_lock(&ltt_session_list.lock);
+       pthread_mutex_lock(&the_session_list.lock);
 }
 
 /*
@@ -163,7 +165,7 @@ void session_lock_list(void)
  */
 int session_trylock_list(void)
 {
-       return pthread_mutex_trylock(&ltt_session_list.lock);
+       return pthread_mutex_trylock(&the_session_list.lock);
 }
 
 /*
@@ -171,7 +173,7 @@ int session_trylock_list(void)
  */
 void session_unlock_list(void)
 {
-       pthread_mutex_unlock(&ltt_session_list.lock);
+       pthread_mutex_unlock(&the_session_list.lock);
 }
 
 /*
@@ -1015,7 +1017,7 @@ void session_release(struct urcu_ref *ref)
        pthread_mutex_destroy(&session->lock);
 
        if (session_published) {
-               ASSERT_LOCKED(ltt_session_list.lock);
+               ASSERT_LOCKED(the_session_list.lock);
                del_session_list(session);
                del_session_ht(session);
        }
@@ -1038,8 +1040,8 @@ void session_release(struct urcu_ref *ref)
                 * Broadcast after free-ing to ensure the memory is
                 * reclaimed before the main thread exits.
                 */
-               ASSERT_LOCKED(ltt_session_list.lock);
-               pthread_cond_broadcast(&ltt_session_list.removal_cond);
+               ASSERT_LOCKED(the_session_list.lock);
+               pthread_cond_broadcast(&the_session_list.removal_cond);
        }
 }
 
@@ -1064,7 +1066,7 @@ void session_put(struct ltt_session *session)
         * The session list lock must be held as any session_put()
         * may cause the removal of the session from the session_list.
         */
-       ASSERT_LOCKED(ltt_session_list.lock);
+       ASSERT_LOCKED(the_session_list.lock);
        LTTNG_ASSERT(session->ref.refcount);
        urcu_ref_put(&session->ref, session_release);
 }
@@ -1137,11 +1139,11 @@ struct ltt_session *session_find_by_name(const char *name)
        struct ltt_session *iter;
 
        LTTNG_ASSERT(name);
-       ASSERT_LOCKED(ltt_session_list.lock);
+       ASSERT_LOCKED(the_session_list.lock);
 
        DBG2("Trying to find session by name %s", name);
 
-       cds_list_for_each_entry(iter, &ltt_session_list.head, list) {
+       cds_list_for_each_entry(iter, &the_session_list.head, list) {
                if (!strncmp(iter->name, name, NAME_MAX) &&
                                !iter->destroyed) {
                        goto found;
@@ -1165,7 +1167,7 @@ struct ltt_session *session_find_by_id(uint64_t id)
        struct ltt_session *ls;
 
        ASSERT_RCU_READ_LOCKED();
-       ASSERT_LOCKED(ltt_session_list.lock);
+       ASSERT_LOCKED(the_session_list.lock);
 
        if (!ltt_sessions_ht_by_id) {
                goto end;
@@ -1197,7 +1199,7 @@ enum lttng_error_code session_create(const char *name, uid_t uid, gid_t gid,
        enum lttng_error_code ret_code;
        struct ltt_session *new_session = NULL;
 
-       ASSERT_LOCKED(ltt_session_list.lock);
+       ASSERT_LOCKED(the_session_list.lock);
        if (name) {
                struct ltt_session *clashing_session;
 
@@ -1391,7 +1393,7 @@ int session_reset_rotation_state(struct ltt_session *session,
 {
        int ret = 0;
 
-       ASSERT_LOCKED(ltt_session_list.lock);
+       ASSERT_LOCKED(the_session_list.lock);
        ASSERT_LOCKED(session->lock);
 
        session->rotation_state = result;
index 94890e6ef47786db7d13fce3fac6f9e372fe878a..201917396462230165f91a931c33373d2a556eff 100644 (file)
 #include <common/error.hpp>
 #include <common/defaults.hpp>
 
-static struct thread_list {
+namespace {
+struct thread_list {
        struct cds_list_head head;
        pthread_mutex_t lock;
 } thread_list = {
        .head = CDS_LIST_HEAD_INIT(thread_list.head),
        .lock = PTHREAD_MUTEX_INITIALIZER,
 };
+} /* namespace */
 
 struct lttng_thread {
        struct urcu_ref ref;
index 4e8b8026b2ee7534f01a95826b8f92f89f6b4dd3..30eb13446e3badb44e1e278e5f8ad5c636490e7c 100644 (file)
        })
 #define PTR_TO_UINT(ptr) ((uintptr_t) ptr)
 
+namespace {
 /*
  * Handle timer teardown race wrt memory free of private data by sessiond
  * signals are handled by a single thread, which permits a synchronization
  * point between handling of each signal. Internal lock ensures mutual
  * exclusion.
  */
-static
 struct timer_signal_data {
        /* Thread managing signals. */
        pthread_t tid;
@@ -44,6 +44,7 @@ struct timer_signal_data {
        .qs_done = 0,
        .lock = PTHREAD_MUTEX_INITIALIZER,
 };
+} /* namespace */
 
 /*
  * Set custom signal mask to current thread.
index 7d587280645b0ebe72381075038994a15f17d605..9e29b73247c33ed21f5b19c77aadeaa6cf9fc978 100644 (file)
 #include <common/tracker.hpp>
 #include <lttng/lttng-error.h>
 
+struct process_attr_tracker {
+       enum lttng_tracking_policy policy;
+       struct cds_lfht *inclusion_set_ht;
+};
+
+namespace {
 struct process_attr_tracker_value_node {
        struct process_attr_value *value;
        struct cds_lfht_node inclusion_set_ht_node;
        struct rcu_head rcu_head;
 };
-
-struct process_attr_tracker {
-       enum lttng_tracking_policy policy;
-       struct cds_lfht *inclusion_set_ht;
-};
+} /* namespace */
 
 static void process_attr_tracker_value_node_rcu_free(struct rcu_head *rcu_head)
 {
index 5f031a9c41f7f074fda80129828b0c6688508576..3a2eb5ca2446b5042884d5917c468df281cb3bf5 100644 (file)
 
 #define NR_CLOCK_OFFSET_SAMPLES                10
 
+namespace {
 struct offset_sample {
-       int64_t offset;                 /* correlation offset */
-       uint64_t measure_delta;         /* lower is better */
+       /* correlation offset */
+       int64_t offset;
+       /* lower is better */
+       uint64_t measure_delta;
 };
+} /* namespace */
 
 static
 int _lttng_field_statedump(struct ust_registry_session *session,
index b25d2d10a3aced9b771a8094bac5e12cf3bee335..5db0c5664888193d1b943558faf2ae4d3556a4aa 100644 (file)
@@ -217,7 +217,7 @@ static struct poptOption long_options[] = {
        _PERF_HW_CACHE(optstr "-prefetch-misses", name, type,           \
                PREFETCH, MISS, hide)
 
-static
+namespace {
 const struct ctx_opts {
        /* Needed for end-of-list item. */
        ctx_opts()
@@ -552,8 +552,7 @@ struct ctx_type_list {
 } ctx_type_list = {
        .head = CDS_LIST_HEAD_INIT(ctx_type_list.head),
 };
-
-
+} /* namespace */
 
 /*
  * Find context numerical value from string.
index acaa50c7dfff3bfb183651e3f33c5c6e33f325bc..4ae57638fc71491e982a166acefec2fce2970ce3 100644 (file)
@@ -640,6 +640,7 @@ void destroy_event_expr(void *ptr)
        lttng_event_expr_destroy((lttng_event_expr *) ptr);
 }
 
+namespace {
 struct parse_event_rule_res {
        /* Owned by this. */
        struct lttng_event_rule *er;
@@ -647,6 +648,7 @@ struct parse_event_rule_res {
        /* Array of `struct lttng_event_expr *` */
        struct lttng_dynamic_pointer_array capture_descriptors;
 };
+} /* namespace */
 
 static
 struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv,
@@ -1404,11 +1406,13 @@ end:
        return c;
 }
 
+namespace {
 struct condition_descr {
        const char *name;
        struct lttng_condition *(*handler) (int *argc, const char ***argv,
                int argc_offset);
 };
+} /* namespace */
 
 static const
 struct condition_descr condition_descrs[] = {
@@ -2099,11 +2103,13 @@ end:
        return action;
 }
 
+namespace {
 struct action_descr {
        const char *name;
        struct lttng_action *(*handler) (int *argc, const char ***argv,
                int argc_offset);
 };
+} /* namespace */
 
 static const
 struct action_descr action_descrs[] = {
index f7b268f71d11edbb7087771d27e829e498f89467..8e9bec149e7cb3f881d30b829491edad59595a2b 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "../command.hpp"
 
+namespace {
 struct process_attr_command_args {
        enum lttng_process_attr process_attr;
        /* Present in the user's command. */
@@ -37,6 +38,7 @@ struct process_attr_command_args {
        bool all;
        struct lttng_dynamic_pointer_array string_args;
 };
+} /* namespace */
 
 enum cmd_type {
        CMD_TRACK,
index fe588bd8e01d957727e2acd7a3e04d42c23cc994..6b9881a025bcd8004982b059fd4fd99e4f96657a 100644 (file)
 #include <strings.h>
 #include <ctype.h>
 
+namespace {
 struct loglevel_name_value {
        const char *name;
        int value;
 };
+} /* namespace */
 
 static
 const struct loglevel_name_value loglevel_values[] = {
index e524399adf499b7ebf57833bf53e7183acdbcb06..1d962152b0e825e9b422542d7d37126c9de5e18b 100644 (file)
@@ -18,6 +18,7 @@
 #define IS_LIST_ACTION(action) \
        (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_LIST)
 
+namespace {
 struct lttng_action_list {
        struct lttng_action parent;
 
@@ -33,6 +34,7 @@ struct lttng_action_list_comm {
         */
        char data[];
 } LTTNG_PACKED;
+} /* namespace */
 
 static void destroy_lttng_action_list_element(void *ptr)
 {
index cbb7519b13f5a21d907f993755785b6d6dfeaa4f..4728485177a209a5c5aa7ddfc95033c04c3cd597 100644 (file)
@@ -7,10 +7,12 @@
 
 #include <lttng/action/path-internal.hpp>
 
+namespace {
 struct lttng_action_path_comm {
        uint32_t index_count;
        uint64_t indexes[];
 } LTTNG_PACKED;
+} /* namespace */
 
 struct lttng_action_path *lttng_action_path_create(
                const uint64_t *indexes, size_t index_count)
index 25f8e4083387b11a53f0a74e92c4b6bcb4290306..c9c7a05197c2cbea1d8f8be4c8d30c8f2f07b1a1 100644 (file)
@@ -48,6 +48,7 @@ struct lttng_rate_policy {
        rate_policy_mi_serialize_cb mi_serialize;
 };
 
+namespace {
 struct lttng_rate_policy_every_n {
        struct lttng_rate_policy parent;
        uint64_t interval;
@@ -70,6 +71,7 @@ struct lttng_rate_policy_once_after_n_comm {
 struct lttng_rate_policy_every_n_comm {
        uint64_t interval;
 } LTTNG_PACKED;
+} /* namespace */
 
 /* Forward declaration. */
 static void lttng_rate_policy_init(struct lttng_rate_policy *rate_policy,
index a8e882b4faa4e175ca113ebb3821e7db441d0784..9c9a2a466ddbe52adfbc4e1ac0e10d06c38f3706 100644 (file)
@@ -17,6 +17,7 @@
 #define IS_ROTATE_SESSION_ACTION(action) \
        (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_ROTATE_SESSION)
 
+namespace {
 struct lttng_action_rotate_session {
        struct lttng_action parent;
 
@@ -37,6 +38,7 @@ struct lttng_action_rotate_session_comm {
         */
        char data[];
 } LTTNG_PACKED;
+} /* namespace */
 
 static const struct lttng_rate_policy *
 lttng_action_rotate_session_internal_get_rate_policy(
index c3570081abcdf2248137fdd8c631403a3c45c0bf..6639ea55ea219e20140af602268f20b1cfc30634 100644 (file)
@@ -23,6 +23,7 @@
 #define IS_SNAPSHOT_SESSION_ACTION(action) \
        (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_SNAPSHOT_SESSION)
 
+namespace {
 struct lttng_action_snapshot_session {
        struct lttng_action parent;
 
@@ -54,6 +55,7 @@ struct lttng_action_snapshot_session_comm {
         */
        char data[];
 } LTTNG_PACKED;
+} /* namespace */
 
 static const struct lttng_rate_policy *
 lttng_action_snapshot_session_internal_get_rate_policy(
index f9138f51a56f8b20fd2aee980ea800d779b0e758..91bb3505e5115e7c489e5072e469c3c8ee69b580 100644 (file)
@@ -17,6 +17,7 @@
 #define IS_START_SESSION_ACTION(action) \
        (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_START_SESSION)
 
+namespace {
 struct lttng_action_start_session {
        struct lttng_action parent;
 
@@ -37,6 +38,7 @@ struct lttng_action_start_session_comm {
         */
        char data[];
 } LTTNG_PACKED;
+} /* namespace */
 
 static const struct lttng_rate_policy *
 lttng_action_start_session_internal_get_rate_policy(
index 75ff1b84755b5ec682d712093d4990f082f472c0..d395c66d64e11eea2a3e85ad0f7b7e0901c95c10 100644 (file)
@@ -17,6 +17,7 @@
 #define IS_STOP_SESSION_ACTION(action) \
        (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_STOP_SESSION)
 
+namespace {
 struct lttng_action_stop_session {
        struct lttng_action parent;
 
@@ -37,6 +38,7 @@ struct lttng_action_stop_session_comm {
         */
        char data[];
 } LTTNG_PACKED;
+} /* namespace */
 
 static const struct lttng_rate_policy *
 lttng_action_stop_session_internal_get_rate_policy(
index 5c8d28db9de6db30e95589cfa074edb76784961c..904f59e9489af49604bde85195e23d0eefc79bde 100644 (file)
@@ -1151,6 +1151,7 @@ int lttng_directory_handle_remove_subdirectory_as_user(
        return ret;
 }
 
+namespace {
 struct rmdir_frame {
        ssize_t parent_frame_idx;
        DIR *dir;
@@ -1158,6 +1159,7 @@ struct rmdir_frame {
        /* Size including '\0'. */
        size_t path_size;
 };
+} /* namespace */
 
 static
 void rmdir_frame_fini(void *data)
index 9e5f0ff20cbf298b4753c2e0bf2975e7b8d5ea25..de0b519f7b7e614cdb82ed6a1d73396148f9705b 100644 (file)
 
 #define CONFIG_USERSPACE_PROBE_LOOKUP_METHOD_NAME_MAX_LEN 7
 
+namespace {
 struct session_config_validation_ctx {
        xmlSchemaParserCtxtPtr parser_ctx;
        xmlSchemaPtr schema;
        xmlSchemaValidCtxtPtr schema_validation_ctx;
 };
+} /* namespace */
 
 const char * const config_element_all = "all";
 LTTNG_EXPORT const char *config_xml_encoding = "UTF-8";
@@ -233,12 +235,14 @@ enum process_event_node_phase {
        ENABLE = 1,
 };
 
+namespace {
 struct consumer_output {
        int enabled;
        char *path;
        char *control_uri;
        char *data_uri;
 };
+} /* namespace */
 
 /*
  * Returns a xmlChar string which must be released using xmlFree().
index 9393e6cc29af21a8c3b8072ffd42eb6a0ae14b3e..a9de1696e4ce862d52bf58b5c6ab44f73ad76b28 100644 (file)
@@ -52,12 +52,22 @@ enum consumer_channel_action {
        CONSUMER_CHANNEL_QUIT,
 };
 
+namespace {
 struct consumer_channel_msg {
        enum consumer_channel_action action;
        struct lttng_consumer_channel *chan;    /* add */
        uint64_t key;                           /* del */
 };
 
+/*
+ * Global hash table containing respectively metadata and data streams. The
+ * stream element in this ht should only be updated by the metadata poll thread
+ * for the metadata and the data poll thread for the data.
+ */
+struct lttng_ht *metadata_ht;
+struct lttng_ht *data_ht;
+} /* namespace */
+
 /* Flag used to temporarily pause data consumption from testpoints. */
 int data_consumption_paused;
 
@@ -69,14 +79,6 @@ int data_consumption_paused;
  */
 int consumer_quit;
 
-/*
- * Global hash table containing respectively metadata and data streams. The
- * stream element in this ht should only be updated by the metadata poll thread
- * for the metadata and the data poll thread for the data.
- */
-static struct lttng_ht *metadata_ht;
-static struct lttng_ht *data_ht;
-
 static const char *get_consumer_domain(void)
 {
        switch (the_consumer_data.type) {
index 13efbbfd7d03f6154ceca9dcc8f9b7b2e8fb69fb..31de0ee5e764c7d1b0ea98a784668afaedbdc304 100644 (file)
@@ -24,6 +24,17 @@ struct lttng_error_query {
        enum lttng_error_query_target_type target_type;
 };
 
+struct lttng_error_query_result {
+       enum lttng_error_query_result_type type;
+       char *name;
+       char *description;
+};
+
+struct lttng_error_query_results {
+       struct lttng_dynamic_pointer_array results;
+};
+
+namespace {
 struct lttng_error_query_comm {
        /* enum lttng_error_query_target_type */
        int8_t target_type;
@@ -50,12 +61,6 @@ struct lttng_error_query_action {
        struct lttng_action_path action_path;
 };
 
-struct lttng_error_query_result {
-       enum lttng_error_query_result_type type;
-       char *name;
-       char *description;
-};
-
 struct lttng_error_query_result_comm {
        /* enum lttng_error_query_result_type */
        uint8_t type;
@@ -81,10 +86,7 @@ struct lttng_error_query_results_comm {
        /* `count` instances of `struct lttng_error_query_result` follow. */
        char payload[];
 } LTTNG_PACKED;
-
-struct lttng_error_query_results {
-       struct lttng_dynamic_pointer_array results;
-};
+} /* namespace */
 
 static
 enum lttng_error_code lttng_error_query_result_mi_serialize(
index 4844888a2df770ca5b9bed7e5dd7a9d758be7def..e17a560cf811bd5dd781200d1cdcf7385927b690 100644 (file)
 #include <lttng/lttng-error.h>
 #include <lttng/userspace-probe-internal.hpp>
 
+namespace {
 struct event_list_element {
        struct lttng_event *event;
        struct lttng_event_exclusion *exclusions;
        char *filter_expression;
 };
+} /* namespace */
 
 static void event_list_destructor(void *ptr)
 {
index 398ec971ddd5fdf5c8e0ff61e987efbad3ac1432..e1f9b14fbba8fa618e072d5addc422f2c5cbdaec 100644 (file)
@@ -80,6 +80,7 @@ struct fd_tracker {
        struct lttng_unlinked_file_pool *unlinked_file_pool;
 };
 
+namespace {
 struct open_properties {
        int flags;
        LTTNG_OPTIONAL(mode_t) mode;
@@ -124,7 +125,7 @@ struct unsuspendable_fd {
        struct rcu_head rcu_head;
 };
 
-static struct {
+struct {
        pthread_mutex_t lock;
        bool initialized;
        unsigned long value;
@@ -133,6 +134,7 @@ static struct {
        .initialized = false,
        .value = 0,
 };
+} /* namespace */
 
 static int match_fd(struct cds_lfht_node *node, const void *key);
 static void unsuspendable_fd_destroy(struct unsuspendable_fd *entry);
index 9c1133ea56255281e628533453df8b36d55eac89..95a0f27426c9f943c86aee36d1be11947446f16b 100644 (file)
 
 #include "inode.hpp"
 
+namespace {
 struct inode_id {
        dev_t device;
        ino_t inode;
 };
+} /* namespace */
 
 struct lttng_inode_registry {
        /* Hashtable of inode_id to lttng_inode. */
@@ -60,7 +62,8 @@ struct lttng_unlinked_file_pool {
        unsigned int next_id;
 };
 
-static struct {
+namespace {
+struct {
        pthread_mutex_t lock;
        bool initialized;
        unsigned long value;
@@ -69,6 +72,7 @@ static struct {
                .initialized = false,
                .value = 0,
 };
+} /* namespace */
 
 static unsigned long lttng_inode_id_hash(const struct inode_id *id)
 {
index 8c04b07b2da1d2049f11ecc8f0dffda586a516f7..8c252851ee667df1319633ded704b1e9ea8169e3 100644 (file)
 
 #ifdef HAVE_EPOLL
 
+namespace {
 struct create_args {
        struct lttng_poll_event *events;
        int size;
        int flags;
 };
+} /* namespace */
 
 static int open_epoll(void *data, int *out_fd)
 {
index 79da7ced6b14dde19faf553569940b68df7db6b8..d4a7329282651b714b0937f3889b42ab9de82e40 100644 (file)
@@ -63,11 +63,13 @@ int fd_tracker_util_pipe_close(struct fd_tracker *tracker, int *pipe)
                        tracker, pipe, 2, close_pipe, NULL);
 }
 
+namespace {
 struct open_directory_handle_args {
        const struct lttng_directory_handle *in_handle;
        struct lttng_directory_handle *ret_handle;
        const char *path;
 };
+} /* namespace */
 
 static
 int open_directory_handle(void *_args, int *out_fds)
index 1f7b3e05208d3cfb6fa60785f4db7218f57f7588..32778cd205eae16652af36770d768769db62724f 100644 (file)
@@ -22,10 +22,12 @@ struct lttng_index_allocator {
        uint64_t nb_allocated_indexes;
 };
 
+namespace {
 struct lttng_index {
        uint64_t index;
        struct cds_list_head head;
 };
+} /* namespace */
 
 struct lttng_index_allocator *lttng_index_allocator_create(
                uint64_t index_count)
index 0b9502fc48c77db3a200bfb8a7f4f0e3b7217929..da204d988c0aa9557979f550080b72384d0d1c28 100644 (file)
@@ -21,11 +21,13 @@ LTTNG_EXPORT const char *config_str_no = "no";
 LTTNG_EXPORT const char *config_str_false = "false";
 LTTNG_EXPORT const char *config_str_off = "off";
 
+namespace {
 struct handler_filter_args {
        const char* section;
        config_entry_handler_cb handler;
        void *user_data;
 };
+} /* namespace */
 
 static int config_entry_handler_filter(struct handler_filter_args *args,
                const char *section, const char *name, const char *value)
index ba8d80bb5abef8f4678343a2c3570157da59ecfc..e6b8624386914a38de270fbfbb5a45808d0fe6c1 100644 (file)
 #define EV_NUM 2
 #endif
 
+namespace {
 struct lttng_elf_ehdr {
        uint16_t e_type;
        uint16_t e_machine;
@@ -188,6 +189,7 @@ struct lttng_elf_sym {
        uint64_t st_value;
        uint64_t st_size;
 };
+} /* namespace */
 
 struct lttng_elf {
        int fd;
index 6b1201deb6fc032c3dfb7cd4abcb7db6bd8e31fb..2c762d5ee797f3a98c92f1f59527a1a9ae92f37c 100644 (file)
 
 #define GETPW_BUFFER_FALLBACK_SIZE 4096
 
-struct run_as_data;
-struct run_as_ret;
-typedef int (*run_as_fct)(struct run_as_data *data, struct run_as_ret *ret_value);
-
 enum run_as_cmd {
        RUN_AS_MKDIR,
        RUN_AS_MKDIRAT,
@@ -67,6 +63,11 @@ enum run_as_cmd {
        RUN_AS_GENERATE_FILTER_BYTECODE,
 };
 
+namespace {
+struct run_as_data;
+struct run_as_ret;
+typedef int (*run_as_fct)(struct run_as_data *data, struct run_as_ret *ret_value);
+
 struct run_as_mkdir_data {
        int dirfd;
        char path[LTTNG_PATH_MAX];
@@ -210,7 +211,7 @@ struct run_as_command_properties {
        bool use_cwd_fd;
 };
 
-static const struct run_as_command_properties command_properties[] = {
+const struct run_as_command_properties command_properties[] = {
        {
                .in_fds_offset = offsetof(struct run_as_data, u.mkdir.dirfd),
                .out_fds_offset = -1,
@@ -341,9 +342,10 @@ struct run_as_worker_data {
 };
 
 /* Single global worker per process (for now). */
-static run_as_worker_data *global_worker;
+run_as_worker_data *global_worker;
 /* Lock protecting the worker. */
-static pthread_mutex_t worker_lock = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t worker_lock = PTHREAD_MUTEX_INITIALIZER;
+} /* namespace */
 
 #ifdef VALGRIND
 static
index a3aa40b3e7ddede7f09cf756284cdaef45d78e02..642c6399fc6e7728693a2d27ff07326b9ded2432 100644 (file)
 #include <time.h>
 #include <stdio.h>
 
+namespace {
 struct lttng_session_descriptor_network_location {
        struct lttng_uri *control;
        struct lttng_uri *data;
 };
+} /* namespace */
 
 struct lttng_session_descriptor {
        enum lttng_session_descriptor_type type;
@@ -32,6 +34,7 @@ struct lttng_session_descriptor {
        } output;
 };
 
+namespace {
 struct lttng_session_descriptor_snapshot {
        struct lttng_session_descriptor base;
        /*
@@ -61,6 +64,7 @@ struct lttng_session_descriptor_live_comm {
        /* Live-specific parameters. */
        uint64_t live_timer_us;
 } LTTNG_PACKED;
+} /* namespace */
 
 static
 struct lttng_uri *uri_copy(const struct lttng_uri *uri)
index 618196dd86f02b30f46f207cb95653bf8c3a86a7..191f484c255b0d5a9669737b07e6fff8b3c535cb 100644 (file)
@@ -77,6 +77,7 @@ end:
        return equal;
 }
 
+namespace {
 /*
  * This is essentially the same as `struct lttng_snapshot_output`, but packed.
  */
@@ -87,6 +88,7 @@ struct lttng_snapshot_output_comm {
        char ctrl_url[PATH_MAX];
        char data_url[PATH_MAX];
 } LTTNG_PACKED;
+} /* namespace */
 
 int lttng_snapshot_output_serialize(
                const struct lttng_snapshot_output *output,
index 288e3a2ae6b60beb404bf6248e509d9370d6aef1..0b605a6442a797ad0822e7d034e016d8abd84e5d 100644 (file)
 #include "macros.hpp"
 #include "spawn-viewer.hpp"
 
-
-static const char *babeltrace_bin = CONFIG_BABELTRACE_BIN;
-static const char *babeltrace2_bin = CONFIG_BABELTRACE2_BIN;
-
-/*
- * This is needed for each viewer since we are using execvp().
- */
-static const char *babeltrace_opts[] = { "babeltrace" };
-static const char *babeltrace2_opts[] = { "babeltrace2" };
-
 /*
  * Type is also use as the index in the viewers array. So please, make sure
  * your enum value is in the right order in the array below.
@@ -39,7 +29,17 @@ enum viewer_type {
        VIEWER_USER_DEFINED  = 2,
 };
 
-static const struct viewer {
+namespace {
+const char *babeltrace_bin = CONFIG_BABELTRACE_BIN;
+const char *babeltrace2_bin = CONFIG_BABELTRACE2_BIN;
+
+/*
+ * This is needed for each viewer since we are using execvp().
+ */
+const char *babeltrace_opts[] = { "babeltrace" };
+const char *babeltrace2_opts[] = { "babeltrace2" };
+
+const struct viewer {
        const char *exec_name;
        enum viewer_type type;
 } viewers[] = {
@@ -47,6 +47,7 @@ static const struct viewer {
        { "babeltrace2", VIEWER_BABELTRACE2 },
        { NULL, VIEWER_USER_DEFINED },
 };
+} /* namespace */
 
 static const struct viewer *parse_viewer_option(const char *opt_viewer)
 {
index 2d12216d0ed7ceee52526a316c8c502a2116c993..beae46ef3110c416bd271aeb8125edef70f33502 100644 (file)
@@ -64,10 +64,12 @@ static
 enum lttng_trace_chunk_status lttng_trace_chunk_rename_path_no_lock(
                struct lttng_trace_chunk *chunk, const char *path);
 
+namespace {
 struct chunk_credentials {
        bool use_current_user;
        struct lttng_credentials user;
 };
+} /* namespace */
 
 /*
  * NOTE: Make sure to update:
@@ -120,6 +122,7 @@ struct lttng_trace_chunk {
        struct fd_tracker *fd_tracker;
 };
 
+namespace {
 /* A trace chunk is uniquely identified by its (session id, chunk id) tuple. */
 struct lttng_trace_chunk_registry_element {
        struct lttng_trace_chunk chunk;
@@ -130,11 +133,13 @@ struct lttng_trace_chunk_registry_element {
        /* call_rcu delayed reclaim. */
        struct rcu_head rcu_node;
 };
+} /* namespace */
 
 struct lttng_trace_chunk_registry {
        struct cds_lfht *ht;
 };
 
+namespace {
 struct fs_handle_untracked {
        struct fs_handle parent;
        int fd;
@@ -143,6 +148,7 @@ struct fs_handle_untracked {
                char *path;
        } location;
 };
+} /* namespace */
 
 static
 int fs_handle_untracked_get_fd(struct fs_handle *handle);
index 41e141afe63ae36e09e3caa9f5bb9b21f07331c3..e988599bae9a27a0c4859e6a577b191a5ff57094 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <type_traits>
 
+namespace {
 struct process_attr_tracker_values_comm_header {
        uint32_t count;
 } LTTNG_PACKED;
@@ -33,6 +34,7 @@ struct process_attr_tracker_value_comm {
                uint32_t name_len;
        } value;
 } LTTNG_PACKED;
+} /* namespace */
 
 #define GET_INTEGRAL_COMM_VALUE(value_ptr, as_type)              \
        ((as_type)(std::is_signed<as_type>::value ? (value_ptr)->u._signed : \
index 8e663c46a732116b84c9e5c20615c6c018354034..3b74928b401cc469a9b2dca2f8f205b3746a1d71 100644 (file)
@@ -25,6 +25,7 @@ enum uri_proto_code {
        P_NET, P_NET6, P_FILE, P_TCP, P_TCP6,
 };
 
+namespace {
 struct uri_proto {
        const char *name;
        const char *leading_string;
@@ -34,7 +35,7 @@ struct uri_proto {
 };
 
 /* Supported protocols */
-static const struct uri_proto proto_uri[] = {
+const struct uri_proto proto_uri[] = {
        { .name = "file", .leading_string = "file://", .code = P_FILE, .type = LTTNG_PROTO_TYPE_NONE, .dtype = LTTNG_DST_PATH },
        { .name = "net", .leading_string = "net://", .code = P_NET, .type = LTTNG_TCP, .dtype = LTTNG_DST_IPV4 },
        { .name = "net4", .leading_string = "net4://", .code = P_NET, .type = LTTNG_TCP, .dtype = LTTNG_DST_IPV4 },
@@ -45,6 +46,7 @@ static const struct uri_proto proto_uri[] = {
        /* Invalid proto marking the end of the array. */
        {}
 };
+} /* namespace */
 
 /*
  * Return pointer to the character in s matching one of the characters in
index 5dabf55b6e560d403374ee054981bfb101963aa3..c0b6882172b13d471be9a3496ac80b2692595a67 100644 (file)
@@ -59,7 +59,8 @@ static void epoll_pwait_concurrent_munmap(FILE *validation_output_file);
 
 typedef void (*test_case_cb)(FILE *output_file);
 
-static const struct test_case {
+namespace {
+const struct test_case {
        test_case_cb run;
        bool produces_validation_info;
        int timeout;
@@ -82,6 +83,7 @@ struct ppoll_thread_data {
        struct pollfd *ufds;
        int value;
 };
+} /* namespace */
 
 static
 void test_select_big(void)
index 2da5b6fe4e069911af17dbda6bb386a1873f3686..559b9a7b1e8298885ae574090a26683e6058eb82 100644 (file)
 LTTNG_EXPORT DEFINE_LTTNG_UST_SIGBUS_STATE();
 #endif
 
-static int control_sock;
+namespace {
 struct live_session *session;
+int control_sock;
 
-static int first_packet_offset;
-static int first_packet_len;
-static int first_packet_stream_id = -1;
+int first_packet_offset;
+int first_packet_len;
+int first_packet_stream_id = -1;
 
 struct viewer_stream {
        uint64_t id;
@@ -68,6 +69,7 @@ struct live_session {
        uint64_t live_timer_interval;
        uint64_t stream_count;
 };
+} /* namespace */
 
 static
 ssize_t lttng_live_recv(int fd, void *buf, size_t len)
index 15f98bf9a1b4fa50265e412e34adbdeff6496ddc..d3d486be3574a85c2f8bc5f6abc2ec0030d4834a 100644 (file)
@@ -48,6 +48,7 @@ enum field_type {
        FIELD_TYPE_ARRAY_FIELD,
 };
 
+namespace {
 struct capture_base_field_tuple {
        const char *field_name;
        enum field_type field_type;
@@ -58,6 +59,7 @@ struct capture_base_field_tuple {
        validate_cb validate_ust;
        validate_cb validate_kernel;
 };
+} /* namespace */
 
 static
 const char *field_value_type_to_str(enum lttng_event_field_value_type type)
index 874f47f9b09bb55c1e803a291c4ef43589e62aef..bc9aedf1063e73a032c85900fcd55642ea9f82d4 100644 (file)
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <lttng/constant.h>
 
+namespace {
 struct state {
        int section_1;
        int section_2;
@@ -20,6 +21,7 @@ struct state {
        int text_entry;
        int int_entry;
 };
+} /* namespace */
 
 int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 0;
index 351937444b00fd2a7debca8670a8b7f67343ff0a..d7228d0f31f236fc47cac685e547633f3633752f 100644 (file)
@@ -45,10 +45,12 @@ int lttng_opt_mi;
 
 #define NUM_TESTS 212
 
+namespace {
 struct tracepoint_test {
        enum lttng_domain_type type;
        bool support_name_pattern_exclusion;
 };
+} /* namespace */
 
 typedef const char *(*log_level_name_getter)(int log_level);
 
index 42cb0156a8246f2262e56679e12aeda36c7c4331..4b794faf7c7081660cc1317dbdc575c999f8cfbb 100644 (file)
@@ -18,6 +18,7 @@
 /* Number of TAP tests in this file */
 #define NUM_TESTS_PER_TEST 1
 
+namespace {
 struct test {
        const char *stream_path;
        const char *session_name;
@@ -27,6 +28,7 @@ struct test {
        const char *leftover;
        bool is_valid;
 };
+} /* namespace */
 
 int lttng_opt_quiet;
 int lttng_opt_mi;
index d11c2d9198d46605f54bab9073c1a8c7bdd03d42..9892727bad86f7e615e9a644c43236cb78208191 100644 (file)
@@ -24,6 +24,7 @@ int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 3;
 int lttng_opt_mi;
 
+namespace {
 struct valid_test_input {
        const char *input;
        const char *relative_part;
@@ -41,7 +42,7 @@ struct symlink_test_input {
 };
 
 /* Valid test cases */
-static struct valid_test_input valid_tests_inputs[] = {
+struct valid_test_input valid_tests_inputs[] = {
        { "/a/b/c/d/e",                 "",             "/a/b/c/d/e"    },
        { "/a//b//c/d/e",               "",             "/a/b/c/d/e"    },
        { "./a/b/c/d/e",                ".",            "/a/b/c/d/e"    },
@@ -67,22 +68,22 @@ static struct valid_test_input valid_tests_inputs[] = {
        { "/a/..",                      "",             "/"             },
 };
 char **valid_tests_expected_results;
-static const int num_valid_tests =
+const int num_valid_tests =
                sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]);
 
 /* Symlinks test cases */
 char tree_origin[] = "/tmp/test_utils_expand_path.XXXXXX";
 
-static const char * const tree_dirs[] = {
+const char * const tree_dirs[] = {
        "a",
        "a/b",
        "a/b/c",
        "a/e",
 };
-static const int num_tree_dirs =
+const int num_tree_dirs =
                sizeof(tree_dirs) / sizeof(tree_dirs[0]);
 
-static struct tree_symlink tree_symlinks[] = {
+struct tree_symlink tree_symlinks[] = {
        { "a/d",                        "b/c/"          },
        { "a/g",                        "d/"            },
        { "a/b/f",                      "../e/"         },
@@ -90,7 +91,7 @@ static struct tree_symlink tree_symlinks[] = {
        { "a/b/k",                      "c/g/"          },
        { "a/b/c/g",                    "../../../"     },
 };
-static const int num_tree_symlinks =
+const int num_tree_symlinks =
                sizeof(tree_symlinks) / sizeof(tree_symlinks[0]);
 
 static struct symlink_test_input symlink_tests_inputs[] = {
@@ -100,15 +101,16 @@ static struct symlink_test_input symlink_tests_inputs[] = {
        { "a/g/../l/../",               "a/b/"          },
        { "a/b/h/g/",                   ""              },
 };
-static const int num_symlink_tests =
+const int num_symlink_tests =
                sizeof(symlink_tests_inputs) / sizeof(symlink_tests_inputs[0]);
 
 /* Invalid test cases */
-static char *invalid_tests_inputs[] = {
+char *invalid_tests_inputs[] = {
        NULL,
 };
-static const int num_invalid_tests =
+const int num_invalid_tests =
                sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]);
+} /* namespace */
 
 #define PRINT_ERR(fmt, args...)                                                \
        fprintf(stderr, "test_utils_expand_path: error: " fmt "\n", ## args)
index 296ed88b85283906dc9688c7e415c256d3508d94..840d4fc5bd93b88347d4709ae534f9b695a70c75 100644 (file)
@@ -17,13 +17,14 @@ int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 3;
 int lttng_opt_mi;
 
+namespace {
 struct valid_test_input {
        const char *input;
        uint64_t expected_result;
 };
 
 /* Valid test cases */
-static struct valid_test_input valid_tests_inputs[] = {
+struct valid_test_input valid_tests_inputs[] = {
                { "0", 0 },
                { "1234", 1234 },
                { "0x400", 1024 },
@@ -65,10 +66,10 @@ static struct valid_test_input valid_tests_inputs[] = {
                { "0XA0M", 167772160 },
                { "0xA0G", 171798691840ULL },
 };
-static const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]);
+const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]);
 
 /* Invalid test cases */
-static const char *invalid_tests_inputs[] = {
+const char *invalid_tests_inputs[] = {
                "",
                " ",
                "-1",
@@ -90,7 +91,8 @@ static const char *invalid_tests_inputs[] = {
                "0B",
 };
 
-static const int num_invalid_tests = sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]);
+const int num_invalid_tests = sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]);
+} /* namespace */
 
 static void test_utils_parse_size_suffix(void)
 {
index 97c2c78ba39d3a6ed91a1330275905ad08cdab6f..765c96fb5d01bb96c7509d1c0f167a3803c4cb8f 100644 (file)
@@ -18,13 +18,14 @@ int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 3;
 int lttng_opt_mi;
 
+namespace {
 struct valid_test_input {
        const char *input;
        uint64_t expected_result;
 };
 
 /* Valid test cases */
-static struct valid_test_input valid_tests_inputs[] = {
+struct valid_test_input valid_tests_inputs[] = {
                { "0", 0 },
                { "1234", 1234 },
                { "1234us", 1234 },
@@ -52,10 +53,10 @@ static struct valid_test_input valid_tests_inputs[] = {
                { "08", 8 },
                { "0145us", 145 },
 };
-static const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]);
+const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]);
 
 /* Invalid test cases */
-static const char *invalid_tests_inputs[] = {
+const char *invalid_tests_inputs[] = {
                "",
                " ",
                "-1",
@@ -87,7 +88,8 @@ static const char *invalid_tests_inputs[] = {
                "12mo",
                "53hi",
 };
-static const int num_invalid_tests = sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]);
+const int num_invalid_tests = sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]);
+} /* namespace */
 
 static void test_utils_parse_time_suffix(void)
 {
index f75c8e47b063a1a46de2e38a30087467a0ebf25f..887f7af524c146a2f1f6d8b5ecd2ee018cc981c3 100644 (file)
 #include <lttng/lttng-error.h>
 #include <common/macros.hpp>
 
+namespace {
 struct validation_ctx {
        xmlSchemaParserCtxtPtr parser_ctx;
        xmlSchemaPtr schema;
        xmlSchemaValidCtxtPtr schema_validation_ctx;
 };
+} /* namespace */
 
 enum command_err_code {
        CMD_SUCCESS = 0,
This page took 0.060223 seconds and 4 git commands to generate.