summaryrefslogtreecommitdiff
path: root/ovsdb/table.c
diff options
context:
space:
mode:
authorDumitru Ceara <dceara@redhat.com>2022-06-24 11:55:58 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-06-28 13:45:36 +0200
commita9ec4e3be3be8d0a6e2e0b4571d94b045cf671c6 (patch)
tree76fae3770b6da9b704c0f1972958c8a8be12cc93 /ovsdb/table.c
parentc558f9f1e131e8d97cbf46bfd69aa2880ec4893d (diff)
downloadopenvswitch-a9ec4e3be3be8d0a6e2e0b4571d94b045cf671c6.tar.gz
ovsdb-server: Log database transactions for user requested tables.
Add a new command, 'ovsdb-server/tlog-set DB:TABLE on|off', which allows the user to enable/disable transaction logging for specific databases and tables. By default, logging is disabled. Once enabled, logs are generated with level INFO and are also rate limited. If used with care, this command can be useful in analyzing production deployment performance issues, allowing the user to pin point bottlenecks without the need to enable wider debug logs, e.g., jsonrpc. A command to inspect the logging state is also added: 'ovsdb-server/tlog-list'. Signed-off-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ovsdb/table.c')
-rw-r--r--ovsdb/table.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ovsdb/table.c b/ovsdb/table.c
index 2184701ec..66071ce2f 100644
--- a/ovsdb/table.c
+++ b/ovsdb/table.c
@@ -301,11 +301,24 @@ ovsdb_table_create(struct ovsdb_table_schema *ts)
hmap_init(&table->indexes[i]);
}
hmap_init(&table->rows);
+ table->log = false;
return table;
}
void
+ovsdb_table_logging_enable(struct ovsdb_table *table, bool enabled)
+{
+ table->log = enabled;
+}
+
+bool
+ovsdb_table_is_logging_enabled(struct ovsdb_table *table)
+{
+ return table->log;
+}
+
+void
ovsdb_table_destroy(struct ovsdb_table *table)
{
if (table) {