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

Re: [Xen-devel] [PATCH 2/3] xen/trace: Implement TRACE_?D() in a more efficient fashon


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Thu, 18 Jul 2019 20:59:53 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=George.Dunlap@xxxxxxxxxx; spf=Pass smtp.mailfrom=George.Dunlap@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Jul 2019 21:00:03 +0000
  • Ironport-sdr: qlNNg73tKdU27V4v0oL4JU5VzihFKJGdYTHjX3TbSxiV5V7J5UWcKUgrf3rAwm0FoD/ygpWBB8 X6ozqQ9u//uvypvGtghUc9SwqrHhDJY4Pzbn/0u8oXVICPTam/YqMyJDjJqc0RJkh8VwqjqT5T rx7LXT6aNRjM3YK7TvuKhHBUIn40JdFP7Ld+8II5IsHMNjP76fGAjSlb386TW5spC5GdVPuIeV aETacxeKhZgyZy39nD+yUXXGZ6ie5pOkodVxNL1QY/QzEJ0spc5VGWCftKEapqrgcpDl7tr4DP ylw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPYtDulAwNLH6ekatUVqF9rkM96bQuuCA
  • Thread-topic: [PATCH 2/3] xen/trace: Implement TRACE_?D() in a more efficient fashon


> On Jul 18, 2019, at 6:07 PM, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> These can easily be expressed with a variadic macro. No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Interestingly, this results in fractionally different (but equally correct)
> code generation in vlapic_update_timer().  Everywhere else is identical.
> ---
> xen/include/xen/trace.h | 99 +++++++++++++------------------------------------
> 1 file changed, 26 insertions(+), 73 deletions(-)
> 
> diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h
> index e6a4ef93cc..7f5a904103 100644
> --- a/xen/include/xen/trace.h
> +++ b/xen/include/xen/trace.h
> @@ -81,80 +81,33 @@ static inline void __trace_hypercall(uint32_t event, 
> unsigned long op,
>     do {                                        \
>         trace_var(_e, 1, 0, NULL);              \
>     } while ( 0 )
> -  
> -#define TRACE_1D(_e,d1)                                         \
> -    do {                                                        \
> -        if ( unlikely(tb_init_done) )                           \
> -        {                                                       \
> -            u32 _d[1];                                          \
> -            _d[0] = d1;                                         \
> -            __trace_var(_e, 1, sizeof(_d), _d);                 \
> -        }                                                       \
> -    } while ( 0 )
> - 
> -#define TRACE_2D(_e,d1,d2)                                      \
> -    do {                                                        \
> -        if ( unlikely(tb_init_done) )                           \
> -        {                                                       \
> -            u32 _d[2];                                          \
> -            _d[0] = d1;                                         \
> -            _d[1] = d2;                                         \
> -            __trace_var(_e, 1, sizeof(_d), _d);                 \
> -        }                                                       \
> -    } while ( 0 )
> - 
> -#define TRACE_3D(_e,d1,d2,d3)                                   \
> -    do {                                                        \
> -        if ( unlikely(tb_init_done) )                           \
> -        {                                                       \
> -            u32 _d[3];                                          \
> -            _d[0] = d1;                                         \
> -            _d[1] = d2;                                         \
> -            _d[2] = d3;                                         \
> -            __trace_var(_e, 1, sizeof(_d), _d);                 \
> -        }                                                       \
> -    } while ( 0 )
> - 
> -#define TRACE_4D(_e,d1,d2,d3,d4)                                \
> -    do {                                                        \
> -        if ( unlikely(tb_init_done) )                           \
> -        {                                                       \
> -            u32 _d[4];                                          \
> -            _d[0] = d1;                                         \
> -            _d[1] = d2;                                         \
> -            _d[2] = d3;                                         \
> -            _d[3] = d4;                                         \
> -            __trace_var(_e, 1, sizeof(_d), _d);                 \
> -        }                                                       \
> -    } while ( 0 )
> - 
> -#define TRACE_5D(_e,d1,d2,d3,d4,d5)                             \
> -    do {                                                        \
> -        if ( unlikely(tb_init_done) )                           \
> -        {                                                       \
> -            u32 _d[5];                                          \
> -            _d[0] = d1;                                         \
> -            _d[1] = d2;                                         \
> -            _d[2] = d3;                                         \
> -            _d[3] = d4;                                         \
> -            _d[4] = d5;                                         \
> -            __trace_var(_e, 1, sizeof(_d), _d);                 \
> -        }                                                       \
> -    } while ( 0 )
> 
> -#define TRACE_6D(_e,d1,d2,d3,d4,d5,d6)                             \
> -    do {                                                        \
> -        if ( unlikely(tb_init_done) )                           \
> -        {                                                       \
> -            u32 _d[6];                                          \
> -            _d[0] = d1;                                         \
> -            _d[1] = d2;                                         \
> -            _d[2] = d3;                                         \
> -            _d[3] = d4;                                         \
> -            _d[4] = d5;                                         \
> -            _d[5] = d6;                                         \
> -            __trace_var(_e, 1, sizeof(_d), _d);                 \
> -        }                                                       \
> +/* Common helper for TRACE_{1..6}D() below. */
> +#define TRACE_varD(_e, ...)                             \
> +    do {                                                \
> +        if ( unlikely(tb_init_done) )                   \
> +        {                                               \
> +            uint32_t _d[] = { __VA_ARGS__ };            \

Just to check — this will clip any larger values to uint32_t?

If so:

Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.