You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create PerfDataExtension project with decoding support for perf.data files. Includes a generic events table with details view and a simple files metadata table.
Perf is used to collect CPU Sampling (cpu-clock) events as LTTng doesn't support capturing these yet. Note: Stacks may require symbol setup
100
+
# Perf.data
101
+
102
+
You can collect and view Linux [kernel-mode](https://www.kernel.org/doc/html/latest/trace/tracepoints.html) and [user-mode](https://docs.kernel.org/trace/user_events.html) tracepoints in the `perf.data` file format.
103
+
104
+
- Select existing tracepoints that you want to collect, or write your own programs that generate tracepoint events.
105
+
- Use the Linux `perf` tool or some other tool to collect tracepoint events into `perf.data` files.
106
+
- Use the PerfData extension to view the tracepoints.
107
+
108
+
## Selecting tracepoints
109
+
110
+
The Linux kernel and the kernel modules generate many useful tracepoints that you can collect. Look in `/sys/kernel/tracing/events` for the tracepoints that are available to you.
111
+
112
+
In addition, Linux 6.4 adds support for generating
-[LinuxTracepoints](https://github.com/microsoft/LinuxTracepoints) contains support for generating `user_events` from C/C++ programs.
117
+
-[LinuxTracepoints-Rust](https://github.com/microsoft/LinuxTracepoints-Rust) contains support for generating `user_events` from Rust programs.
118
+
119
+
## Collecting tracepoints
120
+
121
+
The Linux [perf](https://perf.wiki.kernel.org/) tool supports collecting tracepoint events using `perf record`.
122
+
123
+
- Install `perf` from the `linux-perf` or `linux-tools` package.
124
+
- Note that some `perf` packages use a wrapper script to help you match the running kernel version with a version-specific build of the `perf` tool, e.g. `perf_VERSION`. For collecting tracepoints, the version doesn't need to match. If you have version mismatch problems, you can safely bypass the wrapper script and directly use the `perf_VERSION` tool.
125
+
- Install the `libtraceevent1` package to enable `perf` support for tracepoints.
126
+
- Use [perf record](https://www.man7.org/linux/man-pages/man1/perf-record.1.html) to collect traces, e.g. `perf record -o MyFile.perf.data -k monotonic -e "event1_group:event1_name,event2_group:event2_name"`
127
+
- Use `-k monotonic` to include clock offset information in the data file.
128
+
129
+
You can also use other tools that generate `perf.data`-compatible files.
130
+
131
+
-[libtracepoint-control](https://github.com/microsoft/LinuxTracepoints/tree/main/libtracepoint-control-cpp) includes a library for configuring tracepoint collection sessions and collecting `perf.data` files.
132
+
-[tracepoint-collect](https://github.com/microsoft/LinuxTracepoints/blob/main/libtracepoint-control-cpp/tools/tracepoint-collect.cpp) is a simple tool that collects tracepoint events into `perf.data` files.
133
+
134
+
# Perf.data.txt
135
+
Perf is used to collect CPU Sampling (cpu-clock) events as LTTng doesn't support capturing these yet. Note: Stacks may require symbol setup.
136
+
137
+
The perf CPU Sampling analysis plugin uses perf.data.txt files as input.
102
138
103
139
[perf](https://perf.wiki.kernel.org/) CPU Sampling(cpu-clock)
104
140
@@ -172,4 +208,4 @@ $ tar -czvf perf_cpu.tar.gz perf*
172
208
# Presentations
173
209
174
210
If you want to see a demo or get more in-depth info on using these tools check out a talk given at the [Linux Tracing Summit](https://www.tracingsummit.org/ts/2019/):
175
-
>Linux & Windows Perf Analysis using WPA, ([slides](https://www.tracingsummit.org/ts/2019/files/Tracingsummit2019-wpa-berg-gibeau.pdf)) ([video](https://youtu.be/HUbVaIi-aaw))
211
+
>Linux & Windows Perf Analysis using WPA, ([slides](https://www.tracingsummit.org/ts/2019/files/Tracingsummit2019-wpa-berg-gibeau.pdf)) ([video](https://youtu.be/HUbVaIi-aaw))
0 commit comments