2009-12-11 13:38:53

by limp

[permalink] [raw]
Subject: Finding and chaniging registered clocksources

Hi all,

I have some questions regarding clocksource and I will really appreciate it
if someone is willing to help me.

I know how to force the kernel to use a specific clocksource for driving the
scheduler and verify that this clocksource is used.

However, I don't know how to found out what clocksource Linux has assigned
for other activities apart from the one mentioned (e.g. for timekeeping) and
how to change it, if possible.

For example, I want to find out which clocksource getnstimeofday() is using.
It could be also useful if there is a way to see all the registered
clocksources in the system.

Thanks in advance.

P.S. please cc me.


2009-12-11 14:06:34

by Christoph Lameter

[permalink] [raw]
Subject: Re: Finding and chaniging registered clocksources

On Fri, 11 Dec 2009, Ioannis Kyriakopoulos wrote:

> However, I don't know how to found out what clocksource Linux has assigned
> for other activities apart from the one mentioned (e.g. for timekeeping) and
> how to change it, if possible.

Depends on the subsystem. Code can use time sources as needed but in
general the standard clock is used as a common time base.

> For example, I want to find out which clocksource getnstimeofday() is using.
> It could be also useful if there is a way to see all the registered
> clocksources in the system.

getnstimeofday uses the syste, cllock that can be retrieved using
/sys/devices/system/clocksource/clocksource0/current_clocksource

2009-12-11 14:27:40

by limp

[permalink] [raw]
Subject: RE: Finding and chaniging registered clocksources

Thanks very much for the reply.

>> However, I don't know how to found out what clocksource Linux has
assigned
>> for other activities apart from the one mentioned (e.g. for timekeeping)
and
>> how to change it, if possible.
>
>Depends on the subsystem.

Could you be a little more specific please cause I don't understand?

>getnstimeofday uses the syste, cllock that can be retrieved using
>/sys/devices/system/clocksource/clocksource0/current_clocksource

The problem in my case is that when I execute the above, I get:
cat: can't open
'/sys/devices/system/clocksource/clocksource0/current_clocksource': No such
file or directory
In general, my /sys directory is empty. This file should exist to my
filesystem prior to kernel execution or should it be created by the kernel
when it starts executing; but for some reason it is not being created in my
case?

Thanks.

2009-12-11 14:42:21

by Christoph Lameter

[permalink] [raw]
Subject: RE: Finding and chaniging registered clocksources

On Fri, 11 Dec 2009, Ioannis Kyriakopoulos wrote:

> cat: can't open
> '/sys/devices/system/clocksource/clocksource0/current_clocksource': No such
> file or directory
> In general, my /sys directory is empty. This file should exist to my
> filesystem prior to kernel execution or should it be created by the kernel
> when it starts executing; but for some reason it is not being created in my
> case?

mount -t sys none /sys