Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:FrontRunner
pacemaker.34782
0001-Log-all-use-high-resolution-timestamps-in-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Log-all-use-high-resolution-timestamps-in-detail-log.patch of Package pacemaker.34782
From 5a33121e34998649d249150e4a0babf055cfd4f1 Mon Sep 17 00:00:00 2001 From: Ken Gaillot <kgaillot@redhat.com> Date: Wed, 13 Jan 2021 09:56:49 -0600 Subject: [PATCH] Log: all: use high-resolution timestamps in detail log when available --- lib/common/logging.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/common/logging.c b/lib/common/logging.c index 7259e1f7d..595f701e5 100644 --- a/lib/common/logging.c +++ b/lib/common/logging.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2020 the Pacemaker project contributors + * Copyright 2004-2021 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -33,6 +33,15 @@ #include <crm/crm.h> #include <crm/common/mainloop.h> +// Use high-resolution (millisecond) timestamps if libqb supports them +#ifdef QB_FEATURE_LOG_HIRES_TIMESTAMPS +#define TIMESTAMP_FORMAT_SPEC "%%T" +typedef struct timespec *log_time_t; +#else +#define TIMESTAMP_FORMAT_SPEC "%%t" +typedef time_t log_time_t; +#endif + unsigned int crm_log_level = LOG_INFO; unsigned int crm_trace_nonlog = 0; bool pcmk__is_daemon = false; @@ -146,7 +155,7 @@ set_format_string(int method, const char *daemon) // If logging to file, prefix with timestamp, node name, daemon ID offset += snprintf(fmt + offset, FMT_MAX - offset, - "%%t %s %-20s[%lu] ", + TIMESTAMP_FORMAT_SPEC " %s %-20s[%lu] ", nodename, daemon, (unsigned long) getpid()); } @@ -293,12 +302,6 @@ crm_add_logfile(const char *filename) static int blackbox_trigger = 0; static volatile char *blackbox_file_prefix = NULL; -#ifdef QB_FEATURE_LOG_HIRES_TIMESTAMPS -typedef struct timespec *log_time_t; -#else -typedef time_t log_time_t; -#endif - static void blackbox_logger(int32_t t, struct qb_log_callsite *cs, log_time_t timestamp, const char *msg) -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor