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

Method readRaw

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

Source from the content-addressed store, hash-verified

102 }
103
104 bool readRaw(uint64_t* values) {
105 if (m_err || !useCounters()) return false;
106 init_if_not();
107
108 if (m_fd > 0) {
109 /*
110 * read the count + scaling values
111 *
112 * It is not necessary to stop an event to read its value
113 */
114 auto ret = ::read(m_fd, values, sizeof(*values) * 3);
115 if (ret == sizeof(*values) * 3) {
116 values[0] -= reset_values[0];
117 values[1] -= reset_values[1];
118 values[2] -= reset_values[2];
119 return true;
120 }
121 }
122 return false;
123 }
124
125 void reset() {
126 if (m_err || !useCounters()) return;

Callers

nothing calls this directly

Calls 2

useCountersFunction · 0.85
readFunction · 0.50

Tested by

no test coverage detected