All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: adeos-main <adeos-main@gna.org>
Cc: Philippe Gerum <rpm@xenomai.org>
Subject: [Adeos-main] [PATCH] x86_64: cleanup IRQ on/off tracing
Date: Sun, 11 Nov 2007 19:50:31 +0100	[thread overview]
Message-ID: <47374EF7.4070608@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 301 bytes --]

Tracing of IRQ on/off paths on x86_64 currently suffers from heavy
over-instrumentation. This patch aligns x86_64 in this regard with i386
(and hopefully the other tracer-supporting archs too). It also gets rid
of related *_thunk indirections (I wonder if we cannot kill more of
them...).

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: cleanup-irqoff-instrumentation.patch --]
[-- Type: text/x-patch; name="cleanup-irqoff-instrumentation.patch", Size: 4525 bytes --]

---
 arch/x86_64/kernel/entry.S    |   26 ++++++++++++++++++--------
 arch/x86_64/kernel/ipipe.c    |   16 ----------------
 arch/x86_64/lib/thunk.S       |    5 -----
 include/asm-x86_64/irqflags.h |   15 ++++-----------
 4 files changed, 22 insertions(+), 40 deletions(-)

Index: linux-2.6.23.1-xeno_64/arch/x86_64/kernel/entry.S
===================================================================
--- linux-2.6.23.1-xeno_64.orig/arch/x86_64/kernel/entry.S
+++ linux-2.6.23.1-xeno_64/arch/x86_64/kernel/entry.S
@@ -542,16 +542,28 @@ END(stub_rt_sigreturn)
 	 */
 	TRACE_IRQS_OFF
 #ifdef CONFIG_IPIPE_TRACE_IRQSOFF
-        leaq RIP-8(%rdi), %rbp
-        pushq %rdi
-        movq ORIG_RAX(%rdi), %rdi
+	leaq RIP-8(%rdi), %rbp	# make interrupted address show up in trace
+	pushq %rdi
+	movq ORIG_RAX(%rdi), %rdi	# IRQ number
+	notq %rdi			# ...is inverted, fix up
+	call ipipe_trace_begin
+	popq %rdi
+	popq %rbp
+	pushq %rbp
+
+	call \func
+
+	popq %rbp
+	pushq %rbp
+	movq 8-ARGOFFSET+ORIG_RAX(%rbp), %rdi
+	leaq 8-ARGOFFSET+RIP-8(%rbp), %rbp
 	notq %rdi
-        call ipipe_trace_begin_thunk
-        popq %rdi
+	call ipipe_trace_end
 	popq %rbp
 	pushq %rbp
-#endif
+#else
 	call \func
+#endif
 	.endm
 
 #ifdef CONFIG_IPIPE
@@ -602,7 +614,6 @@ ENTRY(common_interrupt)
 	jnz ret_from_intr
 	decl %gs:pda_irqcount
 	leaveq
-	IPIPE_TRACE_IRQS_ON
 	CFI_DEF_CFA_REGISTER	rsp
 	CFI_ADJUST_CFA_OFFSET	-8
 	testl $3,CS-ARGOFFSET(%rsp)
@@ -734,7 +745,6 @@ END(common_interrupt)
 	jnz ret_from_intr
 	decl %gs:pda_irqcount
 	leaveq
-	IPIPE_TRACE_IRQS_ON
 	CFI_DEF_CFA_REGISTER	rsp
 	CFI_ADJUST_CFA_OFFSET	-8
 	testl $3,CS-ARGOFFSET(%rsp)
Index: linux-2.6.23.1-xeno_64/arch/x86_64/kernel/ipipe.c
===================================================================
--- linux-2.6.23.1-xeno_64.orig/arch/x86_64/kernel/ipipe.c
+++ linux-2.6.23.1-xeno_64/arch/x86_64/kernel/ipipe.c
@@ -760,10 +760,6 @@ finalize:
 
 finalize_nosync:
 
