提交 e323c93e 编写于 作者: J Jes Sorensen 提交者: Aurelien Jarno

tracetool: Add optional argument to specify dtrace probe names

Optional feature allowing a user to generate the probe list to match
the name of the binary, in case they wish to install qemu under a
different name than qemu-{system,user},<arch>
Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
Acked-by: NStefan Hajnoczi <stefaha@linux.vnet.ibm.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 8387da81
...@@ -33,6 +33,8 @@ Options: ...@@ -33,6 +33,8 @@ Options:
--binary [path] Full path to QEMU binary --binary [path] Full path to QEMU binary
--target-arch [arch] QEMU emulator target arch --target-arch [arch] QEMU emulator target arch
--target-type [type] QEMU emulator target type ('system' or 'user') --target-type [type] QEMU emulator target type ('system' or 'user')
--probe-prefix [prefix] Prefix for dtrace probe names
(default: qemu-\$targettype-\$targetarch)
EOF EOF
exit 1 exit 1
...@@ -472,7 +474,7 @@ linetostap_dtrace() ...@@ -472,7 +474,7 @@ linetostap_dtrace()
# Define prototype for probe arguments # Define prototype for probe arguments
cat <<EOF cat <<EOF
probe qemu.$targettype.$targetarch.$name = process("$binary").mark("$name") probe $probeprefix.$name = process("$binary").mark("$name")
{ {
EOF EOF
...@@ -574,14 +576,17 @@ tracetostap() ...@@ -574,14 +576,17 @@ tracetostap()
echo "--binary is required for SystemTAP tapset generator" echo "--binary is required for SystemTAP tapset generator"
exit 1 exit 1
fi fi
if [ -z "$targettype" ]; then if [ -z "$probeprefix" -a -z "$targettype" ]; then
echo "--target-type is required for SystemTAP tapset generator" echo "--target-type is required for SystemTAP tapset generator"
exit 1 exit 1
fi fi
if [ -z "$targetarch" ]; then if [ -z "$probeprefix" -a -z "$targetarch" ]; then
echo "--target-arch is required for SystemTAP tapset generator" echo "--target-arch is required for SystemTAP tapset generator"
exit 1 exit 1
fi fi
if [ -z "$probeprefix" ]; then
probeprefix="qemu.$targettype.$targetarch";
fi
echo "/* This file is autogenerated by tracetool, do not edit. */" echo "/* This file is autogenerated by tracetool, do not edit. */"
convert stap convert stap
} }
...@@ -592,6 +597,7 @@ output= ...@@ -592,6 +597,7 @@ output=
binary= binary=
targettype= targettype=
targetarch= targetarch=
probeprefix=
until [ -z "$1" ] until [ -z "$1" ]
...@@ -602,6 +608,7 @@ do ...@@ -602,6 +608,7 @@ do
"--binary") shift ; binary="$1" ;; "--binary") shift ; binary="$1" ;;
"--target-arch") shift ; targetarch="$1" ;; "--target-arch") shift ; targetarch="$1" ;;
"--target-type") shift ; targettype="$1" ;; "--target-type") shift ; targettype="$1" ;;
"--probe-prefix") shift ; probeprefix="$1" ;;
"-h" | "-c" | "-d") output="${1#-}" ;; "-h" | "-c" | "-d") output="${1#-}" ;;
"--stap") output="${1#--}" ;; "--stap") output="${1#--}" ;;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册