diff options
-rw-r--r-- | xlators/cluster/dht/src/dht.c | 5 | ||||
-rw-r--r-- | xlators/performance/io-cache/src/io-cache.c | 13 | ||||
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 12 |
3 files changed, 19 insertions, 11 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index 96382bf16e0..f73600d7bb8 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -144,7 +144,10 @@ dht_priv_dump (xlator_t *this) conf->du_stats->avail_inodes); gf_proc_dump_write("du_stats.log", "%lu", conf->du_stats->log); } - gf_proc_dump_write("last_stat_fetch", "%s", ctime(&conf->last_stat_fetch.tv_sec)); + + if (conf->last_stat_fetch.tv_sec) + gf_proc_dump_write("last_stat_fetch", "%s", + ctime(&conf->last_stat_fetch.tv_sec)); UNLOCK(&conf->subvolume_lock); diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 3296682303d..78c8b14bf00 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1834,12 +1834,15 @@ __ioc_cache_dump (ioc_inode_t *ioc_inode, char *prefix) table = ioc_inode->table; - tm = localtime (&ioc_inode->cache.tv.tv_sec); - strftime (timestr, 256, "%Y-%m-%d %H:%M:%S", tm); - snprintf (timestr + strlen (timestr), 256 - strlen (timestr), - ".%"GF_PRI_SUSECONDS, ioc_inode->cache.tv.tv_usec); + if (ioc_inode->cache.tv.tv_sec) { + tm = localtime (&ioc_inode->cache.tv.tv_sec); + strftime (timestr, 256, "%Y-%m-%d %H:%M:%S", tm); + snprintf (timestr + strlen (timestr), 256 - strlen (timestr), + ".%"GF_PRI_SUSECONDS, ioc_inode->cache.tv.tv_usec); - gf_proc_dump_write ("last-cache-validation-time", "%s", timestr); + gf_proc_dump_write ("last-cache-validation-time", "%s", + timestr); + } for (offset = 0; offset < ioc_inode->ia_size; offset += table->page_size) { diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index a64e63de4ba..1d682b62dce 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -3164,12 +3164,14 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode) gf_proc_dump_write ("entire-file-cached", "%s", qr_inode->xattr ? "yes" : "no"); - tm = localtime (&qr_inode->tv.tv_sec); - strftime (buf, 256, "%Y-%m-%d %H:%M:%S", tm); - snprintf (buf + strlen (buf), 256 - strlen (buf), - ".%"GF_PRI_SUSECONDS, qr_inode->tv.tv_usec); + if (qr_inode->tv.tv_sec) { + tm = localtime (&qr_inode->tv.tv_sec); + strftime (buf, 256, "%Y-%m-%d %H:%M:%S", tm); + snprintf (buf + strlen (buf), 256 - strlen (buf), + ".%"GF_PRI_SUSECONDS, qr_inode->tv.tv_usec); - gf_proc_dump_write ("last-cache-validation-time", "%s", buf); + gf_proc_dump_write ("last-cache-validation-time", "%s", buf); + } ret = 0; out: |