From: Jérémie Galarneau Date: Fri, 22 Mar 2024 16:24:57 +0000 (-0400) Subject: Clean-up: apply suggested clang-tidy fixes X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0f4aa1a88a318046475c7caa0f72438db044d9c0;p=lttng-tools.git Clean-up: apply suggested clang-tidy fixes Signed-off-by: Jérémie Galarneau Change-Id: I926b96120d8c77b3c0d8efc3fcdf1d11d2314e8a --- diff --git a/src/bin/lttng-relayd/live.hpp b/src/bin/lttng-relayd/live.hpp index 67fb58a14..53f67d30e 100644 --- a/src/bin/lttng-relayd/live.hpp +++ b/src/bin/lttng-relayd/live.hpp @@ -15,7 +15,7 @@ #include int relayd_live_create(struct lttng_uri *live_uri); -int relayd_live_stop(void); -int relayd_live_join(void); +int relayd_live_stop(); +int relayd_live_join(); #endif /* LTTNG_RELAYD_LIVE_H */ diff --git a/src/bin/lttng-relayd/lttng-relayd.hpp b/src/bin/lttng-relayd/lttng-relayd.hpp index ac7d0c691..bf86575f5 100644 --- a/src/bin/lttng-relayd/lttng-relayd.hpp +++ b/src/bin/lttng-relayd/lttng-relayd.hpp @@ -52,12 +52,12 @@ extern enum relay_group_output_by opt_group_output_by; extern struct fd_tracker *the_fd_tracker; -void lttng_relay_notify_ready(void); -int lttng_relay_stop_threads(void); +void lttng_relay_notify_ready(); +int lttng_relay_stop_threads(); -int relayd_init_thread_quit_pipe(void); -int relayd_notify_thread_quit_pipe(void); -void relayd_close_thread_quit_pipe(void); +int relayd_init_thread_quit_pipe(); +int relayd_notify_thread_quit_pipe(); +void relayd_close_thread_quit_pipe(); bool relayd_is_thread_quit_pipe(const int fd); int create_named_thread_poll_set(struct lttng_poll_event *events, int size, const char *name); diff --git a/src/bin/lttng-relayd/session.hpp b/src/bin/lttng-relayd/session.hpp index b50c68526..2a6c130dd 100644 --- a/src/bin/lttng-relayd/session.hpp +++ b/src/bin/lttng-relayd/session.hpp @@ -160,6 +160,6 @@ int session_abort(struct relay_session *session); bool session_has_ongoing_rotation(const struct relay_session *session); -void print_sessions(void); +void print_sessions(); #endif /* _SESSION_H */ diff --git a/src/bin/lttng-relayd/sessiond-trace-chunks.hpp b/src/bin/lttng-relayd/sessiond-trace-chunks.hpp index c290f9d0f..5b9f00a7e 100644 --- a/src/bin/lttng-relayd/sessiond-trace-chunks.hpp +++ b/src/bin/lttng-relayd/sessiond-trace-chunks.hpp @@ -26,7 +26,7 @@ */ struct sessiond_trace_chunk_registry; -struct sessiond_trace_chunk_registry *sessiond_trace_chunk_registry_create(void); +struct sessiond_trace_chunk_registry *sessiond_trace_chunk_registry_create(); void sessiond_trace_chunk_registry_destroy(struct sessiond_trace_chunk_registry *sessiond_registry); diff --git a/src/bin/lttng-relayd/stream.hpp b/src/bin/lttng-relayd/stream.hpp index a616e425a..40d840398 100644 --- a/src/bin/lttng-relayd/stream.hpp +++ b/src/bin/lttng-relayd/stream.hpp @@ -216,6 +216,6 @@ int stream_complete_packet(struct relay_stream *stream, int stream_add_index(struct relay_stream *stream, const struct lttcomm_relayd_index *index_info); int stream_reset_file(struct relay_stream *stream); -void print_relay_streams(void); +void print_relay_streams(); #endif /* _STREAM_H */ diff --git a/src/bin/lttng-relayd/viewer-session.hpp b/src/bin/lttng-relayd/viewer-session.hpp index 301b8ffc7..3dfa3acea 100644 --- a/src/bin/lttng-relayd/viewer-session.hpp +++ b/src/bin/lttng-relayd/viewer-session.hpp @@ -61,7 +61,7 @@ struct relay_viewer_session { struct lttng_trace_chunk *current_trace_chunk; }; -struct relay_viewer_session *viewer_session_create(void); +struct relay_viewer_session *viewer_session_create(); void viewer_session_destroy(struct relay_viewer_session *vsession); void viewer_session_close(struct relay_viewer_session *vsession); diff --git a/src/bin/lttng-relayd/viewer-stream.hpp b/src/bin/lttng-relayd/viewer-stream.hpp index 2886420f4..ea6292b2c 100644 --- a/src/bin/lttng-relayd/viewer-stream.hpp +++ b/src/bin/lttng-relayd/viewer-stream.hpp @@ -86,7 +86,7 @@ bool viewer_stream_get(struct relay_viewer_stream *vstream); void viewer_stream_put(struct relay_viewer_stream *vstream); int viewer_stream_rotate(struct relay_viewer_stream *vstream); bool viewer_stream_is_tracefile_seq_readable(struct relay_viewer_stream *vstream, uint64_t seq); -void print_viewer_streams(void); +void print_viewer_streams(); void viewer_stream_close_files(struct relay_viewer_stream *vstream); void viewer_stream_sync_tracefile_array_tail(struct relay_viewer_stream *vstream); diff --git a/src/bin/lttng-sessiond/agent-thread.hpp b/src/bin/lttng-sessiond/agent-thread.hpp index 86d0a9b88..0d56588ea 100644 --- a/src/bin/lttng-sessiond/agent-thread.hpp +++ b/src/bin/lttng-sessiond/agent-thread.hpp @@ -12,8 +12,8 @@ #ifdef HAVE_LIBLTTNG_UST_CTL -bool launch_agent_management_thread(void); -bool agent_tracing_is_enabled(void); +bool launch_agent_management_thread(); +bool agent_tracing_is_enabled(); #else /* HAVE_LIBLTTNG_UST_CTL */ diff --git a/src/bin/lttng-sessiond/agent.hpp b/src/bin/lttng-sessiond/agent.hpp index 388543f66..258517b5d 100644 --- a/src/bin/lttng-sessiond/agent.hpp +++ b/src/bin/lttng-sessiond/agent.hpp @@ -104,7 +104,7 @@ struct agent_event { struct lttng_event_exclusion *exclusion; }; -#define AGENT_EVENT_IS_ENABLED(agent_event) (!!agent_event->enabled_count) +#define AGENT_EVENT_IS_ENABLED(agent_event) (!!(agent_event)->enabled_count) /* * Agent object containing events enabled/disabled for a given domain in a @@ -134,9 +134,9 @@ struct agent { }; /* Allocate agent apps hash table */ -int agent_app_ht_alloc(void); +int agent_app_ht_alloc(); /* Clean-up agent apps hash table */ -void agent_app_ht_clean(void); +void agent_app_ht_clean(); /* Initialize an already allocated agent domain. */ int agent_init(struct agent *agt); @@ -187,7 +187,7 @@ struct agent_event *agent_find_event_by_trigger(const struct lttng_trigger *trig /* Global event notifier per-domain agents. */ struct agent *agent_find_by_event_notifier_domain(enum lttng_domain_type domain_type); -void agent_by_event_notifier_domain_ht_destroy(void); -int agent_by_event_notifier_domain_ht_create(void); +void agent_by_event_notifier_domain_ht_destroy(); +int agent_by_event_notifier_domain_ht_create(); #endif /* LTTNG_SESSIOND_AGENT_H */ diff --git a/src/bin/lttng-sessiond/buffer-registry.hpp b/src/bin/lttng-sessiond/buffer-registry.hpp index 35f7960e9..2bdc58367 100644 --- a/src/bin/lttng-sessiond/buffer-registry.hpp +++ b/src/bin/lttng-sessiond/buffer-registry.hpp @@ -101,7 +101,7 @@ struct buffer_reg_pid { }; /* Buffer registry per UID. */ -void buffer_reg_init_uid_registry(void); +void buffer_reg_init_uid_registry(); int buffer_reg_uid_create(uint64_t session_id, uint32_t bits_per_long, uid_t uid, @@ -115,7 +115,7 @@ void buffer_reg_uid_remove(struct buffer_reg_uid *regp); void buffer_reg_uid_destroy(struct buffer_reg_uid *regp, struct consumer_output *consumer); /* Buffer registry per PID. */ -void buffer_reg_init_pid_registry(void); +void buffer_reg_init_pid_registry(); int buffer_reg_pid_create(uint64_t session_id, struct buffer_reg_pid **regp, const char *root_shm_path, @@ -138,7 +138,7 @@ void buffer_reg_stream_add(struct buffer_reg_stream *stream, struct buffer_reg_c void buffer_reg_stream_destroy(struct buffer_reg_stream *regp, enum lttng_domain_type domain); /* Global registry. */ -void buffer_reg_destroy_registries(void); +void buffer_reg_destroy_registries(); int buffer_reg_uid_consumer_channel_key(struct cds_list_head *buffer_reg_uid_list, uint64_t chan_key, diff --git a/src/bin/lttng-sessiond/client.hpp b/src/bin/lttng-sessiond/client.hpp index 49a454dfb..a8d0adc12 100644 --- a/src/bin/lttng-sessiond/client.hpp +++ b/src/bin/lttng-sessiond/client.hpp @@ -12,6 +12,6 @@ #include "thread.hpp" -struct lttng_thread *launch_client_thread(void); +struct lttng_thread *launch_client_thread(); #endif /* CLIENT_SESSIOND_H */ diff --git a/src/bin/lttng-sessiond/cmd.hpp b/src/bin/lttng-sessiond/cmd.hpp index 0039caf96..a470a0881 100644 --- a/src/bin/lttng-sessiond/cmd.hpp +++ b/src/bin/lttng-sessiond/cmd.hpp @@ -38,7 +38,7 @@ struct cmd_completion_handler { * Init the command subsystem. Must be called before using any of the functions * above. This is called in the main() of the session daemon. */ -void cmd_init(void); +void cmd_init(); /* Session commands */ enum lttng_error_code cmd_create_session(struct command_ctx *cmd_ctx, @@ -183,7 +183,7 @@ int cmd_rotation_set_schedule(struct ltt_session *session, enum lttng_rotation_schedule_type schedule_type, uint64_t value); -const struct cmd_completion_handler *cmd_pop_completion_handler(void); +const struct cmd_completion_handler *cmd_pop_completion_handler(); int start_kernel_session(struct ltt_kernel_session *ksess); int stop_kernel_session(struct ltt_kernel_session *ksess); diff --git a/src/bin/lttng-sessiond/ctf2-trace-class-visitor.hpp b/src/bin/lttng-sessiond/ctf2-trace-class-visitor.hpp index a46cc8bcb..d48442360 100644 --- a/src/bin/lttng-sessiond/ctf2-trace-class-visitor.hpp +++ b/src/bin/lttng-sessiond/ctf2-trace-class-visitor.hpp @@ -25,12 +25,12 @@ using append_metadata_fragment_function = std::function( @@ -138,8 +138,8 @@ lttng::cli::session_list list_sessions(const struct session_spec& spec); } /* namespace cli */ } /* namespace lttng */ -char *get_session_name(void); -char *get_session_name_quiet(void); +char *get_session_name(); +char *get_session_name_quiet(); void list_commands(struct cmd_struct *commands, FILE *ofp); void list_cmd_options(FILE *ofp, struct poptOption *options); void list_cmd_options_argpar(FILE *ofp, const struct argpar_opt_descr *options); @@ -167,7 +167,7 @@ const char *get_event_type_str(enum lttng_event_type event_type); int print_missing_or_multiple_domains(unsigned int domain_count, bool include_agent_domains); int spawn_relayd(const char *pathname, int port); -int check_relayd(void); +int check_relayd(); void print_session_stats(const char *session_name); int get_session_stats_str(const char *session_name, char **str); int show_cmd_help(const char *cmd_name, const char *help_msg); diff --git a/src/common/fd-tracker/inode.hpp b/src/common/fd-tracker/inode.hpp index 7f4f6fb59..4206117d8 100644 --- a/src/common/fd-tracker/inode.hpp +++ b/src/common/fd-tracker/inode.hpp @@ -30,7 +30,7 @@ struct lttng_unlinked_file_pool *lttng_unlinked_file_pool_create(const char *pat void lttng_unlinked_file_pool_destroy(struct lttng_unlinked_file_pool *pool); /* The inode registry is protected by the fd-tracker's lock. */ -struct lttng_inode_registry *lttng_inode_registry_create(void); +struct lttng_inode_registry *lttng_inode_registry_create(); struct lttng_inode *lttng_inode_registry_get_inode(struct lttng_inode_registry *registry, struct lttng_directory_handle *handle, diff --git a/src/lib/lttng-ctl/lttng-ctl-helper.hpp b/src/lib/lttng-ctl/lttng-ctl-helper.hpp index 843462e9f..b725dd06f 100644 --- a/src/lib/lttng-ctl/lttng-ctl-helper.hpp +++ b/src/lib/lttng-ctl/lttng-ctl-helper.hpp @@ -50,7 +50,7 @@ static inline int lttng_ctl_ask_sessiond_varlen_no_cmd_header(struct lttcomm_ses void **user_payload_buf) { return lttng_ctl_ask_sessiond_fds_varlen( - lsm, NULL, 0, vardata, vardata_len, user_payload_buf, NULL, NULL); + lsm, nullptr, 0, vardata, vardata_len, user_payload_buf, nullptr, nullptr); } /* @@ -61,18 +61,19 @@ static inline int lttng_ctl_ask_sessiond_fds_no_cmd_header(struct lttcomm_sessio size_t nb_fd, void **buf __attribute__((unused))) { - return lttng_ctl_ask_sessiond_fds_varlen(lsm, fds, nb_fd, NULL, 0, NULL, NULL, NULL); + return lttng_ctl_ask_sessiond_fds_varlen( + lsm, fds, nb_fd, nullptr, 0, nullptr, nullptr, nullptr); } /* * Use this if no variable length data needs to be sent. */ static inline int lttng_ctl_ask_sessiond(struct lttcomm_session_msg *lsm, void **buf) { - return lttng_ctl_ask_sessiond_varlen_no_cmd_header(lsm, NULL, 0, buf); + return lttng_ctl_ask_sessiond_varlen_no_cmd_header(lsm, nullptr, 0, buf); } -int lttng_check_tracing_group(void); +int lttng_check_tracing_group(); -int connect_sessiond(void); +int connect_sessiond(); #endif /* LTTNG_CTL_HELPER_H */