This allows to get cycles stamp used for time calculation when clocksource is tsc Signed-off-by: Denis Plotnikov <dplotnikov@xxxxxxxxxxxxx> --- arch/x86/kernel/tsc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index b475f6c..5411b18 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1112,7 +1112,11 @@ static void tsc_resume(struct clocksource *cs) */ static u64 read_tsc(struct clocksource *cs, u64 *cycles_stamp) { - return (u64)rdtsc_ordered(); + u64 tsc = rdtsc_ordered(); + + if (cycles_stamp) + *cycles_stamp = tsc; + return tsc; } static void tsc_cs_mark_unstable(struct clocksource *cs) -- 2.7.4