summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Graf <tgraf@noironetworks.com>2014-12-15 14:10:38 +0100
committerThomas Graf <tgraf@noironetworks.com>2014-12-15 14:15:19 +0100
commite6211adce42c28453e0004c7a3e342a3d52bb97d (patch)
treef4ededea7bc727aa458885ef336f712d4089c703 /lib
parent55951e15e5603318219ea5efca160723bbb28111 (diff)
downloadopenvswitch-e6211adce42c28453e0004c7a3e342a3d52bb97d.tar.gz
lib: Move vlog.h to <openvswitch/vlog.h>
A new function vlog_insert_module() is introduced to avoid using list_insert() from the vlog.h header. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/automake.mk1
-rw-r--r--lib/backtrace.c2
-rw-r--r--lib/bfd.c2
-rw-r--r--lib/bundle.c2
-rw-r--r--lib/cfm.c2
-rw-r--r--lib/classifier.c2
-rw-r--r--lib/command-line.c2
-rw-r--r--lib/coverage.c2
-rw-r--r--lib/daemon-unix.c2
-rw-r--r--lib/daemon-windows.c2
-rw-r--r--lib/daemon.c4
-rw-r--r--lib/dpif-netdev.c2
-rw-r--r--lib/dpif-netlink.c2
-rw-r--r--lib/dpif.c2
-rw-r--r--lib/entropy.c4
-rw-r--r--lib/fatal-signal.c2
-rw-r--r--lib/getopt_long.c2
-rw-r--r--lib/getrusage-windows.c2
-rw-r--r--lib/hmap.c2
-rw-r--r--lib/jsonrpc.c2
-rw-r--r--lib/lacp.c2
-rw-r--r--lib/learning-switch.c2
-rw-r--r--lib/lockfile.c2
-rw-r--r--lib/mcast-snooping.c2
-rw-r--r--lib/memory.c2
-rw-r--r--lib/meta-flow.c2
-rw-r--r--lib/netdev-bsd.c2
-rw-r--r--lib/netdev-dpdk.c2
-rw-r--r--lib/netdev-dummy.c2
-rw-r--r--lib/netdev-linux.c2
-rw-r--r--lib/netdev-vport.c2
-rw-r--r--lib/netdev-windows.c2
-rw-r--r--lib/netdev.c2
-rw-r--r--lib/netlink-notifier.c2
-rw-r--r--lib/netlink-socket.c2
-rw-r--r--lib/netlink.c2
-rw-r--r--lib/nx-match.c2
-rw-r--r--lib/odp-util.c2
-rw-r--r--lib/ofp-actions.c2
-rw-r--r--lib/ofp-errors.c2
-rw-r--r--lib/ofp-msgs.c2
-rw-r--r--lib/ofp-util.c2
-rw-r--r--lib/ovs-numa.c2
-rw-r--r--lib/ovs-rcu.c2
-rw-r--r--lib/ovs-thread.c3
-rw-r--r--lib/ovsdb-error.c2
-rw-r--r--lib/ovsdb-idl.c2
-rw-r--r--lib/pcap-file.c2
-rw-r--r--lib/poll-loop.c2
-rw-r--r--lib/process.c2
-rw-r--r--lib/rconn.c2
-rw-r--r--lib/reconnect.c2
-rw-r--r--lib/route-table.c2
-rw-r--r--lib/rstp-state-machines.c2
-rw-r--r--lib/rstp.c2
-rw-r--r--lib/rtbsd.c2
-rw-r--r--lib/signals.c2
-rw-r--r--lib/socket-util-unix.c2
-rw-r--r--lib/socket-util.c2
-rw-r--r--lib/stp.c3
-rw-r--r--lib/stream-fd.c2
-rw-r--r--lib/stream-nossl.c2
-rw-r--r--lib/stream-ssl.c2
-rw-r--r--lib/stream-tcp.c2
-rw-r--r--lib/stream-unix.c2
-rw-r--r--lib/stream.c2
-rw-r--r--lib/svec.c2
-rw-r--r--lib/timeval.c2
-rw-r--r--lib/tnl-arp-cache.c2
-rw-r--r--lib/unixctl.c2
-rw-r--r--lib/util.c2
-rw-r--r--lib/vconn-stream.c2
-rw-r--r--lib/vconn.c2
-rw-r--r--lib/vlandev.c2
-rw-r--r--lib/vlog.c7
-rw-r--r--lib/vlog.h296
76 files changed, 84 insertions, 372 deletions
diff --git a/lib/automake.mk b/lib/automake.mk
index ba5f80aa4..ef5b02041 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -265,7 +265,6 @@ lib_libopenvswitch_la_SOURCES = \
lib/vlandev.c \
lib/vlandev.h \
lib/vlog.c \
- lib/vlog.h \
lib/vswitch-idl.c \
lib/vswitch-idl.h \
lib/vtep-idl.c \
diff --git a/lib/backtrace.c b/lib/backtrace.c
index 9b7c52b9a..5cb2954f8 100644
--- a/lib/backtrace.c
+++ b/lib/backtrace.c
@@ -18,7 +18,7 @@
#include <inttypes.h>
#include "backtrace.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(backtrace);
diff --git a/lib/bfd.c b/lib/bfd.c
index 7f6bf5b51..3db1d5745 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -44,7 +44,7 @@
#include "unaligned.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(bfd);
diff --git a/lib/bundle.c b/lib/bundle.c
index 700969b4f..e66ceed06 100644
--- a/lib/bundle.c
+++ b/lib/bundle.c
@@ -29,7 +29,7 @@
#include "ofp-errors.h"
#include "ofp-util.h"
#include "openflow/nicira-ext.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(bundle);
diff --git a/lib/cfm.c b/lib/cfm.c
index bc8be7114..23c1c6f31 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -36,7 +36,7 @@
#include "timer.h"
#include "timeval.h"
#include "unixctl.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(cfm);
diff --git a/lib/classifier.c b/lib/classifier.c
index 1985efea7..bbc5a4a2f 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -25,7 +25,7 @@
#include "ofp-util.h"
#include "packets.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(classifier);
diff --git a/lib/command-line.c b/lib/command-line.c
index eb0a83b54..2eccdc682 100644
--- a/lib/command-line.c
+++ b/lib/command-line.c
@@ -22,7 +22,7 @@
#include "dynamic-string.h"
#include "ovs-thread.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(command_line);
diff --git a/lib/coverage.c b/lib/coverage.c
index fe97d69af..61219566e 100644
--- a/lib/coverage.c
+++ b/lib/coverage.c
@@ -24,7 +24,7 @@
#include "timeval.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(coverage);
diff --git a/lib/daemon-unix.c b/lib/daemon-unix.c
index 3d0822238..3b24fca83 100644
--- a/lib/daemon-unix.c
+++ b/lib/daemon-unix.c
@@ -35,7 +35,7 @@
#include "socket-util.h"
#include "timeval.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(daemon_unix);
diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c
index 3d1907e51..cb205cacc 100644
--- a/lib/daemon-windows.c
+++ b/lib/daemon-windows.c
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "poll-loop.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(daemon_windows);
diff --git a/lib/daemon.c b/lib/daemon.c
index 4c7c8e16a..4ac32b88c 100644
--- a/lib/daemon.c
+++ b/lib/daemon.c
@@ -19,7 +19,9 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
-#include "vlog.h"
+#include "util.h"
+#include "ovs-thread.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(daemon);
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 319435102..a0e508ce1 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -66,7 +66,7 @@
#include "tnl-arp-cache.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(dpif_netdev);
diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
index 2492a6bf7..63bbddcf8 100644
--- a/lib/dpif-netlink.c
+++ b/lib/dpif-netlink.c
@@ -53,7 +53,7 @@
#include "timeval.h"
#include "unaligned.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(dpif_netlink);
#ifdef _WIN32
diff --git a/lib/dpif.c b/lib/dpif.c
index 4db3e433f..a2696c690 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -47,7 +47,7 @@
#include "tnl-ports.h"
#include "util.h"
#include "valgrind.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(dpif);
diff --git a/lib/entropy.c b/lib/entropy.c
index f9808553d..05cc64835 100644
--- a/lib/entropy.c
+++ b/lib/entropy.c
@@ -23,9 +23,9 @@
#ifdef _WIN32
#include <Wincrypt.h>
#endif
-
+#include "util.h"
#include "socket-util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(entropy);
diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c
index 199cf6bd5..62acea085 100644
--- a/lib/fatal-signal.c
+++ b/lib/fatal-signal.c
@@ -30,7 +30,7 @@
#include "signals.h"
#include "socket-util.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "type-props.h"
diff --git a/lib/getopt_long.c b/lib/getopt_long.c
index 95c810492..0663762fb 100644
--- a/lib/getopt_long.c
+++ b/lib/getopt_long.c
@@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string.h>
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(getopt_long);
diff --git a/lib/getrusage-windows.c b/lib/getrusage-windows.c
index 0282a17c6..915725e37 100644
--- a/lib/getrusage-windows.c
+++ b/lib/getrusage-windows.c
@@ -20,7 +20,7 @@
#include <sys/resource.h>
#include <time.h>
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(getrusage_windows);
diff --git a/lib/hmap.c b/lib/hmap.c
index 542d8b5a8..938dbc211 100644
--- a/lib/hmap.c
+++ b/lib/hmap.c
@@ -21,7 +21,7 @@
#include "coverage.h"
#include "random.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(hmap);
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index d571656eb..f15adcaa1 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -31,7 +31,7 @@
#include "reconnect.h"
#include "stream.h"
#include "timeval.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(jsonrpc);
diff --git a/lib/lacp.c b/lib/lacp.c
index cc1a58223..6f526522e 100644
--- a/lib/lacp.c
+++ b/lib/lacp.c
@@ -30,7 +30,7 @@
#include "timer.h"
#include "timeval.h"
#include "unixctl.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(lacp);
diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index af72ae10a..b948af7a6 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -42,7 +42,7 @@
#include "simap.h"
#include "timeval.h"
#include "vconn.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(learning_switch);
diff --git a/lib/lockfile.c b/lib/lockfile.c
index 1ef625128..26aee3324 100644
--- a/lib/lockfile.c
+++ b/lib/lockfile.c
@@ -30,7 +30,7 @@
#include "ovs-thread.h"
#include "timeval.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(lockfile);
diff --git a/lib/mcast-snooping.c b/lib/mcast-snooping.c
index d99f01c13..e84efc60f 100644
--- a/lib/mcast-snooping.c
+++ b/lib/mcast-snooping.c
@@ -33,7 +33,7 @@
#include "unaligned.h"
#include "util.h"
#include "vlan-bitmap.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
COVERAGE_DEFINE(mcast_snooping_learned);
COVERAGE_DEFINE(mcast_snooping_expired);
diff --git a/lib/memory.c b/lib/memory.c
index 6c97e190a..3e21eb561 100644
--- a/lib/memory.c
+++ b/lib/memory.c
@@ -24,7 +24,7 @@
#include "simap.h"
#include "timeval.h"
#include "unixctl.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(memory);
diff --git a/lib/meta-flow.c b/lib/meta-flow.c
index 9aa71a3df..90dd27c24 100644
--- a/lib/meta-flow.c
+++ b/lib/meta-flow.c
@@ -35,7 +35,7 @@
#include "socket-util.h"
#include "unaligned.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(meta_flow);
diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
index 473c0f662..a10b529ca 100644
--- a/lib/netdev-bsd.c
+++ b/lib/netdev-bsd.c
@@ -61,7 +61,7 @@
#include "socket-util.h"
#include "svec.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netdev_bsd);
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 4e2d28118..0ede2001d 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -46,7 +46,7 @@
#include "unaligned.h"
#include "timeval.h"
#include "unixctl.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(dpdk);
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 01ee928e9..fcb0b7749 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -40,7 +40,7 @@
#include "timeval.h"
#include "unixctl.h"
#include "reconnect.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netdev_dummy);
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 99425f77b..a1e49797c 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -71,7 +71,7 @@
#include "sset.h"
#include "timer.h"
#include "unaligned.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netdev_linux);
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
index e6b97fa44..91acabb4e 100644
--- a/lib/netdev-vport.c
+++ b/lib/netdev-vport.c
@@ -44,7 +44,7 @@
#include "route-table.h"
#include "shash.h"
#include "socket-util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "unaligned.h"
#include "unixctl.h"
#include "util.h"
diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c
index 465f0c5c9..c67aaebcd 100644
--- a/lib/netdev-windows.c
+++ b/lib/netdev-windows.c
@@ -28,7 +28,7 @@
#include "poll-loop.h"
#include "shash.h"
#include "svec.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "odp-netlink.h"
#include "netlink-socket.h"
#include "netlink.h"
diff --git a/lib/netdev.c b/lib/netdev.c
index 4a9c0f516..2bda77f51 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -42,7 +42,7 @@
#include "smap.h"
#include "sset.h"
#include "svec.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netdev);
diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c
index 713082db4..45c9188af 100644
--- a/lib/netlink-notifier.c
+++ b/lib/netlink-notifier.c
@@ -26,7 +26,7 @@
#include "netlink.h"
#include "netlink-socket.h"
#include "ofpbuf.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netlink_notifier);
diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index 2e02c43bf..e4f153f4d 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -35,7 +35,7 @@
#include "seq.h"
#include "socket-util.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netlink_socket);
diff --git a/lib/netlink.c b/lib/netlink.c
index 24b21689c..b6f7d4538 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -26,7 +26,7 @@
#include "ofpbuf.h"
#include "timeval.h"
#include "unaligned.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netlink);
diff --git a/lib/nx-match.c b/lib/nx-match.c
index 72fa29bb6..2ad3cf2a4 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -33,7 +33,7 @@
#include "shash.h"
#include "unaligned.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(nx_match);
diff --git a/lib/odp-util.c b/lib/odp-util.c
index a89d5f8bd..b8fda49b4 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -37,7 +37,7 @@
#include "timeval.h"
#include "unaligned.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(odp_util);
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index 1b7625d95..4680d816c 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -30,7 +30,7 @@
#include "ofpbuf.h"
#include "unaligned.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ofp_actions);
diff --git a/lib/ofp-errors.c b/lib/ofp-errors.c
index c803494f0..ce85f6758 100644
--- a/lib/ofp-errors.c
+++ b/lib/ofp-errors.c
@@ -23,7 +23,7 @@
#include "ofp-util.h"
#include "ofpbuf.h"
#include "openflow/openflow.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ofp_errors);
diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c
index 4dfc65764..364ce7616 100644
--- a/lib/ofp-msgs.c
+++ b/lib/ofp-msgs.c
@@ -24,7 +24,7 @@
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
#include "ovs-thread.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ofp_msgs);
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index b32234a97..986659ee7 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -42,7 +42,7 @@
#include "random.h"
#include "unaligned.h"
#include "type-props.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "bitmap.h"
VLOG_DEFINE_THIS_MODULE(ofp_util);
diff --git a/lib/ovs-numa.c b/lib/ovs-numa.c
index 07cbc7b2d..dabdd187f 100644
--- a/lib/ovs-numa.c
+++ b/lib/ovs-numa.c
@@ -32,7 +32,7 @@
#include "hmap.h"
#include "list.h"
#include "ovs-thread.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovs_numa);
diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c
index 1cf69aebb..5276981c8 100644
--- a/lib/ovs-rcu.c
+++ b/lib/ovs-rcu.c
@@ -22,7 +22,7 @@
#include "poll-loop.h"
#include "seq.h"
#include "timeval.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovs_rcu);
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
index 3dd0ed6eb..7d38c8001 100644
--- a/lib/ovs-thread.c
+++ b/lib/ovs-thread.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include "compiler.h"
#include "hash.h"
+#include "list.h"
#include "netdev-dpdk.h"
#include "ovs-rcu.h"
#include "poll-loop.h"
@@ -38,7 +39,7 @@
* cut-and-paste. Since "sparse" is just a checker, not a compiler, it
* doesn't matter that we don't define them. */
#else
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovs_thread);
diff --git a/lib/ovsdb-error.c b/lib/ovsdb-error.c
index eb9f1eee4..8be4d1613 100644
--- a/lib/ovsdb-error.c
+++ b/lib/ovsdb-error.c
@@ -23,7 +23,7 @@
#include "dynamic-string.h"
#include "json.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovsdb_error);
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index e1857b6d3..9c25dbcbc 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -34,7 +34,7 @@
#include "poll-loop.h"
#include "shash.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovsdb_idl);
diff --git a/lib/pcap-file.c b/lib/pcap-file.c
index 191e690e6..58c60b1cc 100644
--- a/lib/pcap-file.c
+++ b/lib/pcap-file.c
@@ -29,7 +29,7 @@
#include "packets.h"
#include "timeval.h"
#include "unaligned.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(pcap);
diff --git a/lib/poll-loop.c b/lib/poll-loop.c
index 8747c61a1..3c4b55c88 100644
--- a/lib/poll-loop.c
+++ b/lib/poll-loop.c
@@ -29,7 +29,7 @@
#include "seq.h"
#include "socket-util.h"
#include "timeval.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "hmap.h"
#include "hash.h"
diff --git a/lib/process.c b/lib/process.c
index f6b665e81..e89f9cacc 100644
--- a/lib/process.c
+++ b/lib/process.c
@@ -34,7 +34,7 @@
#include "signals.h"
#include "socket-util.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(process);
diff --git a/lib/rconn.c b/lib/rconn.c
index 9d8c46f3e..8e07b8e2b 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -30,7 +30,7 @@
#include "timeval.h"
#include "util.h"
#include "vconn.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(rconn);
diff --git a/lib/reconnect.c b/lib/reconnect.c
index 5296c5cbe..bab821ebb 100644
--- a/lib/reconnect.c
+++ b/lib/reconnect.c
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include "poll-loop.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(reconnect);
diff --git a/lib/route-table.c b/lib/route-table.c
index 2c3f64cf1..1459b7d54 100644
--- a/lib/route-table.c
+++ b/lib/route-table.c
@@ -31,7 +31,7 @@
#include "ofpbuf.h"
#include "ovs-router.h"
#include "rtnetlink-link.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(route_table);
diff --git a/lib/rstp-state-machines.c b/lib/rstp-state-machines.c
index df357a736..320201897 100644
--- a/lib/rstp-state-machines.c
+++ b/lib/rstp-state-machines.c
@@ -42,7 +42,7 @@
#include "seq.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(rstp_sm);
diff --git a/lib/rstp.c b/lib/rstp.c
index 8a7891a60..3b314b4c5 100644
--- a/lib/rstp.c
+++ b/lib/rstp.c
@@ -44,7 +44,7 @@
#include "seq.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(rstp);
diff --git a/lib/rtbsd.c b/lib/rtbsd.c
index d33f64bd6..c3dbdcab4 100644
--- a/lib/rtbsd.c
+++ b/lib/rtbsd.c
@@ -26,7 +26,7 @@
#include "coverage.h"
#include "socket-util.h"
#include "poll-loop.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "rtbsd.h"
VLOG_DEFINE_THIS_MODULE(rtbsd);
diff --git a/lib/signals.c b/lib/signals.c
index 85e5c7949..3af618713 100644
--- a/lib/signals.c
+++ b/lib/signals.c
@@ -25,7 +25,7 @@
#include "socket-util.h"
#include "type-props.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(signals);
diff --git a/lib/socket-util-unix.c b/lib/socket-util-unix.c
index c56654e03..afab1958d 100644
--- a/lib/socket-util-unix.c
+++ b/lib/socket-util-unix.c
@@ -28,7 +28,7 @@
#include "fatal-signal.h"
#include "random.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(socket_util_unix);
diff --git a/lib/socket-util.c b/lib/socket-util.c
index 755ce4e4e..8949da77d 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -37,7 +37,7 @@
#include "packets.h"
#include "poll-loop.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#ifdef __linux__
#include <linux/if_packet.h>
#endif
diff --git a/lib/stp.c b/lib/stp.c
index 9e02acc7b..1e88cba89 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -28,11 +28,12 @@
#include "byte-order.h"
#include "connectivity.h"
#include "ofpbuf.h"
+#include "ovs-atomic.h"
#include "packets.h"
#include "seq.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(stp);
diff --git a/lib/stream-fd.c b/lib/stream-fd.c
index 1b8070190..a6a10d476 100644
--- a/lib/stream-fd.c
+++ b/lib/stream-fd.c
@@ -29,7 +29,7 @@
#include "util.h"
#include "stream-provider.h"
#include "stream.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(stream_fd);
diff --git a/lib/stream-nossl.c b/lib/stream-nossl.c
index 9dda9871c..26fcc978e 100644
--- a/lib/stream-nossl.c
+++ b/lib/stream-nossl.c
@@ -16,7 +16,7 @@
#include <config.h>
#include "stream-ssl.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(stream_nossl);
diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c
index 353f1718c..47c53125b 100644
--- a/lib/stream-ssl.c
+++ b/lib/stream-ssl.c
@@ -45,7 +45,7 @@
#include "stream-provider.h"
#include "stream.h"
#include "timeval.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#ifdef _WIN32
/* Ref: https://www.openssl.org/support/faq.html#PROG2
diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c
index e58c5adf7..3e19dbbb7 100644
--- a/lib/stream-tcp.c
+++ b/lib/stream-tcp.c
@@ -31,7 +31,7 @@
#include "util.h"
#include "stream-provider.h"
#include "stream-fd.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(stream_tcp);
diff --git a/lib/stream-unix.c b/lib/stream-unix.c
index 29077c6a2..daade3f3b 100644
--- a/lib/stream-unix.c
+++ b/lib/stream-unix.c
@@ -33,7 +33,7 @@
#include "util.h"
#include "stream-provider.h"
#include "stream-fd.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(stream_unix);
diff --git a/lib/stream.c b/lib/stream.c
index 4e512da2a..ca469fb5f 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -37,7 +37,7 @@
#include "random.h"
#include "socket-util.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(stream);
diff --git a/lib/svec.c b/lib/svec.c
index d083ebb86..7fe8bebdf 100644
--- a/lib/svec.c
+++ b/lib/svec.c
@@ -21,7 +21,7 @@
#include <string.h>
#include "dynamic-string.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(svec);
diff --git a/lib/timeval.c b/lib/timeval.c
index 99f9b949c..6173affec 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -37,7 +37,7 @@
#include "seq.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(timeval);
diff --git a/lib/tnl-arp-cache.c b/lib/tnl-arp-cache.c
index 76195ec7c..59ec0bc37 100644
--- a/lib/tnl-arp-cache.c
+++ b/lib/tnl-arp-cache.c
@@ -36,7 +36,7 @@
#include "unaligned.h"
#include "unixctl.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
/* In seconds */
diff --git a/lib/unixctl.c b/lib/unixctl.c
index 9fb2e85b6..b47f35ad0 100644
--- a/lib/unixctl.c
+++ b/lib/unixctl.c
@@ -29,7 +29,7 @@
#include "stream.h"
#include "stream-provider.h"
#include "svec.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(unixctl);
diff --git a/lib/util.c b/lib/util.c
index 453ade6dc..6b51fa810 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -33,7 +33,7 @@
#include "ovs-rcu.h"
#include "ovs-thread.h"
#include "socket-util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#ifdef HAVE_PTHREAD_SET_NAME_NP
#include <pthread_np.h>
#endif
diff --git a/lib/vconn-stream.c b/lib/vconn-stream.c
index 9347b5ea0..32c25cdbb 100644
--- a/lib/vconn-stream.c
+++ b/lib/vconn-stream.c
@@ -30,7 +30,7 @@
#include "util.h"
#include "vconn-provider.h"
#include "vconn.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(vconn_stream);
diff --git a/lib/vconn.c b/lib/vconn.c
index 97e8dd262..2ffbd8d7a 100644
--- a/lib/vconn.c
+++ b/lib/vconn.c
@@ -37,7 +37,7 @@
#include "poll-loop.h"
#include "random.h"
#include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "socket-util.h"
VLOG_DEFINE_THIS_MODULE(vconn);
diff --git a/lib/vlandev.c b/lib/vlandev.c
index d2f5a37e1..99c99de70 100644
--- a/lib/vlandev.c
+++ b/lib/vlandev.c
@@ -27,7 +27,7 @@
#include "hash.h"
#include "shash.h"
#include "socket-util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(vlandev);
diff --git a/lib/vlog.c b/lib/vlog.c
index 60ce3b420..dbf46c5ab 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -15,7 +15,7 @@
*/
#include <config.h>
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@@ -170,6 +170,11 @@ vlog_get_facility_val(const char *name)
return i;
}
+void vlog_insert_module(struct ovs_list *vlog)
+{
+ list_insert(&vlog_modules, vlog);
+}
+
/* Returns the name for logging module 'module'. */
const char *
vlog_get_module_name(const struct vlog_module *module)
diff --git a/lib/vlog.h b/lib/vlog.h
deleted file mode 100644
index a8f7b0152..000000000
--- a/lib/vlog.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef VLOG_H
-#define VLOG_H 1
-
-/* Logging.
- *
- *
- * Thread-safety
- * =============
- *
- * Fully thread safe.
- */
-
-#include <limits.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <time.h>
-#include "compiler.h"
-#include "ovs-thread.h"
-#include "sat-math.h"
-#include "openvswitch/token-bucket.h"
-#include "util.h"
-#include "list.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Logging severity levels.
- *
- * ovs-appctl(8) defines each of the log levels. */
-#define VLOG_LEVELS \
- VLOG_LEVEL(OFF, LOG_ALERT, 1) \
- VLOG_LEVEL(EMER, LOG_ALERT, 1) \
- VLOG_LEVEL(ERR, LOG_ERR, 3) \
- VLOG_LEVEL(WARN, LOG_WARNING, 4) \
- VLOG_LEVEL(INFO, LOG_NOTICE, 5) \
- VLOG_LEVEL(DBG, LOG_DEBUG, 7)
-enum vlog_level {
-#define VLOG_LEVEL(NAME, SYSLOG_LEVEL, RFC5424_LEVEL) VLL_##NAME,
- VLOG_LEVELS
-#undef VLOG_LEVEL
- VLL_N_LEVELS
-};
-
-const char *vlog_get_level_name(enum vlog_level);
-enum vlog_level vlog_get_level_val(const char *name);
-
-/* Facilities that we can log to. */
-#define VLOG_FACILITIES \
- VLOG_FACILITY(SYSLOG, "ovs|%05N|%c%T|%p|%m") \
- VLOG_FACILITY(CONSOLE, "%D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m") \
- VLOG_FACILITY(FILE, "%D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m")
-enum vlog_facility {
-#define VLOG_FACILITY(NAME, PATTERN) VLF_##NAME,
- VLOG_FACILITIES
-#undef VLOG_FACILITY
- VLF_N_FACILITIES,
- VLF_ANY_FACILITY = -1
-};
-
-const char *vlog_get_facility_name(enum vlog_facility);
-enum vlog_facility vlog_get_facility_val(const char *name);
-
-/* A log module. */
-struct vlog_module {
- struct ovs_list list;
- const char *name; /* User-visible name. */
- int levels[VLF_N_FACILITIES]; /* Minimum log level for each facility. */
- int min_level; /* Minimum log level for any facility. */
- bool honor_rate_limits; /* Set false to ignore rate limits. */
-};
-
-/* Global list of all logging modules */
-extern struct ovs_list vlog_modules;
-
-/* Creates and initializes a global instance of a module named MODULE. */
-#define VLOG_DEFINE_MODULE(MODULE) \
- VLOG_DEFINE_MODULE__(MODULE) \
- OVS_CONSTRUCTOR(init_##MODULE) { \
- list_insert(&vlog_modules, &VLM_##MODULE.list); \
- } \
-
-const char *vlog_get_module_name(const struct vlog_module *);
-struct vlog_module *vlog_module_from_name(const char *name);
-
-/* Rate-limiter for log messages. */
-struct vlog_rate_limit {
- struct token_bucket token_bucket;
- time_t first_dropped; /* Time first message was dropped. */
- time_t last_dropped; /* Time of most recent message drop. */
- unsigned int n_dropped; /* Number of messages dropped. */
- struct ovs_mutex mutex; /* Mutual exclusion for rate limit. */
-};
-
-/* Number of tokens to emit a message. We add 'rate' tokens per millisecond,
- * thus 60,000 tokens are required to emit one message per minute. */
-#define VLOG_MSG_TOKENS (60 * 1000)
-
-/* Initializer for a struct vlog_rate_limit, to set up a maximum rate of RATE
- * messages per minute and a maximum burst size of BURST messages. */
-#define VLOG_RATE_LIMIT_INIT(RATE, BURST) \
- { \
- TOKEN_BUCKET_INIT(RATE, OVS_SAT_MUL(BURST, VLOG_MSG_TOKENS)),\
- 0, /* first_dropped */ \
- 0, /* last_dropped */ \
- 0, /* n_dropped */ \
- OVS_MUTEX_INITIALIZER /* mutex */ \
- }
-
-/* Configuring how each module logs messages. */
-enum vlog_level vlog_get_level(const struct vlog_module *, enum vlog_facility);
-void vlog_set_levels(struct vlog_module *,
- enum vlog_facility, enum vlog_level);
-char *vlog_set_levels_from_string(const char *) OVS_WARN_UNUSED_RESULT;
-void vlog_set_levels_from_string_assert(const char *);
-char *vlog_get_levels(void);
-bool vlog_is_enabled(const struct vlog_module *, enum vlog_level);
-bool vlog_should_drop(const struct vlog_module *, enum vlog_level,
- struct vlog_rate_limit *);
-void vlog_set_verbosity(const char *arg);
-
-/* Configuring log facilities. */
-void vlog_set_pattern(enum vlog_facility, const char *pattern);
-int vlog_set_log_file(const char *file_name);
-int vlog_reopen_log_file(void);
-
-/* Configure syslog target. */
-void vlog_set_syslog_target(const char *target);
-
-/* Initialization. */
-void vlog_init(void);
-void vlog_enable_async(void);
-
-/* Functions for actual logging. */
-void vlog(const struct vlog_module *, enum vlog_level, const char *format, ...)
- OVS_PRINTF_FORMAT (3, 4);
-void vlog_valist(const struct vlog_module *, enum vlog_level,
- const char *, va_list)
- OVS_PRINTF_FORMAT (3, 0);
-
-OVS_NO_RETURN void vlog_fatal(const struct vlog_module *, const char *format, ...)
- OVS_PRINTF_FORMAT (2, 3);
-OVS_NO_RETURN void vlog_fatal_valist(const struct vlog_module *,
- const char *format, va_list)
- OVS_PRINTF_FORMAT (2, 0);
-
-OVS_NO_RETURN void vlog_abort(const struct vlog_module *, const char *format, ...)
- OVS_PRINTF_FORMAT (2, 3);
-OVS_NO_RETURN void vlog_abort_valist(const struct vlog_module *,
- const char *format, va_list)
- OVS_PRINTF_FORMAT (2, 0);
-
-void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
- struct vlog_rate_limit *, const char *, ...)
- OVS_PRINTF_FORMAT (4, 5);
-
-/* Creates and initializes a global instance of a module named MODULE, and
- * defines a static variable named THIS_MODULE that points to it, for use with
- * the convenience macros below. */
-#define VLOG_DEFINE_THIS_MODULE(MODULE) \
- VLOG_DEFINE_MODULE(MODULE); \
- static struct vlog_module *const THIS_MODULE = &VLM_##MODULE
-
-/* Convenience macros. These assume that THIS_MODULE points to a "struct
- * vlog_module" for the current module, as set up by e.g. the
- * VLOG_DEFINE_MODULE macro above.
- *
- * Guaranteed to preserve errno.
- */
-#define VLOG_FATAL(...) vlog_fatal(THIS_MODULE, __VA_ARGS__)
-#define VLOG_ABORT(...) vlog_abort(THIS_MODULE, __VA_ARGS__)
-#define VLOG_EMER(...) VLOG(VLL_EMER, __VA_ARGS__)
-#define VLOG_ERR(...) VLOG(VLL_ERR, __VA_ARGS__)
-#define VLOG_WARN(...) VLOG(VLL_WARN, __VA_ARGS__)
-#define VLOG_INFO(...) VLOG(VLL_INFO, __VA_ARGS__)
-#define VLOG_DBG(...) VLOG(VLL_DBG, __VA_ARGS__)
-
-/* More convenience macros, for testing whether a given level is enabled in
- * THIS_MODULE. When constructing a log message is expensive, this enables it
- * to be skipped. */
-#define VLOG_IS_ERR_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_ERR)
-#define VLOG_IS_WARN_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_WARN)
-#define VLOG_IS_INFO_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_INFO)
-#define VLOG_IS_DBG_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_DBG)
-
-/* Convenience macros for rate-limiting.
- * Guaranteed to preserve errno.
- */
-#define VLOG_ERR_RL(RL, ...) VLOG_RL(RL, VLL_ERR, __VA_ARGS__)
-#define VLOG_WARN_RL(RL, ...) VLOG_RL(RL, VLL_WARN, __VA_ARGS__)
-#define VLOG_INFO_RL(RL, ...) VLOG_RL(RL, VLL_INFO, __VA_ARGS__)
-#define VLOG_DBG_RL(RL, ...) VLOG_RL(RL, VLL_DBG, __VA_ARGS__)
-
-/* Convenience macros to additionally store log message in buffer
- * Caller is responsible for freeing *ERRP afterwards */
-#define VLOG_ERR_BUF(ERRP, ...) VLOG_ERRP(ERRP, VLL_ERR, __VA_ARGS__)
-#define VLOG_WARN_BUF(ERRP, ...) VLOG_ERRP(ERRP, VLL_WARN, __VA_ARGS__)
-
-#define VLOG_DROP_ERR(RL) vlog_should_drop(THIS_MODULE, VLL_ERR, RL)
-#define VLOG_DROP_WARN(RL) vlog_should_drop(THIS_MODULE, VLL_WARN, RL)
-#define VLOG_DROP_INFO(RL) vlog_should_drop(THIS_MODULE, VLL_INFO, RL)
-#define VLOG_DROP_DBG(RL) vlog_should_drop(THIS_MODULE, VLL_DBG, RL)
-
-/* Macros for logging at most once per execution. */
-#define VLOG_ERR_ONCE(...) VLOG_ONCE(VLL_ERR, __VA_ARGS__)
-#define VLOG_WARN_ONCE(...) VLOG_ONCE(VLL_WARN, __VA_ARGS__)
-#define VLOG_INFO_ONCE(...) VLOG_ONCE(VLL_INFO, __VA_ARGS__)
-#define VLOG_DBG_ONCE(...) VLOG_ONCE(VLL_DBG, __VA_ARGS__)
-
-/* Command line processing. */
-#define VLOG_OPTION_ENUMS \
- OPT_LOG_FILE, \
- OPT_SYSLOG_TARGET
-
-#define VLOG_LONG_OPTIONS \
- {"verbose", optional_argument, NULL, 'v'}, \
- {"log-file", optional_argument, NULL, OPT_LOG_FILE}, \
- {"syslog-target", optional_argument, NULL, OPT_SYSLOG_TARGET}
-
-#define VLOG_OPTION_HANDLERS \
- case 'v': \
- vlog_set_verbosity(optarg); \
- break; \
- case OPT_LOG_FILE: \
- vlog_set_log_file(optarg); \
- break; \
- case OPT_SYSLOG_TARGET: \
- vlog_set_syslog_target(optarg); \
- break;
-
-void vlog_usage(void);
-
-/* Implementation details. */
-#define VLOG(LEVEL, ...) \
- do { \
- enum vlog_level level__ = LEVEL; \
- if (THIS_MODULE->min_level >= level__) { \
- vlog(THIS_MODULE, level__, __VA_ARGS__); \
- } \
- } while (0)
-#define VLOG_RL(RL, LEVEL, ...) \
- do { \
- enum vlog_level level__ = LEVEL; \
- if (THIS_MODULE->min_level >= level__) { \
- vlog_rate_limit(THIS_MODULE, level__, RL, __VA_ARGS__); \
- } \
- } while (0)
-#define VLOG_ONCE(LEVEL, ...) \
- do { \
- static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; \
- if (ovsthread_once_start(&once)) { \
- vlog(THIS_MODULE, LEVEL, __VA_ARGS__); \
- ovsthread_once_done(&once); \
- } \
- } while (0)
-#define VLOG_ERRP(ERRP, LEVEL, ...) \
- do { \
- VLOG(LEVEL, __VA_ARGS__); \
- if (ERRP) { \
- *(ERRP) = xasprintf(__VA_ARGS__); \
- } \
- } while (0)
-
-#define VLOG_DEFINE_MODULE__(MODULE) \
- extern struct vlog_module VLM_##MODULE; \
- struct vlog_module VLM_##MODULE = \
- { \
- OVS_LIST_INITIALIZER(&VLM_##MODULE.list), \
- #MODULE, /* name */ \
- { VLL_INFO, VLL_INFO, VLL_INFO }, /* levels */ \
- VLL_INFO, /* min_level */ \
- true /* honor_rate_limits */ \
- };
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* vlog.h */