MCPcopy Create free account
hub / github.com/NationalSecurityAgency/TraceAnalysis / EmitThreadMeta

Function EmitThreadMeta

tracer-pin/pintool.cpp:514–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514inline VOID
515EmitThreadMeta()
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
535VOID
536WriteMapToJsonFile(IMG img, VOID* _v)

Callers 1

EmitPcFunction · 0.85

Calls 1

WriteRecordToFileFunction · 0.85

Tested by

no test coverage detected