linux - How to print time in kernel source? -
i'm newbie of linux.
i'm modifying kernel/sys.c in linux kernel source.
to see fluctuation of system calls, want modify source print time.
but think can use printf in kernel source.
how can print time????
one way accomplish use printk
(see http://www.makelinux.net/books/lkd2/ch18lev1sec3 example) , enable printk_times
feature, you'll output in form of
[8804849.737776] kernel bug @ fs/nfs/file.c:321
where these 2 numbers number of seconds , microseconds since system booted.
you can enable in several ways:
- you can define
config_printk_time
kernel config option - at boot time, passing
printk.time=1
- at runtime, issuing
# echo 1 > /sys/module/printk/parameters/time
some resources:
Comments
Post a Comment