Please note that SMP vkernels will simply freeze on startup when profiling
is enabled.
In our tests it only has worked with UP vkernels.

We're also not entirely sure that the numbers produced during execution (in
the .gmon file) are right, this is still under discussion.

2012/5/17 Sascha Wildner <[email protected]>

>
> commit b96eeefdbef8ad746365c234181372389428cc11
> Author: Sascha Wildner <[email protected]>
> Date:   Thu May 17 16:17:22 2012 +0200
>
>    vkernel: Fix compilation with profiling support.
>
>    The vkernel is a special userland program in the regard that its
> Makefile
>    is generated by config(8), which is kind of tailored to the real kernel.
>
>    So first of all, we have to modify config(8) to detect it's a vkernel we
>    want to build and in this case it should not define GPROF which
> otherwise
>    activates the real kernel's profiling bits.
>
>    Then, modify libkern's mcount.c to skip kernel specific parts too.
>
>    Then, modify the vkernels' Makefiles to take into account ${PROF} (and
>    while we're here, ${DEBUG} too) which are set by the surrounding
> Makefile
>    which is generated by config(8).
>
>    The vkernel is now (from profiling point of view) treated like any other
>    userland program.
>
>    Last but not least, add some documentation about building a vkernel with
>    profiling support to vkernel's manpage.
>
>    To build with profiling, simply add CONFIGARGS=-p to the buildkernel
>    command line. It will need the config(8) program to be in /usr/obj's
>    btools dir, so either a buildworld with this commit needs to be done,
>    or config can be installed manually to /usr/sbin and nativekernel can
>    be used.
>
>    Tested-by: tuxillo
>
> Summary of changes:
>  share/man/man7/vkernel.7             |   14 +++++++++++++-
>  sys/libkern/mcount.c                 |   15 +++++++--------
>  sys/platform/vkernel/conf/Makefile   |    5 ++---
>  sys/platform/vkernel64/conf/Makefile |    5 ++---
>  usr.sbin/config/mkmakefile.c         |    7 +++++--
>  5 files changed, 29 insertions(+), 17 deletions(-)
>
>
> http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b96eeefdbef8ad746365c234181372389428cc11
>
>
> --
> DragonFly BSD source repository
>

Reply via email to