Skip to content

Commit 462f2e0

Browse files
committed
add more debug statements
1 parent f5bbe7a commit 462f2e0

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

server/src/unifyfs_inode.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,11 @@ int unifyfs_inode_cache_extents(int gfid,
546546
ino->extents_cache = extents;
547547
ino->extents_cache_count = num_extents;
548548
ino->cache_time = *cache_time;
549-
LOGINFO("cached %d extents to inode (gfid=%d)",
550-
num_extents, gfid);
549+
LOGINFO("caching %d extents to inode (gfid=%d) "
550+
"using timestamp=%lu.%09lu",
551+
num_extents, gfid,
552+
cache_time->tv_sec,
553+
cache_time->tv_nsec);
551554
}
552555
} else {
553556
LOGDBG("local cache time for gfid=%d already matches", gfid);
@@ -783,6 +786,8 @@ int unifyfs_inode_get_extent_chunks(unifyfs_extent_t* extent,
783786
cache_expire.tv_sec += UNIFYFS_METADATA_CACHE_SECONDS;
784787
clock_gettime(CLOCK_REALTIME, &now);
785788
if (compare_timespec(&now, &cache_expire) <= 0) {
789+
LOGDBG("using cached extent metadata - stamp=(%lu.%09lu)",
790+
ino->cache_time.tv_sec, ino->cache_time.tv_nsec);
786791
ret = get_extent_cache_chunks(extent,
787792
ino->extents_cache,
788793
ino->extents_cache_count,
@@ -791,6 +796,9 @@ int unifyfs_inode_get_extent_chunks(unifyfs_extent_t* extent,
791796
if (UNIFYFS_SUCCESS == ret) {
792797
done = 1;
793798
}
799+
} else {
800+
LOGDBG("NOT using cached extent metadata - stamp=(%lu.%09lu)",
801+
ino->cache_time.tv_sec, ino->cache_time.tv_nsec);
794802
}
795803
}
796804

server/src/unifyfs_p2p_rpc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ int add_pending_remote_request(int peer_rank,
206206
bool have_pending = check_pending_remote_request(peer_rank, gfid,
207207
op, &preq);
208208
if (have_pending) {
209+
LOGDBG("found pending (op=%d) to rank[%d] for gfid=%d - preq(%p)",
210+
op, peer_rank, gfid, preq);
209211
ret = UNIFYFS_PENDING;
210212
} else {
211213
preq = (p2p_request*) calloc(1, sizeof(p2p_request));
@@ -221,6 +223,8 @@ int add_pending_remote_request(int peer_rank,
221223
return rc;
222224
}
223225
preq->client_req = client_req;
226+
LOGDBG("allocated pending (op=%d) to rank[%d] for gfid=%d - preq(%p)",
227+
op, peer_rank, gfid, preq);
224228
ret = UNIFYFS_SUCCESS;
225229
}
226230

@@ -273,6 +277,8 @@ int add_pending_remote_request(int peer_rank,
273277
if ((ret == UNIFYFS_SUCCESS) || (ret == UNIFYFS_PENDING)) {
274278
*preqp = preq;
275279
} else if (allocated) {
280+
LOGDBG("an error occurred (ret=%d) - cleaning preq(%p)", ret, preq);
281+
clear_pending_remote_request(preq);
276282
cleanup_p2p_request(preq);
277283
free(preq);
278284
}

0 commit comments

Comments
 (0)