git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timeval: Restore ability to warp time forward when time is not stopped.
[sliver-openvswitch.git]
/
lib
/
vlog.c
diff --git
a/lib/vlog.c
b/lib/vlog.c
index
26d0e6c
..
37806b8
100644
(file)
--- a/
lib/vlog.c
+++ b/
lib/vlog.c
@@
-74,6
+74,7
@@
extern struct vlog_module *__stop_vlog_modules[];
#include "vlog-modules.def"
#undef VLOG_MODULE
#include "vlog-modules.def"
#undef VLOG_MODULE
+extern struct vlog_module *vlog_modules[];
struct vlog_module *vlog_modules[] = {
#define VLOG_MODULE(NAME) &VLM_##NAME,
#include "vlog-modules.def"
struct vlog_module *vlog_modules[] = {
#define VLOG_MODULE(NAME) &VLM_##NAME,
#include "vlog-modules.def"
@@
-100,13
+101,13
@@
static struct facility facilities[VLF_N_FACILITIES] = {
};
/* Sequence number for the message currently being composed. */
};
/* Sequence number for the message currently being composed. */
-DEFINE_PER_THREAD_DATA(unsigned int, msg_num, 0);
+DEFINE_
STATIC_
PER_THREAD_DATA(unsigned int, msg_num, 0);
/* VLF_FILE configuration.
*
* All of the following is protected by 'log_file_mutex', which nests inside
* pattern_rwlock. */
/* VLF_FILE configuration.
*
* All of the following is protected by 'log_file_mutex', which nests inside
* pattern_rwlock. */
-static struct ovs_mutex log_file_mutex = OVS_
ADAPTIVE_
MUTEX_INITIALIZER;
+static struct ovs_mutex log_file_mutex = OVS_MUTEX_INITIALIZER;
static char *log_file_name OVS_GUARDED_BY(log_file_mutex);
static int log_fd OVS_GUARDED_BY(log_file_mutex) = -1;
static struct async_append *log_writer OVS_GUARDED_BY(log_file_mutex);
static char *log_file_name OVS_GUARDED_BY(log_file_mutex);
static int log_fd OVS_GUARDED_BY(log_file_mutex) = -1;
static struct async_append *log_writer OVS_GUARDED_BY(log_file_mutex);
@@
-582,7
+583,7
@@
static void
vlog_init__(void)
{
static char *program_name_copy;
vlog_init__(void)
{
static char *program_name_copy;
-
time_
t now;
+
long long in
t now;
/* openlog() is allowed to keep the pointer passed in, without making a
* copy. The daemonize code sometimes frees and replaces 'program_name',
/* openlog() is allowed to keep the pointer passed in, without making a
* copy. The daemonize code sometimes frees and replaces 'program_name',
@@
-592,10
+593,10
@@
vlog_init__(void)
program_name_copy = program_name ? xstrdup(program_name) : NULL;
openlog(program_name_copy, LOG_NDELAY, LOG_DAEMON);
program_name_copy = program_name ? xstrdup(program_name) : NULL;
openlog(program_name_copy, LOG_NDELAY, LOG_DAEMON);
- now = time_wall();
+ now = time_wall
_msec
();
if (now < 0) {
if (now < 0) {
- char *s = xastrftime("%a, %d %b %Y %H:%M:%S", now, true);
- VLOG_ERR("current time is negative: %s (%l
d)", s, (long int)
now);
+ char *s = xastrftime
_msec
("%a, %d %b %Y %H:%M:%S", now, true);
+ VLOG_ERR("current time is negative: %s (%l
ld)", s,
now);
free(s);
}
free(s);
}
@@
-745,12
+746,12
@@
format_log_message(const struct vlog_module *module, enum vlog_level level,
ds_put_cstr(s, vlog_get_module_name(module));
break;
case 'd':
ds_put_cstr(s, vlog_get_module_name(module));
break;
case 'd':
- p = fetch_braces(p, "%Y-%m-%d %H:%M:%S", tmp, sizeof tmp);
- ds_put_strftime
(s, tmp, time_wall
(), false);
+ p = fetch_braces(p, "%Y-%m-%d %H:%M:%S
.###
", tmp, sizeof tmp);
+ ds_put_strftime
_msec(s, tmp, time_wall_msec
(), false);
break;
case 'D':
break;
case 'D':
- p = fetch_braces(p, "%Y-%m-%d %H:%M:%S", tmp, sizeof tmp);
- ds_put_strftime
(s, tmp, time_wall
(), true);
+ p = fetch_braces(p, "%Y-%m-%d %H:%M:%S
.###
", tmp, sizeof tmp);
+ ds_put_strftime
_msec(s, tmp, time_wall_msec
(), true);
break;
case 'm':
/* Format user-supplied log message and trim trailing new-lines. */
break;
case 'm':
/* Format user-supplied log message and trim trailing new-lines. */