From: Lionel Landwerlin Date: Fri, 2 Jun 2023 19:40:03 +0000 (+0300) Subject: intel/stub_gpu: add an option to launch valgrind X-Git-Tag: upstream/23.3.3~7562 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c56dd678e4827a0d32f693d04f451ac45c890e82;p=platform%2Fupstream%2Fmesa.git intel/stub_gpu: add an option to launch valgrind Signed-off-by: Lionel Landwerlin Reviewed-by: Ian Romanick Part-of: --- diff --git a/src/intel/tools/intel_stub_gpu.in b/src/intel/tools/intel_stub_gpu.in index f8f09e0..068cda9 100755 --- a/src/intel/tools/intel_stub_gpu.in +++ b/src/intel/tools/intel_stub_gpu.in @@ -18,7 +18,8 @@ EOF exit 0 } -gdb="" +gdb= +valgrind= platform="skl" while true; do @@ -31,6 +32,10 @@ while true; do gdb=1 shift ;; + --valgrind) + valgrind=1 + shift + ;; -p) platform=$2 shift 2 @@ -66,8 +71,11 @@ done INTEL_STUB_GPU_PLATFORM=$platform ld_preload="@install_libdir@/libintel_noop_drm_shim.so${LD_PRELOAD:+:$LD_PRELOAD}" -if [ -z $gdb ]; then +if [ -n "$gdb" ]; then + 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 - 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 "$@" fi