Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 2020 13:45:53 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r365794 - in stable/12/sbin/ggate: ggatec ggated
Message-ID:  <202009161345.08GDjrLw036870@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Sep 16 13:45:53 2020
New Revision: 365794
URL: https://svnweb.freebsd.org/changeset/base/365794

Log:
  MFC r365502:
  ggate: Fix ggated/ggatec debug print of offsets.

Modified:
  stable/12/sbin/ggate/ggatec/ggatec.c
  stable/12/sbin/ggate/ggated/ggated.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ggate/ggatec/ggatec.c
==============================================================================
--- stable/12/sbin/ggate/ggatec/ggatec.c	Wed Sep 16 09:58:15 2020	(r365793)
+++ stable/12/sbin/ggate/ggatec/ggatec.c	Wed Sep 16 13:45:53 2020	(r365794)
@@ -35,6 +35,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <ctype.h>
+#include <inttypes.h>
 #include <libgen.h>
 #include <pthread.h>
 #include <signal.h>
@@ -174,8 +175,9 @@ send_thread(void *arg __unused)
 				pthread_kill(recvtd, SIGUSR1);
 				break;
 			}
-			g_gate_log(LOG_DEBUG, "Sent %zd bytes (offset=%llu, "
-			    "size=%u).", data, hdr.gh_offset, hdr.gh_length);
+			g_gate_log(LOG_DEBUG, "Sent %zd bytes (offset=%"
+			    PRIu64 ", length=%" PRIu32 ").", data,
+			    hdr.gh_offset, hdr.gh_length);
 		}
 	}
 	g_gate_log(LOG_DEBUG, "%s: Died.", __func__);
@@ -229,9 +231,9 @@ recv_thread(void *arg __unused)
 				pthread_kill(sendtd, SIGUSR1);
 				break;
 			}
-			g_gate_log(LOG_DEBUG, "Received %d bytes (offset=%ju, "
-			    "size=%zu).", data, (uintmax_t)hdr.gh_offset,
-			    (size_t)hdr.gh_length);
+			g_gate_log(LOG_DEBUG, "Received %d bytes (offset=%"
+			    PRIu64 ", length=%" PRIu32 ").", data,
+			    hdr.gh_offset, hdr.gh_length);
 		}
 
 		g_gate_ioctl(G_GATE_CMD_DONE, &ggio);

Modified: stable/12/sbin/ggate/ggated/ggated.c
==============================================================================
--- stable/12/sbin/ggate/ggated/ggated.c	Wed Sep 16 09:58:15 2020	(r365793)
+++ stable/12/sbin/ggate/ggated/ggated.c	Wed Sep 16 13:45:53 2020	(r365794)
@@ -43,6 +43,7 @@
 #include <assert.h>
 #include <err.h>
 #include <errno.h>
+#include <inttypes.h>
 #include <fcntl.h>
 #include <libgen.h>
 #include <libutil.h>
@@ -661,8 +662,8 @@ recv_thread(void *arg)
 		g_gate_log(LOG_DEBUG, "Received hdr packet.");
 		g_gate_swap2h_hdr(&req->r_hdr);
 
-		g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__,
-		    (intmax_t)req->r_offset, (unsigned)req->r_length);
+		g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32,
+		    __func__, req->r_offset, req->r_length);
 
 		/*
 		 * Allocate memory for data.
@@ -729,8 +730,8 @@ disk_thread(void *arg)
 		assert((req->r_offset % conn->c_sectorsize) == 0);
 		assert((req->r_length % conn->c_sectorsize) == 0);
 
-		g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__,
-		    (intmax_t)req->r_offset, (unsigned)req->r_length);
+		g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32,
+		     __func__, req->r_offset, req->r_length);
 
 		/*
 		 * Do the request.
@@ -803,8 +804,8 @@ send_thread(void *arg)
 		error = pthread_mutex_unlock(&outqueue_mtx);
 		assert(error == 0);
 
-		g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__,
-		    (intmax_t)req->r_offset, (unsigned)req->r_length);
+		g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32,
+		    __func__, req->r_offset, req->r_length);
 
 		/*
 		 * Send the request.
@@ -823,8 +824,8 @@ send_thread(void *arg)
 				    strerror(errno));
 			}
 			g_gate_log(LOG_DEBUG,
-			    "Sent %zd bytes (offset=%ju, size=%zu).", data,
-			    (uintmax_t)req->r_offset, (size_t)req->r_length);
+			    "Sent %zd bytes (offset=%" PRIu64 ", size=%" PRIu32
+			    ").", data, req->r_offset, req->r_length);
 			free(req->r_data);
 		}
 		free(req);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009161345.08GDjrLw036870>