mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 01:18:06 +02:00
intel/stub_gpu: add an option to launch valgrind
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23405>
This commit is contained in:
parent
61a7eacf3e
commit
c56dd678e4
1 changed files with 12 additions and 4 deletions
|
|
@ -18,7 +18,8 @@ EOF
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
gdb=""
|
gdb=
|
||||||
|
valgrind=
|
||||||
platform="skl"
|
platform="skl"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
@ -31,6 +32,10 @@ while true; do
|
||||||
gdb=1
|
gdb=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--valgrind)
|
||||||
|
valgrind=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-p)
|
-p)
|
||||||
platform=$2
|
platform=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
|
@ -66,8 +71,11 @@ done
|
||||||
INTEL_STUB_GPU_PLATFORM=$platform
|
INTEL_STUB_GPU_PLATFORM=$platform
|
||||||
|
|
||||||
ld_preload="@install_libdir@/libintel_noop_drm_shim.so${LD_PRELOAD:+:$LD_PRELOAD}"
|
ld_preload="@install_libdir@/libintel_noop_drm_shim.so${LD_PRELOAD:+:$LD_PRELOAD}"
|
||||||
if [ -z $gdb ]; then
|
if [ -n "$gdb" ]; then
|
||||||
LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform exec "$@"
|
|
||||||
else
|
|
||||||
gdb -iex "set exec-wrapper env LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform" --args "$@"
|
gdb -iex "set exec-wrapper env LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform" --args "$@"
|
||||||
|
LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform exec "$@"
|
||||||
|
elif [ -n "$valgrind" ]; then
|
||||||
|
LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform exec valgrind "$@"
|
||||||
|
else
|
||||||
|
LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform exec "$@"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue