| 512 | } |
| 513 | |
| 514 | inline VOID |
| 515 | EmitThreadMeta() |
| 516 | { |
| 517 | /* |
| 518 | * NOTE: rather than use the `THREADID` that the emit functions use, |
| 519 | * I'm using pin's `OS_THREAD_ID`. Pin will re-use the `THREADID` value as |
| 520 | * different threads are stopped and started which may confuse dataflow |
| 521 | * analysis. Unfortunately though, this introduces a call to `PIN_GetTid()` |
| 522 | * which will slow everything down even more. |
| 523 | */ |
| 524 | OS_THREAD_ID threadid; |
| 525 | |
| 526 | if (INVALID_OS_THREAD_ID == (threadid = PIN_GetTid())) { |
| 527 | LOG("PIN_GetTid() returned invalid tid." + decstr(threadid)); |
| 528 | return; |
| 529 | } |
| 530 | |
| 531 | ThreadMeta tdata = { .threadid = threadid }; |
| 532 | WriteRecordToFile(RecordKind::MetaRecord, (UINT8*)&tdata, sizeof(tdata), OutFile); |
| 533 | } |
| 534 | |
| 535 | VOID |
| 536 | WriteMapToJsonFile(IMG img, VOID* _v) |
no test coverage detected