mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
A simple built-in parameter expansion removing the matching prefix pattern (everything up to and including the last slash) is sufficient to strip the path from the basename. Speeds up "lszfcp -D" significantly. Before: $ time ~/git/s390-tools/zconf/lszfcp -D | wc -l 1028 real 0m5.322s user 0m0.300s sys 0m4.907s After: $ time ~/git/s390-tools/zconf/lszfcp -D | wc -l 1028 real 0m0.602s user 0m0.100s sys 0m0.492s Above measurements are from the fast in-memory sysfs. The improvements are likely amplified when running "lszfcp --sysfs ..." on collected debug data in a regular file system. Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Steffen Maier <maier@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>