README_CLI.txt
4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
****************************************************************************
* README *
* *
* This file provides all the information regarding 4 new CLI commands that *
* enable using Intel(R) Processor Trace Tool from LLDB's CLI. *
****************************************************************************
============
Introduction
============
A C++ based cli wrapper has been developed to use Intel(R) Processor Trace Tool
through LLDB's command line. This also provides an idea to all developers on how
to integrate the Tool into various IDEs providing LLDB as a debugger.
============
How to Build
============
The wrapper cli-wrapper-pt.cpp needs to be compiled and linked with the shared
library of the Intel(R) Processor Trace Tool in order to be used through LLDB's
CLI. The procedure to build shared library of the Intel(R) Processor Trace Tool
is given in README_TOOL.txt file.
============
How to Use
============
All these commands are available via shared library (lldbIntelFeatures)
obtained after building intel-features folder from top. Please refer to
cli-wrapper.cpp and README files of "intel-features" folder for this purpose.
============
Description
============
4 CLI commands have been designed keeping the LLDB's existing CLI command syntax
in mind.
1) processor-trace start [-b <buffer-size>] [<thread-index>]
Start Intel(R) Processor Trace on a specific thread or on the whole process
Syntax: processor-trace start <cmd-options>
cmd-options Usage:
processor-trace start [-b <buffer-size>] [<thread-index>]
-b <buffer-size>
size of the trace buffer to store the trace data. If not specified
then a default value (=4KB) will be taken
<thread-index>
thread index of the thread. If no threads are specified, currently
selected thread is taken. Use the thread-index 'all' to start
tracing the whole process
2) processor-trace stop [<thread-index>]
Stop Intel(R) Processor Trace on a specific thread or on the whole process
Syntax: processor-trace stop <cmd-options>
cmd-options Usage:
processor-trace stop [<thread-index>]
<thread-index>
thread index of the thread. If no threads are specified, currently
selected thread is taken. Use the thread-index 'all' to stop
tracing the whole process
3) processor-trace show-trace-options [<thread-index>]
Display all the information regarding Intel(R) Processor Trace for a specific
thread or for the whole process. The information contains trace buffer
size and configuration options of Intel(R) Processor Trace.
Syntax: processor-trace show-trace-options <cmd-options>
cmd-options Usage:
processor-trace show-trace-options [<thread-index>]
<thread-index>
thread index of the thread. If no threads are specified, currently
selected thread is taken. Use the thread-index 'all' to display
information for all threads of the process
4) processor-trace show-instr-log [-o <offset>] [-c <count>] [<thread-index>]
Display a log of assembly instructions executed for a specific thread or
for the whole process. The length of the log to be displayed and the
offset in the whole instruction log from where the log needs to be
displayed can also be provided. The offset is counted from the end of this
whole instruction log which means the last executed instruction is at
offset 0 (zero).
Syntax: processor-trace show-instr-log <cmd-options>
cmd-options Usage:
processor-trace show-instr-log [-o <offset>] [-c <count>] [<thread-index>]
-c <count>
number of instructions to be displayed. If not specified then a
default value (=10) will be taken
-o <offset>
offset in the whole instruction log from where the log will be
displayed. If not specified then default value is calculated as
offset = count -1
<thread-index>
thread index of the thread. If no threads are specified, currently
selected thread is taken. Use the thread-index 'all' to show
instruction log for all the threads of the process