Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 616559 Details for
Bug 838743
[RFE] Enhancement to the Corosync logging for the CPG system
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add support for debug level trace in config file
2012-09-19-0001-Add-support-for-debug-level-trace-in-config-file.patch (text/plain), 4.87 KB, created by
Jan Friesse
on 2012-09-24 13:34:28 UTC
(
hide
)
Description:
Add support for debug level trace in config file
Filename:
MIME Type:
Creator:
Jan Friesse
Created:
2012-09-24 13:34:28 UTC
Size:
4.87 KB
patch
obsolete
>From 02254400d79366ee951024f4558a4a90b98abdd9 Mon Sep 17 00:00:00 2001 >From: Jan Friesse <jfriesse@redhat.com> >Date: Wed, 19 Sep 2012 15:21:14 +0200 >Subject: [PATCH 1/2] Add support for debug level trace in config file > >Because logsys uses 3-bits for log level encoded in rec, it's impossible >to add trace log level in clean way. Instead of that, we are using >recid of TRACE1 for trace messages. So if trace is allowed in >configuration file, we change old condition to log only LOGSYS_RECID_LOG >to log also LOGSYS_RECID_TRACE1. > >Signed-off-by: Jan Friesse <jfriesse@redhat.com> >--- > exec/logsys.c | 35 +++++++++++++++++++++++++++++------ > exec/mainconfig.c | 10 ++++++++-- > include/corosync/engine/logsys.h | 7 +++++++ > man/corosync.conf.5 | 3 ++- > 4 files changed, 46 insertions(+), 9 deletions(-) > >diff --git a/exec/logsys.c b/exec/logsys.c >index 4c3e11a..34de644 100644 >--- a/exec/logsys.c >+++ b/exec/logsys.c >@@ -144,6 +144,7 @@ struct logsys_logger { > int logfile_priority; /* priority to file */ > int init_status; /* internal field to handle init queues > for subsystems */ >+ unsigned int trace1_allowed; > }; > > >@@ -439,13 +440,14 @@ static void log_printf_to_logs ( > int c; > struct tm tm_res; > >- if (LOGSYS_DECODE_RECID(rec_ident) != LOGSYS_RECID_LOG) { >- return; >- } >- > subsysid = LOGSYS_DECODE_SUBSYSID(rec_ident); > level = LOGSYS_DECODE_LEVEL(rec_ident); > >+ if (!((LOGSYS_DECODE_RECID(rec_ident) == LOGSYS_RECID_LOG) || >+ (logsys_loggers[subsysid].trace1_allowed && LOGSYS_DECODE_RECID(rec_ident) == LOGSYS_RECID_TRACE1))) { >+ return; >+ } >+ > while ((c = format_buffer[format_buffer_idx])) { > cutoff = 0; > if (c != '%') { >@@ -960,6 +962,7 @@ int _logsys_system_setup( > logsys_loggers[i].mode = mode; > > logsys_loggers[i].debug = debug; >+ logsys_loggers[i].trace1_allowed = 0; > > if (logsys_config_file_set_unlocked (i, &errstr, logfile) < 0) { > pthread_mutex_unlock (&logsys_config_mutex); >@@ -1495,12 +1498,32 @@ int logsys_config_debug_set ( > if (subsys != NULL) { > i = _logsys_config_subsys_get_unlocked (subsys); > if (i >= 0) { >- logsys_loggers[i].debug = debug; >+ switch (debug) { >+ case LOGSYS_DEBUG_OFF: >+ case LOGSYS_DEBUG_ON: >+ logsys_loggers[i].debug = debug; >+ logsys_loggers[i].trace1_allowed = 0; >+ break; >+ case LOGSYS_DEBUG_TRACE: >+ logsys_loggers[i].debug = LOGSYS_DEBUG_ON; >+ logsys_loggers[i].trace1_allowed = 1; >+ break; >+ } > i = 0; > } > } else { > for (i = 0; i <= LOGSYS_MAX_SUBSYS_COUNT; i++) { >- logsys_loggers[i].debug = debug; >+ switch (debug) { >+ case LOGSYS_DEBUG_OFF: >+ case LOGSYS_DEBUG_ON: >+ logsys_loggers[i].debug = debug; >+ logsys_loggers[i].trace1_allowed = 0; >+ break; >+ case LOGSYS_DEBUG_TRACE: >+ logsys_loggers[i].debug = LOGSYS_DEBUG_ON; >+ logsys_loggers[i].trace1_allowed = 1; >+ break; >+ } > } > i = 0; > } >diff --git a/exec/mainconfig.c b/exec/mainconfig.c >index cbc41f5..d15dd49 100644 >--- a/exec/mainconfig.c >+++ b/exec/mainconfig.c >@@ -424,14 +424,20 @@ static int corosync_main_config_set ( > } > > if (!objdb_get_string (objdb, object_handle, "debug", &value)) { >+ if (strcmp (value, "trace") == 0) { >+ if (logsys_config_debug_set (subsys, LOGSYS_DEBUG_TRACE) < 0) { >+ error_reason = "unable to set debug on"; >+ goto parse_error; >+ } >+ } else > if (strcmp (value, "on") == 0) { >- if (logsys_config_debug_set (subsys, 1) < 0) { >+ if (logsys_config_debug_set (subsys, LOGSYS_DEBUG_ON) < 0) { > error_reason = "unable to set debug on"; > goto parse_error; > } > } else > if (strcmp (value, "off") == 0) { >- if (logsys_config_debug_set (subsys, 0) < 0) { >+ if (logsys_config_debug_set (subsys, LOGSYS_DEBUG_OFF) < 0) { > error_reason = "unable to set debug off"; > goto parse_error; > } >diff --git a/include/corosync/engine/logsys.h b/include/corosync/engine/logsys.h >index df1db1d..6b26a9f 100644 >--- a/include/corosync/engine/logsys.h >+++ b/include/corosync/engine/logsys.h >@@ -58,6 +58,7 @@ extern "C" { > #define LOGSYS_MODE_FORK (1<<3) > #define LOGSYS_MODE_THREADED (1<<4) > >+ > /* > * Log priorities, compliant with syslog and SA Forum Log spec. > */ >@@ -92,6 +93,12 @@ extern "C" { > #define LOGSYS_RECID_TRACE7 (LOGSYS_RECID_MAX - 10) > #define LOGSYS_RECID_TRACE8 (LOGSYS_RECID_MAX - 11) > >+/* >+ * Debug levels >+ */ >+#define LOGSYS_DEBUG_OFF 0 >+#define LOGSYS_DEBUG_ON 1 >+#define LOGSYS_DEBUG_TRACE 2 > > /* > * Internal APIs that must be globally exported >diff --git a/man/corosync.conf.5 b/man/corosync.conf.5 >index 82ec80e..bad9700 100644 >--- a/man/corosync.conf.5 >+++ b/man/corosync.conf.5 >@@ -601,7 +601,8 @@ The default is: info. > > .TP > debug >-This specifies whether debug output is logged for this particular logger. >+This specifies whether debug output is logged for this particular logger. Also can contain >+value trace, what is highest level of debug informations. > > The default is off. > >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 838743
: 616559 |
616560