Commit 41fc6063 authored by Antonio Caggiano's avatar Antonio Caggiano 🦀
Browse files

readme: Add Intel information



Add some information about the new available Intel driver and adjust
formatting of the code examples.
Signed-off-by: Antonio Caggiano's avatarAntonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: default avatarRohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny's avatarGert Wollny <gert.wollny@collabora.com>
parent 2d118fb4
Pipeline #236234 passed with stages
in 2 minutes and 6 seconds
Graphics Perfetto producers
---------------------------
This project contains a collection of graphics-related [Perfetto producers](https://perfetto.dev/#/architecture.md). A producer is a client process for the Perfetto tracing service. Currently under development are the following producers:
This project contains a collection of graphics-related [Perfetto producers](https://perfetto.dev/#/architecture.md). A producer is a client process for the Perfetto tracing service. Currently available are the following producers:
- Panfrost performance counters
- Weston timeline debug stream
- Intel performance counters
## Build
......@@ -12,21 +13,21 @@ This section guides you through the building process assuming you are compiling
1. Install dependencies:
```sh
apt install build-essential meson cmake libwayland-dev rapidjson-dev libdrm-dev libprotobuf-dev libgtest-dev libdocopt-dev
```
```sh
apt install build-essential meson cmake libwayland-dev rapidjson-dev libdrm-dev libprotobuf-dev libgtest-dev libdocopt-dev
```
2. Generate the project:
```sh
meson build
```
```sh
meson build
```
3. Compile and run tests (it may take a while):
```sh
ninja -C build test
```
```sh
ninja -C build test
```
### Cross-compile
......@@ -40,32 +41,32 @@ To cross-compile on amd64 using clang, follow these steps:
1. Change directory to `perfetto`
```sh
cd <path>/perfetto
```
```sh
cd <path>/perfetto
```
2. Generate a build directory
```sh
tools/gn args out/arm64
```
```sh
tools/gn args out/arm64
```
Typing in the following GN args
Typing in the following GN args
```js
// args.gn
target_os = "linux"
target_cpu = "arm64"
is_debug = false
target_sysroot = "/usr/aarch64-linux-gnu"
target_gcc_toolchain = "/usr"
```
```js
// args.gn
target_os = "linux"
target_cpu = "arm64"
is_debug = false
target_sysroot = "/usr/aarch64-linux-gnu"
target_gcc_toolchain = "/usr"
```
3. Compile perfetto and the tracing service
```sh
tools/ninja -C out/arm64 perfetto traced traced_probes
```
```sh
tools/ninja -C out/arm64 perfetto traced traced_probes
```
#### Cross-compile gfx-pps producers
......@@ -73,45 +74,45 @@ To cross-compile with meson, you need to take these steps:
1. Prepare a chroot for cross-building
```sh
sudo debootstrap --variant=buildd focal /srv/target/focal
sudo chroot /srv/target/focal
mount -t proc proc /proc
```
```sh
sudo debootstrap --variant=buildd focal /srv/target/focal
sudo chroot /srv/target/focal
mount -t proc proc /proc
```
2. Add arm64 to `/etc/apt/souces.list`
```
deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main
```
```
deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main
```
3. Enable multiarch by adding arm64
```sh
dpkg --add-architecture arm64
```
```sh
dpkg --add-architecture arm64
```
4. Install the arm64 toolchain and other required packages:
```sh
apt update
apt install build-essential libc6-arm64-cross gcc-aarch64-linux-gnu g++-aarch64-linux-gnu meson cmake libdrm-dev:arm64 libwayland-dev:arm64 libprotobuf-dev:arm64 rapidjson-dev:arm64 libgtest-dev:arm64 libdocopt-dev:arm64
```
```sh
apt update
apt install build-essential libc6-arm64-cross gcc-aarch64-linux-gnu g++-aarch64-linux-gnu meson cmake libdrm-dev:arm64 libwayland-dev:arm64 libprotobuf-dev:arm64 rapidjson-dev:arm64 libgtest-dev:arm64 libdocopt-dev:arm64
```
5. Create a [cross file](https://mesonbuild.com/Cross-compilation.html) for meson like the following snippet: [aarch64-linux](https://gitlab.freedesktop.org/Fahien/gfx-pps/snippet/1086)
6. Generate the project using that cross file:
```sh
meson build/arm64 --cross-file aarch64-linux
```
```sh
meson build/arm64 --cross-file aarch64-linux
```
7. Compile and run tests
```sh
ninja -C build/arm64 test
```
```sh
ninja -C build/arm64 test
```
## Run
......@@ -123,10 +124,10 @@ To capture a trace with perfetto you need to take the following steps:
3. Change directory to `perfetto` and run a [convenience script](https://perfetto.dev/#/running.md) to start the tracing service:
```sh
cd <path>/perfetto
CONFIG=test.cfg OUT=out/build ./tools/tmux
```
```sh
cd <path>/perfetto
CONFIG=test.cfg OUT=out/build ./tools/tmux
```
4. Start other producers you may need, like `producer-gpu` or `producer-weston`.
......@@ -138,18 +139,32 @@ CONFIG=test.cfg OUT=out/build ./tools/tmux
### GPU producer
The GPU producer contains at the current state a data-source able to query GPU performance counters using the Panfrost driver. The data-source uses unstable ioctls that behave correctly on kernel version [5.4.23+](https://lwn.net/Articles/813601/) and [5.5.7+](https://lwn.net/Articles/813600/). To run the producer, follow these two simple steps:
The GPU producer contains at the current state a data-source able to query performance counters using a Panfrost driver for Arm Mali devices, or an Intel driver for Intel Graphics devices.
#### Panfrost driver
The Panfrost driver uses unstable ioctls that behave correctly on kernel version [5.4.23+](https://lwn.net/Articles/813601/) and [5.5.7+](https://lwn.net/Articles/813600/).
To run the producer, follow these two simple steps:
1. Enable Panfrost unstable ioctls via kernel parameter:
```sh
modprobe panfrost unstable_ioctls=1
```
```sh
modprobe panfrost unstable_ioctls=1
```
2. Run the producer:
```sh
./build/producer-gpu
```
#### Intel driver
The Intel driver needs root access to read system-wide [RenderBasic]() performance counters, so you can simply run it with sudo:
```sh
./build/producer-gpu
sudo ./build/producer-gpu
```
### Weston producer
......@@ -158,15 +173,15 @@ The weston producer needs the debug protocol to be present in weston. If the deb
1. Before running `producer-weston`, make sure weston is started with the `--debug` argument:
```sh
weston --debug
```
```sh
weston --debug
```
2. Execute the producer:
```sh
./build/producer-weston
```
```sh
./build/producer-weston
```
## Troubleshooting
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment