Skip to contentSkip to conversation

2.6.17-rc6 perfmon2 patch for review: modified i386 files

PATCH Chuck Ebbert 2 participants 2 messages Jun 16, 2006

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

Quoted 16 lines · Stephane Eranian

This patch contains the modified i386 files

<...>

diff -ur linux-2.6.17-rc6.orig/arch/i386/kernel/apic.c linux-2.6.17-rc6/arch/i386/kernel/apic.c

arch/i386/kernel/apic.c 2006-06-08 01:49:22.000000000 -0700 renamed from arch/i386/kernel/apic.c 2006-06-08 01:42:30.000000000 -0700 +1 -0
@@ -27,6 +27,7 @@
 #include <linux/sysdev.h>
 #include <linux/cpu.h>
 #include <linux/module.h>
+#include <linux/perfmon.h>
 
 #include <asm/atomic.h>
 #include <asm/smp.h>

arch/i386/kernel/apic.c 2006-06-08 01:49:22.000000000 -0700 line 1187

Quoted 8 lines
arch/i386/kernel/apic.c 2006-06-08 01:49:22.000000000 -0700 renamed from arch/i386/kernel/apic.c 2006-06-08 01:42:30.000000000 -0700 +2 -0
@@ -1179,6 +1180,8 @@
      update_process_times(user_mode_vm(regs));
 #endif
 
+     pfm_handle_switch_timeout();
+
      /*
       * We take the 'long' return path, and there every subsystem
       * grabs the apropriate locks (kernel lock/ irq lock).

Please add '-p' to your diff options. It makes it easier to see what is happening.

Quoted 12 lines

<...>

diff -ur linux-2.6.17-rc6.orig/arch/i386/kernel/syscall_table.S linux-2.6.17-rc6/arch/i386/kernel/syscall_table.S

arch/i386/kernel/syscall_table.S 2006-06-08 01:50:27.000000000 -0700 renamed from arch/i386/kernel/syscall_table.S 2006-06-08 01:42:30.000000000 -0700 +2 -0
@@ -316,3 +316,15 @@
      .long sys_sync_file_range
      .long sys_tee                   /* 315 */
      .long sys_vmsplice
+             .long sys_pfm_create_context
+             .long sys_pfm_write_pmcs

arch/i386/kernel/syscall_table.S 2006-06-08 01:50:27.000000000 -0700 line 330

Quoted 10 lines
arch/i386/kernel/syscall_table.S 2006-06-08 01:50:27.000000000 -0700 renamed from arch/i386/kernel/syscall_table.S 2006-06-08 01:42:30.000000000 -0700 +10 -0
+             .long sys_pfm_write_pmds
+             .long sys_pfm_read_pmds         /* 320 */
+             .long sys_pfm_load_context
+             .long sys_pfm_start
+             .long sys_pfm_stop
+             .long sys_pfm_restart
+             .long sys_pfm_create_evtsets    /* 325 */
+             .long sys_pfm_getinfo_evtsets
+             .long sys_pfm_delete_evtsets
+     .long sys_pfm_unload_context

