You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable profiling framework in core ZFSBootMenu tools
Create /lib/profiling-lib.sh, which can be sourced by any Bash script.
Once sourced, a debug trap is installed that dumps the stack (but not
the command being executed) to a serial port, which collects the data on
the host side into a log file. After the VM exits, the performance data
is converted into a format expected by flamegraph.pl
(https://github.com/brendangregg/FlameGraph) and then both a flamegraph
and a flamechart are created.
If profiling isn't enabled, a no-op /lib/profiling-lib.sh is created.
The profiling library must always exist, and must always be sourceable.
Optimizations/performance changes include:
- setting the loglevel as from the KCL as early as possible, to preserve
all log messages > zwarn
- validating that the loglevel is an integer, otherwise defaulting to 4
- validating that zbm.timeout/timeout is an integer, otherwise
defaulting to 10
- adding re-import guards to libraries
- removing the zlog() function and doing the logging work in the
zerror/zwarn/... function instead. This means that everything but
zdebug can be as lean as possible.
- gating a couple serial zdebug calls behind a single zdebug check
- added a fast-fail to timed_prompt to return 0 if delay isn't greater
than 0. Any default values for delay/prompt are assigned after this
test.
- add a short-circuit to get_zbm_arg that uses bashre to check if the
kcl option string is present at all in the KCL. If it's not, the next
option passed to get_zbm_arg is evaluated.
- Avoid pre-computing a return value until it's actually needed
- cut i18n out of testing builds unless a graphical interface is
requested
- cut crypt-ssh and network-legacy out of testing builds unless SSH
access is requested
- cut out 'nvdimm fs-lib rootfs-block dm dmraid lunmask' from testing
builds. These can likely be cut from release builds as well.
Closes#245
0 commit comments