From e94cb46c2219da504a559d49eeda3e4134b96453 Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 22 Mar 2005 18:36:50 +0000 Subject: *** empty log message *** --- runtime/docs/html/probes_8c-source.html | 183 ++++++++++++++++++-------------- 1 file changed, 102 insertions(+), 81 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 3446e997..5fe6164c 100644 --- a/runtime/docs/html/probes_8c-source.html +++ b/runtime/docs/html/probes_8c-source.html @@ -5,87 +5,108 @@
Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages
-

probes.c

00001 /* -*- linux-c -*- */
-00002 
-00003 /** Create a new map.
-00004  * Maps must be created at module initialization time.
-00005  * @param max_entries The maximum number of entries allowed. Currently that 
-00006  * will be allocated dynamically.
-00007  * @param type Type of values stored in this map. 
-00008  * @return A MAP on success or NULL on failure.
-00009  */
-00010 
-00011 
-00012 static unsigned long (*_stp_lookup_name)(char *name)=(void *)KALLSYMS_LOOKUP_NAME;
-00013 
-00014 void _stp_unregister_jprobes (struct jprobe *probes, int num_probes)
-00015 {
-00016         int i;
-00017         for (i = 0; i < num_probes; i++)
-00018                 unregister_jprobe(&probes[i]);
-00019         dlog ("All jprobes removed\n");
-00020 }
-00021 
-00022 int _stp_register_jprobes (struct jprobe *probes, int num_probes)
-00023 {
-00024         int i, ret ;
-00025         unsigned long addr;
-00026 
-00027         for (i = 0; i < num_probes; i++) {
-00028                 addr =_stp_lookup_name((char *)probes[i].kp.addr);
-00029                 if (addr == 0) {
-00030                         dlog ("ERROR: function %s not found!\n", 
-00031                               (char *)probes[i].kp.addr);
-00032                         ret = -1; /* FIXME */
-00033                         goto out;
-00034                 }
-00035                 dlog("inserting jprobe at %s (%p)\n", probes[i].kp.addr, addr);
-00036                 probes[i].kp.addr = (kprobe_opcode_t *)addr;
-00037                 ret = register_jprobe(&probes[i]);
-00038                 if (ret)
-00039                         goto out;
-00040         }
-00041         return 0;
-00042 out:
-00043         dlog ("probe module initialization failed.  Exiting...\n");
-00044         _stp_unregister_jprobes(probes, i);
-00045         return ret;
-00046 }
-00047 
-00048 void _stp_unregister_kprobes (struct kprobe *probes, int num_probes)
-00049 {
-00050         int i;
-00051         for (i = 0; i < num_probes; i++)
-00052                 unregister_kprobe(&probes[i]);
-00053         dlog ("All kprobes removed\n");
-00054 }
-00055 
-00056 int _stp_register_kprobes (struct kprobe *probes, int num_probes)
-00057 {
-00058         int i, ret ;
-00059         unsigned long addr;
-00060 
-00061         for (i = 0; i < num_probes; i++) {
-00062                 addr =_stp_lookup_name((char *)probes[i].addr);
-00063                 if (addr == 0) {
-00064                         dlog ("ERROR: function %s not found!\n", 
-00065                               (char *)probes[i].addr);
-00066                         ret = -1; /* FIXME */
-00067                         goto out;
-00068                 }
-00069                 dlog("inserting kprobe at %s (%p)\n", probes[i].addr, addr);
-00070                 probes[i].addr = (kprobe_opcode_t *)addr;
-00071                 ret = register_kprobe(&probes[i]);
-00072                 if (ret)
-00073                         goto out;
-00074         }
-00075         return 0;
-00076 out:
-00077         dlog ("probe module initialization failed.  Exiting...\n");
-00078         _stp_unregister_kprobes(probes, i);
-00079         return ret;
-00080 }
+

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 
 

-Generated on Tue Mar 22 00:32:02 2005 for SystemTap. +Generated on Tue Mar 22 10:27:36 2005 for SystemTap. -- cgit