From 5d0707278390cfe8a8420dffcbb80e0078ac4f48 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Thu, 9 Apr 2015 15:17:19 -0600 Subject: [PATCH] strace_tailor: make more generic, cleanup --- tools/strace_tailor.sh | 16 ++++++++++++++++ tools/xilinx_strace_tailor.sh | 14 -------------- 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100755 tools/strace_tailor.sh delete mode 100755 tools/xilinx_strace_tailor.sh diff --git a/tools/strace_tailor.sh b/tools/strace_tailor.sh new file mode 100755 index 000000000..859880f91 --- /dev/null +++ b/tools/strace_tailor.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Copyright Robert Jordens 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 . diff --git a/tools/xilinx_strace_tailor.sh b/tools/xilinx_strace_tailor.sh deleted file mode 100755 index 57bb74c48..000000000 --- a/tools/xilinx_strace_tailor.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# Copyright Robert Jordens 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 .