cleaner output for fib numbers
This commit is contained in:
parent
bf92567e5f
commit
18be29567b
1 changed files with 5 additions and 3 deletions
|
@ -42,6 +42,7 @@ static int __init hello_init(void)
|
||||||
unsigned long sym_addr;
|
unsigned long sym_addr;
|
||||||
char *sym_name;
|
char *sym_name;
|
||||||
char filename[255];
|
char filename[255];
|
||||||
|
unsigned long jiffies_start, jiffies_diff;
|
||||||
|
|
||||||
hello_print_hello();
|
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(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_cap = 10000000;
|
||||||
f_start1 = 0;
|
f_start1 = 0;
|
||||||
f_start2 = 1;
|
f_start2 = 1;
|
||||||
f_int = hello_fib(f_cap, f_start1, f_start2);
|
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);
|
jiffies_diff = jiffies - jiffies_start;
|
||||||
printk("[%s] jiffies: %lu\n", __this_module.name, jiffies);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue