IBM / ibmichroot

A set of scripts to facilitate the use of chroot-based containers for IBM i
MIT License
21 stars 9 forks source link

Add trace for time consumption #22

Open abmusse opened 9 years ago

abmusse commented 9 years ago

Original report by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


Issue 21 mentioned the idea of TRACE_MY_FUNCTION=1,0, to find time hogs. Logging this for future when someone has time to code it.

I recommend naming it TIME_TRACE=1,0.

Initial thought is to use time in front of chroot_xxxxxx calls. For example:

        case "$action" in
          ":file")
            time chroot_setup $name
             action=":file"
          ;;
          ":mkdir")
            time chroot_mkdir $name
          ;;
          ":ln_fix_rel")
            time chroot_ln_fix_rel $name
          ;;
          ":ln_rel")
            time chroot_ln_rel $name
          ;;
          ":ln")
            time chroot_ln $name
          ;;
. . .