0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 08:18:20 +02:00

ircd::prof: Add a coarse enable conf item.

This commit is contained in:
Jason Volk 2019-04-10 01:29:25 -07:00
parent 06e7b16ed5
commit 96ff7022d0

View file

@ -31,6 +31,8 @@ namespace ircd::prof
event &leader(group &);
event *leader(group *const &);
extern conf::item<bool> enable;
}
struct ircd::prof::event
@ -59,6 +61,14 @@ struct ircd::prof::event
~event() noexcept;
};
decltype(ircd::prof::enable)
ircd::prof::enable
{
{ "name", "ircd.prof.enable" },
{ "default", false },
{ "persist", false },
};
//
// init
//
@ -66,6 +76,9 @@ struct ircd::prof::event
ircd::prof::init::init()
try
{
if(!enable)
return;
create(system::group, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_CLOCK, true, false);
create(system::group, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_CLOCK, false, true);
create(system::group, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_TASK_CLOCK, true, false);