diff options
author | Pavel Březina <pbrezina@redhat.com> | 2011-08-29 10:32:03 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-09-08 15:29:42 -0400 |
commit | 1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1 (patch) | |
tree | eca7704990f1d8e028bf6b3cba1cd9211d26b614 /src/monitor | |
parent | 8414023e4ba838edb9712fa7e3f923f9b035665e (diff) | |
download | sssd-1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1.tar.gz sssd-1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1.tar.xz sssd-1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1.zip |
DEBUG timestamps offer higher precision
https://fedorahosted.org/sssd/ticket/956
Added: --debug-microseconds=0/1
Added: debug_microseconds to sssd.conf
Diffstat (limited to 'src/monitor')
-rw-r--r-- | src/monitor/monitor.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 4cd1e99d0..799b7c69a 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -62,6 +62,7 @@ int cmdline_debug_level; int cmdline_debug_timestamps; +int cmdline_debug_microseconds; struct svc_spy; @@ -975,6 +976,17 @@ static int get_service_config(struct mt_ctx *ctx, const char *name, } } + if (cmdline_debug_microseconds != SSSDBG_MICROSECONDS_UNRESOLVED) { + svc->command = talloc_asprintf_append( + svc->command, " --debug-microseconds=%d", + cmdline_debug_microseconds + ); + if (!svc->command) { + talloc_free(svc); + return ENOMEM; + } + } + if (debug_to_file) { svc->command = talloc_strdup_append( svc->command, " --debug-to-files" @@ -1130,6 +1142,17 @@ static int get_provider_config(struct mt_ctx *ctx, const char *name, } } + if (cmdline_debug_microseconds != SSSDBG_MICROSECONDS_UNRESOLVED) { + svc->command = talloc_asprintf_append( + svc->command, " --debug-microseconds=%d", + cmdline_debug_microseconds + ); + if (!svc->command) { + talloc_free(svc); + return ENOMEM; + } + } + if (debug_to_file) { svc->command = talloc_strdup_append( svc->command, " --debug-to-files" @@ -2390,11 +2413,12 @@ int main(int argc, const char *argv[]) CONVERT_AND_SET_DEBUG_LEVEL(debug_level); - /* If the level or timestamps was passed at the command-line, we want - * to save it and pass it to the children later. + /* If the level, timestamps or microseconds was passed at the command-line, + * we want to save it and pass it to the children later. */ cmdline_debug_level = debug_level; cmdline_debug_timestamps = debug_timestamps; + cmdline_debug_microseconds = debug_microseconds; if (opt_daemon && opt_interactive) { fprintf(stderr, "Option -i|--interactive is not allowed together with -D|--daemon\n"); |