now with a parameter for the name of the symbol to look up
This commit is contained in:
parent
18be29567b
commit
05c5575fd3
1 changed files with 6 additions and 3 deletions
|
@ -36,17 +36,20 @@ long hello_fib(long times, long n1, long n2)
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static char *sym_name = "files";
|
||||||
|
module_param(sym_name, charp, S_IRUGO);
|
||||||
|
|
||||||
static int __init hello_init(void)
|
static int __init hello_init(void)
|
||||||
{
|
{
|
||||||
long f_int, f_cap, f_start1, f_start2;
|
long f_int, f_cap, f_start1, f_start2;
|
||||||
unsigned long sym_addr;
|
|
||||||
char *sym_name;
|
|
||||||
char filename[255];
|
char filename[255];
|
||||||
unsigned long jiffies_start, jiffies_diff;
|
unsigned long jiffies_start, jiffies_diff;
|
||||||
|
unsigned long sym_addr;
|
||||||
|
|
||||||
|
|
||||||
hello_print_hello();
|
hello_print_hello();
|
||||||
|
|
||||||
sym_name = "files";
|
|
||||||
printk("looking up '%s'\n", sym_name);
|
printk("looking up '%s'\n", sym_name);
|
||||||
sym_addr = kallsyms_lookup_name(sym_name);
|
sym_addr = kallsyms_lookup_name(sym_name);
|
||||||
printk("%s 0x%lx\n", sym_name, sym_addr);
|
printk("%s 0x%lx\n", sym_name, sym_addr);
|
||||||
|
|
Loading…
Reference in a new issue