You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/02/01 05:32:22 UTC
[1/2] git commit: TS-1084: Add format string checking
Updated Branches:
refs/heads/master cbacb6da7 -> 9b3bae364
TS-1084: Add format string checking
Add format string checking to internal and external APIs that take
a printf(3) format string. No functional changes.
Fix all the resulting warnings
- we needed a lot of %PRId64 tokens
- time_t is formatted as long long for portability
- size_t became %zu
- pointers all became %p
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9b3bae36
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9b3bae36
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9b3bae36
Branch: refs/heads/master
Commit: 9b3bae3644bc302aa7587b225bb4340b52219436
Parents: cbacb6d
Author: James Peach <jp...@apache.org>
Authored: Sat Dec 17 17:54:51 2011 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Jan 31 20:30:58 2012 -0800
----------------------------------------------------------------------
iocore/aio/AIO.cc | 2 +-
iocore/cache/Cache.cc | 26 ++++++------
iocore/cache/CacheDir.cc | 6 +-
iocore/cache/CacheHosting.cc | 16 ++++----
iocore/cache/CachePages.cc | 2 +-
iocore/cache/CacheRead.cc | 38 +++++++++---------
iocore/cache/CacheWrite.cc | 10 ++--
iocore/cache/RamCacheCLFUS.cc | 2 +-
iocore/cache/Store.cc | 4 +-
iocore/cluster/ClusterAPI.cc | 14 +++---
iocore/cluster/ClusterCache.cc | 34 ++++++++--------
iocore/cluster/ClusterHandler.cc | 22 +++++-----
iocore/cluster/ClusterHandlerBase.cc | 10 ++--
iocore/cluster/ClusterVConnection.cc | 6 +-
iocore/dns/SplitDNS.cc | 4 +-
iocore/eventsystem/P_EventSystem.h | 2 +-
iocore/hostdb/HostDB.cc | 4 +-
iocore/hostdb/MultiCache.cc | 20 +++++----
iocore/net/SSLNetVConnection.cc | 13 +++---
iocore/net/Socks.cc | 2 +-
iocore/net/UnixNet.cc | 3 +-
iocore/net/UnixNetProcessor.cc | 6 +-
iocore/net/UnixUDPNet.cc | 10 ++--
iocore/utils/OneWayTunnel.cc | 2 +-
lib/records/I_RecCore.h | 2 +-
lib/records/RecHttp.cc | 7 ++-
lib/ts/Diags.h | 25 ++++++++++--
lib/ts/Regression.h | 2 +-
mgmt/Main.cc | 2 +-
mgmt/api/CoreAPI.cc | 4 +-
mgmt/api/EventControlMain.cc | 2 +-
mgmt/stats/StatType.cc | 4 +-
plugins/conf_remap/conf_remap.cc | 5 ++-
proxy/FetchSM.cc | 6 +-
proxy/ICP.cc | 8 ++--
proxy/InkAPITest.cc | 12 +++---
proxy/InkAPITestTool.cc | 12 +++---
proxy/ParentSelection.cc | 8 ++--
proxy/PluginVC.cc | 16 ++++----
proxy/Prefetch.cc | 6 +-
proxy/ProxyConfig.h | 2 +-
proxy/ReverseProxy.cc | 4 +-
proxy/StatSystem.cc | 2 +-
proxy/Transform.cc | 10 ++--
proxy/Update.cc | 8 ++--
proxy/api/ts/ts.h.in | 14 +++++-
proxy/congest/Congestion.cc | 6 +-
proxy/congest/CongestionDB.cc | 6 +-
proxy/hdrs/HTTP.cc | 4 +-
proxy/hdrs/HdrHeap.cc | 2 +-
proxy/hdrs/MIME.cc | 8 ++--
proxy/http/HttpAccept.cc | 2 +-
proxy/http/HttpBodyFactory.cc | 26 ++++++------
proxy/http/HttpClientSession.cc | 2 +-
proxy/http/HttpConfig.cc | 4 +-
proxy/http/HttpSM.cc | 8 ++--
proxy/http/HttpServerSession.cc | 4 +-
proxy/http/HttpTransact.cc | 60 ++++++++++++++++------------
proxy/http/HttpTunnel.cc | 20 +++++-----
proxy/http/remap/RemapProcessor.cc | 4 +-
proxy/logging/Log.cc | 2 +-
proxy/logging/LogAccess.cc | 2 +-
proxy/logging/LogBuffer.cc | 4 +-
proxy/logging/LogCollationHostSM.cc | 4 +-
proxy/logging/LogConfig.cc | 4 +-
proxy/logging/LogField.cc | 4 +-
proxy/logging/LogFile.cc | 4 +-
proxy/logging/LogFilter.cc | 4 +-
proxy/logging/LogObject.cc | 6 +-
proxy/logging/LogSock.cc | 4 +-
proxy/logstats.cc | 8 ++--
proxy/stats/Stats.h | 10 ++---
72 files changed, 335 insertions(+), 296 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/aio/AIO.cc
----------------------------------------------------------------------
diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index 1bd7409..e9202e4 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -403,7 +403,7 @@ cache_op(AIOCallbackInternal *op)
err = pwrite(a->aio_fildes, ((char *) a->aio_buf) + res, a->aio_nbytes - res, a->aio_offset + res);
} while ((err < 0) && (errno == EINTR || errno == ENOBUFS || errno == ENOMEM));
if (err <= 0) {
- Warning("cache disk operation failed %s %d %d\n",
+ Warning("cache disk operation failed %s %zd %d\n",
(a->aio_lio_opcode == LIO_READ) ? "READ" : "WRITE", err, errno);
op->aio_result = -errno;
return (err);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 230672b..edf56b6 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -675,13 +675,13 @@ CacheProcessor::diskInitialized()
CacheDisk *d = gdisks[i];
if (is_debug_tag_set("cache_hosting")) {
int j;
- Debug("cache_hosting", "Disk: %d: Vol Blocks: %ld: Free space: %ld",
- i, d->header->num_diskvol_blks, d->free_space);
+ Debug("cache_hosting", "Disk: %d: Vol Blocks: %u: Free space: %lld",
+ i, d->header->num_diskvol_blks, (long long)d->free_space);
for (j = 0; j < (int) d->header->num_volumes; j++) {
- Debug("cache_hosting", "\tVol: %d Size: %d", d->disk_vols[j]->vol_number, d->disk_vols[j]->size);
+ Debug("cache_hosting", "\tVol: %d Size: %"PRIu64, d->disk_vols[j]->vol_number, d->disk_vols[j]->size);
}
for (j = 0; j < (int) d->header->num_diskvol_blks; j++) {
- Debug("cache_hosting", "\tBlock No: %d Size: %d Free: %d",
+ Debug("cache_hosting", "\tBlock No: %d Size: %"PRIu64" Free: %u",
d->header->vol_info[j].number, d->header->vol_info[j].len, d->header->vol_info[j].free);
}
}
@@ -1680,13 +1680,13 @@ AIO_Callback_handler::handle_disk_failure(int event, void *data) {
if (!DISK_BAD(d)) {
char message[128];
snprintf(message, sizeof(message), "Error accessing Disk %s", d->path);
- Warning(message);
+ Warning("%s", message);
IOCORE_SignalManager(REC_SIGNAL_CACHE_WARNING, message);
} else if (!DISK_BAD_SIGNALLED(d)) {
char message[128];
snprintf(message, sizeof(message), "too many errors accessing disk %s: declaring disk bad", d->path);
- Warning(message);
+ Warning("%s", message);
IOCORE_SignalManager(REC_SIGNAL_CACHE_ERROR, message);
/* subtract the disk space that was being used from the cache size stat */
// dir entries stat
@@ -1901,7 +1901,7 @@ CacheVC::handleReadDone(int event, Event *e) {
checksum += *b;
ink_assert(checksum == doc->checksum);
if (checksum != doc->checksum) {
- Note("cache: checksum error for [%" PRIu64 " %" PRIu64 "] len %d, hlen %d, disk %s, offset %" PRIu64 " size %d",
+ Note("cache: checksum error for [%" PRIu64 " %" PRIu64 "] len %d, hlen %d, disk %s, offset %" PRIu64 " size %zu",
doc->first_key.b[0], doc->first_key.b[1],
doc->len, doc->hlen, vol->path, io.aiocb.aio_offset, io.aiocb.aio_nbytes);
doc->magic = DOC_CORRUPT;
@@ -2298,7 +2298,7 @@ cplist_reconfigure()
int vols = (free_space / MAX_VOL_SIZE) + 1;
for (int p = 0; p < vols; p++) {
off_t b = gdisks[i]->free_space / (vols - p);
- Debug("cache_hosting", "blocks = %d\n", b);
+ Debug("cache_hosting", "blocks = %lld\n", (long long)b);
DiskVolBlock *dpb = gdisks[i]->create_volume(0, b, CACHE_HTTP_TYPE);
ink_assert(dpb && dpb->len == (uint64_t)b);
}
@@ -2350,7 +2350,7 @@ cplist_reconfigure()
percent_remaining -= (config_vol->size < 128) ? 0 : config_vol->percent;
}
if (config_vol->size < 128) {
- Warning("the size of volume %d (%d) is less than the minimum required volume size",
+ Warning("the size of volume %d (%d) is less than the minimum required volume size %d",
config_vol->number, config_vol->size, 128);
Warning("volume %d is not created", config_vol->number);
}
@@ -2497,11 +2497,11 @@ create_volume(int volume_number, off_t size_in_blocks, int scheme, CacheVol *cp)
char config_file[PATH_NAME_MAX];
IOCORE_ReadConfigString(config_file, "proxy.config.cache.volume_filename", PATH_NAME_MAX);
if (cp->size)
- Warning("not enough space to increase volume: [%d] to size: [%d]",
- volume_number, (to_create + cp->size) >> (20 - STORE_BLOCK_SHIFT));
+ Warning("not enough space to increase volume: [%d] to size: [%lld]",
+ volume_number, (long long)((to_create + cp->size) >> (20 - STORE_BLOCK_SHIFT)));
else
- Warning("not enough space to create volume: [%d], size: [%d]",
- volume_number, to_create >> (20 - STORE_BLOCK_SHIFT));
+ Warning("not enough space to create volume: [%d], size: [%lld]",
+ volume_number, (long long)(to_create >> (20 - STORE_BLOCK_SHIFT)));
Note("edit the %s file and restart traffic_server", config_file);
delete[]sp;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/CacheDir.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheDir.cc b/iocore/cache/CacheDir.cc
index 50fcd6d..13a3d34 100644
--- a/iocore/cache/CacheDir.cc
+++ b/iocore/cache/CacheDir.cc
@@ -546,7 +546,7 @@ Lagain:
continue;
}
} else
- DDebug("dir_probe_tag", "tag mismatch %X %X vs expected %X", e, dir_tag(e), key->word(3));
+ DDebug("dir_probe_tag", "tag mismatch %p %X vs expected %X", e, dir_tag(e), key->word(3));
Lcont:
p = e;
e = next_dir(e, seg);
@@ -776,7 +776,7 @@ dir_lookaside_fixup(CacheKey *key, Vol *d)
while (b) {
if (b->evac_frags.key == *key) {
int res = dir_overwrite(key, d, &b->new_dir, &b->dir, false);
- DDebug("dir_lookaside", "fixup %X %X offset %d phase %d %d",
+ DDebug("dir_lookaside", "fixup %X %X offset %"PRId64" phase %d %d",
key->word(0), key->word(1), dir_offset(&b->new_dir), dir_phase(&b->new_dir), res);
d->ram_cache->fixup(key, 0, dir_offset(&b->dir), 0, dir_offset(&b->new_dir));
d->lookaside[i].remove(b);
@@ -820,7 +820,7 @@ dir_lookaside_remove(CacheKey *key, Vol *d)
EvacuationBlock *b = d->lookaside[i].head;
while (b) {
if (b->evac_frags.key == *key) {
- DDebug("dir_lookaside", "remove %X %X offset %d phase %d",
+ DDebug("dir_lookaside", "remove %X %X offset %"PRId64" phase %d",
key->word(0), key->word(1), dir_offset(&b->new_dir), dir_phase(&b->new_dir));
d->lookaside[i].remove(b);
free_EvacuationBlock(b, d->mutex->thread_holding);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/CacheHosting.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheHosting.cc b/iocore/cache/CacheHosting.cc
index 8423ea1..c9d316f 100644
--- a/iocore/cache/CacheHosting.cc
+++ b/iocore/cache/CacheHosting.cc
@@ -180,7 +180,7 @@ CacheHostMatcher::NewEntry(matcher_line * line_info)
memset(cur_d, 0, sizeof(CacheHostRecord));
return;
}
- Debug("cache_hosting", "hostname: %s, host record: %xd", match_data, cur_d);
+ Debug("cache_hosting", "hostname: %s, host record: %p", match_data, cur_d);
// Fill in the matching info
host_lookup->NewEntry(match_data, (line_info->type == MATCH_DOMAIN) ? true : false, cur_d);
@@ -459,7 +459,7 @@ CacheHostRecord::Init(int typ)
CacheVol *cachep = cp_list.head;
for (; cachep; cachep = cachep->link.next) {
if (cachep->scheme == type) {
- Debug("cache_hosting", "Host Record: %xd, Volume: %d, size: %u", this, cachep->vol_number, cachep->size);
+ Debug("cache_hosting", "Host Record: %p, Volume: %d, size: %u", this, cachep->vol_number, cachep->size);
cp[num_cachevols] = cachep;
num_cachevols++;
num_vols += cachep->num_vols;
@@ -556,8 +556,8 @@ CacheHostRecord::Init(matcher_line * line_info, int typ)
is_vol_present = 1;
if ((cachep->scheme == type)) {
Debug("cache_hosting",
- "Host Record: %xd, Volume: %d, size: %ld",
- this, volume_number, cachep->size * STORE_BLOCK_SIZE);
+ "Host Record: %p, Volume: %d, size: %ld",
+ this, volume_number, (long)(cachep->size * STORE_BLOCK_SIZE));
cp[num_cachevols] = cachep;
num_cachevols++;
num_vols += cachep->num_vols;
@@ -1144,14 +1144,14 @@ execute_and_verify(RegressionTest * t)
CacheDisk *d = gdisks[i];
if (is_debug_tag_set("cache_hosting")) {
- Debug("cache_hosting", "Disk: %d: Vol Blocks: %ld: Free space: %ld",
- i, d->header->num_diskvol_blks, d->free_space);
+ Debug("cache_hosting", "Disk: %d: Vol Blocks: %u: Free space: %lld",
+ i, d->header->num_diskvol_blks, (long long)(d->free_space));
for (int j = 0; j < (int) d->header->num_volumes; j++) {
- Debug("cache_hosting", "\tVol: %d Size: %d", d->disk_vols[j]->vol_number, d->disk_vols[j]->size);
+ Debug("cache_hosting", "\tVol: %d Size: %"PRIu64, d->disk_vols[j]->vol_number, d->disk_vols[j]->size);
}
for (int j = 0; j < (int) d->header->num_diskvol_blks; j++) {
- Debug("cache_hosting", "\tBlock No: %d Size: %d Free: %d",
+ Debug("cache_hosting", "\tBlock No: %d Size: %"PRIu64" Free: %u",
d->header->vol_info[j].number, d->header->vol_info[j].len, d->header->vol_info[j].free);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/CachePages.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CachePages.cc b/iocore/cache/CachePages.cc
index d5f93e6..e08eae3 100644
--- a/iocore/cache/CachePages.cc
+++ b/iocore/cache/CachePages.cc
@@ -126,7 +126,7 @@ struct ShowCache: public ShowCont {
if (show_cache_urlstrs[i][0] == '\0')
continue;
unescapifyStr(show_cache_urlstrs[i]);
- Debug("cache_inspector", "URL %d: %s", i + 1, &show_cache_urlstrs[i]);
+ Debug("cache_inspector", "URL %d: %s", i + 1, show_cache_urlstrs[i]);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/CacheRead.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheRead.cc b/iocore/cache/CacheRead.cc
index ae3c989..aa200d0 100644
--- a/iocore/cache/CacheRead.cc
+++ b/iocore/cache/CacheRead.cc
@@ -276,14 +276,14 @@ CacheVC::openReadChooseWriter(int event, Event * e)
vector.clear(false);
if (!write_vc) {
MUTEX_RELEASE(lock);
- DDebug("cache_read_agg", "%x: key: %X %X writer alternate different: %d", this, first_key.word(1), alternate_index);
+ DDebug("cache_read_agg", "%p: key: %X writer alternate different: %d", this, first_key.word(1), alternate_index);
od = NULL;
SET_HANDLER(&CacheVC::openReadStartHead);
return openReadStartHead(EVENT_IMMEDIATE, 0);
}
DDebug("cache_read_agg",
- "%x: key: %X eKey: %d # alts: %d, ndx: %d, # writers: %d writer: %x",
+ "%p: key: %X eKey: %d # alts: %d, ndx: %d, # writers: %d writer: %p",
this, first_key.word(1), write_vc->earliest_key.word(1),
vector.count(), alternate_index, od->num_writers, write_vc);
}
@@ -308,7 +308,7 @@ CacheVC::openReadFromWriter(int event, Event * e)
}
cancel_trigger();
intptr_t err = ECACHE_DOC_BUSY;
- DDebug("cache_read_agg", "%x: key: %X In openReadFromWriter", this, first_key.word(1));
+ DDebug("cache_read_agg", "%p: key: %X In openReadFromWriter", this, first_key.word(1));
#ifndef READ_WHILE_WRITER
return openReadFromWriterFailure(CACHE_EVENT_OPEN_READ_FAILED, (Event *) -err);
#else
@@ -336,7 +336,7 @@ CacheVC::openReadFromWriter(int event, Event * e)
if (writer_done()) {
MUTEX_RELEASE(lock);
DDebug("cache_read_agg",
- "%x: key: %X writer %x has left, continuing as normal read", this, first_key.word(1), write_vc);
+ "%p: key: %X writer %p has left, continuing as normal read", this, first_key.word(1), write_vc);
od = NULL;
write_vc = NULL;
SET_HANDLER(&CacheVC::openReadStartHead);
@@ -361,14 +361,14 @@ CacheVC::openReadFromWriter(int event, Event * e)
if (!cache_config_read_while_writer || frag_type != CACHE_FRAG_TYPE_HTTP)
return openReadFromWriterFailure(CACHE_EVENT_OPEN_READ_FAILED, (Event *) - err);
DDebug("cache_read_agg",
- "%x: key: %X writer: closed:%d, fragment:%d, retry: %d",
+ "%p: key: %X writer: closed:%d, fragment:%d, retry: %d",
this, first_key.word(1), write_vc->closed, write_vc->fragment, writer_lock_retry);
VC_SCHED_WRITER_RETRY();
}
CACHE_TRY_LOCK(writer_lock, write_vc->mutex, mutex->thread_holding);
if (!writer_lock) {
- DDebug("cache_read_agg", "%x: key: %X lock miss", this, first_key.word(1));
+ DDebug("cache_read_agg", "%p: key: %X lock miss", this, first_key.word(1));
VC_SCHED_LOCK_RETRY();
}
MUTEX_RELEASE(lock);
@@ -378,7 +378,7 @@ CacheVC::openReadFromWriter(int event, Event * e)
#ifdef HTTP_CACHE
if (frag_type == CACHE_FRAG_TYPE_HTTP) {
DDebug("cache_read_agg",
- "%x: key: %X http passed stage 1, closed: %d, frag: %d",
+ "%p: key: %X http passed stage 1, closed: %d, frag: %d",
this, first_key.word(1), write_vc->closed, write_vc->fragment);
if (!write_vc->alternate.valid())
return openReadFromWriterFailure(CACHE_EVENT_OPEN_READ_FAILED, (Event *) - err);
@@ -395,7 +395,7 @@ CacheVC::openReadFromWriter(int event, Event * e)
} else {
key = write_vc->update_key;
ink_assert(write_vc->closed);
- DDebug("cache_read_agg", "%x: key: %X writer header update", this, first_key.word(1));
+ DDebug("cache_read_agg", "%p: key: %X writer header update", this, first_key.word(1));
// Update case (b) : grab doc_len from the writer's alternate
doc_len = alternate.object_size_get();
if (write_vc->update_key == cod->single_doc_key &&
@@ -426,7 +426,7 @@ CacheVC::openReadFromWriter(int event, Event * e)
}
} else {
#endif //HTTP_CACHE
- DDebug("cache_read_agg", "%x: key: %X non-http passed stage 1", this, first_key.word(1));
+ DDebug("cache_read_agg", "%p: key: %X non-http passed stage 1", this, first_key.word(1));
key = write_vc->earliest_key;
#ifdef HTTP_CACHE
}
@@ -435,7 +435,7 @@ CacheVC::openReadFromWriter(int event, Event * e)
doc_len = write_vc->vio.nbytes;
last_collision = NULL;
DDebug("cache_read_agg",
- "%x: key: %X closed: %d, fragment: %d, len: %d starting first fragment",
+ "%p: key: %X closed: %d, fragment: %d, len: %d starting first fragment",
this, first_key.word(1), write_vc->closed, write_vc->fragment, (int)doc_len);
MUTEX_RELEASE(writer_lock);
// either a header + body update or a new document
@@ -453,7 +453,7 @@ CacheVC::openReadFromWriter(int event, Event * e)
doc_len = write_vc->total_len;
dir_clean(&first_dir);
dir_clean(&earliest_dir);
- DDebug("cache_read_agg", "%x key: %X %X: single fragment read", first_key.word(1), key.word(0));
+ DDebug("cache_read_agg", "%p: key: %X %X: single fragment read", this, first_key.word(1), key.word(0));
MUTEX_RELEASE(writer_lock);
SET_HANDLER(&CacheVC::openReadFromWriterMain);
CACHE_INCREMENT_DYN_STAT(cache_read_busy_success_stat);
@@ -581,17 +581,17 @@ CacheVC::openReadReadDone(int event, Event * e)
last_collision = NULL;
while (dir_probe(&earliest_key, vol, &dir, &last_collision)) {
if (dir_offset(&dir) == dir_offset(&earliest_dir)) {
- DDebug("cache_read_agg", "%x: key: %X ReadRead complete: %d",
+ DDebug("cache_read_agg", "%p: key: %X ReadRead complete: %d",
this, first_key.word(1), (int)vio.ndone);
doc_len = vio.ndone;
goto Ldone;
}
}
- DDebug("cache_read_agg", "%x: key: %X ReadRead writer aborted: %d",
+ DDebug("cache_read_agg", "%p: key: %X ReadRead writer aborted: %d",
this, first_key.word(1), (int)vio.ndone);
goto Lerror;
}
- DDebug("cache_read_agg", "%x: key: %X ReadRead retrying: %d", this, first_key.word(1), (int)vio.ndone);
+ DDebug("cache_read_agg", "%p: key: %X ReadRead retrying: %d", this, first_key.word(1), (int)vio.ndone);
VC_SCHED_WRITER_RETRY(); // wait for writer
}
// fall through for truncated documents
@@ -713,17 +713,17 @@ Lread: {
last_collision = NULL;
while (dir_probe(&earliest_key, vol, &dir, &last_collision)) {
if (dir_offset(&dir) == dir_offset(&earliest_dir)) {
- DDebug("cache_read_agg", "%x: key: %X ReadMain complete: %d",
+ DDebug("cache_read_agg", "%p: key: %X ReadMain complete: %d",
this, first_key.word(1), (int)vio.ndone);
doc_len = vio.ndone;
goto Leos;
}
}
- DDebug("cache_read_agg", "%X: key: %X ReadMain writer aborted: %d",
+ DDebug("cache_read_agg", "%p: key: %X ReadMain writer aborted: %d",
this, first_key.word(1), (int)vio.ndone);
goto Lerror;
}
- DDebug("cache_read_agg", "%X: key: %X ReadMain retrying: %d", this, first_key.word(1), (int)vio.ndone);
+ DDebug("cache_read_agg", "%p: key: %X ReadMain retrying: %d", this, first_key.word(1), (int)vio.ndone);
SET_HANDLER(&CacheVC::openReadMain);
VC_SCHED_WRITER_RETRY();
}
@@ -802,7 +802,7 @@ CacheVC::openReadStartEarliest(int event, Event * e)
#ifdef HIT_EVACUATE
if (vol->within_hit_evacuate_window(&earliest_dir) &&
(!cache_config_hit_evacuate_size_limit || doc_len <= (uint64_t)cache_config_hit_evacuate_size_limit)) {
- DDebug("cache_hit_evac", "dir: %d, write: %d, phase: %d",
+ DDebug("cache_hit_evac", "dir: %"PRId64", write: %"PRId64", phase: %d",
dir_offset(&earliest_dir), offset_to_vol_offset(vol, vol->header->write_pos), vol->header->phase);
f.hit_evacuate = 1;
}
@@ -1063,7 +1063,7 @@ CacheVC::openReadStartHead(int event, Event * e)
#ifdef HIT_EVACUATE
if (vol->within_hit_evacuate_window(&dir) &&
(!cache_config_hit_evacuate_size_limit || doc_len <= (uint64_t)cache_config_hit_evacuate_size_limit)) {
- DDebug("cache_hit_evac", "dir: %d, write: %d, phase: %d",
+ DDebug("cache_hit_evac", "dir: %"PRId64", write: %"PRId64", phase: %d",
dir_offset(&dir), offset_to_vol_offset(vol, vol->header->write_pos), vol->header->phase);
f.hit_evacuate = 1;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/CacheWrite.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
index 207cee3..06a71d1 100644
--- a/iocore/cache/CacheWrite.cc
+++ b/iocore/cache/CacheWrite.cc
@@ -417,7 +417,7 @@ CacheVC::evacuateReadHead(int event, Event *e)
goto Ldone;
alternate_tmp = vector.get(alternate_index);
doc_len = alternate_tmp->object_size_get();
- Debug("cache_evac", "evacuateReadHead http earliest %X first: %X len: %d",
+ Debug("cache_evac", "evacuateReadHead http earliest %X first: %X len: %"PRId64,
first_key.word(0), earliest_key.word(0), doc_len);
} else
#endif
@@ -429,7 +429,7 @@ CacheVC::evacuateReadHead(int event, Event *e)
goto Ldone;
doc_len = doc->total_len;
DDebug("cache_evac",
- "evacuateReadHead non-http earliest %X first: %X len: %d", first_key.word(0), earliest_key.word(0), doc_len);
+ "evacuateReadHead non-http earliest %X first: %X len: %"PRId64, first_key.word(0), earliest_key.word(0), doc_len);
}
if (doc_len == total_len) {
// the whole document has been evacuated. Insert the directory
@@ -656,7 +656,7 @@ Vol::evacuateDocReadDone(int event, Event *e)
b->evac_frags.key = doc->key;
b->evac_frags.earliest_key = doc->key;
b->earliest_evacuator = doc_evacuator;
- DDebug("cache_evac", "evacuating earliest %X %X evac: %X offset: %d",
+ DDebug("cache_evac", "evacuating earliest %X %X evac: %p offset: %d",
(int) b->evac_frags.key.word(0), (int) doc->key.word(0),
doc_evacuator, (int) dir_offset(&doc_evacuator->overwrite_dir));
b->f.unused = 67;
@@ -1508,8 +1508,8 @@ CacheVC::openWriteStartDone(int event, Event *e)
*/
if (!dir_valid(vol, &dir)) {
DDebug("cache_write",
- "OpenReadStartDone: Dir not valid: Write Head: %d, Dir: %d",
- offset_to_vol_offset(vol, vol->header->write_pos), dir_offset(&dir));
+ "OpenReadStartDone: Dir not valid: Write Head: %lld, Dir: %"PRId64,
+ (long long)offset_to_vol_offset(vol, vol->header->write_pos), dir_offset(&dir));
last_collision = NULL;
goto Lcollision;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/RamCacheCLFUS.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/RamCacheCLFUS.cc b/iocore/cache/RamCacheCLFUS.cc
index 32aaabd..3ce7223 100644
--- a/iocore/cache/RamCacheCLFUS.cc
+++ b/iocore/cache/RamCacheCLFUS.cc
@@ -523,7 +523,7 @@ int RamCacheCLFUS::put(INK_MD5 *key, IOBufferData *data, uint32_t len, bool copy
if (bytes + victim->size + size > max_bytes && CACHE_VALUE(victim) > CACHE_VALUE(e)) {
requeue_victims(this, victims);
lru[1].enqueue(e);
- DDebug("ram_cache", "put %X %d %d size %d INC %d HISTORY",
+ DDebug("ram_cache", "put %X %d %d size %d INC %"PRId64" HISTORY",
key->word(3), auxkey1, auxkey2, e->size, e->hits);
return 0;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cache/Store.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Store.cc b/iocore/cache/Store.cc
index 652c70b..0900ad5 100644
--- a/iocore/cache/Store.cc
+++ b/iocore/cache/Store.cc
@@ -700,7 +700,9 @@ Span::init(char *filename, int64_t size)
hw_sector_size = arg;
is_disk = 1;
adjusted_sec = hw_sector_size / 512;
- Debug("cache_init", "Span::init - %s hw_sector_size = %d,is_disk = %d,adjusted_sec = %d", filename, hw_sector_size, is_disk,adjusted_sec);
+ Debug("cache_init",
+ "Span::init - %s hw_sector_size=%"PRId64" is_disk=%d adjusted_sec=%d",
+ filename, hw_sector_size, is_disk,adjusted_sec);
}
alignment = 0;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cluster/ClusterAPI.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterAPI.cc b/iocore/cluster/ClusterAPI.cc
index af614e6..5e64719 100644
--- a/iocore/cluster/ClusterAPI.cc
+++ b/iocore/cluster/ClusterAPI.cc
@@ -306,7 +306,7 @@ clusterAPI_init()
int
TSAddClusterStatusFunction(TSClusterStatusFunction Status_Function, TSMutex m, TSClusterStatusHandle_t * h)
{
- Debug("cluster_api", "TSAddClusterStatusFunction func 0x%x", Status_Function);
+ Debug("cluster_api", "TSAddClusterStatusFunction func %p", Status_Function);
int n;
EThread *e = this_ethread();
@@ -319,7 +319,7 @@ TSAddClusterStatusFunction(TSClusterStatusFunction Status_Function, TSMutex m, T
MUTEX_UNTAKE_LOCK(ClusterAPI_mutex, e);
*h = INDEX_TO_CLUSTER_STATUS_HANDLE(n);
- Debug("cluster_api", "TSAddClusterStatusFunction: func 0x%x n %d", Status_Function, n);
+ Debug("cluster_api", "TSAddClusterStatusFunction: func %p n %d", Status_Function, n);
return 0;
}
}
@@ -447,7 +447,7 @@ TSAddClusterRPCFunction(TSClusterRPCKey_t k, TSClusterRPCFunction func, TSCluste
ink_release_assert(func);
ink_release_assert((n >= API_STARECT_CLUSTER_FUNCTION)
&& (n <= API_END_CLUSTER_FUNCTION));
- Debug("cluster_api", "TSAddClusterRPCFunction: key %d func 0x%x", k, func);
+ Debug("cluster_api", "TSAddClusterRPCFunction: key %d func %p", k, func);
handle.u.internal.cluster_function = n;
handle.u.internal.magic = RPC_HANDLE_MAGIC;
@@ -489,7 +489,7 @@ TSDeleteClusterRPCFunction(TSClusterRPCHandle_t * rpch)
void
default_api_ClusterFunction(ClusterMachine * m, void *data, int len)
{
- Debug("cluster_api", "default_api_ClusterFunction: [%u.%u.%u.%u] data 0x%x len %d", DOT_SEPARATED(m->ip), data, len);
+ Debug("cluster_api", "default_api_ClusterFunction: [%u.%u.%u.%u] data %p len %d", DOT_SEPARATED(m->ip), data, len);
TSClusterRPCMsg_t *msg = (TSClusterRPCMsg_t *) data;
RPCHandle_t *rpch = (RPCHandle_t *) & msg->m_handle;
@@ -516,7 +516,7 @@ TSFreeRPCMsg(TSClusterRPCMsg_t * msg, int msg_data_len)
{
RPCHandle_t *rpch = (RPCHandle_t *) & msg->m_handle;
ink_release_assert(rpch->u.internal.magic == RPC_HANDLE_MAGIC);
- Debug("cluster_api", "TSFreeRPCMsg: msg 0x%x msg_data_len %d", msg, msg_data_len);
+ Debug("cluster_api", "TSFreeRPCMsg: msg %p msg_data_len %d", msg, msg_data_len);
clusterProcessor.free_remote_data((char *) msg, msg_data_len + SIZEOF_RPC_MSG_LESS_DATA);
}
@@ -574,9 +574,9 @@ TSSendClusterRPC(TSNodeHandle_t * nh, TSClusterRPCMsg_t * msg)
clusterProcessor.invoke_remote(m, rpch->u.internal.cluster_function,
msg, len, (CLUSTER_OPT_STEAL | CLUSTER_OPT_DATA_IS_OCONTROL));
- Debug("cluster_api", "TSSendClusterRPC: msg 0x%x dlen %d [%u.%u.%u.%u] sent", msg, len, DOT_SEPARATED(ipaddr.s_addr));
+ Debug("cluster_api", "TSSendClusterRPC: msg %p dlen %d [%u.%u.%u.%u] sent", msg, len, DOT_SEPARATED(ipaddr.s_addr));
} else {
- Debug("cluster_api", "TSSendClusterRPC: msg 0x%x to [%u.%u.%u.%u] dropped", msg, DOT_SEPARATED(ipaddr.s_addr));
+ Debug("cluster_api", "TSSendClusterRPC: msg %p to [%u.%u.%u.%u] dropped", msg, DOT_SEPARATED(ipaddr.s_addr));
c->freeall();
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cluster/ClusterCache.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterCache.cc b/iocore/cluster/ClusterCache.cc
index 197a471..8b20b70 100644
--- a/iocore/cluster/ClusterCache.cc
+++ b/iocore/cluster/ClusterCache.cc
@@ -438,7 +438,7 @@ CacheContinuation::do_op(Continuation * c, ClusterMachine * mp, void *args,
memset(data, 0, op_to_sizeof_fixedlen_msg(opcode));
#endif
Debug("cache_msg",
- "do_op opcode=%d seqno=%d Machine=0x%x data=0x%x datalen=%d mio=0x%x",
+ "do_op opcode=%d seqno=%d Machine=%p data=%p datalen=%d mio=%p",
opcode, (c ? cc->seq_number : CACHE_NO_RESPONSE), mp, data, data_len, b);
switch (opcode) {
@@ -694,14 +694,14 @@ CacheContinuation::setup_local_vc(char *data, int data_len, CacheContinuation *
ms->channel = vc->channel;
ms->token = cc->open_local_token;
Debug("cache_proto",
- "0open_local-s (%s) success, seqno=%d chan=%d token=%d,%d VC=0x%x",
+ "0open_local-s (%s) success, seqno=%d chan=%d token=%d,%d VC=%p",
(read_op ? "R" : "W"), ms->seq_number, vc->channel, ms->token.ip_created, ms->token.sequence_number, vc);
} else {
CacheOpMsg_long *ml = (CacheOpMsg_long *) data;
ml->channel = vc->channel;
ml->token = cc->open_local_token;
Debug("cache_proto",
- "1open_local-l (%s) success, seqno=%d chan=%d token=%d,%d VC=0x%x",
+ "1open_local-l (%s) success, seqno=%d chan=%d token=%d,%d VC=%p",
(read_op ? "R" : "W"), ml->seq_number, vc->channel, ml->token.ip_created, ml->token.sequence_number, vc);
}
cc->freeMsgBuffer();
@@ -889,7 +889,7 @@ CacheContinuation::localVCsetupEvent(int event, ClusterVConnection * vc)
ms->token = open_local_token;
Debug("cache_proto",
- "2open_local-s (%s) success, seqno=%d chan=%d token=%d,%d VC=0x%x",
+ "2open_local-s (%s) success, seqno=%d chan=%d token=%d,%d VC=%p",
(read_op ? "R" : "W"), ms->seq_number, vc->channel, ms->token.ip_created, ms->token.sequence_number, vc);
} else {
@@ -898,7 +898,7 @@ CacheContinuation::localVCsetupEvent(int event, ClusterVConnection * vc)
ml->token = open_local_token;
Debug("cache_proto",
- "3open_local-l (%s) success, seqno=%d chan=%d token=%d,%d VC=0x%x",
+ "3open_local-l (%s) success, seqno=%d chan=%d token=%d,%d VC=%p",
(read_op ? "R" : "W"), ml->seq_number, vc->channel, ml->token.ip_created, ml->token.sequence_number, vc);
}
SET_HANDLER((CacheContHandler) & CacheContinuation::remoteOpEvent);
@@ -1110,7 +1110,7 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
CacheOpMsg_short *msg = unmarshal_CacheOpMsg_short(data, mh->NeedByteSwap());
init_from_short(c, msg, from);
Debug("cache_msg",
- "cache_op-s op=%d seqno=%d data=0x%x len=%d machine=0x%x", opcode, c->seq_number, data, len, from);
+ "cache_op-s op=%d seqno=%d data=%p len=%d machine=%p", opcode, c->seq_number, data, len, from);
//
// Establish the remote side of the ClusterVConnection
//
@@ -1166,7 +1166,7 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
CacheOpMsg_long *msg = unmarshal_CacheOpMsg_long(c->getMsgBuffer(), mh->NeedByteSwap());
init_from_long(c, msg, from);
Debug("cache_msg",
- "cache_op-l op=%d seqno=%d data=0x%x len=%d machine=0x%x", opcode, c->seq_number, data, len, from);
+ "cache_op-l op=%d seqno=%d data=%p len=%d machine=%p", opcode, c->seq_number, data, len, from);
#ifdef CACHE_MSG_TRACE
log_cache_op_msg(msg->seq_number, len, "cache_op_open_read_long");
#endif
@@ -1256,7 +1256,7 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
CacheOpMsg_short *msg = unmarshal_CacheOpMsg_short(data, mh->NeedByteSwap());
init_from_short(c, msg, from);
Debug("cache_msg",
- "cache_op-s op=%d seqno=%d data=0x%x len=%d machine=0x%x", opcode, c->seq_number, data, len, from);
+ "cache_op-s op=%d seqno=%d data=%p len=%d machine=%p", opcode, c->seq_number, data, len, from);
#ifdef CACHE_MSG_TRACE
log_cache_op_msg(msg->seq_number, len, "cache_op_open_write");
#endif
@@ -1311,7 +1311,7 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
CacheOpMsg_long *msg = unmarshal_CacheOpMsg_long(c->getMsgBuffer(), mh->NeedByteSwap());
init_from_long(c, msg, from);
Debug("cache_msg",
- "cache_op-l op=%d seqno=%d data=0x%x len=%d machine=0x%x", opcode, c->seq_number, data, len, from);
+ "cache_op-l op=%d seqno=%d data=%p len=%d machine=%p", opcode, c->seq_number, data, len, from);
#ifdef CACHE_MSG_TRACE
log_cache_op_msg(msg->seq_number, len, "cache_op_open_write_long");
#endif
@@ -1382,7 +1382,7 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
CacheOpMsg_short *msg = unmarshal_CacheOpMsg_short(data, mh->NeedByteSwap());
init_from_short(c, msg, from);
Debug("cache_msg",
- "cache_op op=%d seqno=%d data=0x%x len=%d machine=0x%x", opcode, c->seq_number, data, len, from);
+ "cache_op op=%d seqno=%d data=%p len=%d machine=%p", opcode, c->seq_number, data, len, from);
#ifdef CACHE_MSG_TRACE
log_cache_op_msg(msg->seq_number, len, "cache_op_remove");
#endif
@@ -1409,7 +1409,7 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
CacheOpMsg_short_2 *msg = unmarshal_CacheOpMsg_short_2(data, mh->NeedByteSwap());
init_from_short_2(c, msg, from);
Debug("cache_msg",
- "cache_op op=%d seqno=%d data=0x%x len=%d machine=0x%x", opcode, c->seq_number, data, len, from);
+ "cache_op op=%d seqno=%d data=%p len=%d machine=%p", opcode, c->seq_number, data, len, from);
#ifdef CACHE_MSG_TRACE
log_cache_op_msg(msg->seq_number, len, "cache_op_link");
#endif
@@ -1436,7 +1436,7 @@ cache_op_ClusterFunction(ClusterMachine * from, void *data, int len)
CacheOpMsg_short *msg = unmarshal_CacheOpMsg_short(data, mh->NeedByteSwap());
init_from_short(c, msg, from);
Debug("cache_msg",
- "cache_op op=%d seqno=%d data=0x%x len=%d machine=0x%x", opcode, c->seq_number, data, len, from);
+ "cache_op op=%d seqno=%d data=%p len=%d machine=%p", opcode, c->seq_number, data, len, from);
#ifdef CACHE_MSG_TRACE
log_cache_op_msg(msg->seq_number, len, "cache_op_deref");
#endif
@@ -1650,7 +1650,7 @@ int
CacheContinuation::replyOpEvent(int event, VConnection * cvc)
{
ink_assert(magicno == (int) MagicNo);
- Debug("cache_proto", "replyOpEvent(this=%x,event=%d,VC=%x)", this, event, cvc);
+ Debug("cache_proto", "replyOpEvent(this=%p,event=%d,VC=%p)", this, event, cvc);
ink_hrtime now;
now = ink_get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CACHE_CALLBACK_TIME_STAT, now - start_time);
@@ -1744,7 +1744,7 @@ CacheContinuation::replyOpEvent(int event, VConnection * cvc)
}
} else {
- Debug("cache_proto", "cache operation failed result=%d seqno=%d (this=%x)", event, seq_number, this);
+ Debug("cache_proto", "cache operation failed result=%d seqno=%d (this=%p)", event, seq_number, this);
msg->token.clear(); // Tell sender no conn established
// Reallocate reply message, allowing for marshalled data
@@ -1784,7 +1784,7 @@ CacheContinuation::replyOpEvent(int event, VConnection * cvc)
if (vers == CacheOpReplyMsg::CACHE_OP_REPLY_MESSAGE_VERSION) {
if (read_op) {
// Transmit reply message and object data in same cluster message
- Debug("cache_proto", "Sending reply/data seqno=%d buflen=%d",
+ Debug("cache_proto", "Sending reply/data seqno=%d buflen=%"PRId64,
seq_number, readahead_data ? bytes_IOBufferBlockList(readahead_data, 1) : 0);
clusterProcessor.invoke_remote_data(from,
CACHE_OP_RESULT_CLUSTER_FUNCTION,
@@ -1793,7 +1793,7 @@ CacheContinuation::replyOpEvent(int event, VConnection * cvc)
cluster_vc_channel, &token,
&CacheContinuation::disposeOfDataBuffer, (void *) this, CLUSTER_OPT_STEAL);
} else {
- Debug("cache_proto", "Sending reply seqno=%d, (this=%x)", seq_number, this);
+ Debug("cache_proto", "Sending reply seqno=%d, (this=%p)", seq_number, this);
clusterProcessor.invoke_remote(from, CACHE_OP_RESULT_CLUSTER_FUNCTION,
(void *) msg, (flen + len), CLUSTER_OPT_STEAL);
}
@@ -1808,7 +1808,7 @@ CacheContinuation::replyOpEvent(int event, VConnection * cvc)
free_exit:
results_expected--;
if (results_expected <= 0) {
- Debug("cache_proto", "replyOpEvent: freeing this=%x", this, event, cvc);
+ Debug("cache_proto", "replyOpEvent: freeing this=%p", this);
cacheContAllocator_free(this);
}
return EVENT_DONE;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cluster/ClusterHandler.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterHandler.cc b/iocore/cluster/ClusterHandler.cc
index 7c8ae93..aff8621 100644
--- a/iocore/cluster/ClusterHandler.cc
+++ b/iocore/cluster/ClusterHandler.cc
@@ -769,7 +769,7 @@ bool ClusterHandler::get_read_locks()
int64_t read_avail = vc->read_block->read_avail();
if (!vc->pending_remote_fill && read_avail) {
- Debug("cluster_vc_xfer", "Deferred fill ch %d 0x%x %d bytes", vc->channel, vc, read_avail);
+ Debug("cluster_vc_xfer", "Deferred fill ch %d %p %"PRId64" bytes", vc->channel, vc, read_avail);
vc->read.vio.buffer.writer()->append_block(vc->read_block->clone());
if (complete_channel_read(read_avail, vc)) {
@@ -1319,7 +1319,7 @@ ClusterHandler::update_channels_partial_read()
if (!vc->pending_remote_fill) {
if ((ProxyMutex *) vc->read_locked) {
- Debug("cluster_vc_xfer", "Partial read, credit ch %d 0x%x %d bytes", vc->channel, vc, len);
+ Debug("cluster_vc_xfer", "Partial read, credit ch %d %p %d bytes", vc->channel, vc, len);
s->vio.buffer.writer()->append_block(vc->read_block->clone());
if (complete_channel_read(len, vc)) {
vc->read_block->consume(len); // note bytes moved to user
@@ -1331,12 +1331,12 @@ ClusterHandler::update_channels_partial_read()
// we will resume the read at this VC.
if (len == (int) read.msg.descriptor[i].length) {
- Debug("cluster_vc_xfer", "Partial read, byte bank move ch %d 0x%x %d bytes", vc->channel, vc, len);
+ Debug("cluster_vc_xfer", "Partial read, byte bank move ch %d %p %d bytes", vc->channel, vc, len);
add_to_byte_bank(vc);
}
}
} else {
- Debug("cluster_vc_xfer", "Partial remote fill read, credit ch %d 0x%x %d bytes", vc->channel, vc, len);
+ Debug("cluster_vc_xfer", "Partial remote fill read, credit ch %d %p %d bytes", vc->channel, vc, len);
complete_channel_read(len, vc);
}
read.msg.descriptor[i].length -= len;
@@ -1369,7 +1369,7 @@ bool ClusterHandler::complete_channel_read(int len, ClusterVConnection * vc)
ink_assert((ProxyMutex *) s->vio.mutex == (ProxyMutex *) s->vio._cont->mutex);
- Debug("cluster_vc_xfer", "Complete read, credit ch %d 0x%x %d bytes", vc->channel, vc, len);
+ Debug("cluster_vc_xfer", "Complete read, credit ch %d %p %d bytes", vc->channel, vc, len);
s->vio.ndone += len;
if (s->vio.ntodo() <= 0) {
@@ -1425,7 +1425,7 @@ ClusterHandler::finish_delayed_reads()
ClusterVC_remove_read(vc);
}
Debug("cluster_vc_xfer",
- "Delayed read, credit ch %d 0x%x %d bytes", vc->channel, vc, d->get_block()->read_avail());
+ "Delayed read, credit ch %d %p %"PRId64" bytes", vc->channel, vc, d->get_block()->read_avail());
vc->read.vio.buffer.writer()->append_block(d->get_block());
if (complete_channel_read(d->get_block()->read_avail(), vc)) {
@@ -1474,7 +1474,7 @@ ClusterHandler::update_channels_written(bool bump_unhandled_channels)
int len = write.msg.descriptor[i].length;
vc->write_bytes_in_transit -= len;
ink_release_assert(vc->write_bytes_in_transit >= 0);
- Debug(CL_PROTO, "(%d) data sent %d %d", write.msg.descriptor[i].channel, len, s->vio.ndone);
+ Debug(CL_PROTO, "(%d) data sent %d %"PRId64, write.msg.descriptor[i].channel, len, s->vio.ndone);
if (vc_ok_write(vc)) {
vc->last_activity_time = current_time; // note activity time
@@ -2217,7 +2217,7 @@ retry:
// Push initial read data into VC
if (ntodo >= bytes_to_move) {
- Debug("cluster_vc_xfer", "finish initial data push ch %d bytes %d", vc->channel, vc->read_block->read_avail());
+ Debug("cluster_vc_xfer", "finish initial data push ch %d bytes %"PRId64, vc->channel, vc->read_block->read_avail());
s->vio.buffer.writer()->append_block(vc->read_block->clone());
vc->read_block = 0;
@@ -2225,7 +2225,7 @@ retry:
} else {
bytes_to_move = ntodo;
- Debug("cluster_vc_xfer", "initial data push ch %d bytes %d", vc->channel, bytes_to_move);
+ Debug("cluster_vc_xfer", "initial data push ch %d bytes %"PRId64, vc->channel, bytes_to_move);
// Clone a portion of the data
@@ -2280,7 +2280,7 @@ retry:
}
if ((vc->last_local_free == 0) || (nextfree >= vc->last_local_free)) {
- Debug(CL_PROTO, "(%d) update freespace %d", vc->channel, nextfree);
+ Debug(CL_PROTO, "(%d) update freespace %"PRId64, vc->channel, nextfree);
cluster_update_priority(this, vc, s, nextfree - vc->last_local_free, nb);
cluster_reschedule(this, vc, s);
//
@@ -3098,7 +3098,7 @@ ClusterHandler::do_open_local_requests()
} else {
// unable to get mutex, insert request back onto global queue.
- Debug(CL_TRACE, "do_open_local_requests() unable to acquire mutex (cvc=0x%x)", cvc);
+ Debug(CL_TRACE, "do_open_local_requests() unable to acquire mutex (cvc=%p)", cvc);
pending_request = 1;
ink_atomiclist_push(&external_incoming_open_local, (void *) cvc);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cluster/ClusterHandlerBase.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterHandlerBase.cc b/iocore/cluster/ClusterHandlerBase.cc
index 76ea2d2..6b7f14e 100644
--- a/iocore/cluster/ClusterHandlerBase.cc
+++ b/iocore/cluster/ClusterHandlerBase.cc
@@ -701,17 +701,17 @@ ClusterHandler::alloc_channel(ClusterVConnection * vc, int requested)
ink_release_assert(i != 0); // required
ink_release_assert(channels[i] == (ClusterVConnection *) 1); // required
- Debug(CL_TRACE, "alloc_channel local chan=%d VC=0x%x", i, vc);
+ Debug(CL_TRACE, "alloc_channel local chan=%d VC=%p", i, vc);
} else {
if (!check_channel(i)) {
return -2; // Limit exceeded
}
if (channels[i]) {
- Debug(CL_TRACE, "alloc_channel remote inuse chan=%d VC=0x%x", i, vc);
+ Debug(CL_TRACE, "alloc_channel remote inuse chan=%d VC=%p", i, vc);
return -1; // channel in use
} else {
- Debug(CL_TRACE, "alloc_channel remote chan=%d VC=0x%x", i, vc);
+ Debug(CL_TRACE, "alloc_channel remote chan=%d VC=%p", i, vc);
}
}
channels[i] = vc;
@@ -730,10 +730,10 @@ ClusterHandler::free_channel(ClusterVConnection * vc)
if (local_channel(i)) {
channels[i] = (ClusterVConnection *) 1;
free_local_channels.enqueue(channel_data[i]);
- Debug(CL_TRACE, "free_channel local chan=%d VC=0x%x", i, vc);
+ Debug(CL_TRACE, "free_channel local chan=%d VC=%p", i, vc);
} else {
channels[i] = 0;
- Debug(CL_TRACE, "free_channel remote chan=%d VC=0x%x", i, vc);
+ Debug(CL_TRACE, "free_channel remote chan=%d VC=%p", i, vc);
}
}
vc->channel = 0;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/cluster/ClusterVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterVConnection.cc b/iocore/cluster/ClusterVConnection.cc
index b6a0913..fe0813b 100644
--- a/iocore/cluster/ClusterVConnection.cc
+++ b/iocore/cluster/ClusterVConnection.cc
@@ -349,7 +349,7 @@ ClusterVConnection::start(EThread * t)
}
} else {
- Debug(CL_TRACE, "VC start alloc local chan=%d VC=0x%x", channel, this);
+ Debug(CL_TRACE, "VC start alloc local chan=%d VC=%p", channel, this);
if (new_connect_read)
this->pending_remote_fill = 1;
}
@@ -358,11 +358,11 @@ ClusterVConnection::start(EThread * t)
// Establish the remote side of the VC connection
ch = machine->clusterHandler;
if ((status = ch->alloc_channel(this, channel)) < 0) {
- Debug(CL_TRACE, "VC start alloc remote failed chan=%d VC=0x%x", channel, this);
+ Debug(CL_TRACE, "VC start alloc remote failed chan=%d VC=%p", channel, this);
clusterVCAllocator_free(this);
return status; // Channel active or no more channels
} else {
- Debug(CL_TRACE, "VC start alloc remote chan=%d VC=0x%x", channel, this);
+ Debug(CL_TRACE, "VC start alloc remote chan=%d VC=%p", channel, this);
if (new_connect_read)
this->pending_remote_fill = 1;
this->iov_map = CLUSTER_IOV_NONE; // disable connect timeout
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/dns/SplitDNS.cc
----------------------------------------------------------------------
diff --git a/iocore/dns/SplitDNS.cc b/iocore/dns/SplitDNS.cc
index 898fd23..9609adb 100644
--- a/iocore/dns/SplitDNS.cc
+++ b/iocore/dns/SplitDNS.cc
@@ -190,7 +190,7 @@ SplitDNSConfig::print()
SplitDNS *params = SplitDNSConfig::acquire();
Debug("splitdns_config", "DNS Server Selection Config\n");
- Debug("splitdns_config", "\tEnabled \n", params->m_SplitDNSlEnable);
+ Debug("splitdns_config", "\tEnabled=%d \n", params->m_SplitDNSlEnable);
params->m_DNSSrvrTable->Print();
SplitDNSConfig::release(params);
@@ -563,7 +563,7 @@ SplitDNSRecord::UpdateMatch(SplitDNSResult * result, RD * rdata)
result->m_rec = this;
result->m_line_number = this->line_num;
- Debug("splitdns_config", "Matched with 0x%x dns node from line %d", this, this->line_num);
+ Debug("splitdns_config", "Matched with %p dns node from line %d", this, this->line_num);
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/eventsystem/P_EventSystem.h
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/P_EventSystem.h b/iocore/eventsystem/P_EventSystem.h
index a121bf5..44b1aa8 100644
--- a/iocore/eventsystem/P_EventSystem.h
+++ b/iocore/eventsystem/P_EventSystem.h
@@ -65,7 +65,7 @@
if(_already == false) \
IOCORE_SignalManager(REC_SIGNAL_CONFIG_ERROR, _buf); \
_already = true; \
- Warning(_buf); \
+ Warning("%s", _buf); \
}
#define IOCORE_SignalManager REC_SignalManager
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 85597a0..d886b79 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -80,7 +80,7 @@ static Queue <HostDBContinuation > remoteHostDBQueue[MULTI_CACHE_PARTITIONS];
static inline int
corrupt_debugging_callout(HostDBInfo * e, RebuildMC & r)
{
- Debug("hostdb", "corrupt %d part %d", (char *) &e->app.rr.offset - r.data, r.partition);
+ Debug("hostdb", "corrupt %ld part %d", (char *) &e->app.rr.offset - r.data, r.partition);
return -1;
}
@@ -1419,7 +1419,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt * e)
if (rr) {
int s = HostDBRoundRobin::size(n, is_srv());
HostDBRoundRobin *rr_data = (HostDBRoundRobin *) hostDB.alloc(&r->app.rr.offset, s);
- Debug("hostdb", "allocating %d bytes for %d RR at %lX %d", s, n, rr_data, r->app.rr.offset);
+ Debug("hostdb", "allocating %d bytes for %d RR at %p %d", s, n, rr_data, r->app.rr.offset);
if (rr_data) {
int i = 0, ii = 0;
if (is_srv()) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/hostdb/MultiCache.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/MultiCache.cc b/iocore/hostdb/MultiCache.cc
index f8618d8..c53d198 100644
--- a/iocore/hostdb/MultiCache.cc
+++ b/iocore/hostdb/MultiCache.cc
@@ -406,8 +406,8 @@ MultiCacheBase::mmap_data(bool private_flag, bool zero_fill)
}
if (!d->file_pathname) {
if (zorch_file(path, fds[n_fds], (int64_t) d->blocks * (int64_t) STORE_BLOCK_SIZE, 0)) {
- Warning("unable to set file size '%s' to %" PRId64 ": %d, %s",
- (int64_t) d->blocks * STORE_BLOCK_SIZE, path, errno, strerror(errno));
+ Warning("unable to set file '%s' size to %" PRId64 ": %d, %s",
+ path, (int64_t) d->blocks * STORE_BLOCK_SIZE, errno, strerror(errno));
goto Lalloc;
}
}
@@ -1142,8 +1142,8 @@ MultiCacheBase::fixup_heap_offsets(int partition, int before_used, UnsunkPtrRegi
for (int i = 0; i < r->n; i++) {
UnsunkPtr & p = r->ptrs[i];
if (p.offset) {
- Debug("multicache", "fixup p.offset %d offset %d %d part %d",
- p.offset, *p.poffset, (char *) p.poffset - data, partition);
+ Debug("multicache", "fixup p.offset %d offset %d %lld part %d",
+ p.offset, *p.poffset, (long long)((char *) p.poffset - data), partition);
if (*p.poffset == -(i + base) - 1) {
if (halfspace_of(p.offset) != heap_halfspace) {
ink_assert(0);
@@ -1157,7 +1157,8 @@ MultiCacheBase::fixup_heap_offsets(int partition, int before_used, UnsunkPtrRegi
}
} else {
Debug("multicache",
- "not found %d i %d base %d *p.poffset = %d, rr = %d\n", (char *) p.poffset - data, i, base, *p.poffset);
+ "not found %lld i %d base %d *p.poffset = %d",
+ (long long)((char *) p.poffset - data), i, base, *p.poffset);
}
p.offset = 0;
p.poffset = (int *) r->next_free;
@@ -1274,7 +1275,7 @@ void
MultiCacheBase::copy_heap_data(char *src, int s, int *pi, int partition, MultiCacheHeapGC *gc)
{
char *dest = (char *) alloc(NULL, s);
- Debug("multicache", "copy %X to %X", src, dest);
+ Debug("multicache", "copy %p to %p", src, dest);
if (dest) {
memcpy(dest, src, s);
if (*pi < 0) { // already in the unsunk ptr registry, ok to change there
@@ -1367,7 +1368,8 @@ MultiCacheBase::alloc(int *poffset, int asize)
UnsunkPtr *up = unsunk[part].alloc(poffset);
up->offset = offset;
up->poffset = poffset;
- Debug("multicache", "alloc unsunk %d at %d part %d offset %d", *poffset, (char *) poffset - data, part, offset);
+ Debug("multicache", "alloc unsunk %d at %lld part %d offset %d",
+ *poffset, (long long)((char *) poffset - data), part, offset);
}
return (void *) p;
}
@@ -1391,7 +1393,7 @@ void *
MultiCacheBase::ptr(int *poffset, int partition)
{
int o = *poffset;
- Debug("multicache", "ptr %d part %d %d", (char *) poffset - data, partition, o);
+ Debug("multicache", "ptr %lld part %d %d", (long long)((char *) poffset - data), partition, o);
if (o > 0) {
if (!valid_offset(o)) {
ink_assert(!"bad offset");
@@ -1414,7 +1416,7 @@ void
MultiCacheBase::update(int *poffset, int *old_poffset)
{
int o = *poffset;
- Debug("multicache", "updating %d %d", (char *) poffset - data, o);
+ Debug("multicache", "updating %lld %d", (long long)((char *) poffset - data), o);
if (o > 0) {
if (!valid_offset(o)) {
ink_assert(!"bad poffset");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/net/SSLNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 3fbe093..1d7d589 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -75,7 +75,7 @@ ssl_read_from_net(NetHandler * nh, UnixNetVConnection * vc, EThread * lthread, i
for (bytes_read = 0; (b != 0) && (sslErr == SSL_ERROR_NONE); b = b->next) {
block_write_avail = b->write_avail();
- Debug("ssl", "[SSL_NetVConnection::ssl_read_from_net] b->write_avail()=%d", block_write_avail);
+ Debug("ssl", "[SSL_NetVConnection::ssl_read_from_net] b->write_avail()=%"PRId64, block_write_avail);
int64_t offset = 0;
// while can be replaced with if - need to test what works faster with openssl
@@ -139,7 +139,7 @@ ssl_read_from_net(NetHandler * nh, UnixNetVConnection * vc, EThread * lthread, i
} // for ( bytes_read = 0; (b != 0); b = b->next)
if (bytes_read > 0) {
- Debug("ssl", "[SSL_NetVConnection::ssl_read_from_net] bytes_read=%d", bytes_read);
+ Debug("ssl", "[SSL_NetVConnection::ssl_read_from_net] bytes_read=%"PRId64, bytes_read);
buf.writer()->fill(bytes_read);
s->vio.ndone += bytes_read;
vc->netActivity(lthread);
@@ -302,7 +302,8 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread)
int64_t
-SSLNetVConnection::load_buffer_and_write(int64_t towrite, int64_t &wattempted, int64_t &total_wrote, MIOBufferAccessor & buf) {
+SSLNetVConnection::load_buffer_and_write(int64_t towrite, int64_t &wattempted, int64_t &total_wrote, MIOBufferAccessor & buf)
+{
ProxyMutex *mutex = this_ethread()->mutex;
int64_t r = 0;
int64_t l = 0;
@@ -327,8 +328,8 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, int64_t &wattempted, i
break;
wattempted = l;
total_wrote += l;
- Debug("ssl", "SSLNetVConnection::loadBufferAndCallWrite, before do_SSL_write, l = %d, towrite = %d, b = %x", l,
- towrite, b);
+ Debug("ssl", "SSLNetVConnection::loadBufferAndCallWrite, before do_SSL_write, l=%"PRId64", towrite=%"PRId64", b=%p",
+ l, towrite, b);
write_calls++;
r = do_SSL_write(ssl, b->start() + offset, (int)l);
if (r == l) {
@@ -337,7 +338,7 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, int64_t &wattempted, i
// on to the next block
offset = 0;
b = b->next;
- Debug("ssl", "SSLNetVConnection::loadBufferAndCallWrite,Number of bytes written =%d , total =%d", r, total_wrote);
+ Debug("ssl", "SSLNetVConnection::loadBufferAndCallWrite,Number of bytes written=%"PRId64" , total=%"PRId64"", r, total_wrote);
NET_DEBUG_COUNT_DYN_STAT(net_calls_to_write_stat, 1);
} while (r == l && total_wrote < towrite && b);
if (r > 0) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/net/Socks.cc
----------------------------------------------------------------------
diff --git a/iocore/net/Socks.cc b/iocore/net/Socks.cc
index e105c5a..21c68d6 100644
--- a/iocore/net/Socks.cc
+++ b/iocore/net/Socks.cc
@@ -403,7 +403,7 @@ SocksEntry::mainEvent(int event, void *data)
bool success;
if (version == SOCKS5_VERSION) {
success = (p[0] == SOCKS5_VERSION && p[1] == SOCKS5_REQ_GRANTED);
- Debug("Socks", "received reply of length %d addr type %d", ((VIO *) data)->ndone, (int) p[3]);
+ Debug("Socks", "received reply of length %"PRId64" addr type %d", ((VIO *) data)->ndone, (int) p[3]);
} else
success = (p[0] == 0 && p[1] == SOCKS4_REQ_GRANTED);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/net/UnixNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index 34b9552..8900eb4 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -95,7 +95,8 @@ PollCont::pollEvent(int event, Event *e) {
if (likely
(!net_handler->read_ready_list.empty() || !net_handler->write_ready_list.empty() ||
!net_handler->read_enable_list.empty() || !net_handler->write_enable_list.empty())) {
- NetDebug("iocore_net_poll", "rrq: %d, wrq: %d, rel: %d, wel: %d", net_handler->read_ready_list.empty(),
+ NetDebug("iocore_net_poll", "rrq: %d, wrq: %d, rel: %d, wel: %d",
+ net_handler->read_ready_list.empty(),
net_handler->write_ready_list.empty(), net_handler->read_enable_list.empty(),
net_handler->write_enable_list.empty());
poll_timeout = 0; //poll immediately returns -- we have triggered stuff to process right now
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/net/UnixNetProcessor.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNetProcessor.cc b/iocore/net/UnixNetProcessor.cc
index 5a26cce..1b49745 100644
--- a/iocore/net/UnixNetProcessor.cc
+++ b/iocore/net/UnixNetProcessor.cc
@@ -66,7 +66,7 @@ NetProcessor::accept(Continuation* cont,
AcceptOptions const& opt
) {
Debug("iocore_net_processor",
- "NetProcessor::accept - port %d,recv_bufsize %d, send_bufsize %d, sockopt 0x%0lX",
+ "NetProcessor::accept - port %d,recv_bufsize %d, send_bufsize %d, sockopt 0x%0x",
opt.local_port, opt.recv_bufsize, opt.send_bufsize, opt.sockopt_flags);
return ((UnixNetProcessor *) this)->accept_internal(cont, NO_FD, opt);
@@ -78,7 +78,7 @@ NetProcessor::main_accept(Continuation *cont,
AcceptOptions const& opt
) {
UnixNetProcessor* this_unp = static_cast<UnixNetProcessor*>(this);
- Debug("iocore_net_processor", "NetProcessor::main_accept - port %d,recv_bufsize %d, send_bufsize %d, sockopt 0x%0lX",
+ Debug("iocore_net_processor", "NetProcessor::main_accept - port %d,recv_bufsize %d, send_bufsize %d, sockopt 0x%0x",
opt.local_port, opt.recv_bufsize, opt.send_bufsize, opt.sockopt_flags);
return this_unp->accept_internal(cont, fd, opt);
}
@@ -123,7 +123,7 @@ UnixNetProcessor::accept_internal(
if (opt.f_inbound_transparent) {
Debug(
"http_tproxy",
- "Marking accept server %x on port %d as inbound transparent.\n",
+ "Marking accept server %p on port %d as inbound transparent",
na, opt.local_port
);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/net/UnixUDPNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index fd0e291..c472bbe 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -674,7 +674,7 @@ UDPNetProcessor::UDPBind(Continuation * cont, sockaddr const* addr, int send_buf
}
n = NEW(new UnixUDPConnection(fd));
- Debug("udpnet", "UDPNetProcessor::UDPBind: %x fd=%d", n, fd);
+ Debug("udpnet", "UDPNetProcessor::UDPBind: %p fd=%d", n, fd);
n->setBinding(&myaddr.sa);
n->bindToThread(cont);
@@ -850,7 +850,7 @@ UDPQueue::service(UDPNetHandler * nh)
continue;
}
// insert into our queue.
- Debug("udp-send", "Adding 0x%x", p);
+ Debug("udp-send", "Adding %p", p);
addToGuaranteedQ = ((p->conn->pipe_class > 0) && (p->conn->flowRateBps > 10.0));
pktLen = p->getPktLength();
if (p->conn->lastPktStartTime == 0) {
@@ -1053,8 +1053,8 @@ sendPackets:
G_inkPipeInfo.perPipeInfo[i].queue->FreeCancelledPackets(g_udp_periodicCleanupSlots);
}
endTime = ink_get_hrtime_internal();
- Debug("udp-pending-packets", "Did cleanup of %d buckets: %" PRId64 " bytes in %d m.sec",
- g_udp_periodicCleanupSlots, nbytes - g_udp_bytesPending, ink_hrtime_to_msec(endTime - startTime));
+ Debug("udp-pending-packets", "Did cleanup of %d buckets: %" PRId64 " bytes in %lld m.sec",
+ g_udp_periodicCleanupSlots, nbytes - g_udp_bytesPending, (long long)ink_hrtime_to_msec(endTime - startTime));
lastCleanupTime = now;
}
}
@@ -1072,7 +1072,7 @@ UDPQueue::SendUDPPacket(UDPPacketInternal * p, int32_t pktLen)
p->conn->lastSentPktStartTime = p->delivery_time;
}
- Debug("udp-send", "Sending 0x%x", p);
+ Debug("udp-send", "Sending %p", p);
#if !defined(solaris)
msg.msg_control = 0;
msg.msg_controllen = 0;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/iocore/utils/OneWayTunnel.cc
----------------------------------------------------------------------
diff --git a/iocore/utils/OneWayTunnel.cc b/iocore/utils/OneWayTunnel.cc
index 7b4eee1..34ce210 100644
--- a/iocore/utils/OneWayTunnel.cc
+++ b/iocore/utils/OneWayTunnel.cc
@@ -140,7 +140,7 @@ OneWayTunnel::init(VConnection * vcSource,
else
size_index = default_large_iobuffer_size;
- Debug("one_way_tunnel", "buffer size index [%d] [%d]\n", size_index, size_estimate);
+ Debug("one_way_tunnel", "buffer size index [%"PRId64"] [%d]\n", size_index, size_estimate);
// enqueue read request on vcSource.
MIOBuffer *buf1 = new_MIOBuffer(size_index);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/lib/records/I_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecCore.h b/lib/records/I_RecCore.h
index a03ee17..b769f02 100644
--- a/lib/records/I_RecCore.h
+++ b/lib/records/I_RecCore.h
@@ -234,7 +234,7 @@ int RecSetSyncRequired(char *name, bool lock = true);
// Signal Alarm/Warning
//------------------------------------------------------------------------
#define REC_SignalManager RecSignalManager
-#define REC_SignalWarning(_n,_d) { Warning(_d); RecSignalManager(_n,_d); }
+#define REC_SignalWarning(_n,_d) { Warning("%s", _d); RecSignalManager(_n,_d); }
//------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/lib/records/RecHttp.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecHttp.cc b/lib/records/RecHttp.cc
index 3eb8997..6bbd6ed 100644
--- a/lib/records/RecHttp.cc
+++ b/lib/records/RecHttp.cc
@@ -172,7 +172,7 @@ HttpProxyPort::loadConfig(Vec<self>& entries) {
} else if (-1 != ssl_port) {
// -1 is used as the sentinel value in the config record for
// "not set by user".
- Warning("SSL enabled but port value %d is not in the range 1..65535.\n",
+ Warning("SSL enabled but port value %"PRId64" is not in the range 1..65535.\n",
ssl_port);
}
}
@@ -252,7 +252,7 @@ HttpProxyPort::processOptions(char const* opts) {
}
}
if (bracket_p) {
- Warning("Invalid port descriptor '%s' - left bracket without closing right bracket.");
+ Warning("Invalid port descriptor '%s' - left bracket without closing right bracket", opts);
return zret;
}
@@ -348,7 +348,8 @@ HttpProxyPort::processOptions(char const* opts) {
if (af_set_p) {
if (in_ip_set_p && m_family != m_inbound_ip.family()) {
- Warning("Invalid port descriptor '%s' - the inbound adddress family [%s] is not the same type as the explict family value [%s].", ink_inet_family_name(m_inbound_ip.family()), ink_inet_family_name(m_family));
+ Warning("Invalid port descriptor '%s' - the inbound adddress family [%s] is not the same type as the explict family value [%s]",
+ opts, ink_inet_family_name(m_inbound_ip.family()), ink_inet_family_name(m_family));
zret = false;
}
} else if (in_ip_set_p) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/lib/ts/Diags.h
----------------------------------------------------------------------
diff --git a/lib/ts/Diags.h b/lib/ts/Diags.h
index 1e5ba83..78ce69a 100644
--- a/lib/ts/Diags.h
+++ b/lib/ts/Diags.h
@@ -44,6 +44,13 @@
#define DIAGS_MAGIC 0x12345678
+#if !defined(TS_PRINTFLIKE)
+#if defined(__GNUC__) || defined(__clang__)
+#define TS_PRINTFLIKE(fmt, arg) __attribute__((format(printf, fmt, arg)))
+#else
+#endif
+#endif
+
class Diags;
// extern int diags_on_for_plugins;
@@ -312,10 +319,12 @@ public:
{ }
// default: no location printed
- void inkcoreapi operator() (const char *tag, const char *format_string ...);
+ void inkcoreapi operator() (const char *tag, const char *format_string ...)
+ TS_PRINTFLIKE(3, 4);
// location optionally printed
- void operator() (const char *tag, int show_loc, const char *format_string ...);
+ void operator() (const char *tag, int show_loc, const char *format_string ...)
+ TS_PRINTFLIKE(4, 5);
};
// debug closures support debug tags
@@ -331,10 +340,12 @@ public:
{ }
// default: no location printed
- void inkcoreapi operator() (const char *format_string ...);
+ void inkcoreapi operator() (const char *format_string ...)
+ TS_PRINTFLIKE(2, 3);
// location optionally printed
void operator() (int show_loc, const char *format_string ...);
+ TS_PRINTFLIKE(3, 4);
};
//////////////////////////////////////////////////////////////////////////
@@ -359,13 +370,17 @@ public:
extern inkcoreapi Diags *diags;
#define DTA(l) diags,l,__FILE__,__FUNCTION__,__LINE__
+
+void dummy_debug(const char * tag, const char *fmt ...) TS_PRINTFLIKE(2, 3);
+void dummy_debug(const char * tag, char *fmt ...) TS_PRINTFLIKE(2, 3);
+
inline void
-dummy_debug(char *dummy_arg ...)
+dummy_debug(const char *, char *dummy_arg ...)
{
(void) dummy_arg;
}
inline void
-dummy_debug(const char *dummy_arg ...)
+dummy_debug(const char *, const char *dummy_arg ...)
{
(void) dummy_arg;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/lib/ts/Regression.h
----------------------------------------------------------------------
diff --git a/lib/ts/Regression.h b/lib/ts/Regression.h
index afcc9a2..1a6486b 100644
--- a/lib/ts/Regression.h
+++ b/lib/ts/Regression.h
@@ -105,7 +105,7 @@ extern int regression_level;
{ \
if(_already == false) pmgmt->signalManager(MGMT_SIGNAL_CONFIG_ERROR, _buf); \
_already = true; \
- Warning(_buf); \
+ Warning("%s", _buf); \
} \
#endif /* _Regression_h */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index 05cfff9..17de7f0 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -754,7 +754,7 @@ main(int argc, char **argv)
// UI record for this machine
overviewGenerator->addSelfRecord();
webThrId = ink_thread_create(webIntr_main, NULL); /* Spin web agent thread */
- Debug("lm", "Created Web Agent thread (%d)", webThrId);
+ Debug("lm", "Created Web Agent thread (%lld)", (long long)webThrId);
lmgmt->listenForProxy();
/* Check the permissions on vip_config */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/mgmt/api/CoreAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index 05c7033..55d13b7 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -325,7 +325,7 @@ MgmtRecordGet(const char *rec_name, TSRecordEle * rec_ele)
return TS_ERR_FAIL;
rec_ele->counter_val = (TSCounter) counter_val;
- Debug("RecOp", "[MgmtRecordGet] Get Counter Var %s = %d\n", rec_ele->rec_name, rec_ele->counter_val);
+ Debug("RecOp", "[MgmtRecordGet] Get Counter Var %s = %"PRId64"\n", rec_ele->rec_name, rec_ele->counter_val);
break;
case RECD_INT:
@@ -334,7 +334,7 @@ MgmtRecordGet(const char *rec_name, TSRecordEle * rec_ele)
return TS_ERR_FAIL;
rec_ele->int_val = (TSInt) int_val;
- Debug("RecOp", "[MgmtRecordGet] Get Int Var %s = %d\n", rec_ele->rec_name, rec_ele->int_val);
+ Debug("RecOp", "[MgmtRecordGet] Get Int Var %s = %"PRId64"\n", rec_ele->rec_name, rec_ele->int_val);
break;
case RECD_FLOAT:
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/mgmt/api/EventControlMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/EventControlMain.cc b/mgmt/api/EventControlMain.cc
index 9422459..b47a3ef 100644
--- a/mgmt/api/EventControlMain.cc
+++ b/mgmt/api/EventControlMain.cc
@@ -407,7 +407,7 @@ event_callback_main(void *arg)
if (client_entry->events_registered[event->id]) {
ret = send_event_notification(client_entry->sock_info, event);
if (ret != TS_ERR_OKAY) { // send_event_notification failed!
- Debug("event", "sending even notification to fd [%d] failed.\n", client_entry->sock_info);
+ Debug("event", "sending even notification to fd [%d] failed.\n", client_entry->sock_info.fd);
}
}
// get next client connection, if any
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/mgmt/stats/StatType.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatType.cc b/mgmt/stats/StatType.cc
index 10a7269..5edc837 100644
--- a/mgmt/stats/StatType.cc
+++ b/mgmt/stats/StatType.cc
@@ -783,8 +783,8 @@ StatObject::setTokenValue(StatExprToken * token, bool cluster)
// only support time function
token->m_token_value = (StatFloat) (m_current_time - m_last_update);
if (StatDebug) {
- Debug(MODULE, "m_current_time(%f) - m_last_update(%f) = %f\n",
- m_current_time, m_last_update, token->m_token_value);
+ Debug(MODULE, "m_current_time(%lld) - m_last_update(%lld) = %lld\n",
+ (long long)m_current_time, (long long)m_last_update, (long long)token->m_token_value);
}
break;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/plugins/conf_remap/conf_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/conf_remap/conf_remap.cc b/plugins/conf_remap/conf_remap.cc
index e163e3e..0e6e048 100644
--- a/plugins/conf_remap/conf_remap.cc
+++ b/plugins/conf_remap/conf_remap.cc
@@ -16,12 +16,15 @@
limitations under the License.
*/
+#define __STDC_FORMAT_MACROS
+
#include <ts/ts.h>
#include <ts/remap.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
+#include <inttypes.h>
static const char* PLUGIN_NAME = "conf_remap";
// This makes the plugin depend on the version of traffic server installed, but that's
@@ -241,7 +244,7 @@ TSRemapDoRemap(void* ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
switch (conf->_items[ix]._type) {
case TS_RECORDDATATYPE_INT:
TSHttpTxnConfigIntSet(txnp, conf->_items[ix]._name, conf->_items[ix]._data.rec_int);
- TSDebug(PLUGIN_NAME, "Setting config id %d to %d", conf->_items[ix]._name, conf->_items[ix]._data.rec_int);
+ TSDebug(PLUGIN_NAME, "Setting config id %d to %"PRId64"", conf->_items[ix]._name, conf->_items[ix]._data.rec_int);
break;
case TS_RECORDDATATYPE_STRING:
TSHttpTxnConfigStringSet(txnp, conf->_items[ix]._name, conf->_items[ix]._data.rec_string, conf->_items[ix]._data_len);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/FetchSM.cc
----------------------------------------------------------------------
diff --git a/proxy/FetchSM.cc b/proxy/FetchSM.cc
index b096177..821ae09 100644
--- a/proxy/FetchSM.cc
+++ b/proxy/FetchSM.cc
@@ -132,7 +132,7 @@ FetchSM::process_fetch_read(int event)
switch (event) {
case TS_EVENT_VCONN_READ_READY:
bytes = resp_reader->read_avail();
- Debug(DEBUG_TAG, "[%s] number of bytes in read ready %d", __FUNCTION__, bytes);
+ Debug(DEBUG_TAG, "[%s] number of bytes in read ready %"PRId64"", __FUNCTION__, bytes);
while (actual_bytes_copied < bytes) {
actual_bytes_copied = response_buffer->write(resp_reader, bytes, 0);
resp_reader->consume(actual_bytes_copied);
@@ -154,11 +154,11 @@ FetchSM::process_fetch_read(int event)
bytes = response_reader->read_avail();
get_info_from_buffer(response_reader);
- Debug(DEBUG_TAG, "[%s] number of bytes %d", __FUNCTION__, bytes);
+ Debug(DEBUG_TAG, "[%s] number of bytes %"PRId64"", __FUNCTION__, bytes);
if(client_response!=NULL)
client_response[bytes] = '\0';
//client_response[bytes + _headers.size()] = '\0';
- Debug(DEBUG_TAG, "[%s] Completed data fetch of size %d, notifying caller", __FUNCTION__, bytes);
+ Debug(DEBUG_TAG, "[%s] Completed data fetch of size %"PRId64", notifying caller", __FUNCTION__, bytes);
//InvokePlugin( TS_EVENT_INTERNAL_60200, (void *) client_response);
client_bytes = bytes;
//InvokePlugin( TS_EVENT_INTERNAL_60200, (void *) this);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/ICP.cc
----------------------------------------------------------------------
diff --git a/proxy/ICP.cc b/proxy/ICP.cc
index c8245a4..56e35c5 100644
--- a/proxy/ICP.cc
+++ b/proxy/ICP.cc
@@ -817,8 +817,8 @@ ICPPeerReadCont::PeerReadStateMachine(PeerReadData * s, Event * e)
if (s->_queryResult == CACHE_EVENT_LOOKUP) {
// Use the received ICP data buffer for the response message
- Debug("icp", "Sending ICP_OP_HIT for id=%d, [%s] to [%s]",
- s->_rICPmsg->h.requestno, data, ink_inet_nptop(&s->_sender, ipb, sizeof(ipb)));
+ Debug("icp", "Sending ICP_OP_HIT for id=%d, [%.*s] to [%s]",
+ s->_rICPmsg->h.requestno, datalen, (const char *)data, ink_inet_nptop(&s->_sender, ipb, sizeof(ipb)));
ICP_INCREMENT_DYN_STAT(icp_cache_lookup_success_stat);
status = ICPRequestCont::BuildICPMsg(ICP_OP_HIT,
s->_rICPmsg->h.requestno, 0 /* optflags */ , 0 /* optdata */ ,
@@ -826,8 +826,8 @@ ICPPeerReadCont::PeerReadStateMachine(PeerReadData * s, Event * e)
data, datalen, &s->_mhdr, s->_iov, s->_rICPmsg);
} else if (s->_queryResult == CACHE_EVENT_LOOKUP_FAILED) {
// Use the received ICP data buffer for response message
- Debug("icp", "Sending ICP_OP_MISS for id=%d, [%s] to [%s]",
- s->_rICPmsg->h.requestno, data, ink_inet_nptop(&s->_sender, ipb, sizeof(ipb)));
+ Debug("icp", "Sending ICP_OP_MISS for id=%d, [%.*s] to [%s]",
+ s->_rICPmsg->h.requestno, datalen, (const char *)data, ink_inet_nptop(&s->_sender, ipb, sizeof(ipb)));
ICP_INCREMENT_DYN_STAT(icp_cache_lookup_fail_stat);
status = ICPRequestCont::BuildICPMsg(ICP_OP_MISS,
s->_rICPmsg->h.requestno, 0 /* optflags */ , 0 /* optdata */ ,
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 1d6c263..bdfa0b8 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -467,7 +467,7 @@ cache_handler(TSCont contp, TSEvent event, void *data)
cache_vconn->read_vconnp = (TSVConn) data;
content_length = TSVConnCacheObjectSizeGet(cache_vconn->read_vconnp);
- Debug(UTDBG_TAG "_cache_read", "In cache open read [Content-Length: %d]", content_length);
+ Debug(UTDBG_TAG "_cache_read", "In cache open read [Content-Length: %"PRId64"]", content_length);
if (content_length != OBJECT_SIZE) {
SDK_RPRINT(SDK_Cache_test, "TSVConnCacheObjectSizeGet", "TestCase1", TC_FAIL, "cached data size is incorrect");
@@ -518,7 +518,7 @@ cache_handler(TSCont contp, TSEvent event, void *data)
nbytes = TSVIONBytesGet(cache_vconn->write_vio);
ndone = TSVIONDoneGet(cache_vconn->write_vio);
ntodo = TSVIONTodoGet(cache_vconn->write_vio);
- Debug(UTDBG_TAG "_cache_write", "Nbytes=%d Ndone=%d Ntodo=%d", nbytes, ndone, ntodo);
+ Debug(UTDBG_TAG "_cache_write", "Nbytes=%"PRId64" Ndone=%"PRId64" Ntodo=%"PRId64"", nbytes, ndone, ntodo);
if (ndone == (OBJECT_SIZE / 2)) {
TSVIONBytesSet(cache_vconn->write_vio, (OBJECT_SIZE - 100));
@@ -621,7 +621,7 @@ cache_handler(TSCont contp, TSEvent event, void *data)
nbytes = TSVIONBytesGet(cache_vconn->write_vio);
ndone = TSVIONDoneGet(cache_vconn->write_vio);
ntodo = TSVIONTodoGet(cache_vconn->write_vio);
- Debug(UTDBG_TAG "_cache_write", "Nbytes=%d Ndone=%d Ntodo=%d", nbytes, ndone, ntodo);
+ Debug(UTDBG_TAG "_cache_write", "Nbytes=%"PRId64" Ndone=%"PRId64" Ntodo=%"PRId64"", nbytes, ndone, ntodo);
TSVIOReenable(cache_vconn->write_vio);
return 1;
@@ -639,7 +639,7 @@ cache_handler(TSCont contp, TSEvent event, void *data)
nbytes = TSVIONBytesGet(cache_vconn->read_vio);
ntodo = TSVIONTodoGet(cache_vconn->read_vio);
ndone = TSVIONDoneGet(cache_vconn->read_vio);
- Debug(UTDBG_TAG "_cache_read", "Nbytes=%d Ndone=%d Ntodo=%d", nbytes, ndone, ntodo);
+ Debug(UTDBG_TAG "_cache_read", "Nbytes=%"PRId64" Ndone=%"PRId64" Ntodo=%"PRId64"", nbytes, ndone, ntodo);
if (nbytes != (ndone + ntodo)) {
SDK_RPRINT(SDK_Cache_test, "TSVIONBytesGet", "TestCase1", TC_FAIL, "read_vio corrupted");
@@ -686,7 +686,7 @@ cache_handler(TSCont contp, TSEvent event, void *data)
nbytes = TSVIONBytesGet(cache_vconn->read_vio);
ntodo = TSVIONTodoGet(cache_vconn->read_vio);
ndone = TSVIONDoneGet(cache_vconn->read_vio);
- Debug(UTDBG_TAG "_cache_read", "Nbytes=%d Ndone=%d Ntodo=%d", nbytes, ndone, ntodo);
+ Debug(UTDBG_TAG "_cache_read", "Nbytes=%"PRId64" Ndone=%"PRId64" Ntodo=%"PRId64"", nbytes, ndone, ntodo);
if (nbytes != (ndone + ntodo)) {
SDK_RPRINT(SDK_Cache_test, "TSVIONBytesGet", "TestCase1", TC_FAIL, "read_vio corrupted");
@@ -705,7 +705,7 @@ cache_handler(TSCont contp, TSEvent event, void *data)
// Fix for bug INKqa12276: Must consume data from iobuffer
nbytes = TSIOBufferReaderAvail(cache_vconn->out_readerp);
TSIOBufferReaderConsume(cache_vconn->out_readerp, nbytes);
- TSDebug(UTDBG_TAG "_cache_read", "Consuming %d bytes from cache read VC", nbytes);
+ TSDebug(UTDBG_TAG "_cache_read", "Consuming %"PRId64" bytes from cache read VC", nbytes);
TSVIOReenable(cache_vconn->read_vio);
Debug(UTDBG_TAG "_cache_read", "finishing up [j]");
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/InkAPITestTool.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITestTool.cc b/proxy/InkAPITestTool.cc
index e486f18..666efaf 100644
--- a/proxy/InkAPITestTool.cc
+++ b/proxy/InkAPITestTool.cc
@@ -540,7 +540,7 @@ synclient_txn_read_response(TSCont contp)
memcpy((char *) (txn->response + txn->response_len), blockptr, blocklen);
txn->response_len += blocklen;
} else {
- TSError("Error: Response length %d > response buffer size %d", txn->response_len+blocklen, RESPONSE_MAX_SIZE);
+ TSError("Error: Response length %"PRId64" > response buffer size %d", txn->response_len+blocklen, RESPONSE_MAX_SIZE);
}
block = TSIOBufferBlockNext(block);
@@ -571,7 +571,7 @@ synclient_txn_read_response_handler(TSCont contp, TSEvent event, void *data)
}
avail = TSIOBufferReaderAvail(txn->resp_reader);
- TSDebug(CDBG_TAG, "%d bytes available in buffer", avail);
+ TSDebug(CDBG_TAG, "%"PRId64" bytes available in buffer", avail);
if (avail > 0) {
synclient_txn_read_response(contp);
@@ -627,7 +627,7 @@ synclient_txn_write_request(TSCont contp)
}
/* Start writing the response */
- TSDebug(CDBG_TAG, "Writing |%s| (%d) bytes", txn->request, len);
+ TSDebug(CDBG_TAG, "Writing |%s| (%"PRId64") bytes", txn->request, len);
txn->write_vio = TSVConnWrite(txn->vconn, contp, txn->req_reader, len);
return 1;
@@ -881,7 +881,7 @@ synserver_txn_write_response(TSCont contp)
}
/* Start writing the response */
- TSDebug(SDBG_TAG, "Writing response: |%s| (%d) bytes)", response, len);
+ TSDebug(SDBG_TAG, "Writing response: |%s| (%"PRId64") bytes)", response, len);
txn->write_vio = TSVConnWrite(txn->vconn, contp, txn->resp_reader, len);
/* Now that response is in IOBuffer, free up response */
@@ -945,7 +945,7 @@ synserver_txn_read_request(TSCont contp)
memcpy((char *) (txn->request + txn->request_len), blockptr, blocklen);
txn->request_len += blocklen;
} else {
- TSError("Error: Request length %d > request buffer size %d", txn->request_len+blocklen, REQUEST_MAX_SIZE);
+ TSError("Error: Request length %"PRId64" > request buffer size %d", txn->request_len+blocklen, REQUEST_MAX_SIZE);
}
block = TSIOBufferBlockNext(block);
@@ -975,7 +975,7 @@ synserver_txn_read_request_handler(TSCont contp, TSEvent event, void *data)
case TS_EVENT_VCONN_READ_COMPLETE:
TSDebug(SDBG_TAG, (event == TS_EVENT_VCONN_READ_READY) ? "READ_READY" : "READ_COMPLETE");
avail = TSIOBufferReaderAvail(txn->req_reader);
- TSDebug(SDBG_TAG, "%d bytes available in buffer", avail);
+ TSDebug(SDBG_TAG, "%"PRId64" bytes available in buffer", avail);
if (avail > 0) {
end_of_request = synserver_txn_read_request(contp);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b3bae36/proxy/ParentSelection.cc
----------------------------------------------------------------------
diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index e080b6c..978a8cf 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -306,7 +306,7 @@ ParentConfigParams::findParent(HttpRequestData * rdata, ParentResult * result)
Debug("parent_select", "Result for %s was %s", host, ParentResultStr[result->r]);
break;
case PARENT_SPECIFIED:
- Debug("parent_select", "sizeof ParentResult = %d", sizeof(ParentResult));
+ Debug("parent_select", "sizeof ParentResult = %zu", sizeof(ParentResult));
Debug("parent_select", "Result for %s was parent %s:%d", host, result->hostname, result->port);
break;
default:
@@ -555,8 +555,8 @@ ParentRecord::FindParent(bool first_call, ParentResult * result, RD * rdata, Par
parentUp = true;
} else {
if ((result->wrap_around) || ((parents[cur_index].failedAt + config->ParentRetryTime) < request_info->xact_start)) {
- Debug("parent_select", "Parent[%d].failedAt = %u, retry = %u,xact_start = %u but wrap = %d", cur_index,
- parents[cur_index].failedAt, config->ParentRetryTime, request_info->xact_start, result->wrap_around);
+ Debug("parent_select", "Parent[%d].failedAt = %u, retry = %u,xact_start = %lld but wrap = %d", cur_index,
+ parents[cur_index].failedAt, config->ParentRetryTime, (long long)request_info->xact_start, result->wrap_around);
// Reuse the parent
parentUp = true;
parentRetry = true;
@@ -831,7 +831,7 @@ ParentRecord::UpdateMatch(ParentResult * result, RD * rdata)
result->rec = this;
result->line_number = this->line_num;
- Debug("parent_select", "Matched with 0x%x parent node from line %d", this, this->line_num);
+ Debug("parent_select", "Matched with %p parent node from line %d", this, this->line_num);
}
}