From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2897 invoked by alias); 12 Sep 2008 21:35:19 -0000 Received: (qmail 2888 invoked by uid 22791); 12 Sep 2008 21:35:18 -0000 X-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_20,J_CHICKENPOX_21,J_CHICKENPOX_61,J_CHICKENPOX_62,J_CHICKENPOX_72,KAM_MX,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Sep 2008 21:34:41 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m8CLYc4J013465; Fri, 12 Sep 2008 17:34:38 -0400 Received: from mail.boston.redhat.com (mail.boston.redhat.com [10.16.255.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m8CLYZbt006555; Fri, 12 Sep 2008 17:34:35 -0400 Received: from [10.16.3.219] (dhcp-100-3-219.bos.redhat.com [10.16.3.219]) by mail.boston.redhat.com (8.13.1/8.13.1) with ESMTP id m8CLYYPL009564; Fri, 12 Sep 2008 17:34:34 -0400 Message-ID: <48CAE004.3090703@redhat.com> Date: Fri, 12 Sep 2008 21:35:00 -0000 From: Masami Hiramatsu User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Mathieu Desnoyers CC: Pierre-Marc Fournier , ltt-dev@lists.casi.polymtl.ca, Hideo AOKI , Takahiro Yasui , systemtap-ml Subject: Re: [ltt-dev] [LTTng][RFC][Patch 2/2] add irq-id parameter to irq_exit tracepoint and marker References: <48B4220A.4020505@redhat.com> <48B430AF.8080208@polymtl.ca> <48B44DEB.90504@redhat.com> <20080910223540.GE23197@Krystal> <48CA9C00.8020606@redhat.com> <20080912173753.GA27996@Krystal> In-Reply-To: <20080912173753.GA27996@Krystal> X-Enigmail-Version: 0.95.7 Content-Type: multipart/mixed; boundary="------------040700010906070308050400" X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00646.txt.bz2 This is a multi-part message in MIME format. --------------040700010906070308050400 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 2583 Mathieu Desnoyers wrote: > * Masami Hiramatsu (mhiramat@redhat.com) wrote: >> Hi Mathieu, >> >> Mathieu Desnoyers wrote: >>>> And when we use these markers not from LTTng (ex. systemtap), >>>> it could be handled as isolated events. For example, I can check which >>>> irq handler returns error by tracing ONLY irq_exit events, with this patch. >>>> >>> Hrm, this is precisely why I created the tracepoints. I would be all in >>> to add a struct pt_regs parameter and a irq id parameter to the irq exit >>> _tracepoint_ (since this is a kernel internal API), but I am very >>> reluctant to add it to the marker, given it will add useless information >>> in the traces. >> Indeed. What we really need is additional parameters for tracepoints, not >> markers, because markers can't get parameters which are not passed from >> tracepoints. ;-) >> LTTng's conversion module can filter those parameters for LTTng >> or some other tracers which use LTTng markers. >> >>> I propose that systemtap move to tracepoints instead of markers, given >>> that they run in kernel-space anyway. It'a really a plus to have correct >>> typing of pointers, structures, etc. >> The difficulty of using tracepoints directly is parsing native C >> code to get parameters. If each tracer can have its conversion module, >> I think we don't need to do so. >> >>>>> Here we need to compromise between the trace size and the amount of work >>>>> needed to analyze the trace. kernel_irq_exit is a very high rate event >>>>> and the work needed to keep track of the state is small. Therefore I >>>>> doubt including the redundant information is the best choice. >>>> Indeed, could LTTng ignores(or filters) the parameter? >>>> >>> LTTng just parses the format string and dumps them to userspace. Since I >>> developed the tracepoints, I see more and more the markers as being a >>> "binary formatting" infrastructure more closely tied to LTTng. But >>> tracepoints are taking over, so there is no features removed, just added >>> flexibility for in-kernel tracers. >> BTW, if so, I think we can make various versions of tracepoint-marker >> conversion modules for LTTng and other in-kernel tracers. >> >> Thank you, >> > > Yep, I agree. Could you rearrange your patch against LTTng > instrumentation to only add the irq exit tracepoint parameter you need ? > I would be glad to merge that, Of cause, I can :-) here I removed modification of markers. Thank you so much, -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America) Inc. Software Solutions Division e-mail: mhiramat@redhat.com --------------040700010906070308050400 Content-Type: text/plain; name="lttng-irq-tracepoint-modify.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lttng-irq-tracepoint-modify.patch" Content-length: 6218 Add irq id parameter to irq_exit tracepoint and marker irq_id parameter is useful for paring irq enter and exit events. Signed-off-by: Masami Hiramatsu Signed-off-by: Hideo Aoki --- arch/x86/kernel/apic_32.c | 6 +++--- arch/x86/kernel/apic_64.c | 6 +++--- arch/x86/kernel/cpu/mcheck/mce_intel_64.c | 2 +- arch/x86/kernel/cpu/mcheck/p4.c | 2 +- arch/x86/kernel/tlb_32.c | 2 +- arch/x86/kernel/tlb_64.c | 2 +- include/trace/irq.h | 4 ++-- kernel/irq/handle.c | 2 +- kernel/kernel-trace.c | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) Index: linux-2.6-lttng/include/trace/irq.h =================================================================== --- linux-2.6-lttng.orig/include/trace/irq.h 2008-09-12 15:00:04.000000000 -0400 +++ linux-2.6-lttng/include/trace/irq.h 2008-09-12 15:07:59.000000000 -0400 @@ -9,8 +9,8 @@ TPPROTO(unsigned int id, struct pt_regs *regs), TPARGS(id, regs)); DEFINE_TRACE(irq_exit, - TPPROTO(irqreturn_t retval), - TPARGS(retval)); + TPPROTO(unsigned int id, irqreturn_t retval), + TPARGS(id, retval)); DEFINE_TRACE(irq_softirq_entry, TPPROTO(struct softirq_action *h, struct softirq_action *softirq_vec), TPARGS(h, softirq_vec)); Index: linux-2.6-lttng/kernel/irq/handle.c =================================================================== --- linux-2.6-lttng.orig/kernel/irq/handle.c 2008-09-12 15:00:04.000000000 -0400 +++ linux-2.6-lttng/kernel/irq/handle.c 2008-09-12 15:07:59.000000000 -0400 @@ -153,7 +153,7 @@ add_interrupt_randomness(irq); local_irq_disable(); - trace_irq_exit(retval); + trace_irq_exit(irq, retval); return retval; } Index: linux-2.6-lttng/kernel/kernel-trace.c =================================================================== --- linux-2.6-lttng.orig/kernel/kernel-trace.c 2008-09-12 15:00:04.000000000 -0400 +++ linux-2.6-lttng/kernel/kernel-trace.c 2008-09-12 15:08:47.000000000 -0400 @@ -18,7 +18,7 @@ (regs)?instruction_pointer(regs):0UL); } -static void probe_irq_exit(irqreturn_t retval) +static void probe_irq_exit(unsigned int id, irqreturn_t retval) { trace_mark(kernel_irq_exit, "handled #1u%u", IRQ_RETVAL(retval)); } Index: linux-2.6-lttng/arch/x86/kernel/apic_32.c =================================================================== --- linux-2.6-lttng.orig/arch/x86/kernel/apic_32.c 2008-09-12 15:00:00.000000000 -0400 +++ linux-2.6-lttng/arch/x86/kernel/apic_32.c 2008-09-12 15:07:59.000000000 -0400 @@ -638,7 +638,7 @@ local_apic_timer_interrupt(); - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(LOCAL_TIMER_VECTOR, IRQ_HANDLED); irq_exit(); @@ -1301,7 +1301,7 @@ "should never happen.\n", smp_processor_id()); __get_cpu_var(irq_stat).irq_spurious_count++; - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(SPURIOUS_APIC_VECTOR, IRQ_HANDLED); irq_exit(); } @@ -1337,7 +1337,7 @@ printk(KERN_DEBUG "APIC error on CPU%d: %02lx(%02lx)\n", smp_processor_id(), v , v1); - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(ERROR_APIC_VECTOR, IRQ_HANDLED); irq_exit(); } Index: linux-2.6-lttng/arch/x86/kernel/apic_64.c =================================================================== --- linux-2.6-lttng.orig/arch/x86/kernel/apic_64.c 2008-09-12 15:00:00.000000000 -0400 +++ linux-2.6-lttng/arch/x86/kernel/apic_64.c 2008-09-12 15:07:59.000000000 -0400 @@ -492,7 +492,7 @@ irq_enter(); trace_irq_entry(LOCAL_TIMER_VECTOR, regs); local_apic_timer_interrupt(); - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(LOCAL_TIMER_VECTOR, IRQ_HANDLED); irq_exit(); set_irq_regs(old_regs); } @@ -976,7 +976,7 @@ add_pda(irq_spurious_count, 1); - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(SPURIOUS_APIC_VECTOR, IRQ_HANDLED); irq_exit(); } @@ -1013,7 +1013,7 @@ printk(KERN_DEBUG "APIC error on CPU%d: %02x(%02x)\n", smp_processor_id(), v , v1); - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(ERROR_APIC_VECTOR, IRQ_HANDLED); irq_exit(); } Index: linux-2.6-lttng/arch/x86/kernel/cpu/mcheck/mce_intel_64.c =================================================================== --- linux-2.6-lttng.orig/arch/x86/kernel/cpu/mcheck/mce_intel_64.c 2008-09-12 15:00:00.000000000 -0400 +++ linux-2.6-lttng/arch/x86/kernel/cpu/mcheck/mce_intel_64.c 2008-09-12 15:07:59.000000000 -0400 @@ -31,7 +31,7 @@ add_pda(irq_thermal_count, 1); - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(THERMAL_APIC_VECTOR, IRQ_HANDLED); irq_exit(); } Index: linux-2.6-lttng/arch/x86/kernel/cpu/mcheck/p4.c =================================================================== --- linux-2.6-lttng.orig/arch/x86/kernel/cpu/mcheck/p4.c 2008-09-12 15:00:00.000000000 -0400 +++ linux-2.6-lttng/arch/x86/kernel/cpu/mcheck/p4.c 2008-09-12 15:07:59.000000000 -0400 @@ -67,7 +67,7 @@ vendor_thermal_interrupt(regs); __get_cpu_var(irq_stat).irq_thermal_count++; - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(THERMAL_APIC_VECTOR, IRQ_HANDLED); irq_exit(); } Index: linux-2.6-lttng/arch/x86/kernel/tlb_32.c =================================================================== --- linux-2.6-lttng.orig/arch/x86/kernel/tlb_32.c 2008-09-12 15:00:00.000000000 -0400 +++ linux-2.6-lttng/arch/x86/kernel/tlb_32.c 2008-09-12 15:07:59.000000000 -0400 @@ -124,7 +124,7 @@ out: put_cpu_no_resched(); __get_cpu_var(irq_stat).irq_tlb_count++; - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(INVALIDATE_TLB_VECTOR, IRQ_HANDLED); } void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, Index: linux-2.6-lttng/arch/x86/kernel/tlb_64.c =================================================================== --- linux-2.6-lttng.orig/arch/x86/kernel/tlb_64.c 2008-09-12 15:00:00.000000000 -0400 +++ linux-2.6-lttng/arch/x86/kernel/tlb_64.c 2008-09-12 15:07:59.000000000 -0400 @@ -159,7 +159,7 @@ ack_APIC_irq(); cpu_clear(cpu, f->flush_cpumask); add_pda(irq_tlb_count, 1); - trace_irq_exit(IRQ_HANDLED); + trace_irq_exit(sender, IRQ_HANDLED); } void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, --------------040700010906070308050400--