aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64
diff options
context:
space:
mode:
authorbibo,mao <bibo.mao@intel.com>2006-10-02 05:17:33 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-02 10:57:16 -0400
commit62c27be0dd8144e11bd3ed054a0fb890579925f8 (patch)
tree1884eaafd723059b903b81db513ca3bf5b06774b /arch/x86_64
parent09b18203d772db318ef92f6908c439ee5a35a4f9 (diff)
[PATCH] kprobe whitespace cleanup
Whitespace is used to indent, this patch cleans up these sentences by kernel coding style. Signed-off-by: bibo, mao <bibo.mao@intel.com> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/kernel/kprobes.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index ffc73ac72485..d04f0ab2ff40 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -270,20 +270,19 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
270 struct pt_regs *regs) 270 struct pt_regs *regs)
271{ 271{
272 unsigned long *sara = (unsigned long *)regs->rsp; 272 unsigned long *sara = (unsigned long *)regs->rsp;
273 struct kretprobe_instance *ri; 273 struct kretprobe_instance *ri;
274 274
275 if ((ri = get_free_rp_inst(rp)) != NULL) { 275 if ((ri = get_free_rp_inst(rp)) != NULL) {
276 ri->rp = rp; 276 ri->rp = rp;
277 ri->task = current; 277 ri->task = current;
278 ri->ret_addr = (kprobe_opcode_t *) *sara; 278 ri->ret_addr = (kprobe_opcode_t *) *sara;
279 279
280 /* Replace the return addr with trampoline addr */ 280 /* Replace the return addr with trampoline addr */
281 *sara = (unsigned long) &kretprobe_trampoline; 281 *sara = (unsigned long) &kretprobe_trampoline;
282 282 add_rp_inst(ri);
283 add_rp_inst(ri); 283 } else {
284 } else { 284 rp->nmissed++;
285 rp->nmissed++; 285 }
286 }
287} 286}
288 287
289int __kprobes kprobe_handler(struct pt_regs *regs) 288int __kprobes kprobe_handler(struct pt_regs *regs)
@@ -405,14 +404,14 @@ no_kprobe:
405 */ 404 */
406int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 405int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
407{ 406{
408 struct kretprobe_instance *ri = NULL; 407 struct kretprobe_instance *ri = NULL;
409 struct hlist_head *head; 408 struct hlist_head *head;
410 struct hlist_node *node, *tmp; 409 struct hlist_node *node, *tmp;
411 unsigned long flags, orig_ret_address = 0; 410 unsigned long flags, orig_ret_address = 0;
412 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 411 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
413 412
414 spin_lock_irqsave(&kretprobe_lock, flags); 413 spin_lock_irqsave(&kretprobe_lock, flags);
415 head = kretprobe_inst_table_head(current); 414 head = kretprobe_inst_table_head(current);
416 415
417 /* 416 /*
418 * It is possible to have multiple instances associated with a given 417 * It is possible to have multiple instances associated with a given
@@ -423,14 +422,14 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
423 * We can handle this because: 422 * We can handle this because:
424 * - instances are always inserted at the head of the list 423 * - instances are always inserted at the head of the list
425 * - when multiple return probes are registered for the same 424 * - when multiple return probes are registered for the same
426 * function, the first instance's ret_addr will point to the 425 * function, the first instance's ret_addr will point to the
427 * real return address, and all the rest will point to 426 * real return address, and all the rest will point to
428 * kretprobe_trampoline 427 * kretprobe_trampoline
429 */ 428 */
430 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 429 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
431 if (ri->task != current) 430 if (ri->task != current)
432 /* another task is sharing our hash bucket */ 431 /* another task is sharing our hash bucket */
433 continue; 432 continue;
434 433
435 if (ri->rp && ri->rp->handler) 434 if (ri->rp && ri->rp->handler)
436 ri->rp->handler(ri, regs); 435 ri->rp->handler(ri, regs);
@@ -454,12 +453,12 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
454 spin_unlock_irqrestore(&kretprobe_lock, flags); 453 spin_unlock_irqrestore(&kretprobe_lock, flags);
455 preempt_enable_no_resched(); 454 preempt_enable_no_resched();
456 455
457 /* 456 /*
458 * By returning a non-zero value, we are telling 457 * By returning a non-zero value, we are telling
459 * kprobe_handler() that we don't want the post_handler 458 * kprobe_handler() that we don't want the post_handler
460 * to run (and have re-enabled preemption) 459 * to run (and have re-enabled preemption)
461 */ 460 */
462 return 1; 461 return 1;
463} 462}
464 463
465/* 464/*