From 65b1f8d709d6a419942f3363d959d739c855cb23 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 7 May 2019 19:14:35 -0700 Subject: [PATCH] ircd::prof: Trim sample contaminantes. --- ircd/prof.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ircd/prof.cc b/ircd/prof.cc index d99b49c57..5441331ae 100644 --- a/ircd/prof.cc +++ b/ircd/prof.cc @@ -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