summaryrefslogtreecommitdiffstats
path: root/kernel/power/main.c
diff options
context:
space:
mode:
authorHarry Pan <harry.pan@intel.com>2019-02-25 20:36:43 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-04-02 10:53:19 +0200
commitc64546b17bc940643545dd34eac21f51764d633c (patch)
treedf9f9504498caaee4392800ea26f2276fe0161aa /kernel/power/main.c
parentb5dee3130bb4014511f5d0dd46855ed843e3fdc8 (diff)
downloadlinux-c64546b17bc940643545dd34eac21f51764d633c.tar.bz2
PM / sleep: Measure the time of filesystems syncing
Measure the filesystems sync time during system sleep more precisely. Among other things, this allows the pr_cont() to be dropped from ksys_sync_helper() and makes automatic system suspend and hibernation profiling somewhat more straightforward. Signed-off-by: Harry Pan <harry.pan@intel.com> [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r--kernel/power/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 40472a7c5536..4f43e724f6eb 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -54,9 +54,14 @@ EXPORT_SYMBOL_GPL(unlock_system_sleep);
void ksys_sync_helper(void)
{
- pr_info("Syncing filesystems ... ");
+ ktime_t start;
+ long elapsed_msecs;
+
+ start = ktime_get();
ksys_sync();
- pr_cont("done.\n");
+ elapsed_msecs = ktime_to_ms(ktime_sub(ktime_get(), start));
+ pr_info("Filesystems sync: %ld.%03ld seconds\n",
+ elapsed_msecs / MSEC_PER_SEC, elapsed_msecs % MSEC_PER_SEC);
}
EXPORT_SYMBOL_GPL(ksys_sync_helper);