From 77c7c900d190f7fb4f99a456c767f069da7e72b8 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 16 Aug 2012 15:17:11 -0400 Subject: [PATCH] Fix: 32-bit print format type mismatch warnings Signed-off-by: Mathieu Desnoyers Signed-off-by: David Goulet --- src/bin/lttng-relayd/main.c | 17 +++++++++-------- src/bin/lttng-sessiond/health.c | 2 +- src/bin/lttng-sessiond/kernel.c | 3 ++- src/bin/lttng-sessiond/main.c | 4 ++-- src/common/consumer.c | 7 ++++--- src/common/kernel-consumer/kernel-consumer.c | 8 +++++--- src/common/relayd/relayd.c | 10 ++++++---- src/common/ust-consumer/ust-consumer.c | 7 ++++--- 8 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index ae631c70a..77e314d95 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -878,7 +878,7 @@ void relay_delete_session(struct relay_command *cmd, struct lttng_ht *streams_ht return; } - DBG("Relay deleting session %lu", cmd->session->id); + DBG("Relay deleting session %" PRIu64, cmd->session->id); free(cmd->session->sock); rcu_read_lock(); @@ -1030,7 +1030,7 @@ int relay_close_stream(struct lttcomm_relayd_hdr *recv_hdr, &iter); node = lttng_ht_iter_get_node_ulong(&iter); if (node == NULL) { - DBG("Relay stream %lu not found", be64toh(stream_info.stream_id)); + DBG("Relay stream %" PRIu64 " not found", be64toh(stream_info.stream_id)); ret = -1; goto end_unlock; } @@ -1133,7 +1133,7 @@ struct relay_stream *relay_stream_from_stream_id(uint64_t stream_id, &iter); node = lttng_ht_iter_get_node_ulong(&iter); if (node == NULL) { - DBG("Relay stream %lu not found", stream_id); + DBG("Relay stream %" PRIu64 " not found", stream_id); ret = NULL; goto end; } @@ -1181,7 +1181,7 @@ int relay_recv_metadata(struct lttcomm_relayd_hdr *recv_hdr, data_buffer_size = data_size; } memset(data_buffer, 0, data_size); - DBG2("Relay receiving metadata, waiting for %lu bytes", data_size); + DBG2("Relay receiving metadata, waiting for %" PRIu64 " bytes", data_size); ret = cmd->sock->ops->recvmsg(cmd->sock, data_buffer, data_size, MSG_WAITALL); if (ret < 0 || ret != data_size) { @@ -1235,7 +1235,7 @@ int relay_send_version(struct lttcomm_relayd_hdr *recv_hdr, goto end; } session->id = ++last_relay_session_id; - DBG("Created session %lu", session->id); + DBG("Created session %" PRIu64, session->id); cmd->session = session; } session->version_check_done = 1; @@ -1340,7 +1340,7 @@ int relay_process_data(struct relay_command *cmd, struct lttng_ht *streams_ht) net_seq_num = be64toh(data_hdr.net_seq_num); - DBG3("Receiving data of size %u for stream id %zu seqnum %" PRIu64, + DBG3("Receiving data of size %u for stream id %" PRIu64 " seqnum %" PRIu64, data_size, stream_id, net_seq_num); ret = cmd->sock->ops->recvmsg(cmd->sock, data_buffer, data_size, MSG_WAITALL); if (ret <= 0) { @@ -1356,7 +1356,8 @@ int relay_process_data(struct relay_command *cmd, struct lttng_ht *streams_ht) ret = -1; goto end_unlock; } - DBG2("Relay wrote %d bytes to tracefile for stream id %lu", ret, stream->stream_handle); + DBG2("Relay wrote %d bytes to tracefile for stream id %" PRIu64, + ret, stream->stream_handle); stream->prev_seq = net_seq_num; @@ -1578,7 +1579,7 @@ void *relay_thread_worker(void *data) DBG("Control connection closed with %d", pollfd); } else { if (relay_connection->session) { - DBG2("Relay worker receiving data for session : %lu", + DBG2("Relay worker receiving data for session : %" PRIu64, relay_connection->session->id); } ret = relay_process_control(&recv_hdr, diff --git a/src/bin/lttng-sessiond/health.c b/src/bin/lttng-sessiond/health.c index 7bf41c883..d382c04b5 100644 --- a/src/bin/lttng-sessiond/health.c +++ b/src/bin/lttng-sessiond/health.c @@ -123,7 +123,7 @@ int health_check_state(struct health_state *state) } end: - DBG("Health state current %" PRIu64 ", last %" PRIu64 ", ret %d", + DBG("Health state current %lu, last %lu, ret %d", current, last, ret); return retval; diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 6fce7d84f..f73476077 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -150,7 +151,7 @@ int kernel_create_channel(struct ltt_kernel_session *session, goto error; } - DBG3("Kernel create channel %s in %s with attr: %d, %zu, %zu, %u, %u, %d", + DBG3("Kernel create channel %s in %s with attr: %d, %" PRIu64 ", %" PRIu64 ", %u, %u, %d", chan->name, path, lkc->channel->attr.overwrite, lkc->channel->attr.subbuf_size, lkc->channel->attr.num_subbuf, lkc->channel->attr.switch_timer_interval, lkc->channel->attr.read_timer_interval, diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 92bf85bc6..2b40e7aec 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4751,7 +4751,7 @@ skip_domain: } /* Receive variable len data */ - DBG("Receiving %lu URI(s) from client ...", nb_uri); + DBG("Receiving %zu URI(s) from client ...", nb_uri); ret = lttcomm_recv_unix_sock(sock, uris, len); if (ret <= 0) { DBG("No URIs received from client... continuing"); @@ -4811,7 +4811,7 @@ skip_domain: } /* Receive variable len data */ - DBG("Waiting for %lu URIs from client ...", nb_uri); + DBG("Waiting for %zu URIs from client ...", nb_uri); ret = lttcomm_recv_unix_sock(sock, uris, len); if (ret <= 0) { DBG("No URIs received from client... continuing"); diff --git a/src/common/consumer.c b/src/common/consumer.c index c1dadddb3..ea32af463 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -1091,7 +1092,7 @@ static int write_relayd_metadata_id(int fd, PERROR("write metadata stream id"); goto end; } - DBG("Metadata stream id %zu written before data", + DBG("Metadata stream id %" PRIu64 " written before data", stream->relayd_stream_id); end: @@ -1192,14 +1193,14 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( } goto end; } else if (ret > len) { - PERROR("Error in file write (ret %ld > len %lu)", ret, len); + PERROR("Error in file write (ret %zd > len %lu)", ret, len); written += ret; goto end; } else { len -= ret; mmap_offset += ret; } - DBG("Consumer mmap write() ret %ld (len %lu)", ret, len); + DBG("Consumer mmap write() ret %zd (len %lu)", ret, len); /* This call is useless on a socket so better save a syscall. */ if (!relayd) { diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index f5eb35c31..a85dfe0b0 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -285,13 +286,14 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, { struct consumer_relayd_sock_pair *relayd; - DBG("Kernel consumer destroying relayd %zu", + DBG("Kernel consumer destroying relayd %" PRIu64, msg.u.destroy_relayd.net_seq_idx); /* Get relayd reference if exists. */ relayd = consumer_find_relayd(msg.u.destroy_relayd.net_seq_idx); if (relayd == NULL) { - ERR("Unable to find relayd %zu", msg.u.destroy_relayd.net_seq_idx); + ERR("Unable to find relayd %" PRIu64, + msg.u.destroy_relayd.net_seq_idx); goto end_nosignal; } @@ -370,7 +372,7 @@ ssize_t lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream, * display the error but continue processing to try * to release the subbuffer */ - ERR("Error splicing to tracefile (ret: %ld != len: %ld)", + ERR("Error splicing to tracefile (ret: %zd != len: %lu)", ret, len); } diff --git a/src/common/relayd/relayd.c b/src/common/relayd/relayd.c index 6f877c968..7e99dbb67 100644 --- a/src/common/relayd/relayd.c +++ b/src/common/relayd/relayd.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -196,7 +197,8 @@ int relayd_add_stream(struct lttcomm_sock *sock, const char *channel_name, *stream_id = reply.handle; } - DBG("Relayd stream added successfully with handle %zu", reply.handle); + DBG("Relayd stream added successfully with handle %" PRIu64, + reply.handle); error: return ret; @@ -306,7 +308,7 @@ int relayd_send_metadata(struct lttcomm_sock *sock, size_t len) /* Code flow error. Safety net. */ assert(sock); - DBG("Relayd sending metadata of size %lu", len); + DBG("Relayd sending metadata of size %zu", len); /* Send command */ ret = send_command(sock, RELAYD_SEND_METADATA, NULL, len, 0); @@ -399,7 +401,7 @@ int relayd_send_close_stream(struct lttcomm_sock *sock, uint64_t stream_id, /* Code flow error. Safety net. */ assert(sock); - DBG("Relayd closing stream id %zu", stream_id); + DBG("Relayd closing stream id %" PRIu64, stream_id); msg.stream_id = htobe64(stream_id); msg.last_net_seq_num = htobe64(last_net_seq_num); @@ -427,7 +429,7 @@ int relayd_send_close_stream(struct lttcomm_sock *sock, uint64_t stream_id, ret = 0; } - DBG("Relayd close stream id %zu successfully", stream_id); + DBG("Relayd close stream id %" PRIu64 " successfully", stream_id); error: return ret; diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 486ca2634..3024af4a7 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -305,7 +306,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, consumer_add_stream(new_stream); } - DBG("UST consumer_add_stream %s (%d,%d) with relayd id %lu", + DBG("UST consumer_add_stream %s (%d,%d) with relayd id %" PRIu64, msg.u.stream.path_name, fds[0], fds[1], new_stream->relayd_stream_id); break; @@ -314,13 +315,13 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, { struct consumer_relayd_sock_pair *relayd; - DBG("UST consumer destroying relayd %zu", + DBG("UST consumer destroying relayd %" PRIu64, msg.u.destroy_relayd.net_seq_idx); /* Get relayd reference if exists. */ relayd = consumer_find_relayd(msg.u.destroy_relayd.net_seq_idx); if (relayd == NULL) { - ERR("Unable to find relayd %zu", msg.u.destroy_relayd.net_seq_idx); + ERR("Unable to find relayd %" PRIu64, msg.u.destroy_relayd.net_seq_idx); goto end_nosignal; } -- 2.34.1