strace_tailor: make more generic, cleanup

This commit is contained in:
Robert Jordens 2015-04-09 15:17:19 -06:00 committed by Sebastien Bourdeauducq
parent a69741b24e
commit 5d07072783
2 changed files with 16 additions and 14 deletions

16
tools/strace_tailor.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# Copyright Robert Jordens <robert@joerdens.org> 2014,2015
# assuming your xilinx toolchain lives in /opt/Xilinx,
# run `strace_tailor.sh /opt/Xilinx/ [synthesis script] [options]`,
# e.g. for the pipistrello target of misoc:
# strace_tailor.sh /opt/Xilinx/ ./make.py -t pipistrello build-bitstream
# then in your current directory, `opt/Xilinx/*` is the
# minimal toolchain required for this synthesis script run.
PREFIX=$1
shift
strace -e trace=file,process -f -o strace.log $@
sed -n 's|^.*"\('"$PREFIX"'[^"]*\)".*$|\1|p' strace.log \
| sort | uniq | xargs -d '\n' \
cp --parent --no-dereference --preserve=all -t .

View File

@ -1,14 +0,0 @@
#!/bin/sh
# Copyright Robert Jordens <robert@joerdens.org> 2014,2015
# assuming your xilinx toolchain lives in /opt/Xilinx,
# run `strace-tailor.sh [synthesis script] [options]`
# then in your current directory, `opt/Xilinx/*` is the
# minimal toolchain required for this synthesis script run.
PREFIX=\\/opt\\/Xilinx\\/
strace -e trace=file,process -f -o strace.log $@
sed -n "s/^.*\"\\(${PREFIX}[^\"]*\\)\".*$/\\1/p" strace.log \
| sort | uniq | tr '\n' '\0' \
| xargs -0 cp --parent --no-dereference --preserve=all -t .