[PATCH] Linux Kernel Markers 0.2 for Linux 2.6.17

Mathieu Desnoyers compudj@krystal.dyndns.org
Wed Sep 20 17:19:00 GMT 2006


And here is the sample module to use my jump-marker symbols :

(yes, it works!)

Adresses are taken by hand from /proc/kallsyms for now.

---BEGIN---

/* test-mark.c
 *
 */

#include <linux/marker.h>
#include <linux/module.h>

static void **__mark_subsys_mark1_call = (void**)0xf887580c;
static void **__mark_subsys_mark1_jump_over = (void**)0xf8875814;
static void **__mark_subsys_mark1_jump_call = (void*)0xf8875810;
static void *__this_mark_empty_function = (void*)0xf8875000;

static void *saved_over;

void do_mark1(const char *format, int value)
{
	printk("value is %d\n", value);
}

int init_module(void)
{
	*__mark_subsys_mark1_call = (void*)do_mark1;
	saved_over = *__mark_subsys_mark1_jump_over;
	*__mark_subsys_mark1_jump_over = *__mark_subsys_mark1_jump_call;

	return 0;
}

void cleanup_module(void)
{
	*__mark_subsys_mark1_jump_over = saved_over;
	*__mark_subsys_mark1_call = __this_mark_empty_function;
}

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mathieu Desnoyers");
MODULE_DESCRIPTION("Marker Test");

---END---




OpenPGP public key:	      http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/systemtap/attachments/20060920/de303187/attachment.sig>


More information about the Systemtap mailing list