+/* Adds some memory usage statistics for 'db' into 'usage', for use with
+ * memory_report(). */
+void
+ovsdb_get_memory_usage(const struct ovsdb *db, struct simap *usage)
+{
+ const struct shash_node *node;
+ unsigned int cells = 0;
+
+ SHASH_FOR_EACH (node, &db->tables) {
+ const struct ovsdb_table *table = node->data;
+ unsigned int n_columns = shash_count(&table->schema->columns);
+ unsigned int n_rows = hmap_count(&table->rows);
+
+ cells += n_rows * n_columns;
+ }
+
+ simap_increase(usage, "cells", cells);
+}
+