mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-22 20:01:53 +01:00
target: Speed-up read_tree_values()
Since target.read_tree_values() has been modified to use tar as a way to fetch the content of files from the target, it is more robust, but also much slower. Since that level of robustness is in practice required only for very specific use-cased, re-introduce the old way of doing read_tree using find and grep. read_tree_values() gains a new parameter to specify how files should be read from the target, with or without tar. It defaults to the old way of doing things. Signed-off-by: Quentin Perret <quentin.perret@arm.com>
This commit is contained in:
committed by
Marc Bonnici
parent
413e83f5d6
commit
a6b9542f0f
@@ -255,6 +255,28 @@ sched_get_kernel_attributes() {
|
||||
# Misc
|
||||
################################################################################
|
||||
|
||||
read_tree_values() {
|
||||
BASEPATH=$1
|
||||
MAXDEPTH=$2
|
||||
|
||||
if [ ! -e $BASEPATH ]; then
|
||||
echo "ERROR: $BASEPATH does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PATHS=$($BUSYBOX find $BASEPATH -follow -maxdepth $MAXDEPTH)
|
||||
i=0
|
||||
for path in $PATHS; do
|
||||
i=$(expr $i + 1)
|
||||
if [ $i -gt 1 ]; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if [ $i -gt 1 ]; then
|
||||
$BUSYBOX grep -s '' $PATHS
|
||||
fi
|
||||
}
|
||||
|
||||
read_tree_tgz_b64() {
|
||||
BASEPATH=$1
|
||||
MAXDEPTH=$2
|
||||
@@ -353,6 +375,9 @@ ftrace_get_function_stats)
|
||||
hotplug_online_all)
|
||||
hotplug_online_all
|
||||
;;
|
||||
read_tree_values)
|
||||
read_tree_values $*
|
||||
;;
|
||||
read_tree_tgz_b64)
|
||||
read_tree_tgz_b64 $*
|
||||
;;
|
||||
|
Reference in New Issue
Block a user