From 13ec4b51653d3c83b6ec4416055af4a9af662faf Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Tue, 2 Nov 2021 22:19:58 -0400 Subject: [PATCH] hash: add utsname fields to log output Putting this information in the logs saves us from having to ask for the kernel version and machine name every time. Signed-off-by: Zygo Blaxell --- src/bees-hash.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bees-hash.cc b/src/bees-hash.cc index d0afe81..91648ca 100644 --- a/src/bees-hash.cc +++ b/src/bees-hash.cc @@ -3,6 +3,7 @@ #include "crucible/city.h" #include "crucible/crc64.h" #include "crucible/string.h" +#include "crucible/uname.h" #include @@ -225,6 +226,7 @@ percent(size_t num, size_t den) void BeesHashTable::prefetch_loop() { + Uname uname; bool not_locked = true; while (!m_stop_requested) { size_t width = 64; @@ -318,6 +320,7 @@ BeesHashTable::prefetch_loop() graph_blob << "Now: " << format_time(time(NULL)) << "\n"; graph_blob << "Uptime: " << m_ctx->total_timer().age() << " seconds\n"; graph_blob << "Version: " << BEES_VERSION << "\n"; + graph_blob << "Kernel: " << uname.sysname << " " << uname.release << " " << uname.machine << " " << uname.version << "\n"; graph_blob << "\nHash table page occupancy histogram (" << occupied_count << "/" << total_count << " cells occupied, " << (occupied_count * 100 / total_count) << "%)\n"