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

Re: [Xen-devel] [PATCH 08/15] xen: trace RCU behavior



>>> On 01.06.17 at 19:34, <dario.faggioli@xxxxxxxxxx> wrote:
> --- a/xen/common/rcupdate.c
> +++ b/xen/common/rcupdate.c
> @@ -92,6 +92,57 @@ static int qhimark = 10000;
>  static int qlowmark = 100;
>  static int rsinterval = 1000;
>  
> +#ifdef CONFIG_TRACE_RCU
> +static inline void trace_call_rcu(void *func)
> +{
> +    uint64_t addr = (uint64_t)func;

I've probably overlooked something similar in patch 6 - why uint64_t
rather than unsigned long? Does this even build without warning for
ARM32?

> +    if ( likely(!tb_init_done) )
> +        return;
> +
> +    __trace_var(TRC_XEN_RCU_CALL_RCU, 0, sizeof(addr), &addr);
> +}
> +static inline void trace_start_batch(const cpumask_t *m)

Blank lines between functions please.

> +{
> +    uint32_t mask[6];
> +
> +    if ( likely(!tb_init_done) )
> +        return;
> +
> +    memset(mask, 0, sizeof(mask));

Perhaps better use {} as initializer?

> +    memcpy(mask, m, min(sizeof(mask), sizeof(cpumask_t)));

sizeof(*m)

> +#define trace_force_qstate()    TRACE_0D(TRC_XEN_RCU_FORCE_QSTATE)
> +#define trace_cpu_quiet()       TRACE_0D(TRC_XEN_RCU_CPU_QUIET)
> +#define trace_check_qstate(p)   TRACE_1D(TRC_XEN_RCU_CHECK_QSTATE, p)
> +#define trace_do_callbacks()    TRACE_0D(TRC_XEN_RCU_DO_CALLBKS)
> +#define trace_pending(p)        TRACE_1D(TRC_XEN_RCU_PENDING, p)
> +#else /* !TRACE_RCU */
> +#define trace_call_rcu(f)       do {} while ( 0 )
> +#define trace_start_batch(m)    do {} while ( 0 )
> +#define trace_do_batch(f, q)    do {} while ( 0 )
> +#define trace_force_qstate()    do {} while ( 0 )
> +#define trace_cpu_quiet()       do {} while ( 0 )
> +#define trace_check_qstate(p)   do {} while ( 0 )
> +#define trace_do_callbacks()    do {} while ( 0 )
> +#define trace_pending(p)        do {} while ( 0 )

Here and elsewhere please make sure you evaluate macro
arguments consistently (i.e. exactly once regardless of tracing
being enabled or disabled).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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