From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] add trace points in irqchip code Date: Tue, 7 Jul 2009 15:44:42 +0300 Message-ID: <20090707124442.GH28046@redhat.com> References: <20090706131723.GA28046@redhat.com> <4A531E08.9010302@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:42432 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755436AbZGGMok (ORCPT ); Tue, 7 Jul 2009 08:44:40 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n67CiieQ014892 for ; Tue, 7 Jul 2009 08:44:44 -0400 Content-Disposition: inline In-Reply-To: <4A531E08.9010302@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 07, 2009 at 01:06:00PM +0300, Avi Kivity wrote: > On 07/06/2009 04:17 PM, Gleb Natapov wrote: >> Add tracepoint in msi/ioapic/pic set_irq() functions, >> in IPI sending and in the point where IRQ is placed into >> apic's IRR. >> >> Signed-off-by: Gleb Natapov >> diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c >> index 1d1bb75..e4bcbdd 100644 >> --- a/arch/x86/kvm/i8259.c >> +++ b/arch/x86/kvm/i8259.c >> @@ -30,6 +30,7 @@ >> #include "irq.h" >> >> #include >> +#include "trace.h" >> >> static void pic_lock(struct kvm_pic *s) >> __acquires(&s->lock) >> @@ -190,6 +191,8 @@ int kvm_pic_set_irq(void *opaque, int irq, int level) >> if (irq>= 0&& irq< PIC_NUM_PINS) { >> ret = pic_set_irq1(&s->pics[irq>> 3], irq& 7, level); >> pic_update_irq(s); >> + trace_kvm_pic_set_irq(irq>> 3, irq& 7, s->pics[irq>> 3].elcr, >> + s->pics[irq>> 3].imr, ret == 0); >> > > It's better to send undecoded arguments (irq, s, ret) and do the > shifting/masking/derefing in the TP_fast_assign. This is because > argument preparation is always compiled inline and executed (so I > understand; not sure) but TP_fast_assign is out-of-line and only > executed if the tracepoint is enabled. This will move knowledge how gsi is mapped to pic chips into tracing code. This will break if we will add emulation to some fantastic HW with number of pics different from 2. -- Gleb.