Skip to contentSkip to conversation

Kprobes: move aggregate probe handlers and few return probe routines to static

PATCH New Prasanna S Panchamukhi 1 participant 1 message Jun 9, 2005 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kprobes: move aggregate probe handlers and few return probe routines to static

Hi,

This patch moves kprobes aggregate probe handlers and few return probe routines to static.

Thanks
Prasanna

Several aggregate kprobe handlers and return probe routines were unnecessarily made global. This patch moves several global routines to static.

---

 linux-2.6.12-rc6-mm1-prasanna/kernel/kprobes.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
kernel/kprobes.c renamed from kernel/kprobes.c~move-aggr-kprobe-handlers-to-static +8 -7
diff -puN kernel/kprobes.c~move-aggr-kprobe-handlers-to-static kernel/kprobes.c
@@ -82,7 +82,7 @@ struct kprobe *get_kprobe(void *addr)
  * Aggregate handlers for multiple kprobes support - these handlers
  * take care of invoking the individual kprobe handlers on p->list
  */
-int aggr_pre_handler(struct kprobe *p, struct pt_regs *regs)
+static int aggr_pre_handler(struct kprobe *p, struct pt_regs *regs)
 {
 	struct kprobe *kp;
 
@@ -97,8 +97,8 @@ int aggr_pre_handler(struct kprobe *p, s
 	return 0;
 }
 
-void aggr_post_handler(struct kprobe *p, struct pt_regs *regs,
-		unsigned long flags)
+static void aggr_post_handler(struct kprobe *p, struct pt_regs *regs,
+			      unsigned long flags)
 {
 	struct kprobe *kp;
 
@@ -112,7 +112,8 @@ void aggr_post_handler(struct kprobe *p,
 	return;
 }
 
-int aggr_fault_handler(struct kprobe *p, struct pt_regs *regs, int trapnr)
+static int aggr_fault_handler(struct kprobe *p, struct pt_regs *regs,
+			      int trapnr)
 {
 	/*
 	 * if we faulted "during" the execution of a user specified
@@ -153,7 +154,7 @@ struct kretprobe_instance *get_free_rp_i
 	return NULL;
 }
 
-struct kretprobe_instance *get_used_rp_inst(struct kretprobe *rp)
+static struct kretprobe_instance *get_used_rp_inst(struct kretprobe *rp)
 {
 	struct hlist_node *node;
 	struct kretprobe_instance *ri;
@@ -252,7 +253,7 @@ void kprobe_flush_task(struct task_struc
  * This kprobe pre_handler is registered with every kretprobe. When probe
  * hits it will set up the return probe.
  */
-int pre_handler_kretprobe(struct kprobe *p, struct pt_regs *regs)
+static int pre_handler_kretprobe(struct kprobe *p, struct pt_regs *regs)
 {
 	struct kretprobe *rp = container_of(p, struct kretprobe, kp);
 
@@ -261,7 +262,7 @@ int pre_handler_kretprobe(struct kprobe 
 	return 0;
 }
 
-inline void free_rp_inst(struct kretprobe *rp)
+static inline void free_rp_inst(struct kretprobe *rp)
 {
 	struct kretprobe_instance *ri;
 	while ((ri = get_free_rp_inst(rp)) != NULL) {

_

Signature · 5 lines
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<[email protected]>