| 103 | } |
| 104 | |
| 105 | void KittyPerfWatch::clear() |
| 106 | { |
| 107 | for (auto &w : _watches) |
| 108 | { |
| 109 | if (w.fd >= 0) |
| 110 | { |
| 111 | ioctl(w.fd, PERF_EVENT_IOC_RESET, 0); |
| 112 | ioctl(w.fd, PERF_EVENT_IOC_DISABLE, 0); |
| 113 | } |
| 114 | |
| 115 | if (w.mmap && w.mmap != MAP_FAILED && w.mmap_sz) |
| 116 | munmap(w.mmap, w.mmap_sz); |
| 117 | |
| 118 | if (w.fd >= 0) |
| 119 | close(w.fd); |
| 120 | |
| 121 | w = {}; |
| 122 | } |
| 123 | |
| 124 | _watches.clear(); |
| 125 | } |
| 126 | |
| 127 | void KittyPerfWatch::consumeRecord(const WatchInfo &w, KittyPerfSample *out) |
| 128 | { |
no outgoing calls
no test coverage detected