diff options
Diffstat (limited to 'arch')
129 files changed, 437 insertions, 785 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 2a85dc3390..4c002ba37e 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -654,7 +654,7 @@ source "drivers/Kconfig" | |||
654 | 654 | ||
655 | source "fs/Kconfig" | 655 | source "fs/Kconfig" |
656 | 656 | ||
657 | source "arch/alpha/oprofile/Kconfig" | 657 | source "kernel/Kconfig.instrumentation" |
658 | 658 | ||
659 | source "arch/alpha/Kconfig.debug" | 659 | source "arch/alpha/Kconfig.debug" |
660 | 660 | ||
diff --git a/arch/alpha/kernel/semaphore.c b/arch/alpha/kernel/semaphore.c index 8c8aaa205e..8d2982aa1b 100644 --- a/arch/alpha/kernel/semaphore.c +++ b/arch/alpha/kernel/semaphore.c | |||
@@ -69,7 +69,7 @@ __down_failed(struct semaphore *sem) | |||
69 | 69 | ||
70 | #ifdef CONFIG_DEBUG_SEMAPHORE | 70 | #ifdef CONFIG_DEBUG_SEMAPHORE |
71 | printk("%s(%d): down failed(%p)\n", | 71 | printk("%s(%d): down failed(%p)\n", |
72 | tsk->comm, tsk->pid, sem); | 72 | tsk->comm, task_pid_nr(tsk), sem); |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | tsk->state = TASK_UNINTERRUPTIBLE; | 75 | tsk->state = TASK_UNINTERRUPTIBLE; |
@@ -98,7 +98,7 @@ __down_failed(struct semaphore *sem) | |||
98 | 98 | ||
99 | #ifdef CONFIG_DEBUG_SEMAPHORE | 99 | #ifdef CONFIG_DEBUG_SEMAPHORE |
100 | printk("%s(%d): down acquired(%p)\n", | 100 | printk("%s(%d): down acquired(%p)\n", |
101 | tsk->comm, tsk->pid, sem); | 101 | tsk->comm, task_pid_nr(tsk), sem); |
102 | #endif | 102 | #endif |
103 | } | 103 | } |
104 | 104 | ||
@@ -111,7 +111,7 @@ __down_failed_interruptible(struct semaphore *sem) | |||
111 | 111 | ||
112 | #ifdef CONFIG_DEBUG_SEMAPHORE | 112 | #ifdef CONFIG_DEBUG_SEMAPHORE |
113 | printk("%s(%d): down failed(%p)\n", | 113 | printk("%s(%d): down failed(%p)\n", |
114 | tsk->comm, tsk->pid, sem); | 114 | tsk->comm, task_pid_nr(tsk), sem); |
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | tsk->state = TASK_INTERRUPTIBLE; | 117 | tsk->state = TASK_INTERRUPTIBLE; |
@@ -139,7 +139,7 @@ __down_failed_interruptible(struct semaphore *sem) | |||
139 | 139 | ||
140 | #ifdef CONFIG_DEBUG_SEMAPHORE | 140 | #ifdef CONFIG_DEBUG_SEMAPHORE |
141 | printk("%s(%d): down %s(%p)\n", | 141 | printk("%s(%d): down %s(%p)\n", |
142 | current->comm, current->pid, | 142 | current->comm, task_pid_nr(current), |
143 | (ret < 0 ? "interrupted" : "acquired"), sem); | 143 | (ret < 0 ? "interrupted" : "acquired"), sem); |
144 | #endif | 144 | #endif |
145 | return ret; | 145 | return ret; |
@@ -168,7 +168,7 @@ down(struct semaphore *sem) | |||
168 | #endif | 168 | #endif |
169 | #ifdef CONFIG_DEBUG_SEMAPHORE | 169 | #ifdef CONFIG_DEBUG_SEMAPHORE |
170 | printk("%s(%d): down(%p) <count=%d> from %p\n", | 170 | printk("%s(%d): down(%p) <count=%d> from %p\n", |
171 | current->comm, current->pid, sem, | 171 | current->comm, task_pid_nr(current), sem, |
172 | atomic_read(&sem->count), __builtin_return_address(0)); | 172 | atomic_read(&sem->count), __builtin_return_address(0)); |
173 | #endif | 173 | #endif |
174 | __down(sem); | 174 | __down(sem); |
@@ -182,7 +182,7 @@ down_interruptible(struct semaphore *sem) | |||
182 | #endif | 182 | #endif |
183 | #ifdef CONFIG_DEBUG_SEMAPHORE | 183 | #ifdef CONFIG_DEBUG_SEMAPHORE |
184 | printk("%s(%d): down(%p) <count=%d> from %p\n", | 184 | printk("%s(%d): down(%p) <count=%d> from %p\n", |
185 | current->comm, current->pid, sem, | 185 | current->comm, task_pid_nr(current), sem, |
186 | atomic_read(&sem->count), __builtin_return_address(0)); | 186 | atomic_read(&sem->count), __builtin_return_address(0)); |
187 | #endif | 187 | #endif |
188 | return __down_interruptible(sem); | 188 | return __down_interruptible(sem); |
@@ -201,7 +201,7 @@ down_trylock(struct semaphore *sem) | |||
201 | 201 | ||
202 | #ifdef CONFIG_DEBUG_SEMAPHORE | 202 | #ifdef CONFIG_DEBUG_SEMAPHORE |
203 | printk("%s(%d): down_trylock %s from %p\n", | 203 | printk("%s(%d): down_trylock %s from %p\n", |
204 | current->comm, current->pid, | 204 | current->comm, task_pid_nr(current), |
205 | ret ? "failed" : "acquired", | 205 | ret ? "failed" : "acquired", |
206 | __builtin_return_address(0)); | 206 | __builtin_return_address(0)); |
207 | #endif | 207 | #endif |
@@ -217,7 +217,7 @@ up(struct semaphore *sem) | |||
217 | #endif | 217 | #endif |
218 | #ifdef CONFIG_DEBUG_SEMAPHORE | 218 | #ifdef CONFIG_DEBUG_SEMAPHORE |
219 | printk("%s(%d): up(%p) <count=%d> from %p\n", | 219 | printk("%s(%d): up(%p) <count=%d> from %p\n", |
220 | current->comm, current->pid, sem, | 220 | current->comm, task_pid_nr(current), sem, |
221 | atomic_read(&sem->count), __builtin_return_address(0)); | 221 | atomic_read(&sem->count), __builtin_return_address(0)); |
222 | #endif | 222 | #endif |
223 | __up(sem); | 223 | __up(sem); |
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index ec0f05e0d8..2dc7f9fed2 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c | |||
@@ -182,7 +182,7 @@ die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15) | |||
182 | #ifdef CONFIG_SMP | 182 | #ifdef CONFIG_SMP |
183 | printk("CPU %d ", hard_smp_processor_id()); | 183 | printk("CPU %d ", hard_smp_processor_id()); |
184 | #endif | 184 | #endif |
185 | printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err); | 185 | printk("%s(%d): %s %ld\n", current->comm, task_pid_nr(current), str, err); |
186 | dik_show_regs(regs, r9_15); | 186 | dik_show_regs(regs, r9_15); |
187 | add_taint(TAINT_DIE); | 187 | add_taint(TAINT_DIE); |
188 | dik_show_trace((unsigned long *)(regs+1)); | 188 | dik_show_trace((unsigned long *)(regs+1)); |
@@ -646,7 +646,7 @@ got_exception: | |||
646 | lock_kernel(); | 646 | lock_kernel(); |
647 | 647 | ||
648 | printk("%s(%d): unhandled unaligned exception\n", | 648 | printk("%s(%d): unhandled unaligned exception\n", |
649 | current->comm, current->pid); | 649 | current->comm, task_pid_nr(current)); |
650 | 650 | ||
651 | printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx\n", | 651 | printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx\n", |
652 | pc, una_reg(26), regs->ps); | 652 | pc, una_reg(26), regs->ps); |
@@ -786,7 +786,7 @@ do_entUnaUser(void __user * va, unsigned long opcode, | |||
786 | } | 786 | } |
787 | if (++cnt < 5) { | 787 | if (++cnt < 5) { |
788 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", | 788 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", |
789 | current->comm, current->pid, | 789 | current->comm, task_pid_nr(current), |
790 | regs->pc - 4, va, opcode, reg); | 790 | regs->pc - 4, va, opcode, reg); |
791 | } | 791 | } |
792 | last_time = jiffies; | 792 | last_time = jiffies; |
diff --git a/arch/alpha/lib/fls.c b/arch/alpha/lib/fls.c index 7ad84ea0ac..32afaa3fa6 100644 --- a/arch/alpha/lib/fls.c +++ b/arch/alpha/lib/fls.c | |||
@@ -3,7 +3,7 @@ | |||
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
6 | #include <asm/bitops.h> | 6 | #include <linux/bitops.h> |
7 | 7 | ||
8 | /* This is fls(x)-1, except zero is held to zero. This allows most | 8 | /* This is fls(x)-1, except zero is held to zero. This allows most |
9 | efficent input into extbl, plus it allows easy handling of fls(0)=0. */ | 9 | efficent input into extbl, plus it allows easy handling of fls(0)=0. */ |
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c index 25154df305..4829f96585 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c | |||
@@ -188,13 +188,13 @@ do_page_fault(unsigned long address, unsigned long mmcsr, | |||
188 | /* We ran out of memory, or some other thing happened to us that | 188 | /* We ran out of memory, or some other thing happened to us that |
189 | made us unable to handle the page fault gracefully. */ | 189 | made us unable to handle the page fault gracefully. */ |
190 | out_of_memory: | 190 | out_of_memory: |
191 | if (is_init(current)) { | 191 | if (is_global_init(current)) { |
192 | yield(); | 192 | yield(); |
193 | down_read(&mm->mmap_sem); | 193 | down_read(&mm->mmap_sem); |
194 | goto survive; | 194 | goto survive; |
195 | } | 195 | } |
196 | printk(KERN_ALERT "VM: killing process %s(%d)\n", | 196 | printk(KERN_ALERT "VM: killing process %s(%d)\n", |
197 | current->comm, current->pid); | 197 | current->comm, task_pid_nr(current)); |
198 | if (!user_mode(regs)) | 198 | if (!user_mode(regs)) |
199 | goto no_context; | 199 | goto no_context; |
200 | do_group_exit(SIGKILL); | 200 | do_group_exit(SIGKILL); |
diff --git a/arch/alpha/oprofile/Kconfig b/arch/alpha/oprofile/Kconfig deleted file mode 100644 index 5ade19801b..0000000000 --- a/arch/alpha/oprofile/Kconfig +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | depends on EXPERIMENTAL | ||
4 | |||
5 | config PROFILING | ||
6 | bool "Profiling support (EXPERIMENTAL)" | ||
7 | help | ||
8 | Say Y here to enable the extended profiling support mechanisms used | ||
9 | by profilers such as OProfile. | ||
10 | |||
11 | |||
12 | config OPROFILE | ||
13 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
14 | depends on PROFILING | ||
15 | help | ||
16 | OProfile is a profiling system capable of profiling the | ||
17 | whole system, include the kernel, kernel modules, libraries, | ||
18 | and applications. | ||
19 | |||
20 | If unsure, say N. | ||
21 | |||
22 | endmenu | ||
23 | |||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 0a0c88d003..4cee938df0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1068,7 +1068,7 @@ endmenu | |||
1068 | 1068 | ||
1069 | source "fs/Kconfig" | 1069 | source "fs/Kconfig" |
1070 | 1070 | ||
1071 | source "arch/arm/oprofile/Kconfig" | 1071 | source "kernel/Kconfig.instrumentation" |
1072 | 1072 | ||
1073 | source "arch/arm/Kconfig.debug" | 1073 | source "arch/arm/Kconfig.debug" |
1074 | 1074 | ||
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 93b7f8e22d..4f1a03124a 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -265,7 +265,7 @@ void __show_regs(struct pt_regs *regs) | |||
265 | void show_regs(struct pt_regs * regs) | 265 | void show_regs(struct pt_regs * regs) |
266 | { | 266 | { |
267 | printk("\n"); | 267 | printk("\n"); |
268 | printk("Pid: %d, comm: %20s\n", current->pid, current->comm); | 268 | printk("Pid: %d, comm: %20s\n", task_pid_nr(current), current->comm); |
269 | __show_regs(regs); | 269 | __show_regs(regs); |
270 | __backtrace(); | 270 | __backtrace(); |
271 | } | 271 | } |
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 5feee722ea..4b05dc5c10 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -382,16 +382,16 @@ static void clear_breakpoint(struct task_struct *task, struct debug_entry *bp) | |||
382 | 382 | ||
383 | if (ret != 2 || old_insn.thumb != BREAKINST_THUMB) | 383 | if (ret != 2 || old_insn.thumb != BREAKINST_THUMB) |
384 | printk(KERN_ERR "%s:%d: corrupted Thumb breakpoint at " | 384 | printk(KERN_ERR "%s:%d: corrupted Thumb breakpoint at " |
385 | "0x%08lx (0x%04x)\n", task->comm, task->pid, | 385 | "0x%08lx (0x%04x)\n", task->comm, |
386 | addr, old_insn.thumb); | 386 | task_pid_nr(task), addr, old_insn.thumb); |
387 | } else { | 387 | } else { |
388 | ret = swap_insn(task, addr & ~3, &old_insn.arm, | 388 | ret = swap_insn(task, addr & ~3, &old_insn.arm, |
389 | &bp->insn.arm, 4); | 389 | &bp->insn.arm, 4); |
390 | 390 | ||
391 | if (ret != 4 || old_insn.arm != BREAKINST_ARM) | 391 | if (ret != 4 || old_insn.arm != BREAKINST_ARM) |
392 | printk(KERN_ERR "%s:%d: corrupted ARM breakpoint at " | 392 | printk(KERN_ERR "%s:%d: corrupted ARM breakpoint at " |
393 | "0x%08lx (0x%08x)\n", task->comm, task->pid, | 393 | "0x%08lx (0x%08x)\n", task->comm, |
394 | addr, old_insn.arm); | 394 | task_pid_nr(task), addr, old_insn.arm); |
395 | } | 395 | } |
396 | } | 396 | } |
397 | 397 | ||
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 8ad47619c0..4764bd9cce 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -223,7 +223,7 @@ static void __die(const char *str, int err, struct thread_info *thread, struct p | |||
223 | print_modules(); | 223 | print_modules(); |
224 | __show_regs(regs); | 224 | __show_regs(regs); |
225 | printk("Process %s (pid: %d, stack limit = 0x%p)\n", | 225 | printk("Process %s (pid: %d, stack limit = 0x%p)\n", |
226 | tsk->comm, tsk->pid, thread + 1); | 226 | tsk->comm, task_pid_nr(tsk), thread + 1); |
227 | 227 | ||
228 | if (!user_mode(regs) || in_interrupt()) { | 228 | if (!user_mode(regs) || in_interrupt()) { |
229 | dump_mem("Stack: ", regs->ARM_sp, | 229 | dump_mem("Stack: ", regs->ARM_sp, |
@@ -337,7 +337,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | |||
337 | #ifdef CONFIG_DEBUG_USER | 337 | #ifdef CONFIG_DEBUG_USER |
338 | if (user_debug & UDBG_UNDEFINED) { | 338 | if (user_debug & UDBG_UNDEFINED) { |
339 | printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", | 339 | printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", |
340 | current->comm, current->pid, pc); | 340 | current->comm, task_pid_nr(current), pc); |
341 | dump_instr(regs); | 341 | dump_instr(regs); |
342 | } | 342 | } |
343 | #endif | 343 | #endif |
@@ -388,7 +388,7 @@ static int bad_syscall(int n, struct pt_regs *regs) | |||
388 | #ifdef CONFIG_DEBUG_USER | 388 | #ifdef CONFIG_DEBUG_USER |
389 | if (user_debug & UDBG_SYSCALL) { | 389 | if (user_debug & UDBG_SYSCALL) { |
390 | printk(KERN_ERR "[%d] %s: obsolete system call %08x.\n", | 390 | printk(KERN_ERR "[%d] %s: obsolete system call %08x.\n", |
391 | current->pid, current->comm, n); | 391 | task_pid_nr(current), current->comm, n); |
392 | dump_instr(regs); | 392 | dump_instr(regs); |
393 | } | 393 | } |
394 | #endif | 394 | #endif |
@@ -565,7 +565,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
565 | */ | 565 | */ |
566 | if (user_debug & UDBG_SYSCALL) { | 566 | if (user_debug & UDBG_SYSCALL) { |
567 | printk("[%d] %s: arm syscall %d\n", | 567 | printk("[%d] %s: arm syscall %d\n", |
568 | current->pid, current->comm, no); | 568 | task_pid_nr(current), current->comm, no); |
569 | dump_instr(regs); | 569 | dump_instr(regs); |
570 | if (user_mode(regs)) { | 570 | if (user_mode(regs)) { |
571 | __show_regs(regs); | 571 | __show_regs(regs); |
@@ -642,7 +642,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs) | |||
642 | #ifdef CONFIG_DEBUG_USER | 642 | #ifdef CONFIG_DEBUG_USER |
643 | if (user_debug & UDBG_BADABORT) { | 643 | if (user_debug & UDBG_BADABORT) { |
644 | printk(KERN_ERR "[%d] %s: bad data abort: code %d instr 0x%08lx\n", | 644 | printk(KERN_ERR "[%d] %s: bad data abort: code %d instr 0x%08lx\n", |
645 | current->pid, current->comm, code, instr); | 645 | task_pid_nr(current), current->comm, code, instr); |
646 | dump_instr(regs); | 646 | dump_instr(regs); |
647 | show_pte(current->mm, addr); | 647 | show_pte(current->mm, addr); |
648 | } | 648 | } |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index 074b7cb077..e162cca591 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -757,7 +757,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
757 | if (ai_usermode & 1) | 757 | if (ai_usermode & 1) |
758 | printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*lx " | 758 | printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*lx " |
759 | "Address=0x%08lx FSR 0x%03x\n", current->comm, | 759 | "Address=0x%08lx FSR 0x%03x\n", current->comm, |
760 | current->pid, instrptr, | 760 | task_pid_nr(current), instrptr, |
761 | thumb_mode(regs) ? 4 : 8, | 761 | thumb_mode(regs) ? 4 : 8, |
762 | thumb_mode(regs) ? tinstr : instr, | 762 | thumb_mode(regs) ? tinstr : instr, |
763 | addr, fsr); | 763 | addr, fsr); |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 59ed1d05b7..a8a7dab757 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -197,7 +197,7 @@ survive: | |||
197 | return fault; | 197 | return fault; |
198 | 198 | ||
199 | out_of_memory: | 199 | out_of_memory: |
200 | if (!is_init(tsk)) | 200 | if (!is_global_init(tsk)) |
201 | goto out; | 201 | goto out; |
202 | 202 | ||
203 | /* | 203 | /* |
diff --git a/arch/arm/oprofile/Kconfig b/arch/arm/oprofile/Kconfig deleted file mode 100644 index afd93ad02f..0000000000 --- a/arch/arm/oprofile/Kconfig +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | depends on EXPERIMENTAL | ||
4 | |||
5 | config PROFILING | ||
6 | bool "Profiling support (EXPERIMENTAL)" | ||
7 | help | ||
8 | Say Y here to enable the extended profiling support mechanisms used | ||
9 | by profilers such as OProfile. | ||
10 | |||
11 | |||
12 | config OPROFILE | ||
13 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
14 | depends on PROFILING | ||
15 | help | ||
16 | OProfile is a profiling system capable of profiling the | ||
17 | whole system, include the kernel, kernel modules, libraries, | ||
18 | and applications. | ||
19 | |||
20 | If unsure, say N. | ||
21 | |||
22 | if OPROFILE | ||
23 | |||
24 | config OPROFILE_ARMV6 | ||
25 | bool | ||
26 | depends on CPU_V6 && !SMP | ||
27 | default y | ||
28 | select OPROFILE_ARM11_CORE | ||
29 | |||
30 | config OPROFILE_MPCORE | ||
31 | bool | ||
32 | depends on CPU_V6 && SMP | ||
33 | default y | ||
34 | select OPROFILE_ARM11_CORE | ||
35 | |||
36 | config OPROFILE_ARM11_CORE | ||
37 | bool | ||
38 | |||
39 | endif | ||
40 | |||
41 | endmenu | ||
42 | |||
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index 9a73ce7eb5..8a7caf8e7b 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c | |||
@@ -89,7 +89,7 @@ void _exception(long signr, struct pt_regs *regs, int code, | |||
89 | * generate the same exception over and over again and we get | 89 | * generate the same exception over and over again and we get |
90 | * nowhere. Better to kill it and let the kernel panic. | 90 | * nowhere. Better to kill it and let the kernel panic. |
91 | */ | 91 | */ |
92 | if (is_init(current)) { | 92 | if (is_global_init(current)) { |
93 | __sighandler_t handler; | 93 | __sighandler_t handler; |
94 | 94 | ||
95 | spin_lock_irq(¤t->sighand->siglock); | 95 | spin_lock_irq(¤t->sighand->siglock); |
diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c index 11472f8701..6560cb18b4 100644 --- a/arch/avr32/mm/fault.c +++ b/arch/avr32/mm/fault.c | |||
@@ -160,7 +160,7 @@ bad_area: | |||
160 | if (exception_trace && printk_ratelimit()) | 160 | if (exception_trace && printk_ratelimit()) |
161 | printk("%s%s[%d]: segfault at %08lx pc %08lx " | 161 | printk("%s%s[%d]: segfault at %08lx pc %08lx " |
162 | "sp %08lx ecr %lu\n", | 162 | "sp %08lx ecr %lu\n", |
163 | is_init(tsk) ? KERN_EMERG : KERN_INFO, | 163 | is_global_init(tsk) ? KERN_EMERG : KERN_INFO, |
164 | tsk->comm, tsk->pid, address, regs->pc, | 164 | tsk->comm, tsk->pid, address, regs->pc, |
165 | regs->sp, ecr); | 165 | regs->sp, ecr); |
166 | _exception(SIGSEGV, regs, code, address); | 166 | _exception(SIGSEGV, regs, code, address); |
@@ -209,7 +209,7 @@ no_context: | |||
209 | */ | 209 | */ |
210 | out_of_memory: | 210 | out_of_memory: |
211 | up_read(&mm->mmap_sem); | 211 | up_read(&mm->mmap_sem); |
212 | if (is_init(current)) { | 212 | if (is_global_init(current)) { |
213 | yield(); | 213 | yield(); |
214 | down_read(&mm->mmap_sem); | 214 | down_read(&mm->mmap_sem); |
215 | goto survive; | 215 | goto survive; |
@@ -231,7 +231,7 @@ do_sigbus: | |||
231 | if (exception_trace) | 231 | if (exception_trace) |
232 | printk("%s%s[%d]: bus error at %08lx pc %08lx " | 232 | printk("%s%s[%d]: bus error at %08lx pc %08lx " |
233 | "sp %08lx ecr %lu\n", | 233 | "sp %08lx ecr %lu\n", |
234 | is_init(tsk) ? KERN_EMERG : KERN_INFO, | 234 | is_global_init(tsk) ? KERN_EMERG : KERN_INFO, |
235 | tsk->comm, tsk->pid, address, regs->pc, | 235 | tsk->comm, tsk->pid, address, regs->pc, |
236 | regs->sp, ecr); | 236 | regs->sp, ecr); |
237 | 237 | ||
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index aa9db30733..4c5ca9d5e4 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -1012,7 +1012,7 @@ source "drivers/Kconfig" | |||
1012 | 1012 | ||
1013 | source "fs/Kconfig" | 1013 | source "fs/Kconfig" |
1014 | 1014 | ||
1015 | source "arch/blackfin/oprofile/Kconfig" | 1015 | source "kernel/Kconfig.instrumentation" |
1016 | 1016 | ||
1017 | menu "Kernel hacking" | 1017 | menu "Kernel hacking" |
1018 | 1018 | ||
diff --git a/arch/blackfin/oprofile/Kconfig b/arch/blackfin/oprofile/Kconfig deleted file mode 100644 index 0a2fd999c9..0000000000 --- a/arch/blackfin/oprofile/Kconfig +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | menu "Profiling support" | ||
2 | depends on EXPERIMENTAL | ||
3 | |||
4 | config PROFILING | ||
5 | bool "Profiling support (EXPERIMENTAL)" | ||
6 | help | ||
7 | Say Y here to enable the extended profiling support mechanisms used | ||
8 | by profilers such as OProfile. | ||
9 | |||
10 | config OPROFILE | ||
11 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
12 | depends on PROFILING | ||
13 | help | ||
14 | OProfile is a profiling system capable of profiling the | ||
15 | whole system, include the kernel, kernel modules, libraries, | ||
16 | and applications. | ||
17 | |||
18 | If unsure, say N. | ||
19 | |||
20 | config HARDWARE_PM | ||
21 | tristate "Hardware Performance Monitor Profiling" | ||
22 | depends on PROFILING | ||
23 | help | ||
24 | take use of hardware performance monitor to profiling the kernel | ||
25 | and application. | ||
26 | |||
27 | If unsure, say N. | ||
28 | |||
29 | endmenu | ||
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 6b4d026a00..21900a9378 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -196,6 +196,8 @@ source "sound/Kconfig" | |||
196 | 196 | ||
197 | source "drivers/usb/Kconfig" | 197 | source "drivers/usb/Kconfig" |
198 | 198 | ||
199 | source "kernel/Kconfig.instrumentation" | ||
200 | |||
199 | source "arch/cris/Kconfig.debug" | 201 | source "arch/cris/Kconfig.debug" |
200 | 202 | ||
201 | source "security/Kconfig" | 203 | source "security/Kconfig" |
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 74eef7111f..43153e767b 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -375,6 +375,8 @@ source "drivers/Kconfig" | |||
375 | 375 | ||
376 | source "fs/Kconfig" | 376 | source "fs/Kconfig" |
377 | 377 | ||
378 | source "kernel/Kconfig.instrumentation" | ||
379 | |||
378 | source "arch/frv/Kconfig.debug" | 380 | source "arch/frv/Kconfig.debug" |
379 | 381 | ||
380 | source "security/Kconfig" | 382 | source "security/Kconfig" |
diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c index ad753c1e9b..9e38f99bba 100644 --- a/arch/frv/kernel/irq-mb93091.c +++ b/arch/frv/kernel/irq-mb93091.c | |||
@@ -17,10 +17,10 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/bitops.h> | ||
20 | 21 | ||
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
22 | #include <asm/system.h> | 23 | #include <asm/system.h> |
23 | #include <asm/bitops.h> | ||
24 | #include <asm/delay.h> | 24 | #include <asm/delay.h> |
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | #include <asm/irc-regs.h> | 26 | #include <asm/irc-regs.h> |
diff --git a/arch/frv/kernel/irq-mb93093.c b/arch/frv/kernel/irq-mb93093.c index e0983f6926..3c2752ca97 100644 --- a/arch/frv/kernel/irq-mb93093.c +++ b/arch/frv/kernel/irq-mb93093.c | |||
@@ -17,10 +17,10 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/bitops.h> | ||
20 | 21 | ||
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
22 | #include <asm/system.h> | 23 | #include <asm/system.h> |
23 | #include <asm/bitops.h> | ||
24 | #include <asm/delay.h> | 24 | #include <asm/delay.h> |
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | #include <asm/irc-regs.h> | 26 | #include <asm/irc-regs.h> |
diff --git a/arch/frv/kernel/irq-mb93493.c b/arch/frv/kernel/irq-mb93493.c index c157eeff87..7754c7338e 100644 --- a/arch/frv/kernel/irq-mb93493.c +++ b/arch/frv/kernel/irq-mb93493.c | |||
@@ -17,10 +17,10 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/bitops.h> | ||
20 | 21 | ||
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
22 | #include <asm/system.h> | 23 | #include <asm/system.h> |
23 | #include <asm/bitops.h> | ||
24 | #include <asm/delay.h> | 24 | #include <asm/delay.h> |
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | #include <asm/irc-regs.h> | 26 | #include <asm/irc-regs.h> |
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c index c7e59dcade..7ddb69089e 100644 --- a/arch/frv/kernel/irq.c +++ b/arch/frv/kernel/irq.c | |||
@@ -24,12 +24,12 @@ | |||
24 | #include <linux/proc_fs.h> | 24 | #include <linux/proc_fs.h> |
25 | #include <linux/seq_file.h> | 25 | #include <linux/seq_file.h> |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/bitops.h> | ||
27 | 28 | ||
28 | #include <asm/atomic.h> | 29 | #include <asm/atomic.h> |
29 | #include <asm/io.h> | 30 | #include <asm/io.h> |
30 | #include <asm/smp.h> | 31 | #include <asm/smp.h> |
31 | #include <asm/system.h> | 32 | #include <asm/system.h> |
32 | #include <asm/bitops.h> | ||
33 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
34 | #include <asm/pgalloc.h> | 34 | #include <asm/pgalloc.h> |
35 | #include <asm/delay.h> | 35 | #include <asm/delay.h> |
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index e35f74e6e5..e2e9f57abe 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig | |||
@@ -223,6 +223,8 @@ endmenu | |||
223 | 223 | ||
224 | source "fs/Kconfig" | 224 | source "fs/Kconfig" |
225 | 225 | ||
226 | source "kernel/Kconfig.instrumentation" | ||
227 | |||
226 | source "arch/h8300/Kconfig.debug" | 228 | source "arch/h8300/Kconfig.debug" |
227 | 229 | ||
228 | source "security/Kconfig" | 230 | source "security/Kconfig" |
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index b84d5050e9..04be7a7d09 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -1256,31 +1256,6 @@ source "drivers/Kconfig" | |||
1256 | 1256 | ||
1257 | source "fs/Kconfig" | 1257 | source "fs/Kconfig" |
1258 | 1258 | ||
1259 | menuconfig INSTRUMENTATION | ||
1260 | bool "Instrumentation Support" | ||
1261 | default y | ||
1262 | ---help--- | ||
1263 | Say Y here to get to see options related to performance measurement, | ||
1264 | debugging, and testing. This option alone does not add any kernel code. | ||
1265 | |||
1266 | If you say N, all options in this submenu will be skipped and disabled. | ||
1267 | |||
1268 | if INSTRUMENTATION | ||
1269 | |||
1270 | source "arch/x86/oprofile/Kconfig" | ||
1271 | |||
1272 | config KPROBES | ||
1273 | bool "Kprobes" | ||
1274 | depends on KALLSYMS && MODULES | ||
1275 | help | ||
1276 | Kprobes allows you to trap at almost any kernel address and | ||
1277 | execute a callback function. register_kprobe() establishes | ||
1278 | a probepoint and specifies the callback. Kprobes is useful | ||
1279 | for kernel debugging, non-intrusive instrumentation and testing. | ||
1280 | If in doubt, say "N". | ||
1281 | |||
1282 | endif # INSTRUMENTATION | ||
1283 | |||
1284 | source "arch/i386/Kconfig.debug" | 1259 | source "arch/i386/Kconfig.debug" |
1285 | 1260 | ||
1286 | source "security/Kconfig" | 1261 | source "security/Kconfig" |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index c60532d93c..c89108e977 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -592,20 +592,7 @@ config IRQ_PER_CPU | |||
592 | 592 | ||
593 | source "arch/ia64/hp/sim/Kconfig" | 593 | source "arch/ia64/hp/sim/Kconfig" |
594 | 594 | ||
595 | menu "Instrumentation Support" | 595 | source "kernel/Kconfig.instrumentation" |
596 | |||
597 | source "arch/ia64/oprofile/Kconfig" | ||
598 | |||
599 | config KPROBES | ||
600 | bool "Kprobes" | ||
601 | depends on KALLSYMS && MODULES | ||
602 | help | ||
603 | Kprobes allows you to trap at almost any kernel address and | ||
604 | execute a callback function. register_kprobe() establishes | ||
605 | a probepoint and specifies the callback. Kprobes is useful | ||
606 | for kernel debugging, non-intrusive instrumentation and testing. | ||
607 | If in doubt, say "N". | ||
608 | endmenu | ||
609 | 596 | ||
610 | source "arch/ia64/Kconfig.debug" | 597 | source "arch/ia64/Kconfig.debug" |
611 | 598 | ||
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig index 449d3e75bf..75fd90dc76 100644 --- a/arch/ia64/configs/sn2_defconfig +++ b/arch/ia64/configs/sn2_defconfig | |||
@@ -26,6 +26,7 @@ CONFIG_TASK_IO_ACCOUNTING=y | |||
26 | # CONFIG_AUDIT is not set | 26 | # CONFIG_AUDIT is not set |
27 | # CONFIG_IKCONFIG is not set | 27 | # CONFIG_IKCONFIG is not set |
28 | CONFIG_LOG_BUF_SHIFT=20 | 28 | CONFIG_LOG_BUF_SHIFT=20 |
29 | CONFIG_CGROUPS=y | ||
29 | CONFIG_CPUSETS=y | 30 | CONFIG_CPUSETS=y |
30 | CONFIG_SYSFS_DEPRECATED=y | 31 | CONFIG_SYSFS_DEPRECATED=y |
31 | CONFIG_RELAY=y | 32 | CONFIG_RELAY=y |
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index a3405b3c1e..d025a22eb2 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c | |||
@@ -773,7 +773,7 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro | |||
773 | if (flags & MAP_SHARED) | 773 | if (flags & MAP_SHARED) |
774 | printk(KERN_INFO | 774 | printk(KERN_INFO |
775 | "%s(%d): emulate_mmap() can't share head (addr=0x%lx)\n", | 775 | "%s(%d): emulate_mmap() can't share head (addr=0x%lx)\n", |
776 | current->comm, current->pid, start); | 776 | current->comm, task_pid_nr(current), start); |
777 | ret = mmap_subpage(file, start, min(PAGE_ALIGN(start), end), prot, flags, | 777 | ret = mmap_subpage(file, start, min(PAGE_ALIGN(start), end), prot, flags, |
778 | off); | 778 | off); |
779 | if (IS_ERR((void *) ret)) | 779 | if (IS_ERR((void *) ret)) |
@@ -786,7 +786,7 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro | |||
786 | if (flags & MAP_SHARED) | 786 | if (flags & MAP_SHARED) |
787 | printk(KERN_INFO | 787 | printk(KERN_INFO |
788 | "%s(%d): emulate_mmap() can't share tail (end=0x%lx)\n", | 788 | "%s(%d): emulate_mmap() can't share tail (end=0x%lx)\n", |
789 | current->comm, current->pid, end); | 789 | current->comm, task_pid_nr(current), end); |
790 | ret = mmap_subpage(file, max(start, PAGE_START(end)), end, prot, flags, | 790 | ret = mmap_subpage(file, max(start, PAGE_START(end)), end, prot, flags, |
791 | (off + len) - offset_in_page(end)); | 791 | (off + len) - offset_in_page(end)); |
792 | if (IS_ERR((void *) ret)) | 792 | if (IS_ERR((void *) ret)) |
@@ -816,7 +816,7 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro | |||
816 | 816 | ||
817 | if ((flags & MAP_SHARED) && !is_congruent) | 817 | if ((flags & MAP_SHARED) && !is_congruent) |
818 | printk(KERN_INFO "%s(%d): emulate_mmap() can't share contents of incongruent mmap " | 818 | printk(KERN_INFO "%s(%d): emulate_mmap() can't share contents of incongruent mmap " |
819 | "(addr=0x%lx,off=0x%llx)\n", current->comm, current->pid, start, off); | 819 | "(addr=0x%lx,off=0x%llx)\n", current->comm, task_pid_nr(current), start, off); |
820 | 820 | ||
821 | DBG("mmap_body: mapping [0x%lx-0x%lx) %s with poff 0x%llx\n", pstart, pend, | 821 | DBG("mmap_body: mapping [0x%lx-0x%lx) %s with poff 0x%llx\n", pstart, pend, |
822 | is_congruent ? "congruent" : "not congruent", poff); | 822 | is_congruent ? "congruent" : "not congruent", poff); |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 73ca86d038..8e4894b205 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -967,7 +967,7 @@ find_memmap_space (void) | |||
967 | * to use. We can allocate partial granules only if the unavailable | 967 | * to use. We can allocate partial granules only if the unavailable |
968 | * parts exist, and are WB. | 968 | * parts exist, and are WB. |
969 | */ | 969 | */ |
970 | void | 970 | unsigned long |
971 | efi_memmap_init(unsigned long *s, unsigned long *e) | 971 | efi_memmap_init(unsigned long *s, unsigned long *e) |
972 | { | 972 | { |
973 | struct kern_memdesc *k, *prev = NULL; | 973 | struct kern_memdesc *k, *prev = NULL; |
@@ -1084,6 +1084,8 @@ efi_memmap_init(unsigned long *s, unsigned long *e) | |||
1084 | /* reserve the memory we are using for kern_memmap */ | 1084 | /* reserve the memory we are using for kern_memmap */ |
1085 | *s = (u64)kern_memmap; | 1085 | *s = (u64)kern_memmap; |
1086 | *e = (u64)++k; | 1086 | *e = (u64)++k; |
1087 | |||
1088 | return total_mem; | ||
1087 | } | 1089 | } |
1088 | 1090 | ||
1089 | void | 1091 | void |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index f55fa07849..59169bf714 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -158,14 +158,14 @@ | |||
158 | */ | 158 | */ |
159 | #define PROTECT_CTX(c, f) \ | 159 | #define PROTECT_CTX(c, f) \ |
160 | do { \ | 160 | do { \ |
161 | DPRINT(("spinlock_irq_save ctx %p by [%d]\n", c, current->pid)); \ | 161 | DPRINT(("spinlock_irq_save ctx %p by [%d]\n", c, task_pid_nr(current))); \ |
162 | spin_lock_irqsave(&(c)->ctx_lock, f); \ | 162 | spin_lock_irqsave(&(c)->ctx_lock, f); \ |
163 | DPRINT(("spinlocked ctx %p by [%d]\n", c, current->pid)); \ | 163 | DPRINT(("spinlocked ctx %p by [%d]\n", c, task_pid_nr(current))); \ |
164 | } while(0) | 164 | } while(0) |
165 | 165 | ||
166 | #define UNPROTECT_CTX(c, f) \ | 166 | #define UNPROTECT_CTX(c, f) \ |
167 | do { \ | 167 | do { \ |
168 | DPRINT(("spinlock_irq_restore ctx %p by [%d]\n", c, current->pid)); \ | 168 | DPRINT(("spinlock_irq_restore ctx %p by [%d]\n", c, task_pid_nr(current))); \ |
169 | spin_unlock_irqrestore(&(c)->ctx_lock, f); \ | 169 | spin_unlock_irqrestore(&(c)->ctx_lock, f); \ |
170 | } while(0) | 170 | } while(0) |
171 | 171 | ||
@@ -227,12 +227,12 @@ | |||
227 | #ifdef PFM_DEBUGGING | 227 | #ifdef PFM_DEBUGGING |
228 | #define DPRINT(a) \ | 228 | #define DPRINT(a) \ |
229 | do { \ | 229 | do { \ |
230 | if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), current->pid); printk a; } \ | 230 | if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \ |
231 | } while (0) | 231 | } while (0) |
232 | 232 | ||
233 | #define DPRINT_ovfl(a) \ | 233 | #define DPRINT_ovfl(a) \ |
234 | do { \ | 234 | do { \ |
235 | if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), current->pid); printk a; } \ | 235 | if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \ |
236 | } while (0) | 236 | } while (0) |
237 | #endif | 237 | #endif |
238 | 238 | ||
@@ -913,7 +913,7 @@ pfm_mask_monitoring(struct task_struct *task) | |||
913 | unsigned long mask, val, ovfl_mask; | 913 | unsigned long mask, val, ovfl_mask; |
914 | int i; | 914 | int i; |
915 | 915 | ||
916 | DPRINT_ovfl(("masking monitoring for [%d]\n", task->pid)); | 916 | DPRINT_ovfl(("masking monitoring for [%d]\n", task_pid_nr(task))); |
917 | 917 | ||
918 | ovfl_mask = pmu_conf->ovfl_val; | 918 | ovfl_mask = pmu_conf->ovfl_val; |
919 | /* | 919 | /* |
@@ -992,12 +992,12 @@ pfm_restore_monitoring(struct task_struct *task) | |||
992 | ovfl_mask = pmu_conf->ovfl_val; | 992 | ovfl_mask = pmu_conf->ovfl_val; |
993 | 993 | ||
994 | if (task != current) { | 994 | if (task != current) { |
995 | printk(KERN_ERR "perfmon.%d: invalid task[%d] current[%d]\n", __LINE__, task->pid, current->pid); | 995 | printk(KERN_ERR "perfmon.%d: invalid task[%d] current[%d]\n", __LINE__, task_pid_nr(task), task_pid_nr(current)); |
996 | return; | 996 | return; |
997 | } | 997 | } |
998 | if (ctx->ctx_state != PFM_CTX_MASKED) { | 998 | if (ctx->ctx_state != PFM_CTX_MASKED) { |
999 | printk(KERN_ERR "perfmon.%d: task[%d] current[%d] invalid state=%d\n", __LINE__, | 999 | printk(KERN_ERR "perfmon.%d: task[%d] current[%d] invalid state=%d\n", __LINE__, |
1000 | task->pid, current->pid, ctx->ctx_state); | 1000 | task_pid_nr(task), task_pid_nr(current), ctx->ctx_state); |
1001 | return; | 1001 | return; |
1002 | } | 1002 | } |
1003 | psr = pfm_get_psr(); | 1003 | psr = pfm_get_psr(); |
@@ -1051,7 +1051,8 @@ pfm_restore_monitoring(struct task_struct *task) | |||
1051 | if ((mask & 0x1) == 0UL) continue; | 1051 | if ((mask & 0x1) == 0UL) continue; |
1052 | ctx->th_pmcs[i] = ctx->ctx_pmcs[i]; | 1052 | ctx->th_pmcs[i] = ctx->ctx_pmcs[i]; |
1053 | ia64_set_pmc(i, ctx->th_pmcs[i]); | 1053 | ia64_set_pmc(i, ctx->th_pmcs[i]); |
1054 | DPRINT(("[%d] pmc[%d]=0x%lx\n", task->pid, i, ctx->th_pmcs[i])); | 1054 | DPRINT(("[%d] pmc[%d]=0x%lx\n", |
1055 | task_pid_nr(task), i, ctx->th_pmcs[i])); | ||
1055 | } | 1056 | } |
1056 | ia64_srlz_d(); | 1057 | ia64_srlz_d(); |
1057 | 1058 | ||
@@ -1370,7 +1371,7 @@ pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned int cpu) | |||
1370 | 1371 | ||
1371 | error_conflict: | 1372 | error_conflict: |
1372 | DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n", | 1373 | DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n", |
1373 | pfm_sessions.pfs_sys_session[cpu]->pid, | 1374 | task_pid_nr(pfm_sessions.pfs_sys_session[cpu]), |
1374 | cpu)); | 1375 | cpu)); |
1375 | abort: | 1376 | abort: |
1376 | UNLOCK_PFS(flags); | 1377 | UNLOCK_PFS(flags); |
@@ -1442,7 +1443,7 @@ pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long siz | |||
1442 | 1443 | ||
1443 | /* sanity checks */ | 1444 | /* sanity checks */ |
1444 | if (task->mm == NULL || size == 0UL || vaddr == NULL) { | 1445 | if (task->mm == NULL || size == 0UL || vaddr == NULL) { |
1445 | printk(KERN_ERR "perfmon: pfm_remove_smpl_mapping [%d] invalid context mm=%p\n", task->pid, task->mm); | 1446 | printk(KERN_ERR "perfmon: pfm_remove_smpl_mapping [%d] invalid context mm=%p\n", task_pid_nr(task), task->mm); |
1446 | return -EINVAL; | 1447 | return -EINVAL; |
1447 | } | 1448 | } |
1448 | 1449 | ||
@@ -1459,7 +1460,7 @@ pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long siz | |||
1459 | 1460 | ||
1460 | up_write(&task->mm->mmap_sem); | 1461 | up_write(&task->mm->mmap_sem); |
1461 | if (r !=0) { | 1462 | if (r !=0) { |
1462 | printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task->pid, vaddr, size); | 1463 | printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); |
1463 | } | 1464 | } |
1464 | 1465 | ||
1465 | DPRINT(("do_unmap(%p, %lu)=%d\n", vaddr, size, r)); | 1466 | DPRINT(("do_unmap(%p, %lu)=%d\n", vaddr, size, r)); |
@@ -1501,7 +1502,7 @@ pfm_free_smpl_buffer(pfm_context_t *ctx) | |||
1501 | return 0; | 1502 | return 0; |
1502 | 1503 | ||
1503 | invalid_free: | 1504 | invalid_free: |
1504 | printk(KERN_ERR "perfmon: pfm_free_smpl_buffer [%d] no buffer\n", current->pid); | 1505 | printk(KERN_ERR "perfmon: pfm_free_smpl_buffer [%d] no buffer\n", task_pid_nr(current)); |
1505 | return -EINVAL; | 1506 | return -EINVAL; |
1506 | } | 1507 | } |
1507 | #endif | 1508 | #endif |
@@ -1547,13 +1548,13 @@ pfm_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos) | |||
1547 | unsigned long flags; | 1548 | unsigned long flags; |
1548 | DECLARE_WAITQUEUE(wait, current); | 1549 | DECLARE_WAITQUEUE(wait, current); |
1549 | if (PFM_IS_FILE(filp) == 0) { | 1550 | if (PFM_IS_FILE(filp) == 0) { |
1550 | printk(KERN_ERR "perfmon: pfm_poll: bad magic [%d]\n", current->pid); | 1551 | printk(KERN_ERR "perfmon: pfm_poll: bad magic [%d]\n", task_pid_nr(current)); |
1551 | return -EINVAL; | 1552 | return -EINVAL; |
1552 | } | 1553 | } |
1553 | 1554 | ||
1554 | ctx = (pfm_context_t *)filp->private_data; | 1555 | ctx = (pfm_context_t *)filp->private_data; |
1555 | if (ctx == NULL) { | 1556 | if (ctx == NULL) { |
1556 | printk(KERN_ERR "perfmon: pfm_read: NULL ctx [%d]\n", current->pid); | 1557 | printk(KERN_ERR "perfmon: pfm_read: NULL ctx [%d]\n", task_pid_nr(current)); |
1557 | return -EINVAL; | 1558 | return -EINVAL; |
1558 | } | 1559 | } |
1559 | 1560 | ||
@@ -1607,7 +1608,7 @@ pfm_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos) | |||
1607 | 1608 | ||
1608 | PROTECT_CTX(ctx, flags); | 1609 | PROTECT_CTX(ctx, flags); |
1609 | } | 1610 | } |
1610 | DPRINT(("[%d] back to running ret=%ld\n", current->pid, ret)); | 1611 | DPRINT(("[%d] back to running ret=%ld\n", task_pid_nr(current), ret)); |
1611 | set_current_state(TASK_RUNNING); | 1612 | set_current_state(TASK_RUNNING); |
1612 | remove_wait_queue(&ctx->ctx_msgq_wait, &wait); | 1613 | remove_wait_queue(&ctx->ctx_msgq_wait, &wait); |
1613 | 1614 | ||
@@ -1616,7 +1617,7 @@ pfm_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos) | |||
1616 | ret = -EINVAL; | 1617 | ret = -EINVAL; |
1617 | msg = pfm_get_next_msg(ctx); | 1618 | msg = pfm_get_next_msg(ctx); |
1618 | if (msg == NULL) { | 1619 | if (msg == NULL) { |
1619 | printk(KERN_ERR "perfmon: pfm_read no msg for ctx=%p [%d]\n", ctx, current->pid); | 1620 | printk(KERN_ERR "perfmon: pfm_read no msg for ctx=%p [%d]\n", ctx, task_pid_nr(current)); |
1620 | goto abort_locked; | 1621 | goto abort_locked; |
1621 | } | 1622 | } |
1622 | 1623 | ||
@@ -1647,13 +1648,13 @@ pfm_poll(struct file *filp, poll_table * wait) | |||
1647 | unsigned int mask = 0; | 1648 | unsigned int mask = 0; |
1648 | 1649 | ||
1649 | if (PFM_IS_FILE(filp) == 0) { | 1650 | if (PFM_IS_FILE(filp) == 0) { |
1650 | printk(KERN_ERR "perfmon: pfm_poll: bad magic [%d]\n", current->pid); | 1651 | printk(KERN_ERR "perfmon: pfm_poll: bad magic [%d]\n", task_pid_nr(current)); |
1651 | return 0; | 1652 | return 0; |
1652 | } | 1653 | } |
1653 | 1654 | ||
1654 | ctx = (pfm_context_t *)filp->private_data; | 1655 | ctx = (pfm_context_t *)filp->private_data; |
1655 | if (ctx == NULL) { | 1656 | if (ctx == NULL) { |
1656 | printk(KERN_ERR "perfmon: pfm_poll: NULL ctx [%d]\n", current->pid); | 1657 | printk(KERN_ERR "perfmon: pfm_poll: NULL ctx [%d]\n", task_pid_nr(current)); |
1657 | return 0; | 1658 | return 0; |
1658 | } | 1659 | } |
1659 | 1660 | ||
@@ -1692,7 +1693,7 @@ pfm_do_fasync(int fd, struct file *filp, pfm_context_t *ctx, int on) | |||
1692 | ret = fasync_helper (fd, filp, on, &ctx->ctx_async_queue); | 1693 | ret = fasync_helper (fd, filp, on, &ctx->ctx_async_queue); |
1693 | 1694 | ||
1694 | DPRINT(("pfm_fasync called by [%d] on ctx_fd=%d on=%d async_queue=%p ret=%d\n", | 1695 | DPRINT(("pfm_fasync called by [%d] on ctx_fd=%d on=%d async_queue=%p ret=%d\n", |
1695 | current->pid, | 1696 | task_pid_nr(current), |
1696 | fd, | 1697 | fd, |
1697 | on, | 1698 | on, |
1698 | ctx->ctx_async_queue, ret)); | 1699 | ctx->ctx_async_queue, ret)); |
@@ -1707,13 +1708,13 @@ pfm_fasync(int fd, struct file *filp, int on) | |||
1707 | int ret; | 1708 | int ret; |
1708 | 1709 | ||
1709 | if (PFM_IS_FILE(filp) == 0) { | 1710 | if (PFM_IS_FILE(filp) == 0) { |
1710 | printk(KERN_ERR "perfmon: pfm_fasync bad magic [%d]\n", current->pid); | 1711 | printk(KERN_ERR "perfmon: pfm_fasync bad magic [%d]\n", task_pid_nr(current)); |
1711 | return -EBADF; | 1712 | return -EBADF; |
1712 | } | 1713 | } |
1713 | 1714 | ||
1714 | ctx = (pfm_context_t *)filp->private_data; | 1715 | ctx = (pfm_context_t *)filp->private_data; |
1715 | if (ctx == NULL) { | 1716 | if (ctx == NULL) { |
1716 | printk(KERN_ERR "perfmon: pfm_fasync NULL ctx [%d]\n", current->pid); | 1717 | printk(KERN_ERR "perfmon: pfm_fasync NULL ctx [%d]\n", task_pid_nr(current)); |
1717 | return -EBADF; | 1718 | return -EBADF; |
1718 | } | 1719 | } |
1719 | /* | 1720 | /* |
@@ -1759,7 +1760,7 @@ pfm_syswide_force_stop(void *info) | |||
1759 | if (owner != ctx->ctx_task) { | 1760 | if (owner != ctx->ctx_task) { |
1760 | printk(KERN_ERR "perfmon: pfm_syswide_force_stop CPU%d unexpected owner [%d] instead of [%d]\n", | 1761 | printk(KERN_ERR "perfmon: pfm_syswide_force_stop CPU%d unexpected owner [%d] instead of [%d]\n", |
1761 | smp_processor_id(), | 1762 | smp_processor_id(), |
1762 | owner->pid, ctx->ctx_task->pid); | 1763 | task_pid_nr(owner), task_pid_nr(ctx->ctx_task)); |
1763 | return; | 1764 | return; |
1764 | } | 1765 | } |
1765 | if (GET_PMU_CTX() != ctx) { | 1766 | if (GET_PMU_CTX() != ctx) { |
@@ -1769,7 +1770,7 @@ pfm_syswide_force_stop(void *info) | |||
1769 | return; | 1770 | return; |
1770 | } | 1771 | } |
1771 | 1772 | ||
1772 | DPRINT(("on CPU%d forcing system wide stop for [%d]\n", smp_processor_id(), ctx->ctx_task->pid)); | 1773 | DPRINT(("on CPU%d forcing system wide stop for [%d]\n", smp_processor_id(), task_pid_nr(ctx->ctx_task))); |
1773 | /* | 1774 | /* |
1774 | * the context is already protected in pfm_close(), we simply | 1775 | * the context is already protected in pfm_close(), we simply |
1775 | * need to mask interrupts to avoid a PMU interrupt race on | 1776 | * need to mask interrupts to avoid a PMU interrupt race on |
@@ -1821,7 +1822,7 @@ pfm_flush(struct file *filp, fl_owner_t id) | |||
1821 | 1822 | ||
1822 | ctx = (pfm_context_t *)filp->private_data; | 1823 | ctx = (pfm_context_t *)filp->private_data; |
1823 | if (ctx == NULL) { | 1824 | if (ctx == NULL) { |
1824 | printk(KERN_ERR "perfmon: pfm_flush: NULL ctx [%d]\n", current->pid); | 1825 | printk(KERN_ERR "perfmon: pfm_flush: NULL ctx [%d]\n", task_pid_nr(current)); |
1825 | return -EBADF; | 1826 | return -EBADF; |
1826 | } | 1827 | } |
1827 | 1828 | ||
@@ -1969,7 +1970,7 @@ pfm_close(struct inode *inode, struct file *filp) | |||
1969 | 1970 | ||
1970 | ctx = (pfm_context_t *)filp->private_data; | 1971 | ctx = (pfm_context_t *)filp->private_data; |
1971 | if (ctx == NULL) { | 1972 | if (ctx == NULL) { |
1972 | printk(KERN_ERR "perfmon: pfm_close: NULL ctx [%d]\n", current->pid); | 1973 | printk(KERN_ERR "perfmon: pfm_close: NULL ctx [%d]\n", task_pid_nr(current)); |
1973 | return -EBADF; | 1974 | return -EBADF; |
1974 | } | 1975 | } |
1975 | 1976 | ||
@@ -2066,7 +2067,7 @@ pfm_close(struct inode *inode, struct file *filp) | |||
2066 | */ | 2067 | */ |
2067 | ctx->ctx_state = PFM_CTX_ZOMBIE; | 2068 | ctx->ctx_state = PFM_CTX_ZOMBIE; |
2068 | 2069 | ||
2069 | DPRINT(("zombie ctx for [%d]\n", task->pid)); | 2070 | DPRINT(("zombie ctx for [%d]\n", task_pid_nr(task))); |
2070 | /* | 2071 | /* |
2071 | * cannot free the context on the spot. deferred until | 2072 | * cannot free the context on the spot. deferred until |
2072 | * the task notices the ZOMBIE state | 2073 | * the task notices the ZOMBIE state |
@@ -2472,7 +2473,7 @@ pfm_setup_buffer_fmt(struct task_struct *task, struct file *filp, pfm_context_t | |||
2472 | /* invoke and lock buffer format, if found */ | 2473 | /* invoke and lock buffer format, if found */ |
2473 | fmt = pfm_find_buffer_fmt(arg->ctx_smpl_buf_id); | 2474 | fmt = pfm_find_buffer_fmt(arg->ctx_smpl_buf_id); |
2474 | if (fmt == NULL) { | 2475 | if (fmt == NULL) { |
2475 | DPRINT(("[%d] cannot find buffer format\n", task->pid)); | 2476 | DPRINT(("[%d] cannot find buffer format\n", task_pid_nr(task))); |
2476 | return -EINVAL; | 2477 | return -EINVAL; |
2477 | } | 2478 | } |
2478 | 2479 | ||
@@ -2483,7 +2484,7 @@ pfm_setup_buffer_fmt(struct task_struct *task, struct file *filp, pfm_context_t | |||
2483 | 2484 | ||
2484 | ret = pfm_buf_fmt_validate(fmt, task, ctx_flags, cpu, fmt_arg); | 2485 | ret = pfm_buf_fmt_validate(fmt, task, ctx_flags, cpu, fmt_arg); |
2485 | 2486 | ||
2486 | DPRINT(("[%d] after validate(0x%x,%d,%p)=%d\n", task->pid, ctx_flags, cpu, fmt_arg, ret)); | 2487 | DPRINT(("[%d] after validate(0x%x,%d,%p)=%d\n", task_pid_nr(task), ctx_flags, cpu, fmt_arg, ret)); |
2487 | 2488 | ||
2488 | if (ret) goto error; | 2489 | if (ret) goto error; |
2489 | 2490 | ||
@@ -2605,23 +2606,23 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task) | |||
2605 | * no kernel task or task not owner by caller | 2606 | * no kernel task or task not owner by caller |
2606 | */ | 2607 | */ |
2607 | if (task->mm == NULL) { | 2608 | if (task->mm == NULL) { |
2608 | DPRINT(("task [%d] has not memory context (kernel thread)\n", task->pid)); | 2609 | DPRINT(("task [%d] has not memory context (kernel thread)\n", task_pid_nr(task))); |
2609 | return -EPERM; | 2610 | return -EPERM; |
2610 | } | 2611 | } |
2611 | if (pfm_bad_permissions(task)) { | 2612 | if (pfm_bad_permissions(task)) { |
2612 | DPRINT(("no permission to attach to [%d]\n", task->pid)); | 2613 | DPRINT(("no permission to attach to [%d]\n", task_pid_nr(task))); |
2613 | return -EPERM; | 2614 | return -EPERM; |
2614 | } | 2615 | } |
2615 | /* | 2616 | /* |
2616 | * cannot block in self-monitoring mode | 2617 | * cannot block in self-monitoring mode |
2617 | */ | 2618 | */ |
2618 | if (CTX_OVFL_NOBLOCK(ctx) == 0 && task == current) { | 2619 | if (CTX_OVFL_NOBLOCK(ctx) == 0 && task == current) { |
2619 | DPRINT(("cannot load a blocking context on self for [%d]\n", task->pid)); | 2620 | DPRINT(("cannot load a blocking context on self for [%d]\n", task_pid_nr(task))); |
2620 | return -EINVAL; | 2621 | return -EINVAL; |
2621 | } | 2622 | } |
2622 | 2623 | ||
2623 | if (task->exit_state == EXIT_ZOMBIE) { | 2624 | if (task->exit_state == EXIT_ZOMBIE) { |
2624 | DPRINT(("cannot attach to zombie task [%d]\n", task->pid)); | 2625 | DPRINT(("cannot attach to zombie task [%d]\n", task_pid_nr(task))); |
2625 | return -EBUSY; | 2626 | return -EBUSY; |
2626 | } | 2627 | } |
2627 | 2628 | ||
@@ -2631,7 +2632,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task) | |||
2631 | if (task == current) return 0; | 2632 | if (task == current) return 0; |
2632 | 2633 | ||
2633 | if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { | 2634 | if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { |
2634 | DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task->pid, task->state)); | 2635 | DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task_pid_nr(task), task->state)); |
2635 | return -EBUSY; | 2636 | return -EBUSY; |
2636 | } | 2637 | } |
2637 | /* | 2638 | /* |
@@ -3512,7 +3513,7 @@ pfm_use_debug_registers(struct task_struct *task) | |||
3512 | 3513 | ||
3513 | if (pmu_conf->use_rr_dbregs == 0) return 0; | 3514 | if (pmu_conf->use_rr_dbregs == 0) return 0; |
3514 | 3515 | ||
3515 | DPRINT(("called for [%d]\n", task->pid)); | 3516 | DPRINT(("called for [%d]\n", task_pid_nr(task))); |
3516 | 3517 | ||
3517 | /* | 3518 | /* |
3518 | * do it only once | 3519 | * do it only once |
@@ -3543,7 +3544,7 @@ pfm_use_debug_registers(struct task_struct *task) | |||
3543 | DPRINT(("ptrace_use_dbregs=%u sys_use_dbregs=%u by [%d] ret = %d\n", | 3544 | DPRINT(("ptrace_use_dbregs=%u sys_use_dbregs=%u by [%d] ret = %d\n", |
3544 | pfm_sessions.pfs_ptrace_use_dbregs, | 3545 | pfm_sessions.pfs_ptrace_use_dbregs, |
3545 | pfm_sessions.pfs_sys_use_dbregs, | 3546 | pfm_sessions.pfs_sys_use_dbregs, |
3546 | task->pid, ret)); | 3547 | task_pid_nr(task), ret)); |
3547 | 3548 | ||
3548 | UNLOCK_PFS(flags); | 3549 | UNLOCK_PFS(flags); |
3549 | 3550 | ||
@@ -3568,7 +3569,7 @@ pfm_release_debug_registers(struct task_struct *task) | |||
3568 | 3569 | ||
3569 | LOCK_PFS(flags); | 3570 | LOCK_PFS(flags); |
3570 | if (pfm_sessions.pfs_ptrace_use_dbregs == 0) { | 3571 | if (pfm_sessions.pfs_ptrace_use_dbregs == 0) { |
3571 | printk(KERN_ERR "perfmon: invalid release for [%d] ptrace_use_dbregs=0\n", task->pid); | 3572 | printk(KERN_ERR "perfmon: invalid release for [%d] ptrace_use_dbregs=0\n", task_pid_nr(task)); |
3572 | ret = -1; | 3573 | ret = -1; |
3573 | } else { | 3574 | } else { |
3574 | pfm_sessions.pfs_ptrace_use_dbregs--; | 3575 | pfm_sessions.pfs_ptrace_use_dbregs--; |
@@ -3620,7 +3621,7 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
3620 | 3621 | ||
3621 | /* sanity check */ | 3622 | /* sanity check */ |
3622 | if (unlikely(task == NULL)) { | 3623 | if (unlikely(task == NULL)) { |
3623 | printk(KERN_ERR "perfmon: [%d] pfm_restart no task\n", current->pid); | 3624 | printk(KERN_ERR "perfmon: [%d] pfm_restart no task\n", task_pid_nr(current)); |
3624 | return -EINVAL; | 3625 | return -EINVAL; |
3625 | } | 3626 | } |
3626 | 3627 | ||
@@ -3629,7 +3630,7 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
3629 | fmt = ctx->ctx_buf_fmt; | 3630 | fmt = ctx->ctx_buf_fmt; |
3630 | 3631 | ||
3631 | DPRINT(("restarting self %d ovfl=0x%lx\n", | 3632 | DPRINT(("restarting self %d ovfl=0x%lx\n", |
3632 | task->pid, | 3633 | task_pid_nr(task), |
3633 | ctx->ctx_ovfl_regs[0])); | 3634 | ctx->ctx_ovfl_regs[0])); |
3634 | 3635 | ||
3635 | if (CTX_HAS_SMPL(ctx)) { | 3636 | if (CTX_HAS_SMPL(ctx)) { |
@@ -3653,11 +3654,11 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
3653 | pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_PMD_LONG_RESET); | 3654 | pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_PMD_LONG_RESET); |
3654 | 3655 | ||
3655 | if (rst_ctrl.bits.mask_monitoring == 0) { | 3656 | if (rst_ctrl.bits.mask_monitoring == 0) { |
3656 | DPRINT(("resuming monitoring for [%d]\n", task->pid)); | 3657 | DPRINT(("resuming monitoring for [%d]\n", task_pid_nr(task))); |
3657 | 3658 | ||
3658 | if (state == PFM_CTX_MASKED) pfm_restore_monitoring(task); | 3659 | if (state == PFM_CTX_MASKED) pfm_restore_monitoring(task); |
3659 | } else { | 3660 | } else { |
3660 | DPRINT(("keeping monitoring stopped for [%d]\n", task->pid)); | 3661 | DPRINT(("keeping monitoring stopped for [%d]\n", task_pid_nr(task))); |
3661 | 3662 | ||
3662 | // cannot use pfm_stop_monitoring(task, regs); | 3663 | // cannot use pfm_stop_monitoring(task, regs); |
3663 | } | 3664 | } |
@@ -3714,10 +3715,10 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
3714 | * "self-monitoring". | 3715 | * "self-monitoring". |
3715 | */ | 3716 | */ |
3716 | if (CTX_OVFL_NOBLOCK(ctx) == 0 && state == PFM_CTX_MASKED) { | 3717 | if (CTX_OVFL_NOBLOCK(ctx) == 0 && state == PFM_CTX_MASKED) { |
3717 | DPRINT(("unblocking [%d] \n", task->pid)); | 3718 | DPRINT(("unblocking [%d] \n", task_pid_nr(task))); |
3718 | complete(&ctx->ctx_restart_done); | 3719 | complete(&ctx->ctx_restart_done); |
3719 | } else { | 3720 | } else { |
3720 | DPRINT(("[%d] armed exit trap\n", task->pid)); | 3721 | DPRINT(("[%d] armed exit trap\n", task_pid_nr(task))); |
3721 | 3722 | ||
3722 | ctx->ctx_fl_trap_reason = PFM_TRAP_REASON_RESET; | 3723 | ctx->ctx_fl_trap_reason = PFM_TRAP_REASON_RESET; |
3723 | 3724 | ||
@@ -3805,7 +3806,7 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_ | |||
3805 | * don't bother if we are loaded and task is being debugged | 3806 | * don't bother if we are loaded and task is being debugged |
3806 | */ | 3807 | */ |
3807 | if (is_loaded && (thread->flags & IA64_THREAD_DBG_VALID) != 0) { | 3808 | if (is_loaded && (thread->flags & IA64_THREAD_DBG_VALID) != 0) { |
3808 | DPRINT(("debug registers already in use for [%d]\n", task->pid)); | 3809 | DPRINT(("debug registers already in use for [%d]\n", task_pid_nr(task))); |
3809 | return -EBUSY; | 3810 | return -EBUSY; |
3810 | } | 3811 | } |
3811 | 3812 | ||
@@ -3846,7 +3847,7 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_ | |||
3846 | * is shared by all processes running on it | 3847 | * is shared by all processes running on it |
3847 | */ | 3848 | */ |
3848 | if (first_time && can_access_pmu) { | 3849 | if (first_time && can_access_pmu) { |
3849 | DPRINT(("[%d] clearing ibrs, dbrs\n", task->pid)); | 3850 | DPRINT(("[%d] clearing ibrs, dbrs\n", task_pid_nr(task))); |
3850 | for (i=0; i < pmu_conf->num_ibrs; i++) { | 3851 | for (i=0; i < pmu_conf->num_ibrs; i++) { |
3851 | ia64_set_ibr(i, 0UL); | 3852 | ia64_set_ibr(i, 0UL); |
3852 | ia64_dv_serialize_instruction(); | 3853 | ia64_dv_serialize_instruction(); |
@@ -4035,7 +4036,7 @@ pfm_stop(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
4035 | return -EBUSY; | 4036 | return -EBUSY; |
4036 | } | 4037 | } |
4037 | DPRINT(("task [%d] ctx_state=%d is_system=%d\n", | 4038 | DPRINT(("task [%d] ctx_state=%d is_system=%d\n", |
4038 | PFM_CTX_TASK(ctx)->pid, | 4039 | task_pid_nr(PFM_CTX_TASK(ctx)), |
4039 | state, | 4040 | state, |
4040 | is_system)); | 4041 | is_system)); |
4041 | /* | 4042 | /* |
@@ -4093,7 +4094,7 @@ pfm_stop(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
4093 | * monitoring disabled in kernel at next reschedule | 4094 | * monitoring disabled in kernel at next reschedule |
4094 | */ | 4095 | */ |
4095 | ctx->ctx_saved_psr_up = 0; | 4096 | ctx->ctx_saved_psr_up = 0; |
4096 | DPRINT(("task=[%d]\n", task->pid)); | 4097 | DPRINT(("task=[%d]\n", task_pid_nr(task))); |
4097 | } | 4098 | } |
4098 | return 0; | 4099 | return 0; |
4099 | } | 4100 | } |
@@ -4298,11 +4299,12 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
4298 | 4299 | ||
4299 | if (is_system) { | 4300 | if (is_system) { |
4300 | if (pfm_sessions.pfs_ptrace_use_dbregs) { | 4301 | if (pfm_sessions.pfs_ptrace_use_dbregs) { |
4301 | DPRINT(("cannot load [%d] dbregs in use\n", task->pid)); | 4302 | DPRINT(("cannot load [%d] dbregs in use\n", |
4303 | task_pid_nr(task))); | ||
4302 | ret = -EBUSY; | 4304 | ret = -EBUSY; |
4303 | } else { | 4305 | } else { |
4304 | pfm_sessions.pfs_sys_use_dbregs++; | 4306 | pfm_sessions.pfs_sys_use_dbregs++; |
4305 | DPRINT(("load [%d] increased sys_use_dbreg=%u\n", task->pid, pfm_sessions.pfs_sys_use_dbregs)); | 4307 | DPRINT(("load [%d] increased sys_use_dbreg=%u\n", task_pid_nr(task), pfm_sessions.pfs_sys_use_dbregs)); |
4306 | set_dbregs = 1; | 4308 | set_dbregs = 1; |
4307 | } | 4309 | } |
4308 | } | 4310 | } |
@@ -4394,7 +4396,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
4394 | 4396 | ||
4395 | /* allow user level control */ | 4397 | /* allow user level control */ |
4396 | ia64_psr(regs)->sp = 0; | 4398 | ia64_psr(regs)->sp = 0; |
4397 | DPRINT(("clearing psr.sp for [%d]\n", task->pid)); | 4399 | DPRINT(("clearing psr.sp for [%d]\n", task_pid_nr(task))); |
4398 | 4400 | ||
4399 | SET_LAST_CPU(ctx, smp_processor_id()); | 4401 | SET_LAST_CPU(ctx, smp_processor_id()); |
4400 | INC_ACTIVATION(); | 4402 | INC_ACTIVATION(); |
@@ -4429,7 +4431,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
4429 | */ | 4431 | */ |
4430 | SET_PMU_OWNER(task, ctx); | 4432 | SET_PMU_OWNER(task, ctx); |
4431 | 4433 | ||
4432 | DPRINT(("context loaded on PMU for [%d]\n", task->pid)); | 4434 | DPRINT(("context loaded on PMU for [%d]\n", task_pid_nr(task))); |
4433 | } else { | 4435 | } else { |
4434 | /* | 4436 | /* |
4435 | * when not current, task MUST be stopped, so this is safe | 4437 | * when not current, task MUST be stopped, so this is safe |
@@ -4493,7 +4495,7 @@ pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg | |||
4493 | int prev_state, is_system; | 4495 | int prev_state, is_system; |
4494 | int ret; | 4496 | int ret; |
4495 | 4497 | ||
4496 | DPRINT(("ctx_state=%d task [%d]\n", ctx->ctx_state, task ? task->pid : -1)); | 4498 | DPRINT(("ctx_state=%d task [%d]\n", ctx->ctx_state, task ? task_pid_nr(task) : -1)); |
4497 | 4499 | ||
4498 | prev_state = ctx->ctx_state; | 4500 | prev_state = ctx->ctx_state; |
4499 | is_system = ctx->ctx_fl_system; | 4501 | is_system = ctx->ctx_fl_system; |
@@ -4568,7 +4570,7 @@ pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg | |||
4568 | */ | 4570 | */ |
4569 | ia64_psr(regs)->sp = 1; | 4571 | ia64_psr(regs)->sp = 1; |
4570 | 4572 | ||
4571 | DPRINT(("setting psr.sp for [%d]\n", task->pid)); | 4573 | DPRINT(("setting psr.sp for [%d]\n", task_pid_nr(task))); |
4572 | } | 4574 | } |
4573 | /* | 4575 | /* |
4574 | * save PMDs to context | 4576 | * save PMDs to context |
@@ -4608,7 +4610,7 @@ pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg | |||
4608 | ctx->ctx_fl_can_restart = 0; | 4610 | ctx->ctx_fl_can_restart = 0; |
4609 | ctx->ctx_fl_going_zombie = 0; | 4611 | ctx->ctx_fl_going_zombie = 0; |
4610 | 4612 | ||
4611 | DPRINT(("disconnected [%d] from context\n", task->pid)); | 4613 | DPRINT(("disconnected [%d] from context\n", task_pid_nr(task))); |
4612 | 4614 | ||
4613 | return 0; | 4615 | return 0; |
4614 | } | 4616 | } |
@@ -4631,7 +4633,7 @@ pfm_exit_thread(struct task_struct *task) | |||
4631 | 4633 | ||
4632 | PROTECT_CTX(ctx, flags); | 4634 | PROTECT_CTX(ctx, flags); |
4633 | 4635 | ||
4634 | DPRINT(("state=%d task [%d]\n", ctx->ctx_state, task->pid)); | 4636 | DPRINT(("state=%d task [%d]\n", ctx->ctx_state, task_pid_nr(task))); |
4635 | 4637 | ||
4636 | state = ctx->ctx_state; | 4638 | state = ctx->ctx_state; |
4637 | switch(state) { | 4639 | switch(state) { |
@@ -4640,13 +4642,13 @@ pfm_exit_thread(struct task_struct *task) | |||
4640 | * only comes to this function if pfm_context is not NULL, i.e., cannot | 4642 | * only comes to this function if pfm_context is not NULL, i.e., cannot |
4641 | * be in unloaded state | 4643 | * be in unloaded state |
4642 | */ | 4644 | */ |
4643 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid); | 4645 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task_pid_nr(task)); |
4644 | break; | 4646 | break; |
4645 | case PFM_CTX_LOADED: | 4647 | case PFM_CTX_LOADED: |
4646 | case PFM_CTX_MASKED: | 4648 | case PFM_CTX_MASKED: |
4647 | ret = pfm_context_unload(ctx, NULL, 0, regs); | 4649 | ret = pfm_context_unload(ctx, NULL, 0, regs); |
4648 | if (ret) { | 4650 | if (ret) { |
4649 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] state=%d unload failed %d\n", task->pid, state, ret); | 4651 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] state=%d unload failed %d\n", task_pid_nr(task), state, ret); |
4650 | } | 4652 | } |
4651 | DPRINT(("ctx unloaded for current state was %d\n", state)); | 4653 | DPRINT(("ctx unloaded for current state was %d\n", state)); |
4652 | 4654 | ||
@@ -4655,12 +4657,12 @@ pfm_exit_thread(struct task_struct *task) | |||
4655 | case PFM_CTX_ZOMBIE: | 4657 | case PFM_CTX_ZOMBIE: |
4656 | ret = pfm_context_unload(ctx, NULL, 0, regs); | 4658 | ret = pfm_context_unload(ctx, NULL, 0, regs); |
4657 | if (ret) { | 4659 | if (ret) { |
4658 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] state=%d unload failed %d\n", task->pid, state, ret); | 4660 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] state=%d unload failed %d\n", task_pid_nr(task), state, ret); |
4659 | } | 4661 | } |
4660 | free_ok = 1; | 4662 | free_ok = 1; |
4661 | break; | 4663 | break; |
4662 | default: | 4664 | default: |
4663 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] unexpected state=%d\n", task->pid, state); | 4665 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] unexpected state=%d\n", task_pid_nr(task), state); |
4664 | break; | 4666 | break; |
4665 | } | 4667 | } |
4666 | UNPROTECT_CTX(ctx, flags); | 4668 | UNPROTECT_CTX(ctx, flags); |
@@ -4744,7 +4746,7 @@ recheck: | |||
4744 | DPRINT(("context %d state=%d [%d] task_state=%ld must_stop=%d\n", | 4746 | DPRINT(("context %d state=%d [%d] task_state=%ld must_stop=%d\n", |
4745 | ctx->ctx_fd, | 4747 | ctx->ctx_fd, |
4746 | state, | 4748 | state, |
4747 | task->pid, | 4749 | task_pid_nr(task), |
4748 | task->state, PFM_CMD_STOPPED(cmd))); | 4750 | task->state, PFM_CMD_STOPPED(cmd))); |
4749 | 4751 | ||
4750 | /* | 4752 | /* |
@@ -4791,7 +4793,7 @@ recheck: | |||
4791 | */ | 4793 | */ |
4792 | if (PFM_CMD_STOPPED(cmd)) { | 4794 | if (PFM_CMD_STOPPED(cmd)) { |
4793 | if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { | 4795 | if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { |
4794 | DPRINT(("[%d] task not in stopped state\n", task->pid)); | 4796 | DPRINT(("[%d] task not in stopped state\n", task_pid_nr(task))); |
4795 | return -EBUSY; | 4797 | return -EBUSY; |
4796 | } | 4798 | } |
4797 | /* | 4799 | /* |
@@ -4884,7 +4886,7 @@ restart_args: | |||
4884 | * limit abuse to min page size | 4886 | * limit abuse to min page size |
4885 | */ | 4887 | */ |
4886 | if (unlikely(sz > PFM_MAX_ARGSIZE)) { | 4888 | if (unlikely(sz > PFM_MAX_ARGSIZE)) { |
4887 | printk(KERN_ERR "perfmon: [%d] argument too big %lu\n", current->pid, sz); | 4889 | printk(KERN_ERR "perfmon: [%d] argument too big %lu\n", task_pid_nr(current), sz); |
4888 | return -E2BIG; | 4890 | return -E2BIG; |
4889 | } | 4891 | } |
4890 | 4892 | ||
@@ -5031,11 +5033,11 @@ pfm_context_force_terminate(pfm_context_t *ctx, struct pt_regs *regs) | |||
5031 | { | 5033 | { |
5032 | int ret; | 5034 | int ret; |
5033 | 5035 | ||
5034 | DPRINT(("entering for [%d]\n", current->pid)); | 5036 | DPRINT(("entering for [%d]\n", task_pid_nr(current))); |
5035 | 5037 | ||
5036 | ret = pfm_context_unload(ctx, NULL, 0, regs); | 5038 | ret = pfm_context_unload(ctx, NULL, 0, regs); |
5037 | if (ret) { | 5039 | if (ret) { |
5038 | printk(KERN_ERR "pfm_context_force_terminate: [%d] unloaded failed with %d\n", current->pid, ret); | 5040 | printk(KERN_ERR "pfm_context_force_terminate: [%d] unloaded failed with %d\n", task_pid_nr(current), ret); |
5039 | } | 5041 | } |
5040 | 5042 | ||
5041 | /* | 5043 | /* |
@@ -5072,7 +5074,7 @@ pfm_handle_work(void) | |||
5072 | 5074 | ||
5073 | ctx = PFM_GET_CTX(current); | 5075 | ctx = PFM_GET_CTX(current); |
5074 | if (ctx == NULL) { | 5076 | if (ctx == NULL) { |
5075 | printk(KERN_ERR "perfmon: [%d] has no PFM context\n", current->pid); | 5077 | printk(KERN_ERR "perfmon: [%d] has no PFM context\n", task_pid_nr(current)); |
5076 | return; | 5078 | return; |
5077 | } | 5079 | } |
5078 | 5080 | ||
@@ -5269,7 +5271,7 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str | |||
5269 | DPRINT_ovfl(("pmc0=0x%lx pid=%d iip=0x%lx, %s " | 5271 | DPRINT_ovfl(("pmc0=0x%lx pid=%d iip=0x%lx, %s " |
5270 | "used_pmds=0x%lx\n", | 5272 | "used_pmds=0x%lx\n", |
5271 | pmc0, | 5273 | pmc0, |
5272 | task ? task->pid: -1, | 5274 | task ? task_pid_nr(task): -1, |
5273 | (regs ? regs->cr_iip : 0), | 5275 | (regs ? regs->cr_iip : 0), |
5274 | CTX_OVFL_NOBLOCK(ctx) ? "nonblocking" : "blocking", | 5276 | CTX_OVFL_NOBLOCK(ctx) ? "nonblocking" : "blocking", |
5275 | ctx->ctx_used_pmds[0])); | 5277 | ctx->ctx_used_pmds[0])); |
@@ -5458,7 +5460,7 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str | |||
5458 | } | 5460 | } |
5459 | 5461 | ||
5460 | DPRINT_ovfl(("owner [%d] pending=%ld reason=%u ovfl_pmds=0x%lx ovfl_notify=0x%lx masked=%d\n", | 5462 | DPRINT_ovfl(("owner [%d] pending=%ld reason=%u ovfl_pmds=0x%lx ovfl_notify=0x%lx masked=%d\n", |
5461 | GET_PMU_OWNER() ? GET_PMU_OWNER()->pid : -1, | 5463 | GET_PMU_OWNER() ? task_pid_nr(GET_PMU_OWNER()) : -1, |
5462 | PFM_GET_WORK_PENDING(task), | 5464 | PFM_GET_WORK_PENDING(task), |
5463 | ctx->ctx_fl_trap_reason, | 5465 | ctx->ctx_fl_trap_reason, |
5464 | ovfl_pmds, | 5466 | ovfl_pmds, |
@@ -5483,7 +5485,7 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str | |||
5483 | sanity_check: | 5485 | sanity_check: |
5484 | printk(KERN_ERR "perfmon: CPU%d overflow handler [%d] pmc0=0x%lx\n", | 5486 | printk(KERN_ERR "perfmon: CPU%d overflow handler [%d] pmc0=0x%lx\n", |
5485 | smp_processor_id(), | 5487 | smp_processor_id(), |
5486 | task ? task->pid : -1, | 5488 | task ? task_pid_nr(task) : -1, |
5487 | pmc0); | 5489 | pmc0); |
5488 | return; | 5490 | return; |
5489 | 5491 | ||
@@ -5516,7 +5518,7 @@ stop_monitoring: | |||
5516 | * | 5518 | * |
5517 | * Overall pretty hairy stuff.... | 5519 | * Overall pretty hairy stuff.... |
5518 | */ | 5520 | */ |
5519 | DPRINT(("ctx is zombie for [%d], converted to spurious\n", task ? task->pid: -1)); | 5521 | DPRINT(("ctx is zombie for [%d], converted to spurious\n", task ? task_pid_nr(task): -1)); |
5520 | pfm_clear_psr_up(); | 5522 | pfm_clear_psr_up(); |
5521 | ia64_psr(regs)->up = 0; | 5523 | ia64_psr(regs)->up = 0; |
5522 | ia64_psr(regs)->sp = 1; | 5524 | ia64_psr(regs)->sp = 1; |
@@ -5577,13 +5579,13 @@ pfm_do_interrupt_handler(int irq, void *arg, struct pt_regs *regs) | |||
5577 | 5579 | ||
5578 | report_spurious1: | 5580 | report_spurious1: |
5579 | printk(KERN_INFO "perfmon: spurious overflow interrupt on CPU%d: process %d has no PFM context\n", | 5581 | printk(KERN_INFO "perfmon: spurious overflow interrupt on CPU%d: process %d has no PFM context\n", |
5580 | this_cpu, task->pid); | 5582 | this_cpu, task_pid_nr(task)); |
5581 | pfm_unfreeze_pmu(); | 5583 | pfm_unfreeze_pmu(); |
5582 | return -1; | 5584 | return -1; |
5583 | report_spurious2: | 5585 | report_spurious2: |
5584 | printk(KERN_INFO "perfmon: spurious overflow interrupt on CPU%d: process %d, invalid flag\n", | 5586 | printk(KERN_INFO "perfmon: spurious overflow interrupt on CPU%d: process %d, invalid flag\n", |
5585 | this_cpu, | 5587 | this_cpu, |
5586 | task->pid); | 5588 | task_pid_nr(task)); |
5587 | pfm_unfreeze_pmu(); | 5589 | pfm_unfreeze_pmu(); |
5588 | return -1; | 5590 | return -1; |
5589 | } | 5591 | } |
@@ -5870,7 +5872,8 @@ pfm_force_cleanup(pfm_context_t *ctx, struct pt_regs *regs) | |||
5870 | ia64_psr(regs)->sp = 1; | 5872 | ia64_psr(regs)->sp = 1; |
5871 | 5873 | ||
5872 | if (GET_PMU_OWNER() == task) { | 5874 | if (GET_PMU_OWNER() == task) { |
5873 | DPRINT(("cleared ownership for [%d]\n", ctx->ctx_task->pid)); | 5875 | DPRINT(("cleared ownership for [%d]\n", |
5876 | task_pid_nr(ctx->ctx_task))); | ||
5874 | SET_PMU_OWNER(NULL, NULL); | 5877 | SET_PMU_OWNER(NULL, NULL); |
5875 | } | 5878 | } |
5876 | 5879 | ||
@@ -5882,7 +5885,7 @@ pfm_force_cleanup(pfm_context_t *ctx, struct pt_regs *regs) | |||
5882 | task->thread.pfm_context = NULL; | 5885 | task->thread.pfm_context = NULL; |
5883 | task->thread.flags &= ~IA64_THREAD_PM_VALID; | 5886 | task->thread.flags &= ~IA64_THREAD_PM_VALID; |
5884 | 5887 | ||
5885 | DPRINT(("force cleanup for [%d]\n", task->pid)); | 5888 | DPRINT(("force cleanup for [%d]\n", task_pid_nr(task))); |
5886 | } | 5889 | } |
5887 | 5890 | ||
5888 | 5891 | ||
@@ -6426,7 +6429,7 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx) | |||
6426 | 6429 | ||
6427 | if (PMD_IS_COUNTING(i)) { | 6430 | if (PMD_IS_COUNTING(i)) { |
6428 | DPRINT(("[%d] pmd[%d] ctx_pmd=0x%lx hw_pmd=0x%lx\n", | 6431 | DPRINT(("[%d] pmd[%d] ctx_pmd=0x%lx hw_pmd=0x%lx\n", |
6429 | task->pid, | 6432 | task_pid_nr(task), |
6430 | i, | 6433 | i, |
6431 | ctx->ctx_pmds[i].val, | 6434 | ctx->ctx_pmds[i].val, |
6432 | val & ovfl_val)); | 6435 | val & ovfl_val)); |
@@ -6448,11 +6451,11 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx) | |||
6448 | */ | 6451 | */ |
6449 | if (pmc0 & (1UL << i)) { | 6452 | if (pmc0 & (1UL << i)) { |
6450 | val += 1 + ovfl_val; | 6453 | val += 1 + ovfl_val; |
6451 | DPRINT(("[%d] pmd[%d] overflowed\n", task->pid, i)); | 6454 | DPRINT(("[%d] pmd[%d] overflowed\n", task_pid_nr(task), i)); |
6452 | } | 6455 | } |
6453 | } | 6456 | } |
6454 | 6457 | ||
6455 | DPRINT(("[%d] ctx_pmd[%d]=0x%lx pmd_val=0x%lx\n", task->pid, i, val, pmd_val)); | 6458 | DPRINT(("[%d] ctx_pmd[%d]=0x%lx pmd_val=0x%lx\n", task_pid_nr(task), i, val, pmd_val)); |
6456 | 6459 | ||
6457 | if (is_self) ctx->th_pmds[i] = pmd_val; | 6460 | if (is_self) ctx->th_pmds[i] = pmd_val; |
6458 | 6461 | ||
@@ -6793,14 +6796,14 @@ dump_pmu_state(const char *from) | |||
6793 | printk("CPU%d from %s() current [%d] iip=0x%lx %s\n", | 6796 | printk("CPU%d from %s() current [%d] iip=0x%lx %s\n", |
6794 | this_cpu, | 6797 | this_cpu, |
6795 | from, | 6798 | from, |
6796 | current->pid, | 6799 | task_pid_nr(current), |
6797 | regs->cr_iip, | 6800 | regs->cr_iip, |
6798 | current->comm); | 6801 | current->comm); |
6799 | 6802 | ||
6800 | task = GET_PMU_OWNER(); | 6803 | task = GET_PMU_OWNER(); |
6801 | ctx = GET_PMU_CTX(); | 6804 | ctx = GET_PMU_CTX(); |
6802 | 6805 | ||
6803 | printk("->CPU%d owner [%d] ctx=%p\n", this_cpu, task ? task->pid : -1, ctx); | 6806 | printk("->CPU%d owner [%d] ctx=%p\n", this_cpu, task ? task_pid_nr(task) : -1, ctx); |
6804 | 6807 | ||
6805 | psr = pfm_get_psr(); | 6808 | psr = pfm_get_psr(); |
6806 | 6809 | ||
@@ -6848,7 +6851,7 @@ pfm_inherit(struct task_struct *task, struct pt_regs *regs) | |||
6848 | { | 6851 | { |
6849 | struct thread_struct *thread; | 6852 | struct thread_struct *thread; |
6850 | 6853 | ||
6851 | DPRINT(("perfmon: pfm_inherit clearing state for [%d]\n", task->pid)); | 6854 | DPRINT(("perfmon: pfm_inherit clearing state for [%d]\n", task_pid_nr(task))); |
6852 | 6855 | ||
6853 | thread = &task->thread; | 6856 | thread = &task->thread; |
6854 | 6857 | ||
diff --git a/arch/ia64/kernel/perfmon_default_smpl.c b/arch/ia64/kernel/perfmon_default_smpl.c index ff80eab83b..a7af1cb419 100644 --- a/arch/ia64/kernel/perfmon_default_smpl.c +++ b/arch/ia64/kernel/perfmon_default_smpl.c | |||
@@ -44,11 +44,11 @@ default_validate(struct task_struct *task, unsigned int flags, int cpu, void *da | |||
44 | int ret = 0; | 44 | int ret = 0; |
45 | 45 | ||
46 | if (data == NULL) { | 46 | if (data == NULL) { |
47 | DPRINT(("[%d] no argument passed\n", task->pid)); | 47 | DPRINT(("[%d] no argument passed\n", task_pid_nr(task))); |
48 | return -EINVAL; | 48 | return -EINVAL; |
49 | } | 49 | } |
50 | 50 | ||
51 | DPRINT(("[%d] validate flags=0x%x CPU%d\n", task->pid, flags, cpu)); | 51 | DPRINT(("[%d] validate flags=0x%x CPU%d\n", task_pid_nr(task), flags, cpu)); |
52 | 52 | ||
53 | /* | 53 | /* |
54 | * must hold at least the buffer header + one minimally sized entry | 54 | * must hold at least the buffer header + one minimally sized entry |
@@ -88,7 +88,7 @@ default_init(struct task_struct *task, void *buf, unsigned int flags, int cpu, v | |||
88 | hdr->hdr_count = 0UL; | 88 | hdr->hdr_count = 0UL; |
89 | 89 | ||
90 | DPRINT(("[%d] buffer=%p buf_size=%lu hdr_size=%lu hdr_version=%u cur_offs=%lu\n", | 90 | DPRINT(("[%d] buffer=%p buf_size=%lu hdr_size=%lu hdr_version=%u cur_offs=%lu\n", |
91 | task->pid, | 91 | task_pid_nr(task), |
92 | buf, | 92 | buf, |
93 | hdr->hdr_buf_size, | 93 | hdr->hdr_buf_size, |
94 | sizeof(*hdr), | 94 | sizeof(*hdr), |
@@ -245,7 +245,7 @@ default_restart(struct task_struct *task, pfm_ovfl_ctrl_t *ctrl, void *buf, stru | |||
245 | static int | 245 | static int |
246 | default_exit(struct task_struct *task, void *buf, struct pt_regs *regs) | 246 | default_exit(struct task_struct *task, void *buf, struct pt_regs *regs) |
247 | { | 247 | { |
248 | DPRINT(("[%d] exit(%p)\n", task->pid, buf)); | 248 | DPRINT(("[%d] exit(%p)\n", task_pid_nr(task), buf)); |
249 | return 0; | 249 | return 0; |
250 | } | 250 | } |
251 | 251 | ||
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index c613fc0e91..2418289ee5 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -105,7 +105,8 @@ show_regs (struct pt_regs *regs) | |||
105 | unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri; | 105 | unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri; |
106 | 106 | ||
107 | print_modules(); | 107 | print_modules(); |
108 | printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm); | 108 | printk("\nPid: %d, CPU %d, comm: %20s\n", task_pid_nr(current), |
109 | smp_processor_id(), current->comm); | ||
109 | printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s\n", | 110 | printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s\n", |
110 | regs->cr_ipsr, regs->cr_ifs, ip, print_tainted()); | 111 | regs->cr_ipsr, regs->cr_ifs, ip, print_tainted()); |
111 | print_symbol("ip is at %s\n", ip); | 112 | print_symbol("ip is at %s\n", ip); |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index c5cfcfa4c8..cbf67f1aa2 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -208,6 +208,48 @@ static int __init register_memory(void) | |||
208 | 208 | ||
209 | __initcall(register_memory); | 209 | __initcall(register_memory); |
210 | 210 | ||
211 | |||
212 | #ifdef CONFIG_KEXEC | ||
213 | static void __init setup_crashkernel(unsigned long total, int *n) | ||
214 | { | ||
215 | unsigned long long base = 0, size = 0; | ||
216 | int ret; | ||
217 | |||
218 | ret = parse_crashkernel(boot_command_line, total, | ||
219 | &size, &base); | ||
220 | if (ret == 0 && size > 0) { | ||
221 | if (!base) { | ||
222 | sort_regions(rsvd_region, *n); | ||
223 | base = kdump_find_rsvd_region(size, | ||
224 | rsvd_region, *n); | ||
225 | } | ||
226 | if (base != ~0UL) { | ||
227 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
228 | "for crashkernel (System RAM: %ldMB)\n", | ||
229 | (unsigned long)(size >> 20), | ||
230 | (unsigned long)(base >> 20), | ||
231 | (unsigned long)(total >> 20)); | ||
232 | rsvd_region[*n].start = | ||
233 | (unsigned long)__va(base); | ||
234 | rsvd_region[*n].end = | ||
235 | (unsigned long)__va(base + size); | ||
236 | (*n)++; | ||
237 | crashk_res.start = base; | ||
238 | crashk_res.end = base + size - 1; | ||
239 | } | ||
240 | } | ||
241 | efi_memmap_res.start = ia64_boot_param->efi_memmap; | ||
242 | efi_memmap_res.end = efi_memmap_res.start + | ||
243 | ia64_boot_param->efi_memmap_size; | ||
244 | boot_param_res.start = __pa(ia64_boot_param); | ||
245 | boot_param_res.end = boot_param_res.start + | ||
246 | sizeof(*ia64_boot_param); | ||
247 | } | ||
248 | #else | ||
249 | static inline void __init setup_crashkernel(unsigned long total, int *n) | ||
250 | {} | ||
251 | #endif | ||
252 | |||
211 | /** | 253 | /** |
212 | * reserve_memory - setup reserved memory areas | 254 | * reserve_memory - setup reserved memory areas |
213 | * | 255 | * |
@@ -219,6 +261,7 @@ void __init | |||
219 | reserve_memory (void) | 261 | reserve_memory (void) |
220 | { | 262 | { |
221 | int n = 0; | 263 | int n = 0; |
264 | unsigned long total_memory; | ||
222 | 265 | ||
223 | /* | 266 | /* |
224 | * none of the entries in this table overlap | 267 | * none of the entries in this table overlap |
@@ -254,50 +297,11 @@ reserve_memory (void) | |||
254 | n++; | 297 | n++; |
255 | #endif | 298 | #endif |
256 | 299 | ||
257 | efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end); | 300 | total_memory = efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end); |
258 | n++; | 301 | n++; |
259 | 302 | ||
260 | #ifdef CONFIG_KEXEC | 303 | setup_crashkernel(total_memory, &n); |
261 | /* crashkernel=size@offset specifies the size to reserve for a crash | 304 | |
262 | * kernel. If offset is 0, then it is determined automatically. | ||
263 | * By reserving this memory we guarantee that linux never set's it | ||
264 | * up as a DMA target.Useful for holding code to do something | ||
265 | * appropriate after a kernel panic. | ||
266 | */ | ||
267 | { | ||
268 | char *from = strstr(boot_command_line, "crashkernel="); | ||
269 | unsigned long base, size; | ||
270 | if (from) { | ||
271 | size = memparse(from + 12, &from); | ||
272 | if (*from == '@') | ||
273 | base = memparse(from+1, &from); | ||
274 | else | ||
275 | base = 0; | ||
276 | if (size) { | ||
277 | if (!base) { | ||
278 | sort_regions(rsvd_region, n); | ||
279 | base = kdump_find_rsvd_region(size, | ||
280 | rsvd_region, n); | ||
281 | } | ||
282 | if (base != ~0UL) { | ||
283 | rsvd_region[n].start = | ||
284 | (unsigned long)__va(base); | ||
285 | rsvd_region[n].end = | ||
286 | (unsigned long)__va(base + size); | ||
287 | n++; | ||
288 | crashk_res.start = base; | ||
289 | crashk_res.end = base + size - 1; | ||
290 | } | ||
291 | } | ||
292 | } | ||
293 | efi_memmap_res.start = ia64_boot_param->efi_memmap; | ||
294 | efi_memmap_res.end = efi_memmap_res.start + | ||
295 | ia64_boot_param->efi_memmap_size; | ||
296 | boot_param_res.start = __pa(ia64_boot_param); | ||
297 | boot_param_res.end = boot_param_res.start + | ||
298 | sizeof(*ia64_boot_param); | ||
299 | } | ||
300 | #endif | ||
301 | /* end of memory marker */ | 305 | /* end of memory marker */ |
302 | rsvd_region[n].start = ~0UL; | 306 | rsvd_region[n].start = ~0UL; |
303 | rsvd_region[n].end = ~0UL; | 307 | rsvd_region[n].end = ~0UL; |
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index aeec8184e8..cdb64cc4d9 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -227,7 +227,7 @@ ia64_rt_sigreturn (struct sigscratch *scr) | |||
227 | si.si_signo = SIGSEGV; | 227 | si.si_signo = SIGSEGV; |
228 | si.si_errno = 0; | 228 | si.si_errno = 0; |
229 | si.si_code = SI_KERNEL; | 229 | si.si_code = SI_KERNEL; |
230 | si.si_pid = current->pid; | 230 | si.si_pid = task_pid_vnr(current); |
231 | si.si_uid = current->uid; | 231 | si.si_uid = current->uid; |
232 | si.si_addr = sc; | 232 | si.si_addr = sc; |
233 | force_sig_info(SIGSEGV, &si, current); | 233 | force_sig_info(SIGSEGV, &si, current); |
@@ -332,7 +332,7 @@ force_sigsegv_info (int sig, void __user *addr) | |||
332 | si.si_signo = SIGSEGV; | 332 | si.si_signo = SIGSEGV; |
333 | si.si_errno = 0; | 333 | si.si_errno = 0; |
334 | si.si_code = SI_KERNEL; | 334 | si.si_code = SI_KERNEL; |
335 | si.si_pid = current->pid; | 335 | si.si_pid = task_pid_vnr(current); |
336 | si.si_uid = current->uid; | 336 | si.si_uid = current->uid; |
337 | si.si_addr = addr; | 337 | si.si_addr = addr; |
338 | force_sig_info(SIGSEGV, &si, current); | 338 | force_sig_info(SIGSEGV, &si, current); |
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index 3aeaf15e46..78d65cb947 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c | |||
@@ -61,7 +61,7 @@ die (const char *str, struct pt_regs *regs, long err) | |||
61 | 61 | ||
62 | if (++die.lock_owner_depth < 3) { | 62 | if (++die.lock_owner_depth < 3) { |
63 | printk("%s[%d]: %s %ld [%d]\n", | 63 | printk("%s[%d]: %s %ld [%d]\n", |
64 | current->comm, current->pid, str, err, ++die_counter); | 64 | current->comm, task_pid_nr(current), str, err, ++die_counter); |
65 | (void) notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); | 65 | (void) notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); |
66 | show_regs(regs); | 66 | show_regs(regs); |
67 | } else | 67 | } else |
@@ -315,7 +315,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr) | |||
315 | last.time = current_jiffies + 5 * HZ; | 315 | last.time = current_jiffies + 5 * HZ; |
316 | printk(KERN_WARNING | 316 | printk(KERN_WARNING |
317 | "%s(%d): floating-point assist fault at ip %016lx, isr %016lx\n", | 317 | "%s(%d): floating-point assist fault at ip %016lx, isr %016lx\n", |
318 | current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri, isr); | 318 | current->comm, task_pid_nr(current), regs->cr_iip + ia64_psr(regs)->ri, isr); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | } | 321 | } |
@@ -453,7 +453,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, | |||
453 | if (code == 8) { | 453 | if (code == 8) { |
454 | # ifdef CONFIG_IA64_PRINT_HAZARDS | 454 | # ifdef CONFIG_IA64_PRINT_HAZARDS |
455 | printk("%s[%d]: possible hazard @ ip=%016lx (pr = %016lx)\n", | 455 | printk("%s[%d]: possible hazard @ ip=%016lx (pr = %016lx)\n", |
456 | current->comm, current->pid, | 456 | current->comm, task_pid_nr(current), |
457 | regs.cr_iip + ia64_psr(®s)->ri, regs.pr); | 457 | regs.cr_iip + ia64_psr(®s)->ri, regs.pr); |
458 | # endif | 458 | # endif |
459 | return; | 459 | return; |
diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c index fe6aa5a9f8..2173de9fe9 100644 --- a/arch/ia64/kernel/unaligned.c +++ b/arch/ia64/kernel/unaligned.c | |||
@@ -1340,7 +1340,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) | |||
1340 | size_t len; | 1340 | size_t len; |
1341 | 1341 | ||
1342 | len = sprintf(buf, "%s(%d): unaligned access to 0x%016lx, " | 1342 | len = sprintf(buf, "%s(%d): unaligned access to 0x%016lx, " |
1343 | "ip=0x%016lx\n\r", current->comm, current->pid, | 1343 | "ip=0x%016lx\n\r", current->comm, |
1344 | task_pid_nr(current), | ||
1344 | ifa, regs->cr_iip + ipsr->ri); | 1345 | ifa, regs->cr_iip + ipsr->ri); |
1345 | /* | 1346 | /* |
1346 | * Don't call tty_write_message() if we're in the kernel; we might | 1347 | * Don't call tty_write_message() if we're in the kernel; we might |
@@ -1363,7 +1364,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) | |||
1363 | "administrator\n" | 1364 | "administrator\n" |
1364 | "echo 0 > /proc/sys/kernel/ignore-" | 1365 | "echo 0 > /proc/sys/kernel/ignore-" |
1365 | "unaligned-usertrap to re-enable\n", | 1366 | "unaligned-usertrap to re-enable\n", |
1366 | current->comm, current->pid); | 1367 | current->comm, task_pid_nr(current)); |
1367 | } | 1368 | } |
1368 | } | 1369 | } |
1369 | } else { | 1370 | } else { |
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index 32f26253c4..7571076a16 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c | |||
@@ -274,7 +274,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re | |||
274 | 274 | ||
275 | out_of_memory: | 275 | out_of_memory: |
276 | up_read(&mm->mmap_sem); | 276 | up_read(&mm->mmap_sem); |
277 | if (is_init(current)) { | 277 | if (is_global_init(current)) { |
278 | yield(); | 278 | yield(); |
279 | down_read(&mm->mmap_sem); | 279 | down_read(&mm->mmap_sem); |
280 | goto survive; | 280 | goto survive; |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 3e10152abb..c6c19bf11b 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -127,8 +127,8 @@ ia64_init_addr_space (void) | |||
127 | vma->vm_mm = current->mm; | 127 | vma->vm_mm = current->mm; |
128 | vma->vm_start = current->thread.rbs_bot & PAGE_MASK; | 128 | vma->vm_start = current->thread.rbs_bot & PAGE_MASK; |
129 | vma->vm_end = vma->vm_start + PAGE_SIZE; | 129 | vma->vm_end = vma->vm_start + PAGE_SIZE; |
130 | vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7]; | ||
131 | vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT; | 130 | vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT; |
131 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); | ||
132 | down_write(¤t->mm->mmap_sem); | 132 | down_write(¤t->mm->mmap_sem); |
133 | if (insert_vm_struct(current->mm, vma)) { | 133 | if (insert_vm_struct(current->mm, vma)) { |
134 | up_write(¤t->mm->mmap_sem); | 134 | up_write(¤t->mm->mmap_sem); |
diff --git a/arch/ia64/oprofile/Kconfig b/arch/ia64/oprofile/Kconfig deleted file mode 100644 index 97271ab484..0000000000 --- a/arch/ia64/oprofile/Kconfig +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | config PROFILING | ||
2 | bool "Profiling support (EXPERIMENTAL)" | ||
3 | help | ||
4 | Say Y here to enable the extended profiling support mechanisms used | ||
5 | by profilers such as OProfile. | ||
6 | |||
7 | config OPROFILE | ||
8 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
9 | depends on PROFILING | ||
10 | help | ||
11 | OProfile is a profiling system capable of profiling the | ||
12 | whole system, include the kernel, kernel modules, libraries, | ||
13 | and applications. | ||
14 | |||
15 | Due to firmware bugs, you may need to use the "nohalt" boot | ||
16 | option if you're using OProfile with the hardware performance | ||
17 | counters. | ||
18 | |||
19 | If unsure, say N. | ||
20 | |||
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index bd5fe76401..ab9a264cb1 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig | |||
@@ -426,7 +426,7 @@ source "drivers/Kconfig" | |||
426 | 426 | ||
427 | source "fs/Kconfig" | 427 | source "fs/Kconfig" |
428 | 428 | ||
429 | source "arch/m32r/oprofile/Kconfig" | 429 | source "kernel/Kconfig.instrumentation" |
430 | 430 | ||
431 | source "arch/m32r/Kconfig.debug" | 431 | source "arch/m32r/Kconfig.debug" |
432 | 432 | ||
diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c index 97e0b1c083..89ba4a0b5d 100644 --- a/arch/m32r/kernel/traps.c +++ b/arch/m32r/kernel/traps.c | |||
@@ -196,7 +196,7 @@ static void show_registers(struct pt_regs *regs) | |||
196 | printk("SPI: %08lx\n", sp); | 196 | printk("SPI: %08lx\n", sp); |
197 | } | 197 | } |
198 | printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)", | 198 | printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)", |
199 | current->comm, current->pid, 0xffff & i, 4096+(unsigned long)current); | 199 | current->comm, task_pid_nr(current), 0xffff & i, 4096+(unsigned long)current); |
200 | 200 | ||
201 | /* | 201 | /* |
202 | * When in-kernel, we also print out the stack and code at the | 202 | * When in-kernel, we also print out the stack and code at the |
diff --git a/arch/m32r/mm/fault.c b/arch/m32r/mm/fault.c index 70a766aad3..4a71df4c1b 100644 --- a/arch/m32r/mm/fault.c +++ b/arch/m32r/mm/fault.c | |||
@@ -271,7 +271,7 @@ no_context: | |||
271 | */ | 271 | */ |
272 | out_of_memory: | 272 | out_of_memory: |
273 | up_read(&mm->mmap_sem); | 273 | up_read(&mm->mmap_sem); |
274 | if (is_init(tsk)) { | 274 | if (is_global_init(tsk)) { |
275 | yield(); | 275 | yield(); |
276 | down_read(&mm->mmap_sem); | 276 | down_read(&mm->mmap_sem); |
277 | goto survive; | 277 | goto survive; |
diff --git a/arch/m32r/oprofile/Kconfig b/arch/m32r/oprofile/Kconfig deleted file mode 100644 index 19d37730b6..0000000000 --- a/arch/m32r/oprofile/Kconfig +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | depends on EXPERIMENTAL | ||
4 | |||
5 | config PROFILING | ||
6 | bool "Profiling support (EXPERIMENTAL)" | ||
7 | help | ||
8 | Say Y here to enable the extended profiling support mechanisms used | ||
9 | by profilers such as OProfile. | ||
10 | |||
11 | |||
12 | config OPROFILE | ||
13 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
14 | depends on PROFILING | ||
15 | help | ||
16 | OProfile is a profiling system capable of profiling the | ||
17 | whole system, include the kernel, kernel modules, libraries, | ||
18 | and applications. | ||
19 | |||
20 | If unsure, say N. | ||
21 | |||
22 | endmenu | ||
23 | |||
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 20a9c08e59..01dee84f84 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -683,6 +683,8 @@ endmenu | |||
683 | 683 | ||
684 | source "fs/Kconfig" | 684 | source "fs/Kconfig" |
685 | 685 | ||
686 | source "kernel/Kconfig.instrumentation" | ||
687 | |||
686 | source "arch/m68k/Kconfig.debug" | 688 | source "arch/m68k/Kconfig.debug" |
687 | 689 | ||
688 | source "security/Kconfig" | 690 | source "security/Kconfig" |
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index 4e2752a0e8..97f556fa49 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c | |||
@@ -900,7 +900,7 @@ void show_registers(struct pt_regs *regs) | |||
900 | regs->d4, regs->d5, regs->a0, regs->a1); | 900 | regs->d4, regs->d5, regs->a0, regs->a1); |
901 | 901 | ||
902 | printk("Process %s (pid: %d, task=%p)\n", | 902 | printk("Process %s (pid: %d, task=%p)\n", |
903 | current->comm, current->pid, current); | 903 | current->comm, task_pid_nr(current), current); |
904 | addr = (unsigned long)&fp->un; | 904 | addr = (unsigned long)&fp->un; |
905 | printk("Frame format=%X ", regs->format); | 905 | printk("Frame format=%X ", regs->format); |
906 | switch (regs->format) { | 906 | switch (regs->format) { |
@@ -1038,7 +1038,7 @@ void bad_super_trap (struct frame *fp) | |||
1038 | fp->un.fmtb.daddr, space_names[ssw & DFC], | 1038 | fp->un.fmtb.daddr, space_names[ssw & DFC], |
1039 | fp->ptregs.pc); | 1039 | fp->ptregs.pc); |
1040 | } | 1040 | } |
1041 | printk ("Current process id is %d\n", current->pid); | 1041 | printk ("Current process id is %d\n", task_pid_nr(current)); |
1042 | die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0); | 1042 | die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0); |
1043 | } | 1043 | } |
1044 | 1044 | ||
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index eaa6186811..f493f03231 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c | |||
@@ -180,7 +180,7 @@ good_area: | |||
180 | */ | 180 | */ |
181 | out_of_memory: | 181 | out_of_memory: |
182 | up_read(&mm->mmap_sem); | 182 | up_read(&mm->mmap_sem); |
183 | if (is_init(current)) { | 183 | if (is_global_init(current)) { |
184 | yield(); | 184 | yield(); |
185 | down_read(&mm->mmap_sem); | 185 | down_read(&mm->mmap_sem); |
186 | goto survive; | 186 | goto survive; |
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index 185906b54c..f52c627bda 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig | |||
@@ -696,6 +696,8 @@ source "drivers/Kconfig" | |||
696 | 696 | ||
697 | source "fs/Kconfig" | 697 | source "fs/Kconfig" |
698 | 698 | ||
699 | source "kernel/Kconfig.instrumentation" | ||
700 | |||
699 | source "arch/m68knommu/Kconfig.debug" | 701 | source "arch/m68knommu/Kconfig.debug" |
700 | 702 | ||
701 | source "security/Kconfig" | 703 | source "security/Kconfig" |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index cb027580cd..4dc142d394 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -2005,7 +2005,7 @@ source "drivers/Kconfig" | |||
2005 | 2005 | ||
2006 | source "fs/Kconfig" | 2006 | source "fs/Kconfig" |
2007 | 2007 | ||
2008 | source "arch/mips/oprofile/Kconfig" | 2008 | source "kernel/Kconfig.instrumentation" |
2009 | 2009 | ||
2010 | source "arch/mips/Kconfig.debug" | 2010 | source "arch/mips/Kconfig.debug" |
2011 | 2011 | ||
diff --git a/arch/mips/au1000/pb1200/irqmap.c b/arch/mips/au1000/pb1200/irqmap.c index 5f48b06037..bdf00e2a35 100644 --- a/arch/mips/au1000/pb1200/irqmap.c +++ b/arch/mips/au1000/pb1200/irqmap.c | |||
@@ -36,8 +36,8 @@ | |||
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/random.h> | 37 | #include <linux/random.h> |
38 | #include <linux/delay.h> | 38 | #include <linux/delay.h> |
39 | #include <linux/bitops.h> | ||
39 | 40 | ||
40 | #include <asm/bitops.h> | ||
41 | #include <asm/bootinfo.h> | 41 | #include <asm/bootinfo.h> |
42 | #include <asm/io.h> | 42 | #include <asm/io.h> |
43 | #include <asm/mipsregs.h> | 43 | #include <asm/mipsregs.h> |
diff --git a/arch/mips/basler/excite/excite_irq.c b/arch/mips/basler/excite/excite_irq.c index 1ecab63504..4903e06791 100644 --- a/arch/mips/basler/excite/excite_irq.c +++ b/arch/mips/basler/excite/excite_irq.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/timex.h> | 29 | #include <linux/timex.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/random.h> | 31 | #include <linux/random.h> |
32 | #include <asm/bitops.h> | 32 | #include <linux/bitops.h> |
33 | #include <asm/bootinfo.h> | 33 | #include <asm/bootinfo.h> |
34 | #include <asm/io.h> | 34 | #include <asm/io.h> |
35 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig index 49bcc58929..892d4c38fd 100644 --- a/arch/mips/configs/ip27_defconfig +++ b/arch/mips/configs/ip27_defconfig | |||
@@ -175,6 +175,7 @@ CONFIG_POSIX_MQUEUE=y | |||
175 | CONFIG_IKCONFIG=y | 175 | CONFIG_IKCONFIG=y |
176 | CONFIG_IKCONFIG_PROC=y | 176 | CONFIG_IKCONFIG_PROC=y |
177 | CONFIG_LOG_BUF_SHIFT=15 | 177 | CONFIG_LOG_BUF_SHIFT=15 |
178 | CONFIG_CGROUPS=y | ||
178 | CONFIG_CPUSETS=y | 179 | CONFIG_CPUSETS=y |
179 | CONFIG_SYSFS_DEPRECATED=y | 180 | CONFIG_SYSFS_DEPRECATED=y |
180 | CONFIG_RELAY=y | 181 | CONFIG_RELAY=y |
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig index 3ed991ae0e..49dfcef251 100644 --- a/arch/mips/configs/sb1250-swarm_defconfig +++ b/arch/mips/configs/sb1250-swarm_defconfig | |||
@@ -196,6 +196,7 @@ CONFIG_SYSVIPC_SYSCTL=y | |||
196 | # CONFIG_UTS_NS is not set | 196 | # CONFIG_UTS_NS is not set |
197 | # CONFIG_AUDIT is not set | 197 | # CONFIG_AUDIT is not set |
198 | # CONFIG_IKCONFIG is not set | 198 | # CONFIG_IKCONFIG is not set |
199 | CONFIG_CGROUPS=y | ||
199 | CONFIG_CPUSETS=y | 200 | CONFIG_CPUSETS=y |
200 | CONFIG_SYSFS_DEPRECATED=y | 201 | CONFIG_SYSFS_DEPRECATED=y |
201 | CONFIG_RELAY=y | 202 | CONFIG_RELAY=y |
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index b997af713e..7852c7cdf2 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c | |||
@@ -1172,8 +1172,8 @@ static int irix_core_dump(long signr, struct pt_regs *regs, struct file *file, u | |||
1172 | prstatus.pr_sighold = current->blocked.sig[0]; | 1172 | prstatus.pr_sighold = current->blocked.sig[0]; |
1173 | psinfo.pr_pid = prstatus.pr_pid = current->pid; | 1173 | psinfo.pr_pid = prstatus.pr_pid = current->pid; |
1174 | psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid; | 1174 | psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid; |
1175 | psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current); | 1175 | psinfo.pr_pgrp = prstatus.pr_pgrp = task_pgrp_nr(current); |
1176 | psinfo.pr_sid = prstatus.pr_sid = process_session(current); | 1176 | psinfo.pr_sid = prstatus.pr_sid = task_session_nr(current); |
1177 | if (current->pid == current->tgid) { | 1177 | if (current->pid == current->tgid) { |
1178 | /* | 1178 | /* |
1179 | * This is the record for the group leader. Add in the | 1179 | * This is the record for the group leader. Add in the |
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c index 85c2e389ed..a0a91056fd 100644 --- a/arch/mips/kernel/irixsig.c +++ b/arch/mips/kernel/irixsig.c | |||
@@ -609,7 +609,7 @@ repeat: | |||
609 | p = list_entry(_p, struct task_struct, sibling); | 609 | p = list_entry(_p, struct task_struct, sibling); |
610 | if ((type == IRIX_P_PID) && p->pid != pid) | 610 | if ((type == IRIX_P_PID) && p->pid != pid) |
611 | continue; | 611 | continue; |
612 | if ((type == IRIX_P_PGID) && process_group(p) != pid) | 612 | if ((type == IRIX_P_PGID) && task_pgrp_nr(p) != pid) |
613 | continue; | 613 | continue; |
614 | if ((p->exit_signal != SIGCHLD)) | 614 | if ((p->exit_signal != SIGCHLD)) |
615 | continue; | 615 | continue; |
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index ee7790d9de..4c477c7ff7 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c | |||
@@ -763,11 +763,11 @@ asmlinkage int irix_setpgrp(int flags) | |||
763 | printk("[%s:%d] setpgrp(%d) ", current->comm, current->pid, flags); | 763 | printk("[%s:%d] setpgrp(%d) ", current->comm, current->pid, flags); |
764 | #endif | 764 | #endif |
765 | if(!flags) | 765 | if(!flags) |
766 | error = process_group(current); | 766 | error = task_pgrp_nr(current); |
767 | else | 767 | else |
768 | error = sys_setsid(); | 768 | error = sys_setsid(); |
769 | #ifdef DEBUG_PROCGRPS | 769 | #ifdef DEBUG_PROCGRPS |
770 | printk("returning %d\n", process_group(current)); | 770 | printk("returning %d\n", task_pgrp_nr(current)); |
771 | #endif | 771 | #endif |
772 | 772 | ||
773 | return error; | 773 | return error; |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 7b78d13725..fa50078715 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -314,7 +314,7 @@ void show_registers(const struct pt_regs *regs) | |||
314 | __show_regs(regs); | 314 | __show_regs(regs); |
315 | print_modules(); | 315 | print_modules(); |
316 | printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", | 316 | printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", |
317 | current->comm, current->pid, current_thread_info(), current); | 317 | current->comm, task_pid_nr(current), current_thread_info(), current); |
318 | show_stacktrace(current, regs); | 318 | show_stacktrace(current, regs); |
319 | show_code((unsigned int __user *) regs->cp0_epc); | 319 | show_code((unsigned int __user *) regs->cp0_epc); |
320 | printk("\n"); | 320 | printk("\n"); |
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 5699c7713e..fa636fc6b7 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c | |||
@@ -173,7 +173,7 @@ no_context: | |||
173 | */ | 173 | */ |
174 | out_of_memory: | 174 | out_of_memory: |
175 | up_read(&mm->mmap_sem); | 175 | up_read(&mm->mmap_sem); |
176 | if (is_init(tsk)) { | 176 | if (is_global_init(tsk)) { |
177 | yield(); | 177 | yield(); |
178 | down_read(&mm->mmap_sem); | 178 | down_read(&mm->mmap_sem); |
179 | goto survive; | 179 | goto survive; |
diff --git a/arch/mips/oprofile/Kconfig b/arch/mips/oprofile/Kconfig deleted file mode 100644 index fb6f235348..0000000000 --- a/arch/mips/oprofile/Kconfig +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | depends on EXPERIMENTAL | ||
4 | |||
5 | config PROFILING | ||
6 | bool "Profiling support (EXPERIMENTAL)" | ||
7 | help | ||
8 | Say Y here to enable the extended profiling support mechanisms used | ||
9 | by profilers such as OProfile. | ||
10 | |||
11 | |||
12 | config OPROFILE | ||
13 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
14 | depends on PROFILING && !MIPS_MT_SMTC && EXPERIMENTAL | ||
15 | help | ||
16 | OProfile is a profiling system capable of profiling the | ||
17 | whole system, include the kernel, kernel modules, libraries, | ||
18 | and applications. | ||
19 | |||
20 | If unsure, say N. | ||
21 | |||
22 | endmenu | ||
23 | |||
diff --git a/arch/mips/tx4938/common/setup.c b/arch/mips/tx4938/common/setup.c index ab40822675..04f009ccb0 100644 --- a/arch/mips/tx4938/common/setup.c +++ b/arch/mips/tx4938/common/setup.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/random.h> | 25 | #include <linux/random.h> |
26 | #include <linux/irq.h> | 26 | #include <linux/irq.h> |
27 | #include <asm/bitops.h> | 27 | #include <linux/bitops.h> |
28 | #include <asm/bootinfo.h> | 28 | #include <asm/bootinfo.h> |
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 3d73545e8c..b8ef1787a1 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -267,7 +267,7 @@ source "drivers/Kconfig" | |||
267 | 267 | ||
268 | source "fs/Kconfig" | 268 | source "fs/Kconfig" |
269 | 269 | ||
270 | source "arch/parisc/oprofile/Kconfig" | 270 | source "kernel/Kconfig.instrumentation" |
271 | 271 | ||
272 | source "arch/parisc/Kconfig.debug" | 272 | source "arch/parisc/Kconfig.debug" |
273 | 273 | ||
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index fb35ebc0c4..2ce3806f02 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c | |||
@@ -181,7 +181,7 @@ give_sigsegv: | |||
181 | si.si_signo = SIGSEGV; | 181 | si.si_signo = SIGSEGV; |
182 | si.si_errno = 0; | 182 | si.si_errno = 0; |
183 | si.si_code = SI_KERNEL; | 183 | si.si_code = SI_KERNEL; |
184 | si.si_pid = current->pid; | 184 | si.si_pid = task_pid_vnr(current); |
185 | si.si_uid = current->uid; | 185 | si.si_uid = current->uid; |
186 | si.si_addr = &frame->uc; | 186 | si.si_addr = &frame->uc; |
187 | force_sig_info(SIGSEGV, &si, current); | 187 | force_sig_info(SIGSEGV, &si, current); |
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index bbf029a184..99fd56939a 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -219,7 +219,7 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err) | |||
219 | return; /* STFU */ | 219 | return; /* STFU */ |
220 | 220 | ||
221 | printk(KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n", | 221 | printk(KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n", |
222 | current->comm, current->pid, str, err, regs->iaoq[0]); | 222 | current->comm, task_pid_nr(current), str, err, regs->iaoq[0]); |
223 | #ifdef PRINT_USER_FAULTS | 223 | #ifdef PRINT_USER_FAULTS |
224 | /* XXX for debugging only */ | 224 | /* XXX for debugging only */ |
225 | show_regs(regs); | 225 | show_regs(regs); |
@@ -252,7 +252,7 @@ KERN_CRIT " || ||\n"); | |||
252 | 252 | ||
253 | if (err) | 253 | if (err) |
254 | printk(KERN_CRIT "%s (pid %d): %s (code %ld)\n", | 254 | printk(KERN_CRIT "%s (pid %d): %s (code %ld)\n", |
255 | current->comm, current->pid, str, err); | 255 | current->comm, task_pid_nr(current), str, err); |
256 | 256 | ||
257 | /* Wot's wrong wif bein' racy? */ | 257 | /* Wot's wrong wif bein' racy? */ |
258 | if (current->thread.flags & PARISC_KERNEL_DEATH) { | 258 | if (current->thread.flags & PARISC_KERNEL_DEATH) { |
@@ -317,7 +317,7 @@ static void handle_break(struct pt_regs *regs) | |||
317 | if (unlikely(iir != GDB_BREAK_INSN)) { | 317 | if (unlikely(iir != GDB_BREAK_INSN)) { |
318 | printk(KERN_DEBUG "break %d,%d: pid=%d command='%s'\n", | 318 | printk(KERN_DEBUG "break %d,%d: pid=%d command='%s'\n", |
319 | iir & 31, (iir>>13) & ((1<<13)-1), | 319 | iir & 31, (iir>>13) & ((1<<13)-1), |
320 | current->pid, current->comm); | 320 | task_pid_nr(current), current->comm); |
321 | show_regs(regs); | 321 | show_regs(regs); |
322 | } | 322 | } |
323 | #endif | 323 | #endif |
@@ -747,7 +747,7 @@ void handle_interruption(int code, struct pt_regs *regs) | |||
747 | if (user_mode(regs)) { | 747 | if (user_mode(regs)) { |
748 | #ifdef PRINT_USER_FAULTS | 748 | #ifdef PRINT_USER_FAULTS |
749 | printk(KERN_DEBUG "\nhandle_interruption() pid=%d command='%s'\n", | 749 | printk(KERN_DEBUG "\nhandle_interruption() pid=%d command='%s'\n", |
750 | current->pid, current->comm); | 750 | task_pid_nr(current), current->comm); |
751 | show_regs(regs); | 751 | show_regs(regs); |
752 | #endif | 752 | #endif |
753 | /* SIGBUS, for lack of a better one. */ | 753 | /* SIGBUS, for lack of a better one. */ |
@@ -772,7 +772,7 @@ void handle_interruption(int code, struct pt_regs *regs) | |||
772 | else | 772 | else |
773 | printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ", | 773 | printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ", |
774 | code); | 774 | code); |
775 | printk("pid=%d command='%s'\n", current->pid, current->comm); | 775 | printk("pid=%d command='%s'\n", task_pid_nr(current), current->comm); |
776 | show_regs(regs); | 776 | show_regs(regs); |
777 | #endif | 777 | #endif |
778 | si.si_signo = SIGSEGV; | 778 | si.si_signo = SIGSEGV; |
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index 347bb922e6..aebf3c1688 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c | |||
@@ -469,7 +469,7 @@ void handle_unaligned(struct pt_regs *regs) | |||
469 | && ++unaligned_count < 5) { | 469 | && ++unaligned_count < 5) { |
470 | char buf[256]; | 470 | char buf[256]; |
471 | sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n", | 471 | sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n", |
472 | current->comm, current->pid, regs->ior, regs->iaoq[0]); | 472 | current->comm, task_pid_nr(current), regs->ior, regs->iaoq[0]); |
473 | printk(KERN_WARNING "%s", buf); | 473 | printk(KERN_WARNING "%s", buf); |
474 | #ifdef DEBUG_UNALIGNED | 474 | #ifdef DEBUG_UNALIGNED |
475 | show_regs(regs); | 475 | show_regs(regs); |
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 1c091b415c..b2e3e9a8ce 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -211,7 +211,7 @@ bad_area: | |||
211 | #ifdef PRINT_USER_FAULTS | 211 | #ifdef PRINT_USER_FAULTS |
212 | printk(KERN_DEBUG "\n"); | 212 | printk(KERN_DEBUG "\n"); |
213 | printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n", | 213 | printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n", |
214 | tsk->pid, tsk->comm, code, address); | 214 | task_pid_nr(tsk), tsk->comm, code, address); |
215 | if (vma) { | 215 | if (vma) { |
216 | printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n", | 216 | printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n", |
217 | vma->vm_start, vma->vm_end); | 217 | vma->vm_start, vma->vm_end); |
diff --git a/arch/parisc/oprofile/Kconfig b/arch/parisc/oprofile/Kconfig deleted file mode 100644 index 5ade19801b..0000000000 --- a/arch/parisc/oprofile/Kconfig +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | depends on EXPERIMENTAL | ||
4 | |||
5 | config PROFILING | ||
6 | bool "Profiling support (EXPERIMENTAL)" | ||
7 | help | ||
8 | Say Y here to enable the extended profiling support mechanisms used | ||
9 | by profilers such as OProfile. | ||
10 | |||
11 | |||
12 | config OPROFILE | ||
13 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
14 | depends on PROFILING | ||
15 | help | ||
16 | OProfile is a profiling system capable of profiling the | ||
17 | whole system, include the kernel, kernel modules, libraries, | ||
18 | and applications. | ||
19 | |||
20 | If unsure, say N. | ||
21 | |||
22 | endmenu | ||
23 | |||
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 3763f681ce..18f397ca05 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -669,20 +669,7 @@ source "arch/powerpc/sysdev/qe_lib/Kconfig" | |||
669 | 669 | ||
670 | source "lib/Kconfig" | 670 | source "lib/Kconfig" |
671 | 671 | ||
672 | menu "Instrumentation Support" | 672 | source "kernel/Kconfig.instrumentation" |
673 | |||
674 | source "arch/powerpc/oprofile/Kconfig" | ||
675 | |||
676 | config KPROBES | ||
677 | bool "Kprobes" | ||
678 | depends on !BOOKE && !4xx && KALLSYMS && MODULES | ||
679 | help | ||
680 | Kprobes allows you to trap at almost any kernel address and | ||
681 | execute a callback function. register_kprobe() establishes | ||
682 | a probepoint and specifies the callback. Kprobes is useful | ||
683 | for kernel debugging, non-intrusive instrumentation and testing. | ||
684 | If in doubt, say "N". | ||
685 | endmenu | ||
686 | 673 | ||
687 | source "arch/powerpc/Kconfig.debug" | 674 | source "arch/powerpc/Kconfig.debug" |
688 | 675 | ||
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig index 8b47c84642..dcd7c02727 100644 --- a/arch/powerpc/configs/cell_defconfig +++ b/arch/powerpc/configs/cell_defconfig | |||
@@ -68,6 +68,7 @@ CONFIG_SYSVIPC_SYSCTL=y | |||
68 | CONFIG_IKCONFIG=y | 68 | CONFIG_IKCONFIG=y |
69 | CONFIG_IKCONFIG_PROC=y | 69 | CONFIG_IKCONFIG_PROC=y |
70 | CONFIG_LOG_BUF_SHIFT=15 | 70 | CONFIG_LOG_BUF_SHIFT=15 |
71 | CONFIG_CGROUPS=y | ||
71 | CONFIG_CPUSETS=y | 72 | CONFIG_CPUSETS=y |
72 | CONFIG_SYSFS_DEPRECATED=y | 73 | CONFIG_SYSFS_DEPRECATED=y |
73 | # CONFIG_RELAY is not set | 74 | # CONFIG_RELAY is not set |
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig index bb8d4e46f0..05582af50c 100644 --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig | |||
@@ -71,6 +71,7 @@ CONFIG_TASK_DELAY_ACCT=y | |||
71 | CONFIG_IKCONFIG=y | 71 | CONFIG_IKCONFIG=y |
72 | CONFIG_IKCONFIG_PROC=y | 72 | CONFIG_IKCONFIG_PROC=y |
73 | CONFIG_LOG_BUF_SHIFT=17 | 73 | CONFIG_LOG_BUF_SHIFT=17 |
74 | CONFIG_CGROUPS=y | ||
74 | CONFIG_CPUSETS=y | 75 | CONFIG_CPUSETS=y |
75 | CONFIG_SYSFS_DEPRECATED=y | 76 | CONFIG_SYSFS_DEPRECATED=y |
76 | CONFIG_RELAY=y | 77 | CONFIG_RELAY=y |
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index c09eb8cfbe..62a38406b6 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig | |||
@@ -71,6 +71,7 @@ CONFIG_AUDITSYSCALL=y | |||
71 | CONFIG_IKCONFIG=y | 71 | CONFIG_IKCONFIG=y |
72 | CONFIG_IKCONFIG_PROC=y | 72 | CONFIG_IKCONFIG_PROC=y |
73 | CONFIG_LOG_BUF_SHIFT=17 | 73 | CONFIG_LOG_BUF_SHIFT=17 |
74 | CONFIG_CGROUPS=y | ||
74 | CONFIG_CPUSETS=y | 75 | CONFIG_CPUSETS=y |
75 | CONFIG_SYSFS_DEPRECATED=y | 76 | CONFIG_SYSFS_DEPRECATED=y |
76 | # CONFIG_RELAY is not set | 77 | # CONFIG_RELAY is not set |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index e60a0c544d..c0c8e8c3ce 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -61,45 +61,39 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
61 | for(;;); | 61 | for(;;); |
62 | } | 62 | } |
63 | 63 | ||
64 | static int __init early_parse_crashk(char *p) | ||
65 | { | ||
66 | unsigned long size; | ||
67 | |||
68 | if (!p) | ||
69 | return 1; | ||
70 | |||
71 | size = memparse(p, &p); | ||
72 | |||
73 | if (*p == '@') | ||
74 | crashk_res.start = memparse(p + 1, &p); | ||
75 | else | ||
76 | crashk_res.start = KDUMP_KERNELBASE; | ||
77 | |||
78 | crashk_res.end = crashk_res.start + size - 1; | ||
79 | |||
80 | return 0; | ||
81 | } | ||
82 | early_param("crashkernel", early_parse_crashk); | ||
83 | |||
84 | void __init reserve_crashkernel(void) | 64 | void __init reserve_crashkernel(void) |
85 | { | 65 | { |
86 | unsigned long size; | 66 | unsigned long long crash_size, crash_base; |
67 | int ret; | ||
68 | |||
69 | /* this is necessary because of lmb_phys_mem_size() */ | ||
70 | lmb_analyze(); | ||
71 | |||
72 | /* use common parsing */ | ||
73 | ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(), | ||
74 | &crash_size, &crash_base); | ||
75 | if (ret == 0 && crash_size > 0) { | ||
76 | if (crash_base == 0) | ||
77 | crash_base = KDUMP_KERNELBASE; | ||
78 | crashk_res.start = crash_base; | ||
79 | } else { | ||
80 | /* handle the device tree */ | ||
81 | crash_size = crashk_res.end - crashk_res.start + 1; | ||
82 | } | ||
87 | 83 | ||
88 | if (crashk_res.start == 0) | 84 | if (crash_size == 0) |
89 | return; | 85 | return; |
90 | 86 | ||
91 | /* We might have got these values via the command line or the | 87 | /* We might have got these values via the command line or the |
92 | * device tree, either way sanitise them now. */ | 88 | * device tree, either way sanitise them now. */ |
93 | 89 | ||
94 | size = crashk_res.end - crashk_res.start + 1; | ||
95 | |||
96 | if (crashk_res.start != KDUMP_KERNELBASE) | 90 | if (crashk_res.start != KDUMP_KERNELBASE) |
97 | printk("Crash kernel location must be 0x%x\n", | 91 | printk("Crash kernel location must be 0x%x\n", |
98 | KDUMP_KERNELBASE); | 92 | KDUMP_KERNELBASE); |
99 | 93 | ||
100 | crashk_res.start = KDUMP_KERNELBASE; | 94 | crashk_res.start = KDUMP_KERNELBASE; |
101 | size = PAGE_ALIGN(size); | 95 | crash_size = PAGE_ALIGN(crash_size); |
102 | crashk_res.end = crashk_res.start + size - 1; | 96 | crashk_res.end = crashk_res.start + crash_size - 1; |
103 | 97 | ||
104 | /* Crash kernel trumps memory limit */ | 98 | /* Crash kernel trumps memory limit */ |
105 | if (memory_limit && memory_limit <= crashk_res.end) { | 99 | if (memory_limit && memory_limit <= crashk_res.end) { |
@@ -108,7 +102,13 @@ void __init reserve_crashkernel(void) | |||
108 | memory_limit); | 102 | memory_limit); |
109 | } | 103 | } |
110 | 104 | ||
111 | lmb_reserve(crashk_res.start, size); | 105 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " |
106 | "for crashkernel (System RAM: %ldMB)\n", | ||
107 | (unsigned long)(crash_size >> 20), | ||
108 | (unsigned long)(crashk_res.start >> 20), | ||
109 | (unsigned long)(lmb_phys_mem_size() >> 20)); | ||
110 | |||
111 | lmb_reserve(crashk_res.start, crash_size); | ||
112 | } | 112 | } |
113 | 113 | ||
114 | int overlaps_crashkernel(unsigned long start, unsigned long size) | 114 | int overlaps_crashkernel(unsigned long start, unsigned long size) |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index ea6ad7a2a7..b9d88374f1 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -459,7 +459,7 @@ void show_regs(struct pt_regs * regs) | |||
459 | printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr); | 459 | printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr); |
460 | #endif | 460 | #endif |
461 | printk("TASK = %p[%d] '%s' THREAD: %p", | 461 | printk("TASK = %p[%d] '%s' THREAD: %p", |
462 | current, current->pid, current->comm, task_thread_info(current)); | 462 | current, task_pid_nr(current), current->comm, task_thread_info(current)); |
463 | 463 | ||
464 | #ifdef CONFIG_SMP | 464 | #ifdef CONFIG_SMP |
465 | printk(" CPU: %d", smp_processor_id()); | 465 | printk(" CPU: %d", smp_processor_id()); |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index bf9e39c6e2..59c464e26f 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -201,7 +201,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) | |||
201 | * generate the same exception over and over again and we get | 201 | * generate the same exception over and over again and we get |
202 | * nowhere. Better to kill it and let the kernel panic. | 202 | * nowhere. Better to kill it and let the kernel panic. |
203 | */ | 203 | */ |
204 | if (is_init(current)) { | 204 | if (is_global_init(current)) { |
205 | __sighandler_t handler; | 205 | __sighandler_t handler; |
206 | 206 | ||
207 | spin_lock_irq(¤t->sighand->siglock); | 207 | spin_lock_irq(¤t->sighand->siglock); |
@@ -881,7 +881,7 @@ void nonrecoverable_exception(struct pt_regs *regs) | |||
881 | void trace_syscall(struct pt_regs *regs) | 881 | void trace_syscall(struct pt_regs *regs) |
882 | { | 882 | { |
883 | printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n", | 883 | printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n", |
884 | current, current->pid, regs->nip, regs->link, regs->gpr[0], | 884 | current, task_pid_nr(current), regs->nip, regs->link, regs->gpr[0], |
885 | regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted()); | 885 | regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted()); |
886 | } | 886 | } |
887 | 887 | ||
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index ab3546c5ac..a18fda361c 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -375,7 +375,7 @@ bad_area_nosemaphore: | |||
375 | */ | 375 | */ |
376 | out_of_memory: | 376 | out_of_memory: |
377 | up_read(&mm->mmap_sem); | 377 | up_read(&mm->mmap_sem); |
378 | if (is_init(current)) { | 378 | if (is_global_init(current)) { |
379 | yield(); | 379 | yield(); |
380 | down_read(&mm->mmap_sem); | 380 | down_read(&mm->mmap_sem); |
381 | goto survive; | 381 | goto survive; |
diff --git a/arch/powerpc/oprofile/Kconfig b/arch/powerpc/oprofile/Kconfig deleted file mode 100644 index 7089e79689..0000000000 --- a/arch/powerpc/oprofile/Kconfig +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | config PROFILING | ||
2 | bool "Profiling support (EXPERIMENTAL)" | ||
3 | help | ||
4 | Say Y here to enable the extended profiling support mechanisms used | ||
5 | by profilers such as OProfile. | ||
6 | |||
7 | |||
8 | config OPROFILE | ||
9 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
10 | depends on PROFILING | ||
11 | help | ||
12 | OProfile is a profiling system capable of profiling the | ||
13 | whole system, include the kernel, kernel modules, libraries, | ||
14 | and applications. | ||
15 | |||
16 | If unsure, say N. | ||
17 | |||
18 | config OPROFILE_CELL | ||
19 | bool "OProfile for Cell Broadband Engine" | ||
20 | depends on (SPU_FS = y && OPROFILE = m) || (SPU_FS = y && OPROFILE = y) || (SPU_FS = m && OPROFILE = m) | ||
21 | default y | ||
22 | help | ||
23 | Profiling of Cell BE SPUs requires special support enabled | ||
24 | by this option. | ||
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index 354c058616..144177d77c 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -41,13 +41,13 @@ | |||
41 | #include <linux/root_dev.h> | 41 | #include <linux/root_dev.h> |
42 | #include <linux/serial.h> | 42 | #include <linux/serial.h> |
43 | #include <linux/smp.h> | 43 | #include <linux/smp.h> |
44 | #include <linux/bitops.h> | ||
44 | 45 | ||
45 | #include <asm/processor.h> | 46 | #include <asm/processor.h> |
46 | #include <asm/sections.h> | 47 | #include <asm/sections.h> |
47 | #include <asm/prom.h> | 48 | #include <asm/prom.h> |
48 | #include <asm/system.h> | 49 | #include <asm/system.h> |
49 | #include <asm/pgtable.h> | 50 | #include <asm/pgtable.h> |
50 | #include <asm/bitops.h> | ||
51 | #include <asm/io.h> | 51 | #include <asm/io.h> |
52 | #include <asm/kexec.h> | 52 | #include <asm/kexec.h> |
53 | #include <asm/pci-bridge.h> | 53 | #include <asm/pci-bridge.h> |
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index 3a393c7f39..a1ab25c708 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c | |||
@@ -332,7 +332,7 @@ static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err) | |||
332 | err->disposition == RTAS_DISP_NOT_RECOVERED && | 332 | err->disposition == RTAS_DISP_NOT_RECOVERED && |
333 | err->target == RTAS_TARGET_MEMORY && | 333 | err->target == RTAS_TARGET_MEMORY && |
334 | err->type == RTAS_TYPE_ECC_UNCORR && | 334 | err->type == RTAS_TYPE_ECC_UNCORR && |
335 | !(current->pid == 0 || is_init(current))) { | 335 | !(current->pid == 0 || is_global_init(current))) { |
336 | /* Kill off a user process with an ECC error */ | 336 | /* Kill off a user process with an ECC error */ |
337 | printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n", | 337 | printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n", |
338 | current->pid); | 338 | current->pid); |
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index 607925c8a9..6473fa7cb4 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -1317,7 +1317,7 @@ endmenu | |||
1317 | 1317 | ||
1318 | source "lib/Kconfig" | 1318 | source "lib/Kconfig" |
1319 | 1319 | ||
1320 | source "arch/powerpc/oprofile/Kconfig" | 1320 | source "kernel/Kconfig.instrumentation" |
1321 | 1321 | ||
1322 | source "arch/ppc/Kconfig.debug" | 1322 | source "arch/ppc/Kconfig.debug" |
1323 | 1323 | ||
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c index 3f3b292eb7..c78568905c 100644 --- a/arch/ppc/kernel/traps.c +++ b/arch/ppc/kernel/traps.c | |||
@@ -121,7 +121,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) | |||
121 | * generate the same exception over and over again and we get | 121 | * generate the same exception over and over again and we get |
122 | * nowhere. Better to kill it and let the kernel panic. | 122 | * nowhere. Better to kill it and let the kernel panic. |
123 | */ | 123 | */ |
124 | if (is_init(current)) { | 124 | if (is_global_init(current)) { |
125 | __sighandler_t handler; | 125 | __sighandler_t handler; |
126 | 126 | ||
127 | spin_lock_irq(¤t->sighand->siglock); | 127 | spin_lock_irq(¤t->sighand->siglock); |
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c index 94913ddcf7..254c23b755 100644 --- a/arch/ppc/mm/fault.c +++ b/arch/ppc/mm/fault.c | |||
@@ -290,7 +290,7 @@ bad_area: | |||
290 | */ | 290 | */ |
291 | out_of_memory: | 291 | out_of_memory: |
292 | up_read(&mm->mmap_sem); | 292 | up_read(&mm->mmap_sem); |
293 | if (is_init(current)) { | 293 | if (is_global_init(current)) { |
294 | yield(); | 294 | yield(); |
295 | down_read(&mm->mmap_sem); | 295 | down_read(&mm->mmap_sem); |
296 | goto survive; | 296 | goto survive; |
diff --git a/arch/ppc/platforms/chestnut.c b/arch/ppc/platforms/chestnut.c index 248684f50d..dcd6070b85 100644 --- a/arch/ppc/platforms/chestnut.c +++ b/arch/ppc/platforms/chestnut.c | |||
@@ -49,7 +49,6 @@ extern void gen550_progress(char *, unsigned short); | |||
49 | extern void gen550_init(int, struct uart_port *); | 49 | extern void gen550_init(int, struct uart_port *); |
50 | extern void mv64360_pcibios_fixup(mv64x60_handle_t *bh); | 50 | extern void mv64360_pcibios_fixup(mv64x60_handle_t *bh); |
51 | 51 | ||
52 | #define BIT(x) (1<<x) | ||
53 | #define CHESTNUT_PRESERVE_MASK (BIT(MV64x60_CPU2DEV_0_WIN) | \ | 52 | #define CHESTNUT_PRESERVE_MASK (BIT(MV64x60_CPU2DEV_0_WIN) | \ |
54 | BIT(MV64x60_CPU2DEV_1_WIN) | \ | 53 | BIT(MV64x60_CPU2DEV_1_WIN) | \ |
55 | BIT(MV64x60_CPU2DEV_2_WIN) | \ | 54 | BIT(MV64x60_CPU2DEV_2_WIN) | \ |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index b71132166f..4ec716d8c1 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -529,21 +529,7 @@ source "drivers/Kconfig" | |||
529 | 529 | ||
530 | source "fs/Kconfig" | 530 | source "fs/Kconfig" |
531 | 531 | ||
532 | menu "Instrumentation Support" | 532 | source "kernel/Kconfig.instrumentation" |
533 | |||
534 | source "arch/s390/oprofile/Kconfig" | ||
535 | |||
536 | config KPROBES | ||
537 | bool "Kprobes (EXPERIMENTAL)" | ||
538 | depends on EXPERIMENTAL && MODULES | ||
539 | help | ||
540 | Kprobes allows you to trap at almost any kernel address and | ||
541 | execute a callback function. register_kprobe() establishes | ||
542 | a probepoint and specifies the callback. Kprobes is useful | ||
543 | for kernel debugging, non-intrusive instrumentation and testing. | ||
544 | If in doubt, say "N". | ||
545 | |||
546 | endmenu | ||
547 | 533 | ||
548 | source "arch/s390/Kconfig.debug" | 534 | source "arch/s390/Kconfig.debug" |
549 | 535 | ||
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index abb447a3e4..70c57378f4 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -166,7 +166,7 @@ void show_regs(struct pt_regs *regs) | |||
166 | 166 | ||
167 | printk("CPU: %d %s\n", task_thread_info(tsk)->cpu, print_tainted()); | 167 | printk("CPU: %d %s\n", task_thread_info(tsk)->cpu, print_tainted()); |
168 | printk("Process %s (pid: %d, task: %p, ksp: %p)\n", | 168 | printk("Process %s (pid: %d, task: %p, ksp: %p)\n", |
169 | current->comm, current->pid, (void *) tsk, | 169 | current->comm, task_pid_nr(current), (void *) tsk, |
170 | (void *) tsk->thread.ksp); | 170 | (void *) tsk->thread.ksp); |
171 | 171 | ||
172 | show_registers(regs); | 172 | show_registers(regs); |
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index 60604b2819..b159a9d656 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
@@ -64,7 +64,7 @@ out: | |||
64 | 64 | ||
65 | out_of_memory: | 65 | out_of_memory: |
66 | up_read(&mm->mmap_sem); | 66 | up_read(&mm->mmap_sem); |
67 | if (is_init(current)) { | 67 | if (is_global_init(current)) { |
68 | yield(); | 68 | yield(); |
69 | down_read(&mm->mmap_sem); | 69 | down_read(&mm->mmap_sem); |
70 | goto survive; | 70 | goto survive; |
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 14c241ccdd..2456b52ed0 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -211,7 +211,7 @@ static int do_out_of_memory(struct pt_regs *regs, unsigned long error_code, | |||
211 | struct mm_struct *mm = tsk->mm; | 211 | struct mm_struct *mm = tsk->mm; |
212 | 212 | ||
213 | up_read(&mm->mmap_sem); | 213 | up_read(&mm->mmap_sem); |
214 | if (is_init(tsk)) { | 214 | if (is_global_init(tsk)) { |
215 | yield(); | 215 | yield(); |
216 | down_read(&mm->mmap_sem); | 216 | down_read(&mm->mmap_sem); |
217 | return 1; | 217 | return 1; |
diff --git a/arch/s390/oprofile/Kconfig b/arch/s390/oprofile/Kconfig deleted file mode 100644 index 208220a5f2..0000000000 --- a/arch/s390/oprofile/Kconfig +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | |||
4 | config PROFILING | ||
5 | bool "Profiling support" | ||
6 | help | ||
7 | Say Y here to enable profiling support mechanisms used by | ||
8 | profilers such as readprofile or OProfile. | ||
9 | |||
10 | |||
11 | config OPROFILE | ||
12 | tristate "OProfile system profiling" | ||
13 | depends on PROFILING | ||
14 | help | ||
15 | OProfile is a profiling system capable of profiling the | ||
16 | whole system, include the kernel, kernel modules, libraries, | ||
17 | and applications. | ||
18 | |||
19 | If unsure, say N. | ||
20 | |||
21 | endmenu | ||
22 | |||
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 44982c1dfa..247f8a65e7 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -758,7 +758,7 @@ source "drivers/Kconfig" | |||
758 | 758 | ||
759 | source "fs/Kconfig" | 759 | source "fs/Kconfig" |
760 | 760 | ||
761 | source "arch/sh/oprofile/Kconfig" | 761 | source "kernel/Kconfig.instrumentation" |
762 | 762 | ||
763 | source "arch/sh/Kconfig.debug" | 763 | source "arch/sh/Kconfig.debug" |
764 | 764 | ||
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index 790ed69b86..5c17de5198 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c | |||
@@ -104,24 +104,3 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
104 | (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); | 104 | (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); |
105 | } | 105 | } |
106 | 106 | ||
107 | /* crashkernel=size@addr specifies the location to reserve for | ||
108 | * a crash kernel. By reserving this memory we guarantee | ||
109 | * that linux never sets it up as a DMA target. | ||
110 | * Useful for holding code to do something appropriate | ||
111 | * after a kernel panic. | ||
112 | */ | ||
113 | static int __init parse_crashkernel(char *arg) | ||
114 | { | ||
115 | unsigned long size, base; | ||
116 | size = memparse(arg, &arg); | ||
117 | if (*arg == '@') { | ||
118 | base = memparse(arg+1, &arg); | ||
119 | /* FIXME: Do I want a sanity check | ||
120 | * to validate the memory range? | ||
121 | */ | ||
122 | crashk_res.start = base; | ||
123 | crashk_res.end = base + size - 1; | ||
124 | } | ||
125 | return 0; | ||
126 | } | ||
127 | early_param("crashkernel", parse_crashkernel); | ||
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index b4469992d6..6d7f2b07e4 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
@@ -121,7 +121,7 @@ void machine_power_off(void) | |||
121 | void show_regs(struct pt_regs * regs) | 121 | void show_regs(struct pt_regs * regs) |
122 | { | 122 | { |
123 | printk("\n"); | 123 | printk("\n"); |
124 | printk("Pid : %d, Comm: %20s\n", current->pid, current->comm); | 124 | printk("Pid : %d, Comm: %20s\n", task_pid_nr(current), current->comm); |
125 | print_symbol("PC is at %s\n", instruction_pointer(regs)); | 125 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
126 | printk("PC : %08lx SP : %08lx SR : %08lx ", | 126 | printk("PC : %08lx SP : %08lx SR : %08lx ", |
127 | regs->pc, regs->regs[15], regs->sr); | 127 | regs->pc, regs->regs[15], regs->sr); |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index b3027a6775..b749403f6b 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -128,6 +128,37 @@ static void __init register_bootmem_low_pages(void) | |||
128 | free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages)); | 128 | free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages)); |
129 | } | 129 | } |
130 | 130 | ||
131 | #ifdef CONFIG_KEXEC | ||
132 | static void __init reserve_crashkernel(void) | ||
133 | { | ||
134 | unsigned long long free_mem; | ||
135 | unsigned long long crash_size, crash_base; | ||
136 | int ret; | ||
137 | |||
138 | free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; | ||
139 | |||
140 | ret = parse_crashkernel(boot_command_line, free_mem, | ||
141 | &crash_size, &crash_base); | ||
142 | if (ret == 0 && crash_size) { | ||
143 | if (crash_base > 0) { | ||
144 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
145 | "for crashkernel (System RAM: %ldMB)\n", | ||
146 | (unsigned long)(crash_size >> 20), | ||
147 | (unsigned long)(crash_base >> 20), | ||
148 | (unsigned long)(free_mem >> 20)); | ||
149 | crashk_res.start = crash_base; | ||
150 | crashk_res.end = crash_base + crash_size - 1; | ||
151 | reserve_bootmem(crash_base, crash_size); | ||
152 | } else | ||
153 | printk(KERN_INFO "crashkernel reservation failed - " | ||
154 | "you have to specify a base address\n"); | ||
155 | } | ||
156 | } | ||
157 | #else | ||
158 | static inline void __init reserve_crashkernel(void) | ||
159 | {} | ||
160 | #endif | ||
161 | |||
131 | void __init setup_bootmem_allocator(unsigned long free_pfn) | 162 | void __init setup_bootmem_allocator(unsigned long free_pfn) |
132 | { | 163 | { |
133 | unsigned long bootmap_size; | 164 | unsigned long bootmap_size; |
@@ -189,11 +220,8 @@ void __init setup_bootmem_allocator(unsigned long free_pfn) | |||
189 | } | 220 | } |
190 | } | 221 | } |
191 | #endif | 222 | #endif |
192 | #ifdef CONFIG_KEXEC | 223 | |
193 | if (crashk_res.start != crashk_res.end) | 224 | reserve_crashkernel(); |
194 | reserve_bootmem(crashk_res.start, | ||
195 | crashk_res.end - crashk_res.start + 1); | ||
196 | #endif | ||
197 | } | 225 | } |
198 | 226 | ||
199 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 227 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index 2f42442cf1..ca754fd424 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c | |||
@@ -382,7 +382,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
382 | set_fs(USER_DS); | 382 | set_fs(USER_DS); |
383 | 383 | ||
384 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", | 384 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", |
385 | current->comm, current->pid, frame, regs->pc, regs->pr); | 385 | current->comm, task_pid_nr(current), frame, regs->pc, regs->pr); |
386 | 386 | ||
387 | flush_cache_sigtramp(regs->pr); | 387 | flush_cache_sigtramp(regs->pr); |
388 | 388 | ||
@@ -462,7 +462,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
462 | set_fs(USER_DS); | 462 | set_fs(USER_DS); |
463 | 463 | ||
464 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", | 464 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", |
465 | current->comm, current->pid, frame, regs->pc, regs->pr); | 465 | current->comm, task_pid_nr(current), frame, regs->pc, regs->pr); |
466 | 466 | ||
467 | flush_cache_sigtramp(regs->pr); | 467 | flush_cache_sigtramp(regs->pr); |
468 | 468 | ||
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index dcb46e71da..cf99111cb3 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c | |||
@@ -95,8 +95,8 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
95 | print_modules(); | 95 | print_modules(); |
96 | show_regs(regs); | 96 | show_regs(regs); |
97 | 97 | ||
98 | printk("Process: %s (pid: %d, stack limit = %p)\n", | 98 | printk("Process: %s (pid: %d, stack limit = %p)\n", current->comm, |
99 | current->comm, current->pid, task_stack_page(current) + 1); | 99 | task_pid_nr(current), task_stack_page(current) + 1); |
100 | 100 | ||
101 | if (!user_mode(regs) || in_interrupt()) | 101 | if (!user_mode(regs) || in_interrupt()) |
102 | dump_mem("Stack: ", regs->regs[15], THREAD_SIZE + | 102 | dump_mem("Stack: ", regs->regs[15], THREAD_SIZE + |
@@ -386,7 +386,8 @@ static int handle_unaligned_access(u16 instruction, struct pt_regs *regs) | |||
386 | 386 | ||
387 | printk(KERN_NOTICE "Fixing up unaligned userspace access " | 387 | printk(KERN_NOTICE "Fixing up unaligned userspace access " |
388 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", | 388 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", |
389 | current->comm,current->pid,(u16*)regs->pc,instruction); | 389 | current->comm, task_pid_nr(current), |
390 | (u16 *)regs->pc, instruction); | ||
390 | } | 391 | } |
391 | 392 | ||
392 | ret = -EFAULT; | 393 | ret = -EFAULT; |
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 4729668ce5..f33cedb353 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c | |||
@@ -207,7 +207,7 @@ no_context: | |||
207 | */ | 207 | */ |
208 | out_of_memory: | 208 | out_of_memory: |
209 | up_read(&mm->mmap_sem); | 209 | up_read(&mm->mmap_sem); |
210 | if (is_init(current)) { | 210 | if (is_global_init(current)) { |
211 | yield(); | 211 | yield(); |
212 | down_read(&mm->mmap_sem); | 212 | down_read(&mm->mmap_sem); |
213 | goto survive; | 213 | goto survive; |
diff --git a/arch/sh/oprofile/Kconfig b/arch/sh/oprofile/Kconfig deleted file mode 100644 index 5ade19801b..0000000000 --- a/arch/sh/oprofile/Kconfig +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | depends on EXPERIMENTAL | ||
4 | |||
5 | config PROFILING | ||
6 | bool "Profiling support (EXPERIMENTAL)" | ||
7 | help | ||
8 | Say Y here to enable the extended profiling support mechanisms used | ||
9 | by profilers such as OProfile. | ||
10 | |||
11 | |||
12 | config OPROFILE | ||
13 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
14 | depends on PROFILING | ||
15 | help | ||
16 | OProfile is a profiling system capable of profiling the | ||
17 | whole system, include the kernel, kernel modules, libraries, | ||
18 | and applications. | ||
19 | |||
20 | If unsure, say N. | ||
21 | |||
22 | endmenu | ||
23 | |||
diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig index b3327ce8e8..ba204bac49 100644 --- a/arch/sh64/Kconfig +++ b/arch/sh64/Kconfig | |||
@@ -284,7 +284,7 @@ source "drivers/Kconfig" | |||
284 | 284 | ||
285 | source "fs/Kconfig" | 285 | source "fs/Kconfig" |
286 | 286 | ||
287 | source "arch/sh64/oprofile/Kconfig" | 287 | source "kernel/Kconfig.instrumentation" |
288 | 288 | ||
289 | source "arch/sh64/Kconfig.debug" | 289 | source "arch/sh64/Kconfig.debug" |
290 | 290 | ||
diff --git a/arch/sh64/kernel/traps.c b/arch/sh64/kernel/traps.c index 9d0d58fb29..c03101fab4 100644 --- a/arch/sh64/kernel/traps.c +++ b/arch/sh64/kernel/traps.c | |||
@@ -764,7 +764,7 @@ static int misaligned_fixup(struct pt_regs *regs) | |||
764 | --user_mode_unaligned_fixup_count; | 764 | --user_mode_unaligned_fixup_count; |
765 | /* Only do 'count' worth of these reports, to remove a potential DoS against syslog */ | 765 | /* Only do 'count' worth of these reports, to remove a potential DoS against syslog */ |
766 | printk("Fixing up unaligned userspace access in \"%s\" pid=%d pc=0x%08x ins=0x%08lx\n", | 766 | printk("Fixing up unaligned userspace access in \"%s\" pid=%d pc=0x%08x ins=0x%08lx\n", |
767 | current->comm, current->pid, (__u32)regs->pc, opcode); | 767 | current->comm, task_pid_nr(current), (__u32)regs->pc, opcode); |
768 | } else | 768 | } else |
769 | #endif | 769 | #endif |
770 | if (!user_mode(regs) && (kernel_mode_unaligned_fixup_count > 0)) { | 770 | if (!user_mode(regs) && (kernel_mode_unaligned_fixup_count > 0)) { |
@@ -774,7 +774,7 @@ static int misaligned_fixup(struct pt_regs *regs) | |||
774 | (__u32)regs->pc, opcode); | 774 | (__u32)regs->pc, opcode); |
775 | } else { | 775 | } else { |
776 | printk("Fixing up unaligned kernelspace access in \"%s\" pid=%d pc=0x%08x ins=0x%08lx\n", | 776 | printk("Fixing up unaligned kernelspace access in \"%s\" pid=%d pc=0x%08x ins=0x%08lx\n", |
777 | current->comm, current->pid, (__u32)regs->pc, opcode); | 777 | current->comm, task_pid_nr(current), (__u32)regs->pc, opcode); |
778 | } | 778 | } |
779 | } | 779 | } |
780 | 780 | ||
diff --git a/arch/sh64/mm/fault.c b/arch/sh64/mm/fault.c index dd81c669c7..7c79a1ba80 100644 --- a/arch/sh64/mm/fault.c +++ b/arch/sh64/mm/fault.c | |||
@@ -81,7 +81,7 @@ static inline void print_vma(struct vm_area_struct *vma) | |||
81 | 81 | ||
82 | static inline void print_task(struct task_struct *tsk) | 82 | static inline void print_task(struct task_struct *tsk) |
83 | { | 83 | { |
84 | printk("Task pid %d\n", tsk->pid); | 84 | printk("Task pid %d\n", task_pid_nr(tsk)); |
85 | } | 85 | } |
86 | 86 | ||
87 | static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address) | 87 | static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address) |
@@ -272,13 +272,13 @@ bad_area: | |||
272 | * usermode, so only need a few */ | 272 | * usermode, so only need a few */ |
273 | count++; | 273 | count++; |
274 | printk("user mode bad_area address=%08lx pid=%d (%s) pc=%08lx\n", | 274 | printk("user mode bad_area address=%08lx pid=%d (%s) pc=%08lx\n", |
275 | address, current->pid, current->comm, | 275 | address, task_pid_nr(current), current->comm, |
276 | (unsigned long) regs->pc); | 276 | (unsigned long) regs->pc); |
277 | #if 0 | 277 | #if 0 |
278 | show_regs(regs); | 278 | show_regs(regs); |
279 | #endif | 279 | #endif |
280 | } | 280 | } |
281 | if (is_init(tsk)) { | 281 | if (is_global_init(tsk)) { |
282 | panic("INIT had user mode bad_area\n"); | 282 | panic("INIT had user mode bad_area\n"); |
283 | } | 283 | } |
284 | tsk->thread.address = address; | 284 | tsk->thread.address = address; |
@@ -320,14 +320,14 @@ no_context: | |||
320 | * us unable to handle the page fault gracefully. | 320 | * us unable to handle the page fault gracefully. |
321 | */ | 321 | */ |
322 | out_of_memory: | 322 | out_of_memory: |
323 | if (is_init(current)) { | 323 | if (is_global_init(current)) { |
324 | panic("INIT out of memory\n"); | 324 | panic("INIT out of memory\n"); |
325 | yield(); | 325 | yield(); |
326 | goto survive; | 326 | goto survive; |
327 | } | 327 | } |
328 | printk("fault:Out of memory\n"); | 328 | printk("fault:Out of memory\n"); |
329 | up_read(&mm->mmap_sem); | 329 | up_read(&mm->mmap_sem); |
330 | if (is_init(current)) { | 330 | if (is_global_init(current)) { |
331 | yield(); | 331 | yield(); |
332 | down_read(&mm->mmap_sem); | 332 | down_read(&mm->mmap_sem); |
333 | goto survive; | 333 | goto survive; |
diff --git a/arch/sh64/oprofile/Kconfig b/arch/sh64/oprofile/Kconfig deleted file mode 100644 index 19d37730b6..0000000000 --- a/arch/sh64/oprofile/Kconfig +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | |||
2 | menu "Profiling support" | ||
3 | depends on EXPERIMENTAL | ||
4 | |||
5 | config PROFILING | ||
6 | bool "Profiling support (EXPERIMENTAL)" | ||
7 | help | ||
8 | Say Y here to enable the extended profiling support mechanisms used | ||
9 | by profilers such as OProfile. | ||
10 | |||
11 | |||
12 | config OPROFILE | ||
13 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
14 | depends on PROFILING | ||
15 | help | ||
16 | OProfile is a profiling system capable of profiling the | ||
17 | whole system, include the kernel, kernel modules, libraries, | ||
18 | and applications. | ||
19 | |||
20 | If unsure, say N. | ||
21 | |||
22 | endmenu | ||
23 | |||
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index c0f4ba109d..527adc808a 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -320,11 +320,7 @@ endmenu | |||
320 | 320 | ||
321 | source "fs/Kconfig" | 321 | source "fs/Kconfig" |
322 | 322 | ||
323 | menu "Instrumentation Support" | 323 | source "kernel/Kconfig.instrumentation" |
324 | |||
325 | source "arch/sparc/oprofile/Kconfig" | ||
326 | |||
327 | endmenu | ||
328 | 324 | ||
329 | source "arch/sparc/Kconfig.debug" | 325 | source "arch/sparc/Kconfig.debug" |
330 | 326 | ||
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c index 003f8eed32..fe562db475 100644 --- a/arch/sparc/kernel/ptrace.c +++ b/arch/sparc/kernel/ptrace.c | |||
@@ -155,7 +155,7 @@ static inline void read_sunos_user(struct pt_regs *regs, unsigned long offset, | |||
155 | /* Rest of them are completely unsupported. */ | 155 | /* Rest of them are completely unsupported. */ |
156 | default: | 156 | default: |
157 | printk("%s [%d]: Wants to read user offset %ld\n", | 157 | printk("%s [%d]: Wants to read user offset %ld\n", |
158 | current->comm, current->pid, offset); | 158 | current->comm, task_pid_nr(current), offset); |
159 | pt_error_return(regs, EIO); | 159 | pt_error_return(regs, EIO); |
160 | return; | 160 | return; |
161 | } | 161 | } |
@@ -222,7 +222,7 @@ static inline void write_sunos_user(struct pt_regs *regs, unsigned long offset, | |||
222 | /* Rest of them are completely unsupported or "no-touch". */ | 222 | /* Rest of them are completely unsupported or "no-touch". */ |
223 | default: | 223 | default: |
224 | printk("%s [%d]: Wants to write user offset %ld\n", | 224 | printk("%s [%d]: Wants to write user offset %ld\n", |
225 | current->comm, current->pid, offset); | 225 | current->comm, task_pid_nr(current), offset); |
226 | goto failure; | 226 | goto failure; |
227 | } | 227 | } |
228 | success: | 228 | success: |
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c index 6c0221e9a9..42bf09db9a 100644 --- a/arch/sparc/kernel/sys_sparc.c +++ b/arch/sparc/kernel/sys_sparc.c | |||
@@ -357,7 +357,7 @@ c_sys_nis_syscall (struct pt_regs *regs) | |||
357 | if (count++ > 5) | 357 | if (count++ > 5) |
358 | return -ENOSYS; | 358 | return -ENOSYS; |
359 | printk ("%s[%d]: Unimplemented SPARC system call %d\n", | 359 | printk ("%s[%d]: Unimplemented SPARC system call %d\n", |
360 | current->comm, current->pid, (int)regs->u_regs[1]); | 360 | current->comm, task_pid_nr(current), (int)regs->u_regs[1]); |
361 | #ifdef DEBUG_UNIMP_SYSCALL | 361 | #ifdef DEBUG_UNIMP_SYSCALL |
362 | show_regs (regs); | 362 | show_regs (regs); |
363 | #endif | 363 | #endif |
diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index f807172cab..28c187c5d9 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c | |||
@@ -866,7 +866,7 @@ asmlinkage int sunos_killpg(int pgrp, int sig) | |||
866 | rcu_read_lock(); | 866 | rcu_read_lock(); |
867 | ret = -EINVAL; | 867 | ret = -EINVAL; |
868 | if (pgrp > 0) | 868 | if (pgrp > 0) |
869 | ret = kill_pgrp(find_pid(pgrp), sig, 0); | 869 | ret = kill_pgrp(find_vpid(pgrp), sig, 0); |
870 | rcu_read_unlock(); | 870 | rcu_read_unlock(); |
871 | 871 | ||
872 | return ret; | 872 | return ret; |
diff --git a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c index 3bc3bff51e..d404e79945 100644 --- a/arch/sparc/kernel/traps.c +++ b/arch/sparc/kernel/traps.c | |||
@@ -38,7 +38,7 @@ struct trap_trace_entry trapbuf[1024]; | |||
38 | 38 | ||
39 | void syscall_trace_entry(struct pt_regs *regs) | 39 | void syscall_trace_entry(struct pt_regs *regs) |
40 | { | 40 | { |
41 | printk("%s[%d]: ", current->comm, current->pid); | 41 | printk("%s[%d]: ", current->comm, task_pid_nr(current)); |
42 | printk("scall<%d> (could be %d)\n", (int) regs->u_regs[UREG_G1], | 42 | printk("scall<%d> (could be %d)\n", (int) regs->u_regs[UREG_G1], |
43 | (int) regs->u_regs[UREG_I0]); | 43 | (int) regs->u_regs[UREG_I0]); |
44 | } | 44 | } |
@@ -99,7 +99,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) | |||
99 | " /_| \\__/ |_\\\n" | 99 | " /_| \\__/ |_\\\n" |
100 | " \\__U_/\n"); | 100 | " \\__U_/\n"); |
101 | 101 | ||
102 | printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter); | 102 | printk("%s(%d): %s [#%d]\n", current->comm, task_pid_nr(current), str, ++die_counter); |
103 | show_regs(regs); | 103 | show_regs(regs); |
104 | add_taint(TAINT_DIE); | 104 | add_taint(TAINT_DIE); |
105 | 105 | ||
diff --git a/arch/sparc/oprofile/Kconfig b/arch/sparc/oprofile/Kconfig deleted file mode 100644 index d8a8408847..0000000000 --- a/arch/sparc/oprofile/Kconfig +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | config PROFILING | ||
2 | bool "Profiling support (EXPERIMENTAL)" | ||
3 | help | ||
4 | Say Y here to enable the extended profiling support mechanisms used | ||
5 | by profilers such as OProfile. | ||
6 | |||
7 | |||
8 | config OPROFILE | ||
9 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
10 | depends on PROFILING | ||
11 | help | ||
12 | OProfile is a profiling system capable of profiling the | ||
13 | whole system, include the kernel, kernel modules, libraries, | ||
14 | and applications. | ||
15 | |||
16 | If unsure, say N. | ||
17 | |||
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index 59c4d752d2..c7a74e3769 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig | |||
@@ -460,20 +460,7 @@ source "drivers/fc4/Kconfig" | |||
460 | 460 | ||
461 | source "fs/Kconfig" | 461 | source "fs/Kconfig" |
462 | 462 | ||
463 | menu "Instrumentation Support" | 463 | source "kernel/Kconfig.instrumentation" |
464 | |||
465 | source "arch/sparc64/oprofile/Kconfig" | ||
466 | |||
467 | config KPROBES | ||
468 | bool "Kprobes (EXPERIMENTAL)" | ||
469 | depends on KALLSYMS && EXPERIMENTAL && MODULES | ||
470 | help | ||
471 | Kprobes allows you to trap at almost any kernel address and | ||
472 | execute a callback function. register_kprobe() establishes | ||
473 | a probepoint and specifies the callback. Kprobes is useful | ||
474 | for kernel debugging, non-intrusive instrumentation and testing. | ||
475 | If in doubt, say "N". | ||
476 | endmenu | ||
477 | 464 | ||
478 | source "arch/sparc64/Kconfig.debug" | 465 | source "arch/sparc64/Kconfig.debug" |
479 | 466 | ||
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 8f7a06e2c7..170d6ca8de 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c | |||
@@ -831,7 +831,7 @@ asmlinkage int sunos_killpg(int pgrp, int sig) | |||
831 | rcu_read_lock(); | 831 | rcu_read_lock(); |
832 | ret = -EINVAL; | 832 | ret = -EINVAL; |
833 | if (pgrp > 0) | 833 | if (pgrp > 0) |
834 | ret = kill_pgrp(find_pid(pgrp), sig, 0); | 834 | ret = kill_pgrp(find_vpid(pgrp), sig, 0); |
835 | rcu_read_unlock(); | 835 | rcu_read_unlock(); |
836 | 836 | ||
837 | return ret; | 837 | return ret; |
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 34573a55b6..e9c7e4f07a 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2225,7 +2225,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) | |||
2225 | " /_| \\__/ |_\\\n" | 2225 | " /_| \\__/ |_\\\n" |
2226 | " \\__U_/\n"); | 2226 | " \\__U_/\n"); |
2227 | 2227 | ||
2228 | printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter); | 2228 | printk("%s(%d): %s [#%d]\n", current->comm, task_pid_nr(current), str, ++die_counter); |
2229 | notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV); | 2229 | notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV); |
2230 | __asm__ __volatile__("flushw"); | 2230 | __asm__ __volatile__("flushw"); |
2231 | __show_regs(regs); | 2231 | __show_regs(regs); |
diff --git a/arch/sparc64/oprofile/Kconfig b/arch/sparc64/oprofile/Kconfig deleted file mode 100644 index d8a8408847..0000000000 --- a/arch/sparc64/oprofile/Kconfig +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | config PROFILING | ||
2 | bool "Profiling support (EXPERIMENTAL)" | ||
3 | help | ||
4 | Say Y here to enable the extended profiling support mechanisms used | ||
5 | by profilers such as OProfile. | ||
6 | |||
7 | |||
8 | config OPROFILE | ||
9 | tristate "OProfile system profiling (EXPERIMENTAL)" | ||
10 | depends on PROFILING | ||
11 | help | ||
12 | OProfile is a profiling system capable of profiling the | ||
13 | whole system, include the kernel, kernel modules, libraries, | ||
14 | and applications. | ||
15 | |||
16 | If unsure, say N. | ||
17 | |||
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c index 3b67de7455..c86cb3091a 100644 --- a/arch/sparc64/solaris/misc.c +++ b/arch/sparc64/solaris/misc.c | |||
@@ -415,7 +415,7 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid) | |||
415 | 415 | ||
416 | switch (cmd) { | 416 | switch (cmd) { |
417 | case 0: /* getpgrp */ | 417 | case 0: /* getpgrp */ |
418 | return process_group(current); | 418 | return task_pgrp_nr(current); |
419 | case 1: /* setpgrp */ | 419 | case 1: /* setpgrp */ |
420 | { | 420 | { |
421 | int (*sys_setpgid)(pid_t,pid_t) = | 421 | int (*sys_setpgid)(pid_t,pid_t) = |
@@ -426,7 +426,7 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid) | |||
426 | ret = sys_setpgid(0, 0); | 426 | ret = sys_setpgid(0, 0); |
427 | if (ret) return ret; | 427 | if (ret) return ret; |
428 | proc_clear_tty(current); | 428 | proc_clear_tty(current); |
429 | return process_group(current); | 429 | return task_pgrp_nr(current); |
430 | } | 430 | } |
431 | case 2: /* getsid */ | 431 | case 2: /* getsid */ |
432 | { | 432 | { |
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 740d8a922e..d8925d2855 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig | |||
@@ -289,4 +289,6 @@ config INPUT | |||
289 | bool | 289 | bool |
290 | default n | 290 | default n |
291 | 291 | ||
292 | source "kernel/Kconfig.instrumentation" | ||
293 | |||
292 | source "arch/um/Kconfig.debug" | 294 | source "arch/um/Kconfig.debug" |
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index bd060551e6..cb3321f8e0 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c | |||
@@ -108,7 +108,7 @@ out_nosemaphore: | |||
108 | * us unable to handle the page fault gracefully. | 108 | * us unable to handle the page fault gracefully. |
109 | */ | 109 | */ |
110 | out_of_memory: | 110 | out_of_memory: |
111 | if (is_init(current)) { | 111 | if (is_global_init(current)) { |
112 | up_read(&mm->mmap_sem); | 112 | up_read(&mm->mmap_sem); |
113 | yield(); | 113 | yield(); |
114 | down_read(&mm->mmap_sem); | 114 | down_read(&mm->mmap_sem); |
diff --git a/arch/um/sys-x86_64/sysrq.c b/arch/um/sys-x86_64/sysrq.c index ce3e07fcf2..7654440318 100644 --- a/arch/um/sys-x86_64/sysrq.c +++ b/arch/um/sys-x86_64/sysrq.c | |||
@@ -15,8 +15,8 @@ void __show_regs(struct pt_regs * regs) | |||
15 | { | 15 | { |
16 | printk("\n"); | 16 | printk("\n"); |
17 | print_modules(); | 17 | print_modules(); |
18 | printk("Pid: %d, comm: %.20s %s %s\n", | 18 | printk("Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current), |
19 | current->pid, current->comm, print_tainted(), init_utsname()->release); | 19 | current->comm, print_tainted(), init_utsname()->release); |
20 | printk("RIP: %04lx:[<%016lx>] ", PT_REGS_CS(regs) & 0xffff, | 20 | printk("RIP: %04lx:[<%016lx>] ", PT_REGS_CS(regs) & 0xffff, |
21 | PT_REGS_RIP(regs)); | 21 | PT_REGS_RIP(regs)); |
22 | printk("\nRSP: %016lx EFLAGS: %08lx\n", PT_REGS_RSP(regs), | 22 | printk("\nRSP: %016lx EFLAGS: %08lx\n", PT_REGS_RSP(regs), |
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig index ace479ab27..b6a50b8b38 100644 --- a/arch/v850/Kconfig +++ b/arch/v850/Kconfig | |||
@@ -331,6 +331,8 @@ source "sound/Kconfig" | |||
331 | 331 | ||
332 | source "drivers/usb/Kconfig" | 332 | source "drivers/usb/Kconfig" |
333 | 333 | ||
334 | source "kernel/Kconfig.instrumentation" | ||
335 | |||
334 | source "arch/v850/Kconfig.debug" | 336 | source "arch/v850/Kconfig.debug" |
335 | 337 | ||
336 | source "security/Kconfig" | 338 | source "security/Kconfig" |
diff --git a/arch/x86/kernel/crash_dump_32.c b/arch/x86/kernel/crash_dump_32.c index 32e75d0731..72d0c56c1b 100644 --- a/arch/x86/kernel/crash_dump_32.c +++ b/arch/x86/kernel/crash_dump_32.c | |||
@@ -47,6 +47,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | |||
47 | if (!kdump_buf_page) { | 47 | if (!kdump_buf_page) { |
48 | printk(KERN_WARNING "Kdump: Kdump buffer page not" | 48 | printk(KERN_WARNING "Kdump: Kdump buffer page not" |
49 | " allocated\n"); | 49 | " allocated\n"); |
50 | kunmap_atomic(vaddr, KM_PTE0); | ||
50 | return -EFAULT; | 51 | return -EFAULT; |
51 | } | 52 | } |
52 | copy_page(kdump_buf_page, vaddr); | 53 | copy_page(kdump_buf_page, vaddr); |
diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c index 3c86b979a4..d58039e8de 100644 --- a/arch/x86/kernel/e820_32.c +++ b/arch/x86/kernel/e820_32.c | |||
@@ -288,7 +288,8 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
288 | request_resource(res, code_resource); | 288 | request_resource(res, code_resource); |
289 | request_resource(res, data_resource); | 289 | request_resource(res, data_resource); |
290 | #ifdef CONFIG_KEXEC | 290 | #ifdef CONFIG_KEXEC |
291 | request_resource(res, &crashk_res); | 291 | if (crashk_res.start != crashk_res.end) |
292 | request_resource(res, &crashk_res); | ||
292 | #endif | 293 | #endif |
293 | } | 294 | } |
294 | } | 295 | } |
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index e422b8159f..57616865d8 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c | |||
@@ -226,7 +226,8 @@ void __init e820_reserve_resources(void) | |||
226 | request_resource(res, &code_resource); | 226 | request_resource(res, &code_resource); |
227 | request_resource(res, &data_resource); | 227 | request_resource(res, &data_resource); |
228 | #ifdef CONFIG_KEXEC | 228 | #ifdef CONFIG_KEXEC |
229 | request_resource(res, &crashk_res); | 229 | if (crashk_res.start != crashk_res.end) |
230 | request_resource(res, &crashk_res); | ||
230 | #endif | 231 | #endif |
231 | } | 232 | } |
232 | } | 233 | } |
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index 8459ca64bc..11b935f4f8 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c | |||
@@ -149,28 +149,6 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
149 | image->start, cpu_has_pae); | 149 | image->start, cpu_has_pae); |
150 | } | 150 | } |
151 | 151 | ||
152 | /* crashkernel=size@addr specifies the location to reserve for | ||
153 | * a crash kernel. By reserving this memory we guarantee | ||
154 | * that linux never sets it up as a DMA target. | ||
155 | * Useful for holding code to do something appropriate | ||
156 | * after a kernel panic. | ||
157 | */ | ||
158 | static int __init parse_crashkernel(char *arg) | ||
159 | { | ||
160 | unsigned long size, base; | ||
161 | size = memparse(arg, &arg); | ||
162 | if (*arg == '@') { | ||
163 | base = memparse(arg+1, &arg); | ||
164 | /* FIXME: Do I want a sanity check | ||
165 | * to validate the memory range? | ||
166 | */ | ||
167 | crashk_res.start = base; | ||
168 | crashk_res.end = base + size - 1; | ||
169 | } | ||
170 | return 0; | ||
171 | } | ||
172 | early_param("crashkernel", parse_crashkernel); | ||
173 | |||
174 | void arch_crash_save_vmcoreinfo(void) | 152 | void arch_crash_save_vmcoreinfo(void) |
175 | { | 153 | { |
176 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE | 154 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE |
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 7450b69710..0d8577f054 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c | |||
@@ -231,33 +231,6 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
231 | image->start); | 231 | image->start); |
232 | } | 232 | } |
233 | 233 | ||
234 | /* crashkernel=size@addr specifies the location to reserve for | ||
235 | * a crash kernel. By reserving this memory we guarantee | ||
236 | * that linux never set's it up as a DMA target. | ||
237 | * Useful for holding code to do something appropriate | ||
238 | * after a kernel panic. | ||
239 | */ | ||
240 | static int __init setup_crashkernel(char *arg) | ||
241 | { | ||
242 | unsigned long size, base; | ||
243 | char *p; | ||
244 | if (!arg) | ||
245 | return -EINVAL; | ||
246 | size = memparse(arg, &p); | ||
247 | if (arg == p) | ||
248 | return -EINVAL; | ||
249 | if (*p == '@') { | ||
250 | base = memparse(p+1, &p); | ||
251 | /* FIXME: Do I want a sanity check to validate the | ||
252 | * memory range? Yes you do, but it's too early for | ||
253 | * e820 -AK */ | ||
254 | crashk_res.start = base; | ||
255 | crashk_res.end = base + size - 1; | ||
256 | } | ||
257 | return 0; | ||
258 | } | ||
259 | early_param("crashkernel", setup_crashkernel); | ||
260 | |||
261 | void arch_crash_save_vmcoreinfo(void) | 234 | void arch_crash_save_vmcoreinfo(void) |
262 | { | 235 | { |
263 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE | 236 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 097aeafce5..044a47745a 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -301,7 +301,7 @@ void show_regs(struct pt_regs * regs) | |||
301 | unsigned long d0, d1, d2, d3, d6, d7; | 301 | unsigned long d0, d1, d2, d3, d6, d7; |
302 | 302 | ||
303 | printk("\n"); | 303 | printk("\n"); |
304 | printk("Pid: %d, comm: %20s\n", current->pid, current->comm); | 304 | printk("Pid: %d, comm: %20s\n", task_pid_nr(current), current->comm); |
305 | printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); | 305 | printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); |
306 | print_symbol("EIP is at %s\n", regs->eip); | 306 | print_symbol("EIP is at %s\n", regs->eip); |
307 | 307 | ||
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index b87a6fd5ba..978dc0196a 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -378,6 +378,49 @@ extern unsigned long __init setup_memory(void); | |||
378 | extern void zone_sizes_init(void); | 378 | extern void zone_sizes_init(void); |
379 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 379 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
380 | 380 | ||
381 | static inline unsigned long long get_total_mem(void) | ||
382 | { | ||
383 | unsigned long long total; | ||
384 | |||
385 | total = max_low_pfn - min_low_pfn; | ||
386 | #ifdef CONFIG_HIGHMEM | ||
387 | total += highend_pfn - highstart_pfn; | ||
388 | #endif | ||
389 | |||
390 | return total << PAGE_SHIFT; | ||
391 | } | ||
392 | |||
393 | #ifdef CONFIG_KEXEC | ||
394 | static void __init reserve_crashkernel(void) | ||
395 | { | ||
396 | unsigned long long total_mem; | ||
397 | unsigned long long crash_size, crash_base; | ||
398 | int ret; | ||
399 | |||
400 | total_mem = get_total_mem(); | ||
401 | |||
402 | ret = parse_crashkernel(boot_command_line, total_mem, | ||
403 | &crash_size, &crash_base); | ||
404 | if (ret == 0 && crash_size > 0) { | ||
405 | if (crash_base > 0) { | ||
406 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
407 | "for crashkernel (System RAM: %ldMB)\n", | ||
408 | (unsigned long)(crash_size >> 20), | ||
409 | (unsigned long)(crash_base >> 20), | ||
410 | (unsigned long)(total_mem >> 20)); | ||
411 | crashk_res.start = crash_base; | ||
412 | crashk_res.end = crash_base + crash_size - 1; | ||
413 | reserve_bootmem(crash_base, crash_size); | ||
414 | } else | ||
415 | printk(KERN_INFO "crashkernel reservation failed - " | ||
416 | "you have to specify a base address\n"); | ||
417 | } | ||
418 | } | ||
419 | #else | ||
420 | static inline void __init reserve_crashkernel(void) | ||
421 | {} | ||
422 | #endif | ||
423 | |||
381 | void __init setup_bootmem_allocator(void) | 424 | void __init setup_bootmem_allocator(void) |
382 | { | 425 | { |
383 | unsigned long bootmap_size; | 426 | unsigned long bootmap_size; |
@@ -453,11 +496,7 @@ void __init setup_bootmem_allocator(void) | |||
453 | } | 496 | } |
454 | } | 497 | } |
455 | #endif | 498 | #endif |
456 | #ifdef CONFIG_KEXEC | 499 | reserve_crashkernel(); |
457 | if (crashk_res.start != crashk_res.end) | ||
458 | reserve_bootmem(crashk_res.start, | ||
459 | crashk_res.end - crashk_res.start + 1); | ||
460 | #endif | ||
461 | } | 500 | } |
462 | 501 | ||
463 | /* | 502 | /* |
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 5a19f0cc5b..cdcba69752 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -191,6 +191,37 @@ static inline void copy_edd(void) | |||
191 | } | 191 | } |
192 | #endif | 192 | #endif |
193 | 193 | ||
194 | #ifdef CONFIG_KEXEC | ||
195 | static void __init reserve_crashkernel(void) | ||
196 | { | ||
197 | unsigned long long free_mem; | ||
198 | unsigned long long crash_size, crash_base; | ||
199 | int ret; | ||
200 | |||
201 | free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; | ||
202 | |||
203 | ret = parse_crashkernel(boot_command_line, free_mem, | ||
204 | &crash_size, &crash_base); | ||
205 | if (ret == 0 && crash_size) { | ||
206 | if (crash_base > 0) { | ||
207 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
208 | "for crashkernel (System RAM: %ldMB)\n", | ||
209 | (unsigned long)(crash_size >> 20), | ||
210 | (unsigned long)(crash_base >> 20), | ||
211 | (unsigned long)(free_mem >> 20)); | ||
212 | crashk_res.start = crash_base; | ||
213 | crashk_res.end = crash_base + crash_size - 1; | ||
214 | reserve_bootmem(crash_base, crash_size); | ||
215 | } else | ||
216 | printk(KERN_INFO "crashkernel reservation failed - " | ||
217 | "you have to specify a base address\n"); | ||
218 | } | ||
219 | } | ||
220 | #else | ||
221 | static inline void __init reserve_crashkernel(void) | ||
222 | {} | ||
223 | #endif | ||
224 | |||
194 | #define EBDA_ADDR_POINTER 0x40E | 225 | #define EBDA_ADDR_POINTER 0x40E |
195 | 226 | ||
196 | unsigned __initdata ebda_addr; | 227 | unsigned __initdata ebda_addr; |
@@ -357,13 +388,7 @@ void __init setup_arch(char **cmdline_p) | |||
357 | } | 388 | } |
358 | } | 389 | } |
359 | #endif | 390 | #endif |
360 | #ifdef CONFIG_KEXEC | 391 | reserve_crashkernel(); |
361 | if (crashk_res.start != crashk_res.end) { | ||
362 | reserve_bootmem_generic(crashk_res.start, | ||
363 | crashk_res.end - crashk_res.start + 1); | ||
364 | } | ||
365 | #endif | ||
366 | |||
367 | paging_init(); | 392 | paging_init(); |
368 | 393 | ||
369 | #ifdef CONFIG_PCI | 394 | #ifdef CONFIG_PCI |
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index 0d79df3c56..6dc394b872 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c | |||
@@ -200,8 +200,8 @@ badframe: | |||
200 | if (show_unhandled_signals && printk_ratelimit()) | 200 | if (show_unhandled_signals && printk_ratelimit()) |
201 | printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx" | 201 | printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx" |
202 | " esp:%lx oeax:%lx\n", | 202 | " esp:%lx oeax:%lx\n", |
203 | current->pid > 1 ? KERN_INFO : KERN_EMERG, | 203 | task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG, |
204 | current->comm, current->pid, frame, regs->eip, | 204 | current->comm, task_pid_nr(current), frame, regs->eip, |
205 | regs->esp, regs->orig_eax); | 205 | regs->esp, regs->orig_eax); |
206 | 206 | ||
207 | force_sig(SIGSEGV, current); | 207 | force_sig(SIGSEGV, current); |
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index b132d3957d..1e9d57256e 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -316,7 +316,7 @@ void show_registers(struct pt_regs *regs) | |||
316 | printk(KERN_EMERG "ds: %04x es: %04x fs: %04x gs: %04x ss: %04x\n", | 316 | printk(KERN_EMERG "ds: %04x es: %04x fs: %04x gs: %04x ss: %04x\n", |
317 | regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss); | 317 | regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss); |
318 | printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", | 318 | printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", |
319 | TASK_COMM_LEN, current->comm, current->pid, | 319 | TASK_COMM_LEN, current->comm, task_pid_nr(current), |
320 | current_thread_info(), current, task_thread_info(current)); | 320 | current_thread_info(), current, task_thread_info(current)); |
321 | /* | 321 | /* |
322 | * When in-kernel, we also print out the stack and code at the | 322 | * When in-kernel, we also print out the stack and code at the |
@@ -622,7 +622,7 @@ fastcall void __kprobes do_general_protection(struct pt_regs * regs, | |||
622 | printk_ratelimit()) | 622 | printk_ratelimit()) |
623 | printk(KERN_INFO | 623 | printk(KERN_INFO |
624 | "%s[%d] general protection eip:%lx esp:%lx error:%lx\n", | 624 | "%s[%d] general protection eip:%lx esp:%lx error:%lx\n", |
625 | current->comm, current->pid, | 625 | current->comm, task_pid_nr(current), |
626 | regs->eip, regs->esp, error_code); | 626 | regs->eip, regs->esp, error_code); |
627 | 627 | ||
628 | force_sig(SIGSEGV, current); | 628 | force_sig(SIGSEGV, current); |
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c index 9f38b12b4a..8bab2b2efa 100644 --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c | |||
@@ -748,7 +748,7 @@ survive: | |||
748 | retval = get_user_pages(current, current->mm, | 748 | retval = get_user_pages(current, current->mm, |
749 | (unsigned long )to, 1, 1, 0, &pg, NULL); | 749 | (unsigned long )to, 1, 1, 0, &pg, NULL); |
750 | 750 | ||
751 | if (retval == -ENOMEM && is_init(current)) { | 751 | if (retval == -ENOMEM && is_global_init(current)) { |
752 | up_read(¤t->mm->mmap_sem); | 752 | up_read(¤t->mm->mmap_sem); |
753 | congestion_wait(WRITE, HZ/50); | 753 | congestion_wait(WRITE, HZ/50); |
754 | goto survive; | 754 | goto survive; |
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index 6555c3d143..4d3e538c57 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c | |||
@@ -471,8 +471,8 @@ bad_area_nosemaphore: | |||
471 | printk_ratelimit()) { | 471 | printk_ratelimit()) { |
472 | printk("%s%s[%d]: segfault at %08lx eip %08lx " | 472 | printk("%s%s[%d]: segfault at %08lx eip %08lx " |
473 | "esp %08lx error %lx\n", | 473 | "esp %08lx error %lx\n", |
474 | tsk->pid > 1 ? KERN_INFO : KERN_EMERG, | 474 | task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, |
475 | tsk->comm, tsk->pid, address, regs->eip, | 475 | tsk->comm, task_pid_nr(tsk), address, regs->eip, |
476 | regs->esp, error_code); | 476 | regs->esp, error_code); |
477 | } | 477 | } |
478 | tsk->thread.cr2 = address; | 478 | tsk->thread.cr2 = address; |
@@ -587,7 +587,7 @@ no_context: | |||
587 | */ | 587 | */ |
588 | out_of_memory: | 588 | out_of_memory: |
589 | up_read(&mm->mmap_sem); | 589 | up_read(&mm->mmap_sem); |
590 | if (is_init(tsk)) { | 590 | if (is_global_init(tsk)) { |
591 | yield(); | 591 | yield(); |
592 | down_read(&mm->mmap_sem); | 592 | down_read(&mm->mmap_sem); |
593 | goto survive; | 593 | goto survive; |
diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c index 5e0e54906c..5149ac136a 100644 --- a/arch/x86/mm/fault_64.c +++ b/arch/x86/mm/fault_64.c | |||
@@ -554,7 +554,7 @@ no_context: | |||
554 | */ | 554 | */ |
555 | out_of_memory: | 555 | out_of_memory: |
556 | up_read(&mm->mmap_sem); | 556 | up_read(&mm->mmap_sem); |
557 | if (is_init(current)) { | 557 | if (is_global_init(current)) { |
558 | yield(); | 558 | yield(); |
559 | goto again; | 559 | goto again; |
560 | } | 560 | } |
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 78cb68f2eb..d2521942e5 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -799,21 +799,6 @@ source "drivers/firmware/Kconfig" | |||
799 | 799 | ||
800 | source fs/Kconfig | 800 | source fs/Kconfig |
801 | 801 | ||
802 | menu "Instrumentation Support" | ||
803 | |||
804 | source "arch/x86/oprofile/Kconfig" | ||
805 | |||
806 | config KPROBES | ||
807 | bool "Kprobes" | ||
808 | depends on KALLSYMS && MODULES | ||
809 | help | ||
810 | Kprobes allows you to trap at almost any kernel address and | ||
811 | execute a callback function. register_kprobe() establishes | ||
812 | a probepoint and specifies the callback. Kprobes is useful | ||
813 | for kernel debugging, non-intrusive instrumentation and testing. | ||
814 | If in doubt, say "N". | ||
815 | endmenu | ||
816 | |||
817 | source "arch/x86_64/Kconfig.debug" | 802 | source "arch/x86_64/Kconfig.debug" |
818 | 803 | ||
819 | source "security/Kconfig" | 804 | source "security/Kconfig" |
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 7fbb44bea3..85ffbb4914 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -251,6 +251,8 @@ config EMBEDDED_RAMDISK_IMAGE | |||
251 | provide one yourself. | 251 | provide one yourself. |
252 | endmenu | 252 | endmenu |
253 | 253 | ||
254 | source "kernel/Kconfig.instrumentation" | ||
255 | |||
254 | source "arch/xtensa/Kconfig.debug" | 256 | source "arch/xtensa/Kconfig.debug" |
255 | 257 | ||
256 | source "security/Kconfig" | 258 | source "security/Kconfig" |
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 8be99c777d..397bcd6ad0 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c | |||
@@ -176,7 +176,7 @@ void do_unhandled(struct pt_regs *regs, unsigned long exccause) | |||
176 | printk("Caught unhandled exception in '%s' " | 176 | printk("Caught unhandled exception in '%s' " |
177 | "(pid = %d, pc = %#010lx) - should not happen\n" | 177 | "(pid = %d, pc = %#010lx) - should not happen\n" |
178 | "\tEXCCAUSE is %ld\n", | 178 | "\tEXCCAUSE is %ld\n", |
179 | current->comm, current->pid, regs->pc, exccause); | 179 | current->comm, task_pid_nr(current), regs->pc, exccause); |
180 | force_sig(SIGILL, current); | 180 | force_sig(SIGILL, current); |
181 | } | 181 | } |
182 | 182 | ||
@@ -228,7 +228,7 @@ do_illegal_instruction(struct pt_regs *regs) | |||
228 | /* If in user mode, send SIGILL signal to current process. */ | 228 | /* If in user mode, send SIGILL signal to current process. */ |
229 | 229 | ||
230 | printk("Illegal Instruction in '%s' (pid = %d, pc = %#010lx)\n", | 230 | printk("Illegal Instruction in '%s' (pid = %d, pc = %#010lx)\n", |
231 | current->comm, current->pid, regs->pc); | 231 | current->comm, task_pid_nr(current), regs->pc); |
232 | force_sig(SIGILL, current); | 232 | force_sig(SIGILL, current); |
233 | } | 233 | } |
234 | 234 | ||
@@ -254,7 +254,7 @@ do_unaligned_user (struct pt_regs *regs) | |||
254 | current->thread.error_code = -3; | 254 | current->thread.error_code = -3; |
255 | printk("Unaligned memory access to %08lx in '%s' " | 255 | printk("Unaligned memory access to %08lx in '%s' " |
256 | "(pid = %d, pc = %#010lx)\n", | 256 | "(pid = %d, pc = %#010lx)\n", |
257 | regs->excvaddr, current->comm, current->pid, regs->pc); | 257 | regs->excvaddr, current->comm, task_pid_nr(current), regs->pc); |
258 | info.si_signo = SIGBUS; | 258 | info.si_signo = SIGBUS; |
259 | info.si_errno = 0; | 259 | info.si_errno = 0; |
260 | info.si_code = BUS_ADRALN; | 260 | info.si_code = BUS_ADRALN; |
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 2f84285994..33f366be32 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c | |||
@@ -145,7 +145,7 @@ bad_area: | |||
145 | */ | 145 | */ |
146 | out_of_memory: | 146 | out_of_memory: |
147 | up_read(&mm->mmap_sem); | 147 | up_read(&mm->mmap_sem); |
148 | if (is_init(current)) { | 148 | if (is_global_init(current)) { |
149 | yield(); | 149 | yield(); |
150 | down_read(&mm->mmap_sem); | 150 | down_read(&mm->mmap_sem); |
151 | goto survive; | 151 | goto survive; |