help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] [PATCH 4/4] embedded: Allow to disable the profilin


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] [PATCH 4/4] embedded: Allow to disable the profiling support in the interpreter
Date: Sat, 11 May 2013 19:10:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

Il 05/05/2013 11:26, Holger Hans Peter Freyther ha scritto:
> On ARM9 (e.g. TI Davinci DM644x) disabling the bytecode counter makes
> a significant difference on the Bench.st benchmark.
> 
> 2013-04-28  Holger Hans Peter Freyther  <address@hidden>
> 
>       * libgst/vm.def: Use INCR_LOCAL_COUNTER instead LOCAL_COUNTER++.
>       * libgst/interp-bc.inl: Add INCR_LOCAL_COUNTER and allow to disable
>       it when ENABLE_PROFILING is not defined.

Please adjust comp.c to not print the value.  Also you need to make the
rawProfile primitive fail, and signal an exception in the Smalltalk code
that calls it.

Paolo


> ---
>  configure.ac         |    9 +++++++++
>  libgst/ChangeLog     |    6 ++++++
>  libgst/interp-bc.inl |    6 ++++++
>  libgst/vm.def        |    4 ++--
>  4 files changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index e0cb5e6..77c0473 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -664,6 +664,15 @@ if test "$enable_prefetch" != no; then
>      [Define to enable usage of __builtin_prefetch])
>  fi
>  
> +AC_ARG_ENABLE(profiling,
> +[  --disable-profiling     disable profiling support], ,
> +enable_profiling=yes)
> +
> +if test "$enable_profiling" != no; then
> +  AC_DEFINE(ENABLE_PROFILING, 1,
> +    [Define to enable counting bytecodes for profiling support])
> +fi
> +
>  GST_ARG_ENABLE_MODULES([Blox,TCP])
>  
>  dnl 
> diff --git a/libgst/ChangeLog b/libgst/ChangeLog
> index f952307..ea7ef85 100644
> --- a/libgst/ChangeLog
> +++ b/libgst/ChangeLog
> @@ -1,5 +1,11 @@
>  2013-04-28  Holger Hans Peter Freyther  <address@hidden>
>  
> +     * libgst/vm.def: Use INCR_LOCAL_COUNTER instead LOCAL_COUNTER++.
> +     * libgst/interp-bc.inl: Add INCR_LOCAL_COUNTER and allow to disable
> +     it when ENABLE_PROFILING is not defined.
> +
> +2013-04-28  Holger Hans Peter Freyther  <address@hidden>
> +
>       * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
>  
>  2013-04-25  Holger Hans Peter Freyther  <address@hidden>
> diff --git a/libgst/interp-bc.inl b/libgst/interp-bc.inl
> index 8819481..edfa0c6 100644
> --- a/libgst/interp-bc.inl
> +++ b/libgst/interp-bc.inl
> @@ -463,6 +463,12 @@ _gst_interpret (OOP processOOP)
>                          LOCAL_COUNTER = 0)
>  #endif
>  
> +#ifdef ENABLE_PROFILING
> +# define INCR_LOCAL_COUNTER LOCAL_COUNTER++
> +#else
> +# define INCR_LOCAL_COUNTER
> +#endif
> +
>  /* If we have a good quantity of registers, activate more caching 
> mechanisms.  */
>  #if  REG_AVAILABILITY >= 2
>    OOP self_cache, *temp_cache, *lit_cache;
> diff --git a/libgst/vm.def b/libgst/vm.def
> index fb0b61b..0854828 100644
> --- a/libgst/vm.def
> +++ b/libgst/vm.def
> @@ -205,12 +205,12 @@
>  
>  operation PREFETCH ( -- ) {
>    PREFETCH;
> -  LOCAL_COUNTER++;
> +  INCR_LOCAL_COUNTER;
>  }
>  
>  operation ADVANCE ( -- ) {
>    ip += 2;
> -  LOCAL_COUNTER++;
> +  INCR_LOCAL_COUNTER;
>  }
>  
>  /* EXT_BYTE extends the argument of the next bytecode; it includes a
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]