mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
Tools: add disassemble script for perf
This commit is contained in:
parent
8f4bcf3ec3
commit
fd374a7989
50
Tools/perf-disassemble.sh
Executable file
50
Tools/perf-disassemble.sh
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Using this script instead of objdump enables perf to disassemble
|
||||||
|
# and annotate any JIT code (given a symbol file).
|
||||||
|
#
|
||||||
|
# To run perf without root:
|
||||||
|
# kernel.perf_event_paranoid = -1
|
||||||
|
# To trace a process without root:
|
||||||
|
# kernel.yama.ptrace_scope = 0
|
||||||
|
#
|
||||||
|
# Example usage:
|
||||||
|
# $ dolphin-emu -P /tmp -b -e $game
|
||||||
|
# $ perf top -p $(pidof dolphin-emu) --objdump ./Tools/perf-disassemble.sh
|
||||||
|
|
||||||
|
flavor=att
|
||||||
|
raw=r
|
||||||
|
src=
|
||||||
|
|
||||||
|
[[ "${@: -1}" != /tmp/perf-*.map ]] && { objdump "$@"; exit; }
|
||||||
|
|
||||||
|
while [ "$1" ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-M)
|
||||||
|
flavor=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--start-address=*)
|
||||||
|
start="${1##--start-address=}"
|
||||||
|
;;
|
||||||
|
--stop-address=*)
|
||||||
|
stop="${1##--stop-address=}"
|
||||||
|
;;
|
||||||
|
--no-show-raw)
|
||||||
|
raw=
|
||||||
|
;;
|
||||||
|
-S)
|
||||||
|
src=m
|
||||||
|
;;
|
||||||
|
-[ldC])
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
echo "Unknown parameter '$1'"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
gdb -q -p $(pidof dolphin-emu) -ex "set disassembly $flavor" -ex "disas /$raw$src $start,$stop" -ex q -batch
|
Loading…
Reference in New Issue
Block a user