All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: tim@xen.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v3] xen: arm: enable perf counters
Date: Wed, 14 Jan 2015 15:07:18 +0000	[thread overview]
Message-ID: <54B68626.1080608@linaro.org> (raw)
In-Reply-To: <1421246000-6753-1-git-send-email-ian.campbell@citrix.com>

Hi Ian,

On 14/01/15 14:33, Ian Campbell wrote:
> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
> index 25ecf1d..604fc81 100644
> --- a/xen/arch/arm/irq.c
> +++ b/xen/arch/arm/irq.c
> @@ -179,7 +179,12 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
>  {
>      struct irq_desc *desc = irq_to_desc(irq);
>  
> -    /* TODO: perfc_incr(irqs); */
> +    perfc_incr(irqs);
> +
> +    if (irq < 32) /* SGIs do not come down this path */

if ( irq < 32 )

Maybe an ASSERT(irq >= 16) to check the validity of the comment.

[..]

> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 4c93250..68208d6 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -30,6 +30,7 @@
>  #include <xen/hypercall.h>
>  #include <xen/softirq.h>
>  #include <xen/domain_page.h>
> +#include <xen/perfc.h>
>  #include <public/sched.h>
>  #include <public/xen.h>
>  #include <asm/debugger.h>
> @@ -1240,6 +1241,7 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>      case PSCI_cpu_off:
>          {
>              uint32_t pstate = PSCI_ARG32(regs,1);
> +            perfc_incr(psci_cpu_off);
>              PSCI_RESULT_REG(regs) = do_psci_cpu_off(pstate);
>          }
>          break;
> @@ -1247,33 +1249,41 @@ static void do_trap_psci(struct cpu_user_regs *regs)
>          {
>              uint32_t vcpuid = PSCI_ARG32(regs,1);
>              register_t epoint = PSCI_ARG(regs,2);
> +            perfc_incr(psci_cpu_on);

I find confusing to use psci_cpu_on because it may refer to the host psci.

Maybe renaming to vpsci_ would be better?

[..]

> @@ -2113,6 +2146,7 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
>  
>      default:
>   bad_trap:
> +        perfc_incr(trap_bad);

I don't think this perf counters is useful. When the CPU is receiving a
bad trap Xen will panic in do_unexpected_trap.

[..]

> diff --git a/xen/include/asm-arm/perfc.h b/xen/include/asm-arm/perfc.h
> new file mode 100644
> index 0000000..a1a591e
> --- /dev/null
> +++ b/xen/include/asm-arm/perfc.h
> @@ -0,0 +1,12 @@
> +#ifndef __ASM_PERFC_H__
> +#define __ASM_PERFC_H__
> +
> +static inline void arch_perfc_reset(void)
> +{
> +}
> +
> +static inline void arch_perfc_gather(void)
> +{
> +}
> +
> +#endif

Missing the Emacs local variables.

> diff --git a/xen/include/asm-arm/perfc_defn.h b/xen/include/asm-arm/perfc_defn.h
> new file mode 100644
> index 0000000..df86879
> --- /dev/null
> +++ b/xen/include/asm-arm/perfc_defn.h
> @@ -0,0 +1,74 @@
> +/* This file is legiimately included multiple times. */

Legacy for xen/include/perfc_defn.h?

> +/*#ifndef __XEN_PERFC_DEFN_H__*/

All headers in asm-arm use __ARCH_ARM_* or __ARM_*

This would avoid the strange reason to not use guard in xen/perfc_defn.h.

[..]

> +/*#endif*/ /* __XEN_PERFC_DEFN_H__ */

Missing local variables for emacs.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-01-14 15:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 14:33 [PATCH v3] xen: arm: enable perf counters Ian Campbell
2015-01-14 15:07 ` Julien Grall [this message]
2015-01-14 15:14   ` Ian Campbell
2015-01-14 15:19     ` Julien Grall
2015-01-14 15:25       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B68626.1080608@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.