From 57258a2c64233a0b862ca230fbc953770dc64876 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Aug 2011 13:24:25 +0200 Subject: [PATCH] dracut: add "--profile" option for profiling --- dracut | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dracut b/dracut index 9f70b5f..cf27b23 100755 --- a/dracut +++ b/dracut @@ -61,6 +61,7 @@ Creates initial ramdisk images for preloading modules --nolvmconf Do not include local /etc/lvm/lvm.conf -h, --help This message --debug Output debug information of the build process + --profile Output profile information of the build process -L, --stdlog [0-6] Specify logging level (to standard error) 0 - suppress any messages 1 - only fatal errors @@ -222,6 +223,7 @@ while (($# > 0)); do --lvmconf) lvmconf_l="yes";; --nolvmconf) lvmconf_l="no";; --debug) debug="yes";; + --profile) profile="yes";; -v|--verbose) ((verbosity_mod_l++));; -q|--quiet) ((verbosity_mod_l--));; -l|--local) allowlocal="yes" ;; @@ -269,6 +271,12 @@ export PATH set -x } +[[ $profile ]] && { + export PS4='+ $(date "+%s.%N") ${BASH_SOURCE}@${LINENO}: '; + set -x + debug=yes +} + [[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut [[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \ -- 2.7.4