From 0baf199b065ee3adcbf36a503ac91737ab39f7e1 Mon Sep 17 00:00:00 2001 From: Hari Gowtham Date: Thu, 13 Aug 2015 12:53:33 +0530 Subject: performance translators : porting the missing gf_log to gf_msg 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 --- .../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 ++- .../quick-read/src/quick-read-messages.h | 11 ++++++++- xlators/performance/quick-read/src/quick-read.c | 5 ++-- .../read-ahead/src/read-ahead-messages.h | 19 ++++++++++++++- xlators/performance/read-ahead/src/read-ahead.c | 7 ++++-- .../performance/symlink-cache/src/symlink-cache.c | 3 ++- 8 files changed, 71 insertions(+), 11 deletions(-) (limited to 'xlators/performance') 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 53bbd0448f2..cee3bad8c22 100644 --- a/xlators/performance/io-cache/src/ioc-inode.c +++ b/xlators/performance/io-cache/src/ioc-inode.c @@ -47,7 +47,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; @@ -95,7 +96,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 a0f01da6d2e..50f5e190e21 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -467,7 +467,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); diff --git a/xlators/performance/quick-read/src/quick-read-messages.h b/xlators/performance/quick-read/src/quick-read-messages.h index d7444dd8c8f..a3bd594471f 100644 --- a/xlators/performance/quick-read/src/quick-read-messages.h +++ b/xlators/performance/quick-read/src/quick-read-messages.h @@ -40,7 +40,7 @@ */ #define GLFS_QUICK_READ_BASE GLFS_MSGID_COMP_QUICK_READ -#define GLFS_QUICK_READ_NUM_MESSAGES 7 +#define GLFS_QUICK_READ_NUM_MESSAGES 8 #define GLFS_MSGID_END (GLFS_QUICK_READ_BASE +\ GLFS_QUICK_READ_NUM_MESSAGES + 1) @@ -105,6 +105,15 @@ #define QUICK_READ_MSG_INVALID_CONFIG (GLFS_QUICK_READ_BASE + 7) +/*! + * @messageid + * @diagnosis + * @recommendedaction None + * + */ + +#define QUICK_READ_MSG_LRU_NOT_EMPTY (GLFS_QUICK_READ_BASE + 8) + /*! * @messageid * @diagnosis diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 1426ae5760d..58fde4b4e81 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -1067,8 +1067,9 @@ qr_inode_table_destroy (qr_private_t *priv) * that is fixed, log the assert as warning. GF_ASSERT (list_empty (&priv->table.lru[i]));*/ if (!list_empty (&priv->table.lru[i])) { - gf_log ("quick-read", GF_LOG_INFO, - "quick read inode table lru not empty"); + gf_msg ("quick-read", GF_LOG_INFO, 0, + QUICK_READ_MSG_LRU_NOT_EMPTY, + "quick read inode table lru not empty"); } } diff --git a/xlators/performance/read-ahead/src/read-ahead-messages.h b/xlators/performance/read-ahead/src/read-ahead-messages.h index a205ceeb855..e6eaab10777 100644 --- a/xlators/performance/read-ahead/src/read-ahead-messages.h +++ b/xlators/performance/read-ahead/src/read-ahead-messages.h @@ -40,7 +40,7 @@ */ #define GLFS_READ_AHEAD_BASE GLFS_MSGID_COMP_READ_AHEAD -#define GLFS_READ_AHEAD_NUM_MESSAGES 4 +#define GLFS_READ_AHEAD_NUM_MESSAGES 6 #define GLFS_MSGID_END (GLFS_READ_AHEAD_BASE +\ GLFS_READ_AHEAD_NUM_MESSAGES + 1) @@ -86,6 +86,23 @@ #define READ_AHEAD_MSG_FD_CONTEXT_NOT_SET (GLFS_READ_AHEAD_BASE + 4) +/*! + * @messageid + * @diagnosis + * @recommendedaction None + * + */ + +#define READ_AHEAD_MSG_UNDESTROYED_FILE_FOUND (GLFS_READ_AHEAD_BASE + 5) + +/*! + * @messageid + * @diagnosis + * @recommendedaction None + * + */ + +#define READ_AHEAD_MSG_XLATOR_CONF_NULL (GLFS_READ_AHEAD_BASE + 6) /*------------*/ #define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages" diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 923163ab07c..242b57971a0 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -1059,7 +1059,9 @@ ra_priv_dump (xlator_t *this) conf = this->private; if (!conf) { - gf_log (this->name, GF_LOG_WARNING, "conf null in xlator"); + gf_msg (this->name, GF_LOG_WARNING, 0, + READ_AHEAD_MSG_XLATOR_CONF_NULL, + "conf null in xlator"); goto out; } @@ -1217,7 +1219,8 @@ fini (xlator_t *this) */ if (!((conf->files.next == &conf->files) && (conf->files.prev == &conf->files))) { - gf_log (this->name, GF_LOG_INFO, + gf_msg (this->name, GF_LOG_INFO, 0, + READ_AHEAD_MSG_UNDESTROYED_FILE_FOUND, "undestroyed read ahead file structures found"); } diff --git a/xlators/performance/symlink-cache/src/symlink-cache.c b/xlators/performance/symlink-cache/src/symlink-cache.c index 973565cd93e..596b4c53b7b 100644 --- a/xlators/performance/symlink-cache/src/symlink-cache.c +++ b/xlators/performance/symlink-cache/src/symlink-cache.c @@ -187,7 +187,8 @@ sc_cache_validate (xlator_t *this, inode_t *inode, struct iatt *buf) inode_ctx_get (inode, this, &tmp_sc); if (!tmp_sc) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + SYMLINK_CACHE_MSG_NO_MEMORY, "out of memory :("); return 0; } -- cgit