summaryrefslogtreecommitdiff
path: root/tools/intel_aubdump.in
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2016-10-06 16:11:48 +0100
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2016-11-09 15:42:04 +0000
commit7f7530df3d84559d3cac33ff831fcf442a264206 (patch)
tree6be40b3bbdad2aa32c725a2b55f5366474f43448 /tools/intel_aubdump.in
parent1f43677f895a88ae880b35f9b18cc7e6869d0ca6 (diff)
aubdump: add --command option to stream aubdump to another program
This comes handy if you want to look at your application output without having to save it into a file. For example, use this with aubinator from Mesa : $ intel_aubdump -c '/path/to/aubinator --gen=hsw' my_gl_app v2: Fix handling empty command line option v3: Fix command line concatenation (again...) v4: Use execvp (Petri) Indentation (Petri) Allow recording to a file and stream to an external application (Lionel) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com>
Diffstat (limited to 'tools/intel_aubdump.in')
-rw-r--r--tools/intel_aubdump.in26
1 files changed, 25 insertions, 1 deletions
diff --git a/tools/intel_aubdump.in b/tools/intel_aubdump.in
index 18fd03b9..343dc293 100644
--- a/tools/intel_aubdump.in
+++ b/tools/intel_aubdump.in
@@ -10,6 +10,9 @@ contents and execution of the GEM application.
-o, --output=FILE Name of AUB file. Defaults to COMMAND.aub
+ -c, --command=CMD Execute CMD and write the AUB file's content to its
+ standard input
+
--device=ID Override PCI ID of the reported device
-v Enable verbose output
@@ -30,6 +33,17 @@ function add_arg() {
args="$args$arg\n"
}
+function build_command () {
+ command=""
+ for i in $1; do
+ if [ -z $command ]; then
+ command=$i
+ else
+ command="$command,$i"
+ fi;
+ done
+}
+
while true; do
case "$1" in
-o)
@@ -51,6 +65,16 @@ while true; do
add_arg "file=${file:-$(basename ${file}).aub}"
shift
;;
+ -c)
+ build_command "$2"
+ add_arg "command=$command"
+ shift 2
+ ;;
+ --command=*)
+ build_command "${1##--command=}"
+ add_arg "command=$command"
+ shift
+ ;;
--device=*)
add_arg "device=${1##--device=}"
shift
@@ -75,7 +99,7 @@ done
[ -z $1 ] && show_help
-[ -z $file ] && add_arg "file=intel.aub"
+[ -z $file ] && [ -z $command ] && add_arg "file=intel.aub"
prefix=@prefix@
exec_prefix=@exec_prefix@