Symbian3/PDK/Source/GUID-3D5974E9-0F6C-4BBE-AD41-C405DC286C09.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 16 Jul 2010 17:23:46 +0100
changeset 12 80ef3a206772
permissions -rw-r--r--
Week 28 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 1897, Bug 344, Bug 2681, Bug 463, Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-3D5974E9-0F6C-4BBE-AD41-C405DC286C09" xml:lang="en"><title>Crazy Scheduler</title><shortdesc>This document describes the crazy scheduler tool.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-BB5A11B3-4EEB-4DD1-A9CF-F0D38BC87527"><title>Introduction</title><p>The adding of new functionality to the kernel has meant that Inter-Process
Communication (IPC) is no longer deterministic.  The crazy scheduler
is a tool that is designed to simulate the effect of IPC calls occurring
at any time. With this tool, developers can check that their code
will still work with the latest version of the kernel.</p><p>Crazy
scheduler has two modes of operation:</p><ul>
<li><p>Crazy delays</p></li>
<li><p>Crazy priorities</p></li>
</ul><p><note>Both modes of operation should not be enabled simultaneously
since this could cause the system to deadlock.</note></p><p>Ideally,
the test cases should be run twice (once with each mode of the crazy
scheduler).</p> </section>
<section id="GUID-EE0742D8-4050-4307-BBF9-DE00B4CD9D0B"><title>Crazy
delay mode</title><p>This mode is used to test the effect of a delay
in threads moving between states.</p></section>
<section id="GUID-D104CF5B-22F6-4367-8220-3E213583C014"><title>Crazy
priority mode</title><p>This mode is used to test the effect of no
longer being able to rely on thread priority to synchronize IPC calls.
In this mode, an IPC call can occur at any time. </p></section>
<section id="GUID-D23075E3-C015-4ECF-A0E2-65553B3506E5"><title>Prerequisites</title><p>Your build should have the crazy scheduler present. It is present
in the udeb version of a build and is disabled by default.</p></section>
<section id="GUID-03C46CE1-6ED6-4448-A804-E023D25477E1"><title>Limitations</title><p>Crazy scheduler will only work on the udeb version of a build.
Crazy scheduler in crazy priority mode does not impact the system
as heavily as the crazy scheduler in crazy delay mode. Crazy Priority
mode can only be enabled at ROM time or boot time (for the emulator).
Do not expect this tool to find all the issues associated with IPC
and synchronization. The crazy delay mode will slow the system down.</p><p><note>When a build is booting with the crazy scheduler in crazy
delay mode enabled, the booting process can take a long time. In fact
it can appear that it has hung. To reduce the boot time, it is advisable
to do the following:<ul>
<li><p>Format the user NAND (C:) partition using a regular ROM image
before booting the build with the crazy scheduler enabled.</p></li>
</ul>It is advisable to execute the crazy scheduling tests on both
the emulator and on hardware. </note></p></section>
<section id="GUID-B7C2FAE4-4DA7-4678-BB9E-788E884BEDC4"><title>How
to enable the crazy scheduler</title><p>The Crazy scheduler can be
used on both the emulator and hardware builds.</p></section>
<section id="GUID-A0B0C64D-5366-47C7-9599-5E528855C36E"><title>Enabling
for hardware</title><p>If the crazy scheduler is to be executed on
hardware, then there are two ways to enable it:</p><ul>
<li><p>Add the parameters -DCRAZYSCHEDDELAY (for the crazy delay)
or -DCRAZYSCHEDPRIO (for crazy priority) to the buildrom arguments.
Do not enable both parameters at the same time.</p></li>
</ul><p>There are other ways of enabling the two modes of the crazy
scheduler:</p><ul>
<li><p>To enable the crazy priorities mode, include the following
line into the relevant iby/oby file:</p><p>CRAZYSCHEDULING(on)</p></li>
<li><p>To enable the crazy delay mode , include the following line
into the relevant iby/oby file: </p><p>kerneltrace 0x80000000 0 0x20
0 0 0 0 0</p></li>
</ul></section>
<section id="GUID-EEF30371-BF17-4C14-BC06-8C8C92E514DC"><title>Enabling
for the emulator</title><p>If the crazy scheduler is to run on the
emulator, then:</p><ul>
<li><p>To enable crazy delays, add the following line to the \epoc\data\epoc.ini
file:</p><p>debugmask2 0x20</p></li>
<li><p>To enable crazy priorities, add the following line to the \epoc32\data\epoc.ini
file:</p><p>crazyscheduling on</p></li>
</ul><p><note>Do not enable both crazy delays and crazy priorities
on at once.</note></p></section>
<section id="GUID-1D6341AB-D9F1-4F39-AD93-3DF0B408EE4A"><title>Runtime
enabling</title><p>The crazy delays can be toggled on or off at runtime.</p><p>To do this, EShell must be running. The following commands can
be used from within EShell:</p><table id="GUID-B3A9D71D-ED36-4FB4-AEB6-01B4C9AD78CF">
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<tbody>
<row>
<entry><p><b>Command</b></p></entry>
<entry><p><b>Description</b></p></entry>
</row>
<row>
<entry><p>trace on 69</p></entry>
<entry><p>Enable crazy delays</p></entry>
</row>
<row>
<entry><p>trace off 69</p></entry>
<entry><p>Disable crazy delays</p></entry>
</row>
</tbody>
</tgroup>
</table><p><note>Crazy priority cannot be toggled on or off at runtime.</note></p></section>
<section id="GUID-B1284B69-ECCF-4265-A2A6-50C7AC0BD7BB"><title>State
of the crazy scheduler</title><p>The state of the crazy scheduler
can be obtained by executing the following in EShell:</p><ul>
<li><p>sysinfo</p></li>
</ul><p>The output will tell you which of the crazy scheduler modes
are enabled or disabled.</p></section>
<section id="GUID-582EB310-2404-455B-B9F8-59D1367D4E36"><title>How
to obtain the output from the crazy scheduler</title><p>The crazy
scheduler does not produce output as such, instead it is expected
to work in conjunction with other test tools. The only output from
this tool is whether an application will still work or not.</p></section>
<section id="GUID-C47E10B3-DA1F-47EE-BAB8-536055580C95"><title>How
to interpret the output from the crazy scheduler</title><p>As for
above. </p></section>
</conbody><related-links>
<link href="GUID-7FB63DAA-FBFD-4485-919F-5FEFBBC53B97.dita"><linktext>SMP
Tools Overview</linktext></link>
</related-links></concept>