From 655ee2825121e149a9976e562946892efb20aea1 Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 7 Apr 2005 21:48:47 +0000 Subject: *** empty log message *** --- runtime/docs/html/probes_8c-source.html | 209 ++++++++++++++++---------------- 1 file changed, 106 insertions(+), 103 deletions(-) (limited to 'runtime/docs/html/probes_8c-source.html') diff --git a/runtime/docs/html/probes_8c-source.html b/runtime/docs/html/probes_8c-source.html index ab2b831b..6084bad3 100644 --- a/runtime/docs/html/probes_8c-source.html +++ b/runtime/docs/html/probes_8c-source.html @@ -4,107 +4,110 @@ -
Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages
-

probes.c

Go to the documentation of this file.
00001 /* -*- linux-c -*- */
-00002 /** @file probes.c
-00003  * @brief Functions to assist loading and unloading groups of probes.
-00004  */
-00005 
-00006 /** Lookup name.
-00007  * This simply calls the kernel function kallsyms_lookup_name().
-00008  * That function is not exported, so this workaround is required.
-00009  * See the kernel source, kernel/kallsyms.c for more information.
-00010  */
-00011 static unsigned long (*_stp_lookup_name)(char *name)=(void *)KALLSYMS_LOOKUP_NAME;
-00012 
-00013 /** Unregister a group of jprobes.
-00014  * @param probes Pointer to an array of struct jprobe.
-00015  * @param num_probes Number of probes in the array.
-00016  */
-00017 
-00018 void _stp_unregister_jprobes (struct jprobe *probes, int num_probes)
-00019 {
-00020         int i;
-00021         for (i = 0; i < num_probes; i++)
-00022                 unregister_jprobe(&probes[i]);
-00023         dlog ("All jprobes removed\n");
-00024 }
-00025 
-00026 /** Register a group of jprobes.
-00027  * @param probes Pointer to an array of struct jprobe.
-00028  * @param num_probes Number of probes in the array.
-00029  * @return 0 on success.
-00030  */
-00031 
-00032 int _stp_register_jprobes (struct jprobe *probes, int num_probes)
-00033 {
-00034         int i, ret ;
-00035         unsigned long addr;
-00036 
-00037         for (i = 0; i < num_probes; i++) {
-00038                 addr =_stp_lookup_name((char *)probes[i].kp.addr);
-00039                 if (addr == 0) {
-00040                         dlog ("ERROR: function %s not found!\n", 
-00041                               (char *)probes[i].kp.addr);
-00042                         ret = -1; /* FIXME */
-00043                         goto out;
-00044                 }
-00045                 dlog("inserting jprobe at %s (%p)\n", probes[i].kp.addr, addr);
-00046                 probes[i].kp.addr = (kprobe_opcode_t *)addr;
-00047                 ret = register_jprobe(&probes[i]);
-00048                 if (ret)
-00049                         goto out;
-00050         }
-00051         return 0;
-00052 out:
-00053         dlog ("probe module initialization failed.  Exiting...\n");
-00054         _stp_unregister_jprobes(probes, i);
-00055         return ret;
-00056 }
-00057 
-00058 /** Unregister a group of kprobes.
-00059  * @param probes Pointer to an array of struct kprobe.
-00060  * @param num_probes Number of probes in the array.
-00061  */
-00062 
-00063 void _stp_unregister_kprobes (struct kprobe *probes, int num_probes)
-00064 {
-00065         int i;
-00066         for (i = 0; i < num_probes; i++)
-00067                 unregister_kprobe(&probes[i]);
-00068         dlog ("All kprobes removed\n");
-00069 }
-00070 
-00071 /** Register a group of kprobes.
-00072  * @param probes Pointer to an array of struct kprobe.
-00073  * @param num_probes Number of probes in the array.
-00074  * @return 0 on success.
-00075  */
-00076 
-00077 int _stp_register_kprobes (struct kprobe *probes, int num_probes)
-00078 {
-00079         int i, ret ;
-00080         unsigned long addr;
-00081 
-00082         for (i = 0; i < num_probes; i++) {
-00083                 addr =_stp_lookup_name((char *)probes[i].addr);
-00084                 if (addr == 0) {
-00085                         dlog ("ERROR: function %s not found!\n", 
-00086                               (char *)probes[i].addr);
-00087                         ret = -1; /* FIXME */
-00088                         goto out;
-00089                 }
-00090                 dlog("inserting kprobe at %s (%p)\n", probes[i].addr, addr);
-00091                 probes[i].addr = (kprobe_opcode_t *)addr;
-00092                 ret = register_kprobe(&probes[i]);
-00093                 if (ret)
-00094                         goto out;
-00095         }
-00096         return 0;
-00097 out:
-00098         dlog ("probe module initialization failed.  Exiting...\n");
-00099         _stp_unregister_kprobes(probes, i);
-00100         return ret;
-00101 }
-00102 
+
+

