aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@openvz.org>2007-10-19 02:40:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:43 -0400
commit19c5870c0eefd27c6d09d867465e0571262e05d0 (patch)
tree8244d3beb5cc24a75e47bd28a4f3ec7921992338 /arch
parentba25f9dcc4ea6e30839fcab5a5516f2176d5bfed (diff)
Use helpers to obtain task pid in printks (arch code)
One of the easiest things to isolate is the pid printed in kernel log. There was a patch, that made this for arch-independent code, this one makes so for arch/xxx files. It took some time to cross-compile it, but hopefully these are all the printks in arch code. Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/semaphore.c16
-rw-r--r--arch/alpha/kernel/traps.c6
-rw-r--r--arch/alpha/mm/fault.c2
-rw-r--r--arch/arm/kernel/process.c2
-rw-r--r--arch/arm/kernel/ptrace.c8
-rw-r--r--arch/arm/kernel/traps.c10
-rw-r--r--arch/arm/mm/alignment.c2
-rw-r--r--arch/ia64/ia32/sys_ia32.c6
-rw-r--r--arch/ia64/kernel/perfmon.c161
-rw-r--r--arch/ia64/kernel/perfmon_default_smpl.c8
-rw-r--r--arch/ia64/kernel/process.c3
-rw-r--r--arch/ia64/kernel/traps.c6
-rw-r--r--arch/ia64/kernel/unaligned.c5
-rw-r--r--arch/m32r/kernel/traps.c2
-rw-r--r--arch/m68k/kernel/traps.c4
-rw-r--r--arch/mips/kernel/traps.c2
-rw-r--r--arch/parisc/kernel/traps.c10
-rw-r--r--arch/parisc/kernel/unaligned.c2
-rw-r--r--arch/parisc/mm/fault.c2
-rw-r--r--arch/powerpc/kernel/process.c2
-rw-r--r--arch/powerpc/kernel/traps.c2
-rw-r--r--arch/s390/kernel/process.c2
-rw-r--r--arch/sh/kernel/process.c2
-rw-r--r--arch/sh/kernel/signal.c4
-rw-r--r--arch/sh/kernel/traps.c7
-rw-r--r--arch/sh64/kernel/traps.c4
-rw-r--r--arch/sh64/mm/fault.c4
-rw-r--r--arch/sparc/kernel/ptrace.c4
-rw-r--r--arch/sparc/kernel/sys_sparc.c2
-rw-r--r--arch/sparc/kernel/traps.c4
-rw-r--r--arch/sparc64/kernel/traps.c2
-rw-r--r--arch/um/sys-x86_64/sysrq.c4
-rw-r--r--arch/x86/kernel/process_32.c2
-rw-r--r--arch/x86/kernel/signal_32.c4
-rw-r--r--arch/x86/kernel/traps_32.c4
-rw-r--r--arch/x86/mm/fault_32.c4
-rw-r--r--arch/xtensa/kernel/traps.c6
37 files changed, 163 insertions, 157 deletions
diff --git a/arch/alpha/kernel/semaphore.c b/arch/alpha/kernel/semaphore.c
index 8c8aaa205eae..8d2982aa1b8d 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 ec0f05e0d8ff..2dc7f9fed213 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/mm/fault.c b/arch/alpha/mm/fault.c
index e0593e606140..4829f96585b1 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -194,7 +194,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
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/arm/kernel/process.c b/arch/arm/kernel/process.c
index 93b7f8e22dcc..4f1a03124a74 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -265,7 +265,7 @@ void __show_regs(struct pt_regs *regs)
265void show_regs(struct pt_regs * regs) 265void 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 5feee722ea98..4b05dc5c1023 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 8ad47619c079..4764bd9ccee8 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 074b7cb07743..e162cca5917f 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/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index a3405b3c1eef..d025a22eb225 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/perfmon.c b/arch/ia64/kernel/perfmon.c
index f55fa07849c4..59169bf7145f 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
1371error_conflict: 1372error_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));
1375abort: 1376abort:
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
1503invalid_free: 1504invalid_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
5483sanity_check: 5485sanity_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
5578report_spurious1: 5580report_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;
5583report_spurious2: 5585report_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 ff80eab83b38..a7af1cb419f9 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
245static int 245static int
246default_exit(struct task_struct *task, void *buf, struct pt_regs *regs) 246default_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 c613fc0e91cc..2418289ee5ca 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/traps.c b/arch/ia64/kernel/traps.c
index 3aeaf15e468b..78d65cb947d2 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(&regs)->ri, regs.pr); 457 regs.cr_iip + ia64_psr(&regs)->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 fe6aa5a9f8fa..2173de9fe917 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/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c
index 97e0b1c0830e..89ba4a0b5d51 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/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 4e2752a0e89b..97f556fa4932 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/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 7b78d137259f..fa500787152d 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/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index bbf029a184ac..99fd56939afa 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 347bb922e6d0..aebf3c168871 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 1c091b415cd9..b2e3e9a8cece 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/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index ea6ad7a2a7e3..b9d88374f14f 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 9fb4a6849c5a..59c464e26f38 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -881,7 +881,7 @@ void nonrecoverable_exception(struct pt_regs *regs)
881void trace_syscall(struct pt_regs *regs) 881void 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/s390/kernel/process.c b/arch/s390/kernel/process.c
index abb447a3e472..70c57378f426 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/sh/kernel/process.c b/arch/sh/kernel/process.c
index b4469992d6b2..6d7f2b07e491 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -121,7 +121,7 @@ void machine_power_off(void)
121void show_regs(struct pt_regs * regs) 121void 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/signal.c b/arch/sh/kernel/signal.c
index 2f42442cf164..ca754fd42437 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 dcb46e71da1c..cf99111cb33f 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/sh64/kernel/traps.c b/arch/sh64/kernel/traps.c
index 9d0d58fb29fa..c03101fab467 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 7aea586fc3d0..7c79a1ba8059 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
82static inline void print_task(struct task_struct *tsk) 82static 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
87static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address) 87static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address)
@@ -272,7 +272,7 @@ 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);
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c
index 003f8eed32f4..fe562db475e9 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 }
228success: 228success:
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 6c0221e9a9f5..42bf09db9a81 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/traps.c b/arch/sparc/kernel/traps.c
index 3bc3bff51e08..d404e7994527 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
39void syscall_trace_entry(struct pt_regs *regs) 39void 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/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 34573a55b6e5..e9c7e4f07abf 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/um/sys-x86_64/sysrq.c b/arch/um/sys-x86_64/sysrq.c
index ce3e07fcf283..765444031819 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/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 097aeafce5ff..044a47745a5c 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/signal_32.c b/arch/x86/kernel/signal_32.c
index 0d79df3c5631..6dc394b87255 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 b132d3957dfc..1e9d57256eb1 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/mm/fault_32.c b/arch/x86/mm/fault_32.c
index 4fc5e400cf0a..4d3e538c57ab 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;
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index 8be99c777d9d..397bcd6ad08d 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;