Compute the events that apply to a specific code object: global events OR'd with local events registered for that code. This prevents events like INSTRUCTION that are local to one code from being applied to unrelated code objects.
(&self, code_id: usize)
| 125 | /// This prevents events like INSTRUCTION that are local to one code |
| 126 | /// from being applied to unrelated code objects. |
| 127 | pub fn events_for_code(&self, code_id: usize) -> u32 { |
| 128 | let global = self.global_events.iter().fold(0, |acc, &e| acc | e); |
| 129 | let local = self |
| 130 | .local_events |
| 131 | .iter() |
| 132 | .filter(|((_, cid), _)| *cid == code_id) |
| 133 | .fold(0, |acc, (_, &e)| acc | e); |
| 134 | global | local |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | /// Global atomic mask: OR of all tools' events. Checked in the hot path |
no test coverage detected