From: Michael Jeanson Date: Tue, 8 Mar 2022 15:52:55 +0000 (-0500) Subject: Prepare for '-Wunused-parameter' X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f46376a14da2eb796690cb4e718e8b213839d6ea;p=lttng-tools.git Prepare for '-Wunused-parameter' In preparation for '-Wextra' Change-Id: I30e6abb9502fc97daa565fde450d1e4235cf1ec7 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/doc/examples/rotation/rotate-client-example.c b/doc/examples/rotation/rotate-client-example.c index 5cb0887bf..a5ee70da3 100644 --- a/doc/examples/rotation/rotate-client-example.c +++ b/doc/examples/rotation/rotate-client-example.c @@ -42,7 +42,7 @@ static volatile int quit = 0; -static void sighandler(int signal) +static void sighandler(int signal __attribute__((unused))) { printf("Signal caught, exiting\n"); quit = 1; diff --git a/doc/examples/trigger-condition-event-matches/instrumented-app.c b/doc/examples/trigger-condition-event-matches/instrumented-app.c index dce6e577f..465b4a123 100644 --- a/doc/examples/trigger-condition-event-matches/instrumented-app.c +++ b/doc/examples/trigger-condition-event-matches/instrumented-app.c @@ -13,7 +13,7 @@ #include #include -int main(int argc, char **argv) +int main(void) { uint64_t i; diff --git a/extras/core-handler/crash.c b/extras/core-handler/crash.c index 060cd651c..bc7296814 100644 --- a/extras/core-handler/crash.c +++ b/extras/core-handler/crash.c @@ -8,7 +8,7 @@ #include -int main(int argc, char *argv[]) +int main(void) { raise(SIGSEGV); return 0; diff --git a/src/bin/lttng-consumerd/health-consumerd.cpp b/src/bin/lttng-consumerd/health-consumerd.cpp index fe2f6d22c..e3adbe142 100644 --- a/src/bin/lttng-consumerd/health-consumerd.cpp +++ b/src/bin/lttng-consumerd/health-consumerd.cpp @@ -144,7 +144,7 @@ end: /* * Thread managing health check socket. */ -void *thread_manage_health_consumerd(void *data) +void *thread_manage_health_consumerd(void *data __attribute__((unused))) { int sock = -1, new_sock = -1, ret, i, pollfd, err = -1; uint32_t revents, nb_fd; diff --git a/src/bin/lttng-consumerd/lttng-consumerd.cpp b/src/bin/lttng-consumerd/lttng-consumerd.cpp index 73238b4fb..3ee13dcb5 100644 --- a/src/bin/lttng-consumerd/lttng-consumerd.cpp +++ b/src/bin/lttng-consumerd/lttng-consumerd.cpp @@ -82,7 +82,8 @@ enum lttng_consumer_type lttng_consumer_get_type(void) /* * Signal handler for the daemon */ -static void sighandler(int sig, siginfo_t *siginfo, void *arg) +static void sighandler(int sig, siginfo_t *siginfo, + void *arg __attribute__((unused))) { if (sig == SIGINT && sigintcount++ == 0) { DBG("ignoring first SIGINT"); diff --git a/src/bin/lttng-relayd/cmd-2-11.cpp b/src/bin/lttng-relayd/cmd-2-11.cpp index cef90fdc4..572b1836c 100644 --- a/src/bin/lttng-relayd/cmd-2-11.cpp +++ b/src/bin/lttng-relayd/cmd-2-11.cpp @@ -21,7 +21,8 @@ int cmd_create_session_2_11(const struct lttng_buffer_view *payload, char *session_name, char *hostname, char *base_path, uint32_t *live_timer, bool *snapshot, - uint64_t *id_sessiond, lttng_uuid sessiond_uuid, + uint64_t *id_sessiond, + lttng_uuid sessiond_uuid, bool *has_current_chunk, uint64_t *current_chunk_id, time_t *creation_time, bool *session_name_contains_creation_time) diff --git a/src/bin/lttng-relayd/health-relayd.cpp b/src/bin/lttng-relayd/health-relayd.cpp index b832ffe0e..d43c37185 100644 --- a/src/bin/lttng-relayd/health-relayd.cpp +++ b/src/bin/lttng-relayd/health-relayd.cpp @@ -259,7 +259,7 @@ end: /* * Thread managing health check socket. */ -void *thread_manage_health_relayd(void *data) +void *thread_manage_health_relayd(void *data __attribute__((unused))) { int sock = -1, new_sock = -1, ret, i, pollfd, err = -1; uint32_t revents, nb_fd; diff --git a/src/bin/lttng-relayd/live.cpp b/src/bin/lttng-relayd/live.cpp index e0d446b2a..3efa1beda 100644 --- a/src/bin/lttng-relayd/live.cpp +++ b/src/bin/lttng-relayd/live.cpp @@ -655,7 +655,7 @@ end: } static -int close_sock(void *data, int *in_fd) +int close_sock(void *data, int *in_fd __attribute__((unused))) { struct lttcomm_sock *sock = (lttcomm_sock *) data; @@ -766,7 +766,7 @@ error: * This thread manages the listening for new connections on the network */ static -void *thread_listener(void *data) +void *thread_listener(void *data __attribute__((unused))) { int i, ret, pollfd, err = -1; uint32_t revents, nb_fd; @@ -931,7 +931,7 @@ error_sock_control: * This thread manages the dispatching of the requests to worker threads */ static -void *thread_dispatcher(void *data) +void *thread_dispatcher(void *data __attribute__((unused))) { int err = -1; ssize_t ret; @@ -2662,7 +2662,7 @@ void cleanup_connection_pollfd(struct lttng_poll_event *events, int pollfd) * This thread does the actual work */ static -void *thread_worker(void *data) +void *thread_worker(void *data __attribute__((unused))) { int ret, err = -1; uint32_t nb_fd; diff --git a/src/bin/lttng-relayd/main.cpp b/src/bin/lttng-relayd/main.cpp index 2b1061876..99f792010 100644 --- a/src/bin/lttng-relayd/main.cpp +++ b/src/bin/lttng-relayd/main.cpp @@ -405,7 +405,8 @@ end: * See config_entry_handler_cb comment in common/config/session-config.h for the * return value conventions. */ -static int config_entry_handler(const struct config_entry *entry, void *unused) +static int config_entry_handler(const struct config_entry *entry, + void *unused __attribute__((unused))) { int ret = 0, i; @@ -676,7 +677,8 @@ static void print_global_objects(void) print_sessions(); } -static int noop_close(void *data, int *fds) +static int noop_close(void *data __attribute__((unused)), + int *fds __attribute__((unused))) { return 0; } @@ -973,7 +975,7 @@ end: return ret; } -static int close_sock(void *data, int *in_fd) +static int close_sock(void *data, int *in_fd __attribute__((unused))) { struct lttcomm_sock *sock = (lttcomm_sock *) data; @@ -1085,7 +1087,7 @@ end: /* * This thread manages the listening for new connections on the network */ -static void *relay_thread_listener(void *data) +static void *relay_thread_listener(void *data __attribute__((unused))) { int i, ret, pollfd, err = -1; uint32_t revents, nb_fd; @@ -1289,7 +1291,7 @@ error_sock_control: /* * This thread manages the dispatching of the requests to worker threads */ -static void *relay_thread_dispatcher(void *data) +static void *relay_thread_dispatcher(void *data __attribute__((unused))) { int err = -1; ssize_t ret; @@ -1376,7 +1378,8 @@ static bool session_streams_have_index(const struct relay_session *session) * * On success, send back the session id or else return a negative value. */ -static int relay_create_session(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_create_session( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -1568,7 +1571,8 @@ end: /* * relay_add_stream: allocate a new stream for a session */ -static int relay_add_stream(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_add_stream( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -1707,7 +1711,8 @@ end_no_session: /* * relay_close_stream: close a specific stream */ -static int relay_close_stream(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_close_stream( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -1785,7 +1790,8 @@ end_no_session: * relay_reset_metadata: reset a metadata stream */ static -int relay_reset_metadata(const struct lttcomm_relayd_hdr *recv_hdr, +int relay_reset_metadata( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -1884,9 +1890,10 @@ static void relay_unknown_command(struct relay_connection *conn) * relay_start: send an acknowledgment to the client to tell if we are * ready to receive data. We are ready if a session is established. */ -static int relay_start(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_start( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, - const struct lttng_buffer_view *payload) + const struct lttng_buffer_view *payload __attribute__((unused))) { int ret = 0; ssize_t send_ret; @@ -1977,7 +1984,8 @@ end: /* * relay_send_version: send relayd version number */ -static int relay_send_version(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_send_version( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -2047,7 +2055,8 @@ end: /* * Check for data pending for a given stream id from the session daemon. */ -static int relay_data_pending(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_data_pending( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -2136,7 +2145,8 @@ end_no_session: * the control socket has been handled. So, this is why we simply return * OK here. */ -static int relay_quiescent_control(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_quiescent_control( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -2276,7 +2286,8 @@ end_no_session: * * Return to the client if there is data in flight or not with a ret_code. */ -static int relay_end_data_pending(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_end_data_pending( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -2368,7 +2379,8 @@ end_no_session: * * Return 0 on success else a negative value. */ -static int relay_recv_index(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_recv_index( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -2456,9 +2468,10 @@ end_no_session: * * Return 0 on success else a negative value. */ -static int relay_streams_sent(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_streams_sent( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, - const struct lttng_buffer_view *payload) + const struct lttng_buffer_view *payload __attribute__((unused))) { int ret; ssize_t send_ret; @@ -2620,7 +2633,7 @@ error: * session rotation feature (not the tracefile rotation feature). */ static int relay_rotate_session_streams( - const struct lttcomm_relayd_hdr *recv_hdr, + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -2758,7 +2771,8 @@ end_no_reply: /* * relay_create_trace_chunk: create a new trace chunk */ -static int relay_create_trace_chunk(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_create_trace_chunk( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -2944,7 +2958,8 @@ end_no_reply: /* * relay_close_trace_chunk: close a trace chunk */ -static int relay_close_trace_chunk(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_close_trace_chunk( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -3200,7 +3215,8 @@ end_no_reply: /* * relay_trace_chunk_exists: check if a trace chunk exists */ -static int relay_trace_chunk_exists(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_trace_chunk_exists( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -3263,7 +3279,8 @@ end_no_reply: /* * relay_get_configuration: query whether feature is available */ -static int relay_get_configuration(const struct lttcomm_relayd_hdr *recv_hdr, +static int relay_get_configuration( + const struct lttcomm_relayd_hdr *recv_hdr __attribute__((unused)), struct relay_connection *conn, const struct lttng_buffer_view *payload) { @@ -3897,7 +3914,7 @@ static void relay_thread_close_connection(struct lttng_poll_event *events, /* * This thread does the actual work */ -static void *relay_thread_worker(void *data) +static void *relay_thread_worker(void *data __attribute__((unused))) { int ret, err = -1, last_seen_data_fd = -1; uint32_t nb_fd; @@ -4225,7 +4242,7 @@ static int create_relay_conn_pipe(void) "Relayd connection pipe", relay_conn_pipe); } -static int stdio_open(void *data, int *fds) +static int stdio_open(void *data __attribute__((unused)), int *fds) { fds[0] = fileno(stdout); fds[1] = fileno(stderr); diff --git a/src/bin/lttng-sessiond/action-executor.cpp b/src/bin/lttng-sessiond/action-executor.cpp index 34d3b7130..e2eeed451 100644 --- a/src/bin/lttng-sessiond/action-executor.cpp +++ b/src/bin/lttng-sessiond/action-executor.cpp @@ -264,7 +264,7 @@ end: static int action_executor_notify_handler(struct action_executor *executor, const struct action_work_item *work_item, - struct action_work_subitem *item) + struct action_work_subitem *item __attribute__((unused))) { return notification_client_list_send_evaluation(work_item->client_list, work_item->trigger, @@ -276,7 +276,7 @@ static int action_executor_notify_handler(struct action_executor *executor, } static int action_executor_start_session_handler( - struct action_executor *executor, + struct action_executor *executor __attribute__((unused)), const struct action_work_item *work_item, struct action_work_subitem *item) { @@ -361,7 +361,7 @@ end: } static int action_executor_stop_session_handler( - struct action_executor *executor, + struct action_executor *executor __attribute__((unused)), const struct action_work_item *work_item, struct action_work_subitem *item) { @@ -446,7 +446,7 @@ end: } static int action_executor_rotate_session_handler( - struct action_executor *executor, + struct action_executor *executor __attribute__((unused)), const struct action_work_item *work_item, struct action_work_subitem *item) { @@ -538,7 +538,7 @@ end: } static int action_executor_snapshot_session_handler( - struct action_executor *executor, + struct action_executor *executor __attribute__((unused)), const struct action_work_item *work_item, struct action_work_subitem *item) { @@ -633,9 +633,10 @@ end: return ret; } -static int action_executor_list_handler(struct action_executor *executor, - const struct action_work_item *work_item, - struct action_work_subitem *item) +static int action_executor_list_handler( + struct action_executor *executor __attribute__((unused)), + const struct action_work_item *work_item __attribute__((unused)), + struct action_work_subitem *item __attribute__((unused))) { ERR("Execution of a list action by the action executor should never occur"); abort(); diff --git a/src/bin/lttng-sessiond/client.cpp b/src/bin/lttng-sessiond/client.cpp index 7fd9d0b0e..4c1f6954b 100644 --- a/src/bin/lttng-sessiond/client.cpp +++ b/src/bin/lttng-sessiond/client.cpp @@ -583,7 +583,8 @@ error_create: /* * Count number of session permitted by uid/gid. */ -static unsigned int lttng_sessions_count(uid_t uid, gid_t gid) +static unsigned int lttng_sessions_count(uid_t uid, + gid_t gid __attribute__((unused))) { unsigned int i = 0; struct ltt_session *session; @@ -2041,8 +2042,7 @@ skip_domain: { lttng_snapshot_output output = cmd_ctx->lsm.u.snapshot_record.output; ret = cmd_snapshot_record(cmd_ctx->session, - &output, - cmd_ctx->lsm.u.snapshot_record.wait); + &output, 0); // RFC: set to zero since it's ignored by cmd_snapshot_record break; } case LTTNG_CREATE_SESSION_EXT: @@ -2435,7 +2435,7 @@ static void cleanup_client_thread(void *data) lttng_pipe_destroy(quit_pipe); } -static void thread_init_cleanup(void *data) +static void thread_init_cleanup(void *data __attribute__((unused))) { set_thread_status(false); } diff --git a/src/bin/lttng-sessiond/cmd.cpp b/src/bin/lttng-sessiond/cmd.cpp index 0e9821eb6..9ade60798 100644 --- a/src/bin/lttng-sessiond/cmd.cpp +++ b/src/bin/lttng-sessiond/cmd.cpp @@ -917,7 +917,6 @@ relayd_comm_error: * Returns LTTNG_OK, or an LTTng error code on failure. */ static enum lttng_error_code send_consumer_relayd_sockets( - enum lttng_domain_type domain, unsigned int session_id, struct consumer_output *consumer, struct consumer_socket *sock, const char *session_name, const char *hostname, const char *base_path, int session_live_timer, @@ -998,7 +997,7 @@ int cmd_setup_relayd(struct ltt_session *session) cds_lfht_for_each_entry(usess->consumer->socks->ht, &iter.iter, socket, node.node) { pthread_mutex_lock(socket->lock); - ret = send_consumer_relayd_sockets(LTTNG_DOMAIN_UST, session->id, + ret = send_consumer_relayd_sockets(session->id, usess->consumer, socket, session->name, session->hostname, session->base_path, @@ -1026,7 +1025,7 @@ int cmd_setup_relayd(struct ltt_session *session) cds_lfht_for_each_entry(ksess->consumer->socks->ht, &iter.iter, socket, node.node) { pthread_mutex_lock(socket->lock); - ret = send_consumer_relayd_sockets(LTTNG_DOMAIN_KERNEL, session->id, + ret = send_consumer_relayd_sockets(session->id, ksess->consumer, socket, session->name, session->hostname, session->base_path, @@ -5038,7 +5037,7 @@ static enum lttng_error_code set_relayd_for_snapshot( cds_lfht_for_each_entry(output->socks->ht, &iter.iter, socket, node.node) { pthread_mutex_lock(socket->lock); - status = send_consumer_relayd_sockets(LTTNG_DOMAIN_NONE, session->id, + status = send_consumer_relayd_sockets(session->id, output, socket, session->name, session->hostname, base_path, @@ -5067,7 +5066,7 @@ static enum lttng_error_code record_kernel_snapshot( struct ltt_kernel_session *ksess, const struct consumer_output *output, const struct ltt_session *session, - int wait, uint64_t nb_packets_per_stream) + uint64_t nb_packets_per_stream) { enum lttng_error_code status; @@ -5076,7 +5075,7 @@ static enum lttng_error_code record_kernel_snapshot( LTTNG_ASSERT(session); status = kernel_snapshot_record( - ksess, output, wait, nb_packets_per_stream); + ksess, output, nb_packets_per_stream); return status; } @@ -5088,7 +5087,7 @@ static enum lttng_error_code record_kernel_snapshot( static enum lttng_error_code record_ust_snapshot(struct ltt_ust_session *usess, const struct consumer_output *output, const struct ltt_session *session, - int wait, uint64_t nb_packets_per_stream) + uint64_t nb_packets_per_stream) { enum lttng_error_code status; @@ -5097,7 +5096,7 @@ static enum lttng_error_code record_ust_snapshot(struct ltt_ust_session *usess, LTTNG_ASSERT(session); status = ust_app_snapshot_record( - usess, output, wait, nb_packets_per_stream); + usess, output, nb_packets_per_stream); return status; } @@ -5191,7 +5190,7 @@ int64_t get_session_nb_packets_per_stream(const struct ltt_session *session, static enum lttng_error_code snapshot_record(struct ltt_session *session, - const struct snapshot_output *snapshot_output, int wait) + const struct snapshot_output *snapshot_output) { int64_t nb_packets_per_stream; char snapshot_chunk_name[LTTNG_NAME_MAX]; @@ -5311,7 +5310,7 @@ enum lttng_error_code snapshot_record(struct ltt_session *session, if (session->kernel_session) { ret_code = record_kernel_snapshot(session->kernel_session, snapshot_kernel_consumer_output, session, - wait, nb_packets_per_stream); + nb_packets_per_stream); if (ret_code != LTTNG_OK) { goto error_close_trace_chunk; } @@ -5320,7 +5319,7 @@ enum lttng_error_code snapshot_record(struct ltt_session *session, if (session->ust_session) { ret_code = record_ust_snapshot(session->ust_session, snapshot_ust_consumer_output, session, - wait, nb_packets_per_stream); + nb_packets_per_stream); if (ret_code != LTTNG_OK) { goto error_close_trace_chunk; } @@ -5368,7 +5367,8 @@ error: * Return LTTNG_OK on success or else a LTTNG_ERR code. */ int cmd_snapshot_record(struct ltt_session *session, - const struct lttng_snapshot_output *output, int wait) + const struct lttng_snapshot_output *output, + int wait __attribute__((unused))) { enum lttng_error_code cmd_ret = LTTNG_OK; int ret; @@ -5430,7 +5430,7 @@ int cmd_snapshot_record(struct ltt_session *session, /* Use the global datetime */ memcpy(tmp_output->datetime, datetime, sizeof(datetime)); - cmd_ret = snapshot_record(session, tmp_output, wait); + cmd_ret = snapshot_record(session, tmp_output); if (cmd_ret != LTTNG_OK) { goto error; } @@ -5470,7 +5470,7 @@ int cmd_snapshot_record(struct ltt_session *session, } } - cmd_ret = snapshot_record(session, &output_copy, wait); + cmd_ret = snapshot_record(session, &output_copy); if (cmd_ret != LTTNG_OK) { rcu_read_unlock(); goto error; diff --git a/src/bin/lttng-sessiond/consumer.cpp b/src/bin/lttng-sessiond/consumer.cpp index 3637cb2e5..9919c6781 100644 --- a/src/bin/lttng-sessiond/consumer.cpp +++ b/src/bin/lttng-sessiond/consumer.cpp @@ -1009,8 +1009,6 @@ void consumer_init_add_channel_comm_msg(struct lttcomm_consumer_msg *msg, uint64_t channel_key, uint64_t session_id, const char *pathname, - uid_t uid, - gid_t gid, uint64_t relayd_id, const char *name, unsigned int nb_init_streams, @@ -1507,7 +1505,7 @@ end: */ enum lttng_error_code consumer_snapshot_channel(struct consumer_socket *socket, uint64_t key, const struct consumer_output *output, int metadata, - uid_t uid, gid_t gid, const char *channel_path, int wait, + const char *channel_path, uint64_t nb_packets_per_stream) { int ret; @@ -1687,7 +1685,7 @@ end: * chunk each stream is currently writing to (for the rotate_pending operation). */ int consumer_rotate_channel(struct consumer_socket *socket, uint64_t key, - uid_t uid, gid_t gid, struct consumer_output *output, + struct consumer_output *output, bool is_metadata_channel) { int ret; diff --git a/src/bin/lttng-sessiond/consumer.h b/src/bin/lttng-sessiond/consumer.h index ffba198a8..a179206fc 100644 --- a/src/bin/lttng-sessiond/consumer.h +++ b/src/bin/lttng-sessiond/consumer.h @@ -284,8 +284,6 @@ void consumer_init_add_channel_comm_msg(struct lttcomm_consumer_msg *msg, uint64_t channel_key, uint64_t session_id, const char *pathname, - uid_t uid, - gid_t gid, uint64_t relayd_id, const char *name, unsigned int nb_init_streams, @@ -317,13 +315,11 @@ int consumer_get_lost_packets(uint64_t session_id, uint64_t channel_key, /* Snapshot command. */ enum lttng_error_code consumer_snapshot_channel(struct consumer_socket *socket, uint64_t key, const struct consumer_output *output, int metadata, - uid_t uid, gid_t gid, const char *channel_path, int wait, - uint64_t nb_packets_per_stream); + const char *channel_path, uint64_t nb_packets_per_stream); /* Rotation commands. */ int consumer_rotate_channel(struct consumer_socket *socket, uint64_t key, - uid_t uid, gid_t gid, struct consumer_output *output, - bool is_metadata_channel); + struct consumer_output *output, bool is_metadata_channel); int consumer_init(struct consumer_socket *socket, const lttng_uuid sessiond_uuid); diff --git a/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp b/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp index c99c39338..49a54ff50 100644 --- a/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp +++ b/src/bin/lttng-sessiond/event-notifier-error-accounting.cpp @@ -369,7 +369,7 @@ struct ust_error_accounting_entry *ust_error_accounting_entry_find( */ static struct ust_error_accounting_entry *ust_error_accounting_entry_create( - struct lttng_ht *uid_ht, const struct ust_app *app) + const struct ust_app *app) { int i, ret, *cpu_counter_fds = NULL; struct lttng_ust_ctl_daemon_counter *daemon_counter; @@ -611,8 +611,7 @@ event_notifier_error_accounting_register_app(struct ust_app *app) */ pthread_mutex_lock(&the_event_notifier_counter.lock); - entry = ust_error_accounting_entry_create(error_counter_uid_ht, - app); + entry = ust_error_accounting_entry_create(app); if (!entry) { status = EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_ERR; pthread_mutex_unlock(&the_event_notifier_counter.lock); diff --git a/src/bin/lttng-sessiond/event-notifier-error-accounting.h b/src/bin/lttng-sessiond/event-notifier-error-accounting.h index 319a488ae..440b9d091 100644 --- a/src/bin/lttng-sessiond/event-notifier-error-accounting.h +++ b/src/bin/lttng-sessiond/event-notifier-error-accounting.h @@ -56,17 +56,21 @@ event_notifier_error_accounting_register_app(struct ust_app *app); */ enum event_notifier_error_accounting_status event_notifier_error_accounting_unregister_app(struct ust_app *app); + #else /* HAVE_LIBLTTNG_UST_CTL */ + static inline enum event_notifier_error_accounting_status -event_notifier_error_accounting_register_app(struct ust_app *app) +event_notifier_error_accounting_register_app( + struct ust_app *app __attribute__((unused))) { return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK; } static inline enum event_notifier_error_accounting_status -event_notifier_error_accounting_unregister_app(struct ust_app *app) +event_notifier_error_accounting_unregister_app( + struct ust_app *app __attribute__((unused))) { return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK; } diff --git a/src/bin/lttng-sessiond/fd-limit.cpp b/src/bin/lttng-sessiond/fd-limit.cpp index 833b64714..684332e9f 100644 --- a/src/bin/lttng-sessiond/fd-limit.cpp +++ b/src/bin/lttng-sessiond/fd-limit.cpp @@ -43,7 +43,8 @@ int lttng_fd_get(enum lttng_fd_type type, unsigned int nr) return 0; } -void lttng_fd_put(enum lttng_fd_type type, unsigned int nr) +void lttng_fd_put(enum lttng_fd_type type __attribute__((unused)), + unsigned int nr) { uatomic_sub(&fd_count, (long) nr); } diff --git a/src/bin/lttng-sessiond/kernel-consumer.cpp b/src/bin/lttng-sessiond/kernel-consumer.cpp index 364705fcb..d224b4cb7 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.cpp +++ b/src/bin/lttng-sessiond/kernel-consumer.cpp @@ -145,8 +145,6 @@ int kernel_consumer_add_channel(struct consumer_socket *sock, channel->key, ksession->id, &pathname[consumer_path_offset], - ksession->uid, - ksession->gid, consumer->net_seq_index, channel->channel->name, channel->stream_count, @@ -226,8 +224,6 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, ksession->metadata->key, ksession->id, "", - ksession->uid, - ksession->gid, consumer->net_seq_index, ksession->metadata->conf->name, 1, @@ -279,7 +275,7 @@ static int kernel_consumer_add_stream(struct consumer_socket *sock, struct ltt_kernel_channel *channel, struct ltt_kernel_stream *stream, - struct ltt_kernel_session *session, unsigned int monitor) + struct ltt_kernel_session *session) { int ret; struct lttcomm_consumer_msg lkm; @@ -396,7 +392,7 @@ int kernel_consumer_send_channel_streams(struct consumer_socket *sock, /* Add stream on the kernel consumer side. */ ret = kernel_consumer_add_stream(sock, channel, stream, - ksession, monitor); + ksession); if (ret < 0) { goto error; } diff --git a/src/bin/lttng-sessiond/kernel.cpp b/src/bin/lttng-sessiond/kernel.cpp index cb2d649e7..c4662af0d 100644 --- a/src/bin/lttng-sessiond/kernel.cpp +++ b/src/bin/lttng-sessiond/kernel.cpp @@ -1663,7 +1663,7 @@ void kernel_destroy_channel(struct ltt_kernel_channel *kchan) */ enum lttng_error_code kernel_snapshot_record( struct ltt_kernel_session *ksess, - const struct consumer_output *output, int wait, + const struct consumer_output *output, uint64_t nb_packets_per_stream) { int err, ret, saved_metadata_fd; @@ -1721,8 +1721,7 @@ enum lttng_error_code kernel_snapshot_record( /* For each channel, ask the consumer to snapshot it. */ cds_list_for_each_entry(chan, &ksess->channel_list.head, list) { status = consumer_snapshot_channel(socket, chan->key, output, 0, - ksess->uid, ksess->gid, - &trace_path[consumer_path_offset], wait, + &trace_path[consumer_path_offset], nb_packets_per_stream); if (status != LTTNG_OK) { (void) kernel_consumer_destroy_metadata(socket, @@ -1733,8 +1732,7 @@ enum lttng_error_code kernel_snapshot_record( /* Snapshot metadata, */ status = consumer_snapshot_channel(socket, ksess->metadata->key, output, - 1, ksess->uid, ksess->gid, &trace_path[consumer_path_offset], - wait, 0); + 1, &trace_path[consumer_path_offset], 0); if (status != LTTNG_OK) { goto error_consumer; } @@ -1873,7 +1871,7 @@ enum lttng_error_code kernel_rotate_session(struct ltt_session *session) DBG("Rotate kernel channel %" PRIu64 ", session %s", chan->key, session->name); ret = consumer_rotate_channel(socket, chan->key, - ksess->uid, ksess->gid, ksess->consumer, + ksess->consumer, /* is_metadata_channel */ false); if (ret < 0) { status = LTTNG_ERR_ROTATION_FAIL_CONSUMER; @@ -1885,7 +1883,7 @@ enum lttng_error_code kernel_rotate_session(struct ltt_session *session) * Rotate the metadata channel. */ ret = consumer_rotate_channel(socket, ksess->metadata->key, - ksess->uid, ksess->gid, ksess->consumer, + ksess->consumer, /* is_metadata_channel */ true); if (ret < 0) { status = LTTNG_ERR_ROTATION_FAIL_CONSUMER; diff --git a/src/bin/lttng-sessiond/kernel.h b/src/bin/lttng-sessiond/kernel.h index 5ecdad41f..4eb788d5c 100644 --- a/src/bin/lttng-sessiond/kernel.h +++ b/src/bin/lttng-sessiond/kernel.h @@ -65,7 +65,7 @@ void kernel_free_session(struct ltt_kernel_session *ksess); void kernel_destroy_channel(struct ltt_kernel_channel *kchan); enum lttng_error_code kernel_snapshot_record( struct ltt_kernel_session *ksess, - const struct consumer_output *output, int wait, + const struct consumer_output *output, uint64_t nb_packets_per_stream); int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits); enum lttng_error_code kernel_rotate_session(struct ltt_session *session); diff --git a/src/bin/lttng-sessiond/main.cpp b/src/bin/lttng-sessiond/main.cpp index d8d2caf8b..5873f0304 100644 --- a/src/bin/lttng-sessiond/main.cpp +++ b/src/bin/lttng-sessiond/main.cpp @@ -795,7 +795,8 @@ end: * See config_entry_handler_cb comment in common/config/session-config.h for the * return value conventions. */ -static int config_entry_handler(const struct config_entry *entry, void *unused) +static int config_entry_handler(const struct config_entry *entry, + void *unused __attribute__((unused))) { int ret = 0, i; @@ -1172,7 +1173,8 @@ error: * Simply stop all worker threads, leaving main() return gracefully after * joining all threads and calling cleanup(). */ -static void sighandler(int sig, siginfo_t *siginfo, void *arg) +static void sighandler(int sig, siginfo_t *siginfo, + void *arg __attribute__((unused))) { switch (sig) { case SIGINT: diff --git a/src/bin/lttng-sessiond/modprobe.cpp b/src/bin/lttng-sessiond/modprobe.cpp index 9f6c4a9c3..fb2bcc8aa 100644 --- a/src/bin/lttng-sessiond/modprobe.cpp +++ b/src/bin/lttng-sessiond/modprobe.cpp @@ -249,8 +249,12 @@ static int probes_capacity; * @brief Logging function for libkmod integration. */ static ATTR_FORMAT_PRINTF(6, 0) -void log_kmod(void *data, int priority, const char *file, int line, - const char *fn, const char *format, va_list args) +void log_kmod(void *data __attribute__((unused)), + int priority __attribute__((unused)), + const char *file __attribute__((unused)), + int line __attribute__((unused)), + const char *fn __attribute__((unused)), + const char *format, va_list args) { char *str; diff --git a/src/bin/lttng-sessiond/notification-thread-events.cpp b/src/bin/lttng-sessiond/notification-thread-events.cpp index cf18f63f7..f0140ce55 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.cpp +++ b/src/bin/lttng-sessiond/notification-thread-events.cpp @@ -1279,8 +1279,7 @@ void free_notification_client_rcu(struct rcu_head *node) } static -void notification_client_destroy(struct notification_client *client, - struct notification_thread_state *state) +void notification_client_destroy(struct notification_client *client) { if (!client) { return; @@ -2233,7 +2232,7 @@ end: } static int handle_notification_thread_command_list_triggers( - struct notification_thread_handle *handle, + struct notification_thread_handle *handle __attribute__((unused)), struct notification_thread_state *state, uid_t client_uid, struct lttng_triggers **triggers, @@ -3396,7 +3395,7 @@ int handle_notification_thread_client_connect( return ret; error: - notification_client_destroy(client, state); + notification_client_destroy(client); return ret; } @@ -3438,7 +3437,7 @@ int notification_thread_client_disconnect( * Client no longer accessible to other threads (through the * client lists). */ - notification_client_destroy(client, state); + notification_client_destroy(client); return ret; } @@ -3746,7 +3745,7 @@ error: static int client_handle_message_unknown(struct notification_client *client, - struct notification_thread_state *state) + struct notification_thread_state *state __attribute__((unused))) { int ret; /* @@ -4186,7 +4185,7 @@ bool evaluate_session_consumed_size_condition( static int evaluate_buffer_condition(const struct lttng_condition *condition, struct lttng_evaluation **evaluation, - const struct notification_thread_state *state, + const struct notification_thread_state *state __attribute__((unused)), const struct channel_state_sample *previous_sample, const struct channel_state_sample *latest_sample, uint64_t previous_session_consumed_total, diff --git a/src/bin/lttng-sessiond/notify-apps.h b/src/bin/lttng-sessiond/notify-apps.h index ab6289a33..152a52a20 100644 --- a/src/bin/lttng-sessiond/notify-apps.h +++ b/src/bin/lttng-sessiond/notify-apps.h @@ -15,7 +15,8 @@ bool launch_application_notification_thread(int apps_cmd_notify_pipe_read_fd); #else /* HAVE_LIBLTTNG_UST_CTL */ static -bool launch_application_notification_thread(int apps_cmd_notify_pipe_read_fd) +bool launch_application_notification_thread( + int apps_cmd_notify_pipe_read_fd __attribute__((unused))) { return true; } diff --git a/src/bin/lttng-sessiond/rotation-thread.cpp b/src/bin/lttng-sessiond/rotation-thread.cpp index 473138cf8..9c873aec5 100644 --- a/src/bin/lttng-sessiond/rotation-thread.cpp +++ b/src/bin/lttng-sessiond/rotation-thread.cpp @@ -564,7 +564,7 @@ int run_job(struct rotation_thread_job *job, struct ltt_session *session, static int handle_job_queue(struct rotation_thread_handle *handle, - struct rotation_thread *state, + struct rotation_thread *state __attribute__((unused)), struct rotation_thread_timer_queue *queue) { int ret = 0; @@ -710,9 +710,9 @@ end: } static -int handle_notification_channel(int fd, +int handle_notification_channel(int fd __attribute__((unused)), struct rotation_thread_handle *handle, - struct rotation_thread *state) + struct rotation_thread *state __attribute__((unused))) { int ret; bool notification_pending; diff --git a/src/bin/lttng-sessiond/timer.cpp b/src/bin/lttng-sessiond/timer.cpp index 5a1f35dfa..9635dea81 100644 --- a/src/bin/lttng-sessiond/timer.cpp +++ b/src/bin/lttng-sessiond/timer.cpp @@ -406,7 +406,7 @@ end: } static -bool shutdown_timer_thread(void *data) +bool shutdown_timer_thread(void *data __attribute__((unused))) { return kill(getpid(), LTTNG_SESSIOND_SIG_EXIT) == 0; } diff --git a/src/bin/lttng-sessiond/trace-ust.h b/src/bin/lttng-sessiond/trace-ust.h index c312dd970..d4df48d18 100644 --- a/src/bin/lttng-sessiond/trace-ust.h +++ b/src/bin/lttng-sessiond/trace-ust.h @@ -240,129 +240,161 @@ const struct process_attr_tracker *trace_ust_get_process_attr_tracker( #else /* HAVE_LIBLTTNG_UST_CTL */ -static inline int trace_ust_ht_match_event(struct cds_lfht_node *node, - const void *_key) +static inline int trace_ust_ht_match_event( + struct cds_lfht_node *node __attribute__((unused)), + const void *_key __attribute__((unused))) { return 0; } -static inline int trace_ust_ht_match_event_by_name(struct cds_lfht_node *node, - const void *_key) + +static inline int trace_ust_ht_match_event_by_name( + struct cds_lfht_node *node __attribute__((unused)), + const void *_key __attribute__((unused))) { return 0; } + static inline -struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, - const char *name) +struct ltt_ust_channel *trace_ust_find_channel_by_name( + struct lttng_ht *ht __attribute__((unused)), + const char *name __attribute__((unused))) { return NULL; } static inline -struct ltt_ust_session *trace_ust_create_session(unsigned int session_id) +struct ltt_ust_session *trace_ust_create_session( + unsigned int session_id __attribute__((unused))) { return NULL; } + static inline -struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr, - enum lttng_domain_type domain) +struct ltt_ust_channel *trace_ust_create_channel( + struct lttng_channel *attr __attribute__((unused)), + enum lttng_domain_type domain __attribute__((unused))) { return NULL; } + static inline -enum lttng_error_code trace_ust_create_event(struct lttng_event *ev, - const char *filter_expression, - struct lttng_bytecode *filter, - struct lttng_event_exclusion *exclusion, - bool internal_event, struct ltt_ust_event **ust_event) +enum lttng_error_code trace_ust_create_event( + struct lttng_event *ev __attribute__((unused)), + const char *filter_expression __attribute__((unused)), + struct lttng_bytecode *filter __attribute__((unused)), + struct lttng_event_exclusion *exclusion __attribute__((unused)), + bool internal_event __attribute__((unused)), + struct ltt_ust_event **ust_event __attribute__((unused))) { return LTTNG_ERR_NO_UST; } + static inline -void trace_ust_destroy_session(struct ltt_ust_session *session) +void trace_ust_destroy_session( + struct ltt_ust_session *session __attribute__((unused))) { } static inline -void trace_ust_destroy_channel(struct ltt_ust_channel *channel) +void trace_ust_destroy_channel( + struct ltt_ust_channel *channel __attribute__((unused))) { } static inline -void trace_ust_destroy_event(struct ltt_ust_event *event) +void trace_ust_destroy_event( + struct ltt_ust_event *event __attribute__((unused))) { } static inline -void trace_ust_free_session(struct ltt_ust_session *session) +void trace_ust_free_session( + struct ltt_ust_session *session __attribute__((unused))) { } static inline struct ltt_ust_context *trace_ust_create_context( - const struct lttng_event_context *ctx) + const struct lttng_event_context *ctx __attribute__((unused))) { return NULL; } + static inline -int trace_ust_match_context(const struct ltt_ust_context *uctx, - const struct lttng_event_context *ctx) +int trace_ust_match_context( + const struct ltt_ust_context *uctx __attribute__((unused)), + const struct lttng_event_context *ctx __attribute__((unused))) { return 0; } + static inline -struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht, - char *name, struct lttng_bytecode *filter, - enum lttng_ust_abi_loglevel_type loglevel_type, int loglevel_value, - struct lttng_event_exclusion *exclusion) +struct ltt_ust_event *trace_ust_find_event( + struct lttng_ht *ht __attribute__((unused)), + char *name __attribute__((unused)), + struct lttng_bytecode *filter __attribute__((unused)), + enum lttng_ust_abi_loglevel_type loglevel_type __attribute__((unused)), + int loglevel_value __attribute__((unused)), + struct lttng_event_exclusion *exclusion __attribute__((unused))) { return NULL; } + static inline -void trace_ust_delete_channel(struct lttng_ht *ht, - struct ltt_ust_channel *channel) +void trace_ust_delete_channel( + struct lttng_ht *ht __attribute__((unused)), + struct ltt_ust_channel *channel __attribute__((unused))) { return; } + static inline -struct agent *trace_ust_find_agent(struct ltt_ust_session *session, - enum lttng_domain_type domain_type) +struct agent *trace_ust_find_agent( + struct ltt_ust_session *session __attribute__((unused)), + enum lttng_domain_type domain_type __attribute__((unused))) { return NULL; } + static inline int trace_ust_id_tracker_lookup( - enum lttng_process_attr process_attr, - struct ltt_ust_session *session, - int id) + enum lttng_process_attr process_attr __attribute__((unused)), + struct ltt_ust_session *session __attribute__((unused)), + int id __attribute__((unused))) { return 0; } + static inline enum lttng_error_code trace_ust_process_attr_tracker_set_tracking_policy( - struct ltt_ust_session *session, - enum lttng_process_attr process_attr, - enum lttng_tracking_policy policy) + struct ltt_ust_session *session __attribute__((unused)), + enum lttng_process_attr process_attr __attribute__((unused)), + enum lttng_tracking_policy policy __attribute__((unused))) { return LTTNG_OK; } + static inline enum lttng_error_code trace_ust_process_attr_tracker_inclusion_set_add_value( - struct ltt_ust_session *session, - enum lttng_process_attr process_attr, - const struct process_attr_value *value) + struct ltt_ust_session *session __attribute__((unused)), + enum lttng_process_attr process_attr __attribute__((unused)), + const struct process_attr_value *value __attribute__((unused))) { return LTTNG_OK; } + static inline enum lttng_error_code trace_ust_process_attr_tracker_inclusion_set_remove_value( - struct ltt_ust_session *session, - enum lttng_process_attr process_attr, - const struct process_attr_value *value) + struct ltt_ust_session *session __attribute__((unused)), + enum lttng_process_attr process_attr __attribute__((unused)), + const struct process_attr_value *value __attribute__((unused))) { return LTTNG_OK; } + static inline const struct process_attr_tracker * -trace_ust_get_process_attr_tracker(struct ltt_ust_session *session, - enum lttng_process_attr process_attr) +trace_ust_get_process_attr_tracker( + struct ltt_ust_session *session __attribute__((unused)), + enum lttng_process_attr process_attr __attribute__((unused))) { return NULL; } diff --git a/src/bin/lttng-sessiond/trigger-error-query.cpp b/src/bin/lttng-sessiond/trigger-error-query.cpp index 8c39e1b06..5bf612890 100644 --- a/src/bin/lttng-sessiond/trigger-error-query.cpp +++ b/src/bin/lttng-sessiond/trigger-error-query.cpp @@ -11,8 +11,8 @@ #include enum lttng_trigger_status lttng_trigger_add_error_results( - const struct lttng_trigger *trigger, - struct lttng_error_query_results *results) + const struct lttng_trigger *trigger __attribute__((unused)), + struct lttng_error_query_results *results __attribute__((unused))) { return LTTNG_TRIGGER_STATUS_OK; } diff --git a/src/bin/lttng-sessiond/ust-app.cpp b/src/bin/lttng-sessiond/ust-app.cpp index 62d323ee9..44db0accd 100644 --- a/src/bin/lttng-sessiond/ust-app.cpp +++ b/src/bin/lttng-sessiond/ust-app.cpp @@ -1998,7 +1998,7 @@ error: * Should be called with session mutex held. */ static -int create_ust_event(struct ust_app *app, struct ust_app_session *ua_sess, +int create_ust_event(struct ust_app *app, struct ust_app_channel *ua_chan, struct ust_app_event *ua_event) { int ret = 0; @@ -2886,8 +2886,8 @@ error: * Called with UST app session lock held. */ static -int enable_ust_app_event(struct ust_app_session *ua_sess, - struct ust_app_event *ua_event, struct ust_app *app) +int enable_ust_app_event(struct ust_app_event *ua_event, + struct ust_app *app) { int ret; @@ -2905,8 +2905,8 @@ error: /* * Disable on the tracer side a ust app event for the session and channel. */ -static int disable_ust_app_event(struct ust_app_session *ua_sess, - struct ust_app_event *ua_event, struct ust_app *app) +static int disable_ust_app_event(struct ust_app_event *ua_event, + struct ust_app *app) { int ret; @@ -2983,8 +2983,7 @@ error: */ static int do_consumer_create_channel(struct ltt_ust_session *usess, struct ust_app_session *ua_sess, struct ust_app_channel *ua_chan, - int bitness, struct ust_registry_session *registry, - uint64_t trace_archive_id) + int bitness, struct ust_registry_session *registry) { int ret; unsigned int nb_fd = 0; @@ -3420,8 +3419,7 @@ static int create_channel_per_uid(struct ust_app *app, * ust app channel object with all streams and data object. */ ret = do_consumer_create_channel(usess, ua_sess, ua_chan, - app->bits_per_long, reg_uid->registry->reg.ust, - session->most_recent_chunk_id.value); + app->bits_per_long, reg_uid->registry->reg.ust); if (ret < 0) { ERR("Error creating UST channel \"%s\" on the consumer daemon", ua_chan->name); @@ -3535,8 +3533,7 @@ static int create_channel_per_pid(struct ust_app *app, /* Create and get channel on the consumer side. */ ret = do_consumer_create_channel(usess, ua_sess, ua_chan, - app->bits_per_long, registry, - session->most_recent_chunk_id.value); + app->bits_per_long, registry); if (ret < 0) { ERR("Error creating UST channel \"%s\" on the consumer daemon", ua_chan->name); @@ -3656,7 +3653,8 @@ error: */ static int ust_app_channel_allocate(struct ust_app_session *ua_sess, struct ltt_ust_channel *uchan, - enum lttng_ust_abi_chan_type type, struct ltt_ust_session *usess, + enum lttng_ust_abi_chan_type type, + struct ltt_ust_session *usess __attribute__((unused)), struct ust_app_channel **ua_chanp) { int ret = 0; @@ -3706,8 +3704,8 @@ error: * Called with ust app session mutex held. */ static -int create_ust_app_event(struct ust_app_session *ua_sess, - struct ust_app_channel *ua_chan, struct ltt_ust_event *uevent, +int create_ust_app_event(struct ust_app_channel *ua_chan, + struct ltt_ust_event *uevent, struct ust_app *app) { int ret = 0; @@ -3724,7 +3722,7 @@ int create_ust_app_event(struct ust_app_session *ua_sess, shadow_copy_event(ua_event, uevent); /* Create it on the tracer side */ - ret = create_ust_event(app, ua_sess, ua_chan, ua_event); + ret = create_ust_event(app, ua_chan, ua_event); if (ret < 0) { /* * Not found previously means that it does not exist on the @@ -4860,7 +4858,7 @@ int ust_app_disable_event_glb(struct ltt_ust_session *usess, continue; } - ret = disable_ust_app_event(ua_sess, ua_event, app); + ret = disable_ust_app_event(ua_event, app); if (ret < 0) { /* XXX: Report error someday... */ continue; @@ -5019,7 +5017,7 @@ int ust_app_enable_event_glb(struct ltt_ust_session *usess, goto next_app; } - ret = enable_ust_app_event(ua_sess, ua_event, app); + ret = enable_ust_app_event(ua_event, app); if (ret < 0) { pthread_mutex_unlock(&ua_sess->lock); goto error; @@ -5083,7 +5081,7 @@ int ust_app_create_event_glb(struct ltt_ust_session *usess, ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node); - ret = create_ust_app_event(ua_sess, ua_chan, uevent, app); + ret = create_ust_app_event(ua_chan, uevent, app); pthread_mutex_unlock(&ua_sess->lock); if (ret < 0) { if (ret != -LTTNG_UST_ERR_EXIST) { @@ -5779,7 +5777,7 @@ end: static int ust_app_channel_synchronize_event(struct ust_app_channel *ua_chan, - struct ltt_ust_event *uevent, struct ust_app_session *ua_sess, + struct ltt_ust_event *uevent, struct ust_app *app) { int ret = 0; @@ -5788,15 +5786,15 @@ int ust_app_channel_synchronize_event(struct ust_app_channel *ua_chan, ua_event = find_ust_app_event(ua_chan->events, uevent->attr.name, uevent->filter, uevent->attr.loglevel, uevent->exclusion); if (!ua_event) { - ret = create_ust_app_event(ua_sess, ua_chan, uevent, app); + ret = create_ust_app_event(ua_chan, uevent, app); if (ret < 0) { goto end; } } else { if (ua_event->enabled != uevent->enabled) { ret = uevent->enabled ? - enable_ust_app_event(ua_sess, ua_event, app) : - disable_ust_app_event(ua_sess, ua_event, app); + enable_ust_app_event(ua_event, app) : + disable_ust_app_event(ua_event, app); } } @@ -5999,7 +5997,7 @@ void ust_app_synchronize_all_channels(struct ltt_ust_session *usess, cds_lfht_for_each_entry(uchan->events->ht, &uevent_iter, uevent, node.node) { ret = ust_app_channel_synchronize_event(ua_chan, - uevent, ua_sess, app); + uevent, app); if (ret) { goto end; } @@ -7023,7 +7021,7 @@ void ust_app_destroy(struct ust_app *app) */ enum lttng_error_code ust_app_snapshot_record( const struct ltt_ust_session *usess, - const struct consumer_output *output, int wait, + const struct consumer_output *output, uint64_t nb_packets_per_stream) { int ret = 0; @@ -7083,8 +7081,7 @@ enum lttng_error_code ust_app_snapshot_record( buf_reg_chan, node.node) { status = consumer_snapshot_channel(socket, buf_reg_chan->consumer_key, - output, 0, usess->uid, - usess->gid, &trace_path[consumer_path_offset], wait, + output, 0, &trace_path[consumer_path_offset], nb_packets_per_stream); if (status != LTTNG_OK) { goto error; @@ -7092,8 +7089,7 @@ enum lttng_error_code ust_app_snapshot_record( } status = consumer_snapshot_channel(socket, reg->registry->reg.ust->metadata_key, output, 1, - usess->uid, usess->gid, &trace_path[consumer_path_offset], - wait, 0); + &trace_path[consumer_path_offset], 0); if (status != LTTNG_OK) { goto error; } @@ -7146,9 +7142,7 @@ enum lttng_error_code ust_app_snapshot_record( ua_chan, node.node) { status = consumer_snapshot_channel(socket, ua_chan->key, output, 0, - lttng_credentials_get_uid(&ua_sess->effective_credentials), - lttng_credentials_get_gid(&ua_sess->effective_credentials), - &trace_path[consumer_path_offset], wait, + &trace_path[consumer_path_offset], nb_packets_per_stream); switch (status) { case LTTNG_OK: @@ -7167,9 +7161,7 @@ enum lttng_error_code ust_app_snapshot_record( } status = consumer_snapshot_channel(socket, registry->metadata_key, output, 1, - lttng_credentials_get_uid(&ua_sess->effective_credentials), - lttng_credentials_get_gid(&ua_sess->effective_credentials), - &trace_path[consumer_path_offset], wait, 0); + &trace_path[consumer_path_offset], 0); switch (status) { case LTTNG_OK: break; @@ -7462,7 +7454,6 @@ enum lttng_error_code ust_app_rotate_session(struct ltt_session *session) buf_reg_chan, node.node) { ret = consumer_rotate_channel(socket, buf_reg_chan->consumer_key, - usess->uid, usess->gid, usess->consumer, /* is_metadata_channel */ false); if (ret < 0) { @@ -7488,7 +7479,6 @@ enum lttng_error_code ust_app_rotate_session(struct ltt_session *session) ret = consumer_rotate_channel(socket, reg->registry->reg.ust->metadata_key, - usess->uid, usess->gid, usess->consumer, /* is_metadata_channel */ true); if (ret < 0) { @@ -7532,8 +7522,6 @@ enum lttng_error_code ust_app_rotate_session(struct ltt_session *session) ua_chan, node.node) { ret = consumer_rotate_channel(socket, ua_chan->key, - lttng_credentials_get_uid(&ua_sess->effective_credentials), - lttng_credentials_get_gid(&ua_sess->effective_credentials), ua_sess->consumer, /* is_metadata_channel */ false); if (ret < 0) { @@ -7549,8 +7537,6 @@ enum lttng_error_code ust_app_rotate_session(struct ltt_session *session) (void) push_metadata(registry, usess->consumer); ret = consumer_rotate_channel(socket, registry->metadata_key, - lttng_credentials_get_uid(&ua_sess->effective_credentials), - lttng_credentials_get_gid(&ua_sess->effective_credentials), ua_sess->consumer, /* is_metadata_channel */ true); if (ret < 0) { diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index 0e2722e9e..8ad9085ff 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -374,7 +374,7 @@ ssize_t ust_app_push_metadata(struct ust_registry_session *registry, void ust_app_destroy(struct ust_app *app); enum lttng_error_code ust_app_snapshot_record( const struct ltt_ust_session *usess, - const struct consumer_output *output, int wait, + const struct consumer_output *output, uint64_t nb_packets_per_stream); uint64_t ust_app_get_size_one_more_packet_per_stream( const struct ltt_ust_session *usess, uint64_t cur_nr_packets); @@ -410,262 +410,352 @@ bool ust_app_supports_counters(const struct ust_app *app); #else /* HAVE_LIBLTTNG_UST_CTL */ static inline -int ust_app_destroy_trace_all(struct ltt_ust_session *usess) +int ust_app_destroy_trace_all( + struct ltt_ust_session *usess __attribute__((unused))) { return 0; } + static inline -int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) +int ust_app_start_trace( + struct ltt_ust_session *usess __attribute__((unused)), + struct ust_app *app __attribute__((unused))) { return 0; } + static inline -int ust_app_start_trace_all(struct ltt_ust_session *usess) +int ust_app_start_trace_all( + struct ltt_ust_session *usess __attribute__((unused))) { return 0; } + static inline -int ust_app_stop_trace_all(struct ltt_ust_session *usess) +int ust_app_stop_trace_all( + struct ltt_ust_session *usess __attribute__((unused))) { return 0; } + static inline -int ust_app_list_events(struct lttng_event **events) +int ust_app_list_events( + struct lttng_event **events __attribute__((unused))) { return -ENOSYS; } + static inline -int ust_app_list_event_fields(struct lttng_event_field **fields) +int ust_app_list_event_fields( + struct lttng_event_field **fields __attribute__((unused))) { return -ENOSYS; } + static inline -int ust_app_register(struct ust_register_msg *msg, int sock) +int ust_app_register( + struct ust_register_msg *msg __attribute__((unused)), + int sock __attribute__((unused))) { return -ENOSYS; } + static inline -int ust_app_register_done(struct ust_app *app) +int ust_app_register_done(struct ust_app *app __attribute__((unused))) { return -ENOSYS; } + static inline -int ust_app_version(struct ust_app *app) +int ust_app_version(struct ust_app *app __attribute__((unused))) { return -ENOSYS; } + static inline -void ust_app_unregister(int sock) +void ust_app_unregister(int sock __attribute__((unused))) { } + static inline void ust_app_clean_list(void) { } + static inline struct ust_app_list *ust_app_get_list(void) { return NULL; } + static inline -struct ust_app *ust_app_get_by_pid(pid_t pid) +struct ust_app *ust_app_get_by_pid(pid_t pid __attribute__((unused))) { return NULL; } + static inline int ust_app_ht_alloc(void) { return 0; } + static inline -void ust_app_global_update(struct ltt_ust_session *usess, struct ust_app *app) +void ust_app_global_update( + struct ltt_ust_session *usess __attribute__((unused)), + struct ust_app *app __attribute__((unused))) {} + static inline -void ust_app_global_update_event_notifier_rules(struct ust_app *app) +void ust_app_global_update_event_notifier_rules( + struct ust_app *app __attribute__((unused))) {} + static inline void ust_app_global_update_all_event_notifier_rules(void) {} + static inline -int ust_app_setup_event_notifier_group(struct ust_app *app) +int ust_app_setup_event_notifier_group( + struct ust_app *app __attribute__((unused))) { return 0; } + static inline -int ust_app_disable_channel_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan) +int ust_app_disable_channel_glb( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused))) { return 0; } + static inline -int ust_app_enable_channel_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan) +int ust_app_enable_channel_glb( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused))) { return 0; } + static inline -int ust_app_create_event_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent) +int ust_app_create_event_glb( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused)), + struct ltt_ust_event *uevent __attribute__((unused))) { return 0; } + static inline -int ust_app_disable_event_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent) +int ust_app_disable_event_glb( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused)), + struct ltt_ust_event *uevent __attribute__((unused))) { return 0; } + static inline -int ust_app_enable_event_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent) +int ust_app_enable_event_glb( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused)), + struct ltt_ust_event *uevent __attribute__((unused))) { return 0; } + static inline -int ust_app_add_ctx_channel_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan, struct ltt_ust_context *uctx) +int ust_app_add_ctx_channel_glb( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused)), + struct ltt_ust_context *uctx __attribute__((unused))) { return 0; } + static inline -int ust_app_enable_event_pid(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent, - pid_t pid) +int ust_app_enable_event_pid( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused)), + struct ltt_ust_event *uevent __attribute__((unused)), + pid_t pid __attribute__((unused))) { return 0; } + static inline -int ust_app_recv_registration(int sock, struct ust_register_msg *msg) +int ust_app_recv_registration( + int sock __attribute__((unused)), + struct ust_register_msg *msg __attribute__((unused))) { return 0; } + static inline -int ust_app_recv_notify(int sock) +int ust_app_recv_notify(int sock __attribute__((unused))) { return 0; } + static inline -struct ust_app *ust_app_create(struct ust_register_msg *msg, int sock) +struct ust_app *ust_app_create( + struct ust_register_msg *msg __attribute__((unused)), + int sock __attribute__((unused))) { return NULL; } + static inline -void ust_app_add(struct ust_app *app) +void ust_app_add(struct ust_app *app __attribute__((unused))) { } + static inline -void ust_app_notify_sock_unregister(int sock) +void ust_app_notify_sock_unregister(int sock __attribute__((unused))) { } + static inline -ssize_t ust_app_push_metadata(struct ust_registry_session *registry, - struct consumer_socket *socket, int send_zero_data) +ssize_t ust_app_push_metadata( + struct ust_registry_session *registry __attribute__((unused)), + struct consumer_socket *socket __attribute__((unused)), + int send_zero_data __attribute__((unused))) { return 0; } + static inline -void ust_app_destroy(struct ust_app *app) +void ust_app_destroy(struct ust_app *app __attribute__((unused))) { return; } + static inline -enum lttng_error_code ust_app_snapshot_record(struct ltt_ust_session *usess, - const struct consumer_output *output, int wait, uint64_t max_stream_size) +enum lttng_error_code ust_app_snapshot_record( + struct ltt_ust_session *usess __attribute__((unused)), + const struct consumer_output *output __attribute__((unused)), + uint64_t max_stream_size __attribute__((unused))) { return LTTNG_ERR_UNK; } + static inline -unsigned int ust_app_get_nb_stream(struct ltt_ust_session *usess) +unsigned int ust_app_get_nb_stream( + struct ltt_ust_session *usess __attribute__((unused))) { return 0; } + static inline void ust_app_update_event_notifier_error_count( - struct lttng_trigger *lttng_trigger) + struct lttng_trigger *lttng_trigger __attribute__((unused))) { return; } + static inline int ust_app_supported(void) { return 0; } + static inline -bool ust_app_supports_notifiers(const struct ust_app *app) +bool ust_app_supports_notifiers( + const struct ust_app *app __attribute__((unused))) { return false; } + static inline -bool ust_app_supports_counters(const struct ust_app *app) +bool ust_app_supports_counters( + const struct ust_app *app __attribute__((unused))) { return false; } + static inline -struct ust_app *ust_app_find_by_sock(int sock) +struct ust_app *ust_app_find_by_sock(int sock __attribute__((unused))) { return NULL; } + static inline -struct ust_app *ust_app_find_by_pid(pid_t pid) +struct ust_app *ust_app_find_by_pid(pid_t pid __attribute__((unused))) { return NULL; } + static inline uint64_t ust_app_get_size_one_more_packet_per_stream( - const struct ltt_ust_session *usess, uint64_t cur_nr_packets) { + const struct ltt_ust_session *usess __attribute__((unused)), + uint64_t cur_nr_packets __attribute__((unused))) { return 0; } + static inline -int ust_app_uid_get_channel_runtime_stats(uint64_t ust_session_id, - struct cds_list_head *buffer_reg_uid_list, - struct consumer_output *consumer, int overwrite, - uint64_t uchan_id, uint64_t *discarded, uint64_t *lost) +int ust_app_uid_get_channel_runtime_stats( + uint64_t ust_session_id __attribute__((unused)), + struct cds_list_head *buffer_reg_uid_list __attribute__((unused)), + struct consumer_output *consumer __attribute__((unused)), + int overwrite __attribute__((unused)), + uint64_t uchan_id __attribute__((unused)), + uint64_t *discarded __attribute__((unused)), + uint64_t *lost __attribute__((unused))) { return 0; } static inline -int ust_app_pid_get_channel_runtime_stats(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan, - struct consumer_output *consumer, - int overwrite, uint64_t *discarded, uint64_t *lost) +int ust_app_pid_get_channel_runtime_stats( + struct ltt_ust_session *usess __attribute__((unused)), + struct ltt_ust_channel *uchan __attribute__((unused)), + struct consumer_output *consumer __attribute__((unused)), + int overwrite __attribute__((unused)), + uint64_t *discarded __attribute__((unused)), + uint64_t *lost __attribute__((unused))) { return 0; } static inline -int ust_app_regenerate_statedump_all(struct ltt_ust_session *usess) +int ust_app_regenerate_statedump_all( + struct ltt_ust_session *usess __attribute__((unused))) { return 0; } static inline -enum lttng_error_code ust_app_rotate_session(struct ltt_session *session) +enum lttng_error_code ust_app_rotate_session( + struct ltt_session *session __attribute__((unused))) { return LTTNG_ERR_UNK; } static inline enum lttng_error_code ust_app_create_channel_subdirectories( - const struct ltt_ust_session *session) + const struct ltt_ust_session *session __attribute__((unused))) { return LTTNG_ERR_UNK; } static inline -int ust_app_release_object(struct ust_app *app, struct lttng_ust_abi_object_data *data) +int ust_app_release_object(struct ust_app *app __attribute__((unused)), + struct lttng_ust_abi_object_data *data __attribute__((unused))) { return 0; } static inline -enum lttng_error_code ust_app_clear_session(struct ltt_session *session) +enum lttng_error_code ust_app_clear_session( + struct ltt_session *session __attribute__((unused))) { return LTTNG_ERR_UNK; } static inline -enum lttng_error_code ust_app_open_packets(struct ltt_session *session) +enum lttng_error_code ust_app_open_packets( + struct ltt_session *session __attribute__((unused))) { return LTTNG_ERR_UNK; } diff --git a/src/bin/lttng-sessiond/ust-consumer.h b/src/bin/lttng-sessiond/ust-consumer.h index 4f9fca386..63d8eb25c 100644 --- a/src/bin/lttng-sessiond/ust-consumer.h +++ b/src/bin/lttng-sessiond/ust-consumer.h @@ -36,7 +36,8 @@ int ust_consumer_send_channel_to_ust(struct ust_app *app, int ust_consumer_metadata_request(struct consumer_socket *sock); #else static inline -int ust_consumer_metadata_request(struct consumer_socket *sock) +int ust_consumer_metadata_request( + struct consumer_socket *sock __attribute__((unused))) { return -ENOSYS; } diff --git a/src/bin/lttng-sessiond/ust-registry.h b/src/bin/lttng-sessiond/ust-registry.h index a25cdc70d..b77b1d8ae 100644 --- a/src/bin/lttng-sessiond/ust-registry.h +++ b/src/bin/lttng-sessiond/ust-registry.h @@ -319,101 +319,140 @@ struct ust_registry_enum * #else /* HAVE_LIBLTTNG_UST_CTL */ static inline -void ust_registry_channel_destroy(struct ust_registry_session *session, - struct ust_registry_channel *chan) +void ust_registry_channel_destroy( + struct ust_registry_session *session __attribute__((unused)), + struct ust_registry_channel *chan __attribute__((unused))) {} + static inline struct ust_registry_channel *ust_registry_channel_find( - struct ust_registry_session *session, uint64_t key) + struct ust_registry_session *session __attribute__((unused)), + uint64_t key __attribute__((unused))) { return NULL; } + static inline -int ust_registry_channel_add(struct ust_registry_session *session, - uint64_t key) +int ust_registry_channel_add( + struct ust_registry_session *session __attribute__((unused)), + uint64_t key __attribute__((unused))) { return 0; } + static inline -void ust_registry_channel_del_free(struct ust_registry_session *session, - uint64_t key, bool notif) +void ust_registry_channel_del_free( + struct ust_registry_session *session __attribute__((unused)), + uint64_t key __attribute__((unused)), + bool notif __attribute__((unused))) {} + static inline -int ust_registry_session_init(struct ust_registry_session **sessionp, - struct ust_app *app, - uint32_t bits_per_long, - uint32_t uint8_t_alignment, - uint32_t uint16_t_alignment, - uint32_t uint32_t_alignment, - uint32_t uint64_t_alignment, - uint32_t long_alignment, - int byte_order, - uint32_t major, - uint32_t minor, - const char *root_shm_path, - const char *shm_path, - uid_t euid, - gid_t egid, - uint64_t tracing_id, - uid_t tracing_uid) +int ust_registry_session_init( + struct ust_registry_session **sessionp __attribute__((unused)), + struct ust_app *app __attribute__((unused)), + uint32_t bits_per_long __attribute__((unused)), + uint32_t uint8_t_alignment __attribute__((unused)), + uint32_t uint16_t_alignment __attribute__((unused)), + uint32_t uint32_t_alignment __attribute__((unused)), + uint32_t uint64_t_alignment __attribute__((unused)), + uint32_t long_alignment __attribute__((unused)), + int byte_order __attribute__((unused)), + uint32_t major __attribute__((unused)), + uint32_t minor __attribute__((unused)), + const char *root_shm_path __attribute__((unused)), + const char *shm_path __attribute__((unused)), + uid_t euid __attribute__((unused)), + gid_t egid __attribute__((unused)), + uint64_t tracing_id __attribute__((unused)), + uid_t tracing_uid __attribute__((unused))) { return 0; } + static inline -void ust_registry_session_destroy(struct ust_registry_session *session) +void ust_registry_session_destroy( + struct ust_registry_session *session __attribute__((unused))) {} + static inline -int ust_registry_create_event(struct ust_registry_session *session, - uint64_t chan_key, int session_objd, int channel_objd, char *name, - char *sig, size_t nr_fields, struct lttng_ust_ctl_field *fields, - int loglevel_value, char *model_emf_uri, int buffer_type, - uint32_t *event_id_p) +int ust_registry_create_event( + struct ust_registry_session *session __attribute__((unused)), + uint64_t chan_key __attribute__((unused)), + int session_objd __attribute__((unused)), + int channel_objd __attribute__((unused)), + char *name __attribute__((unused)), + char *sig __attribute__((unused)), + size_t nr_fields __attribute__((unused)), + struct lttng_ust_ctl_field *fields __attribute__((unused)), + int loglevel_value __attribute__((unused)), + char *model_emf_uri __attribute__((unused)), + int buffer_type __attribute__((unused)), + uint32_t *event_id_p __attribute__((unused))) { return 0; } static inline struct ust_registry_event *ust_registry_find_event( - struct ust_registry_channel *chan, char *name, char *sig) + struct ust_registry_channel *chan __attribute__((unused)), + char *name __attribute__((unused)), + char *sig __attribute__((unused))) { return NULL; } + static inline -void ust_registry_destroy_event(struct ust_registry_channel *chan, - struct ust_registry_event *event) +void ust_registry_destroy_event( + struct ust_registry_channel *chan __attribute__((unused)), + struct ust_registry_event *event __attribute__((unused))) {} /* The app object can be NULL for registry shared across applications. */ static inline -int ust_metadata_session_statedump(struct ust_registry_session *session, - struct ust_app *app, uint32_t major, uint32_t minor) +int ust_metadata_session_statedump( + struct ust_registry_session *session __attribute__((unused)), + struct ust_app *app __attribute__((unused)), + uint32_t major __attribute__((unused)), + uint32_t minor __attribute__((unused))) { return 0; } + static inline -int ust_metadata_channel_statedump(struct ust_registry_session *session, - struct ust_registry_channel *chan) +int ust_metadata_channel_statedump( + struct ust_registry_session *session __attribute__((unused)), + struct ust_registry_channel *chan __attribute__((unused))) { return 0; } + static inline -int ust_metadata_event_statedump(struct ust_registry_session *session, - struct ust_registry_channel *chan, - struct ust_registry_event *event) +int ust_metadata_event_statedump( + struct ust_registry_session *session __attribute__((unused)), + struct ust_registry_channel *chan __attribute__((unused)), + struct ust_registry_event *event __attribute__((unused))) { return 0; } + static inline -int ust_registry_create_or_find_enum(struct ust_registry_session *session, - int session_objd, char *name, - struct lttng_ust_ctl_enum_entry *entries, size_t nr_entries, - uint64_t *enum_id) +int ust_registry_create_or_find_enum( + struct ust_registry_session *session __attribute__((unused)), + int session_objd __attribute__((unused)), + char *name __attribute__((unused)), + struct lttng_ust_ctl_enum_entry *entries __attribute__((unused)), + size_t nr_entries __attribute__((unused)), + uint64_t *enum_id __attribute__((unused))) { return 0; } + static inline struct ust_registry_enum * - ust_registry_lookup_enum_by_id(struct ust_registry_session *session, - const char *name, uint64_t id) + ust_registry_lookup_enum_by_id( + struct ust_registry_session *session __attribute__((unused)), + const char *name __attribute__((unused)), + uint64_t id __attribute__((unused))) { return NULL; } diff --git a/src/bin/lttng-sessiond/ust-sigbus.h b/src/bin/lttng-sessiond/ust-sigbus.h index 110ef7f75..5c1ff2e73 100644 --- a/src/bin/lttng-sessiond/ust-sigbus.h +++ b/src/bin/lttng-sessiond/ust-sigbus.h @@ -15,7 +15,7 @@ void lttng_ust_handle_sigbus(void *address); #else /* HAVE_LIBLTTNG_UST_CTL */ static inline -void lttng_ust_handle_sigbus(void *address) +void lttng_ust_handle_sigbus(void *address __attribute__((unused))) { } diff --git a/src/bin/lttng/commands/list_triggers.cpp b/src/bin/lttng/commands/list_triggers.cpp index 274bae47d..e6860380f 100644 --- a/src/bin/lttng/commands/list_triggers.cpp +++ b/src/bin/lttng/commands/list_triggers.cpp @@ -748,7 +748,6 @@ static void print_condition_event_rule_matches( } static void print_action_errors(const struct lttng_trigger *trigger, - const struct lttng_action *action, const uint64_t *action_path_indexes, size_t action_path_length) { @@ -963,7 +962,7 @@ void print_one_action(const struct lttng_trigger *trigger, } MSG(""); - print_action_errors(trigger, action, action_path_indexes, + print_action_errors(trigger, action_path_indexes, action_path_length); end: diff --git a/src/bin/lttng/commands/metadata.cpp b/src/bin/lttng/commands/metadata.cpp index 35aea004e..b68c22a07 100644 --- a/src/bin/lttng/commands/metadata.cpp +++ b/src/bin/lttng/commands/metadata.cpp @@ -66,7 +66,8 @@ static int count_arguments(const char **argv) return i; } -static int metadata_regenerate(int argc, const char **argv) +static int metadata_regenerate(int argc, + const char **argv __attribute__((unused))) { int ret; diff --git a/src/bin/lttng/commands/regenerate.cpp b/src/bin/lttng/commands/regenerate.cpp index 0e904f8ab..4ceb55424 100644 --- a/src/bin/lttng/commands/regenerate.cpp +++ b/src/bin/lttng/commands/regenerate.cpp @@ -68,7 +68,8 @@ static int count_arguments(const char **argv) return i; } -static int regenerate_metadata(int argc, const char **argv) +static int regenerate_metadata(int argc, + const char **argv __attribute__((unused))) { int ret; @@ -87,7 +88,8 @@ end: return ret; } -static int regenerate_statedump(int argc, const char **argv) +static int regenerate_statedump(int argc, + const char **argv __attribute__((unused))) { int ret; diff --git a/src/bin/lttng/commands/snapshot.cpp b/src/bin/lttng/commands/snapshot.cpp index 8e19fa3d8..4ae9ba1e9 100644 --- a/src/bin/lttng/commands/snapshot.cpp +++ b/src/bin/lttng/commands/snapshot.cpp @@ -384,7 +384,8 @@ end: return ret; } -static int cmd_list_output(int argc, const char **argv) +static int cmd_list_output(int argc __attribute__((unused)), + const char **argv __attribute__((unused))) { int ret; @@ -425,8 +426,8 @@ static int record(const char *url) } if (lttng_opt_mi) { - ret = mi_lttng_snapshot_record(writer, current_session_name, url, - opt_ctrl_url, opt_data_url); + ret = mi_lttng_snapshot_record(writer, url, opt_ctrl_url, + opt_data_url); if (ret) { ret = CMD_ERROR; } diff --git a/src/bin/lttng/commands/track-untrack.cpp b/src/bin/lttng/commands/track-untrack.cpp index 7547f8b5d..de377430c 100644 --- a/src/bin/lttng/commands/track-untrack.cpp +++ b/src/bin/lttng/commands/track-untrack.cpp @@ -566,7 +566,7 @@ end: static int cmd_track_untrack(enum cmd_type cmd_type, int argc, const char **argv, - const char *help_msg) + const char *help_msg __attribute__((unused))) { int opt, ret = 0; bool sub_command_failed = false; diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 4b9e313dc..9d3ca1294 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -252,7 +252,8 @@ BUILT_SOURCES += filter/filter-parser.hpp # Disable some warning flags for generated sources. FILTER_WARN_FLAGS = \ -Wno-null-dereference \ - -Wno-redundant-decls + -Wno-redundant-decls \ + -Wno-unused-parameter libfilter_la_CFLAGS = $(AM_CFLAGS) $(FILTER_WARN_FLAGS) libfilter_la_CXXFLAGS = -include filter-symbols.h $(AM_CXXFLAGS) $(FILTER_WARN_FLAGS) diff --git a/src/common/config/session-config.cpp b/src/common/config/session-config.cpp index 2d2f303f5..ef254d7cc 100644 --- a/src/common/config/session-config.cpp +++ b/src/common/config/session-config.cpp @@ -529,7 +529,7 @@ end: } static ATTR_FORMAT_PRINTF(2, 3) -void xml_error_handler(void *ctx, const char *format, ...) +void xml_error_handler(void *ctx __attribute__((unused)), const char *format, ...) { char *errMsg; va_list args; diff --git a/src/common/consumer/consumer-stream.cpp b/src/common/consumer/consumer-stream.cpp index c24ea6bca..ebbd66a8b 100644 --- a/src/common/consumer/consumer-stream.cpp +++ b/src/common/consumer/consumer-stream.cpp @@ -160,7 +160,7 @@ void ctf_packet_index_populate(struct ctf_packet_index *index, } static ssize_t consumer_stream_consume_mmap( - struct lttng_consumer_local_data *ctx, + struct lttng_consumer_local_data *ctx __attribute__((unused)), struct lttng_consumer_stream *stream, const struct stream_subbuffer *subbuffer) { @@ -231,7 +231,7 @@ static ssize_t consumer_stream_consume_splice( static int consumer_stream_send_index( struct lttng_consumer_stream *stream, const struct stream_subbuffer *subbuffer, - struct lttng_consumer_local_data *ctx) + struct lttng_consumer_local_data *ctx __attribute__((unused))) { off_t packet_offset = 0; struct ctf_packet_index index = {}; @@ -591,8 +591,8 @@ end: */ static int post_consume_open_new_packet(struct lttng_consumer_stream *stream, - const struct stream_subbuffer *subbuffer, - struct lttng_consumer_local_data *ctx) + const struct stream_subbuffer *subbuffer __attribute__((unused)), + struct lttng_consumer_local_data *ctx __attribute__((unused))) { int ret = 0; @@ -1274,7 +1274,7 @@ end: } static ssize_t metadata_bucket_consume( - struct lttng_consumer_local_data *unused, + struct lttng_consumer_local_data *unused __attribute__((unused)), struct lttng_consumer_stream *stream, const struct stream_subbuffer *subbuffer) { diff --git a/src/common/consumer/consumer.cpp b/src/common/consumer/consumer.cpp index 6166df4ed..f26ccd71a 100644 --- a/src/common/consumer/consumer.cpp +++ b/src/common/consumer/consumer.cpp @@ -3404,7 +3404,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, */ if (stream->rotate_ready) { DBG("Rotate stream before consuming data"); - ret = lttng_consumer_rotate_stream(ctx, stream); + ret = lttng_consumer_rotate_stream(stream); if (ret < 0) { ERR("Stream rotation error before consuming data"); goto end; @@ -3460,7 +3460,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, */ rotation_ret = lttng_consumer_stream_is_rotate_ready(stream); if (rotation_ret == 1) { - rotation_ret = lttng_consumer_rotate_stream(ctx, stream); + rotation_ret = lttng_consumer_rotate_stream(stream); if (rotation_ret < 0) { ret = rotation_ret; ERR("Stream rotation error after consuming data"); @@ -3986,8 +3986,7 @@ end: * Returns 0 on success, < 0 on error */ int lttng_consumer_rotate_channel(struct lttng_consumer_channel *channel, - uint64_t key, uint64_t relayd_id, uint32_t metadata, - struct lttng_consumer_local_data *ctx) + uint64_t key, uint64_t relayd_id) { int ret; struct lttng_consumer_stream *stream; @@ -4537,8 +4536,7 @@ void lttng_consumer_reset_stream_rotate_state(struct lttng_consumer_stream *stre * Perform the rotation a local stream file. */ static -int rotate_local_stream(struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *stream) +int rotate_local_stream(struct lttng_consumer_stream *stream) { int ret = 0; @@ -4577,8 +4575,7 @@ end: * * Return 0 on success, a negative number of error. */ -int lttng_consumer_rotate_stream(struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *stream) +int lttng_consumer_rotate_stream(struct lttng_consumer_stream *stream) { int ret; @@ -4613,7 +4610,7 @@ int lttng_consumer_rotate_stream(struct lttng_consumer_local_data *ctx, } if (stream->net_seq_idx == (uint64_t) -1ULL) { - ret = rotate_local_stream(ctx, stream); + ret = rotate_local_stream(stream); if (ret < 0) { ERR("Failed to rotate stream, ret = %i", ret); goto error; @@ -4657,7 +4654,7 @@ error: * Returns 0 on success, < 0 on error */ int lttng_consumer_rotate_ready_streams(struct lttng_consumer_channel *channel, - uint64_t key, struct lttng_consumer_local_data *ctx) + uint64_t key) { int ret; struct lttng_consumer_stream *stream; @@ -4686,7 +4683,7 @@ int lttng_consumer_rotate_ready_streams(struct lttng_consumer_channel *channel, } DBG("Consumer rotate ready stream %" PRIu64, stream->key); - ret = lttng_consumer_rotate_stream(ctx, stream); + ret = lttng_consumer_rotate_stream(stream); pthread_mutex_unlock(&stream->lock); pthread_mutex_unlock(&stream->chan->lock); if (ret) { diff --git a/src/common/consumer/consumer.h b/src/common/consumer/consumer.h index 4bcd779f9..1c6eeb39a 100644 --- a/src/common/consumer/consumer.h +++ b/src/common/consumer/consumer.h @@ -1051,13 +1051,11 @@ void consumer_add_metadata_stream(struct lttng_consumer_stream *stream); void consumer_del_stream_for_metadata(struct lttng_consumer_stream *stream); int consumer_create_index_file(struct lttng_consumer_stream *stream); int lttng_consumer_rotate_channel(struct lttng_consumer_channel *channel, - uint64_t key, uint64_t relayd_id, uint32_t metadata, - struct lttng_consumer_local_data *ctx); + uint64_t key, uint64_t relayd_id); int lttng_consumer_stream_is_rotate_ready(struct lttng_consumer_stream *stream); -int lttng_consumer_rotate_stream(struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *stream); +int lttng_consumer_rotate_stream(struct lttng_consumer_stream *stream); int lttng_consumer_rotate_ready_streams(struct lttng_consumer_channel *channel, - uint64_t key, struct lttng_consumer_local_data *ctx); + uint64_t key); void lttng_consumer_reset_stream_rotate_state(struct lttng_consumer_stream *stream); enum lttcomm_return_code lttng_consumer_create_trace_chunk( const uint64_t *relayd_id, uint64_t session_id, diff --git a/src/common/event-rule/jul-logging.cpp b/src/common/event-rule/jul-logging.cpp index 77ae3800c..319a904a2 100644 --- a/src/common/event-rule/jul-logging.cpp +++ b/src/common/event-rule/jul-logging.cpp @@ -376,7 +376,7 @@ lttng_event_rule_jul_logging_get_internal_filter_bytecode( static enum lttng_event_rule_generate_exclusions_status lttng_event_rule_jul_logging_generate_exclusions( - const struct lttng_event_rule *rule, + const struct lttng_event_rule *rule __attribute__((unused)), struct lttng_event_exclusion **_exclusions) { /* Unsupported. */ @@ -850,7 +850,8 @@ end: return status; } -static bool log_level_rule_valid(const struct lttng_log_level_rule *rule) +static bool log_level_rule_valid( + const struct lttng_log_level_rule *rule __attribute__((unused))) { /* * For both JUL and LOG4J custom log level are possible and can diff --git a/src/common/event-rule/kernel-kprobe.cpp b/src/common/event-rule/kernel-kprobe.cpp index d33d44605..da87fd2b9 100644 --- a/src/common/event-rule/kernel-kprobe.cpp +++ b/src/common/event-rule/kernel-kprobe.cpp @@ -150,29 +150,31 @@ end: } static enum lttng_error_code lttng_event_rule_kernel_kprobe_generate_filter_bytecode( - struct lttng_event_rule *rule, - const struct lttng_credentials *creds) + struct lttng_event_rule *rule __attribute__((unused)), + const struct lttng_credentials *creds __attribute__((unused))) { /* Nothing to do. */ return LTTNG_OK; } static const char *lttng_event_rule_kernel_kprobe_get_filter( - const struct lttng_event_rule *rule) + const struct lttng_event_rule *rule __attribute__((unused))) { /* Not supported. */ return NULL; } static const struct lttng_bytecode * -lttng_event_rule_kernel_kprobe_get_filter_bytecode(const struct lttng_event_rule *rule) +lttng_event_rule_kernel_kprobe_get_filter_bytecode( + const struct lttng_event_rule *rule __attribute__((unused))) { /* Not supported. */ return NULL; } static enum lttng_event_rule_generate_exclusions_status -lttng_event_rule_kernel_kprobe_generate_exclusions(const struct lttng_event_rule *rule, +lttng_event_rule_kernel_kprobe_generate_exclusions( + const struct lttng_event_rule *rule __attribute__((unused)), struct lttng_event_exclusion **exclusions) { /* Not supported. */ diff --git a/src/common/event-rule/kernel-syscall.cpp b/src/common/event-rule/kernel-syscall.cpp index 3f8e64ed8..64ebe47fd 100644 --- a/src/common/event-rule/kernel-syscall.cpp +++ b/src/common/event-rule/kernel-syscall.cpp @@ -220,7 +220,8 @@ lttng_event_rule_kernel_syscall_get_internal_filter_bytecode( } static enum lttng_event_rule_generate_exclusions_status -lttng_event_rule_kernel_syscall_generate_exclusions(const struct lttng_event_rule *rule, +lttng_event_rule_kernel_syscall_generate_exclusions( + const struct lttng_event_rule *rule __attribute__((unused)), struct lttng_event_exclusion **exclusions) { /* Unsupported. */ diff --git a/src/common/event-rule/kernel-tracepoint.cpp b/src/common/event-rule/kernel-tracepoint.cpp index cff3048f3..1b7fbe2a2 100644 --- a/src/common/event-rule/kernel-tracepoint.cpp +++ b/src/common/event-rule/kernel-tracepoint.cpp @@ -240,7 +240,7 @@ lttng_event_rule_kernel_tracepoint_get_internal_filter_bytecode( static enum lttng_event_rule_generate_exclusions_status lttng_event_rule_kernel_tracepoint_generate_exclusions( - const struct lttng_event_rule *rule, + const struct lttng_event_rule *rule __attribute__((unused)), struct lttng_event_exclusion **_exclusions) { /* Unsupported. */ diff --git a/src/common/event-rule/kernel-uprobe.cpp b/src/common/event-rule/kernel-uprobe.cpp index d53958df6..fe84f7cda 100644 --- a/src/common/event-rule/kernel-uprobe.cpp +++ b/src/common/event-rule/kernel-uprobe.cpp @@ -141,29 +141,31 @@ end: } static enum lttng_error_code lttng_event_rule_kernel_uprobe_generate_filter_bytecode( - struct lttng_event_rule *rule, - const struct lttng_credentials *creds) + struct lttng_event_rule *rule __attribute__((unused)), + const struct lttng_credentials *creds __attribute__((unused))) { /* Nothing to do. */ return LTTNG_OK; } static const char *lttng_event_rule_kernel_uprobe_get_filter( - const struct lttng_event_rule *rule) + const struct lttng_event_rule *rule __attribute__((unused))) { /* Unsupported. */ return NULL; } static const struct lttng_bytecode * -lttng_event_rule_kernel_uprobe_get_filter_bytecode(const struct lttng_event_rule *rule) +lttng_event_rule_kernel_uprobe_get_filter_bytecode( + const struct lttng_event_rule *rule __attribute__((unused))) { /* Unsupported. */ return NULL; } static enum lttng_event_rule_generate_exclusions_status -lttng_event_rule_kernel_uprobe_generate_exclusions(const struct lttng_event_rule *rule, +lttng_event_rule_kernel_uprobe_generate_exclusions( + const struct lttng_event_rule *rule __attribute__((unused)), struct lttng_event_exclusion **exclusions) { /* Unsupported. */ diff --git a/src/common/event-rule/log4j-logging.cpp b/src/common/event-rule/log4j-logging.cpp index 25f2c4c0e..0bef6efab 100644 --- a/src/common/event-rule/log4j-logging.cpp +++ b/src/common/event-rule/log4j-logging.cpp @@ -376,7 +376,7 @@ lttng_event_rule_log4j_logging_get_internal_filter_bytecode( static enum lttng_event_rule_generate_exclusions_status lttng_event_rule_log4j_logging_generate_exclusions( - const struct lttng_event_rule *rule, + const struct lttng_event_rule *rule __attribute__((unused)), struct lttng_event_exclusion **_exclusions) { /* Unsupported. */ @@ -849,7 +849,8 @@ end: return status; } -static bool log_level_rule_valid(const struct lttng_log_level_rule *rule) +static bool log_level_rule_valid( + const struct lttng_log_level_rule *rule __attribute__((unused))) { /* * For both LOG4J custom log level are possible and can diff --git a/src/common/event-rule/python-logging.cpp b/src/common/event-rule/python-logging.cpp index 1ccd495cd..4389c8aaf 100644 --- a/src/common/event-rule/python-logging.cpp +++ b/src/common/event-rule/python-logging.cpp @@ -376,7 +376,7 @@ lttng_event_rule_python_logging_get_internal_filter_bytecode( static enum lttng_event_rule_generate_exclusions_status lttng_event_rule_python_logging_generate_exclusions( - const struct lttng_event_rule *rule, + const struct lttng_event_rule *rule __attribute__((unused)), struct lttng_event_exclusion **_exclusions) { /* Unsupported. */ @@ -849,7 +849,8 @@ end: return status; } -static bool log_level_rule_valid(const struct lttng_log_level_rule *rule) +static bool log_level_rule_valid( + const struct lttng_log_level_rule *rule __attribute__((unused))) { /* * For python, custom log level are possible, it is not clear if diff --git a/src/common/fd-tracker/utils-poll.cpp b/src/common/fd-tracker/utils-poll.cpp index 6a0f2d9bd..b1370c55d 100644 --- a/src/common/fd-tracker/utils-poll.cpp +++ b/src/common/fd-tracker/utils-poll.cpp @@ -32,7 +32,7 @@ end: return ret; } -static int close_epoll(void *data, int *in_fd) +static int close_epoll(void *data, int *in_fd __attribute__((unused))) { /* Will close the epfd. */ lttng_poll_clean((struct lttng_poll_event *) data); diff --git a/src/common/fd-tracker/utils.cpp b/src/common/fd-tracker/utils.cpp index dfe2e188b..7690fe463 100644 --- a/src/common/fd-tracker/utils.cpp +++ b/src/common/fd-tracker/utils.cpp @@ -14,20 +14,20 @@ #include static -int open_pipe_cloexec(void *data, int *fds) +int open_pipe_cloexec(void *data __attribute__((unused)), int *fds) { return utils_create_pipe_cloexec(fds); } static -int close_pipe(void *data, int *pipe) +int close_pipe(void *data __attribute__((unused)), int *pipe) { utils_close_pipe(pipe); pipe[0] = pipe[1] = -1; return 0; } -int fd_tracker_util_close_fd(void *unused, int *fd) +int fd_tracker_util_close_fd(void *unused __attribute__((unused)), int *fd) { return close(*fd); } @@ -111,7 +111,7 @@ end: #ifdef HAVE_DIRFD static -int fd_close(void *unused, int *in_fds) +int fd_close(void *unused __attribute__((unused)), int *in_fds) { const int ret = close(in_fds[0]); diff --git a/src/common/kernel-consumer/kernel-consumer.cpp b/src/common/kernel-consumer/kernel-consumer.cpp index 42242ad12..fa3e8a553 100644 --- a/src/common/kernel-consumer/kernel-consumer.cpp +++ b/src/common/kernel-consumer/kernel-consumer.cpp @@ -145,8 +145,7 @@ error: static int lttng_kconsumer_snapshot_channel( struct lttng_consumer_channel *channel, uint64_t key, char *path, uint64_t relayd_id, - uint64_t nb_packets_per_stream, - struct lttng_consumer_local_data *ctx) + uint64_t nb_packets_per_stream) { int ret; struct lttng_consumer_stream *stream; @@ -989,8 +988,7 @@ error_streams_sent_nosignal: msg.u.snapshot_channel.pathname, msg.u.snapshot_channel.relayd_id, msg.u.snapshot_channel - .nb_packets_per_stream, - ctx); + .nb_packets_per_stream); if (ret_snapshot < 0) { ERR("Snapshot channel failed"); ret_code = LTTCOMM_CONSUMERD_SNAPSHOT_FAILED; @@ -1184,8 +1182,7 @@ end_destroy_channel: ret_rotate_channel = lttng_consumer_rotate_channel( channel, key, - msg.u.rotate_channel.relayd_id, - msg.u.rotate_channel.metadata, ctx); + msg.u.rotate_channel.relayd_id); if (ret_rotate_channel < 0) { ERR("Rotate channel failed"); ret_code = LTTCOMM_CONSUMERD_ROTATION_FAIL; @@ -1204,7 +1201,7 @@ end_destroy_channel: int ret_rotate; ret_rotate = lttng_consumer_rotate_ready_streams( - channel, key, ctx); + channel, key); if (ret_rotate < 0) { ERR("Rotate ready streams failed"); } @@ -1734,7 +1731,7 @@ end: static int put_next_subbuffer(struct lttng_consumer_stream *stream, - struct stream_subbuffer *subbuffer) + struct stream_subbuffer *subbuffer __attribute__((unused))) { const int ret = kernctl_put_next_subbuf(stream->wait_fd); @@ -1766,7 +1763,7 @@ bool is_get_next_check_metadata_available(int tracer_fd) static int signal_metadata(struct lttng_consumer_stream *stream, - struct lttng_consumer_local_data *ctx) + struct lttng_consumer_local_data *ctx __attribute__((unused))) { ASSERT_LOCKED(stream->metadata_rdv_lock); return pthread_cond_broadcast(&stream->metadata_rdv) ? -errno : 0; diff --git a/src/common/mi-lttng.cpp b/src/common/mi-lttng.cpp index 10201d873..94963b222 100644 --- a/src/common/mi-lttng.cpp +++ b/src/common/mi-lttng.cpp @@ -2367,8 +2367,7 @@ end: return ret; } -int mi_lttng_snapshot_record(struct mi_writer *writer, - const char *current_session_name, const char *url, +int mi_lttng_snapshot_record(struct mi_writer *writer, const char *url, const char *cmdline_ctrl_url, const char *cmdline_data_url) { int ret; diff --git a/src/common/mi-lttng.h b/src/common/mi-lttng.h index fa82834dc..78e04199a 100644 --- a/src/common/mi-lttng.h +++ b/src/common/mi-lttng.h @@ -1042,15 +1042,12 @@ int mi_lttng_snapshot_add_output(struct mi_writer *writer, * * writer An instance of a machine interface writer. * - * current_session_name: Snapshot record for session "current_session_name". - * * ctrl_url, data_url: Destination of the output receive from the command-line. * * Returns zero if the element's value could be written. * Negative values indicate an error. */ -int mi_lttng_snapshot_record(struct mi_writer *writer, - const char *current_session_name, const char *url, +int mi_lttng_snapshot_record(struct mi_writer *writer, const char *url, const char *cmdline_ctrl_url, const char *cmdline_data_url); /* diff --git a/src/common/runas.cpp b/src/common/runas.cpp index a87eb13cf..ee3451321 100644 --- a/src/common/runas.cpp +++ b/src/common/runas.cpp @@ -1344,7 +1344,7 @@ end: static int run_as_noworker(enum run_as_cmd cmd, struct run_as_data *data, struct run_as_ret *ret_value, - uid_t uid, gid_t gid) + uid_t uid __attribute__((unused)), gid_t gid __attribute__((unused))) { int ret, saved_errno; mode_t old_mask; diff --git a/src/common/trace-chunk.cpp b/src/common/trace-chunk.cpp index 9e804ce01..ecf8ea803 100644 --- a/src/common/trace-chunk.cpp +++ b/src/common/trace-chunk.cpp @@ -238,7 +238,7 @@ int fs_handle_untracked_get_fd(struct fs_handle *_handle) } static -void fs_handle_untracked_put_fd(struct fs_handle *_handle) +void fs_handle_untracked_put_fd(struct fs_handle *_handle __attribute__((unused))) { /* no-op. */ } @@ -1639,7 +1639,7 @@ end: } static -int lttng_trace_chunk_no_operation(struct lttng_trace_chunk *trace_chunk) +int lttng_trace_chunk_no_operation(struct lttng_trace_chunk *trace_chunk __attribute__((unused))) { return 0; } diff --git a/src/common/ust-consumer/ust-consumer.cpp b/src/common/ust-consumer/ust-consumer.cpp index 1740bbe71..aeafae642 100644 --- a/src/common/ust-consumer/ust-consumer.cpp +++ b/src/common/ust-consumer/ust-consumer.cpp @@ -2065,8 +2065,7 @@ error_push_metadata_fatal: */ rotate_channel = lttng_consumer_rotate_channel( found_channel, key, - msg.u.rotate_channel.relayd_id, - msg.u.rotate_channel.metadata, ctx); + msg.u.rotate_channel.relayd_id); if (rotate_channel < 0) { ERR("Rotate channel failed"); ret_code = LTTCOMM_CONSUMERD_ROTATION_FAIL; @@ -2093,8 +2092,7 @@ error_push_metadata_fatal: ret_rotate_read_streams = lttng_consumer_rotate_ready_streams( - found_channel, key, - ctx); + found_channel, key); if (ret_rotate_read_streams < 0) { ERR("Rotate channel failed"); } @@ -3069,7 +3067,7 @@ end: } static int put_next_subbuffer(struct lttng_consumer_stream *stream, - struct stream_subbuffer *subbuffer) + struct stream_subbuffer *subbuffer __attribute__((unused))) { const int ret = lttng_ust_ctl_put_next_subbuf(stream->ustream); @@ -3078,7 +3076,7 @@ static int put_next_subbuffer(struct lttng_consumer_stream *stream, } static int signal_metadata(struct lttng_consumer_stream *stream, - struct lttng_consumer_local_data *ctx) + struct lttng_consumer_local_data *ctx __attribute__((unused))) { ASSERT_LOCKED(stream->metadata_rdv_lock); return pthread_cond_broadcast(&stream->metadata_rdv) ? -errno : 0; diff --git a/src/common/ust-consumer/ust-consumer.h b/src/common/ust-consumer/ust-consumer.h index e481f0850..e6590c33c 100644 --- a/src/common/ust-consumer/ust-consumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -68,174 +68,219 @@ void lttng_ustconsumer_sigbus_handle(void *addr); static inline ssize_t lttng_ustconsumer_on_read_subbuffer_mmap( - struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *stream, unsigned long len, - unsigned long padding) + struct lttng_consumer_local_data *ctx __attribute__((unused)), + struct lttng_consumer_stream *stream __attribute__((unused)), + unsigned long len __attribute__((unused)), + unsigned long padding __attribute__((unused))) { return -ENOSYS; } static inline ssize_t lttng_ustconsumer_on_read_subbuffer_splice( - struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *uststream, unsigned long len, - unsigned long padding) + struct lttng_consumer_local_data *ctx __attribute__((unused)), + struct lttng_consumer_stream *uststream __attribute__((unused)), + unsigned long len __attribute__((unused)), + unsigned long padding __attribute__((unused))) { return -ENOSYS; } static inline -int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream) +int lttng_ustconsumer_take_snapshot( + struct lttng_consumer_stream *stream __attribute__((unused))) { return -ENOSYS; } static inline int lttng_ustconsumer_sample_snapshot_positions( - struct lttng_consumer_stream *stream) + struct lttng_consumer_stream *stream __attribute__((unused))) { return -ENOSYS; } static inline int lttng_ustconsumer_get_produced_snapshot( - struct lttng_consumer_stream *stream, unsigned long *pos) + struct lttng_consumer_stream *stream __attribute__((unused)), + unsigned long *pos __attribute__((unused))) { return -ENOSYS; } static inline int lttng_ustconsumer_get_consumed_snapshot( - struct lttng_consumer_stream *stream, unsigned long *pos) + struct lttng_consumer_stream *stream __attribute__((unused)), + unsigned long *pos __attribute__((unused))) { return -ENOSYS; } static inline -int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, - int sock, struct pollfd *consumer_sockpoll) +int lttng_ustconsumer_recv_cmd( + struct lttng_consumer_local_data *ctx __attribute__((unused)), + int sock __attribute__((unused)), + struct pollfd *consumer_sockpoll __attribute__((unused))) { return -ENOSYS; } static inline -int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan) +int lttng_ustconsumer_allocate_channel( + struct lttng_consumer_channel *chan __attribute__((unused))) { return -ENOSYS; } static inline -void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan) +void lttng_ustconsumer_del_channel( + struct lttng_consumer_channel *chan __attribute__((unused))) { } static inline -void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan) +void lttng_ustconsumer_free_channel( + struct lttng_consumer_channel *chan __attribute__((unused))) { } static inline -int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream) +int lttng_ustconsumer_add_stream( + struct lttng_consumer_stream *stream __attribute__((unused))) { return -ENOSYS; } static inline -void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream) +void lttng_ustconsumer_del_stream( + struct lttng_consumer_stream *stream __attribute__((unused))) { } static inline -int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream, - struct lttng_consumer_local_data *ctx) +int lttng_ustconsumer_read_subbuffer( + struct lttng_consumer_stream *stream __attribute__((unused)), + struct lttng_consumer_local_data *ctx __attribute__((unused))) { return -ENOSYS; } static inline -int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream) +int lttng_ustconsumer_on_recv_stream( + struct lttng_consumer_stream *stream __attribute__((unused))) { return -ENOSYS; } static inline -void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream) +void lttng_ustconsumer_on_stream_hangup( + struct lttng_consumer_stream *stream __attribute__((unused))) { } static inline -int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream) +int lttng_ustconsumer_data_pending( + struct lttng_consumer_stream *stream __attribute__((unused))) { return -ENOSYS; } + static inline -int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream, - int producer_active) +int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream __attribute__((unused)), + int producer_active __attribute__((unused))) { return -ENOSYS; } + static inline -void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht) +void lttng_ustconsumer_close_all_metadata( + struct lttng_ht *ht __attribute__((unused))) { } + static inline -void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata) +void lttng_ustconsumer_close_metadata( + struct lttng_consumer_channel *metadata __attribute__((unused))) { } static inline -void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream) +void lttng_ustconsumer_close_stream_wakeup( + struct lttng_consumer_stream *stream __attribute__((unused))) { } + static inline -int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, - uint64_t len, uint64_t version, - struct lttng_consumer_channel *channel, int timer) +int lttng_ustconsumer_recv_metadata(int sock __attribute__((unused)), + uint64_t key __attribute__((unused)), + uint64_t offset __attribute__((unused)), + uint64_t len __attribute__((unused)), + uint64_t version __attribute__((unused)), + struct lttng_consumer_channel *channel __attribute__((unused)), + int timer __attribute__((unused))) { return -ENOSYS; } + static inline -int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx, - struct lttng_consumer_channel *channel, int timer, int wait) +int lttng_ustconsumer_request_metadata( + struct lttng_consumer_local_data *ctx __attribute__((unused)), + struct lttng_consumer_channel *channel __attribute__((unused)), + int timer __attribute__((unused)), + int wait __attribute__((unused))) { return -ENOSYS; } + static inline -enum sync_metadata_status lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *metadata) +enum sync_metadata_status lttng_ustconsumer_sync_metadata( + struct lttng_consumer_local_data *ctx __attribute__((unused)), + struct lttng_consumer_stream *metadata __attribute__((unused))) { return SYNC_METADATA_STATUS_ERROR; } + static inline -int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream, - int producer) +int lttng_ustconsumer_flush_buffer( + struct lttng_consumer_stream *stream __attribute__((unused)), + int producer __attribute__((unused))) { return -ENOSYS; } + static inline -int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream) +int lttng_ustconsumer_clear_buffer( + struct lttng_consumer_stream *stream __attribute__((unused))) { return -ENOSYS; } + static inline int lttng_ustconsumer_get_current_timestamp( - struct lttng_consumer_stream *stream, uint64_t *ts) + struct lttng_consumer_stream *stream __attribute__((unused)), + uint64_t *ts __attribute__((unused))) { return -ENOSYS; } + static inline int lttng_ustconsumer_get_sequence_number( - struct lttng_consumer_stream *stream, uint64_t *seq) + struct lttng_consumer_stream *stream __attribute__((unused)), + uint64_t *seq __attribute__((unused))) { return -ENOSYS; } + static inline -int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, - uint64_t *stream_id) +int lttng_ustconsumer_get_stream_id( + struct lttng_consumer_stream *stream __attribute__((unused)), + uint64_t *stream_id __attribute__((unused))) { return -ENOSYS; } + static inline -void lttng_ustconsumer_sigbus_handle(void *addr) +void lttng_ustconsumer_sigbus_handle( + void *addr __attribute__((unused))) { } #endif /* HAVE_LIBLTTNG_UST_CTL */ diff --git a/src/lib/lttng-ctl/lttng-ctl-helper.h b/src/lib/lttng-ctl/lttng-ctl-helper.h index 64e659dca..b10acd5fe 100644 --- a/src/lib/lttng-ctl/lttng-ctl-helper.h +++ b/src/lib/lttng-ctl/lttng-ctl-helper.h @@ -57,7 +57,7 @@ static inline int lttng_ctl_ask_sessiond_varlen_no_cmd_header( */ static inline int lttng_ctl_ask_sessiond_fds_no_cmd_header(struct lttcomm_session_msg *lsm, - const int *fds, size_t nb_fd, void **buf) + const int *fds, size_t nb_fd, void **buf __attribute__((unused))) { return lttng_ctl_ask_sessiond_fds_varlen(lsm, fds, nb_fd, NULL, 0, NULL, NULL, NULL); diff --git a/src/lib/lttng-ctl/lttng-ctl.cpp b/src/lib/lttng-ctl/lttng-ctl.cpp index f99ce672c..0da8f6ad1 100644 --- a/src/lib/lttng-ctl/lttng-ctl.cpp +++ b/src/lib/lttng-ctl/lttng-ctl.cpp @@ -911,7 +911,8 @@ int lttng_stop_tracing_no_wait(const char *session_name) * Returns the size of the returned payload data or a negative error code. */ int lttng_add_context(struct lttng_handle *handle, - struct lttng_event_context *ctx, const char *event_name, + struct lttng_event_context *ctx, + const char *event_name __attribute__((unused)), const char *channel_name) { int ret; @@ -2520,8 +2521,8 @@ end: return ret; } -int lttng_calibrate(struct lttng_handle *handle, - struct lttng_calibrate *calibrate) +int lttng_calibrate(struct lttng_handle *handle __attribute__((unused)), + struct lttng_calibrate *calibrate __attribute__((unused))) { /* * This command was removed in LTTng 2.9. @@ -2827,7 +2828,7 @@ error: */ extern "C" LTTNG_EXPORT int lttng_enable_consumer(struct lttng_handle *handle); -int lttng_enable_consumer(struct lttng_handle *handle) +int lttng_enable_consumer(struct lttng_handle *handle __attribute__((unused))) { return -ENOSYS; } @@ -2837,7 +2838,7 @@ int lttng_enable_consumer(struct lttng_handle *handle) */ extern "C" LTTNG_EXPORT int lttng_disable_consumer(struct lttng_handle *handle); -int lttng_disable_consumer(struct lttng_handle *handle) +int lttng_disable_consumer(struct lttng_handle *handle __attribute__((unused))) { return -ENOSYS; } @@ -2848,8 +2849,9 @@ int lttng_disable_consumer(struct lttng_handle *handle) extern "C" LTTNG_EXPORT int _lttng_create_session_ext(const char *name, const char *url, const char *datetime); -int _lttng_create_session_ext(const char *name, const char *url, - const char *datetime) +int _lttng_create_session_ext(const char *name __attribute__((unused)), + const char *url __attribute__((unused)), + const char *datetime __attribute__((unused))) { return -ENOSYS; } diff --git a/src/lib/lttng-ctl/rotate.cpp b/src/lib/lttng-ctl/rotate.cpp index 6a003a18e..ed198922e 100644 --- a/src/lib/lttng-ctl/rotate.cpp +++ b/src/lib/lttng-ctl/rotate.cpp @@ -196,7 +196,7 @@ end: * Return 0 on success else a negative LTTng error code. */ int lttng_rotate_session(const char *session_name, - struct lttng_rotation_immediate_descriptor *descriptor, + struct lttng_rotation_immediate_descriptor *descriptor __attribute__((unused)), struct lttng_rotation_handle **rotation_handle) { struct lttcomm_session_msg lsm; diff --git a/src/lib/lttng-ctl/snapshot.cpp b/src/lib/lttng-ctl/snapshot.cpp index 543861d67..b50403512 100644 --- a/src/lib/lttng-ctl/snapshot.cpp +++ b/src/lib/lttng-ctl/snapshot.cpp @@ -196,7 +196,8 @@ void lttng_snapshot_output_list_destroy(struct lttng_snapshot_output_list *list) * Return 0 on success or else a negative LTTNG_ERR value. */ int lttng_snapshot_record(const char *session_name, - struct lttng_snapshot_output *output, int wait) + struct lttng_snapshot_output *output, + int wait __attribute__((unused))) { int ret; struct lttcomm_session_msg lsm; diff --git a/tests/regression/kernel/select_poll_epoll.cpp b/tests/regression/kernel/select_poll_epoll.cpp index abedc0aa9..fb72f6e5a 100644 --- a/tests/regression/kernel/select_poll_epoll.cpp +++ b/tests/regression/kernel/select_poll_epoll.cpp @@ -242,7 +242,7 @@ void test_ppoll(void) } static -void test_ppoll_big(FILE *validation_output_file) +void test_ppoll_big(FILE *validation_output_file __attribute__((unused))) { struct pollfd ufds[MAX_FDS]; char buf[BUF_SIZE]; @@ -443,7 +443,8 @@ end: * The event should contain an array of 100 FDs filled with garbage. */ static -void ppoll_fds_buffer_overflow(FILE *validation_output_file) +void ppoll_fds_buffer_overflow( + FILE *validation_output_file __attribute__((unused))) { struct pollfd ufds[NB_FD]; char buf[BUF_SIZE]; @@ -470,7 +471,7 @@ void ppoll_fds_buffer_overflow(FILE *validation_output_file) * The event should contain an empty array of FDs and overflow = 1. */ static -void ppoll_fds_ulong_max(FILE *validation_output_file) +void ppoll_fds_ulong_max(FILE *validation_output_file __attribute__((unused))) { struct pollfd ufds[NB_FD]; char buf[BUF_SIZE]; @@ -495,7 +496,7 @@ void ppoll_fds_ulong_max(FILE *validation_output_file) * -EBADF. The recorded event should contain a "ret = -EBADF (-9)". */ static -void pselect_invalid_fd(FILE *validation_output_file) +void pselect_invalid_fd(FILE *validation_output_file __attribute__((unused))) { fd_set rfds; int ret; @@ -538,7 +539,8 @@ error: * with 0 FDs. */ static -void pselect_invalid_pointer(FILE *validation_output_file) +void pselect_invalid_pointer( + FILE *validation_output_file __attribute__((unused))) { fd_set rfds; int ret; @@ -753,7 +755,8 @@ end: * ppoll should work as expected and the trace should be readable at the end. */ static -void ppoll_concurrent_write(FILE *validation_output_file) +void ppoll_concurrent_write( + FILE *validation_output_file __attribute__((unused))) { int i, ret, fds[MAX_FDS]; diff --git a/tests/regression/tools/live/live_test.cpp b/tests/regression/tools/live/live_test.cpp index afaf23b65..76d801e9b 100644 --- a/tests/regression/tools/live/live_test.cpp +++ b/tests/regression/tools/live/live_test.cpp @@ -675,7 +675,7 @@ error: return ret; } -int main(int argc, char **argv) +int main(void) { int ret; uint64_t session_id; diff --git a/tests/regression/tools/notification/default_pipe_size_getter.cpp b/tests/regression/tools/notification/default_pipe_size_getter.cpp index cc24cec1e..40e2e126f 100644 --- a/tests/regression/tools/notification/default_pipe_size_getter.cpp +++ b/tests/regression/tools/notification/default_pipe_size_getter.cpp @@ -21,7 +21,7 @@ int lttng_opt_verbose; int lttng_opt_mi; int lttng_opt_quiet; -int main(int argc, const char **argv) +int main(void) { int ret; /* diff --git a/tests/regression/tools/notification/notification.cpp b/tests/regression/tools/notification/notification.cpp index 6d3e46ea3..c6205ef63 100644 --- a/tests/regression/tools/notification/notification.cpp +++ b/tests/regression/tools/notification/notification.cpp @@ -794,7 +794,6 @@ error: static void test_triggers_buffer_usage_condition(const char *session_name, const char *channel_name, - enum lttng_domain_type domain_type, enum lttng_condition_type condition_type) { unsigned int test_vector_size = 5, i; @@ -1860,8 +1859,7 @@ end: return; } -static void test_kprobe_event_rule_notification( - enum lttng_domain_type domain_type) +static void test_kprobe_event_rule_notification(void) { int i, ret; enum lttng_error_code ret_code; @@ -1956,7 +1954,6 @@ end: } static void test_uprobe_event_rule_notification( - enum lttng_domain_type domain_type, const char *testapp_path, const char *test_symbol_name) { @@ -2060,8 +2057,7 @@ end: return; } -static void test_syscall_event_rule_notification( - enum lttng_domain_type domain_type) +static void test_syscall_event_rule_notification(void) { int i, ret; enum lttng_error_code ret_code; @@ -2145,8 +2141,7 @@ end: return; } -static void test_syscall_event_rule_notification_filter( - enum lttng_domain_type domain_type) +static void test_syscall_event_rule_notification_filter(void) { int i, ret; enum lttng_error_code ret_code; @@ -2570,13 +2565,11 @@ int main(int argc, const char *argv[]) diag("Test trigger for domain %s with buffer_usage_low condition", domain_type_string); test_triggers_buffer_usage_condition(session_name, channel_name, - domain_type, LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW); diag("Test trigger for domain %s with buffer_usage_high condition", domain_type_string); test_triggers_buffer_usage_condition(session_name, channel_name, - domain_type, LTTNG_CONDITION_TYPE_BUFFER_USAGE_HIGH); diag("Test buffer usage notification channel api for domain %s", @@ -2613,7 +2606,7 @@ int main(int argc, const char *argv[]) diag("Test kprobe event rule notifications for domain %s", domain_type_string); - test_kprobe_event_rule_notification(domain_type); + test_kprobe_event_rule_notification(); break; } @@ -2626,12 +2619,12 @@ int main(int argc, const char *argv[]) diag("Test syscall event rule notifications for domain %s", domain_type_string); - test_syscall_event_rule_notification(domain_type); + test_syscall_event_rule_notification(); diag("Test syscall filtering event rule notifications for domain %s", domain_type_string); - test_syscall_event_rule_notification_filter(domain_type); + test_syscall_event_rule_notification_filter(); break; } @@ -2655,7 +2648,7 @@ int main(int argc, const char *argv[]) domain_type_string); test_uprobe_event_rule_notification( - domain_type, testapp_path, test_symbol_name); + testapp_path, test_symbol_name); break; } diff --git a/tests/regression/tools/trigger/name/trigger_name.cpp b/tests/regression/tools/trigger/name/trigger_name.cpp index 1c9aae32c..11459d4bd 100644 --- a/tests/regression/tools/trigger/name/trigger_name.cpp +++ b/tests/regression/tools/trigger/name/trigger_name.cpp @@ -613,7 +613,7 @@ const test_function test_functions[] = { double_register_automatic_name_trigger, }; -int main(int argc, const char **argv) +int main(void) { size_t i; diff --git a/tests/regression/ust/baddr-statedump/prog.c b/tests/regression/ust/baddr-statedump/prog.c index 071a6c571..7b82c1bdb 100644 --- a/tests/regression/ust/baddr-statedump/prog.c +++ b/tests/regression/ust/baddr-statedump/prog.c @@ -10,7 +10,7 @@ #define TRACEPOINT_DEFINE #include "tp.h" -int main(int argc, char **argv) +int main(void) { sleep(1); return 0; diff --git a/tests/regression/ust/daemon/daemon.c b/tests/regression/ust/daemon/daemon.c index faf204f9b..44ec182fa 100644 --- a/tests/regression/ust/daemon/daemon.c +++ b/tests/regression/ust/daemon/daemon.c @@ -15,15 +15,10 @@ #define TRACEPOINT_CREATE_PROBES #include "ust_tests_daemon.h" -int main(int argc, char **argv, char *env[]) +int main(void) { int result; - if (argc < 1) { - fprintf(stderr, "usage: daemon\n"); - exit(1); - } - pid_t parent_pid = getpid(); printf("parent_pid %d\n", parent_pid); tracepoint(ust_tests_daemon, before_daemon, parent_pid); diff --git a/tests/regression/ust/fork/fork2.c b/tests/regression/ust/fork/fork2.c index ffce5d0a1..48d716401 100644 --- a/tests/regression/ust/fork/fork2.c +++ b/tests/regression/ust/fork/fork2.c @@ -12,7 +12,7 @@ #define TRACEPOINT_CREATE_PROBES #include "ust_tests_fork.h" -int main(int argc, char **argv) +int main(void) { printf("IN FORK2\n"); diff --git a/tests/regression/ust/high-throughput/main.c b/tests/regression/ust/high-throughput/main.c index 092d8015f..055d8823e 100644 --- a/tests/regression/ust/high-throughput/main.c +++ b/tests/regression/ust/high-throughput/main.c @@ -22,7 +22,7 @@ #include "tp.h" static -void inthandler(int sig) +void inthandler(int sig __attribute__((unused))) { } diff --git a/tests/regression/ust/libc-wrapper/prog.c b/tests/regression/ust/libc-wrapper/prog.c index 999d880a3..c7aa0d307 100644 --- a/tests/regression/ust/libc-wrapper/prog.c +++ b/tests/regression/ust/libc-wrapper/prog.c @@ -12,7 +12,7 @@ #define N_ITER 1000 -int main(int argc, char **argv) +int main(void) { int i; const char teststr[] = "Hello World! 1234567890abc"; diff --git a/tests/regression/ust/low-throughput/main.c b/tests/regression/ust/low-throughput/main.c index f199050af..b419d1f5b 100644 --- a/tests/regression/ust/low-throughput/main.c +++ b/tests/regression/ust/low-throughput/main.c @@ -16,7 +16,7 @@ /* * Thread recording a tracepoint every minute for 20 minutes. */ -static void *th_event_minute(void *data) +static void *th_event_minute(void *data __attribute__((unused))) { int i; @@ -45,7 +45,7 @@ static void *th_event_minute(void *data) /* * main */ -int main(int argc, char **argv) +int main(void) { int ret; void *status; diff --git a/tests/regression/ust/multi-lib/probes.h b/tests/regression/ust/multi-lib/probes.h index 4ec4238b7..05bab2dd7 100644 --- a/tests/regression/ust/multi-lib/probes.h +++ b/tests/regression/ust/multi-lib/probes.h @@ -43,6 +43,7 @@ TRACEPOINT_ENUM(multi, enum_a, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( + ctf_unused(arg) ctf_enum(multi, enum_a, int16_t, enum_short_C, 0) ctf_enum(multi, enum_a, int32_t, enum_int_C, 1) ctf_enum(multi, enum_a, uint64_t, enum_long_C, 2) @@ -59,7 +60,8 @@ TRACEPOINT_ENUM(multi, enum_a, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( - ctf_enum(multi, enum_a, int32_t, enum_int_D, 1) + ctf_unused(arg) + ctf_enum(multi, enum_a, int32_t, enum_int_D, 1) ctf_enum(multi, enum_a, int16_t, enum_short_D, 0) ctf_enum(multi, enum_a, uint64_t, enum_long_D, 2) ) @@ -128,6 +130,7 @@ TRACEPOINT_ENUM(multi, enum_a, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( + ctf_unused(arg) ctf_enum(multi, enum_a, int32_t, enum_int, 1) ) ) @@ -142,7 +145,8 @@ TRACEPOINT_ENUM(multi, enum_a, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( - ctf_enum(multi, enum_a, int64_t, enum_int, 1) + ctf_unused(arg) + ctf_enum(multi, enum_a, int64_t, enum_int, 1) ) ) #elif defined(ACTIVATE_PROBES_N) @@ -156,6 +160,7 @@ TRACEPOINT_ENUM(multi, enum_a, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( + ctf_unused(arg) ctf_enum(multi, enum_a, int16_t, enum_int, 1) ) ) @@ -163,6 +168,7 @@ TRACEPOINT_EVENT(multi, tp, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( + ctf_unused(arg) ctf_string(arg_string, "string") ) ) @@ -170,6 +176,7 @@ TRACEPOINT_EVENT(multi, tp, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( + ctf_unused(arg) ctf_string(my_arg_string, "string") ) ) @@ -177,6 +184,7 @@ TRACEPOINT_EVENT(multi, tp, TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS( + ctf_unused(arg) ) ) #endif diff --git a/tests/regression/ust/type-declarations/type-declarations.c b/tests/regression/ust/type-declarations/type-declarations.c index d4a2ff282..d7d2aff73 100644 --- a/tests/regression/ust/type-declarations/type-declarations.c +++ b/tests/regression/ust/type-declarations/type-declarations.c @@ -15,7 +15,7 @@ #define TRACEPOINT_CREATE_PROBES #include "ust_tests_td.h" -int main(int argc, char *argv[]) +int main(void) { int i; diff --git a/tests/regression/ust/ust-dl/prog.c b/tests/regression/ust/ust-dl/prog.c index 473de57a9..bab2644cc 100644 --- a/tests/regression/ust/ust-dl/prog.c +++ b/tests/regression/ust/ust-dl/prog.c @@ -19,7 +19,7 @@ * This test is therefore a mix of dlopen/dlclose and dlmopen/dlclose of * libfoo, and of its direct dependencies. */ -int main(int argc, char **argv) +int main(void) { void *h0, *h2, *h3, *h4; diff --git a/tests/unit/test_action.cpp b/tests/unit/test_action.cpp index ad323e9ac..8657be1dc 100644 --- a/tests/unit/test_action.cpp +++ b/tests/unit/test_action.cpp @@ -528,7 +528,7 @@ static void test_action_snapshot_session(void) lttng_payload_reset(&payload); } -int main(int argc, const char *argv[]) +int main(void) { plan_tests(NUM_TESTS); test_action_notify(); diff --git a/tests/unit/test_condition.cpp b/tests/unit/test_condition.cpp index 1ed14fa6c..627190109 100644 --- a/tests/unit/test_condition.cpp +++ b/tests/unit/test_condition.cpp @@ -109,7 +109,7 @@ void test_condition_event_rule(void) lttng_log_level_rule_destroy(log_level_rule_at_least_as_severe); } -int main(int argc, const char *argv[]) +int main(void) { plan_tests(NUM_TESTS); test_condition_event_rule(); diff --git a/tests/unit/test_directory_handle.cpp b/tests/unit/test_directory_handle.cpp index ca1167165..8dd7dd11a 100644 --- a/tests/unit/test_directory_handle.cpp +++ b/tests/unit/test_directory_handle.cpp @@ -270,7 +270,7 @@ end: return ret == 0 ? tests_ran : ret; } -int main(int argc, char **argv) +int main(void) { int ret; char test_dir[] = "/tmp/lttng-XXXXXX"; diff --git a/tests/unit/test_event_rule.cpp b/tests/unit/test_event_rule.cpp index 0fc9ec770..b8adee769 100644 --- a/tests/unit/test_event_rule.cpp +++ b/tests/unit/test_event_rule.cpp @@ -811,7 +811,7 @@ static void test_event_rule_log_level_python(void) NULL, 0); } -int main(int argc, const char *argv[]) +int main(void) { plan_tests(NUM_TESTS); test_event_rule_kernel_tracepoint(); diff --git a/tests/unit/test_fd_tracker.cpp b/tests/unit/test_fd_tracker.cpp index 6df179f9d..544dc84ea 100644 --- a/tests/unit/test_fd_tracker.cpp +++ b/tests/unit/test_fd_tracker.cpp @@ -131,7 +131,8 @@ int noop_open(void *data, int *fds) } static -int noop_close(void *data, int *fds) +int noop_close(void *data __attribute__((unused)), + int *fds __attribute__((unused))) { return 0; } @@ -209,13 +210,13 @@ end: } static -int error_open(void *data, int *fds) +int error_open(void *data, int *fds __attribute__((unused))) { return *((int *) data); } static -int error_close(void *data, int *fds) +int error_close(void *data, int *fds __attribute__((unused))) { return *((int *) data); } @@ -301,7 +302,7 @@ void test_unsuspendable_duplicate(void) } static -int open_pipes(void *data, int *out_fds) +int open_pipes(void *data __attribute__((unused)), int *out_fds) { unsigned int i; const unsigned int pipe_count = TRACKER_FD_LIMIT / 2; @@ -317,7 +318,7 @@ int open_pipes(void *data, int *out_fds) } static -int close_pipes(void *data, int *fds) +int close_pipes(void *data __attribute__((unused)), int *fds) { int i; int *pipes = fds; @@ -472,7 +473,8 @@ static int open_same_file(struct fd_tracker *tracker, } static -int cleanup_files(struct fd_tracker *tracker, const char *dir, +int cleanup_files(struct fd_tracker *tracker __attribute__((unused)), + const char *dir __attribute__((unused)), unsigned int count, struct fs_handle **handles, char **file_paths) { @@ -882,7 +884,7 @@ end: lttng_directory_handle_put(dir_handle); } -int main(int argc, char **argv) +int main(void) { plan_tests(NUM_TESTS); diag("File descriptor tracker unit tests"); diff --git a/tests/unit/test_kernel_data.cpp b/tests/unit/test_kernel_data.cpp index 4451f65b7..cf2f53564 100644 --- a/tests/unit/test_kernel_data.cpp +++ b/tests/unit/test_kernel_data.cpp @@ -179,7 +179,7 @@ static void test_create_kernel_stream(void) trace_kernel_destroy_stream(stream); } -int main(int argc, char **argv) +int main(void) { plan_tests(NUM_TESTS); diff --git a/tests/unit/test_kernel_probe.cpp b/tests/unit/test_kernel_probe.cpp index 0f6f89ec9..91211eb4e 100644 --- a/tests/unit/test_kernel_probe.cpp +++ b/tests/unit/test_kernel_probe.cpp @@ -159,7 +159,7 @@ static void test_kernel_probe_location_symbol(void) lttng_kernel_probe_location_destroy(location_from_buffer); } -int main(int argc, const char *argv[]) +int main(void) { plan_tests(NUM_TESTS); test_kernel_probe_location_address(); diff --git a/tests/unit/test_log_level_rule.cpp b/tests/unit/test_log_level_rule.cpp index d2895c811..894800665 100644 --- a/tests/unit/test_log_level_rule.cpp +++ b/tests/unit/test_log_level_rule.cpp @@ -178,7 +178,7 @@ static void test_log_level_rule_at_least_as_severe_as(void) lttng_log_level_rule_destroy(at_least_as_severe_as); } -int main(int argc, const char *argv[]) +int main(void) { plan_tests(NUM_TESTS); test_log_level_rule_exactly(); diff --git a/tests/unit/test_notification.cpp b/tests/unit/test_notification.cpp index 5a2bac14d..8e2006f3d 100644 --- a/tests/unit/test_notification.cpp +++ b/tests/unit/test_notification.cpp @@ -303,7 +303,7 @@ static void test_trigger(void) } -int main(int argc, const char *argv[]) +int main(void) { plan_tests(NUM_TESTS); test_condition_buffer_usage_low(); diff --git a/tests/unit/test_rate_policy.cpp b/tests/unit/test_rate_policy.cpp index acfe15903..d9ae4b7b6 100644 --- a/tests/unit/test_rate_policy.cpp +++ b/tests/unit/test_rate_policy.cpp @@ -243,7 +243,7 @@ static void test_rate_policy_once_after_n(void) lttng_payload_reset(&payload); } -int main(int argc, const char *argv[]) +int main(void) { plan_tests(NUM_TESTS); test_rate_policy_every_n(); diff --git a/tests/unit/test_relayd_backward_compat_group_by_session.cpp b/tests/unit/test_relayd_backward_compat_group_by_session.cpp index dee0fabd4..1fde89cbe 100644 --- a/tests/unit/test_relayd_backward_compat_group_by_session.cpp +++ b/tests/unit/test_relayd_backward_compat_group_by_session.cpp @@ -127,7 +127,7 @@ end: return result; } -int main(int argc, char **argv) +int main(void) { int i; int num_test = sizeof(tests) / sizeof(struct test); diff --git a/tests/unit/test_session.cpp b/tests/unit/test_session.cpp index 5a549a593..c403e2355 100644 --- a/tests/unit/test_session.cpp +++ b/tests/unit/test_session.cpp @@ -322,7 +322,7 @@ static void test_large_session_number(void) MAX_SESSIONS); } -int main(int argc, char **argv) +int main(void) { plan_tests(NUM_TESTS); diff --git a/tests/unit/test_string_utils.cpp b/tests/unit/test_string_utils.cpp index e20f88f7a..9f1f45094 100644 --- a/tests/unit/test_string_utils.cpp +++ b/tests/unit/test_string_utils.cpp @@ -172,7 +172,7 @@ static void test_normalize_star_glob_pattern(void) test_one_normalize_star_glob_pattern("**\\***", "*\\**"); } -int main(int argc, char **argv) +int main(void) { plan_tests(NUM_TESTS); diag("String utils unit tests"); diff --git a/tests/unit/test_uri.cpp b/tests/unit/test_uri.cpp index d2ad04b0c..a65ce6218 100644 --- a/tests/unit/test_uri.cpp +++ b/tests/unit/test_uri.cpp @@ -242,7 +242,7 @@ static void test_uri_cmp(void) uri_free(uri2); } -int main(int argc, char **argv) +int main(void) { plan_tests(NUM_TESTS); diff --git a/tests/unit/test_ust_data.cpp b/tests/unit/test_ust_data.cpp index ee566f395..04aa8c83e 100644 --- a/tests/unit/test_ust_data.cpp +++ b/tests/unit/test_ust_data.cpp @@ -263,7 +263,7 @@ static void test_create_ust_context(void) free(uctx); } -int main(int argc, char **argv) +int main(void) { plan_tests(NUM_TESTS); diff --git a/tests/unit/test_utils_compat_pthread.cpp b/tests/unit/test_utils_compat_pthread.cpp index eb2b7b6ec..2ce437372 100644 --- a/tests/unit/test_utils_compat_pthread.cpp +++ b/tests/unit/test_utils_compat_pthread.cpp @@ -13,7 +13,7 @@ #define TEST_NAME_PROPER_LEN 16 -int main(int argc, char **argv) +int main(void) { int ret; char name1[TEST_NAME_PROPER_LEN]; diff --git a/tests/unit/test_utils_expand_path.cpp b/tests/unit/test_utils_expand_path.cpp index 8216f3fd7..e85cbbced 100644 --- a/tests/unit/test_utils_expand_path.cpp +++ b/tests/unit/test_utils_expand_path.cpp @@ -327,7 +327,7 @@ static void test_utils_expand_path(void) } } -int main(int argc, char **argv) +int main(void) { if (prepare_symlink_tree() != 0) { goto error_mkdir; diff --git a/tests/unit/test_utils_parse_size_suffix.cpp b/tests/unit/test_utils_parse_size_suffix.cpp index ac3e24b64..2cd917272 100644 --- a/tests/unit/test_utils_parse_size_suffix.cpp +++ b/tests/unit/test_utils_parse_size_suffix.cpp @@ -117,7 +117,7 @@ static void test_utils_parse_size_suffix(void) } } -int main(int argc, char **argv) +int main(void) { plan_tests(num_valid_tests + num_invalid_tests); diff --git a/tests/unit/test_utils_parse_time_suffix.cpp b/tests/unit/test_utils_parse_time_suffix.cpp index 71f52e426..e444464bc 100644 --- a/tests/unit/test_utils_parse_time_suffix.cpp +++ b/tests/unit/test_utils_parse_time_suffix.cpp @@ -115,7 +115,7 @@ static void test_utils_parse_time_suffix(void) } } -int main(int argc, char **argv) +int main(void) { plan_tests(num_valid_tests + num_invalid_tests); diff --git a/tests/unit/test_uuid.cpp b/tests/unit/test_uuid.cpp index e13a09751..2355084a5 100644 --- a/tests/unit/test_uuid.cpp +++ b/tests/unit/test_uuid.cpp @@ -172,7 +172,7 @@ void run_test(void) run_test_lttng_uuid_generate(); } -int main(int argc, char **argv) +int main(void) { /* Run tap-formated tests */ run_test(); diff --git a/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary.c b/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary.c index e6e041da9..d530be269 100644 --- a/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary.c +++ b/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary.c @@ -14,7 +14,7 @@ void __attribute__ ((noinline)) test_function(void) not_a_function += 1; } -int main(int argc, char *argv[]) +int main(void) { test_function(); dynamic_symbol(42); diff --git a/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary.cpp b/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary.cpp index ab0f24144..2e169c8fc 100644 --- a/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary.cpp +++ b/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary.cpp @@ -15,7 +15,7 @@ void test_cxx_function() not_a_function += 1; } -int main(int argc, char *argv[]) +int main(void) { test_class my_test_class; /* Call test function. */ diff --git a/tests/utils/xml-utils/pretty_xml.c b/tests/utils/xml-utils/pretty_xml.c index be6e0294c..3f296f023 100644 --- a/tests/utils/xml-utils/pretty_xml.c +++ b/tests/utils/xml-utils/pretty_xml.c @@ -12,7 +12,7 @@ #include -int main(int argc, char **argv) +int main(void) { xmlDocPtr doc = NULL; diff --git a/tests/utils/xml-utils/validate_xml.cpp b/tests/utils/xml-utils/validate_xml.cpp index fa8b2cc9d..8e30100c0 100644 --- a/tests/utils/xml-utils/validate_xml.cpp +++ b/tests/utils/xml-utils/validate_xml.cpp @@ -41,7 +41,8 @@ enum command_err_code { }; static ATTR_FORMAT_PRINTF(2, 3) -void xml_error_handler(void *ctx, const char *format, ...) +void xml_error_handler(void *ctx __attribute__((unused)), + const char *format, ...) { char *err_msg; va_list args; @@ -150,7 +151,7 @@ end: } -int main(int argc, char **argv, char *env[]) +int main(int argc, char **argv) { int ret; struct validation_ctx ctx = { 0 };