diff --git a/mod_hello.c b/mod_hello.c index 9cb7331..98f63c4 100644 --- a/mod_hello.c +++ b/mod_hello.c @@ -42,6 +42,7 @@ static int __init hello_init(void) unsigned long sym_addr; char *sym_name; char filename[255]; + unsigned long jiffies_start, jiffies_diff; hello_print_hello(); @@ -54,14 +55,15 @@ static int __init hello_init(void) printk(KERN_INFO "[%s] %s (0x%lx): %s\n", __this_module.name, sym_name, sym_addr, filename); - printk("[%s] jiffies: %lu\n", __this_module.name, jiffies); + jiffies_start = jiffies; f_cap = 10000000; f_start1 = 0; f_start2 = 1; f_int = hello_fib(f_cap, f_start1, f_start2); - printk("fib of %ld and %ld (up to %ld): %ld\n", f_start1, f_start2, f_cap, f_int); - printk("[%s] jiffies: %lu\n", __this_module.name, jiffies); + jiffies_diff = jiffies - jiffies_start; + printk("[%s] fib of %ld and %ld (up to %ld): %ld (in only %lu jiffies)\n", + __this_module.name, f_start1, f_start2, f_cap, f_int, jiffies_diff); return 0; }