From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH 2/3] trace: allow HVMOP_xentrace to set trace record subclass Date: Thu, 15 Aug 2013 15:18:42 +0100 Message-ID: <520CE342.20207@eu.citrix.com> References: <1374758582-29038-1-git-send-email-david.vrabel@citrix.com> <1374758582-29038-3-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1374758582-29038-3-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: George Dunlap , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 25/07/13 14:23, David Vrabel wrote: > From: David Vrabel > > 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 > --- > 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< + || (tr.event & ~((1u< 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<