From 63d4382103573867b10efeb44acfb0bb6e4e1614 Mon Sep 17 00:00:00 2001 From: Hari Gowtham Date: Thu, 13 Aug 2015 12:53:33 +0530 Subject: performance translators : port the missing gf_log to gf_msg backport of: http://review.gluster.org/#/c/11906/ > Change-Id: I5cc2b4669b164fe09637c86da05d2d94589dd7e4 > BUG: 1253149 > Signed-off-by: Hari Gowtham > Reviewed-on: http://review.gluster.org/11906 > Tested-by: NetBSD Build System > Reviewed-by: Raghavendra G > Signed-off-by: Hari Gowtham Change-Id: I54c35e86428a01af5b593df7d3c9bf66a599999c BUG: 1258727 Signed-off-by: Hari Gowtham Reviewed-on: http://review.gluster.org/12073 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra G --- .../performance/io-cache/src/io-cache-messages.h | 28 +++++++++++++++++++++- xlators/performance/io-cache/src/ioc-inode.c | 6 +++-- xlators/performance/io-cache/src/page.c | 3 ++- 3 files changed, 33 insertions(+), 4 deletions(-) (limited to 'xlators/performance/io-cache') diff --git a/xlators/performance/io-cache/src/io-cache-messages.h b/xlators/performance/io-cache/src/io-cache-messages.h index 5c4fbea46fc..ba6b55d1299 100644 --- a/xlators/performance/io-cache/src/io-cache-messages.h +++ b/xlators/performance/io-cache/src/io-cache-messages.h @@ -40,7 +40,7 @@ */ #define GLFS_IO_CACHE_BASE GLFS_MSGID_COMP_IO_CACHE -#define GLFS_IO_CACHE_NUM_MESSAGES 6 +#define GLFS_IO_CACHE_NUM_MESSAGES 9 #define GLFS_MSGID_END (GLFS_IO_CACHE_BASE + GLFS_IO_CACHE_NUM_MESSAGES + 1) /* Messages with message IDs */ @@ -103,6 +103,32 @@ #define IO_CACHE_MSG_INODE_NULL (GLFS_IO_CACHE_BASE + 6) +/*! + * @messageid + * @diagnosis + * @recommendedaction None + * + */ + +#define IO_CACHE_MSG_PAGE_WAIT_VALIDATE (GLFS_IO_CACHE_BASE + 7) + +/*! + * @messageid + * @diagnosis + * @recommendedaction None + * + */ + +#define IO_CACHE_MSG_STR_COVERSION_FAILED (GLFS_IO_CACHE_BASE + 8) + +/*! + * @messageid + * @diagnosis + * @recommendedaction None + * + */ + +#define IO_CACHE_MSG_WASTED_COPY (GLFS_IO_CACHE_BASE + 9) /*------------*/ #define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages" diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c index fcaab962b35..f5400f5cdb2 100644 --- a/xlators/performance/io-cache/src/ioc-inode.c +++ b/xlators/performance/io-cache/src/ioc-inode.c @@ -52,7 +52,8 @@ ptr_to_str (void *ptr) ret = gf_asprintf (&str, "%p", ptr); if (-1 == ret) { - gf_log ("io-cache", GF_LOG_WARNING, + gf_msg ("io-cache", GF_LOG_WARNING, 0, + IO_CACHE_MSG_STR_COVERSION_FAILED, "asprintf failed while converting ptr to str"); str = NULL; goto out; @@ -100,7 +101,8 @@ ioc_inode_wakeup (call_frame_t *frame, ioc_inode_t *ioc_inode, cache_still_valid = 0; if (!waiter) { - gf_log (frame->this->name, GF_LOG_WARNING, + gf_msg (frame->this->name, GF_LOG_WARNING, 0, + IO_CACHE_MSG_PAGE_WAIT_VALIDATE, "cache validate called without any " "page waiting to be validated"); } diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index 4019ec0a2e6..af4d9009ad2 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -472,7 +472,8 @@ ioc_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (!page) { /* page was flushed */ /* some serious bug ? */ - gf_log (frame->this->name, GF_LOG_WARNING, + gf_msg (frame->this->name, GF_LOG_WARNING, 0, + IO_CACHE_MSG_WASTED_COPY, "wasted copy: %"PRId64"[+%"PRId64"] " "ioc_inode=%p", offset, table->page_size, ioc_inode); -- cgit