now with a parameter for the name of the symbol to look up

This commit is contained in:
Vincent Batts 2014-09-18 13:15:59 -04:00
parent 18be29567b
commit 05c5575fd3
1 changed files with 6 additions and 3 deletions

View File

@ -36,17 +36,20 @@ long hello_fib(long times, long n1, long n2)
return next;
}
static char *sym_name = "files";
module_param(sym_name, charp, S_IRUGO);
static int __init hello_init(void)
{
long f_int, f_cap, f_start1, f_start2;
unsigned long sym_addr;
char *sym_name;
char filename[255];
unsigned long jiffies_start, jiffies_diff;
unsigned long sym_addr;
hello_print_hello();
sym_name = "files";
printk("looking up '%s'\n", sym_name);
sym_addr = kallsyms_lookup_name(sym_name);
printk("%s 0x%lx\n", sym_name, sym_addr);