From: Kienan Stewart Date: Fri, 13 Dec 2024 21:14:40 +0000 (-0500) Subject: liblttng-ctl: Correct types for various exported strings X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=053bae8485c22f780a08320bafdc4f92f11b9dec;p=lttng-tools.git liblttng-ctl: Correct types for various exported strings Change-Id: Ib04ad688e634ce2fbc07652c835e9085e0832e4d Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/config/session-config.cpp b/src/common/config/session-config.cpp index 608710e97..df33caa62 100644 --- a/src/common/config/session-config.cpp +++ b/src/common/config/session-config.cpp @@ -50,12 +50,17 @@ struct session_config_validation_ctx { } /* namespace */ const char *const config_element_all = "all"; -LTTNG_EXPORT const char *config_xml_encoding = "UTF-8"; +LTTNG_EXPORT extern const char *const config_xml_encoding; +const char *const config_xml_encoding = "UTF-8"; LTTNG_EXPORT size_t config_xml_encoding_bytes_per_char = 2; /* Size of the encoding's largest character */ -LTTNG_EXPORT const char *config_xml_indent_string = "\t"; -LTTNG_EXPORT const char *config_xml_true = "true"; -LTTNG_EXPORT const char *config_xml_false = "false"; +LTTNG_EXPORT extern const char *const config_xml_indent_string; +LTTNG_EXPORT extern const char *const config_xml_true; +LTTNG_EXPORT extern const char *const config_xml_false; + +const char *const config_xml_indent_string = "\t"; +const char *const config_xml_true = "true"; +const char *const config_xml_false = "false"; const char *const config_element_channel = "channel"; const char *const config_element_channels = "channels"; @@ -235,7 +240,7 @@ const char *const config_event_context_vegid = "VEGID"; const char *const config_event_context_vsgid = "VSGID"; /* Deprecated symbols */ -LTTNG_EXPORT const char *config_element_perf; +LTTNG_EXPORT extern const char *const config_element_perf; enum process_event_node_phase { CREATION = 0, @@ -2769,7 +2774,7 @@ end: static int process_domain_node(xmlNodePtr domain_node, const char *session_name) { int ret; - struct lttng_domain domain {}; + struct lttng_domain domain{}; struct lttng_handle *handle = nullptr; struct lttng_channel *channel = nullptr; xmlNodePtr channels_node = nullptr; diff --git a/src/common/ini-config/ini-config.cpp b/src/common/ini-config/ini-config.cpp index 99a7fbe6f..c019e8509 100644 --- a/src/common/ini-config/ini-config.cpp +++ b/src/common/ini-config/ini-config.cpp @@ -15,13 +15,19 @@ #include -LTTNG_EXPORT const char *config_str_yes = "yes"; -LTTNG_EXPORT const char *config_str_true = "true"; -LTTNG_EXPORT const char *config_str_on = "on"; -LTTNG_EXPORT const char *config_str_no = "no"; -LTTNG_EXPORT const char *config_str_false = "false"; -LTTNG_EXPORT const char *config_str_off = "off"; - +LTTNG_EXPORT extern const char *const config_str_yes; +LTTNG_EXPORT extern const char *const config_str_true; +LTTNG_EXPORT extern const char *const config_str_on; +LTTNG_EXPORT extern const char *const config_str_no; +LTTNG_EXPORT extern const char *const config_str_false; +LTTNG_EXPORT extern const char *const config_str_off; + +const char *const config_str_yes = "yes"; +const char *const config_str_true = "true"; +const char *const config_str_on = "on"; +const char *const config_str_no = "no"; +const char *const config_str_false = "false"; +const char *const config_str_off = "off"; namespace { struct handler_filter_args { const char *section; diff --git a/src/common/mi-lttng.cpp b/src/common/mi-lttng.cpp index 32fdee309..2d201e80b 100644 --- a/src/common/mi-lttng.cpp +++ b/src/common/mi-lttng.cpp @@ -364,14 +364,14 @@ const char *const mi_lttng_element_error_query_results = "error_query_results"; const char *const mi_lttng_element_context_symbol = "symbol"; /* Deprecated symbols preserved for ABI compatibility. */ -LTTNG_EXPORT const char *mi_lttng_context_type_perf_counter; -LTTNG_EXPORT const char *mi_lttng_context_type_perf_cpu_counter; -LTTNG_EXPORT const char *mi_lttng_context_type_perf_thread_counter; -LTTNG_EXPORT const char *mi_lttng_element_track_untrack_pid_target; -LTTNG_EXPORT const char *mi_lttng_element_track_untrack_targets; -LTTNG_EXPORT const char *mi_lttng_element_calibrate; -LTTNG_EXPORT const char *mi_lttng_element_calibrate_function; -LTTNG_EXPORT const char *mi_lttng_element_command_calibrate; +LTTNG_EXPORT extern const char *const mi_lttng_context_type_perf_counter; +LTTNG_EXPORT extern const char *const mi_lttng_context_type_perf_cpu_counter; +LTTNG_EXPORT extern const char *const mi_lttng_context_type_perf_thread_counter; +LTTNG_EXPORT extern const char *const mi_lttng_element_track_untrack_pid_target; +LTTNG_EXPORT extern const char *const mi_lttng_element_track_untrack_targets; +LTTNG_EXPORT extern const char *const mi_lttng_element_calibrate; +LTTNG_EXPORT extern const char *const mi_lttng_element_calibrate_function; +LTTNG_EXPORT extern const char *const mi_lttng_element_command_calibrate; /* This is a merge of jul loglevel and regular loglevel * Those should never overlap by definition diff --git a/src/lib/lttng-ctl/deprecated-symbols.cpp b/src/lib/lttng-ctl/deprecated-symbols.cpp index b036206a7..0283a7c4e 100644 --- a/src/lib/lttng-ctl/deprecated-symbols.cpp +++ b/src/lib/lttng-ctl/deprecated-symbols.cpp @@ -19,15 +19,20 @@ LTTNG_EXPORT size_t default_metadata_subbuf_size; LTTNG_EXPORT size_t default_ust_pid_channel_subbuf_size; LTTNG_EXPORT size_t default_ust_uid_channel_subbuf_size; -LTTNG_EXPORT const char *config_element_pid_tracker = nullptr; -LTTNG_EXPORT const char *config_element_target_pid = nullptr; -LTTNG_EXPORT const char *config_element_targets = nullptr; -LTTNG_EXPORT const char *config_element_trackers = nullptr; - #ifdef __cplusplus extern "C" { #endif +LTTNG_EXPORT extern const char *const config_element_pid_tracker; +LTTNG_EXPORT extern const char *const config_element_target_pid; +LTTNG_EXPORT extern const char *const config_element_targets; +LTTNG_EXPORT extern const char *const config_element_trackers; + +const char *const config_element_pid_tracker = nullptr; +const char *const config_element_target_pid = nullptr; +const char *const config_element_targets = nullptr; +const char *const config_element_trackers = nullptr; + struct log_time { char str[19]; };