[Mesa-dev] [PATCH] configure.ac: add --enable-llvmpipe-profile

Jose Fonseca jfonseca at vmware.com
Thu Jan 7 08:41:35 PST 2016


On 07/01/16 16:27, Oded Gabbay wrote:
> To profile llvmpipe you need to define PROFILE in mesa's code. Currently,
> this define can only be generated if mesa is built using scons.
> This patch makes it possible to generate this define also when building
> mesa through automake tools.
>
> Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
> ---
>   configure.ac | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index b1c1d7d..a2485da 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -476,8 +476,23 @@ AC_ARG_ENABLE([debug],
>       [enable_debug="$enableval"],
>       [enable_debug=no]
>   )
> +
> +AC_ARG_ENABLE([llvmpipe-profile],
> +    [AS_HELP_STRING([--enable-llvmpipe-profile],
> +        [enable profiling of llvmpipe JIT code @<:@default=disabled@:>@])],
> +    [enable_llvmpipe_profile="$enableval"],
> +    [enable_llvmpipe_profile=no]
> +)
> +
> +if test "x$enable_llvmpipe_profile" = xyes; then
> +    DEFINES="$DEFINES -DPROFILE"
> +fi
> +
>   if test "x$enable_debug" = xyes; then
>       DEFINES="$DEFINES -DDEBUG"
> +    if test "x$enable_llvmpipe_profile" = xyes; then
> +        AC_MSG_WARN([Debug and Profile are enabled at the same time])
> +    fi
>       if test "x$GCC" = xyes; then
>           if ! echo "$CFLAGS" | grep -q -e '-g'; then
>               CFLAGS="$CFLAGS -g"
>

I forgot to say, that for best results, we should add 
-fno-omit-frame-pointer too.

At least on scons, the profile build is not specific to llvmpipe.  It 
just happens that llvmpipe is the only driver that needs behavior change 
on profile hence needs PROPFILE define, but the profile build is meant 
to build the code to improve profiling experience for all drivers.  On 
Windows and x86_64, for example, unless one disables the frame pointer 
ommission it's tricky to unwind the stack, particular on MinGW.

Jose


More information about the mesa-dev mailing list