probes.c

Go to the documentation of this file.
00001 #ifndef _PROBES_C_ /* -*- linux-c -*- */
+00002 #define _PROBES_C
+00003 
+00004 /** @file probes.c
+00005  * @brief Functions to assist loading and unloading groups of probes.
+00006  */
+00007 
+00008 /** Lookup name.
+00009  * This simply calls the kernel function kallsyms_lookup_name().
+00010  * That function is not exported, so this workaround is required.
+00011  * See the kernel source, kernel/kallsyms.c for more information.
+00012  */
+00013 static unsigned long (*_stp_lookup_name)(char *name)=(void *)KALLSYMS_LOOKUP_NAME;
+00014 
+00015 /** Unregister a group of jprobes.
+00016  * @param probes Pointer to an array of struct jprobe.
+00017  * @param num_probes Number of probes in the array.
+00018  */
+00019 
+00020 void _stp_unregister_jprobes (struct jprobe *probes, int num_probes)
+00021 {
+00022         int i;
+00023         for (i = 0; i < num_probes; i++)
+00024                 unregister_jprobe(&probes[i]);
+00025         _stp_log ("All jprobes removed\n");
+00026 }
+00027 
+00028 /** Register a group of jprobes.
+00029  * @param probes Pointer to an array of struct jprobe.
+00030  * @param num_probes Number of probes in the array.
+00031  * @return 0 on success.
+00032  */
+00033 
+00034 int _stp_register_jprobes (struct jprobe *probes, int num_probes)
+00035 {
+00036         int i, ret ;
+00037         unsigned long addr;
+00038 
+00039         for (i = 0; i < num_probes; i++) {
+00040                 addr =_stp_lookup_name((char *)probes[i].kp.addr);
+00041                 if (addr == 0) {
+00042                         _stp_log ("ERROR: function %s not found!\n", 
+00043                               (char *)probes[i].kp.addr);
+00044                         ret = -1; /* FIXME */
+00045                         goto out;
+00046                 }
+00047                 _stp_log("inserting jprobe at %s (%p)\n", probes[i].kp.addr, addr);
+00048                 probes[i].kp.addr = (kprobe_opcode_t *)addr;
+00049                 ret = register_jprobe(&probes[i]);
+00050                 if (ret)
+00051                         goto out;
+00052         }
+00053         return 0;
+00054 out:
+00055         _stp_log ("probe module initialization failed.  Exiting...\n");
+00056         _stp_unregister_jprobes(probes, i);
+00057         return ret;
+00058 }
+00059 
+00060 /** Unregister a group of kprobes.
+00061  * @param probes Pointer to an array of struct kprobe.
+00062  * @param num_probes Number of probes in the array.
+00063  */
+00064 
+00065 void _stp_unregister_kprobes (struct kprobe *probes, int num_probes)
+00066 {
+00067         int i;
+00068         for (i = 0; i < num_probes; i++)
+00069                 unregister_kprobe(&probes[i]);
+00070         _stp_log ("All kprobes removed\n");
+00071 }
+00072 
+00073 /** Register a group of kprobes.
+00074  * @param probes Pointer to an array of struct kprobe.
+00075  * @param num_probes Number of probes in the array.
+00076  * @return 0 on success.
+00077  */
+00078 
+00079 int _stp_register_kprobes (struct kprobe *probes, int num_probes)
+00080 {
+00081         int i, ret ;
+00082         unsigned long addr;
+00083 
+00084         for (i = 0; i < num_probes; i++) {
+00085                 addr =_stp_lookup_name((char *)probes[i].addr);
+00086                 if (addr == 0) {
+00087                         _stp_log ("ERROR: function %s not found!\n", 
+00088                               (char *)probes[i].addr);
+00089                         ret = -1; /* FIXME */
+00090                         goto out;
+00091                 }
+00092                 _stp_log("inserting kprobe at %s (%p)\n", probes[i].addr, addr);
+00093                 probes[i].addr = (kprobe_opcode_t *)addr;
+00094                 ret = register_kprobe(&probes[i]);
+00095                 if (ret)
+00096                         goto out;
+00097         }
+00098         return 0;
+00099 out:
+00100         _stp_log ("probe module initialization failed.  Exiting...\n");
+00101         _stp_unregister_kprobes(probes, i);
+00102         return ret;
+00103 }
+00104 
+00105 #endif /* _PROBES_C */
 
-- cgit