* [PATCH] powerpc/time: Fix tracing in time.c
@ 2017-06-20 6:20 Santosh Sivaraj
2017-06-20 7:02 ` Naveen N . Rao
0 siblings, 1 reply; 4+ messages in thread
From: Santosh Sivaraj @ 2017-06-20 6:20 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Naveen N . Rao
Since trace_clock is in a different file and already marked with notrace,
enable tracing in time.c by removing it from the disabled list in Makefile.
Also annotate clocksource read functions and sched_clock with notrace.
Testing: Timer and ftrace selftests run with different trace clocks.
CC: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
---
arch/powerpc/kernel/Makefile | 2 --
arch/powerpc/kernel/time.c | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index e132902..0845eeb 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -25,8 +25,6 @@ CFLAGS_REMOVE_cputable.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_prom_init.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_btext.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_prom.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
-# timers used by tracing
-CFLAGS_REMOVE_time.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
endif
obj-y := cputable.o ptrace.o syscalls.o \
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 2b33cfa..6d10c5f 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -675,7 +675,7 @@ EXPORT_SYMBOL_GPL(tb_to_ns);
* the high 64 bits of a * b, i.e. (a * b) >> 64, where a and b
* are 64-bit unsigned numbers.
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
if (__USE_RTC())
return get_rtc();
@@ -823,12 +823,12 @@ void read_persistent_clock(struct timespec *ts)
}
/* clocksource code */
-static u64 rtc_read(struct clocksource *cs)
+static notrace u64 rtc_read(struct clocksource *cs)
{
return (u64)get_rtc();
}
-static u64 timebase_read(struct clocksource *cs)
+static notrace u64 timebase_read(struct clocksource *cs)
{
return (u64)get_tb();
}
--
2.9.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/time: Fix tracing in time.c
2017-06-20 6:20 [PATCH] powerpc/time: Fix tracing in time.c Santosh Sivaraj
@ 2017-06-20 7:02 ` Naveen N . Rao
2017-06-20 7:44 ` Santosh Sivaraj
0 siblings, 1 reply; 4+ messages in thread
From: Naveen N . Rao @ 2017-06-20 7:02 UTC (permalink / raw)
To: Santosh Sivaraj; +Cc: linuxppc-dev
On 2017/06/20 11:50AM, Santosh Sivaraj wrote:
> Since trace_clock is in a different file and already marked with notrace,
> enable tracing in time.c by removing it from the disabled list in Makefile.
> Also annotate clocksource read functions and sched_clock with notrace.
>
> Testing: Timer and ftrace selftests run with different trace clocks.
>
> CC: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
Thanks for doing this! Apart from the minor nit below:
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/Makefile | 2 --
> arch/powerpc/kernel/time.c | 6 +++---
> 2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
> index e132902..0845eeb 100644
> --- a/arch/powerpc/kernel/Makefile
> +++ b/arch/powerpc/kernel/Makefile
> @@ -25,8 +25,6 @@ CFLAGS_REMOVE_cputable.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> CFLAGS_REMOVE_prom_init.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> CFLAGS_REMOVE_btext.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> CFLAGS_REMOVE_prom.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> -# timers used by tracing
> -CFLAGS_REMOVE_time.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> endif
>
> obj-y := cputable.o ptrace.o syscalls.o \
> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
> index 2b33cfa..6d10c5f 100644
> --- a/arch/powerpc/kernel/time.c
> +++ b/arch/powerpc/kernel/time.c
> @@ -675,7 +675,7 @@ EXPORT_SYMBOL_GPL(tb_to_ns);
> * the high 64 bits of a * b, i.e. (a * b) >> 64, where a and b
> * are 64-bit unsigned numbers.
> */
> -unsigned long long sched_clock(void)
> +unsigned long long notrace sched_clock(void)
For the sake of consistency, it's probably better to add the notrace
annotation before the return values, though I see that the prototype in
include/sched.h has used this order.
- Naveen
> {
> if (__USE_RTC())
> return get_rtc();
> @@ -823,12 +823,12 @@ void read_persistent_clock(struct timespec *ts)
> }
>
> /* clocksource code */
> -static u64 rtc_read(struct clocksource *cs)
> +static notrace u64 rtc_read(struct clocksource *cs)
> {
> return (u64)get_rtc();
> }
>
> -static u64 timebase_read(struct clocksource *cs)
> +static notrace u64 timebase_read(struct clocksource *cs)
> {
> return (u64)get_tb();
> }
> --
> 2.9.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] powerpc/time: Fix tracing in time.c
2017-06-20 7:02 ` Naveen N . Rao
@ 2017-06-20 7:44 ` Santosh Sivaraj
2017-06-23 9:15 ` Michael Ellerman
0 siblings, 1 reply; 4+ messages in thread
From: Santosh Sivaraj @ 2017-06-20 7:44 UTC (permalink / raw)
To: naveen.n.rao; +Cc: mpe, linuxppc-dev
Since trace_clock is in a different file and already marked with notrace,
enable tracing in time.c by removing it from the disabled list in Makefile.
Also annotate clocksource read functions and sched_clock with notrace.
Testing: Timer and ftrace selftests run with different trace clocks.
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
---
arch/powerpc/kernel/Makefile | 2 --
arch/powerpc/kernel/time.c | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index e132902..0845eeb 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -25,8 +25,6 @@ CFLAGS_REMOVE_cputable.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_prom_init.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_btext.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_prom.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
-# timers used by tracing
-CFLAGS_REMOVE_time.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
endif
obj-y := cputable.o ptrace.o syscalls.o \
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 2b33cfa..896ba1a 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -675,7 +675,7 @@ EXPORT_SYMBOL_GPL(tb_to_ns);
* the high 64 bits of a * b, i.e. (a * b) >> 64, where a and b
* are 64-bit unsigned numbers.
*/
-unsigned long long sched_clock(void)
+notrace unsigned long long sched_clock(void)
{
if (__USE_RTC())
return get_rtc();
@@ -823,12 +823,12 @@ void read_persistent_clock(struct timespec *ts)
}
/* clocksource code */
-static u64 rtc_read(struct clocksource *cs)
+static notrace u64 rtc_read(struct clocksource *cs)
{
return (u64)get_rtc();
}
-static u64 timebase_read(struct clocksource *cs)
+static notrace u64 timebase_read(struct clocksource *cs)
{
return (u64)get_tb();
}
--
2.9.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-23 9:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-20 6:20 [PATCH] powerpc/time: Fix tracing in time.c Santosh Sivaraj
2017-06-20 7:02 ` Naveen N . Rao
2017-06-20 7:44 ` Santosh Sivaraj
2017-06-23 9:15 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).