git: vkernel: Fix compilation with profiling support.

Antonio Huete Jimenez ahuete.devel at gmail.com
Thu May 17 07:27:30 PDT 2012


--20cf30334f3363d92b04c03c3c66
Content-Type: text/plain; charset=ISO-8859-1

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 <swildner at crater.dragonflybsd.org>

>
> commit b96eeefdbef8ad746365c234181372389428cc11
> Author: Sascha Wildner <saw at online.de>
> 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
>

--20cf30334f3363d92b04c03c3c66
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Please note that SMP vkernels will simply freeze on startup when profiling =
is enabled.<br>In our tests it only has worked with UP vkernels.<br><br>We&=
#39;re also not entirely sure that the numbers produced during execution (i=
n the .gmon file) are right, this is still under discussion.<br>
<br><div class=3D"gmail_quote">2012/5/17 Sascha Wildner <span dir=3D"ltr">&=
lt;<a href=3D"mailto:swildner at crater.dragonflybsd.org" target=3D"_blank">sw=
ildner at crater.dragonflybsd.org</a>></span><br><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex">
<br>
commit b96eeefdbef8ad746365c234181372389428cc11<br>
Author: Sascha Wildner <<a href=3D"mailto:saw at online.de">saw at online.de</=
a>><br>
Date: =A0 Thu May 17 16:17:22 2012 +0200<br>
<br>
 =A0 =A0vkernel: Fix compilation with profiling support.<br>
<br>
 =A0 =A0The vkernel is a special userland program in the regard that its Ma=
kefile<br>
 =A0 =A0is generated by config(8), which is kind of tailored to the real ke=
rnel.<br>
<br>
 =A0 =A0So first of all, we have to modify config(8) to detect it's a v=
kernel we<br>
 =A0 =A0want to build and in this case it should not define GPROF which oth=
erwise<br>
 =A0 =A0activates the real kernel's profiling bits.<br>
<br>
 =A0 =A0Then, modify libkern's mcount.c to skip kernel specific parts t=
oo.<br>
<br>
 =A0 =A0Then, modify the vkernels' Makefiles to take into account ${PRO=
F} (and<br>
 =A0 =A0while we're here, ${DEBUG} too) which are set by the surroundin=
g Makefile<br>
 =A0 =A0which is generated by config(8).<br>
<br>
 =A0 =A0The vkernel is now (from profiling point of view) treated like any =
other<br>
 =A0 =A0userland program.<br>
<br>
 =A0 =A0Last but not least, add some documentation about building a vkernel=
 with<br>
 =A0 =A0profiling support to vkernel's manpage.<br>
<br>
 =A0 =A0To build with profiling, simply add CONFIGARGS=3D-p to the buildker=
nel<br>
 =A0 =A0command line. It will need the config(8) program to be in /usr/obj&=
#39;s<br>
 =A0 =A0btools dir, so either a buildworld with this commit needs to be don=
e,<br>
 =A0 =A0or config can be installed manually to /usr/sbin and nativekernel c=
an<br>
 =A0 =A0be used.<br>
<br>
 =A0 =A0Tested-by: tuxillo<br>
<br>
Summary of changes:<br>
=A0share/man/man7/vkernel.7 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 14 +++++++++++++-=
<br>
=A0sys/libkern/mcount.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 15 +++++++---=
-----<br>
=A0sys/platform/vkernel/conf/Makefile =A0 | =A0 =A05 ++---<br>
=A0sys/platform/vkernel64/conf/Makefile | =A0 =A05 ++---<br>
=A0usr.sbin/config/mkmakefile.c =A0 =A0 =A0 =A0 | =A0 =A07 +++++--<br>
=A05 files changed, 29 insertions(+), 17 deletions(-)<br>
<br>
<a href=3D"http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b96eeefd=
bef8ad746365c234181372389428cc11" target=3D"_blank">http://gitweb.dragonfly=
bsd.org/dragonfly.git/commitdiff/b96eeefdbef8ad746365c234181372389428cc11</=
a><br>

<span class=3D"HOEnZb"><font color=3D"#888888"><br>
<br>
--<br>
DragonFly BSD source repository<br>
</font></span></blockquote></div><br>

--20cf30334f3363d92b04c03c3c66--





More information about the Commits mailing list