[trace][intelpt] Instruction count in trace info

Added a line to `thread trace dump info` results which shows total number of instructions executed until now.

Differential Revision: https://reviews.llvm.org/D122076
This commit is contained in:
Alisamar Husain 2022-03-20 01:28:04 +05:30
parent ae0ae91903
commit 8271220a99
2 changed files with 6 additions and 2 deletions

View File

@ -110,7 +110,10 @@ void TraceIntelPT::DumpTraceInfo(Thread &thread, Stream &s, bool verbose) {
s.Printf(", not traced\n");
return;
}
s.Printf("\n Raw trace size: %zu bytes\n", *raw_size);
s.Printf("\n");
s.Printf(" Raw trace size: %zu bytes\n", *raw_size);
s.Printf(" Total number of instructions: %zu\n",
Decode(thread)->GetInstructions().size());
return;
}

View File

@ -38,4 +38,5 @@ class TestTraceDumpInfo(TraceIntelPTTestCaseBase):
substrs=['''Trace technology: intel-pt
thread #1: tid = 3842849
Raw trace size: 4096 bytes'''])
Raw trace size: 4096 bytes
Total number of instructions: 21'''])