This adds a basic SB API for creating and stopping traces. Note: This doesn't add any APIs for inspecting individual instructions. That'd be a more complicated change and it might be better to enhande the dump functionality to output the data in binary format. I'll leave that for a later diff. This also enhances the existing tests so that they test the same flow using both the command interface and the SB API. I also did some cleanup of legacy code. Differential Revision: https://reviews.llvm.org/D103500
29 lines
840 B
Python
29 lines
840 B
Python
import lldb
|
|
from intelpt_testcase import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
from lldbsuite.test.decorators import *
|
|
|
|
class TestTraceLoad(TraceIntelPTTestCaseBase):
|
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
|
|
|
def testSchema(self):
|
|
self.expect("trace schema intel-pt", substrs=["trace", "triple", "threads", "traceFile"])
|
|
|
|
def testInvalidPluginSchema(self):
|
|
self.expect("trace schema invalid-plugin", error=True,
|
|
substrs=['error: no trace plug-in matches the specified type: "invalid-plugin"'])
|
|
|
|
def testAllSchemas(self):
|
|
self.expect("trace schema all", substrs=['''{
|
|
"trace": {
|
|
"type": "intel-pt",
|
|
"cpuInfo": {
|
|
"vendor": "intel" | "unknown",
|
|
"family": integer,
|
|
"model": integer,
|
|
"stepping": integer
|
|
}
|
|
},'''])
|