diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-02-17 03:27:41 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-02-17 04:18:07 -0500 |
commit | 7b2d81d48a2d8e37efb6ce7b4d5ef58822b30d89 (patch) | |
tree | 23987f194dcd91b0ba6d27f7f6e08c178797488e /include/linux/uprobes.h | |
parent | 2b144498350860b6ee9dc57ff27a93ad488de5dc (diff) |
uprobes/core: Clean up, refactor and improve the code
Make the uprobes code readable to me:
- improve the Kconfig text so that a mere mortal gets some idea
what CONFIG_UPROBES=y is really about
- do trivial renames to standardize around the uprobes_*() namespace
- clean up and simplify various code flow details
- separate basic blocks of functionality
- line break artifact and white space related removal
- use standard local varible definition blocks
- use vertical spacing to make things more readable
- remove unnecessary volatile
- restructure comment blocks to make them more uniform and
more readable in general
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Anton Arapov <anton@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Link: http://lkml.kernel.org/n/tip-ewbwhb8o6navvllsauu7k07p@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/uprobes.h')
-rw-r--r-- | include/linux/uprobes.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index f1d13fd140f2..64e45f116b2a 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_UPROBES_H | 1 | #ifndef _LINUX_UPROBES_H |
2 | #define _LINUX_UPROBES_H | 2 | #define _LINUX_UPROBES_H |
3 | /* | 3 | /* |
4 | * Userspace Probes (UProbes) | 4 | * User-space Probes (UProbes) |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -40,8 +40,10 @@ struct uprobe_arch_info {}; | |||
40 | #define uprobe_opcode_sz sizeof(uprobe_opcode_t) | 40 | #define uprobe_opcode_sz sizeof(uprobe_opcode_t) |
41 | 41 | ||
42 | /* flags that denote/change uprobes behaviour */ | 42 | /* flags that denote/change uprobes behaviour */ |
43 | |||
43 | /* Have a copy of original instruction */ | 44 | /* Have a copy of original instruction */ |
44 | #define UPROBES_COPY_INSN 0x1 | 45 | #define UPROBES_COPY_INSN 0x1 |
46 | |||
45 | /* Dont run handlers when first register/ last unregister in progress*/ | 47 | /* Dont run handlers when first register/ last unregister in progress*/ |
46 | #define UPROBES_RUN_HANDLER 0x2 | 48 | #define UPROBES_RUN_HANDLER 0x2 |
47 | 49 | ||
@@ -70,27 +72,23 @@ struct uprobe { | |||
70 | }; | 72 | }; |
71 | 73 | ||
72 | #ifdef CONFIG_UPROBES | 74 | #ifdef CONFIG_UPROBES |
73 | extern int __weak set_bkpt(struct mm_struct *mm, struct uprobe *uprobe, | 75 | extern int __weak set_bkpt(struct mm_struct *mm, struct uprobe *uprobe, unsigned long vaddr); |
74 | unsigned long vaddr); | 76 | extern int __weak set_orig_insn(struct mm_struct *mm, struct uprobe *uprobe, unsigned long vaddr, bool verify); |
75 | extern int __weak set_orig_insn(struct mm_struct *mm, struct uprobe *uprobe, | ||
76 | unsigned long vaddr, bool verify); | ||
77 | extern bool __weak is_bkpt_insn(uprobe_opcode_t *insn); | 77 | extern bool __weak is_bkpt_insn(uprobe_opcode_t *insn); |
78 | extern int register_uprobe(struct inode *inode, loff_t offset, | 78 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer); |
79 | struct uprobe_consumer *consumer); | 79 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer); |
80 | extern void unregister_uprobe(struct inode *inode, loff_t offset, | 80 | extern int uprobe_mmap(struct vm_area_struct *vma); |
81 | struct uprobe_consumer *consumer); | ||
82 | extern int mmap_uprobe(struct vm_area_struct *vma); | ||
83 | #else /* CONFIG_UPROBES is not defined */ | 81 | #else /* CONFIG_UPROBES is not defined */ |
84 | static inline int register_uprobe(struct inode *inode, loff_t offset, | 82 | static inline int |
85 | struct uprobe_consumer *consumer) | 83 | uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer) |
86 | { | 84 | { |
87 | return -ENOSYS; | 85 | return -ENOSYS; |
88 | } | 86 | } |
89 | static inline void unregister_uprobe(struct inode *inode, loff_t offset, | 87 | static inline void |
90 | struct uprobe_consumer *consumer) | 88 | uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer) |
91 | { | 89 | { |
92 | } | 90 | } |
93 | static inline int mmap_uprobe(struct vm_area_struct *vma) | 91 | static inline int uprobe_mmap(struct vm_area_struct *vma) |
94 | { | 92 | { |
95 | return 0; | 93 | return 0; |
96 | } | 94 | } |