Add support for tracking and logging daemon memory usage.
[openvswitch] / ofproto / ofproto-provider.h
index a74bf9ad7147cb1fa7d5fb5c6bb52e585a883cbd..1f3ad37f2d14193f1055f4ba283dee8864af4116 100644 (file)
@@ -30,6 +30,7 @@
 #include "timeval.h"
 
 struct ofputil_flow_mod;
+struct simap;
 
 /* An OpenFlow switch.
  *
@@ -396,6 +397,13 @@ struct ofproto_class {
      * poll-loop.h.  */
     void (*wait)(struct ofproto *ofproto);
 
+    /* Adds some memory usage statistics for the implementation of 'ofproto'
+     * into 'usage', for use with memory_report().
+     *
+     * This function is optional. */
+    void (*get_memory_usage)(const struct ofproto *ofproto,
+                             struct simap *usage);
+
     /* Every "struct rule" in 'ofproto' is about to be deleted, one by one.
      * This function may prepare for that, for example by clearing state in
      * advance.  It should *not* actually delete any "struct rule"s from