All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: George Dunlap <george.dunlap@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [PATCH 2/3] trace: allow HVMOP_xentrace to set trace record subclass
Date: Thu, 15 Aug 2013 15:18:42 +0100	[thread overview]
Message-ID: <520CE342.20207@eu.citrix.com> (raw)
In-Reply-To: <1374758582-29038-3-git-send-email-david.vrabel@citrix.com>

On 25/07/13 14:23, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
>
> Allow guests adding trace records with HVMOP_xentrace to set the
> sub-class.  This allows different guest generated traces to be
> filtered by xentrace.
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
>   xen/arch/x86/hvm/hvm.c     |    4 ++--
>   xen/include/public/trace.h |    3 +++
>   2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index e2701b6..b0d8094 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -4388,10 +4388,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
>               return -EFAULT;
>   
>           if ( tr.extra_bytes > sizeof(tr.extra)
> -             || (tr.event & ~((1u<<TRC_SUBCLS_SHIFT)-1)) )
> +             || (tr.event & ~((1u<<TRC_CLS_SHIFT)-1)) )
>               return -EINVAL;
>   
> -        trace_var(tr.event | TRC_GUEST, 1 /*cycles*/,
> +        trace_var(TRC_GUEST_EVENT(tr.event), 1 /*cycles*/,
>                     tr.extra_bytes, tr.extra);
>           break;
>       }
> diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h
> index e2f60a6..bbbd38b 100644
> --- a/xen/include/public/trace.h
> +++ b/xen/include/public/trace.h
> @@ -244,6 +244,9 @@
>   #define TRC_HW_IRQ_UNMAPPED_VECTOR    (TRC_HW_IRQ + 0x7)
>   #define TRC_HW_IRQ_HANDLED            (TRC_HW_IRQ + 0x8)
>   
> +/* Guest event with guest-specified sub-class and number. */
> +#define TRC_GUEST_EVENT(e) (0x08000000 | (e & 0xffff))

Minor nit -- should this be ((1u<<TRC_CLS_SHIFT)-1)?

Alternately, would it make sense to add the following, and use it both 
places in this patch?

#define TRC_CLS_MASK ((1u<<TRC_CLS_SHIFT)-1)

  -George

  reply	other threads:[~2013-08-15 14:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 13:22 [PATCH 0/3] xen: guest tracing improvements David Vrabel
2013-07-25 13:23 ` [PATCH 1/3] trace: include timestamp in trace records added by HVMOP_xentrace David Vrabel
2013-08-15 14:15   ` George Dunlap
2013-07-25 13:23 ` [PATCH 2/3] trace: allow HVMOP_xentrace to set trace record subclass David Vrabel
2013-08-15 14:18   ` George Dunlap [this message]
2013-07-25 13:23 ` [PATCH 3/3] libxc: add xc_tbuf_trace() to insert trace records David Vrabel
2013-07-25 13:39   ` David Vrabel
2013-08-15 14:37   ` George Dunlap
2013-08-15 14:39     ` David Vrabel
2013-08-15 14:48       ` George Dunlap
2013-08-06 14:43 ` [PATCH 0/3] xen: guest tracing improvements David Vrabel
2013-08-06 14:46   ` George Dunlap

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=520CE342.20207@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=george.dunlap@citrix.com \
    --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.