1import lldb
2from intelpt_testcase import *
3from lldbsuite.test.lldbtest import *
4from lldbsuite.test import lldbutil
5from lldbsuite.test.decorators import *
6
7class TestTraceLoad(TraceIntelPTTestCaseBase):
8
9    mydir = TestBase.compute_mydir(__file__)
10
11    def testSchema(self):
12        self.expect("trace schema intel-pt", substrs=["triple", "threads", "traceBuffer"])
13
14    def testInvalidPluginSchema(self):
15        self.expect("trace schema invalid-plugin", error=True,
16            substrs=['error: no trace plug-in matches the specified type: "invalid-plugin"'])
17
18    def testAllSchemas(self):
19        self.expect("trace schema all", substrs=['''{
20  "type": "intel-pt",
21  "cpuInfo": {
22    // CPU information gotten from, for example, /proc/cpuinfo.
23
24    "vendor": "GenuineIntel" | "unknown",
25    "family": integer,
26    "model": integer,
27    "stepping": integer
28  },'''])
29