I think there are seven spaces plus a tab here for the first 11 new syscalls? (You won't be able to tell from my quote because my mail program mangles quoted text.)

Quoted 16 lines

<...>

include/asm-i386/unistd.h 2006-06-08 01:49:22.000000000 -0700 renamed from include/asm-i386/unistd.h 2006-06-08 01:42:35.000000000 -0700 +7 -0
@@ -322,8 +322,19 @@
 #define __NR_sync_file_range 314
 #define __NR_tee             315
 #define __NR_vmsplice                316
+#define __NR_pfm_create_context      317
+#define __NR_pfm_write_pmcs  (__NR_pfm_create_context+1)
+#define __NR_pfm_write_pmds  (__NR_pfm_create_context+2)
+#define __NR_pfm_read_pmds   (__NR_pfm_create_context+3)
+#define __NR_pfm_load_context        (__NR_pfm_create_context+4)
+#define __NR_pfm_start               (__NR_pfm_create_context+5)
+#define __NR_pfm_stop                (__NR_pfm_create_context+6)

include/asm-i386/unistd.h 2006-06-08 01:49:22.000000000 -0700 line 340

Quoted 10 lines
include/asm-i386/unistd.h 2006-06-08 01:49:22.000000000 -0700 renamed from include/asm-i386/unistd.h 2006-06-08 01:42:35.000000000 -0700 +5 -1
+#define __NR_pfm_restart     (__NR_pfm_create_context+7)
+#define __NR_pfm_create_evtsets      (__NR_pfm_create_context+8)
+#define __NR_pfm_getinfo_evtsets (__NR_pfm_create_context+9)
+#define __NR_pfm_delete_evtsets (__NR_pfm_create_context+10)
 
-#define NR_syscalls 317
+#define NR_syscalls 329
 
 /*
  * user-visible error numbers are in the range -1 - -128: see

You missed __NR_pfm_unload_context.

Signature · 1 line
Chuck
#1 lore raw

Chuck,

Quoted 16 lines · Chuck Ebbert
Quoted 16 lines

diff -ur linux-2.6.17-rc6.orig/arch/i386/kernel/apic.c linux-2.6.17-rc6/arch/i386/kernel/apic.c

arch/i386/kernel/apic.c 2006-06-08 01:49:22.000000000 -0700 renamed from arch/i386/kernel/apic.c 2006-06-08 01:42:30.000000000 -0700 +1 -0
@@ -27,6 +27,7 @@
 #include <linux/sysdev.h>
 #include <linux/cpu.h>
 #include <linux/module.h>
+#include <linux/perfmon.h>
 
 #include <asm/atomic.h>
 #include <asm/smp.h>
@@ -1179,6 +1180,8 @@
      update_process_times(user_mode_vm(regs));
 #endif
 
Quoted 9 lines

arch/i386/kernel/apic.c 2006-06-08 01:49:22.000000000 -0700 line 1187

Quoted 5 lines
arch/i386/kernel/apic.c 2006-06-08 01:49:22.000000000 -0700 renamed from arch/i386/kernel/apic.c 2006-06-08 01:42:30.000000000 -0700 +2 -0
+     pfm_handle_switch_timeout();
+
      /*
       * We take the 'long' return path, and there every subsystem
       * grabs the apropriate locks (kernel lock/ irq lock).

Please add '-p' to your diff options. It makes it easier to see what is happening.

Will do for next patch. This is indeed a very useful option I did not know about.

Quoted 15 lines
Quoted 15 lines

diff -ur linux-2.6.17-rc6.orig/arch/i386/kernel/syscall_table.S linux-2.6.17-rc6/arch/i386/kernel/syscall_table.S

arch/i386/kernel/syscall_table.S 2006-06-08 01:50:27.000000000 -0700 renamed from arch/i386/kernel/syscall_table.S 2006-06-08 01:42:30.000000000 -0700 +8 -0
@@ -316,3 +316,15 @@
      .long sys_sync_file_range
      .long sys_tee                   /* 315 */
      .long sys_vmsplice
+             .long sys_pfm_create_context
+             .long sys_pfm_write_pmcs
+             .long sys_pfm_write_pmds
+             .long sys_pfm_read_pmds         /* 320 */
+             .long sys_pfm_load_context
+             .long sys_pfm_start
+             .long sys_pfm_stop
+             .long sys_pfm_restart
Quoted 9 lines

arch/i386/kernel/syscall_table.S 2006-06-08 01:50:27.000000000 -0700 line 330

Quoted 4 lines
arch/i386/kernel/syscall_table.S 2006-06-08 01:50:27.000000000 -0700 renamed from arch/i386/kernel/syscall_table.S 2006-06-08 01:42:30.000000000 -0700 +4 -0
+             .long sys_pfm_create_evtsets    /* 325 */
+             .long sys_pfm_getinfo_evtsets
+             .long sys_pfm_delete_evtsets
+     .long sys_pfm_unload_context

I think there are seven spaces plus a tab here for the first 11 new syscalls? (You won't be able to tell from my quote because my mail program mangles quoted text.)

I fixed that now.

Quoted 21 lines
Quoted 21 lines

<...>

include/asm-i386/unistd.h 2006-06-08 01:49:22.000000000 -0700 renamed from include/asm-i386/unistd.h 2006-06-08 01:42:35.000000000 -0700 +11 -0
@@ -322,8 +322,19 @@
 #define __NR_sync_file_range 314
 #define __NR_tee             315
 #define __NR_vmsplice                316
+#define __NR_pfm_create_context      317
+#define __NR_pfm_write_pmcs  (__NR_pfm_create_context+1)
+#define __NR_pfm_write_pmds  (__NR_pfm_create_context+2)
+#define __NR_pfm_read_pmds   (__NR_pfm_create_context+3)
+#define __NR_pfm_load_context        (__NR_pfm_create_context+4)
+#define __NR_pfm_start               (__NR_pfm_create_context+5)
+#define __NR_pfm_stop                (__NR_pfm_create_context+6)
+#define __NR_pfm_restart     (__NR_pfm_create_context+7)
+#define __NR_pfm_create_evtsets      (__NR_pfm_create_context+8)
+#define __NR_pfm_getinfo_evtsets (__NR_pfm_create_context+9)
+#define __NR_pfm_delete_evtsets (__NR_pfm_create_context+10)
 
Quoted 8 lines

include/asm-i386/unistd.h 2006-06-08 01:49:22.000000000 -0700 line 340

Quoted 5 lines
include/asm-i386/unistd.h 2006-06-08 01:49:22.000000000 -0700 renamed from include/asm-i386/unistd.h 2006-06-08 01:42:35.000000000 -0700 +1 -1
-#define NR_syscalls 317
+#define NR_syscalls 329
 
 /*
  * user-visible error numbers are in the range -1 - -128: see

You missed __NR_pfm_unload_context.

I think, I dropped the line when I edit the patch to make it fit lkml limitations. The line is there is the actual patch.

Thanks for your review.

Signature · 1 line
-Stephane