projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4208f1
)
powerpc: Add cputime_to_nsecs()
author
Anton Blanchard
<anton@ozlabs.org>
Mon, 13 Jul 2020 08:36:01 +0000
(18:36 +1000)
committer
Michael Ellerman
<mpe@ellerman.id.au>
Thu, 16 Jul 2020 03:12:43 +0000
(13:12 +1000)
Generic code has a wrapper to implement cputime_to_nsecs() on top of
cputime_to_usecs() but we can easily return the full nanosecond
resolution directly.
Signed-off-by: Anton Blanchard <anton@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link:
https://lore.kernel.org/r/20200713083601.1103978-1-anton@ozlabs.org
arch/powerpc/include/asm/cputime.h
patch
|
blob
|
history
diff --git
a/arch/powerpc/include/asm/cputime.h
b/arch/powerpc/include/asm/cputime.h
index 0fccd5ea1e9a277ee8070bd503dbdfe5942ccadd..9335b93924b430b03830e719567c225a4bbaa2eb 100644
(file)
--- a/
arch/powerpc/include/asm/cputime.h
+++ b/
arch/powerpc/include/asm/cputime.h
@@
-36,6
+36,8
@@
static inline unsigned long cputime_to_usecs(const cputime_t ct)
return mulhdu((__force u64) ct, __cputime_usec_factor);
}
+#define cputime_to_nsecs(cputime) tb_to_ns((__force u64)cputime)
+
/*
* PPC64 uses PACA which is task independent for storing accounting data while
* PPC32 uses struct thread_info, therefore at task switch the accounting data