lkml.org 
[lkml]   [2006]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Linux Kernel Markers 0.2 for Linux 2.6.17
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-09-20 19:21    [W:0.044 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site