ofproto-dpif-upcall: Add memory usage stats.
[sliver-openvswitch.git] / ofproto / ofproto-dpif.c
index 6af4974..11484cb 100644 (file)
@@ -1545,6 +1545,17 @@ get_memory_usage(const struct ofproto *ofproto_, struct simap *usage)
     simap_increase(usage, "subfacets", n_subfacets);
 }
 
+static void
+type_get_memory_usage(const char *type, struct simap *usage)
+{
+    struct dpif_backer *backer;
+
+    backer = shash_find_data(&all_dpif_backers, type);
+    if (backer) {
+        udpif_get_memory_usage(backer->udpif, usage);
+    }
+}
+
 static void
 flush(struct ofproto *ofproto_)
 {
@@ -6146,6 +6157,7 @@ const struct ofproto_class ofproto_dpif_class = {
     run,
     wait,
     get_memory_usage,
+    type_get_memory_usage,
     flush,
     get_features,
     get_tables,