MCPcopy Create free account
hub / github.com/facebook/react / reset

Method reset

scripts/perf-counters/src/hardware-counter.cpp:125–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 }
124
125 void reset() {
126 if (m_err || !useCounters()) return;
127 init_if_not();
128 extra = 0;
129 if (m_fd > 0) {
130 if (ioctl (m_fd, PERF_EVENT_IOC_RESET, 0) < 0) {
131 // Logger::Warning("perf_event failed to reset with: %s",
132 // folly::errnoStr(errno).c_str());
133 m_err = -1;
134 return;
135 }
136 auto ret = ::read(m_fd, reset_values, sizeof(reset_values));
137 if (ret != sizeof(reset_values)) {
138 // Logger::Warning("perf_event failed to reset with: %s",
139 // folly::errnoStr(errno).c_str());
140 m_err = -1;
141 return;
142 }
143 }
144 }
145
146public:
147 std::string m_desc;

Callers

nothing calls this directly

Calls 2

useCountersFunction · 0.85
readFunction · 0.50

Tested by

no test coverage detected