cleaner output for fib numbers

This commit is contained in:
Vincent Batts 2014-09-18 11:52:21 -04:00
parent bf92567e5f
commit 18be29567b

View file

@ -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;
}