diff options
author | Dan Williams <dcbw@redhat.com> | 2022-12-14 10:29:16 -0600 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-12-21 20:02:50 +0100 |
commit | 685973a9f1cb2c9a49ea517a8feab7012a35a1fd (patch) | |
tree | 7f7baacea58588fce9d6808bd6d29c60c8c6119b /ovsdb | |
parent | 863d2e1a8c2a6ced49a49024c094ef6a9aa7e55a (diff) | |
download | openvswitch-685973a9f1cb2c9a49ea517a8feab7012a35a1fd.tar.gz |
ovsdb-server: Don't log when memory-trim-on-compaction doesn't change.
But log at least once even if the value hasn't changed, for
informational purposes.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ovsdb')
-rw-r--r-- | ovsdb/ovsdb-server.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 7a6bfe0a0..33ca4910d 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -1600,6 +1600,8 @@ ovsdb_server_memory_trim_on_compaction(struct unixctl_conn *conn, const char *argv[], void *arg OVS_UNUSED) { + bool old_trim_memory = trim_memory; + static bool have_logged = false; const char *command = argv[1]; #if !HAVE_DECL_MALLOC_TRIM @@ -1615,8 +1617,11 @@ ovsdb_server_memory_trim_on_compaction(struct unixctl_conn *conn, unixctl_command_reply_error(conn, "invalid argument"); return; } - VLOG_INFO("memory trimming after compaction %s.", - trim_memory ? "enabled" : "disabled"); + if (!have_logged || (trim_memory != old_trim_memory)) { + have_logged = true; + VLOG_INFO("memory trimming after compaction %s.", + trim_memory ? "enabled" : "disabled"); + } unixctl_command_reply(conn, NULL); } |