Skip to content

Commit b035b6d

Browse files
Alexey DobriyanLinus Torvalds
authored andcommitted
[PATCH] Consolidate default sched_clock()
Use attribute(weak). Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5e07e1c commit b035b6d

17 files changed

Lines changed: 10 additions & 137 deletions

File tree

‎arch/alpha/kernel/time.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@ static inline __u32 rpcc(void)
9090
return result;
9191
}
9292

93-
/*
94-
* Scheduler clock - returns current time in nanosec units.
95-
*
96-
* Copied from ARM code for expediency... ;-}
97-
*/
98-
unsigned long long sched_clock(void)
99-
{
100-
return (unsigned long long)jiffies * (1000000000 / HZ);
101-
}
102-
103-
10493
/*
10594
* timer_interrupt() needs to keep up the real-time clock,
10695
* as well as call the "do_timer()" routine every clocktick

‎arch/arm/kernel/time.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ static unsigned long dummy_gettimeoffset(void)
7777
}
7878
#endif
7979

80-
/*
81-
* Scheduler clock - returns current time in nanosec units.
82-
* This is the default implementation. Sub-architecture
83-
* implementations can override this.
84-
*/
85-
unsigned long long __attribute__((weak)) sched_clock(void)
86-
{
87-
return (unsigned long long)jiffies * (1000000000 / HZ);
88-
}
89-
9080
/*
9181
* An implementation of printk_clock() independent from
9282
* sched_clock(). This avoids non-bootable kernels when

‎arch/arm26/kernel/time.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ static unsigned long gettimeoffset(void)
8989
return (offset + LATCH/2) / LATCH;
9090
}
9191

92-
/*
93-
* Scheduler clock - returns current time in nanosec units.
94-
*/
95-
unsigned long long sched_clock(void)
96-
{
97-
return (unsigned long long)jiffies * (1000000000 / HZ);
98-
}
99-
10092
static unsigned long next_rtc_update;
10193

10294
/*

‎arch/avr32/kernel/time.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ static void avr32_hpt_init(unsigned int count)
109109
sysreg_write(COUNT, count);
110110
}
111111

112-
/*
113-
* Scheduler clock - returns current time in nanosec units.
114-
*/
115-
unsigned long long sched_clock(void)
116-
{
117-
/* There must be better ways...? */
118-
return (unsigned long long)jiffies * (1000000000 / HZ);
119-
}
120-
121112
/*
122113
* local_timer_interrupt() does profiling and process accounting on a
123114
* per-CPU basis.

‎arch/cris/kernel/time.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,6 @@ cris_do_profile(struct pt_regs* regs)
216216
#endif
217217
}
218218

219-
/*
220-
* Scheduler clock - returns current time in nanosec units.
221-
*/
222-
unsigned long long sched_clock(void)
223-
{
224-
return (unsigned long long)jiffies * (1000000000 / HZ);
225-
}
226-
227219
static int
228220
__init init_udelay(void)
229221
{

‎arch/h8300/kernel/time.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,3 @@ int do_settimeofday(struct timespec *tv)
118118
}
119119

120120
EXPORT_SYMBOL(do_settimeofday);
121-
122-
unsigned long long sched_clock(void)
123-
{
124-
return (unsigned long long)jiffies * (1000000000 / HZ);
125-
126-
}

‎arch/m32r/kernel/time.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,3 @@ void __init time_init(void)
286286
#error no chip configuration
287287
#endif
288288
}
289-
290-
/*
291-
* Scheduler clock - returns current time in nanosec units.
292-
*/
293-
unsigned long long sched_clock(void)
294-
{
295-
return (unsigned long long)jiffies * (1000000000 / HZ);
296-
}

‎arch/m68k/kernel/time.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,3 @@ int do_settimeofday(struct timespec *tv)
159159
}
160160

161161
EXPORT_SYMBOL(do_settimeofday);
162-
163-
/*
164-
* Scheduler clock - returns current time in ns units.
165-
*/
166-
unsigned long long sched_clock(void)
167-
{
168-
return (unsigned long long)jiffies*(1000000000/HZ);
169-
}
170-

‎arch/m68knommu/kernel/time.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,4 @@ int do_settimeofday(struct timespec *tv)
174174
clock_was_set();
175175
return 0;
176176
}
177-
178-
/*
179-
* Scheduler clock - returns current time in nanosec units.
180-
*/
181-
unsigned long long sched_clock(void)
182-
{
183-
return (unsigned long long)jiffies * (1000000000 / HZ);
184-
}
185-
186177
EXPORT_SYMBOL(do_settimeofday);

‎arch/mips/kernel/time.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,3 @@ EXPORT_SYMBOL(rtc_lock);
455455
EXPORT_SYMBOL(to_tm);
456456
EXPORT_SYMBOL(rtc_mips_set_time);
457457
EXPORT_SYMBOL(rtc_mips_get_time);
458-
459-
unsigned long long sched_clock(void)
460-
{
461-
return (unsigned long long)jiffies*(1000000000/HZ);
462-
}

0 commit comments

Comments
 (0)