+--- linux-2.6.22-590/arch/i386/kernel/entry.S 2009-03-16 20:49:07.000000000 -0400
++++ linux-2.6.22-591/arch/i386/kernel/entry.S 2009-03-16 20:58:59.000000000 -0400
+@@ -374,6 +374,33 @@
+ cmpl $(nr_syscalls), %eax
+ jae syscall_badsys
+ syscall_call:
++ /* Move Chopstix syscall probe here */
++ /* Save and clobber: eax, ecx, ebp */
++ pushl %eax
++ pushl %ecx
++ pushl %ebp
++ movl %esp, %ebp
++ subl $SPEC_EVENT_SIZE, %esp
++ movl rec_event, %ecx
++ testl %ecx, %ecx
++ jz carry_on
++ # struct event is first, just below %ebp
++ movl %eax, (SPEC_number-EVENT_SIZE)(%ebp)
++ leal -SPEC_EVENT_SIZE(%ebp), %eax
++ movl %eax, EVENT_event_data(%ebp)
++ movl $6, EVENT_event_type(%ebp)
++ movl rec_event, %edx
++ movl $1, 4(%esp)
++ leal -EVENT_SIZE(%ebp), %eax
++ movl %eax, (%esp)
++ call rec_event_asm
++carry_on:
++ addl $SPEC_EVENT_SIZE, %esp
++ popl %ebp
++ popl %ecx
++ popl %eax
++ /* End chopstix */
++
+ call *sys_call_table(,%eax,4)
+ movl %eax,PT_EAX(%esp) # store the return value
+ syscall_exit: