diff --git a/include/ircd/prof.h b/include/ircd/prof.h index fae0cfab4..c5c313e03 100644 --- a/include/ircd/prof.h +++ b/include/ircd/prof.h @@ -22,7 +22,7 @@ namespace ircd::prof enum counter :uint8_t; enum cacheop :uint8_t; using group = std::vector>; - + IRCD_OVERLOAD(sample) IRCD_EXCEPTION(ircd::error, error) uint64_t cycles(); ///< Monotonic reference cycles (since system boot) @@ -34,7 +34,6 @@ namespace ircd::prof // Observe system &hotsample(system &) noexcept; - system &sample(system &) noexcept; system &operator+=(system &a, const system &b); system &operator-=(system &a, const system &b); system operator+(const system &a, const system &b); @@ -65,7 +64,6 @@ struct ircd::prof::times uint64_t kern {0}; uint64_t user {0}; - IRCD_OVERLOAD(sample) times(sample_t); times() = default; }; @@ -87,6 +85,7 @@ struct ircd::prof::system // 5: SWITCH_TASK, // 6: SWITCH_CPU, + system(sample_t) noexcept; system() :array_type{{0}} {} diff --git a/ircd/prof.cc b/ircd/prof.cc index 7edb3344e..4849f8eb9 100644 --- a/ircd/prof.cc +++ b/ircd/prof.cc @@ -220,16 +220,6 @@ ircd::prof::operator+=(system &a, return a; } -ircd::prof::system & -ircd::prof::sample(system &s) -noexcept -{ - stop(system::group); - hotsample(s); - start(system::group); - return s; -} - ircd::prof::system & ircd::prof::hotsample(system &s) noexcept @@ -299,6 +289,14 @@ ircd::prof::for_each(const const_buffer &buf, return closure(type(**it), body[i].val); } +ircd::prof::system::system(sample_t) +noexcept +{ + stop(group); + hotsample(*this); + start(group); +} + // // event //