From: Michael Jeanson Date: Tue, 8 Mar 2022 23:05:26 +0000 (-0500) Subject: Prepare for '-Wmissing-field-initializers' X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1c9a0b0e83c7e073c4e576c0bed95de335b0e502;p=lttng-tools.git Prepare for '-Wmissing-field-initializers' In preparation for '-Wextra' Change-Id: Ic593491ad44c1254f158b19659c3b9567d180ad1 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am index 15dea077d..8eea69f32 100644 --- a/extras/bindings/swig/python/Makefile.am +++ b/extras/bindings/swig/python/Makefile.am @@ -10,6 +10,8 @@ lttng.i: lttng.i.in # Disable -Wshadow for that file. AM_CFLAGS += -Wno-shadow +AM_CFLAGS += -Wno-missing-field-initializers + AM_CPPFLAGS += $(PYTHON_INCLUDE) EXTRA_DIST = lttng.i.in diff --git a/src/bin/lttng-relayd/main.cpp b/src/bin/lttng-relayd/main.cpp index 99f792010..42eb09a89 100644 --- a/src/bin/lttng-relayd/main.cpp +++ b/src/bin/lttng-relayd/main.cpp @@ -2543,6 +2543,7 @@ static ssize_t relay_unpack_rotate_streams_header( sizeof(rotate_streams.stream_count)); rotate_streams = (typeof(rotate_streams)) { .stream_count = be32toh(rotate_streams.stream_count), + .new_chunk_id = LTTNG_OPTIONAL_INIT_UNSET, }; /* diff --git a/src/bin/lttng-sessiond/clear.cpp b/src/bin/lttng-sessiond/clear.cpp index 1239c5f24..a0817c2da 100644 --- a/src/bin/lttng-sessiond/clear.cpp +++ b/src/bin/lttng-sessiond/clear.cpp @@ -38,6 +38,7 @@ void cmd_clear_session_reply(const struct ltt_session *session, .pid = UINT32_MAX, .cmd_header_size = 0, .data_size = 0, + .fd_count = 0, }; DBG("End of clear command: replying to client"); diff --git a/src/bin/lttng-sessiond/cmd.cpp b/src/bin/lttng-sessiond/cmd.cpp index 9ade60798..84254f1a5 100644 --- a/src/bin/lttng-sessiond/cmd.cpp +++ b/src/bin/lttng-sessiond/cmd.cpp @@ -3287,6 +3287,7 @@ void cmd_destroy_session_reply(const struct ltt_session *session, .cmd_header_size = sizeof(struct lttcomm_session_destroy_command_header), .data_size = 0, + .fd_count = 0, }; size_t payload_size_before_location; diff --git a/src/bin/lttng-sessiond/consumer.cpp b/src/bin/lttng-sessiond/consumer.cpp index 9919c6781..f76dffa7e 100644 --- a/src/bin/lttng-sessiond/consumer.cpp +++ b/src/bin/lttng-sessiond/consumer.cpp @@ -1731,6 +1731,7 @@ int consumer_open_channel_packets(struct consumer_socket *socket, uint64_t key) int ret; lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_OPEN_CHANNEL_PACKETS, + .u = {}, }; msg.u.open_channel_packets.key = key; @@ -1786,6 +1787,7 @@ int consumer_init(struct consumer_socket *socket, int ret; struct lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_INIT, + .u = {}, }; LTTNG_ASSERT(socket); @@ -1830,6 +1832,7 @@ int consumer_create_trace_chunk(struct consumer_socket *socket, enum lttng_trace_chunk_status tc_status; struct lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_CREATE_TRACE_CHUNK, + .u = {}, }; msg.u.create_trace_chunk.session_id = session_id; @@ -1984,6 +1987,7 @@ int consumer_close_trace_chunk(struct consumer_socket *socket, enum lttng_trace_chunk_status chunk_status; lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_CLOSE_TRACE_CHUNK, + .u = {}, }; msg.u.close_trace_chunk.session_id = session_id; @@ -2110,6 +2114,7 @@ int consumer_trace_chunk_exists(struct consumer_socket *socket, enum lttng_trace_chunk_status chunk_status; lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_TRACE_CHUNK_EXISTS, + .u = {}, }; msg.u.trace_chunk_exists.session_id = session_id; diff --git a/src/bin/lttng-sessiond/dispatch.cpp b/src/bin/lttng-sessiond/dispatch.cpp index 107e205c6..6cbb26126 100644 --- a/src/bin/lttng-sessiond/dispatch.cpp +++ b/src/bin/lttng-sessiond/dispatch.cpp @@ -231,6 +231,7 @@ static void *thread_dispatch_ust_registration(void *data) struct ust_reg_wait_node *wait_node = NULL, *tmp_wait_node; struct ust_reg_wait_queue wait_queue = { .count = 0, + .head = {}, }; struct thread_notifiers *notifiers = (thread_notifiers *) data; diff --git a/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp b/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp index 49a54ff50..2d2a2aa75 100644 --- a/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp +++ b/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp @@ -981,6 +981,9 @@ event_notifier_error_accounting_register_kernel( LTTNG_KERNEL_ABI_COUNTER_BITNESS_64, .number_dimensions = 1, .global_sum_step = 0, + .dimensions = {}, + .coalesce_hits = 0, + .padding = {}, }; error_counter_conf.dimensions[0].size = kernel_state.number_indices; error_counter_conf.dimensions[0].has_underflow = false; diff --git a/src/bin/lttng-sessiond/main.cpp b/src/bin/lttng-sessiond/main.cpp index 5873f0304..34e881c4d 100644 --- a/src/bin/lttng-sessiond/main.cpp +++ b/src/bin/lttng-sessiond/main.cpp @@ -1361,6 +1361,7 @@ static void unregister_all_triggers(void) unsigned int trigger_count, i; const struct lttng_credentials creds = { .uid = LTTNG_OPTIONAL_INIT_VALUE(0), + .gid = LTTNG_OPTIONAL_INIT_UNSET, }; DBG("Unregistering all triggers"); diff --git a/src/bin/lttng-sessiond/modprobe.cpp b/src/bin/lttng-sessiond/modprobe.cpp index fb2bcc8aa..782dcc6b2 100644 --- a/src/bin/lttng-sessiond/modprobe.cpp +++ b/src/bin/lttng-sessiond/modprobe.cpp @@ -30,38 +30,47 @@ struct kern_modules_param kern_modules_control_core[] = { { .name = (char *) "lttng-ring-buffer-client-discard", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED, + .loaded = false, }, { .name = (char *) "lttng-ring-buffer-client-overwrite", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED, + .loaded = false, }, { .name = (char *) "lttng-ring-buffer-metadata-client", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED, + .loaded = false, }, { .name = (char *) "lttng-ring-buffer-client-mmap-discard", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED, + .loaded = false, }, { .name = (char *) "lttng-ring-buffer-client-mmap-overwrite", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED, + .loaded = false, }, { .name = (char *) "lttng-ring-buffer-metadata-mmap-client", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED, + .loaded = false, }, { .name = (char *) "lttng-ring-buffer-event_notifier-client", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-counter-client-percpu-64-modular", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-counter-client-percpu-32-modular", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, }; @@ -70,170 +79,212 @@ struct kern_modules_param kern_modules_probes_default[] = { { .name = (char *) "lttng-probe-asoc", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-block", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-btrfs", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-compaction", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-ext3", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-ext4", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-gpio", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-i2c", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-irq", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-jbd", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-jbd2", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-kmem", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-kvm", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-kvm-x86", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-kvm-x86-mmu", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-lock", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-module", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-napi", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-net", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-power", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-preemptirq", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-printk", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-random", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-rcu", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-regmap", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-regulator", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-rpm", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-sched", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-scsi", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-signal", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-skb", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-sock", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-statedump", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-sunrpc", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-timer", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-udp", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-vmscan", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-v4l2", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-workqueue", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-writeback", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-x86-irq-vectors", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, { .name = (char *) "lttng-probe-x86-exceptions", .load_policy = KERNEL_MODULE_PROPERTY_LOAD_POLICY_OPTIONAL, + .loaded = false, }, }; diff --git a/src/bin/lttng-sessiond/notification-thread-events.cpp b/src/bin/lttng-sessiond/notification-thread-events.cpp index f0140ce55..9e1aa5300 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.cpp +++ b/src/bin/lttng-sessiond/notification-thread-events.cpp @@ -1031,8 +1031,15 @@ int evaluate_condition_for_client(const struct lttng_trigger *trigger, struct lttng_evaluation *evaluation = NULL; struct notification_client_list client_list = { .lock = PTHREAD_MUTEX_INITIALIZER, + .ref = {}, + .condition = NULL, + .triggers_list = {}, + .clients_list = {}, + .notification_trigger_clients_ht = NULL, + .notification_trigger_clients_ht_node = {}, + .rcu_node = {}, }; - struct notification_client_list_element client_list_element = { 0 }; + struct notification_client_list_element client_list_element = {}; uid_t object_uid = 0; gid_t object_gid = 0; @@ -2064,7 +2071,7 @@ int drain_event_notifier_notification_pipe( struct notification_thread_state *state, int pipe, enum lttng_domain_type domain) { - struct lttng_poll_event events = {0}; + struct lttng_poll_event events = {}; int ret; ret = lttng_poll_create(&events, 1, LTTNG_CLOEXEC); @@ -3700,6 +3707,7 @@ int client_send_command_reply(struct notification_client *client, struct lttng_notification_channel_message msg = { .type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_COMMAND_REPLY, .size = sizeof(reply), + .fds = 0, }; char buffer[sizeof(msg) + sizeof(reply)]; enum client_transmission_status transmission_status; @@ -3804,6 +3812,7 @@ int client_handle_message_handshake(struct notification_client *client, const struct lttng_notification_channel_message msg_header = { .type = LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_HANDSHAKE, .size = sizeof(handshake_reply), + .fds = 0, }; enum lttng_notification_channel_status status = LTTNG_NOTIFICATION_CHANNEL_STATUS_OK; @@ -4274,6 +4283,8 @@ int client_notification_overflow(struct notification_client *client) int ret = 0; const struct lttng_notification_channel_message msg = { .type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION_DROPPED, + .size = 0, + .fds = 0, }; ASSERT_LOCKED(client->lock); @@ -4378,6 +4389,8 @@ int notification_client_list_send_evaluation( }; struct lttng_notification_channel_message msg_header = { .type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION, + .size = 0, + .fds = 0, }; const struct lttng_credentials *trigger_creds = lttng_trigger_get_credentials(trigger); diff --git a/src/bin/lttng-sessiond/sessiond-config.cpp b/src/bin/lttng-sessiond/sessiond-config.cpp index c512b1ab1..228d9c16b 100644 --- a/src/bin/lttng-sessiond/sessiond-config.cpp +++ b/src/bin/lttng-sessiond/sessiond-config.cpp @@ -35,37 +35,38 @@ struct sessiond_config sessiond_config_build_defaults = { .daemonize = false, .sig_parent = false, - .tracing_group_name = { (char *) DEFAULT_TRACING_GROUP }, - .kmod_probes_list = { nullptr }, - .kmod_extra_probes_list = { nullptr }, - - .rundir = { nullptr }, - - .apps_unix_sock_path = { nullptr }, - .client_unix_sock_path = { nullptr }, - .wait_shm_path = { nullptr }, - .health_unix_sock_path = { nullptr }, - .lttng_ust_clock_plugin = { nullptr }, - .pid_file_path = { nullptr }, - .lock_file_path = { nullptr }, - .load_session_path = { nullptr }, - .agent_port_file_path = { nullptr }, - - .consumerd32_path = { nullptr }, - .consumerd32_bin_path = { nullptr }, - .consumerd32_lib_dir = { nullptr }, - .consumerd32_err_unix_sock_path = { nullptr }, - .consumerd32_cmd_unix_sock_path = { nullptr }, - - .consumerd64_path = { nullptr }, - .consumerd64_bin_path = { nullptr }, - .consumerd64_lib_dir = { nullptr }, - .consumerd64_err_unix_sock_path = { nullptr }, - .consumerd64_cmd_unix_sock_path = { nullptr }, - - .kconsumerd_path = { nullptr }, - .kconsumerd_err_unix_sock_path = { nullptr }, - .kconsumerd_cmd_unix_sock_path = { nullptr }, + .tracing_group_name = { (char *) DEFAULT_TRACING_GROUP, false }, + + .kmod_probes_list = { nullptr, false }, + .kmod_extra_probes_list = { nullptr, false }, + + .rundir = { nullptr, false }, + + .apps_unix_sock_path = { nullptr, false }, + .client_unix_sock_path = { nullptr, false }, + .wait_shm_path = { nullptr, false }, + .health_unix_sock_path = { nullptr, false }, + .lttng_ust_clock_plugin = { nullptr, false }, + .pid_file_path = { nullptr, false }, + .lock_file_path = { nullptr, false }, + .load_session_path = { nullptr, false }, + .agent_port_file_path = { nullptr, false }, + + .consumerd32_path = { nullptr, false }, + .consumerd32_bin_path = { nullptr, false }, + .consumerd32_lib_dir = { nullptr, false }, + .consumerd32_err_unix_sock_path = { nullptr, false }, + .consumerd32_cmd_unix_sock_path = { nullptr, false }, + + .consumerd64_path = { nullptr, false }, + .consumerd64_bin_path = { nullptr, false }, + .consumerd64_lib_dir = { nullptr, false }, + .consumerd64_err_unix_sock_path = { nullptr, false }, + .consumerd64_cmd_unix_sock_path = { nullptr, false }, + + .kconsumerd_path = { nullptr, false }, + .kconsumerd_err_unix_sock_path = { nullptr, false }, + .kconsumerd_cmd_unix_sock_path = { nullptr, false }, }; static diff --git a/src/bin/lttng/commands/add_trigger.cpp b/src/bin/lttng/commands/add_trigger.cpp index 85a752564..82b2c0162 100644 --- a/src/bin/lttng/commands/add_trigger.cpp +++ b/src/bin/lttng/commands/add_trigger.cpp @@ -659,7 +659,7 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv, int consumed_args = -1; struct lttng_kernel_probe_location *kernel_probe_location = NULL; struct lttng_userspace_probe_location *userspace_probe_location = NULL; - struct parse_event_rule_res res = { 0 }; + struct parse_event_rule_res res = {}; struct lttng_event_expr *event_expr = NULL; struct filter_parser_ctx *parser_ctx = NULL; struct lttng_log_level_rule *log_level_rule = NULL; diff --git a/src/bin/lttng/commands/metadata.cpp b/src/bin/lttng/commands/metadata.cpp index b68c22a07..8f4d8df63 100644 --- a/src/bin/lttng/commands/metadata.cpp +++ b/src/bin/lttng/commands/metadata.cpp @@ -41,7 +41,7 @@ static struct poptOption long_options[] = { { "help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0, }, { "session", 's', POPT_ARG_STRING, &opt_session_name, 0, 0, 0}, { "list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, 0, 0, }, - { "list-commands", 0, POPT_ARG_NONE, NULL, OPT_LIST_COMMANDS}, + { "list-commands", 0, POPT_ARG_NONE, NULL, OPT_LIST_COMMANDS, NULL, NULL}, { 0, 0, 0, 0, 0, 0, 0, }, }; diff --git a/src/bin/lttng/commands/regenerate.cpp b/src/bin/lttng/commands/regenerate.cpp index 4ceb55424..d25e883d5 100644 --- a/src/bin/lttng/commands/regenerate.cpp +++ b/src/bin/lttng/commands/regenerate.cpp @@ -42,7 +42,7 @@ static struct poptOption long_options[] = { { "help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0, }, { "session", 's', POPT_ARG_STRING, &opt_session_name, 0, 0, 0}, { "list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, 0, 0, }, - { "list-commands", 0, POPT_ARG_NONE, NULL, OPT_LIST_COMMANDS}, + { "list-commands", 0, POPT_ARG_NONE, NULL, OPT_LIST_COMMANDS, NULL, NULL}, { 0, 0, 0, 0, 0, 0, 0, }, }; diff --git a/src/bin/lttng/commands/snapshot.cpp b/src/bin/lttng/commands/snapshot.cpp index 4ae9ba1e9..a5cbbfe75 100644 --- a/src/bin/lttng/commands/snapshot.cpp +++ b/src/bin/lttng/commands/snapshot.cpp @@ -60,7 +60,7 @@ static struct poptOption snapshot_opts[] = { {"name", 'n', POPT_ARG_STRING, &opt_output_name, 0, 0, 0}, {"max-size", 'm', POPT_ARG_STRING, 0, OPT_MAX_SIZE, 0, 0}, {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, - {"list-commands", 0, POPT_ARG_NONE, NULL, OPT_LIST_COMMANDS}, + {"list-commands", 0, POPT_ARG_NONE, NULL, OPT_LIST_COMMANDS, NULL, NULL}, {0, 0, 0, 0, 0, 0, 0} }; diff --git a/src/common/channel.cpp b/src/common/channel.cpp index db8d6fdec..c0a0299a4 100644 --- a/src/common/channel.cpp +++ b/src/common/channel.cpp @@ -198,7 +198,7 @@ int lttng_channel_serialize( { int ret; size_t name_len; - struct lttng_channel_comm channel_comm = { 0 }; + struct lttng_channel_comm channel_comm = {}; struct lttng_channel_extended *extended; assert(channel); diff --git a/src/common/conditions/session-rotation.cpp b/src/common/conditions/session-rotation.cpp index 7e59895f9..390123a4e 100644 --- a/src/common/conditions/session-rotation.cpp +++ b/src/common/conditions/session-rotation.cpp @@ -520,7 +520,7 @@ int lttng_evaluation_session_rotation_serialize( { int ret; struct lttng_evaluation_session_rotation *rotation; - struct lttng_evaluation_session_rotation_comm comm = { 0 }; + struct lttng_evaluation_session_rotation_comm comm = {}; rotation = container_of(evaluation, struct lttng_evaluation_session_rotation, parent); diff --git a/src/common/config/session-config.cpp b/src/common/config/session-config.cpp index ef254d7cc..143f8365e 100644 --- a/src/common/config/session-config.cpp +++ b/src/common/config/session-config.cpp @@ -1203,7 +1203,7 @@ int create_snapshot_session(const char *session_name, xmlNodePtr output_node, xmlNextElementSibling(snapshot_output_node)) { char *name = NULL; uint64_t max_size = UINT64_MAX; - struct consumer_output output = { 0 }; + struct consumer_output output = {}; struct lttng_snapshot_output *snapshot_output = NULL; const char *control_uri = NULL; const char *data_uri = NULL; @@ -1329,7 +1329,7 @@ int create_session(const char *name, const struct config_load_session_override_attr *overrides) { int ret; - struct consumer_output output = { 0 }; + struct consumer_output output = {}; xmlNodePtr consumer_output_node; const char *control_uri = NULL; const char *data_uri = NULL; @@ -3859,7 +3859,7 @@ int config_load_session(const char *path, const char *session_name, int ret; bool session_loaded = false; const char *path_ptr = NULL; - struct session_config_validation_ctx validation_ctx = { 0 }; + struct session_config_validation_ctx validation_ctx = {}; ret = init_session_config_validation_ctx(&validation_ctx); if (ret) { diff --git a/src/common/consumer/consumer-timer.cpp b/src/common/consumer/consumer-timer.cpp index f6cb60c3b..51fa1687e 100644 --- a/src/common/consumer/consumer-timer.cpp +++ b/src/common/consumer/consumer-timer.cpp @@ -648,6 +648,9 @@ void monitor_timer(struct lttng_consumer_channel *channel) consumer_timer_thread_get_channel_monitor_pipe(); struct lttcomm_consumer_channel_monitor_msg msg = { .key = channel->key, + .lowest = 0, + .highest = 0, + .total_consumed = 0, }; sample_positions_cb sample; get_consumed_cb get_consumed; diff --git a/src/common/event.cpp b/src/common/event.cpp index dda5eb7ba..ad3e23d4d 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -77,7 +77,7 @@ static int lttng_event_probe_attr_serialize( { int ret; size_t symbol_name_len; - struct lttng_event_probe_attr_comm comm = { 0 }; + struct lttng_event_probe_attr_comm comm = {}; symbol_name_len = lttng_strnlen(probe->symbol_name, LTTNG_SYMBOL_NAME_LEN); if (symbol_name_len == LTTNG_SYMBOL_NAME_LEN) { @@ -700,7 +700,7 @@ int lttng_event_serialize(const struct lttng_event *event, unsigned int i; size_t header_offset, size_before_payload; size_t name_len; - struct lttng_event_comm event_comm = { 0 }; + struct lttng_event_comm event_comm = {}; struct lttng_event_comm *header; assert(event); @@ -1128,7 +1128,7 @@ static int lttng_event_context_app_serialize( struct lttng_payload *payload) { int ret; - struct lttng_event_context_app_comm comm = { 0 }; + struct lttng_event_context_app_comm comm = {}; size_t provider_len, ctx_len; const char *provider_name; const char *ctx_name; @@ -1196,7 +1196,7 @@ static int lttng_event_context_perf_counter_serialize( struct lttng_payload *payload) { int ret; - struct lttng_event_context_perf_counter_comm comm = { 0 }; + struct lttng_event_context_perf_counter_comm comm = {}; assert(payload); assert(context); @@ -1417,7 +1417,7 @@ int lttng_event_field_serialize(const struct lttng_event_field *field, int ret; size_t header_offset, size_before_event; size_t name_len; - struct lttng_event_field_comm event_field_comm = { 0 }; + struct lttng_event_field_comm event_field_comm = {}; struct lttng_event_field_comm *header; assert(field); diff --git a/src/common/fd-tracker/fd-tracker.cpp b/src/common/fd-tracker/fd-tracker.cpp index e511d6901..18071dbd4 100644 --- a/src/common/fd-tracker/fd-tracker.cpp +++ b/src/common/fd-tracker/fd-tracker.cpp @@ -130,6 +130,8 @@ static struct { unsigned long value; } seed = { .lock = PTHREAD_MUTEX_INITIALIZER, + .initialized = false, + .value = 0, }; static int match_fd(struct cds_lfht_node *node, const void *key); diff --git a/src/common/fd-tracker/inode.cpp b/src/common/fd-tracker/inode.cpp index 404ba360b..74f706248 100644 --- a/src/common/fd-tracker/inode.cpp +++ b/src/common/fd-tracker/inode.cpp @@ -66,6 +66,8 @@ static struct { unsigned long value; } seed = { .lock = PTHREAD_MUTEX_INITIALIZER, + .initialized = false, + .value = 0, }; static unsigned long lttng_inode_id_hash(const struct inode_id *id) diff --git a/src/common/optional.h b/src/common/optional.h index 52139d50d..f34c5991f 100644 --- a/src/common/optional.h +++ b/src/common/optional.h @@ -83,7 +83,7 @@ * The wrapped field is set to the value it would gave if it had static storage * duration. */ -#define LTTNG_OPTIONAL_INIT_UNSET { .is_set = 0 } +#define LTTNG_OPTIONAL_INIT_UNSET {} /* * Initialize an optional field as 'set' with a given value. diff --git a/src/common/payload-view.cpp b/src/common/payload-view.cpp index 3ea043c8a..f446acacf 100644 --- a/src/common/payload-view.cpp +++ b/src/common/payload-view.cpp @@ -24,9 +24,11 @@ struct lttng_payload_view lttng_payload_view_from_payload( .buffer = lttng_buffer_view_from_dynamic_buffer( &payload->buffer, offset, len), ._fd_handles = payload->_fd_handles, + ._iterator = {}, } : (struct lttng_payload_view) { .buffer = {}, - ._fd_handles = {} + ._fd_handles = {}, + ._iterator = {}, }; } @@ -41,10 +43,12 @@ struct lttng_payload_view lttng_payload_view_from_view( ._iterator = { .p_fd_handles_position = view->_iterator.p_fd_handles_position ?: &view->_iterator.fd_handles_position, + .fd_handles_position = 0, } } : (struct lttng_payload_view) { .buffer = {}, - ._fd_handles = {} + ._fd_handles = {}, + ._iterator = {}, }; } @@ -55,10 +59,12 @@ struct lttng_payload_view lttng_payload_view_from_dynamic_buffer( return buffer ? (struct lttng_payload_view) { .buffer = lttng_buffer_view_from_dynamic_buffer( buffer, offset, len), - ._fd_handles = {} + ._fd_handles = {}, + ._iterator = {}, } : (struct lttng_payload_view) { .buffer = {}, - ._fd_handles = {} + ._fd_handles = {}, + ._iterator = {}, }; } @@ -69,10 +75,12 @@ struct lttng_payload_view lttng_payload_view_from_buffer_view( return view ? (struct lttng_payload_view) { .buffer = lttng_buffer_view_from_view( view, offset, len), - ._fd_handles = {} + ._fd_handles = {}, + ._iterator = {}, } : (struct lttng_payload_view) { .buffer = {}, - ._fd_handles = {} + ._fd_handles = {}, + ._iterator = {}, }; } @@ -82,7 +90,8 @@ struct lttng_payload_view lttng_payload_view_init_from_buffer( return (struct lttng_payload_view) { .buffer = lttng_buffer_view_init( src, offset, len), - ._fd_handles = {} + ._fd_handles = {}, + ._iterator = {}, }; } diff --git a/src/common/session-descriptor.cpp b/src/common/session-descriptor.cpp index 36b6fc4eb..e8a602121 100644 --- a/src/common/session-descriptor.cpp +++ b/src/common/session-descriptor.cpp @@ -816,7 +816,10 @@ int lttng_session_descriptor_serialize( .output_type = (uint8_t) descriptor->output_type, .name_len = (uint32_t) (descriptor->name ? strlen(descriptor->name) + 1 : 0), - } + .uri_count = 0, + }, + .live_timer_us = 0, + }; const void *header_ptr = NULL; size_t header_size; diff --git a/src/common/sessiond-comm/sessiond-comm.cpp b/src/common/sessiond-comm/sessiond-comm.cpp index 24db51637..9be0cbcac 100644 --- a/src/common/sessiond-comm/sessiond-comm.cpp +++ b/src/common/sessiond-comm/sessiond-comm.cpp @@ -524,7 +524,7 @@ int lttcomm_populate_sock_from_open_socket( { int ret = 0; socklen_t storage_len; - struct sockaddr_storage storage = { 0 }; + struct sockaddr_storage storage = {}; assert(sock); assert(fd >= 0); diff --git a/src/common/trace-chunk.cpp b/src/common/trace-chunk.cpp index 3ae804781..92cbd3c34 100644 --- a/src/common/trace-chunk.cpp +++ b/src/common/trace-chunk.cpp @@ -1007,6 +1007,7 @@ enum lttng_trace_chunk_status lttng_trace_chunk_set_credentials_current_user( enum lttng_trace_chunk_status status = LTTNG_TRACE_CHUNK_STATUS_OK; const struct chunk_credentials credentials = { .use_current_user = true, + .user = {}, }; pthread_mutex_lock(&chunk->lock); diff --git a/src/common/tracker.cpp b/src/common/tracker.cpp index c5efaa319..0cd0e9027 100644 --- a/src/common/tracker.cpp +++ b/src/common/tracker.cpp @@ -247,6 +247,7 @@ int process_attr_tracker_value_serialize(const struct process_attr_value *value, int ret; struct process_attr_tracker_value_comm value_comm = { .type = (int32_t) value->type, + .value = {}, }; const char *name = NULL; diff --git a/src/common/uri.cpp b/src/common/uri.cpp index 98ff2b471..393eba815 100644 --- a/src/common/uri.cpp +++ b/src/common/uri.cpp @@ -43,7 +43,7 @@ static const struct uri_proto proto_uri[] = { { .name = "tcp4", .leading_string = "tcp4://", .code = P_TCP, .type = LTTNG_TCP, .dtype = LTTNG_DST_IPV4 }, { .name = "tcp6", .leading_string = "tcp6://", .code = P_TCP6, .type = LTTNG_TCP, .dtype = LTTNG_DST_IPV6 }, /* Invalid proto marking the end of the array. */ - { 0 } + {} }; /* diff --git a/src/lib/lttng-ctl/channel.cpp b/src/lib/lttng-ctl/channel.cpp index e7b044ac0..f464e7000 100644 --- a/src/lib/lttng-ctl/channel.cpp +++ b/src/lib/lttng-ctl/channel.cpp @@ -575,6 +575,7 @@ int handshake(struct lttng_notification_channel *channel) struct lttng_notification_channel_message msg_header = { .type = LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_HANDSHAKE, .size = sizeof(handshake), + .fds = 0, }; char send_buffer[sizeof(msg_header) + sizeof(handshake)]; @@ -623,6 +624,8 @@ enum lttng_notification_channel_status send_condition_command( struct lttng_payload payload; struct lttng_notification_channel_message cmd_header = { .type = (int8_t) type, + .size =0, + .fds = 0, }; lttng_payload_init(&payload); diff --git a/src/lib/lttng-ctl/clear.cpp b/src/lib/lttng-ctl/clear.cpp index 0eaf97364..fb2b1cae9 100644 --- a/src/lib/lttng-ctl/clear.cpp +++ b/src/lib/lttng-ctl/clear.cpp @@ -283,6 +283,10 @@ enum lttng_error_code lttng_clear_session(const char *session_name, struct lttng_clear_handle *handle = NULL; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_CLEAR_SESSION, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; int sessiond_socket = -1; ssize_t comm_ret; diff --git a/src/lib/lttng-ctl/destruction-handle.cpp b/src/lib/lttng-ctl/destruction-handle.cpp index 35a1c3582..0bfa303d8 100644 --- a/src/lib/lttng-ctl/destruction-handle.cpp +++ b/src/lib/lttng-ctl/destruction-handle.cpp @@ -391,6 +391,10 @@ enum lttng_error_code lttng_destroy_session_ext(const char *session_name, enum lttng_error_code ret_code = LTTNG_OK; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_DESTROY_SESSION, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; int sessiond_socket = -1; struct lttng_destruction_handle *handle = NULL; diff --git a/src/lib/lttng-ctl/lttng-ctl.cpp b/src/lib/lttng-ctl/lttng-ctl.cpp index 0da8f6ad1..68f8c1f7e 100644 --- a/src/lib/lttng-ctl/lttng-ctl.cpp +++ b/src/lib/lttng-ctl/lttng-ctl.cpp @@ -916,7 +916,13 @@ int lttng_add_context(struct lttng_handle *handle, const char *channel_name) { int ret; - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_ADD_CONTEXT }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_ADD_CONTEXT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_payload payload; lttng_payload_init(&payload); @@ -1084,7 +1090,13 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle, const char *original_filter_expression, int exclusion_count, char **exclusion_list) { - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_ENABLE_EVENT }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_ENABLE_EVENT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_payload payload; int ret = 0; unsigned int free_filter_expression = 0; @@ -1263,7 +1275,13 @@ int lttng_disable_event_ext(struct lttng_handle *handle, struct lttng_event *ev, const char *channel_name, const char *original_filter_expression) { - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_DISABLE_EVENT }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_DISABLE_EVENT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_payload payload; int ret = 0; unsigned int free_filter_expression = 0; @@ -1650,7 +1668,13 @@ int lttng_list_tracepoints(struct lttng_handle *handle, enum lttng_error_code ret_code; int ret, total_payload_received; char *reception_buffer = NULL; - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_LIST_TRACEPOINTS }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_LIST_TRACEPOINTS, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttcomm_list_command_header *cmd_header = NULL; size_t cmd_header_len; unsigned int nb_events = 0; @@ -1875,6 +1899,10 @@ enum lttng_error_code lttng_create_session_ext( enum lttng_error_code ret_code; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_CREATE_SESSION_EXT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; void *reply = NULL; struct lttng_buffer_view reply_view; @@ -2983,6 +3011,10 @@ int _lttng_register_trigger(struct lttng_trigger *trigger, const char *name, int ret; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_REGISTER_TRIGGER, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; lsm.u.trigger.is_trigger_anonymous = !name && !generate_name; struct lttcomm_session_msg *message_lsm; @@ -3155,6 +3187,10 @@ enum lttng_error_code lttng_error_query_execute( enum lttng_error_code ret_code; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_EXECUTE_ERROR_QUERY, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; struct lttng_payload message; struct lttng_payload reply; @@ -3339,7 +3375,13 @@ enum lttng_error_code lttng_list_triggers(struct lttng_triggers **triggers) { int ret; enum lttng_error_code ret_code = LTTNG_OK; - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_LIST_TRIGGERS }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_LIST_TRIGGERS, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_triggers *local_triggers = NULL; struct lttng_payload reply; struct lttng_payload_view lsm_view = diff --git a/src/lib/lttng-ctl/tracker.cpp b/src/lib/lttng-ctl/tracker.cpp index 40af23cd1..b7fc1f78a 100644 --- a/src/lib/lttng-ctl/tracker.cpp +++ b/src/lib/lttng-ctl/tracker.cpp @@ -102,7 +102,11 @@ lttng_process_attr_tracker_handle_get_tracking_policy( enum lttng_process_attr_tracker_handle_status status = LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK; struct lttcomm_session_msg lsm = { - .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_GET_POLICY, + .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_GET_POLICY, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; if (!tracker || !policy) { @@ -149,7 +153,11 @@ lttng_process_attr_tracker_handle_set_tracking_policy( enum lttng_process_attr_tracker_handle_status status = LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK; struct lttcomm_session_msg lsm = { - .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_SET_POLICY, + .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_SET_POLICY, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; if (!tracker) { @@ -197,7 +205,12 @@ end: enum lttng_process_attr_tracker_handle_status status = \ LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK; \ struct lttcomm_session_msg lsm = { \ - .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_##command_upper##_INCLUDE_VALUE}; \ + .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_##command_upper##_INCLUDE_VALUE, \ + .session = {}, \ + .domain = {}, \ + .u = {}, \ + .fd_count = 0, \ + }; \ \ if (!tracker) { \ status = LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_INVALID; \ @@ -260,7 +273,12 @@ end: enum lttng_process_attr_tracker_handle_status status = \ LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK; \ struct lttcomm_session_msg lsm = { \ - .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_##command_upper##_INCLUDE_VALUE}; \ + .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_##command_upper##_INCLUDE_VALUE, \ + .session = {}, \ + .domain = {}, \ + .u = {}, \ + .fd_count = 0, \ + }; \ const size_t len = value ? strlen(value) + 1 : 0; \ \ if (!tracker || !value) { \ @@ -374,7 +392,11 @@ lttng_process_attr_tracker_handle_get_inclusion_set( enum lttng_process_attr_tracker_handle_status status = LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK; struct lttcomm_session_msg lsm = { - .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_GET_INCLUSION_SET, + .cmd_type = LTTNG_PROCESS_ATTR_TRACKER_GET_INCLUSION_SET, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; struct lttng_buffer_view inclusion_set_view; ssize_t inclusion_set_ret; diff --git a/tests/regression/kernel/select_poll_epoll.cpp b/tests/regression/kernel/select_poll_epoll.cpp index fb72f6e5a..d3a21e2fc 100644 --- a/tests/regression/kernel/select_poll_epoll.cpp +++ b/tests/regression/kernel/select_poll_epoll.cpp @@ -66,15 +66,15 @@ static const struct test_case { { { .run = run_working_cases, .produces_validation_info = true, .timeout = -1 }, { .run = run_working_cases, .produces_validation_info = true, .timeout = 1 }, - { .run = pselect_invalid_fd, .produces_validation_info = false }, - { .run = test_ppoll_big, .produces_validation_info = false }, - { .run = ppoll_fds_buffer_overflow, .produces_validation_info = false }, - { .run = pselect_invalid_pointer, .produces_validation_info = false }, - { .run = ppoll_fds_ulong_max, .produces_validation_info = false }, - { .run = epoll_pwait_invalid_pointer, .produces_validation_info = true }, - { .run = epoll_pwait_int_max, .produces_validation_info = true }, - { .run = ppoll_concurrent_write, .produces_validation_info = false }, - { .run = epoll_pwait_concurrent_munmap, .produces_validation_info = true }, + { .run = pselect_invalid_fd, .produces_validation_info = false, .timeout = 0 }, + { .run = test_ppoll_big, .produces_validation_info = false, .timeout = 0 }, + { .run = ppoll_fds_buffer_overflow, .produces_validation_info = false, .timeout = 0 }, + { .run = pselect_invalid_pointer, .produces_validation_info = false, .timeout = 0 }, + { .run = ppoll_fds_ulong_max, .produces_validation_info = false, .timeout = 0 }, + { .run = epoll_pwait_invalid_pointer, .produces_validation_info = true, .timeout = 0 }, + { .run = epoll_pwait_int_max, .produces_validation_info = true, .timeout = 0 }, + { .run = ppoll_concurrent_write, .produces_validation_info = false, .timeout = 0 }, + { .run = epoll_pwait_concurrent_munmap, .produces_validation_info = true, .timeout = 0 }, }; struct ppoll_thread_data { @@ -935,7 +935,7 @@ int main(int argc, const char **argv) { "validation-file", 'o', POPT_ARG_STRING, &test_validation_output_file_path, 0, "Test case output", NULL }, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, 0, 0, NULL, 0, NULL, NULL } }; const struct test_case *test_case; diff --git a/tests/regression/tools/trigger/hidden/hidden_trigger.cpp b/tests/regression/tools/trigger/hidden/hidden_trigger.cpp index 668a60fb3..62c8f5dd0 100644 --- a/tests/regression/tools/trigger/hidden/hidden_trigger.cpp +++ b/tests/regression/tools/trigger/hidden/hidden_trigger.cpp @@ -66,7 +66,10 @@ int setup_session_with_size_rotation_schedule(const char *session_output_path) { .type = LTTNG_DOMAIN_UST, .buf_type = LTTNG_BUFFER_PER_UID, - } + .padding = {}, + .attr = {}, + }, + {} }; lttng_channel channel_cfg {}; diff --git a/tests/regression/ust/multi-lib/multi-lib-test.c b/tests/regression/ust/multi-lib/multi-lib-test.c index 6bec733ff..eb1416248 100644 --- a/tests/regression/ust/multi-lib/multi-lib-test.c +++ b/tests/regression/ust/multi-lib/multi-lib-test.c @@ -178,7 +178,7 @@ int main(int argc, const char **argv) { "test", 't', POPT_ARG_INT, &test, 0, "Test to run", NULL }, { "list", 'l', 0, 0, 'l', "List of tests (-t X)", NULL }, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, 0, 0, NULL, 0, NULL, NULL } }; optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); diff --git a/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp b/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp index 78b962d19..6afd855da 100644 --- a/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp +++ b/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp @@ -72,7 +72,7 @@ static struct poptOption opts[] = { { "after", 'a', POPT_ARG_STRING, &after_unshare_wait_file_path, 0, "Wait for file after unshare", NULL }, { "signal", 's', POPT_ARG_STRING, &after_unshare_signal_file_path, 0, "Create signal file after unshare", NULL }, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, 0, 0, NULL, 0, NULL, NULL } }; static ATTR_FORMAT_PRINTF(1, 2) diff --git a/tests/utils/testapp/gen-ust-events-ns/Makefile.am b/tests/utils/testapp/gen-ust-events-ns/Makefile.am index 37bdc94fe..22242fb92 100644 --- a/tests/utils/testapp/gen-ust-events-ns/Makefile.am +++ b/tests/utils/testapp/gen-ust-events-ns/Makefile.am @@ -6,7 +6,8 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir) \ if HAVE_LIBLTTNG_UST_CTL # Disable some warnings flags to accomodate the tracepoint headers WARN_FLAGS = \ - -Wno-redundant-decls + -Wno-redundant-decls \ + -Wno-missing-field-initializers AM_CFLAGS += $(WARN_FLAGS) AM_CXXFLAGS += $(WARN_FLAGS) diff --git a/tests/utils/testapp/gen-ust-events/Makefile.am b/tests/utils/testapp/gen-ust-events/Makefile.am index 1e89ddd67..27896e136 100644 --- a/tests/utils/testapp/gen-ust-events/Makefile.am +++ b/tests/utils/testapp/gen-ust-events/Makefile.am @@ -6,7 +6,8 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir) \ if HAVE_LIBLTTNG_UST_CTL # Disable some warnings flags to accomodate the tracepoint headers WARN_FLAGS = \ - -Wno-redundant-decls + -Wno-redundant-decls \ + -Wno-missing-field-initializers AM_CFLAGS += $(WARN_FLAGS) AM_CXXFLAGS += $(WARN_FLAGS) diff --git a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am index 75c50bb1e..e3a6e5cd0 100644 --- a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am @@ -5,7 +5,8 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils \ if HAVE_LIBLTTNG_UST_CTL WARN_FLAGS = \ - -Wno-redundant-decls + -Wno-redundant-decls \ + -Wno-missing-field-initializers AM_CFLAGS += $(WARN_FLAGS) AM_CXXFLAGS += $(WARN_FLAGS) diff --git a/tests/utils/testapp/gen-ust-nevents/Makefile.am b/tests/utils/testapp/gen-ust-nevents/Makefile.am index c2d36d7c9..746ffc688 100644 --- a/tests/utils/testapp/gen-ust-nevents/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents/Makefile.am @@ -5,7 +5,8 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils \ if HAVE_LIBLTTNG_UST_CTL WARN_FLAGS = \ - -Wno-redundant-decls + -Wno-redundant-decls \ + -Wno-missing-field-initializers AM_CFLAGS += $(WARN_FLAGS) AM_CXXFLAGS += $(WARN_FLAGS) diff --git a/tests/utils/testapp/gen-ust-tracef/Makefile.am b/tests/utils/testapp/gen-ust-tracef/Makefile.am index 17678c697..855ee15ca 100644 --- a/tests/utils/testapp/gen-ust-tracef/Makefile.am +++ b/tests/utils/testapp/gen-ust-tracef/Makefile.am @@ -4,6 +4,9 @@ AM_CPPFLAGS += -I$(srcdir) \ -I$(top_srcdir)/tests/utils/testapp if HAVE_LIBLTTNG_UST_CTL +AM_CXXFLAGS += \ + -Wno-missing-field-initializers + noinst_PROGRAMS = gen-ust-tracef gen_ust_tracef_SOURCES = gen-ust-tracef.cpp gen_ust_tracef_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/utils/xml-utils/validate_xml.cpp b/tests/utils/xml-utils/validate_xml.cpp index 8e30100c0..92f08f203 100644 --- a/tests/utils/xml-utils/validate_xml.cpp +++ b/tests/utils/xml-utils/validate_xml.cpp @@ -154,7 +154,7 @@ end: int main(int argc, char **argv) { int ret; - struct validation_ctx ctx = { 0 }; + struct validation_ctx ctx = {}; /* Check if we have all argument */ if (argc < 3) {