summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c7
-rw-r--r--xlators/performance/quick-read/src/quick-read.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 4dbb1aa01a9..85e876531a5 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -1816,7 +1816,6 @@ __ioc_cache_dump (ioc_inode_t *ioc_inode, char *prefix)
ioc_table_t *table = NULL;
ioc_page_t *page = NULL;
int i = 0;
- struct tm *tm = NULL;
char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char timestr[256] = {0, };
@@ -1827,9 +1826,9 @@ __ioc_cache_dump (ioc_inode_t *ioc_inode, char *prefix)
table = ioc_inode->table;
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_time_fmt (timestr, sizeof timestr,
+ ioc_inode->cache.tv.tv_sec, gf_timefmt_FT);
+ snprintf (timestr + strlen (timestr), sizeof timestr - strlen (timestr),
".%"GF_PRI_SUSECONDS, ioc_inode->cache.tv.tv_usec);
gf_proc_dump_write ("last-cache-validation-time", "%s",
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 05130878470..6e4ce816ec7 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -3435,7 +3435,6 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode)
int32_t ret = -1;
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
char buf[256] = {0, };
- struct tm *tm = NULL;
ret = inode_ctx_get (inode, this, &value);
if (ret != 0) {
goto out;
@@ -3453,9 +3452,9 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode)
gf_proc_dump_write ("entire-file-cached", "%s", qr_inode->xattr ? "yes" : "no");
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_time_fmt (buf, sizeof buf, qr_inode->tv.tv_sec,
+ gf_timefmt_FT);
+ snprintf (buf + strlen (buf), sizeof buf - strlen (buf),
".%"GF_PRI_SUSECONDS, qr_inode->tv.tv_usec);
gf_proc_dump_write ("last-cache-validation-time", "%s", buf);