diff options
Diffstat (limited to 'patches/boot_time_opt/0115-fix-initcall-timestamps.patch')
| -rw-r--r-- | patches/boot_time_opt/0115-fix-initcall-timestamps.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/boot_time_opt/0115-fix-initcall-timestamps.patch b/patches/boot_time_opt/0115-fix-initcall-timestamps.patch new file mode 100644 index 0000000..cdf2af1 --- /dev/null +++ b/patches/boot_time_opt/0115-fix-initcall-timestamps.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 5b5ad2c9b9b555d20aeba1f895d0c9d1c2a77776 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
| 3 | Date: Thu, 2 Jun 2016 23:36:32 -0500 | ||
| 4 | Subject: [PATCH 115/124] fix initcall timestamps | ||
| 5 | |||
| 6 | Print more finegrained initcall timings | ||
| 7 | |||
| 8 | use the tsc instead of the jiffies clock for initcall_debug | ||
| 9 | --- | ||
| 10 | init/main.c | 12 ++++++------ | ||
| 11 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/init/main.c b/init/main.c | ||
| 14 | index f1d8c3fdbf05..8358cbe6ab13 100644 | ||
| 15 | --- a/init/main.c | ||
| 16 | +++ b/init/main.c | ||
| 17 | @@ -747,16 +747,16 @@ __setup("initcall_blacklist=", initcall_blacklist); | ||
| 18 | |||
| 19 | static int __init_or_module do_one_initcall_debug(initcall_t fn) | ||
| 20 | { | ||
| 21 | - ktime_t calltime, delta, rettime; | ||
| 22 | + unsigned long long calltime, delta, rettime; | ||
| 23 | unsigned long long duration; | ||
| 24 | int ret; | ||
| 25 | |||
| 26 | - printk(KERN_DEBUG "calling %pF @ %i\n", fn, raw_smp_processor_id()); | ||
| 27 | - calltime = ktime_get(); | ||
| 28 | + printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current)); | ||
| 29 | + calltime = local_clock(); | ||
| 30 | ret = fn(); | ||
| 31 | - rettime = ktime_get(); | ||
| 32 | - delta = ktime_sub(rettime, calltime); | ||
| 33 | - duration = (unsigned long long) ktime_to_ns(delta) >> 10; | ||
| 34 | + rettime = local_clock(); | ||
| 35 | + delta = rettime - calltime; | ||
| 36 | + duration = delta >> 10; | ||
| 37 | printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n", | ||
| 38 | fn, ret, duration); | ||
| 39 | |||
| 40 | -- | ||
| 41 | 2.11.1 | ||
| 42 | |||
