diff options
author | Simon Rettberg | 2014-02-07 18:20:21 +0100 |
---|---|---|
committer | Simon Rettberg | 2014-02-07 18:20:21 +0100 |
commit | 8224a72b79987b39f4b632234d81084d80d98a20 (patch) | |
tree | 98eb43a27538d3bcbab2c97b26d7483f09c4949d /remote | |
parent | [50-mltk-blacklist]: Commentary to blacklisted modules (diff) | |
download | tm-scripts-8224a72b79987b39f4b632234d81084d80d98a20.tar.gz tm-scripts-8224a72b79987b39f4b632234d81084d80d98a20.tar.xz tm-scripts-8224a72b79987b39f4b632234d81084d80d98a20.zip |
[rfs-stage31] Some benchmarking/profiling features
Diffstat (limited to 'remote')
-rw-r--r-- | remote/rootfs/rootfs-stage31/data/inc/functions | 8 | ||||
-rwxr-xr-x | remote/rootfs/rootfs-stage31/data/inc/setup_stage32 | 10 | ||||
-rwxr-xr-x | remote/rootfs/rootfs-stage31/data/init | 10 |
3 files changed, 25 insertions, 3 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/inc/functions b/remote/rootfs/rootfs-stage31/data/inc/functions index ce510aac..161533ef 100644 --- a/remote/rootfs/rootfs-stage31/data/inc/functions +++ b/remote/rootfs/rootfs-stage31/data/inc/functions @@ -23,7 +23,7 @@ drop_shell() { # Usage: # read_from_cmdline OPTION # -read_from_cmdline(){ +read_from_cmdline() { [ $# -ne 1 ] && echo "Error - 'read_from_cmdline' requires 1 argument, $# given." && exit 1 local OPTION="$1" @@ -89,3 +89,9 @@ download() { return 1 } +# Add benchmark event to var, including uptime as prefix +bench_event() { + bench_result="${bench_result}$(cut -f 1 -d ' ' "/proc/uptime") $@ +" +} + diff --git a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32 b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32 index ba8bad00..9bf30d25 100755 --- a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32 +++ b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32 @@ -3,7 +3,7 @@ # This script sets up the stage 3.2. # - downloads/mounts stage32.sqfs # - merge it with current rootfs through aufs -# - will not download, if the "nfs=" is used in the +# - will not download, if the "nfs=" is used in the # kernel command line # ######################################################################### @@ -56,6 +56,14 @@ if [ $SPLASH -eq 1 ]; then fi fi +# Kinda specific for virtualization environment: Autologin and run VM for benchmarks +if [ -n "$SLX_BENCHMARK_VM" ]; then + # Enable KDM autologin for demo user + sed -i 's/^AutoLoginUser=.*//;s/^AutoLoginEnable=.*/AutoLoginEnable=true\nAutoLoginUser=demo/' "${FUTURE_ROOT}/etc/kde4/kdm/kdmrc" + # Running the VM automatically has to be taken care of by run-virt and vmchooser. SLX_BENCHMARK_VM should contain + # a numeric value for the index in vmchooser +fi + # "Delete" addon hook-script in aufs view touch "/mnt/opt/openslx/uniontmp/.wh.addon-init" diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index 8789caa5..b542a715 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -19,9 +19,10 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin . "/inc/functions" # mount the important standard directories -busybox mount -n -t tmpfs -o 'mode=755' run "/run" [ ! -f /proc/cpuinfo ] && busybox mount -n -t proc proc /proc +bench_event "KERNEL" "Kernel initialized" [ ! -d /sys/class ] && busybox mount -n -t sysfs sysfs /sys +busybox mount -n -t tmpfs -o 'mode=755' run "/run" # preparations for mounting stage3.2 FUTURE_ROOT="/dev/shm/uniontmp" @@ -79,6 +80,7 @@ fi # discover devices mdev -s +bench_event "MDEV" "mdev done" # suppress kernel output if neither DEBUG nor SPLASH is set if [ $SPLASH -eq 0 ]; then @@ -88,14 +90,18 @@ fi [ $DEBUG -ge 4 ] && drop_shell "Requested Debug Shell: before network." . "/inc/setup_network" || . "/inc/setup_network_retry" || drop_shell "Error setting up network" +bench_event "NETWORK" "Network up and running" [ $DEBUG -ge 3 ] && drop_shell "Requested Debug Shell: after network/before configuring." . "/inc/activate_sysconfig" || drop_shell "Could not source /bin/activate_sysconfig" +bench_event "CONFIG" "Downloaded config" +# From here on, we have all the vars from /opt/openslx/config [ $DEBUG -ge 2 ] && drop_shell "Requested Debug Shell: after configuration/before stage32." . "/inc/setup_stage32" || drop_shell "Problem setting up stage3.2" +bench_event "STAGE32" "Downloaded stage 3.2" # copy files needed for stage3.2 to FUTURE_ROOT echo "Copying busybox etc. to stage32..." @@ -115,6 +121,8 @@ for mnt in proc sys run ; do done echo "Switching root...." +bench_event "PRESWITCH" "Switching to stage 3.2" +echo "$bench_result" > "${FUTURE_ROOT}/opt/openslx/.benchmark" # Prepare environment (HOME is needed as a hack for nss_ldap with ssl and no caching) unset BOOT_IMAGE initrd KCL ip slxbase slxsrv IPINFO vga ip MAC BOOTIF DEBUG OLDPWD export HOME=/ |