From 88fe138d121a488d2687eeb416b5939e12622670 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 9 May 2020 17:03:27 -0700 Subject: [PATCH] ircd::prof: Add symbol definition for psi::supported=false on non-linux platforms. --- ircd/prof.cc | 9 +++++++++ modules/console.cc | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/ircd/prof.cc b/ircd/prof.cc index 3a6a30ca9..755169db6 100644 --- a/ircd/prof.cc +++ b/ircd/prof.cc @@ -22,6 +22,15 @@ ircd::prof::log "prof" }; +#ifndef __linux__ +[[gnu::weak]] +decltype(ircd::prof::psi::supported) +ircd::prof::psi::supported +{ + false +}; +#endif + uint64_t ircd::prof::time_real() noexcept diff --git a/modules/console.cc b/modules/console.cc index d1bd71b19..aa799223f 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -1229,6 +1229,12 @@ console_cmd__vg(opt &out, const string_view &line) bool console_cmd__prof__psi(opt &out, const string_view &line) { + if(!prof::psi::supported) + throw error + { + "Pressure Still Information is not supported." + }; + const auto show_file{[&out] (const string_view &name, prof::psi::file &file) {