Symbian3/PDK/Source/GUID-3D5974E9-0F6C-4BBE-AD41-C405DC286C09.dita
changeset 12 80ef3a206772
equal deleted inserted replaced
11:5072524fcc79 12:80ef3a206772
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <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>
       
    13 <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
       
    14 Communication (IPC) is no longer deterministic.  The crazy scheduler
       
    15 is a tool that is designed to simulate the effect of IPC calls occurring
       
    16 at any time. With this tool, developers can check that their code
       
    17 will still work with the latest version of the kernel.</p><p>Crazy
       
    18 scheduler has two modes of operation:</p><ul>
       
    19 <li><p>Crazy delays</p></li>
       
    20 <li><p>Crazy priorities</p></li>
       
    21 </ul><p><note>Both modes of operation should not be enabled simultaneously
       
    22 since this could cause the system to deadlock.</note></p><p>Ideally,
       
    23 the test cases should be run twice (once with each mode of the crazy
       
    24 scheduler).</p> </section>
       
    25 <section id="GUID-EE0742D8-4050-4307-BBF9-DE00B4CD9D0B"><title>Crazy
       
    26 delay mode</title><p>This mode is used to test the effect of a delay
       
    27 in threads moving between states.</p></section>
       
    28 <section id="GUID-D104CF5B-22F6-4367-8220-3E213583C014"><title>Crazy
       
    29 priority mode</title><p>This mode is used to test the effect of no
       
    30 longer being able to rely on thread priority to synchronize IPC calls.
       
    31 In this mode, an IPC call can occur at any time. </p></section>
       
    32 <section id="GUID-D23075E3-C015-4ECF-A0E2-65553B3506E5"><title>Prerequisites</title><p>Your build should have the crazy scheduler present. It is present
       
    33 in the udeb version of a build and is disabled by default.</p></section>
       
    34 <section id="GUID-03C46CE1-6ED6-4448-A804-E023D25477E1"><title>Limitations</title><p>Crazy scheduler will only work on the udeb version of a build.
       
    35 Crazy scheduler in crazy priority mode does not impact the system
       
    36 as heavily as the crazy scheduler in crazy delay mode. Crazy Priority
       
    37 mode can only be enabled at ROM time or boot time (for the emulator).
       
    38 Do not expect this tool to find all the issues associated with IPC
       
    39 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
       
    40 delay mode enabled, the booting process can take a long time. In fact
       
    41 it can appear that it has hung. To reduce the boot time, it is advisable
       
    42 to do the following:<ul>
       
    43 <li><p>Format the user NAND (C:) partition using a regular ROM image
       
    44 before booting the build with the crazy scheduler enabled.</p></li>
       
    45 </ul>It is advisable to execute the crazy scheduling tests on both
       
    46 the emulator and on hardware. </note></p></section>
       
    47 <section id="GUID-B7C2FAE4-4DA7-4678-BB9E-788E884BEDC4"><title>How
       
    48 to enable the crazy scheduler</title><p>The Crazy scheduler can be
       
    49 used on both the emulator and hardware builds.</p></section>
       
    50 <section id="GUID-A0B0C64D-5366-47C7-9599-5E528855C36E"><title>Enabling
       
    51 for hardware</title><p>If the crazy scheduler is to be executed on
       
    52 hardware, then there are two ways to enable it:</p><ul>
       
    53 <li><p>Add the parameters -DCRAZYSCHEDDELAY (for the crazy delay)
       
    54 or -DCRAZYSCHEDPRIO (for crazy priority) to the buildrom arguments.
       
    55 Do not enable both parameters at the same time.</p></li>
       
    56 </ul><p>There are other ways of enabling the two modes of the crazy
       
    57 scheduler:</p><ul>
       
    58 <li><p>To enable the crazy priorities mode, include the following
       
    59 line into the relevant iby/oby file:</p><p>CRAZYSCHEDULING(on)</p></li>
       
    60 <li><p>To enable the crazy delay mode , include the following line
       
    61 into the relevant iby/oby file: </p><p>kerneltrace 0x80000000 0 0x20
       
    62 0 0 0 0 0</p></li>
       
    63 </ul></section>
       
    64 <section id="GUID-EEF30371-BF17-4C14-BC06-8C8C92E514DC"><title>Enabling
       
    65 for the emulator</title><p>If the crazy scheduler is to run on the
       
    66 emulator, then:</p><ul>
       
    67 <li><p>To enable crazy delays, add the following line to the \epoc\data\epoc.ini
       
    68 file:</p><p>debugmask2 0x20</p></li>
       
    69 <li><p>To enable crazy priorities, add the following line to the \epoc32\data\epoc.ini
       
    70 file:</p><p>crazyscheduling on</p></li>
       
    71 </ul><p><note>Do not enable both crazy delays and crazy priorities
       
    72 on at once.</note></p></section>
       
    73 <section id="GUID-1D6341AB-D9F1-4F39-AD93-3DF0B408EE4A"><title>Runtime
       
    74 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
       
    75 be used from within EShell:</p><table id="GUID-B3A9D71D-ED36-4FB4-AEB6-01B4C9AD78CF">
       
    76 <tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
       
    77 <tbody>
       
    78 <row>
       
    79 <entry><p><b>Command</b></p></entry>
       
    80 <entry><p><b>Description</b></p></entry>
       
    81 </row>
       
    82 <row>
       
    83 <entry><p>trace on 69</p></entry>
       
    84 <entry><p>Enable crazy delays</p></entry>
       
    85 </row>
       
    86 <row>
       
    87 <entry><p>trace off 69</p></entry>
       
    88 <entry><p>Disable crazy delays</p></entry>
       
    89 </row>
       
    90 </tbody>
       
    91 </tgroup>
       
    92 </table><p><note>Crazy priority cannot be toggled on or off at runtime.</note></p></section>
       
    93 <section id="GUID-B1284B69-ECCF-4265-A2A6-50C7AC0BD7BB"><title>State
       
    94 of the crazy scheduler</title><p>The state of the crazy scheduler
       
    95 can be obtained by executing the following in EShell:</p><ul>
       
    96 <li><p>sysinfo</p></li>
       
    97 </ul><p>The output will tell you which of the crazy scheduler modes
       
    98 are enabled or disabled.</p></section>
       
    99 <section id="GUID-582EB310-2404-455B-B9F8-59D1367D4E36"><title>How
       
   100 to obtain the output from the crazy scheduler</title><p>The crazy
       
   101 scheduler does not produce output as such, instead it is expected
       
   102 to work in conjunction with other test tools. The only output from
       
   103 this tool is whether an application will still work or not.</p></section>
       
   104 <section id="GUID-C47E10B3-DA1F-47EE-BAB8-536055580C95"><title>How
       
   105 to interpret the output from the crazy scheduler</title><p>As for
       
   106 above. </p></section>
       
   107 </conbody><related-links>
       
   108 <link href="GUID-7FB63DAA-FBFD-4485-919F-5FEFBBC53B97.dita"><linktext>SMP
       
   109 Tools Overview</linktext></link>
       
   110 </related-links></concept>