aboutsummaryrefslogtreecommitdiff
path: root/lib/dpif.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-11-01 14:14:27 -0700
committerBen Pfaff <blp@nicira.com>2010-11-30 10:30:30 -0800
commitd76f09ea77e03ee5a3a7bb67bcab1ac4bb54172b (patch)
tree51f5b6b4090380591410d830e6fa57d02185e629 /lib/dpif.c
parentf4e2e60be455af4d5bd294cfe19a7cb4ea13a9ff (diff)
coverage: Make the coverage counters catalog program-specific.
Until now, the collection of coverage counters supported by a given OVS program was not specific to that program. That means that, for example, even though ovs-dpctl does not have anything to do with mac_learning, it still has a coverage counter for it. This is confusing, at best. This commit fixes the problem on some systems, in particular on ones that use GCC and the GNU linker. It uses the feature of the GNU linker described in its manual as: If an orphaned section's name is representable as a C identifier then the linker will automatically see PROVIDE two symbols: __start_SECNAME and __end_SECNAME, where SECNAME is the name of the section. These indicate the start address and end address of the orphaned section respectively. Systems that don't support these features retain the earlier behavior. This commit also fixes the annoyance that files that include coverage counters must be listed on COVERAGE_FILES in lib/automake.mk. This commit also fixes the annoyance that modifying any source file that includes a coverage counter caused all programs that link against libopenvswitch.a to relink, even programs that the source file was not linked into. For example, modifying ofproto/ofproto.c (which includes coverage counters) caused tests/test-aes128 to relink, even though test-aes128 does not link again ofproto.o.
Diffstat (limited to 'lib/dpif.c')
-rw-r--r--lib/dpif.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/dpif.c b/lib/dpif.c
index ea806dc1..5402033d 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -42,6 +42,18 @@
VLOG_DEFINE_THIS_MODULE(dpif);
+COVERAGE_DEFINE(dpif_destroy);
+COVERAGE_DEFINE(dpif_port_add);
+COVERAGE_DEFINE(dpif_port_del);
+COVERAGE_DEFINE(dpif_flow_flush);
+COVERAGE_DEFINE(dpif_flow_get);
+COVERAGE_DEFINE(dpif_flow_put);
+COVERAGE_DEFINE(dpif_flow_del);
+COVERAGE_DEFINE(dpif_flow_query_list);
+COVERAGE_DEFINE(dpif_flow_query_list_n);
+COVERAGE_DEFINE(dpif_execute);
+COVERAGE_DEFINE(dpif_purge);
+
static const struct dpif_class *base_dpif_classes[] = {
#ifdef HAVE_NETLINK
&dpif_linux_class,
@@ -375,6 +387,7 @@ dpif_get_all_names(const struct dpif *dpif, struct svec *all_names)
}
}
+
/* Destroys the datapath that 'dpif' is connected to, first removing all of its
* ports. After calling this function, it does not make sense to pass 'dpif'
* to any functions other than dpif_name() or dpif_close(). */