mirror of
https://github.com/matrix-construct/construct
synced 2025-04-02 16:00:36 +02:00
ircd::prof: Add a coarse enable conf item.
This commit is contained in:
parent
06e7b16ed5
commit
96ff7022d0
1 changed files with 13 additions and 0 deletions
13
ircd/prof.cc
13
ircd/prof.cc
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue