summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Kozina <okozina@redhat.com>2015-05-12 15:26:26 +0200
committerOndrej Kozina <okozina@redhat.com>2015-05-12 17:16:37 +0200
commitc3d351ec9b4d98a08b4d5556130870332f650b67 (patch)
tree95f5965445f84e6712225ae745ef036f734332ec
parente213aa17bd9ef648f8fc44047ab4bd8c8ff80959 (diff)
downloadlvm2-c3d351ec9b4d98a08b4d5556130870332f650b67.tar.gz
new debug class for lvmpolld client code
-rw-r--r--conf/example.conf.in4
-rw-r--r--lib/commands/toolcontext.c2
-rw-r--r--lib/config/config_settings.h4
-rw-r--r--lib/config/defaults.h3
-rw-r--r--lib/log/log.h2
5 files changed, 10 insertions, 5 deletions
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 843e62d79..fc27a9824 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -500,10 +500,10 @@ log {
# and only appear in debug output if the class is
# listed here. Classes currently available:
# memory, devices, activation, allocation,
- # lvmetad, metadata, cache, locking.
+ # lvmetad, metadata, cache, locking, lvmpolld.
# Use "all" to see everything.
debug_classes = ["memory", "devices", "activation", "allocation",
- "lvmetad", "metadata", "cache", "locking"]
+ "lvmetad", "metadata", "cache", "locking", "lvmpolld"]
}
# Configuration section backup.
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 43d878b5d..47aa209d5 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -274,6 +274,8 @@ static int _parse_debug_classes(struct cmd_context *cmd)
debug_classes |= LOG_CLASS_CACHE;
else if (!strcasecmp(cv->v.str, "locking"))
debug_classes |= LOG_CLASS_LOCKING;
+ else if (!strcasecmp(cv->v.str, "lvmpolld"))
+ debug_classes |= LOG_CLASS_LVMPOLLD;
else
log_verbose("Unrecognised value for log/debug_classes: %s", cv->v.str);
}
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 2bbafc349..4fd886d4e 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -546,13 +546,13 @@ cfg(log_activation_CFG, "activation", log_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(
cfg(log_activate_file_CFG, "activate_file", log_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_UNSUPPORTED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL, NULL)
-cfg_array(log_debug_classes_CFG, "debug_classes", log_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, "#Smemory#Sdevices#Sactivation#Sallocation#Slvmetad#Smetadata#Scache#Slocking", vsn(2, 2, 99), NULL, 0, NULL,
+cfg_array(log_debug_classes_CFG, "debug_classes", log_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, "#Smemory#Sdevices#Sactivation#Sallocation#Slvmetad#Smetadata#Scache#Slocking#Slvmpolld", vsn(2, 2, 99), NULL, 0, NULL,
"Select log messages by class.\n"
"Some debugging messages are assigned to a class\n"
"and only appear in debug output if the class is\n"
"listed here. Classes currently available:\n"
"memory, devices, activation, allocation,\n"
- "lvmetad, metadata, cache, locking.\n"
+ "lvmetad, metadata, cache, locking, lvmpolld.\n"
"Use \"all\" to see everything.\n")
cfg(backup_backup_CFG, "backup", backup_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_BACKUP_ENABLED, vsn(1, 0, 0), NULL, 0, NULL,
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index b74566295..6793d0167 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -144,7 +144,8 @@
#define DEFAULT_LOGGED_DEBUG_CLASSES (LOG_CLASS_MEM | LOG_CLASS_DEVS | \
LOG_CLASS_ACTIVATION | LOG_CLASS_ALLOC | LOG_CLASS_LVMETAD | \
- LOG_CLASS_METADATA | LOG_CLASS_CACHE | LOG_CLASS_LOCKING)
+ LOG_CLASS_METADATA | LOG_CLASS_CACHE | LOG_CLASS_LOCKING | \
+ LOG_CLASS_LVMPOLLD)
#define DEFAULT_SYSLOG 1
#define DEFAULT_VERBOSE 0
diff --git a/lib/log/log.h b/lib/log/log.h
index 75a62206a..79e7d77c5 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -67,6 +67,7 @@
#define LOG_CLASS_METADATA 0x0020 /* "metadata" */
#define LOG_CLASS_CACHE 0x0040 /* "cache" */
#define LOG_CLASS_LOCKING 0x0080 /* "locking" */
+#define LOG_CLASS_LVMPOLLD 0x0100 /* "lvmpolld" */
#define log_debug(x...) LOG_LINE(_LOG_DEBUG, x)
#define log_debug_mem(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_MEM, x)
@@ -77,6 +78,7 @@
#define log_debug_metadata(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_METADATA, x)
#define log_debug_cache(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_CACHE, x)
#define log_debug_locking(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_LOCKING, x)
+#define log_debug_lvmpolld(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_LVMPOLLD, x)
#define log_info(x...) LOG_LINE(_LOG_INFO, x)
#define log_notice(x...) LOG_LINE(_LOG_NOTICE, x)