summaryrefslogtreecommitdiffstats
path: root/runtime/probes.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/probes.c')
-rw-r--r--runtime/probes.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/runtime/probes.c b/runtime/probes.c
index cb268e93..8b756251 100644
--- a/runtime/probes.c
+++ b/runtime/probes.c
@@ -1,16 +1,20 @@
/* -*- linux-c -*- */
-
-/** Create a new map.
- * Maps must be created at module initialization time.
- * @param max_entries The maximum number of entries allowed. Currently that
- * will be allocated dynamically.
- * @param type Type of values stored in this map.
- * @return A MAP on success or NULL on failure.
+/** @file probes.c
+ * @brief Functions to assist loading and unloading groups of probes.
*/
-
+/** Lookup name.
+ * This simply calls the kernel function kallsyms_lookup_name().
+ * That function is not exported, so this workaround is required.
+ * See the kernel source, kernel/kallsyms.c for more information.
+ */
static unsigned long (*_stp_lookup_name)(char *name)=(void *)KALLSYMS_LOOKUP_NAME;
+/** Unregister a group of jprobes.
+ * @param probes Pointer to an array of struct jprobe.
+ * @param num_probes Number of probes in the array.
+ */
+
void _stp_unregister_jprobes (struct jprobe *probes, int num_probes)
{
int i;
@@ -19,6 +23,12 @@ void _stp_unregister_jprobes (struct jprobe *probes, int num_probes)
dlog ("All jprobes removed\n");
}
+/** Register a group of jprobes.
+ * @param probes Pointer to an array of struct jprobe.
+ * @param num_probes Number of probes in the array.
+ * @return 0 on success.
+ */
+
int _stp_register_jprobes (struct jprobe *probes, int num_probes)
{
int i, ret ;
@@ -45,6 +55,11 @@ out:
return ret;
}
+/** Unregister a group of kprobes.
+ * @param probes Pointer to an array of struct kprobe.
+ * @param num_probes Number of probes in the array.
+ */
+
void _stp_unregister_kprobes (struct kprobe *probes, int num_probes)
{
int i;
@@ -53,6 +68,12 @@ void _stp_unregister_kprobes (struct kprobe *probes, int num_probes)
dlog ("All kprobes removed\n");
}
+/** Register a group of kprobes.
+ * @param probes Pointer to an array of struct kprobe.
+ * @param num_probes Number of probes in the array.
+ * @return 0 on success.
+ */
+
int _stp_register_kprobes (struct kprobe *probes, int num_probes)
{
int i, ret ;