0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd::prof: Trim sample contaminantes.

This commit is contained in:
Jason Volk 2019-05-07 19:14:35 -07:00
parent 0112d49f62
commit 65b1f8d709

View file

@ -121,6 +121,7 @@ ircd::prof::reset(group &group)
}
void
__attribute__((optimize("s"), flatten))
ircd::prof::start(group &group)
{
assert(!group.empty());
@ -129,11 +130,12 @@ ircd::prof::start(group &group)
}
void
__attribute__((optimize("s"), flatten))
ircd::prof::stop(group &group)
{
assert(!group.empty());
auto &leader(*group.front());
leader.disable(PERF_IOC_FLAG_GROUP);
assert(!group.empty());
}
ircd::prof::event &
@ -305,6 +307,7 @@ noexcept
}
const uint64_t &
__attribute__((optimize("s")))
ircd::prof::instructions::sample()
{
stop(this->group);
@ -792,15 +795,18 @@ noexcept
}
void
__attribute__((optimize("s")))
ircd::prof::event::disable(const long &arg)
{
ioctl(PERF_EVENT_IOC_DISABLE, arg);
::ioctl(int(fd), PERF_EVENT_IOC_DISABLE, arg);
}
void
__attribute__((optimize("s")))
ircd::prof::event::enable(const long &arg)
{
ioctl(PERF_EVENT_IOC_ENABLE, arg);
const int &fd(this->fd);
::ioctl(fd, PERF_EVENT_IOC_ENABLE, arg);
}
void