mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-20 17:48:15 +02:00
Created stand alone tool for sampling gfx data on regular
intervals. Tool has inner loop that performs sampling every N
useconds. Press any key to end sampling. Results will be dumped
when intel_monitor exits.
First application of intel_monitor will be to collect eu stall
data. Perhaps more applications can be added at a later date.
How to use:
0. Set sysctl dev.xe.observation_paranoid=0
1. Clean shader cache and launch gfx INTEL_DEBUG=shaders-lineno.
Redirect stderr to asm.txt.
2. When gfx app ready to monitor, begin capturing eustall data by
launching `intel_monitor -e > eustall.csv` in separate console.
3 When done collected, close intel_monitor by pressing any key.
4. Correlate eustall data in eustall.csv with shader instructions in
asm.txt by matching instruction offsets. Use data to determine which
instructions are stalling and why.
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30142>
28 lines
631 B
C
28 lines
631 B
C
/*
|
|
* Copyright 2024 Intel Corporation
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "perf/intel_perf.h"
|
|
|
|
struct eustall_config {
|
|
struct intel_perf_query_eustall_result result;
|
|
struct intel_device_info *devinfo;
|
|
int drm_fd;
|
|
uint8_t* buf;
|
|
size_t buf_len;
|
|
int record_size;
|
|
|
|
int fd;
|
|
uint64_t poll_period_ns;
|
|
int sample_rate;
|
|
uint32_t min_event_count;
|
|
};
|
|
|
|
struct eustall_config* eustall_setup(int drm_fd,
|
|
struct intel_device_info* devinfo);
|
|
bool eustall_sample(void *cfg);
|
|
void eustall_dump_results(void *cfg, FILE* file);
|
|
void eustall_close(void *cfg);
|