| 189 | } |
| 190 | |
| 191 | bool TraceManager::ParseProcessStartStop(EventData* data) { |
| 192 | if (data->GetEventName().substr(0, 8) != L"Process/") |
| 193 | return false; |
| 194 | |
| 195 | switch (data->GetEventDescriptor().Opcode) |
| 196 | { |
| 197 | case 1: // process created |
| 198 | { |
| 199 | auto prop = data->GetProperty(L"ImageFileName"); |
| 200 | if (prop) { |
| 201 | auto name = prop->GetAnsiString(); |
| 202 | if (name) { |
| 203 | std::wstring pname; |
| 204 | pname.assign(name, name + strlen(name)); |
| 205 | AddProcessName(data->GetProperty(L"ProcessId")->GetValue<DWORD>(), pname); |
| 206 | assert(!pname.empty()); |
| 207 | } |
| 208 | } |
| 209 | break; |
| 210 | } |
| 211 | |
| 212 | case 2: // process end |
| 213 | RemoveProcessName(data->GetProcessId()); |
| 214 | break; |
| 215 | } |
| 216 | |
| 217 | return true; |
| 218 | } |
| 219 | |
| 220 | void TraceManager::ResetIndex(uint32_t index) { |
| 221 | _index = index; |
nothing calls this directly
no test coverage detected