-#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
-	ipipe_trace_end(irq);
-#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
-
 	if (!ipipe_root_domain_p ||
 	    test_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)))
 		return 0;
@@ -771,18 +767,6 @@ finalize_nosync:
 	return 1;
 }
 
-#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
-void notrace __ipipe_trace_irqs_off(void)
-{
-	ipipe_trace_begin(0x80000000);
-}
-
-void notrace __ipipe_trace_irqs_on(void)
-{
-	ipipe_trace_end(0x80000000);
-}
-#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
-
 EXPORT_SYMBOL(__ipipe_tick_irq);
 EXPORT_SYMBOL(ipipe_critical_enter);
 EXPORT_SYMBOL(ipipe_critical_exit);
Index: linux-2.6.23.1-xeno_64/arch/x86_64/lib/thunk.S
===================================================================
--- linux-2.6.23.1-xeno_64.orig/arch/x86_64/lib/thunk.S
+++ linux-2.6.23.1-xeno_64/arch/x86_64/lib/thunk.S
@@ -56,11 +56,6 @@
 	thunk_retrax __ipipe_preempt_schedule_irq_thunk,__ipipe_preempt_schedule_irq
 #endif	
 	thunk_retrax __ipipe_syscall_root_thunk,__ipipe_syscall_root
-#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
-	thunk __ipipe_trace_irqs_on_thunk,__ipipe_trace_irqs_on
-	thunk __ipipe_trace_irqs_off_thunk,__ipipe_trace_irqs_off
-	thunk ipipe_trace_begin_thunk,ipipe_trace_begin
-#endif	
 #endif
 	
 	/* SAVE_ARGS below is used only for the .cfi directives it contains. */
Index: linux-2.6.23.1-xeno_64/include/asm-x86_64/irqflags.h
===================================================================
--- linux-2.6.23.1-xeno_64.orig/include/asm-x86_64/irqflags.h
+++ linux-2.6.23.1-xeno_64/include/asm-x86_64/irqflags.h
@@ -241,19 +241,12 @@ static inline void local_irq_enable_hw_n
 #endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
 
 #else /* __ASSEMBLY__: */
-#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
-#define IPIPE_TRACE_IRQS_ON	call __ipipe_trace_irqs_on_thunk
-#define IPIPE_TRACE_IRQS_OFF	call __ipipe_trace_irqs_off_thunk
-#else /* !CONFIG_IPIPE_TRACE_IRQSOFF */
-#define IPIPE_TRACE_IRQS_ON
-#define IPIPE_TRACE_IRQS_OFF
-#endif /* !CONFIG_IPIPE_TRACE_IRQSOFF */
 # ifdef CONFIG_TRACE_IRQFLAGS
-#  define TRACE_IRQS_ON	IPIPE_TRACE_IRQS_ON; call trace_hardirqs_on_thunk
-#  define TRACE_IRQS_OFF	IPIPE_TRACE_IRQS_OFF; call trace_hardirqs_off_thunk
+#  define TRACE_IRQS_ON		call trace_hardirqs_on_thunk
+#  define TRACE_IRQS_OFF	call trace_hardirqs_off_thunk
 # else
-#  define TRACE_IRQS_ON	IPIPE_TRACE_IRQS_ON
-#  define TRACE_IRQS_OFF	IPIPE_TRACE_IRQS_OFF
+#  define TRACE_IRQS_ON
+#  define TRACE_IRQS_OFF
 # endif
 #endif
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

             reply	other threads:[~2007-11-11 18:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11 18:50 Jan Kiszka [this message]
2007-11-19 17:42 ` [Adeos-main] [PATCH] x86_64: cleanup IRQ on/off tracing Philippe Gerum
2007-11-20  7:47   ` Jan Kiszka
2007-11-20 10:19     ` Philippe Gerum
2007-11-20 11:50       ` Jan Kiszka
2007-11-20 13:50         ` Philippe Gerum

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=47374EF7.4070608@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=rpm@xenomai.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.