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