From 18be29567b54a00edeefab9173d7ab1d50bbab37 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 18 Sep 2014 11:52:21 -0400 Subject: [PATCH] cleaner output for fib numbers --- mod_hello.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; }