From: Michal Simek <michal.simek@petalogix.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: wuzhangjin@gmail.com, Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: sched_clock - microblaze
Date: Fri, 16 Apr 2010 08:23:10 +0200 [thread overview]
Message-ID: <4BC8024E.6020006@petalogix.com> (raw)
In-Reply-To: <201004152152.03883.arnd@arndb.de>
Arnd Bergmann wrote:
> On Thursday 15 April 2010 21:29:27 Michal Simek wrote:
>>> sched_clock() {
>>> ftrace_stop();
>>> printk(...);
>>> ftrace_start();
>>> ...
>>> }
>> But I am describing different problem. sched_clock is called before
>> kernel initialized timers. Microblaze takes all information from DTS
>> that's means that I am not able to read timer because I even don't know
>> where it is. :-(
>
> You could make sched_clock return zero before the clock is probed, it
> is very unlikely to be needed before that anyway.
First of all - this technique works.
That calling sequence is
main.c: sched_init() -> sched.c: sched_init(); -> init_idle(); ->
sched_clock() without initialized timer which is causing my problems.
Why is sched_clock called in init_idle? Do you get any non zero value on
any ARCH?
Thanks,
Michal
diff --git a/kernel/sched.c b/kernel/sched.c
index 6af210a..bddd918 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5244,7 +5244,7 @@ void __cpuinit init_idle(struct task_struct *idle,
int cpu)
__sched_fork(idle);
idle->state = TASK_RUNNING;
- idle->se.exec_start = sched_clock();
+ idle->se.exec_start = 0;
cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu));
__set_task_cpu(idle, cpu);
--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
next prev parent reply other threads:[~2010-04-16 6:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 14:55 sched_clock - microblaze Michal Simek
2010-04-15 15:04 ` Steven Rostedt
2010-04-15 16:32 ` Michal Simek
2010-04-15 18:12 ` Wu Zhangjin
2010-04-15 19:29 ` Michal Simek
2010-04-15 19:52 ` Arnd Bergmann
2010-04-16 6:23 ` Michal Simek [this message]
2010-04-16 8:37 ` Arnd Bergmann
2010-04-16 9:11 ` Michal Simek
2010-04-15 15:06 ` Steven J. Magnani
2010-04-15 16:21 ` Michal Simek
2010-04-15 18:26 ` Thomas Gleixner
2010-04-15 17:18 ` Wu Zhangjin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BC8024E.6020006@petalogix.com \
--to=michal.simek@petalogix.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=wuzhangjin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox