Revision: 201035
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 02 Sep 2010 21:54:16 +0300
changeset 259 57b9594f5772
parent 247 d8d70de2bd36
child 260 a1a318fd91af
child 266 0008ccd16016
Revision: 201035 Kit: 201035
bsptemplate/asspandvariant/template_assp/traces_usbcc/OstTraceDefinitions.h
bsptemplate/asspandvariant/template_assp/traces_usbcc/fixed_id.definitions
bsptemplate/asspandvariant/template_assp/usbcc.mmp
kernel/eka/bld.inf
kernel/eka/common/des16.cpp
kernel/eka/debug/crashMonitor/inc/crashlogwalker.h
kernel/eka/debug/crashMonitor/inc/scmdatatypes.h
kernel/eka/debug/securityServer/group/rm_debug_svr.mmp
kernel/eka/debug/securityServer/inc/c_process_pair.h
kernel/eka/debug/securityServer/inc/c_security_svr_async.h
kernel/eka/debug/securityServer/inc/c_security_svr_server.h
kernel/eka/debug/securityServer/inc/c_security_svr_session.h
kernel/eka/debug/securityServer/inc/c_shutdown_timer.h
kernel/eka/debug/securityServer/inc/low_mem_requests.h
kernel/eka/debug/securityServer/inc/rm_debug_logging.h
kernel/eka/debug/securityServer/src/c_process_pair.cpp
kernel/eka/debug/securityServer/src/c_security_svr_async.cpp
kernel/eka/debug/securityServer/src/c_security_svr_server.cpp
kernel/eka/debug/securityServer/src/c_security_svr_session.cpp
kernel/eka/debug/securityServer/src/c_shutdown_timer.cpp
kernel/eka/debug/securityServer/src/rm_debug_svr.cpp
kernel/eka/drivers/debug/common/d_debug_functionality.cpp
kernel/eka/drivers/debug/common/debug_utils.h
kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp
kernel/eka/drivers/debug/group/bld.inf
kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmh
kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmp
kernel/eka/drivers/debug/group/rm_debug_kerneldriver_ext.mmp
kernel/eka/drivers/debug/group/sm_debug_kerneldriver.mmp
kernel/eka/drivers/debug/rmdebug/d_debug_agent.cpp
kernel/eka/drivers/debug/rmdebug/d_debug_agent.h
kernel/eka/drivers/debug/rmdebug/d_debug_agent.inl
kernel/eka/drivers/debug/rmdebug/d_driver_event_info.cpp
kernel/eka/drivers/debug/rmdebug/d_driver_event_info.h
kernel/eka/drivers/debug/rmdebug/d_list_manager.cpp
kernel/eka/drivers/debug/rmdebug/d_list_manager.h
kernel/eka/drivers/debug/rmdebug/d_process_tracker.cpp
kernel/eka/drivers/debug/rmdebug/d_process_tracker.h
kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.cpp
kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.h
kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints_debug.inl
kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.cpp
kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.h
kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.inl
kernel/eka/drivers/debug/rmdebug/d_target_process.cpp
kernel/eka/drivers/debug/rmdebug/d_target_process.h
kernel/eka/drivers/debug/rmdebug/rm_debug_eventhandler.cpp
kernel/eka/drivers/debug/rmdebug/rm_debug_kerneldriver.cpp
kernel/eka/drivers/debug/smdebug/d_sm_codeseg.cpp
kernel/eka/drivers/debug/smdebug/d_sm_process.cpp
kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp
kernel/eka/drivers/debug/smdebug/d_stopmode.cpp
kernel/eka/drivers/debug/smdebug/sm_debug_kerneldriver.cpp
kernel/eka/drivers/locmedia/locmedia.cpp
kernel/eka/drivers/medmmc/medmmc.cpp
kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp
kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdio/sdiostack.cpp
kernel/eka/drivers/pbus/mmc/session.cpp
kernel/eka/drivers/pbus/mmc/stack.cpp
kernel/eka/drivers/resmanus/d_resmanus.cpp
kernel/eka/drivers/resourceman/rescontrol_export.cpp
kernel/eka/drivers/resourceman/resourcecontrol.cpp
kernel/eka/drivers/resourceman/resourcecontrol_extended.cpp
kernel/eka/drivers/usbc/d_usbc.cpp
kernel/eka/drivers/usbc/traces/OstTraceDefinitions.h
kernel/eka/drivers/usbc/traces/fixed_id.definitions
kernel/eka/drivers/usbc/usbc.mmp
kernel/eka/drivers/usbc/usbdma.cpp
kernel/eka/drivers/usbcc/chapter9.cpp
kernel/eka/drivers/usbcc/descriptors.cpp
kernel/eka/drivers/usbcc/misc.cpp
kernel/eka/drivers/usbcc/ps_usbc.cpp
kernel/eka/drivers/usbcc/queue.cpp
kernel/eka/drivers/usbcsc/d_usbcsc.cpp
kernel/eka/drivers/usbcsc/traces/OstTraceDefinitions.h
kernel/eka/drivers/usbcsc/traces/fixed_id.definitions
kernel/eka/drivers/usbcsc/usbcsc.mmp
kernel/eka/drivers/usbcsc/usbcsc_bil.cpp
kernel/eka/drivers/usbcsc/usbcsc_bil.mmp
kernel/eka/eabi/rm_debug_extu.def
kernel/eka/eabi/sm_debugu.def
kernel/eka/euser/us_exec.cpp
kernel/eka/include/drivers/gpio.h
kernel/eka/include/drivers/mmc.h
kernel/eka/include/drivers/mmc.inl
kernel/eka/include/drivers/resmanus.h
kernel/eka/include/drivers/resource.h
kernel/eka/include/drivers/resourcecontrol.h
kernel/eka/include/drivers/resourcecontrol.inl
kernel/eka/include/drivers/rm_debug_driver.h
kernel/eka/include/drivers/rm_debug_eventhandler.h
kernel/eka/include/drivers/rm_debug_eventhandler.inl
kernel/eka/include/drivers/rm_debug_kerneldriver.h
kernel/eka/include/drivers/sdcard.h
kernel/eka/include/e32ver.h
kernel/eka/include/kernel/kpower.h
kernel/eka/include/rm_debug_api.h
kernel/eka/include/sm_debug_api.h
kernel/eka/include/u32hal.h
kernel/eka/kernel/power.cpp
kernel/eka/kernel/sexec.cpp
kernel/eka/kernel/sprocess.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mpager.h
kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp
kernel/eka/release.txt
kernel/eka/rombuild/base.iby
kernel/eka/rombuild/rm_debug_svr.iby
kernel/eka/rombuild/sm_debug.iby
kernel/eka/rombuild/user.iby
kernelhwsrv_info/doc_pub/base_how_to_use_t_fatcharsetconv_framework.doc
kernelhwsrv_info/doc_pub/base_migrating_device_drivers_dfc_q.doc
kerneltest/e32test/buffer/t_des.cpp
kerneltest/e32test/demandpaging/t_svrpinning.cpp
kerneltest/e32test/device/t_usb.cpp
kerneltest/e32test/device/t_usb.h
kerneltest/e32test/device/t_usbapi.cpp
kerneltest/e32test/device/t_usbco2.cpp
kerneltest/e32test/device/t_usbcsc.cpp
kerneltest/e32test/domainmgr/dm_autoexec.bat
kerneltest/e32test/domainmgr/dm_tests.iby
kerneltest/e32test/domainmgr/dmtest.auto.bat
kerneltest/e32test/domainmgr/domainpolicy99.mmp
kerneltest/e32test/domainmgr/domainpolicytest.cpp
kerneltest/e32test/domainmgr/domainpolicytest.h
kerneltest/e32test/domainmgr/t_domain.cpp
kerneltest/e32test/domainmgr/t_domain.mmp
kerneltest/e32test/domainmgr/t_domain_slave.cpp
kerneltest/e32test/domainmgr/t_domain_slave.mmp
kerneltest/e32test/domainmgr/test.inf
kerneltest/e32test/domainmgr/tshell_dmtest.oby
kerneltest/e32test/group/bld.inf
kerneltest/e32test/group/domainPolicyTest.mmp
kerneltest/e32test/group/rescontrol_extended_psl.mmp
kerneltest/e32test/group/rescontrol_psl.mmp
kerneltest/e32test/group/t_domain.mmp
kerneltest/e32test/group/t_domain_slave.mmp
kerneltest/e32test/group/t_pci.mmp
kerneltest/e32test/group/t_usb.mmp
kerneltest/e32test/group/t_usb_device.mmp
kerneltest/e32test/group/t_usb_scdevice.mmp
kerneltest/e32test/group/t_usb_transfersrv.mmp
kerneltest/e32test/group/t_usb_transfersrvclient.mmp
kerneltest/e32test/group/t_usbapi.mmp
kerneltest/e32test/group/t_usbcsc.mmp
kerneltest/e32test/heap/t_heapdl.cpp
kerneltest/e32test/mediaext/d_nfe.cpp
kerneltest/e32test/mediaext/t_nfe.cpp
kerneltest/e32test/mmu/d_gobble.cpp
kerneltest/e32test/mmu/t_demandpaging.cpp
kerneltest/e32test/mmu/t_shadow.cpp
kerneltest/e32test/pci/t_pci.cpp
kerneltest/e32test/pci/t_pci.h
kerneltest/e32test/power/d_powermisctest.cpp
kerneltest/e32test/power/d_powermisctest.h
kerneltest/e32test/power/d_powermisctest.mmp
kerneltest/e32test/power/domainpolicytest.cpp
kerneltest/e32test/power/domainpolicytest.h
kerneltest/e32test/power/t_domain.cpp
kerneltest/e32test/power/t_domain_slave.cpp
kerneltest/e32test/power/t_powermisctest.cpp
kerneltest/e32test/power/t_powermisctest.mmp
kerneltest/e32test/resmanus/resourcecontrol.mmp
kerneltest/e32test/resmanus/resourcecontrollerextended.mmp
kerneltest/e32test/resmanus/t_resmanus.cpp
kerneltest/e32test/resmanus/t_resmanus.mmp
kerneltest/e32test/resmanus/t_resmanusextended.mmp
kerneltest/e32test/resmanus/t_resmanuskern.mmp
kerneltest/e32test/resourceman/d_rescontrolcli.cpp
kerneltest/e32test/resourceman/resourceman_psl/rescontrol_extended_psl.cpp
kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.cpp
kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.h
kerneltest/e32test/resourceman/t_rescontrolcli.cpp
kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.cpp
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.h
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2_oemtoken.cpp
kerneltest/e32test/rm_debug/common/t_target_launcher.cpp
kerneltest/e32test/rm_debug/common/t_target_launcher.h
kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h
kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.cia
kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.s
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.s
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.s
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.cpp
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.cpp
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm.cia
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm2.cia
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_app.cpp
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_app.h
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.cpp
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.h
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.cpp
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.h
kerneltest/e32test/rm_debug/group/t_multi_agent_launcher.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2.mmh
kerneltest/e32test/rm_debug/group/t_rmdebug2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oem.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oem2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app1.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app10.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app3.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app4.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app5.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app6.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app7.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app8.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app9.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_dll.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_multi_agent.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_multi_target.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security0.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security1.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security3.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_target_launcher.mmp
kerneltest/e32test/rm_debug/group/t_trkdummyapp.mmp
kerneltest/e32test/rm_debug/metro_trk/d_rmdebugclient.h
kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.cpp
kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.h
kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.cpp
kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.cpp
kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_debug_logging.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.cpp
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.cpp
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.h
kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.cpp
kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.h
kerneltest/e32test/smpsoak/t_smpsoak.cpp
kerneltest/e32test/smpsoak/t_smpsoak.h
kerneltest/e32test/traces_t_usb/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb/fixed_id.definitions
kerneltest/e32test/traces_t_usb_device/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_device/fixed_id.definitions
kerneltest/e32test/traces_t_usb_scdevice/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_scdevice/fixed_id.definitions
kerneltest/e32test/traces_t_usb_transfersrv/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_transfersrv/fixed_id.definitions
kerneltest/e32test/traces_t_usb_transfersrvclient/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_transfersrvclient/fixed_id.definitions
kerneltest/e32test/traces_t_usbapi/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usbapi/fixed_id.definitions
kerneltest/e32test/traces_t_usbcsc/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usbcsc/fixed_id.definitions
kerneltest/e32test/usb/t_usb_device/include/general.h
kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp
kerneltest/e32test/usb/t_usb_device/src/activedevicestatenotifier.cpp
kerneltest/e32test/usb/t_usb_device/src/activerw.cpp
kerneltest/e32test/usb/t_usb_device/src/activestallnotifier.cpp
kerneltest/e32test/usb/t_usb_device/src/activetimer.cpp
kerneltest/e32test/usb/t_usb_device/src/apitests.cpp
kerneltest/e32test/usb/t_usb_device/src/config.cpp
kerneltest/e32test/usb/t_usb_device/src/main.cpp
kerneltest/e32test/usb/t_usb_device/src/tranhandleserver.cpp
kerneltest/e32test/usb/t_usb_device/src/tranhandlesession.cpp
kerneltest/e32test/usb/t_usb_device/src/transferhandle.cpp
kerneltest/e32test/usb/t_usb_device/src/transferserver.cpp
kerneltest/e32test/usb/t_usb_device/src/transfersession.cpp
kerneltest/e32test/usb/t_usb_device/src/transfersrv.cpp
kerneltest/e32test/usb/t_usb_device/src/transfersrvmain.cpp
kerneltest/e32test/usb/t_usb_device/src/usbms.cpp
kerneltest/e32test/usbho/t_otgdi/group/t_otgdi.mmp
kerneltest/e32test/usbho/t_otgdi/group/t_otgdi_fdfactor.mmp
kerneltest/e32test/usbho/t_otgdi/inc/b2bwatchers.h
kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h
kerneltest/e32test/usbho/t_otgdi/src/b2bwatchers.cpp
kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp
kerneltest/e32test/usbho/t_otgdi/src/otgroot.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor_main.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_uid.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0456.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0457.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0458.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0459.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0460.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0461.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0462.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0463.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0464.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0465.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0466.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0467.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0468.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0670.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0671.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0675.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0676.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0677.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0678.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0679.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0680.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0684.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase1233.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcasecontroller.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcasefactory.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcaseroot.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcasewd.cpp
kerneltest/e32test/usbho/t_otgdi/src/testengine.cpp
kerneltest/e32test/usbho/t_otgdi/src/testpolicy.cpp
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/fixed_id.definitions
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/fixed_id.definitions
kerneltest/e32test/usbho/t_usbdi/group/t_usbdi.mmp
kerneltest/e32test/usbho/t_usbdi/group/t_usbhost_usbman.mmp
kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h
kerneltest/e32test/usbho/t_usbdi/inc/EndpointStallWatcher.h
kerneltest/e32test/usbho/t_usbdi/inc/HostTransfers.h
kerneltest/e32test/usbho/t_usbdi/inc/testdebug.h
kerneltest/e32test/usbho/t_usbdi/src/BaseBulkTestCase.cpp
kerneltest/e32test/usbho/t_usbdi/src/BaseTestCase.cpp
kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp
kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp
kerneltest/e32test/usbho/t_usbdi/src/FDFActor.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0472.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0473.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0474.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0476.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0478.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0479.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0480.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0481.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0482.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0483.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0484.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0485.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0486.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0488.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0490.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0491.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0492.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0494.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0496.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0499.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1229.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1230.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1231.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1232.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1234.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1235.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1236.cpp
kerneltest/e32test/usbho/t_usbdi/src/SoftwareConnectTimer.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestCaseController.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestCaseFactory.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestEngine.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestPolicy.cpp
kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp
kerneltest/e32test/usbho/t_usbdi/src/controlendpointreader.cpp
kerneltest/e32test/usbho/t_usbdi/src/controltransferrequests.cpp
kerneltest/e32test/usbho/t_usbdi/src/endpointreader.cpp
kerneltest/e32test/usbho/t_usbdi/src/endpointwriter.cpp
kerneltest/e32test/usbho/t_usbdi/src/hostbulktransfers.cpp
kerneltest/e32test/usbho/t_usbdi/src/hostinterrupttransfers.cpp
kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp
kerneltest/e32test/usbho/t_usbdi/src/main.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceA.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceC.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceD.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceb.cpp
kerneltest/e32test/usbho/t_usbdi/src/testinterfacesettingbase.cpp
kerneltest/e32test/usbho/t_usbdi/src/vendordevice.cpp
kerneltest/e32test/usbho/t_usbdi/src/wakeuptimer.cpp
kerneltest/e32test/usbho/t_usbdi/t_usbhost_usbman_src/t_usbhost_usbman.cpp
kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/fixed_id.definitions
kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/fixed_id.definitions
kerneltest/f32test/bench/t_fcachebm.cpp
kerneltest/f32test/filesystem/fat/t_checkdisk.cpp
kerneltest/f32test/fileutils/inc/f32_test_utils.h
kerneltest/f32test/fileutils/src/f32_test_utils.cpp
kerneltest/f32test/group/bld.inf
kerneltest/f32test/rofs/rofs_tests.mrp
kerneltest/f32test/server/t_dcallcaps.cpp
kerneltest/f32test/server/t_dcallfiles.cpp
kerneltest/f32test/server/t_dcdiskadmin.cpp
kerneltest/f32test/server/t_dcdiskadminallfiles.cpp
kerneltest/f32test/server/t_dcnone.cpp
kerneltest/f32test/server/t_dctcb.cpp
kerneltest/f32test/server/t_dctcballfiles.cpp
kerneltest/f32test/server/t_dctcbdiskadmin.cpp
kerneltest/f32test/server/t_file.cpp
kerneltest/f32test/server/t_fman.cpp
kerneltest/f32test/server/t_fsched.cpp
kerneltest/f32test/server/t_pwstr.cpp
kerneltest/f32test/server/t_rcache.cpp
kerneltest/f32test/server/t_sysbin.cpp
kerneltest/f32test/server/t_wcache.cpp
package_definition.xml
userlibandfileserver/fileserver/group/release.txt
userlibandfileserver/fileserver/inc/f32ver.h
userlibandfileserver/fileserver/sfat/sl_cache.cpp
userlibandfileserver/fileserver/sfat/sl_fatcache.cpp
userlibandfileserver/fileserver/sfat/sl_leafdir_cache.cpp
userlibandfileserver/fileserver/sfat32/sl_cache.cpp
userlibandfileserver/fileserver/sfat32/sl_fatcache.cpp
userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp
userlibandfileserver/fileserver/sfat32/sl_mnt.cpp
userlibandfileserver/fileserver/sfile/sf_drv.cpp
userlibandfileserver/fileserver/sfile/sf_file.cpp
userlibandfileserver/fileserver/sfile/sf_memory_client.cpp
userlibandfileserver/fileserver/sfile/sf_pool.cpp
userlibandfileserver/fileserver/sfile/sf_std.h
userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp
userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.inl
userlibandfileserver/fileserver/swins/elocal.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_assp/traces_usbcc/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+// #define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_assp/traces_usbcc/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,767 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FATAL[0x81]_DUP1_TUSBCCONFIGDESCRIPTOR_CONSTRUCT_DUP1=0x43
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP2=0xe7
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP3=0xe8
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK_DUP1=0xfa
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CANCELREADBUFFER_DUP1=0xaa
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER_DUP1=0xab
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP3=0x3f
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP1=0xd2
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP1=0xda
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP2=0xdb
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP3=0xdc
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP4=0xdd
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP5=0xde
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP6=0xdf
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP1=0xd3
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP10=0xd9
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP3=0xd4
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP5=0xd5
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP6=0xd6
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP8=0xd7
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP9=0xd8
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP2=0xe9
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP1=0xea
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP2=0xeb
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP1=0xec
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP2=0xed
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP2=0x8d
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP2=0x8e
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP3=0x8f
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP1=0xcc
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP4=0xcd
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP1=0xee
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP3=0xef
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP4=0xf0
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP5=0xf1
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP3=0xf7
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP6=0xf8
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP1=0xca
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP2=0xcb
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK_DUP1=0xc7
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP1=0xc5
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP2=0xc6
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK_DUP1=0xc2
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP1=0xc0
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP2=0xc1
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR_DUP1=0xbe
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE_DUP1=0xbd
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR_DUP1=0xb4
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP1=0x9a
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP2=0x9b
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP1=0xd0
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP2=0xd1
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP3=0xcf
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP3=0x41
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP4=0x42
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP3=0x40
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP2=0xf2
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP3=0xf3
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP1=0xfc
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_POWERUPDFC_DUP1=0xfb
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_POWERUPUDC_DUP3=0x97
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT_DUP1=0xf5
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT_DUP1=0xf6
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP2=0xf
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP3=0x10
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP4=0x11
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP13=0x2
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP21=0x3
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP22=0x4
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP26=0x5
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP27=0x6
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP36=0x7
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP37=0x8
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP38=0x9
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP40=0xa
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP41=0xb
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP42=0xc
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP44=0xd
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP48=0xe
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE_DUP1=0x1
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP1=0x30
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP2=0x31
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP3=0x32
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP1=0x2d
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP4=0x2e
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP1=0x12
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP1=0x15
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP2=0x16
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP1=0x13
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP2=0x14
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP1=0x35
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP2=0x36
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP3=0x37
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP5=0xf4
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP1=0x2b
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP2=0x2c
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP1=0x17
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP10=0x20
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP11=0x21
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP12=0x22
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP13=0x23
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP14=0x24
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP15=0x25
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP2=0x18
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP3=0x19
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP4=0x1a
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP5=0x1b
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP6=0x1c
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP7=0x1d
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP8=0x1e
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP9=0x1f
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP1=0x27
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP2=0x28
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP3=0x29
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP4=0x2a
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE_DUP1=0x26
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP1=0x33
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP2=0x34
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR_DUP1=0x2f
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP1=0x38
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP2=0x39
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP3=0x3a
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP4=0x3b
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP1=0x3c
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP2=0x3d
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP3=0x3e
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK_DUP1=0xf9
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REENUMERATE_DUP3=0x96
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP1=0x90
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP1=0x99
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP1=0xb3
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP1=0x98
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERUDC_DUP1=0xce
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP2=0xae
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP3=0xaf
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP1=0xc8
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP2=0xc9
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP1=0xc3
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP2=0xc4
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP1=0xac
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP2=0xad
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR_DUP1=0xbf
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP1=0xb0
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP1=0xb5
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP2=0xb6
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP3=0xb7
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP4=0xb8
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP5=0xb9
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP6=0xba
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP7=0xbb
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP8=0xbc
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP2=0x92
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP3=0x93
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP4=0x94
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP5=0x95
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP1=0xb1
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP3=0xb2
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP1=0xe0
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP2=0xe1
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP3=0xe2
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP4=0xe3
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP5=0xe4
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP6=0xe5
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP7=0xe6
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP13=0xa1
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP3=0x9c
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP4=0x9d
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP5=0x9e
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP7=0x9f
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP8=0xa0
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP10=0xa8
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP11=0xa9
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP3=0xa2
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP4=0xa3
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP5=0xa4
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP6=0xa5
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP7=0xa6
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP8=0xa7
+[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER_DUP1=0x91
+[TRACE]TRACE_FATAL[0x81]_TSGLQUEBASE_DOREMOVE=0xfd
+[TRACE]TRACE_FATAL[0x81]_TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT_DUP1=0x48
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP1=0x79
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP2=0x7a
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP8=0x7b
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR_DUP1=0x5c
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP1=0x50
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP12=0x58
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP13=0x59
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP2=0x51
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP3=0x52
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP4=0x53
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP5=0x54
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP6=0x55
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP7=0x56
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP8=0x57
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP1=0x76
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP2=0x77
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP3=0x78
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR_DUP1=0x75
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP2=0x7d
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP5=0x7e
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP6=0x7f
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORSIZE=0x6b
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORTC=0x69
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORSIZE=0x68
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORTC=0x66
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC_DUP1=0x62
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE_DUP1=0x61
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC_DUP1=0x5f
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC_DUP1=0x5d
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1=0x64
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INITHS_DUP2=0x4e
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INITHS_DUP3=0x4f
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INIT_DUP1=0x4c
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INIT_DUP3=0x4d
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INSERTEPDESC_DUP1=0x74
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC=0x6c
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1=0x6d
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP2=0x6e
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP3=0x6f
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCSENDPOINTDESCRIPTORTC=0x6a
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC=0x67
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC_DUP1=0x63
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP1=0x80
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP2=0x81
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP3=0x82
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP4=0x83
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC_DUP1=0x60
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP1=0x5a
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP2=0x5b
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR_DUP1=0x5e
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1=0x65
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP1=0x70
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP2=0x71
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP3=0x72
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP4=0x73
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP1=0x84
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP2=0x85
+[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP2=0x7c
+[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP1=0x44
+[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP4=0x45
+[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP5=0x46
+[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP6=0x47
+[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTINFO_ADJUSTEPSIZES=0x86
+[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTINFO_ADJUSTEPSIZES_DUP1=0x87
+[TRACE]TRACE_FATAL[0x81]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP1=0x8a
+[TRACE]TRACE_FATAL[0x81]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP3=0x8b
+[TRACE]TRACE_FATAL[0x81]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP5=0x8c
+[TRACE]TRACE_FATAL[0x81]_TUSBCPHYSICALENDPOINT_DIRAVAILABLE_DUP1=0x89
+[TRACE]TRACE_FATAL[0x81]_TUSBCPHYSICALENDPOINT_TYPEAVAILABLE_DUP1=0x88
+[TRACE]TRACE_FATAL[0x81]_TUSBCSTRINGDESCRIPTORBASE_SETWORD=0x4a
+[TRACE]TRACE_FATAL[0x81]_TUSBCSTRINGDESCRIPTORBASE_WORD=0x49
+[TRACE]TRACE_FATAL[0x81]_TUSBCSTRINGDESCRIPTOR_CONSTRUCT_DUP1=0x4b
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER=0xc6
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ALLOCATEENDPOINTRESOURCE=0xb0
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CABLEDETECTWITHOUTPOWERCAPS=0xb9
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK=0xda
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION=0x14
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CHANGEINTERFACE=0x17
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY=0xc3
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CLEARHALTFEATURE=0x13
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS=0xc4
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CURRENTLYUSINGHIGHSPEED=0xb3
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER=0xc7
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEALLOCATEENDPOINTRESOURCE=0xb1
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK=0xc8
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS=0xc9
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK=0xc2
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE=0x86
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE=0x9c
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE=0x84
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICECAPS=0x7d
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICEEVENTNOTIFICATION=0xb7
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICEHIGHSPEEDCAPS=0xba
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICEHNPHANDLEDBYHARDWARECAPS=0xbc
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICERESOURCEALLOCV2CAPS=0xbb
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK=0x77
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE=0x18
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_CONS=0xb6
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES=0x76
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK=0x78
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENDPOINTCAPS=0x7c
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENDPOINTZEROMAXPACKETSIZES=0x90
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENTERFULLSPEED=0xd6
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENTERHIGHSPEED=0xd7
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_EP0STALL=0x88
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY=0xcb
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS=0xd8
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTOR=0x94
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTORSIZE=0x96
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCONFIGURATIONSTRINGDESCRIPTOR=0xad
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCURRENTOTGFEATURES=0x9a
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTOR=0x91
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTORSIZE=0x93
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICEQUALIFIERDESCRIPTOR=0x9e
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICESTATUS=0x8a
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETENDPOINTSTATUS=0x8b
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE=0x9d
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETINTERFACENUMBER=0x87
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETMANUFACTURERSTRINGDESCRIPTOR=0xa4
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETOTGDESCRIPTOR=0x97
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETOTGFEATURES=0x99
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETOTHERSPEEDCONFIGURATIONDESCRIPTOR=0xa0
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETPRODUCTSTRINGDESCRIPTOR=0xa7
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETSERIALNUMBERSTRINGDESCRIPTOR=0xaa
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTORLANGID=0xa2
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS=0xb5
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN=0x16
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_INTERFACESETUP=0x15
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ISACTIVE=0x79
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_MOVETOADDRESSSTATE=0xb8
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE=0xcf
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_OTGDISABLEUDC=0xc1
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_OTGENABLEUDC=0xc0
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_OTGFEATURESNOTIFY=0xcc
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERDOWN=0xbe
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERDOWNDFC=0xdc
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERDOWNWHENACTIVE=0xbd
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERUP=0xbf
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERUPDFC=0xdb
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERUPUDC=0x80
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCEEDSETDESCRIPTOR=0x11
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT=0xd4
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT=0xd5
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE=0xce
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED=0x2
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED=0x1
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION=0xc
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR=0xa
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS=0x3
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS=0x5
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE=0xe
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS=0x4
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT=0xd3
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSRESUMEEVENT=0xd2
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS=0x9
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE=0x6
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE=0x8
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE=0x7
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION=0xd
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR=0xb
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE=0xf
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENT=0xd0
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED=0xd1
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME=0x10
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_QUERYENDPOINTRESOURCE=0xb2
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK=0xd9
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REENUMERATE=0x7f
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK=0x7a
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE=0x85
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE=0x9b
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE=0x83
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERUDC=0xb4
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL=0x8f
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVECONFIGURATIONSTRINGDESCRIPTOR=0xaf
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVEMANUFACTURERSTRINGDESCRIPTOR=0xa6
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVEPRODUCTSTRINGDESCRIPTOR=0xa9
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVESERIALNUMBERSTRINGDESCRIPTOR=0xac
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS=0xcd
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SENDEP0STATUSPACKET=0x89
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE=0x12
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETCONFIGURATIONDESCRIPTOR=0x95
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETCONFIGURATIONSTRINGDESCRIPTOR=0xae
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETDEVICECONTROL=0x8e
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETDEVICEDESCRIPTOR=0x92
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETDEVICEQUALIFIERDESCRIPTOR=0x9f
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETINTERFACE=0x7e
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETMANUFACTURERSTRINGDESCRIPTOR=0xa5
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR=0x98
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETOTHERSPEEDCONFIGURATIONDESCRIPTOR=0xa1
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETPRODUCTSTRINGDESCRIPTOR=0xa8
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETSERIALNUMBERSTRINGDESCRIPTOR=0xab
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTORLANGID=0xa3
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR=0xc5
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER=0x8c
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER=0x8d
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_STATUSNOTIFY=0xca
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER=0x7b
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_USBCONNECT=0x81
+[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_USBDISCONNECT=0x82
+[TRACE]TRACE_FLOW[0x8A]_TUSBCAUDIOENDPOINTDESCRIPTOR_CONSTRUCT=0x34
+[TRACE]TRACE_FLOW[0x8A]_TUSBCAUDIOENDPOINTDESCRIPTOR_NEW=0x33
+[TRACE]TRACE_FLOW[0x8A]_TUSBCAUDIOENDPOINTDESCRIPTOR_TUSBCAUDIOENDPOINTDESCRIPTOR_CONS=0x32
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT=0x3b
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_NEW=0x3a
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_CONS=0x38
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_DES=0x39
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGDESCRIPTOR_CONSTRUCT=0x27
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGDESCRIPTOR_NEW=0x26
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGDESCRIPTOR_TUSBCCONFIGDESCRIPTOR_CONS=0x25
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGURATION_TUSBCCONFIGURATION_CONS=0x74
+[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGURATION_TUSBCCONFIGURATION_DES=0x75
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_CONS=0x19
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_DES=0x1a
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS=0x61
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR=0x67
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS=0x69
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR=0x4c
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTORTC=0x50
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR=0x62
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTORTC=0x4e
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC=0x57
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC=0x64
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE=0x56
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC=0x54
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC=0x52
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR=0x63
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC=0x59
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC=0x5b
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC_DUP1=0x5c
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INIT=0x48
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INITHS=0x49
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR=0x4d
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INSERTEPDESC=0x60
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC=0x5f
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR=0x66
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR=0x5e
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONDESCRIPTORTC=0x51
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETDEVICEDESCRIPTORTC=0x4f
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC=0x58
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC=0x65
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC=0x55
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR=0x53
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC=0x5a
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC=0x5d
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS=0x68
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_CONS=0x46
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES=0x47
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSFS=0x4a
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSHS=0x4b
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_CONSTRUCT=0x1d
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_NEW=0x1c
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_TUSBCDEVICEDESCRIPTOR_CONS=0x1b
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_UPDATEFS=0x1e
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_UPDATEHS=0x1f
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_CONSTRUCT=0x22
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_NEW=0x21
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_TUSBCDEVICEQUALIFIERDESCRIPTOR_CONS=0x20
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEFS=0x23
+[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEHS=0x24
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT=0x2c
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_TUSBCENDPOINTDESCRIPTORBASE_CONS=0x2b
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_UPDATEFS=0x2d
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_UPDATEHS=0x2e
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTOR_CONSTRUCT=0x31
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTOR_NEW=0x30
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTOR_TUSBCENDPOINTDESCRIPTOR_CONS=0x2f
+[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACEDESCRIPTOR_CONSTRUCT=0x2a
+[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACEDESCRIPTOR_NEW=0x29
+[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACEDESCRIPTOR_TUSBCINTERFACEDESCRIPTOR_CONS=0x28
+[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACESET_TUSBCINTERFACESET_CONS=0x72
+[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACESET_TUSBCINTERFACESET_DES=0x73
+[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACE_TUSBCINTERFACE_CONS=0x70
+[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACE_TUSBCINTERFACE_DES=0x71
+[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_CONSTRUCT=0x45
+[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_NEW=0x44
+[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_CONS=0x42
+[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_DES=0x43
+[TRACE]TRACE_FLOW[0x8A]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS=0x6f
+[TRACE]TRACE_FLOW[0x8A]_TUSBCOTGDESCRIPTOR_CONSTRUCT=0x37
+[TRACE]TRACE_FLOW[0x8A]_TUSBCOTGDESCRIPTOR_NEW=0x35
+[TRACE]TRACE_FLOW[0x8A]_TUSBCOTGDESCRIPTOR_TUSBCOTGDESCRIPTOR_CONS=0x36
+[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_DIRAVAILABLE=0x6c
+[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE=0x6d
+[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_CONS=0x6a
+[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_DES=0x6e
+[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_TYPEAVAILABLE=0x6b
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_CONS=0x3c
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_DES=0x3d
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_CONSTRUCT=0x41
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_NEW=0x40
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_CONS=0x3e
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_DES=0x3f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP1=0x100
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP4=0x101
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CANCELREADBUFFER=0xbc
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CANCELTRANSFERREQUESTS=0x107
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER=0xbd
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP1=0x3e
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP2=0x3f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP4=0x40
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP5=0x41
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP6=0x42
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP7=0x43
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP8=0x44
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP9=0x45
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP1=0x4d
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP2=0x4e
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP2=0xf2
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP3=0xf3
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP4=0xf4
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CLEARHALTENDPOINT=0xbf
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CLOSEDMACHANNEL=0xee
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP10=0xfc
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP11=0xfd
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP12=0xfe
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP13=0xff
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP7=0xf9
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP8=0xfa
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP9=0xfb
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE=0xf5
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP2=0xf6
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP4=0xf7
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP7=0xf8
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP1=0x102
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP3=0x103
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEINTERFACE=0x105
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEINTERFACESET=0x104
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP3=0x106
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP1=0x10a
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP2=0x10b
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP1=0x108
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP2=0x109
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENT=0xae
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP1=0xf0
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP2=0xf1
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENT_DUP1=0xaf
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP1=0xac
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP2=0xad
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP1=0xca
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP2=0xcb
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP1=0xa9
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP2=0xaa
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP1=0x97
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE_DUP1=0x4f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES_DUP1=0x96
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP1=0x98
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP1=0x9a
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP2=0x9b
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE=0xda
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP2=0xdb
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP3=0xdc
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTREQUESTCOMPLETE=0xe5
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE=0x1
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP1=0x2
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP2=0x3
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP3=0x4
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENTERTESTMODE=0xef
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0PACKETSIZE=0xb0
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0PACKETSIZE_DUP1=0xb1
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE=0xe7
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP1=0xe8
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP2=0xe9
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP3=0xea
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP4=0xeb
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP2=0x10d
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP6=0x10e
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP7=0x10f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP8=0x110
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP9=0x111
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP1=0x11b
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP2=0x11c
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP4=0x11d
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP5=0x11e
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP7=0x11f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK=0xd4
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE=0xd6
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK=0xd1
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE=0xd3
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR=0xce
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE=0xd0
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR=0xcc
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTOR=0xd7
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_HALTENDPOINT=0xbe
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST=0xe6
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP1=0xdd
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP2=0xde
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP4=0xdf
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP5=0xe0
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP6=0xe1
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP7=0xe2
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP8=0xe3
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP9=0xe4
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP1=0x49
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP2=0x4a
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP5=0x4b
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP6=0x4c
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP1=0x46
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP2=0x47
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP4=0x48
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP1=0x114
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP4=0x115
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_OPENDMACHANNEL=0xed
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP2=0x120
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP3=0x121
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP4=0x122
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERUPUDC_DUP1=0xa5
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERUPUDC_DUP2=0xa6
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE_DUP1=0x113
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP1=0x2a
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP5=0x2b
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP6=0x2c
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0RECEIVEDONE=0x5
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP1=0x7
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP10=0x10
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP11=0x11
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP12=0x12
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP14=0x13
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP15=0x14
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP16=0x15
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP17=0x16
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP18=0x17
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP19=0x18
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP2=0x8
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP20=0x19
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP23=0x1a
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP24=0x1b
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP25=0x1c
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP28=0x1d
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP29=0x1e
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP3=0x9
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP30=0x1f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP31=0x20
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP32=0x21
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP33=0x22
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP34=0x23
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP35=0x24
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP39=0x25
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP4=0xa
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP43=0x26
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP45=0x27
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP46=0x28
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP47=0x29
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP5=0xb
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP6=0xc
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP7=0xd
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP8=0xe
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP9=0xf
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE=0x6
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP4=0x34
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP5=0x35
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP2=0x31
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP3=0x32
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP5=0x33
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP2=0x2d
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP3=0x2f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP3=0x2e
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP4=0x38
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP1=0x117
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP2=0x118
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP3=0x119
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP4=0x11a
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP3=0x30
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP3=0x36
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP4=0x37
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP5=0x39
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED_DUP1=0x116
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REENUMERATE_DUP1=0xa3
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REENUMERATE_DUP2=0xa4
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP2=0x99
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP2=0xab
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP2=0xc9
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP2=0xa8
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP1=0xc0
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE=0x9d
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP1=0x9e
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP2=0x9f
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP3=0xa0
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP4=0xa1
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP5=0xa2
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REMOVESTRINGDESCRIPTOR=0xd9
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS_DUP1=0x112
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP1=0x3a
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP2=0x3b
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP3=0x3c
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP4=0x3d
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK=0xd5
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK=0xd2
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCURRENT=0xec
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR=0xcf
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE=0xc1
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP2=0xc2
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR=0xcd
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP1=0x9c
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP2=0xc3
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP4=0xc4
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP5=0xc5
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP6=0xc6
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP7=0xc7
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP8=0xc8
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTOR=0xd8
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP1=0xb2
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP10=0xb6
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP11=0xb7
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP12=0xb8
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP2=0xb3
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP6=0xb4
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP9=0xb5
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP1=0xb9
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP2=0xba
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP9=0xbb
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_STATUSNOTIFY_DUP1=0x10c
+[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_USBCONNECT_DUP1=0xa7
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP3=0x6f
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP4=0x70
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP5=0x71
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP6=0x72
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP7=0x73
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR=0x5e
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP1=0x87
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP2=0x88
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS_DUP1=0x89
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP10=0x59
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP11=0x5a
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP9=0x58
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR=0x6e
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR=0x6d
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR=0x7d
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP1=0x7e
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP3=0x7f
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP4=0x80
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP7=0x81
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC=0x60
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1=0x61
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP1=0x7b
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP2=0x7c
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP1=0x84
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP2=0x85
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR_DUP1=0x82
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTOR=0x83
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INITHS_DUP1=0x57
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INIT_DUP2=0x54
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INIT_DUP4=0x55
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INIT_DUP5=0x56
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR_DUP1=0x5b
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP1=0x6a
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP2=0x6b
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP3=0x6c
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVECONFIGURATIONSTRINGDESCRIPTOR=0x62
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR_DUP1=0x86
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP1=0x63
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP2=0x64
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP3=0x65
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP4=0x66
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP5=0x67
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP6=0x68
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP7=0x69
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC_DUP1=0x5f
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR=0x5c
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP3=0x5d
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP1=0x52
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP2=0x53
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH=0x74
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP1=0x75
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP2=0x76
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS=0x77
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP1=0x78
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP3=0x79
+[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATEIFCNUMBERS=0x7a
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP2=0x50
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP3=0x51
+[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP2=0x90
+[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP4=0x91
+[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES=0x92
+[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP1=0x93
+[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP2=0x94
+[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP3=0x95
+[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP1=0x8a
+[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP2=0x8b
+[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP3=0x8c
+[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP4=0x8d
+[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP5=0x8e
+[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP6=0x8f
--- a/bsptemplate/asspandvariant/template_assp/usbcc.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/bsptemplate/asspandvariant/template_assp/usbcc.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -26,6 +26,8 @@
 linkas				usbcc.dll
 noexportlibrary
 
+USERINCLUDE traces_usbcc
+
 sourcepath			../../../kernel/eka/drivers/usbcc
 source				chapter9.cpp
 source				descriptors.cpp
@@ -46,3 +48,4 @@
 capability			all
 
 VENDORID 0x70000001
+uid           0x100039d0 0x1000015f
--- a/kernel/eka/bld.inf	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/bld.inf	Thu Sep 02 21:54:16 2010 +0300
@@ -247,7 +247,6 @@
 include/drivers/crashflashnor.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/crashflashnand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 
-include/rm_debug_api.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(rm_debug_api.h)
 include/sm_debug_api.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(sm_debug_api.h)
 
 include/drivers/resourceman.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
@@ -395,7 +394,7 @@
 rombuild/PlatSecDiagnostics.oby					/epoc32/rom/include/
 rombuild/btrace.iby								/epoc32/rom/include/
 rombuild/kernel.hby								/epoc32/rom/include/
-rombuild/rm_debug_svr.iby						/epoc32/rom/include/			// Run mode debug driver
+rombuild/sm_debug.iby						    /epoc32/rom/include/			
 rombuild/utrace.iby								/epoc32/rom/include/
 rombuild/ost.iby								/epoc32/rom/include/
 
--- a/kernel/eka/common/des16.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/common/des16.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1691,20 +1691,19 @@
 	{
 	TInt strLength = Length();
 	const TText16* start = Ptr();
-	const TText16* end = Ptr() + strLength;
 	TText16* newEnd;
 	TUint currentChar;
-	TInt int16Index = 0;
+	TInt int16Index = strLength;
 	TInt status = KErrNone;
 	FOREVER
 		{
-		status = ::RecedeOneCharacter(start, end, newEnd, currentChar);
-        if (status != KErrNone)
-            return status;
+		status = ::RecedeOneCharacter(start, start+int16Index, newEnd, currentChar);
+		if (status != KErrNone)
+		    return status;
+		int16Index = (newEnd - start);
 		TCharF c(currentChar);
 		if (c == aChar)
-			return int16Index;
-		int16Index = (newEnd - start);
+		    return int16Index;
 		}
 	}
 
@@ -3990,8 +3989,8 @@
 The descriptor is filled from the beginning up to its current length. The 
 descriptor's length does not change. It is not filled to its maximum length.
 If aChar is supplementary character, and available space to fill is odd in
-16-bit unit, then the last 16-bit unit will be left unchanged, and the length
-will keep unchanged.
+16-bit unit, then the last 16-bit unit will be filled with high surrogate, 
+and the length will keep unchanged.
 
 @param aChar The fill character. Can be inside or outside BMP.
 
@@ -4012,6 +4011,9 @@
 			*pB++ = TChar::GetHighSurrogate(aChar);
 			*pB++ = TChar::GetLowSurrogate(aChar);
 			}
+		// fill the last 16-bit unit
+		if (pB < pE)
+		    *pB++ = TChar::GetHighSurrogate(aChar);
 		}
 	}
 
@@ -4056,7 +4058,7 @@
 length is changed to reflect this.
 
 If aChar is supplementary character, and available space to fill is odd in 
-16-bit unit, then the last 16-bit unit will be left unchanged.
+16-bit unit, then the last 16-bit unit will be filled with high surrogate.
 
 @param aChar   The fill character. Can be inside or outside BMP.
 @param aLength The length of additional space to append into.
@@ -4088,6 +4090,9 @@
 			*pB++ = TChar::GetHighSurrogate(aChar);
 			*pB++ = TChar::GetLowSurrogate(aChar);
 			}
+        // fill the last 16-bit unit
+        if (pB < pE)
+            *pB++ = TChar::GetHighSurrogate(aChar);
 		}
 	}
 
--- a/kernel/eka/debug/crashMonitor/inc/crashlogwalker.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/debug/crashMonitor/inc/crashlogwalker.h	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -23,7 +23,6 @@
 #define __CRASH_LOG_WALKER_H_INCLUDED__
 
 #include <e32cmn.h> 
-#include <rm_debug_api.h>
 
 #include <scmdatatypes.h>
 
--- a/kernel/eka/debug/crashMonitor/inc/scmdatatypes.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/debug/crashMonitor/inc/scmdatatypes.h	Thu Sep 02 21:54:16 2010 +0300
@@ -22,7 +22,7 @@
 #ifndef __SCMDATATYPES_H_INCLUDED__
 #define __SCMDATATYPES_H_INCLUDED__
 
-#include <rm_debug_api.h>
+
 #include <e32rom.h>
 
 #include <scmbytestreamutil.h>
@@ -45,6 +45,88 @@
 	static const TInt KSCMDataTypesBuildNumber = 0;
 
 	/**
+	  Specifies the type of a code segment.
+	  @see TCodeSegListEntry
+	  */
+	enum TCodeSegType
+	    {
+	    EUnknownCodeSegType = 0, /**< Signifies an unknown code segment type. */
+	    EExeCodeSegType = 1,     /**< Signifies a code segment belonging to an executable. */
+	    EDllCodeSegType = 2      /**< Signifies a code segment belonging to a library. */
+	    };
+	
+	
+	/**
+	  Used for storing the contents of a 32 bit register
+	  */
+	typedef TUint32 TRegisterValue32;
+	
+	/**
+	  Structure containing information about the state of the registers when a
+	  hardware exception occurred
+	  */
+	class TRmdArmExcInfo
+	    {
+	public:
+	    /** Enumeration detailing the types of exception which may occur. */
+	    enum TExceptionType
+	        {
+	        /** Enumerator signifying that a prefetch abort error has occurred. */
+	        EPrefetchAbort = 0,
+	        /** Enumerator signifying that a data abort error has occurred. */
+	        EDataAbort = 1,
+	        /** Enumerator signifying that an undefined instruction error has occurred. */
+	        EUndef =2
+	        };
+
+	    /** Value of CPSR. */
+	    TRegisterValue32 iCpsr;
+	    /** Type of exception which has occurred. */
+	    TExceptionType iExcCode;
+	    /** Value of R13 supervisor mode banked register. */
+	    TRegisterValue32 iR13Svc;
+	    /** Value of user mode register R4. */
+	    TRegisterValue32 iR4;
+	    /** Value of user mode register R5. */
+	    TRegisterValue32 iR5;
+	    /** Value of user mode register R6. */
+	    TRegisterValue32 iR6;
+	    /** Value of user mode register R7. */
+	    TRegisterValue32 iR7;
+	    /** Value of user mode register R8. */
+	    TRegisterValue32 iR8;
+	    /** Value of user mode register R9. */
+	    TRegisterValue32 iR9;
+	    /** Value of user mode register R10. */
+	    TRegisterValue32 iR10;
+	    /** Value of user mode register R11. */
+	    TRegisterValue32 iR11;
+	    /** Value of R14 supervisor mode banked register. */
+	    TRegisterValue32 iR14Svc;
+	    /** Address which caused exception (System Control Coprocessor Fault Address Register) */
+	    TRegisterValue32 iFaultAddress;
+	    /** Value of System Control Coprocessor Fault Status Register. */
+	    TRegisterValue32 iFaultStatus;
+	    /** Value of SPSR supervisor mode banked register. */
+	    TRegisterValue32 iSpsrSvc;
+	    /** Value of user mode register R13. */
+	    TRegisterValue32 iR13;
+	    /** Value of user mode register R14. */
+	    TRegisterValue32 iR14;
+	    /** Value of user mode register R0. */
+	    TRegisterValue32 iR0;
+	    /** Value of user mode register R1. */
+	    TRegisterValue32 iR1;
+	    /** Value of user mode register R2. */
+	    TRegisterValue32 iR2;
+	    /** Value of user mode register R3. */
+	    TRegisterValue32 iR3;
+	    /** Value of user mode register R12. */
+	    TRegisterValue32 iR12;
+	    /** Value of user mode register R15, points to instruction which caused exception. */
+	    TRegisterValue32 iR15;
+	    };
+	/**
 	 * This enum defines the type of struct we are dealing with when we
 	 * are serialising/deserialising
 	 */
--- a/kernel/eka/debug/securityServer/group/rm_debug_svr.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-//
-
-ALWAYS_BUILD_AS_ARM 
-
-target         rm_debug_svr.exe
-targettype     exe
-
-sourcepath	   	../src
-source		c_shutdown_timer.cpp
-source		c_process_pair.cpp
-source        	c_security_svr_server.cpp 
-source        	c_security_svr_session.cpp 
-source		c_security_svr_async.cpp
-source        	rm_debug_svr.cpp
-
-library		euser.lib
-library         efsrv.lib
-library         btracec.lib
-
-userinclude ../inc
-userinclude ../../../include
-userinclude ../../../include/drivers
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x100039CE 0x102834E2
-SECUREID       0x102834E2
-VENDORID       0x70000001
-
-
-// Enables UTrace logging of DSS public API calls
-macro SYMBIAN_TRACE_ENABLE
-
-//TCB is added for the RLocalDrive methods.
-CAPABILITY AllFiles TCB
-
-SMPSAFE
--- a/kernel/eka/debug/securityServer/inc/c_process_pair.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Provides a helper class for process security management
-// 
-//
-
-#ifndef C_PROCESS_PAIR_H
-#define C_PROCESS_PAIR_H
-
-/**
-@file
-@internalTechnology
-@released
-*/
-
-/**
-CProcessPair is a mapping between a debug agent's process Id, and
-the process fileName of a process the agent is interested in debugging.
-*/
-class CProcessPair : public CBase
-	{
-public:
-	static CProcessPair* NewL(const TDesC& aProcessName, const TProcessId aProcessId);
-	~CProcessPair();
-	TBool operator==(const CProcessPair &aProcessPair) const;
-	TBool Equals(const TDesC& aProcessName, const TProcessId aProcessId) const;
-	TBool ProcessIdMatches(const CProcessPair &aProcessPair) const;
-	TBool ProcessNameMatches(const CProcessPair &aProcessPair) const;
-	TBool ProcessIdMatches(const TProcessId &aProcessId) const;
-	TBool ProcessNameMatches(const TDesC& aProcessName) const;
-
-private:
-	CProcessPair();
-	void ConstructL(const TDesC& aProcessName, TProcessId aProcessId);
-
-private:
-	HBufC16* iProcessName;
-	TProcessId iProcessId;
-	};
-
-#endif //C_PROCESS_PAIR_H
-
--- a/kernel/eka/debug/securityServer/inc/c_security_svr_async.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Asynchronous security server responder active object class.
-// 
-//
-
-#ifndef C_SECURITY_SVR_ASYNC_H
-#define C_SECURITY_SVR_ASYNC_H
-
-#include <rm_debug_api.h>
-
-#include "c_security_svr_session.h"
-#include "c_security_svr_server.h"
-
-// forward declaration
-class CSecuritySvrSession;
-
-/**
-Class used to handle asynchronous events within a DSS session. Currently this
-is only used to handle GetEvent() calls. It sets up an active object when a 
-client makes a GetEvent() call, and completes it when ready, or cancels it
-if the client so wishes.
-
-Only one outstanding active object per client session is permitted.
-*/
-class CSecuritySvrAsync : public CActive
-{
-public:
-	~CSecuritySvrAsync();
-	static CSecuritySvrAsync* NewL(CSecuritySvrSession* aSession, const TDesC8& aProcessName, TProcessId aAgentId);
-
-	void GetEvent(const RMessage2& aMessage);
-	const TDesC8& ProcessName(void);
-
-protected:
-	CSecuritySvrAsync(CSecuritySvrSession* aSession, TProcessId aAgentId);
-
-	void ConstructL(const TDesC8& aProcessName);
-
-	virtual void RunL();
-	virtual void DoCancel();
-	virtual TInt RunError(TInt aError);
-
-private:
-
-    /*
-     * The last GetEvent message details. Needed for completion by RunL()
-     */
-    RMessagePtr2 iMessage;			
-
-    /*
-     * Temporary storage area for rm_debug.ldd to return data asynchronously
-     */
-	Debug::TEventInfo iInfo;
-
-	/*
-	 * Identity of this server session. Used for completing iMessage
-	 */
-	CSecuritySvrSession* iSession;
-
-	/*
-	 * Name of the process being debugged associated with this AO
-	 */
-	RBuf8 iProcessName;
-
-	/*
-	 * Debug Agent Id
-	 */
-	TProcessId iAgentId;
-	
-	/*
-	 * Balance between event requests and event deliveries.
-	 * @see GetEvent()
-	 * @see NotifyEvent()
-	 * @see DoCancel()
-	 */
-	TInt iEventBalance;
-};
- 
-#endif	// C_SECURITY_SVR_ASYNC_H
--- a/kernel/eka/debug/securityServer/inc/c_security_svr_server.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Definitions for the security server server.
-// 
-//
-
-#ifndef C_SECURITY_SVR_SERVER_H
-#define C_SECURITY_SVR_SERVER_H
-
-/**
-@file
-@internalTechnology
-@released
-*/
-
-#include <rm_debug_api.h>
-#include "c_process_pair.h"
-#include "c_shutdown_timer.h"
-#include "rm_debug_kerneldriver.h"
-
-_LIT(KDebugDriverFileName,"rm_debug.ldd");
-class CSecuritySvrSession;
-
-/**
-Definition of a Debug Security Server. Responsible for managing all debug agent clients,
-including attachment/detachment from target executables. Keeps track of which executables
-are being debugged.
-*/
-class CSecuritySvrServer : public CServer2
-	{
-	public:
-		CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
-		TInt AttachProcessL(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId, const TBool aPassive);
-		TInt DetachProcess(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId);
-		void DetachAllProcesses(const TProcessId aDebugAgentProcessId);
-		TBool CheckAttached(const TThreadId aTargetThreadId, const RMessage2& aMessage, const TBool aPassive);
-		TBool CheckAttached(const TProcessId aTargetProcessId, const RMessage2& aMessage, const TBool aPassive);
-		TBool CheckAttachedProcess(const TDesC& aTargetProcessName, const RMessage2& aMessage, const TBool aPassive) const;
-		TBool IsDebugged(const TDesC& aTargetProcessName, const TBool aPassive) const;
-		void SessionClosed();
-		void SessionOpened();
-		static CSecuritySvrServer* NewLC();
-
-		TBool OEMTokenPermitsDebugL(const TCapabilitySet aTokenCaps, const TCapabilitySet aTargetCaps);
-		TBool OEMTokenPermitsFlashAccessL(const TCapabilitySet aTokenCaps);
-
-	protected:
-		CSecuritySvrServer(CActive::TPriority aActiveObjectPriority);
-		void ConstructL();
-		
-	private:
-		~CSecuritySvrServer();
-		TBool IsActiveDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const;
-		TBool IsDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const;
-		TInt GetProcessIdFromMessage(TProcessId& aProcessId, const RMessage2& aMessage) const;
-
-	private:
-		RPointerArray<CProcessPair> iActiveDebugMap;
-		RPointerArray<CProcessPair> iPassiveDebugMap;
-		TInt iSessionCount;
-		CShutdownTimer iShutdown;
-		RRM_DebugDriver iKernelDriver;
-
-	// Declare the CSecuritySvrAsync as a friend so it can use the iKernelDriver too
-	friend class CSecuritySvrAsync;
-	friend class CSecuritySvrSession;
-	};
-
-#endif // C_SECURITY_SVR_SERVER_H
--- a/kernel/eka/debug/securityServer/inc/c_security_svr_session.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Definitions for the security server server side session.
-// 
-//
-
-#ifndef C_SECURITY_SVR_SESSION_H
-#define C_SECURITY_SVR_SESSION_H
-
-/**
-@file
-@internalTechnology
-@released
-*/
-
-// forward declaration
-class CSecuritySvrAsync;
-
-#include "c_security_svr_async.h"
-#include <f32file.h>
-#include <d32locd.h>
-
-#include <rm_debug_api.h>
-
-#include "rm_debug_kerneldriver.h"
-
-// Server name
-_LIT(KDebugDriverName,"RunMode Debug Driver");
-
-class CSecuritySvrServer;
-
-/**
-Debug Security Server session. Manages the session with one debug agent and
-as many target executables as it has attached to.
-*/
-class CSecuritySvrSession : public CSession2
-	{
-public:
-	CSecuritySvrSession();
-	~CSecuritySvrSession();
-	void ConstructL ();
-	void CreateL();
-
-	TInt OpenHandle(const TRM_DebugDriverInfo& aDriverInfo);
-	void ServiceL(const RMessage2& aMessage);
-	void ServiceError(const RMessage2 &aMessage, TInt aError);
-
-	void ResumeThreadL(const RMessage2& aMessage);
-	void SuspendThreadL(const RMessage2& aMessage);
-	//break
-	void SetBreakL(const RMessage2& aMessage);
-	void ClearBreakL(const RMessage2& aMessage);
-	void ModifyBreakL(const RMessage2& aMessage);
-	void BreakInfoL(const RMessage2& aMessage);
-
-	void StepRangeL(const RMessage2& aMessage);
-
-	void GetEventL(const RMessage2& aMessage);
-	void CancelGetEventL(const RMessage2& aMessage);
-
-	void AttachProcessL(const RMessage2& aMessage);
-	void DetachProcessL(const RMessage2& aMessage);
-	//debug functionality
-	void GetDebugFunctionalityBufSizeL(const RMessage2& aMessage);
-	void GetDebugFunctionalityL(const RMessage2& aMessage);
-	//memory
-	void ReadMemoryL(const RMessage2& aMessage);
-	void WriteMemoryL(const RMessage2& aMessage);
-	//registers
-	void ReadRegistersL(const RMessage2& aMessage);
-	void WriteRegistersL(const RMessage2& aMessage);
-	//event
-	void SetEventActionL(const RMessage2& aMessage);
-
-	void GetListL(const RMessage2& aMessage);
-	void StepL(const RMessage2& aMessage);
-	void TraceExecutableL(const RMessage2& aMessage);
-	
-	//crash log
-	void ReadCrashLogL(const RMessage2& aMessage);
-	void WriteCrashConfigL(const RMessage2& aMessage);
-	void EraseCrashLogL(const RMessage2& aMessage);
-	void EraseEntireCrashLogL(const RMessage2& aMessage);
-
-	void SetProcessBreakL(const RMessage2& aMessage);
-	void ModifyProcessBreakL(const RMessage2& aMessage);
-	void ProcessBreakInfoL(const RMessage2& aMessage);
-
-	void KillProcessL(const RMessage2& aMessage);
-
-	TCapabilitySet GetOEMDebugCapabilities(void) const { return iOEMDebugCapabilities; };
-
-#ifdef _DEBUG
-	void DoFailAlloc(const RMessage2& aMessage);
-#endif
-
-private:
-	CSecuritySvrServer& Server() const;
-	void HeapWatcher(const TUint32 aFunction, const TBool aEntry) const;
-	void WriteDataL(const RMessage2& aMessage, const TInt aIndex, const TAny* aPtr, const TUint32 aPtrSize) const;
-	void StoreDebugAgentId(const TProcessId aDebugAgentProcessId);
-	void CheckAttachedL(const TThreadId aThreadId, const RMessage2& aMessage, const TBool aPassive) const;
-	void CheckAttachedL(const TProcessId aProcessId, const RMessage2& aMessage, const TBool aPassive) const;
-	TBool PermitDebugL(const TProcessId aDebugAgentProcessId, const TDesC& aTargetProcessName) const;
-	TBool IsDebugged(const TDesC& aFileName, const TBool aPassive) const;
-	void OpenFileHandleL(const TDesC& aFileName, RFs& aFs, RFile& aFileHandle);
-	TBool IsTraceBitSet(const TDesC8& aHeaderData, const TBool aXip);
-	TBool IsDebugBitSet(const TDesC8& aHeaderData, const TBool aXip);
-	TBool CheckSufficientData(const TDesC8& aHeaderData, const TBool aXip) const;
-
-	void ValidateMemoryInfoL(const TThreadId aThreadId, const Debug::TMemoryInfo &aMemoryInfo, const TBool aReadOperation);
-	void ValidateRegisterBuffersL(const RMessage2& aMessage, TUint32& aNumberOfRegisters);
-
-	TInt GetExecutablesListL(TDes8& aBuffer, TUint32& aSize) const;
-	void AppendExecutableData(TDes8& aBuffer, TUint32& aSize, const TDesC& aEntryName) const;
-	void GetSecureIdL(const TDesC& aFileName, TUid& aSecureId);
-	TUid GetSecureIdL(const TDesC8& aHeaderData, TBool aXip);
-
-	void IsDebuggableL(const TDesC& aFileName);
-	TThreadId ReadTThreadIdL(const RMessagePtr2& aMessage, const TInt aIndex) const;
-	TProcessId ReadTProcessIdL(const RMessagePtr2& aMessage, const TInt aIndex) const;
-	TBool IsExecutableXipL(RFile& aExecutable);
-	
-	void ConnectCrashPartitionL(void);
-
-	void GetDebugAgentOEMTokenCapsL();
-	TInt CheckFlashAccessPermissionL(const RThread aClientThread);
-
-	// Declare the CSecuritySvrAsync as a friend so it can use the iKernelDriver too
-	friend class CSecuritySvrAsync;
-
-private:
-	/**
-	Flag to indicate whether we have stored the TProcessId associated with the Debug Agent.
-	*/
-	TBool iDebugAgentProcessIdStored;
-
-	/**
-	The TProcessId of the Debug Agent associated with this session. A convenience to
-	save looking it up repeatedly.
-	*/
-	TProcessId iDebugAgentProcessId;
-	/**
-	Need an array of async completion objects, one for each target executable.
-	*/
-	RPointerArray<CSecuritySvrAsync> iAsyncHandlers;
-
-	/**
-	Used to track whether the Debug Agent has been notified when closing the session.
-	*/
-	TBool iServerNotified;
-
-	/**
-	OEM Debug token support. This is only used when the Debug Agent has OEM debug 
-	authority provided by a specific authorisation token file. This token confers
-	the ability to debug certain executables which have not been built as 'Debuggable'.
-	
-	The OEM Debug token executable must be marked with 'AllFiles', as this is analogous
-	to looking 'inside' executables - with AllFiles, it could read all the data out of an
-	executable in \sys\bin\. In addition, since debug control of an executable implies the
-	ability to execute arbitrary code within the target process space, this would imply that
-	a Debug Agent could use any PlatSec capability which that target process possessed.
-	
-	Therefore, we require that the OEM Debug Token must also be marked with a superset of
-	the PlatSec capabilities of the executable which is to be debugged. This means the
-	Debug Agent is not granted more access/PlatSec capabilities than its authorisation
-	token allows, and cannot exploit a target executable to leverage greater access than
-	should be permitted.
-
-	iTargetCapabilities tracks which PlatSec capabilities the target executables may
-	possess and still be debugged by this debug agent. The capabilities are NOT those
-	of the debug agent process, they are the capabilites indicated in the OEM Debug Token
-	which describe the capabilities the debug agent is authorised to debug. E.g. a Debug
-	Agent might use CommsDD, but wish to debug a DRM capable executable. In that case, the
-	Debug Agent exe must be signed with CommsDD, but the OEM Debug Token need only possess
-	DRM and AllFiles (permission to look inside another executable).
-	*/
-	TCapabilitySet iOEMDebugCapabilities;
-	
-	//RLocalDrive to access the crash Flash
-	RLocalDrive iLocalDrive;
-	
-	//For NOR flash 
-	TLocalDriveCapsV2 iCaps;
-	
-	/**
-	 * If true means the local drive connected to the crash partition else connect 
-	 * when access required to crash flash partition for read operation
-	*/	
-	TBool iCrashConnected;
-	};
-
-
-#endif // C_SECURITY_SVR_SESSION_H
-
--- a/kernel/eka/debug/securityServer/inc/c_shutdown_timer.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Definitions for the security server's shutdown timer.
-// 
-//
-
-#ifndef C_SHUTDOWN_TIMER_H
-#define C_SHUTDOWN_TIMER_H
-
-/**
-@file
-@internalTechnology
-@released
-*/
-
-#include <e32base.h>
-
-const TInt KShutdownDelay = 5000000; // approx 5 seconds
-const TInt KActivePriorityShutdown = -1; // priority for shutdown AO
-
-/**
-Timer class used to manage shutdown of the DSS
-*/
-class CShutdownTimer : public CTimer
-	{
-public:
-	CShutdownTimer();
-	void ConstructL();
-	void Start();
-private:
-	void RunL();
-	};
-
-#endif // C_SHUTDOWN_TIMER_H
-
--- a/kernel/eka/debug/securityServer/inc/low_mem_requests.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Request numbers for use with the Debug Security Server and low mem tests
-// 
-//
-
-#ifndef LOW_MEM_REQUESTS_H
-#define LOW_MEM_REQUESTS_H
-
-/**
-@file
-@internalTechnology
-@released
-*/
-
-#ifdef _DEBUG
-// enumerators to use to call Debug Security Server in debug mode for low mem tests
-enum TLowMemDebugServRqst
-	{
-	EDebugServFailAlloc = 0x10000001,
-	EDebugServMarkEnd = 0x10000002,
-	EDebugServMarkHeap = 0x10000003
-	};
-#endif
-
-#endif //LOW_MEM_REQUESTS_H
--- a/kernel/eka/debug/securityServer/inc/rm_debug_logging.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Logging macros for use in debug subsystem
-// 
-//
-
-#ifndef RM_DEBUG_LOGGING_H
-#define RM_DEBUG_LOGGING_H
-
-/* Debug messages
- * 
- * Debug messages are only generated for debug builds.
- * 
- * For kernel mode, use __KTRACE_OPT(KDEBUGGER, Kern::Printf(), 
- * for user mode use RDebug::Printf(). 
- * 
- */
-
-#ifdef _DEBUG
-
-  #ifdef __KERNEL_MODE__
-
-    #include <kernel/kernel.h>
-    #include <nkern/nk_trace.h>
-
-    #define LOG_MSG(args...)			__KTRACE_OPT(KDEBUGGER, Kern::Printf(args))
-	#define LOG_ENTRY()					__KTRACE_OPT(KDEBUGGER, Kern::Printf("+%s", __PRETTY_FUNCTION__))
-	#define LOG_EXIT()					__KTRACE_OPT(KDEBUGGER, Kern::Printf("-%s", __PRETTY_FUNCTION__))
-	#define LOG_ARGS(fmt, args...)		__KTRACE_OPT(KDEBUGGER, Kern::Printf("+%s " fmt, __PRETTY_FUNCTION__, args))
-	#define LOG_RETURN(x)				__KTRACE_OPT(KDEBUGGER, Kern::Printf("Returning %d from [%s]", x, __PRETTY_FUNCTION__)
-
-	// These kept for compatability
-    #define LOG_MSG2( a, b )			__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b ))
-    #define LOG_MSG3( a, b, c )			__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c ))
-    #define LOG_MSG4( a, b, c, d )		__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d ))
-    #define LOG_MSG5( a, b, c, d, e )	__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d, e ))
-  #else
-
-    #include <e32debug.h>
-
-    #define LOG_MSG(args...)			RDebug::Printf(args)
-	#define LOG_DES(args...)			RDebug::Print(args) // For wide descriptors
-	#define LOG_ENTRY()					RDebug::Printf("+%s", __PRETTY_FUNCTION__)
-	#define LOG_EXIT()					RDebug::Printf("-%s", __PRETTY_FUNCTION__)
-	#define LOG_ARGS(fmt, args...)		RDebug::Printf("+%s " fmt, __PRETTY_FUNCTION__, args)
-	#define LOG_RETURN(x)				RDebug::Printf("Returning %d from [%s]", x, __PRETTY_FUNCTION__)
-
-    #define LOG_MSG2( a, b )			RDebug::Printf( a, b )
-    #define LOG_MSG3( a, b, c )			RDebug::Printf( a, b, c )
-    #define LOG_MSG4( a, b, c, d )		RDebug::Printf( a, b, c, d )
-    #define LOG_MSG5( a, b, c, d, e )	RDebug::Printf( a, b, c, d, e )
-
-  #endif
-
-#else
-
-	#define LOG_MSG(args...)
-	#define LOG_DES(args...)
-	#define LOG_ENTRY()
-	#define LOG_EXIT()
-	#define LOG_ARGS(fmt, args...)
-	#define LOG_RETURN(x)
-
-	#define LOG_MSG2( a, b )
-	#define LOG_MSG3( a, b, c )
-	#define LOG_MSG4( a, b, c, d )
-	#define LOG_MSG5( a, b, c, d, e )
-
-#endif
-
-#endif //RM_DEBUG_LOGGING_H
-
--- a/kernel/eka/debug/securityServer/src/c_process_pair.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Provides a helper class for process security management
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-
-// Required for logging
-#include <rm_debug_api.h>
-
-#include "c_process_pair.h"
-#include "rm_debug_logging.h"
-
-
-CProcessPair* CProcessPair::NewL(const TDesC& aProcessName, const TProcessId aProcessId)
-	{
-	CProcessPair* self=new (ELeave) CProcessPair();
-	CleanupStack::PushL(self);
-	self->ConstructL(aProcessName, aProcessId);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CProcessPair::ConstructL(const TDesC& aProcessName, const TProcessId aProcessId)
-	{
-	//allocate the process name buffer and fill with aProcessName
-	iProcessName = aProcessName.Alloc();
-	if(iProcessName == NULL)
-		User::Leave(KErrNoMemory);
-
-	LOG_MSG2( "CProcessPair::ConstructL() process name: %S", &TPtr8((TUint8*)iProcessName->Ptr(), 2*iProcessName->Length(), 2*iProcessName->Length()) );
-
-	//set process id
-	iProcessId = aProcessId;
-	}
-
-CProcessPair::CProcessPair()
-	{
-	}
-
-CProcessPair::~CProcessPair()
-	{
-	delete iProcessName;
-	}
-
-/**
-Check whether two CProcessPair objects are equal
-
-@param aProcessPair a CProcessPair object to match with this one
-
-@return 0 if process ids and names do not match, non-zero if they do
-*/
-TBool CProcessPair::operator==(const CProcessPair &aProcessPair) const
-	{
-	return Equals(*aProcessPair.iProcessName, aProcessPair.iProcessId);
-	}
-	
-/**
-Check whether this CProcessPair object has these values set
-
-@param aProcessName process name to check
-@param aProcessId process id to check
-
-@return 0 if process ids and names do not match, non-zero if they do
-*/
-TBool CProcessPair::Equals(const TDesC& aProcessName, const TProcessId aProcessId) const
-	{
-	return (ProcessIdMatches(aProcessId) && (ProcessNameMatches(aProcessName)));
-	}
-
-/**
-Check whether the process ids of two objects match
-
-@param aProcessPair a CProcessPair object to compare with this one
-
-@return 0 if process ids do not match, non-zero if they do
-*/
-TBool CProcessPair::ProcessIdMatches(const CProcessPair &aProcessPair) const
-	{
-	return ProcessIdMatches(aProcessPair.iProcessId);
-	}
-
-/**
-Check whether two process ids match
-
-@param aProcessId a process ID to compare with this pair's process ID
-
-@return 0 if process ids do not match, non-zero if they do
-*/
-TBool CProcessPair::ProcessIdMatches(const TProcessId &aProcessId) const
-	{
-	return iProcessId == aProcessId;
-	}
-
-/**
-Check whether the process names of two objects match in-case-sensitively
-
-@param aProcessPair a CProcessPair object to compare with this one
-
-@return 0 if process names do not match, non-zero if they do
-*/
-TBool CProcessPair::ProcessNameMatches(const CProcessPair &aProcessPair) const
-	{
-	return ProcessNameMatches(*aProcessPair.iProcessName);
-	}
-
-/**
-Check whether two strings match in-case-sensitively
-
-@param aProcessName a process name to compare with this pair's process name
-
-@return 0 if process names do not match, non-zero if they do
-*/
-TBool CProcessPair::ProcessNameMatches(const TDesC& aProcessName) const
-	{
-	return iProcessName->CompareF(aProcessName) == 0;
-	}
-
--- a/kernel/eka/debug/securityServer/src/c_security_svr_async.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Asynchronous security server active object class.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-
-#include "c_security_svr_async.h"
-#include "rm_debug_logging.h"
-
-using namespace Debug;
-
-// ctor
-CSecuritySvrAsync::CSecuritySvrAsync(CSecuritySvrSession* aSession, TProcessId aAgentId)
-	: CActive(CActive::EPriorityStandard),
-	iSession(aSession),
-	iProcessName(NULL),
-	iAgentId(aAgentId),
-	iEventBalance(0)
-	{
-	LOG_MSG("CSecuritySvrAsync::CSecuritySvrAsync()");
-	CActiveScheduler::Add(this);
-	}
-
-// returns a CSecuritySvrAsync active object associated with
-// the specified agent and debugged process.
-CSecuritySvrAsync* CSecuritySvrAsync::NewL(CSecuritySvrSession* aSession, const TDesC8& aProcessName, TProcessId aAgentId)
-	{
-	LOG_MSG("CSecuritySvrAsync::NewL()");
-	CSecuritySvrAsync* me = new (ELeave) CSecuritySvrAsync(aSession, aAgentId);
-
-	CleanupStack::PushL(me);
-
-	me->ConstructL(aProcessName);
-
-	CleanupStack::Pop(me);
-
-	return (me);
-	}
-
-// dtor
-CSecuritySvrAsync::~CSecuritySvrAsync()
-	{
-	LOG_MSG("CSecuritySvrAsync::~CSecuritySvrAsync()");
-
-	// NOTE: the Cancel() function calls DoCancel() which may rely on class members so be careful not
-	// to destroy/close data members before this call if they are needed
-	Cancel();
-	iProcessName.Close();
-	}
-
-// Associates the agent id and process name with the Active Object being constructed
-void CSecuritySvrAsync::ConstructL(const TDesC8& aProcessName)
-	{
-	LOG_MSG("CSecuritySvrAsync::ConstructL()");
-	iProcessName.CreateL(aProcessName.Length());
-	iProcessName.Copy(aProcessName);
-	}
-
-// RunL() completes a previously issued call (currently only GetEvent() completion)
-void CSecuritySvrAsync::RunL()
-	{
-
-	LOG_MSG3("CSecuritySvrAsync::RunL() &iInfo=0x%08x, iEventBalance=%d", (TUint8*)&iInfo, iEventBalance);
-
-	// Something bad happened in the driver
-	User::LeaveIfError(iStatus.Int());
-
-	// Write back the event data to the debug agent.
-	// For compatibility we need to check the size of the buffer that the
-	// client has passed in as the size of TEventInfo will increase over time.
-	// Clients can calculate the required size from the EApiConstantsTEventInfoSize entry 
-	// in the Debug Functionality block but may still pass in buffers which
-	// are smaller than the Debug Security Server's calculation of sizeof(TEventInfo), 
-	// returning KErrTooBig in this case would be
-	// inappropriate as we would break compatibility.
-	TInt dataLengthToReturn = sizeof(TEventInfo);
-	TInt maxLengthClientSide = iMessage.GetDesMaxLengthL(1);
-	if(maxLengthClientSide < dataLengthToReturn)
-		{
-		dataLengthToReturn = maxLengthClientSide;
-		}
-
-	TPtr8 data((TUint8*)&iInfo,dataLengthToReturn,dataLengthToReturn);
-
-	iMessage.WriteL(1,data,0);
-
-	iMessage.Complete(KErrNone);
-	--iEventBalance;
-	}
-
-// Cancels the oustanding GetEvent call. May cope with other async calls in future.
-void CSecuritySvrAsync::DoCancel()
-	{
-	LOG_MSG2("CSecuritySvrAsync::DoCancel() iEventBalance=%d", iEventBalance);
-	iSession->Server().iKernelDriver.CancelGetEvent(iProcessName,iAgentId.Id());
-
-	iMessage.Complete(KErrCancel);
-	iEventBalance=0;
-	}
-
-// Report any leave to the client if possible.
-TInt CSecuritySvrAsync::RunError(TInt aError)
-	{
-	LOG_MSG2("CSecuritySvrAsync::RunError()=%d", aError);
-	iMessage.Complete(aError);
-
-	return KErrNone;
-	}
-
-/*
- * Start an asynchronous GetEvent call to the debug driver
- * and activates this active object. 
- */
-void CSecuritySvrAsync::GetEvent(const RMessage2& aMessage)
-	{
-	iMessage = aMessage;
-
-	iEventBalance++;
-	LOG_MSG5("CSecuritySvrAsync::GetEvent() this = 0x%08x, iInfo=0x%08x, iStatus=0x%08x \
-		iEventBalance=%d : >SetActive() > GetEvent() ",
-		this, &iInfo, &iStatus, iEventBalance );
-
-	/* 
-	SetActive is called before sending the message to the driver so 
-	that we do not get stray signal panics, since the driver may complete immediately
- 	*/
-	SetActive();
-	iSession->Server().iKernelDriver.GetEvent(iProcessName,iAgentId.Id(),iStatus,iInfo);
-	}
-
-// Used for identifying which AO is associated with a debugged process
-const TDesC8& CSecuritySvrAsync::ProcessName(void)
-	{
-	return iProcessName;
-	}
-
-// End of file - c_security_svr_async.cpp
-
--- a/kernel/eka/debug/securityServer/src/c_security_svr_server.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,655 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Provides the debug security server server implementation.
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <rm_debug_api.h>
-#include "c_process_pair.h"
-#include "c_security_svr_session.h"
-#include "c_security_svr_server.h"
-#include "rm_debug_logging.h"
-
-using namespace Debug;
-
-/**
-Server constructor, sessions are created as ESharableSessions, meaning that
-each session will be used by at most one debug agent
-*/
-CSecuritySvrServer::CSecuritySvrServer(CActive::TPriority aActiveObjectPriority)
-	: CServer2(aActiveObjectPriority, ESharableSessions),
-	  iSessionCount(0),
-	  iShutdown()
-	{
-	LOG_MSG("CSecuritySvrServer::CSecuritySvrServer()\n");
-	}
-
-/**
-Standard implementation
-
-@return pointer to new CSecuritySvrServer object
-*/
-CSecuritySvrServer* CSecuritySvrServer::NewLC()
-	{
-	LOG_MSG("CSecuritySvrServer::NewLC()\n");
-
-	CSecuritySvrServer* self=new(ELeave) CSecuritySvrServer(EPriorityStandard);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-/**
-Server destructor, performs cleanup for the server
-*/
-CSecuritySvrServer::~CSecuritySvrServer()
-	{
-	LOG_MSG("CSecuritySvrServer::~CSecuritySvrServer()\n");
-
-	// stop the kernel side driver
-	iKernelDriver.Close();
-	User::FreeLogicalDevice(KDebugDriverName);
-
-	//deallocate both the debug maps
-	iPassiveDebugMap.ResetAndDestroy();
-	iActiveDebugMap.ResetAndDestroy();
-	}
-
-/**
-Starts the server and constructs and starts the servers shutdown timer
-*/
-void CSecuritySvrServer::ConstructL()
-	{
-	LOG_MSG("CSecuritySvrServer::ConstructL()");
-
-	StartL(KSecurityServerName);
-	iShutdown.ConstructL();
-	iShutdown.Start();
-
-	//load the kernel driver
-	TInt err = User::LoadLogicalDevice(KDebugDriverFileName);
-	if(! ((KErrNone == err) || (KErrAlreadyExists == err)))
-		{
-		User::Leave(err);
-		}
-	//create an information object for initialising the driver
-	TRM_DebugDriverInfo driverInfo;
-	driverInfo.iUserLibraryEnd = 0;
-	User::LeaveIfError(iKernelDriver.Open(driverInfo));
-	}
-
-/**
-Creates a new session with the DSS. A version check is done to ensure that an
-up to date version of the DSS is available (according to the DA's needs).
-The device driver is loaded if necessary and a session with the server and a 
-handle to the driver opened.
-
-@param aRequiredVersion the minimal version of the DSS required by the DA
-
-@return a pointer to the new sever session, or NULL if any of the 
-        initialisation process failed
-*/
-CSession2* CSecuritySvrServer::NewSessionL(const TVersion& aRequiredVersion, const RMessage2& aMessage) const
-//
-// Session constructor
-//
-	{
-	LOG_ARGS("version=%d.%d.%d", aRequiredVersion.iMajor, aRequiredVersion.iMinor, aRequiredVersion.iBuild);
-
-	//assert compatible version
-	TVersion currentVersion(KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServPatchVersionNumber);
-	if(!User::QueryVersionSupported(currentVersion, aRequiredVersion))
-		{
-		LOG_MSG("Requested version not compatible with this version. Asked for %d.%d.%d but this is %d.%d.%d", aRequiredVersion.iMajor, aRequiredVersion.iMinor, aRequiredVersion.iBuild, KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServPatchVersionNumber);
-		User::Leave(KErrNotSupported);
-		}
-
-	//create session
-	LOG_MSG("About to call new(ELeave) CSecuritySvrSession()");
-	CSecuritySvrSession* servSession = new(ELeave) CSecuritySvrSession();
-
-	CleanupStack::PushL(servSession);
-	servSession->ConstructL();
-	CleanupStack::Pop(servSession);
-	return servSession;
-	}
-
-/**
-Manages requests from debug agents to attach to target debug processes
-
-Given the debug agent process ID and the target process name:
-(1) checks whether the pair is already in either of the debug maps, if so
-    then returns KErrAlreadyExists
-(2) if aPassive == ETrue then just add the pair to the passive map and return
-    whatever the return value of the array write was
-(3) if aPassive == EFalse then check whether the target debug process is 
-    already reserved by another debug agent. If it is then return KErrInUse,
-    otherwise add the pair to the active debug map and return the status 
-    value of the array write.
-
-@param aTargetProcessName original FileName of the process to attach to
-@param aDebugAgentProcessId process ID of the debug agent
-@param aPassive ETrue if wish to attach passively, EFalse otherwise
-
-@return KErrNone if successfully attached, otherwise another system wide error
-        code as above
-*/
-TInt CSecuritySvrServer::AttachProcessL(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId, const TBool aPassive)
-	{
-	//store the pair of values
-	LOG_MSG( "CSecuritySvrServer::AttachProcessL()\n" );
-
-	CProcessPair *processPair = CProcessPair::NewL(aTargetProcessName, aDebugAgentProcessId);
-	if(processPair == NULL)
-		return KErrNoMemory;
-
-	//check whether the pair already exists in the active debug map
-	for(TInt i=0; i<iActiveDebugMap.Count(); i++)
-		{
-		if(*processPair == *(iActiveDebugMap[i]))
-			{
-			//process already exists
-			LOG_MSG( "  AttachProcessL() error : KErrAlreadyExists in active map\n" );
-			delete processPair;
-			return KErrAlreadyExists;
-			}
-		}
-
-	//check whether the pair already exists in the passive map
-	for(TInt i=0; i<iPassiveDebugMap.Count(); i++)
-		{
-		if(*processPair == *(iPassiveDebugMap[i]))
-			{
-			//process already exists
-			LOG_MSG( "  AttachProcessL() error : KErrAlreadyExists in passive map\n" );
-			delete processPair;
-			return KErrAlreadyExists;
-			}
-		}
-
-	if(aPassive)
-		{
-		//just add the pair and return
-		TInt err = iPassiveDebugMap.Append(processPair);
-		if(err != KErrNone)
-			{
-			// couldn't add pair for some unknown reason, so delete the pair
-			LOG_MSG2( "  AttachProcessL() error %d appending passive process pair \n", err );
-			delete processPair;
-			}
-		return err;
-		}
-	else
-		{
-		//check whether the process Id has already been reserved
-		for(TInt i=0; i<iActiveDebugMap.Count(); i++)
-			{
-			if(processPair->ProcessNameMatches(*(iActiveDebugMap[i])))
-				{
-				//process already being debugged
-				LOG_MSG( "  AttachProcessL() error : process already being debugged\n" );
-				delete processPair;
-				return KErrInUse;
-				}
-			}
-		//try to add the pair	
-		TInt err = iActiveDebugMap.Append(processPair);
-		if(err != KErrNone)
-			{
-			// couldn't add pair for some unknown reason, so delete the pair
-			LOG_MSG2( "  AttachProcessL() error %d appending active process pair \n", err );
-			delete processPair;
-			}
-		return err;
-		}
-	}
-
-/*
-Detach from debugging the specified process
-
-@param aTargetProcessName name of the process to detach from
-@param aDebugAgentProcessId process ID of the debug agent
-
-@return KErrNone if successfully detached, KErrNotFound if an attempt is made
-        to detach from a process which the debug agent hasn't previously attached to
-*/
-TInt CSecuritySvrServer::DetachProcess(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId)
-	{
-	//check whether the pair is in the active debug map
-	for(TInt i=0; i<iActiveDebugMap.Count(); i++)
-		{
-		if(iActiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
-			{
-			//remove the process pair from the active debug map
-			delete iActiveDebugMap[i];
-			iActiveDebugMap.Remove(i);
-			return KErrNone;
-			}
-		}
-
-	//check whether the pair is in the passive debug map
-	for(TInt i=0; i<iPassiveDebugMap.Count(); i++)
-		{
-		if(iPassiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
-			{
-			//remove the process pair from the active debug map
-			delete iPassiveDebugMap[i];
-			iPassiveDebugMap.Remove(i);
-			return KErrNone;
-			}
-		}
-
-	//process pair wasn't in either map
-	return KErrNotFound;
-	}
-
-/**
-Given a debug agent process ID, removes all references to that debug agent
-from the debug maps
-
-@param aMessage message from the debug agent
-
-@return returns KErrNone if successful, another system wide error code otherwise
-*/
-void CSecuritySvrServer::DetachAllProcesses(const TProcessId aDebugAgentProcessId)
-	{
-	//check whether the debug agent process ID is in the active debug map
-	for(TInt i=iActiveDebugMap.Count()-1; i>=0; i--)
-		{
-		if(iActiveDebugMap[i]->ProcessIdMatches(aDebugAgentProcessId))
-			{
-			//remove the process pair from the active debug map
-			delete iActiveDebugMap[i];
-			iActiveDebugMap.Remove(i);
-			}
-		}
-
-	//check whether the debug agent process ID is in the passive debug map
-	for(TInt i=iPassiveDebugMap.Count()-1; i>=0; i--)
-		{
-		if(iPassiveDebugMap[i]->ProcessIdMatches(aDebugAgentProcessId))
-			{
-			//remove the process pair from the passive debug map
-			delete iPassiveDebugMap[i];
-			iPassiveDebugMap.Remove(i);
-			}
-		}
-	}
-
-/*
-Check whether the specified debug agent is attaced to the specfied target
-process.
-
-@param aTargetThreadId thread ID of a thread in the target process
-@param aMessage a message which originates with the debug agent
-@param aPassive if EFalse then checks whether the debug agent is the active
-       debugger of the target process. If ETrue then checks whether the debug
-       agent is attached to the target process, irrespective of whether it is
-       attached passively or actively
-
-@return ETrue if attached, EFalse otherwise
-*/
-TBool CSecuritySvrServer::CheckAttached(const TThreadId aTargetThreadId, const RMessage2& aMessage, const TBool aPassive)
-	{
-	
-	//get a handle to the target thread
-	RThread targetThread;
-	TInt err = targetThread.Open(aTargetThreadId);
-	if(err != KErrNone)
-		{
-		return EFalse;
-		}
-
-	//get a handle to the target process
-	RProcess targetProcess;
-	err = targetThread.Process(targetProcess);
-	//finshed with the thread handle so close it
-	targetThread.Close();
-	if(err != KErrNone)
-		return EFalse;
-
-	//get the target process' file name
-	TFileName targetFileName = targetProcess.FileName();
-
-	// Tamperproofing. Ensure that the debug agent really has a superset
-	// of the target process PlatSec capabilities, as authorised
-	// by an OEM Debug Token (if any)
-
-	TSecurityInfo targetSecInfo(targetProcess);
-
-	// Now compare the capabilities, to ensure the DebugAgent has been authorised with
-	// sufficient capabilities from its OEM Debug token
-	CSecuritySvrSession* session = (CSecuritySvrSession*)aMessage.Session();
-
-	// Presume we need to check the target process is debuggable unless a valid OEM Debug token in effect?
-	if (!OEMTokenPermitsDebugL(session->GetOEMDebugCapabilities(), targetSecInfo.iCaps) )
-		{
-		// No debug token therefore check if the process is debuggable
-		err = iKernelDriver.IsDebuggable(targetProcess.Id());
-		}
-
-	//finished with the process handle so close it
-	targetProcess.Close();
-
-	if (err != KErrNone)
-	{
-		// The process was not marked as debuggable by the loader, and the OEM
-		// debug token did not override the lack of a debuggable bit.
-		// The process was not marked as debuggable by the loader
-		return EFalse;
-	}
-
-	return CheckAttachedProcess(targetFileName, aMessage, aPassive);
-	}
-
-/*
-Check whether the specified debug agent is attaced to the specfied target
-process.
-
-@param aTargetProcessId process ID of the target process
-@param aMessage a message which originates with the debug agent
-@param aPassive if EFalse then checks whether the debug agent is the active
-       debugger of the target process. If ETrue then checks whether the debug
-       agent is attached to the target process, irrespective of whether it is
-       attached passively or actively
-
-@return ETrue if attached, EFalse otherwise
-*/
-TBool CSecuritySvrServer::CheckAttached(const TProcessId aTargetProcessId, const RMessage2& aMessage, const TBool aPassive)
-	{
-	//get a handle to the target process
-	RProcess targetProcess;
-	TInt err =targetProcess.Open(aTargetProcessId);
-	if(err != KErrNone)
-		{
-		return EFalse;
-		}
-
-	//get the target process' file name
-	TFileName targetFileName = targetProcess.FileName();
-
-	// Tamperproofing. Ensure that the debug agent really has a superset
-	// of the target process PlatSec capabilities, as authorised
-	// by an OEM Debug Token (if any)
-
-	TSecurityInfo targetSecInfo(targetProcess);
-
-	// Now compare the capabilities, to ensure the DebugAgent has been authorised with
-	// sufficient capabilities from its OEM Debug token
-	CSecuritySvrSession* session = (CSecuritySvrSession*)aMessage.Session();
-
-	// Presume we need to check the target process is debuggable unless a valid OEM Debug token in effect?
-	if ( !OEMTokenPermitsDebugL(session->GetOEMDebugCapabilities(), targetSecInfo.iCaps) )
-		{
-		// No debug token therefore check if the process is debuggable
-		err = iKernelDriver.IsDebuggable(targetProcess.Id());
-		}
-
-	//finished with the process handle so close it
-	targetProcess.Close();
-
-	if (err != KErrNone)
-	{
-		return EFalse;
-	}
-
-	return CheckAttachedProcess(targetFileName, aMessage, aPassive);
-	}
-
-/*
-Check whether the specified debug agent is attaced to the specfied target
-process.
-
-@param aTargetProcessName 
-@param aMessage a message which originates with the debug agent
-
-@return ETrue if attached, EFalse otherwise
-*/
-TBool CSecuritySvrServer::CheckAttachedProcess(const TDesC& aTargetProcessName, const RMessage2& aMessage, const TBool aPassive) const
-	{
-	//get the debug agent's process id
-	TProcessId clientProcessId = 0;
-	TInt err = GetProcessIdFromMessage(clientProcessId, aMessage);
-	if(err != KErrNone)
-		return EFalse;
-
-	//check permissions
-	if(aPassive)
-		return IsDebugger(aTargetProcessName, clientProcessId);
-	else
-		return IsActiveDebugger(aTargetProcessName, clientProcessId);
-	}
-
-/**
-Tests whether the debug agent is attached actively to the target debug process
-
-@param aTargetProcessName target debug process' FileName
-@param aDebugAgentProcessId process ID of a debug agent
-
-@return ETrue if the specified debug agent is actively attached to the 
-        specified target debug process, EFalse otherwise
-*/
-TBool CSecuritySvrServer::IsActiveDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const
-	{
-	//check whether the pair is in the active debug map
-	for(TInt i=0; i<iActiveDebugMap.Count(); i++)
-		{
-		if(iActiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
-			return ETrue;
-		}
-	//not found so return false
-	return EFalse;
-	}
-
-/**
-Tests whether the target process is being debugged
-
-@param aTargetProcessName target process' FileName
-@param aPassive indicates whether to check for the process being actively debugged,
-or passively debugged
-
-@return ETrue if the specified target process is being debugged,
-        EFalse otherwise
-*/
-TBool CSecuritySvrServer::IsDebugged(const TDesC& aTargetProcessName, const TBool aPassive) const
-	{
-	//get a reference to the appropriate list
-	const RPointerArray<CProcessPair>& map = (aPassive) ? iPassiveDebugMap : iActiveDebugMap;
-
-	//iterate through the map trying to match the aTargetProcessName
-	for(TInt i=0; i<map.Count(); i++)
-		{
-		if(map[i]->ProcessNameMatches(aTargetProcessName))
-			{
-			return ETrue;
-			}
-		}
-	return EFalse;
-	}
-
-/**
-Tests whether the debug agent is attached to the target debug process
-
-@param aTargetProcessName target debug process' FileName
-@param aDebugAgentProcessId process ID of a debug agent
-
-@return ETrue if the specified debug agent is attached to the 
-        specified target debug process (regardless of whether it is attached
-	passively or actively), EFalse otherwise
-*/
-TBool CSecuritySvrServer::IsDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const
-	{
-	//check whether the pair is in the active debug map
-	if(IsActiveDebugger(aTargetProcessName, aDebugAgentProcessId))
-		return ETrue; 
-
-	//check whether the pair is in the passive debug map
-	for(TInt i=0; i<iPassiveDebugMap.Count(); i++)
-		{
-		if(iPassiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
-			return ETrue;
-		}
-	//not found so return false
-	return EFalse;
-	}
-
-/**
-Decrements the server's count of how many sessions are connected to it and
-starts the shutdown timer if there are no sessions connected
-*/
-void CSecuritySvrServer::SessionClosed()
-	{
-	if(--iSessionCount < 1)
-		{
-		iShutdown.Start();
-		}
-	}
-
-/**
-Increments the servers count of how many sessions are connected to it and
-cancels the shutdown timer if it is running
-*/
-void CSecuritySvrServer::SessionOpened()
-	{
-	iSessionCount++;
-	iShutdown.Cancel();
-	}
-
-/** 
-  Get the process id of the thread which sent aMessage
-  @param aProcessId process id of the thread which sent aMessage
-  @param aMessage message object sent by thread 
-
-  @return KErrNone if aProcessId could be set, or one of the system wide error codes if not
-  */
-TInt CSecuritySvrServer::GetProcessIdFromMessage(TProcessId& aProcessId, const RMessage2& aMessage) const
-	{
-	//get the debug agent's thread
-	RThread clientThread;
-	TInt err = aMessage.Client(clientThread);
-	if(err != KErrNone)
-		{
-		return err;
-		}
-
-	//get the debug agent's process
-	RProcess clientProcess;
-	err = clientThread.Process(clientProcess);
-
-	//finished with the thread handle so close it
-	clientThread.Close();
-
-	//check if there was an error from getting the process
-	if(err != KErrNone)
-		{
-		return err;
-		}
-
-	//get the debug agent's process id
-	aProcessId = clientProcess.Id();
-
-	//finished with the process handle so close it
-	clientProcess.Close();
-
-	return KErrNone;
-	}
-
-/**
-  Helper function which determines whether the capabilities of the
-  OEM Token are sufficient to permit debug of an application.
-
-  Normally, we use the AllFiles capability as a proxy which
-  means a Debug Agent can debug non-debuggable executables,
-  provided it has a superset of the capabilities of the executable
-  to be debugged.
- 
-  However, this causes the problem that all OEM Debug Tokens implicitly
-  give the power to debug an AllFiles executable, even if all that
-  is really needed is the power to debug an app with no capabilities,
-  or capabilities other than AllFiles.
-  
-  To address this, we treat the AllFiles capability in a special way.
-  The AllFiles capability in a token is taken to mean that an OEM has
-  signed the token, and hence can debug other executables. But this does
-  not inclue the ability to debug an AllFiles executable. To debug an AllFiles
-  executable, the token must also have TCB.
-
-  @param aTokenCaps - The PlatSec capabilities of a token
-  @param aTargetCaps - The PlatSec capabilities of a target app to be debugged
-
-  @return ETrue if authorised for debugging, EFalse otherwise.
-
-  @leave Any system error code.
-  */
-TBool CSecuritySvrServer::OEMTokenPermitsDebugL(const TCapabilitySet aTokenCaps, const TCapabilitySet aTargetCaps)
-	{	
-	LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL\n");
-
-	// Is the token valid - i.e. does it have AllFiles.
-	if ( !aTokenCaps.HasCapability(ECapabilityAllFiles) )
-		{
-		// Token is not valid, as it does not have AllFiles.
-		LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL - Token does not have AllFiles\n");
-			
-		return EFalse;
-		}
-
-	// Token MUST have a strict superset of capabilities
-	if ( !aTokenCaps.HasCapabilities(aTargetCaps) )
-		{
-		// Token does not have at least all the capabilities of the target
-		LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL - Token does not have superset of target capabilities\n");
-
-		return EFalse;
-		}
-
-	// Special case: If the target has AllFiles, the Token must have TCB
-	if ( aTargetCaps.HasCapability(ECapabilityAllFiles) )
-		{
-		// Target has AllFiles, so does the Token have TCB?
-		if ( !aTokenCaps.HasCapability(ECapabilityTCB) )
-			{
-			// Token does not have TCB.
-			LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL - Token does not have TCB when target has AllFiles\n");
-	
-			return EFalse;
-			}
-		}
-
-	// If we have passed all the above tests, the token permits debug
-	return ETrue;
-	}
-
-/**
- * This looks at a debug tokens capability and ensures it is sufficient 
- * to provide access to the flash partition
- * @param aTokenCaps Capabilties of the Token
- * @return TBool Whether or not flash access is permitted
- */
-TBool CSecuritySvrServer::OEMTokenPermitsFlashAccessL(const TCapabilitySet aTokenCaps)
-	{	
-	//Must have TCB to access flash
-	return aTokenCaps.HasCapability(ECapabilityTCB);
-	}
-
-//eof
-
--- a/kernel/eka/debug/securityServer/src/c_security_svr_session.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2593 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Provides the debug security server session implementation.
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-// Needed so we get the text strings for capabilities
-#define __INCLUDE_CAPABILITY_NAMES__
-
-#include <e32std.h>
-#include <e32std_private.h>
-#include <e32btrace.h>
-#include <d32btrace.h>
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32uid.h>
-#include <f32file.h>
-#include <e32capability.h>
-#include <rm_debug_api.h>
-
-// required for direct parsing of e32image/tromimage headers
-#include <f32image.h>
-#include <e32rom.h>
-
-//added for direct access to media driver
-#include <partitions.h>
-#include <ftlcontrolio.h>
-
-#include "c_security_svr_session.h"
-#include "c_security_svr_server.h"
-#include "c_security_svr_async.h"
-#include "rm_debug_logging.h"
-#ifdef _DEBUG
-#include "low_mem_requests.h"
-#endif
-
-using namespace Debug;
-
-CSecuritySvrSession::CSecuritySvrSession()
-	: iDebugAgentProcessIdStored(EFalse),
-	  iDebugAgentProcessId(0),
-	  iServerNotified(EFalse),
-	  iCrashConnected(EFalse)
-	{
-	// Ensure that this debug agent has no target capability override
-	// by default
-	iOEMDebugCapabilities.SetEmpty();
-	}
-
-void CSecuritySvrSession::ServiceError(const RMessage2 &aMessage, TInt aError)
-	{
-	LOG_MSG2("CSecuritySvrSession::ServiceError(), aError: %d\n", aError);
-
-	//insert ending heap markers
-	HeapWatcher(aMessage.Function(), EFalse);
-
-	aMessage.Complete(aError);
-	}
-
-/**
-Called by the client/server framework as part of session creation.
-
-Notifies the server that a session is being created
-*/
-void CSecuritySvrSession::CreateL()
-	{
-	LOG_MSG("CSecuritySvrSession::CreateL()\n");
-
-	//notify the server that the session has been opened
-	Server().SessionOpened();
-	iServerNotified = ETrue;
-	}
-
-/**
-  Returns a reference to the DSS
-
-  @return a reference to the DSS
-  */
-CSecuritySvrServer& CSecuritySvrSession::Server() const
-    {
-    return *static_cast<CSecuritySvrServer*>(const_cast<CServer2*>(CSession2::Server()));
-    }
-
-/**
-Session destructor. Performs necessary cleanup and notifies the server that the
-session is being closed
-*/
-CSecuritySvrSession::~CSecuritySvrSession()
-	{
-	LOG_MSG("CSecuritySvrSession::~CSecuritySvrSession!()\n");
-
-	//forced detachment if attached to processes
-	if(iDebugAgentProcessIdStored)
-		{
-		// Cancel any outstanding async objects.
-		iAsyncHandlers.ResetAndDestroy();
-		
-		// Inform the device driver of the agent detach.
-		Server().iKernelDriver.DetachAgent(iDebugAgentProcessId.Id());
-
-		LOG_MSG( "CSecuritySvrSession::~CSecuritySvrSession() : -> securityServer.DetachAllProcesses()\n" );
-		Server().DetachAllProcesses(iDebugAgentProcessId);
-		}
-
-	//notify the server that the session has closed
-	if(iServerNotified)
-		{
-		Server().SessionClosed();
-		}
-	}
-
-void CSecuritySvrSession::ConstructL()
-	{
-	// nothing to do
-	}
-
-/**
-  Used to insert heap checking markers.
-
-  @param aFunction The function that heap markers should be added for
-  @param aEntry if ETrue indicates that heap checking is starting, if EFalse
-  that heap checking is ending.
-  */
-void CSecuritySvrSession::HeapWatcher(const TUint32 aFunction, const TBool aEntry) const
-	{
-	switch(aFunction)
-		{
-		case EDebugServAttachExecutable:
-			return;
-		case EDebugServDetachExecutable:
-			return;
-		case EDebugServSuspendThread:
-			return;
-		case EDebugServResumeThread:
-			return;
-// used for out-of-memory testing in debug mode
-#ifdef _DEBUG
-		// start heap marking in on entry, do nothing on exit
-		case EDebugServMarkHeap:
-			{
-			if(aEntry)
-				{
-				__UHEAP_MARK;
-				}
-			return;
-			}
-		// stop heap marking on exit, do nothing on entry
-		case EDebugServMarkEnd:
-			{
-			if(!aEntry)
-				{
-				__UHEAP_MARKEND;
-				}
-			return;
-			}
-#endif
-		default:
-			if(aEntry)
-				{
-				__UHEAP_MARK;
-				}
-			else
-				{
-				__UHEAP_MARKEND;
-				}
-			return;
-		}
-	}
-
-void CSecuritySvrSession::ServiceL(const RMessage2& aMessage)
-//
-// Session service handler
-//
-	{
-	//insert starting heap markers
-	HeapWatcher(aMessage.Function(), ETrue);
-
-	switch(aMessage.Function())
-		{
-		case EDebugServResumeThread:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServResumeThread\n" );
-			ResumeThreadL(aMessage);
-			break;
-
-		case EDebugServSuspendThread:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServSuspendThread\n" );
-			SuspendThreadL(aMessage);
-			break;
-
-		case EDebugServReadMemory:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServReadMemory\n" );
-			ReadMemoryL(aMessage);
-			break;
-
-		case EDebugServWriteMemory:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServWriteMemory\n" );
-			WriteMemoryL(aMessage);
-			break;
-
-		case EDebugServSetBreak:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServSetBreak\n" );
-			SetBreakL(aMessage);
-			break;
-
-		case EDebugServClearBreak:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServClearBreak\n" );
-			ClearBreakL(aMessage);
-			break;
-
-		case EDebugServModifyBreak:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServModifyBreak\n" );
-			ModifyBreakL(aMessage);
-			break;
-
-		case EDebugServModifyProcessBreak:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServModifyProcessBreak\n" );
-			ModifyProcessBreakL(aMessage);
-			break;
-
-		case EDebugServBreakInfo:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServBreakInfo\n" );
-			BreakInfoL(aMessage);
-			break;
-
-		case EDebugServReadRegisters:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServReadRegisters\n" );
-			ReadRegistersL(aMessage);
-			break;
-
-		case EDebugServWriteRegisters:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServWriteRegisters\n" );
-			WriteRegistersL(aMessage);
-			break;
-
-		case EDebugServGetEvent:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetEvent\n" );
-			GetEventL(aMessage);
-			break;
-
-		case EDebugServCancelGetEvent:
-			CancelGetEventL(aMessage);
-			break;
-
-		case EDebugServAttachExecutable:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServAttachExecutable\n" );
-			AttachProcessL(aMessage);
-			break;
-
-		case EDebugServDetachExecutable:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServDetachExecutable\n" );
-			DetachProcessL(aMessage);
-			break;
-
-		case EDebugServGetDebugFunctionalityBufSize:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetDebugFunctionalityBufSize\n" );
-			GetDebugFunctionalityBufSizeL(aMessage);
-			break;
-
-		case EDebugServGetDebugFunctionality:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetDebugFunctionality\n" );
-			GetDebugFunctionalityL(aMessage);
-			break;
-
-		case EDebugServSetEventAction:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServSetEventAction\n" );
-			SetEventActionL(aMessage);
-			break;
-
-		case EDebugServGetList:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetList\n" );
-			GetListL(aMessage);
-			break;
-
-		case EDebugServStep:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServStep\n");
-			StepL(aMessage);
-			break;
-
-		case EDebugServSetProcessBreak:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServSetProcessBreak\n");
-			SetProcessBreakL(aMessage);
-			break;
-		
-		case EDebugServProcessBreakInfo:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServProcessBreakInfo\n");
-			ProcessBreakInfoL(aMessage);
-			break;
-
-		case EDebugServKillProcess:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServKillProcess\n");
-			KillProcessL(aMessage);
-			break;
-
-#ifdef _DEBUG
-		case EDebugServMarkHeap:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServMarkHeap\n");
-			// all taken care of in HeapWatcher
-			aMessage.Complete(KErrNone);
-			break;
-
-		case EDebugServMarkEnd:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServMarkEnd\n");
-			// all taken care of in HeapWatcher
-			aMessage.Complete(KErrNone);
-			break;
-
-		case EDebugServFailAlloc:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServFailAlloc\n");
-			DoFailAlloc(aMessage);
-			break;
-#endif
-		case EDebugServReadCrashFlash:
-			ReadCrashLogL(aMessage);
-			break;		
-		case EDebugServWriteCrashFlash:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServWriteCrashFlash\n");
-			WriteCrashConfigL(aMessage);
-			break;
-		case EDebugServEraseCrashFlash:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServEraseCrashFlash\n");
-			EraseCrashLogL(aMessage);
-			break;
-		case EDebugServEraseEntireCrashFlash:
-			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServEraseEntireCrashFlash\n");
-			EraseEntireCrashLogL(aMessage);
-			break;
-		default:
-			LOG_MSG( "CSecuritySvrSession::ServiceL() Unknown request, calling User::Leave(KErrNotSupported);\n" );
-			User::Leave(KErrNotSupported);
-			break;
-		}
-
-	//insert ending heap markers
-	HeapWatcher(aMessage.Function(), EFalse);
-	}
-
-#ifdef _DEBUG
-/**
-  Used to control heap failure in debug mode.
-  @param aMessage If aMessage.Int0 is non-zero then heap will be set to fail on that allocation.
-  If aMessage.Int0 is zero then the heap failure count is reset
-  */
-void CSecuritySvrSession::DoFailAlloc(const RMessage2& aMessage)
-	{
-	TInt count = aMessage.Int0();
-	if(count == 0)
-		{
-		__UHEAP_RESET;
-		}
-	else
-		{
-		__UHEAP_FAILNEXT(count);
-		}
-	aMessage.Complete(KErrNone);
-	}
-#endif
-
-/**
-Suspends execution of the specified thread.
-
-@param aMessage contains an integer representation of the target thread's
-       thread ID at offset 0.
-
-@leave KErrPermissionDenied if security check fails or KErrArgument if the
-       thread does not exist
-*/
-void CSecuritySvrSession::SuspendThreadL(const RMessage2& aMessage)
-	{
-
-	LOG_MSG( "CSecuritySvrSession::SuspendThreadL()\n" );
-
-	//get thread ID
-	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-	//check attached
-	CheckAttachedL(threadId, aMessage, EFalse);
-
-	//security check passed so can perform actions
-	User::LeaveIfError(Server().iKernelDriver.SuspendThread(threadId));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Resumes execution of the specified thread.
-
-@param aMessage contains an integer representation of the target thread's
-       thread ID at offset 0.
-
-@leave KErrPermissionDenied if security check fails or KErrArgument if the
-       thread does not exist
-*/
-void CSecuritySvrSession::ResumeThreadL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::ResumeThreadL()\n" );
-
-	//get thread ID
-	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-
-	//check attached
-	CheckAttachedL(threadId, aMessage, EFalse);
-	
-	//security check passed so can perform actions
-	TInt err = Server().iKernelDriver.ResumeThread(threadId);
-	aMessage.Complete(err);
-	}
-
-void CSecuritySvrSession::GetDebugFunctionalityBufSizeL(const RMessage2& aMessage)
-//
-// Retrieve size of functionality data buffer in bytes which must be allocated
-// by the client
-//
-	{
-	LOG_MSG( "CSecuritySvrSession::GetDebugFunctionalityBufSizeL()\n" );
-
-	TUint32 result = 0;
-	// Get Buffer size from the kernel driver
-	User::LeaveIfError(Server().iKernelDriver.GetDebugFunctionalityBufSize(result));
-
-	TPtr8 stuff((TUint8*)&result,4, 4);
-
-	aMessage.WriteL(0,stuff);
-
-	aMessage.Complete(KErrNone);
-	}
-
-void CSecuritySvrSession::GetDebugFunctionalityL(const RMessage2& aMessage)
-//
-// Retrieve the functionality data and place it in a buffer
-// allocated by the client.
-//
-	{
-	LOG_MSG( "CSecuritySvrSession::GetDebugFunctionalityL()\n" );
-
-	TUint32 dfsize = 0;
-
-	// Get Buffer size from the kernel driver
-	User::LeaveIfError(Server().iKernelDriver.GetDebugFunctionalityBufSize(dfsize));
-
-	// Allocate space for the functionality data
-	HBufC8* dftext = HBufC8::NewLC(dfsize);
-
-	const TPtr8& dfPtr = dftext->Des();
-
-	// Extract said data from the device driver
-	User::LeaveIfError(Server().iKernelDriver.GetDebugFunctionality((TDes8&)dfPtr));
-
-	// Return data to client
-	aMessage.WriteL(0,dfPtr);
-
-	// Free buffer
-	CleanupStack::PopAndDestroy(dftext);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Reads memory from a specified thread using the passed parameters. The user 
-should ensure that the TPtr8 that is passed in has size greater than or equal
-to the size of the memory that is trying to be read.
-
-@param aMessage The RMessage2 object should be constructed as follows:
-    * aMessage.Int0() is the thread ID of the target debug app
-    * aMessage.Ptr1() is a TMemoryInfo object which contains the following:
-        * the address of the memory to be read from the target debug thread
-        * the size of the memory block to be read from the target debug thread
-	* the access size to use
-	* the endianess to interpret the data as
-    * aMessage.Ptr2() is the address of the buffer in the debug agent thread 
-      that the data from the target debug app should be written into 
-
-@leave KErrPermissionDenied if client is not attached to the target
-       thread's process,
-       KErrNoMemory if memory could not be allocated,
-       KErrArgument if there are problems with the aMessage object,
-       KErrBadHandle if the thread represented by aMessage.Ptr0() is invalid,
-       an error value from CSecuritySvrSession::ValidateMemoryInfo if checking
-       the memory attributes failed,
-       or another of the system wide error codes
-*/
-void CSecuritySvrSession::ReadMemoryL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::ReadMemoryL()\n" );
-
-	//get debug app thread ID
-	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-
-	CheckAttachedL(threadId, aMessage, ETrue);
-
-	//create and initialise the memory info object
-	TMemoryInfo targetMemory;
-	TPtr8 targetMemoryPtr( (TUint8 *)&targetMemory, sizeof(TMemoryInfo) );
-
-	aMessage.ReadL(1,targetMemoryPtr);
-
-	//check memory info is acceptable
-	ValidateMemoryInfoL(threadId, targetMemory, ETrue);
-
-	RBuf8 data;
-	data.CreateL(targetMemory.iSize);
-	data.CleanupClosePushL();
-
-	//fill buffer with data from target debug thread
-	User::LeaveIfError(Server().iKernelDriver.ReadMemory(threadId, targetMemory.iAddress, targetMemory.iSize, data));
-
-	//attempt to write the data from the target debug thread back to the agent
-	aMessage.WriteL(2, data);
-
-	//delete temporary buffer
-	CleanupStack::PopAndDestroy(&data);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Writes memory to a specified thread using the passed parameters. 
-
-@param aMessage The RMessage2 object should be constructed as follows:
-    * aMessage.Ptr0() is the thread ID of the target debug app
-    * aMessage.Ptr1() is a TMemoryInfo object which contains the following:
-        * the address of the memory to be written to the target debug thread
-        * the size of the memory block to be written to the target debug thread
-	* the access size to use
-	* the endianess to interpret the data as
-    * aMessage.Ptr2() is the address of the buffer in the debug agent thread 
-      that the data to write to the target debug app should be read from
-
-@leave KErrPermissionDenied if client is not attached (actively) to the target
-       thread's process,
-       KErrNoMemory if memory could not be allocated,
-       KErrArgument if there are problems with the aMessage object,
-       KErrBadHandle if the thread represented by aMessage.Ptr0() is invalid,
-       an error value from CSecuritySvrSession::ValidateMemoryInfo if checking
-       the memory attributes failed,
-       or another of the system wide error codes
-*/
-void CSecuritySvrSession::WriteMemoryL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::WriteMemoryL()\n" );
-
-	//get debug app thread ID
-	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-
-	CheckAttachedL(threadId, aMessage, EFalse);
-
-	//create and initialise the memory info object
-	TMemoryInfo targetMemory;
-	TPtr8 targetMemoryPtr( (TUint8 *)&targetMemory, sizeof(TMemoryInfo) );
-
-	aMessage.ReadL(1,targetMemoryPtr);
-
-	//check memory info is acceptable
-	ValidateMemoryInfoL(threadId, targetMemory, EFalse);
-
-	//create temporary buffer and read data from client
-	RBuf8 data;
-	data.CreateL(targetMemory.iSize);
-	data.CleanupClosePushL();
-	
-	aMessage.ReadL(2, data);
-
-	// what about telling the driver about endianess/access size?
-	User::LeaveIfError(Server().iKernelDriver.WriteMemory(threadId, targetMemory.iAddress, targetMemory.iSize, data));
-
-	//free temporary buffer
-	CleanupStack::PopAndDestroy(&data);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-@internalTechnology
-
-Notes: This call is used to set a thread specific breakpoint. Its input arguments
-are the thread id, address and architecture type of the breakpoint. It returns success
-or failure, and if successful, it sets the TBreakId in the Debug Agent to the 
-breakpoint id by which it can be referenced in future calls to ModifyBreak,ClearBreak and
-BreakInfo.
-
-@param aMessage.Ptr0() - aThreadId is thread id of the target debug process
-@param aMessage.Ptr1() - Address of a TBreakInfo in the Debug Agent
-@param aMessage.Ptr2() - Address of a TBreakId in the Debug Agent
-@leave KErrPermissionDenied if the security check fails.
- KErrAlreadyExists if there is a breakpoint overlapping the desired address.
- KErrNotSupported if the architecture type is unrecognised.
- KErrNoMemory if there is no more memory to complete the operation.
- KErrArgument if the breakpoint address alignment is unsuitable for the requested
- breakpoint.
- KErrOverflow if there are too many breakpoints set.
-*/
-void CSecuritySvrSession::SetBreakL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::SetBreakL!()\n" );
-
-	//get debug app thread ID
-	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-
-	//check that the agent has attached to the target process
-	CheckAttachedL(threadId, aMessage, EFalse);
-
-	//create and initialise the memory info object
-	TBreakInfo breakInfo;
-	TPtr8 breakInfoPtr( (TUint8 *)&breakInfo, sizeof(TBreakInfo) );
-
-	aMessage.ReadL(1,breakInfoPtr);
-
-	//set break in target app
-	TBreakId breakId = 0;
-	User::LeaveIfError(Server().iKernelDriver.SetBreak(breakId, threadId, breakInfo.iAddress, breakInfo.iArchitectureMode));
-
-	//attempt to write the break id back to the debug agent
-	WriteDataL(aMessage, 2, &breakId, sizeof(breakId));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Clears a breakpoint previously set by a SetBreak() call.
-
-@param aMessage.Int0() - TBreakId of the breakpoint to be removed.
-*/
-void CSecuritySvrSession::ClearBreakL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::ClearBreakL()\n" );
-
-	const TInt breakId = aMessage.Int0();
-
-	// Check that the breakpoint exists
-	TUint64 objectId;
-	TUint32 address;
-	TArchitectureMode mode;
-	TBool threadSpecific = EFalse;
-
-	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,objectId,address,mode,threadSpecific));
-
-	if(threadSpecific)
-		{
-		// Check that the debug agent is attached to the thread for which the
-		// breakpoint is currently set.
-		CheckAttachedL(TThreadId(objectId), aMessage, EFalse);
-		}
-	else
-		{
-		// Check that the debug agent is attached to the process for which the
-		// breakpoint is currently set.
-		CheckAttachedL(TProcessId(objectId), aMessage, EFalse);
-		}
-
-	// Finally clear the breakpoint
-	User::LeaveIfError(Server().iKernelDriver.ClearBreak(breakId));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-@param aMessage.Int0() - Breakpoint Id of interest
-@param aMessage.Ptr1() - Address in Debug Agent to place threadId of the breakpoint
-@param aMessage.Ptr2() - Address in Debug Agent to place address of the breakpoint
-@param aMessage.Ptr3() - Address in Debug Agent to place the architecture mode of the breakpoint
-@leave Any error which may be returned by RSessionBase::SendReceive()
-*/
-void CSecuritySvrSession::BreakInfoL(const RMessage2& aMessage)
-	{
-	const TBreakId breakId = (TBreakId)aMessage.Int0();
-
-	TThreadId threadId;
-	TUint32 address;
-	TArchitectureMode mode;
-	TBool threadSpecific = ETrue;
-
-	TUint64 threadIdData;
-	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,threadIdData,address,mode,threadSpecific));
-
-	if(!threadSpecific)
-		{
-		User::Leave(KErrNotFound);
-		}
-
-	threadId = TThreadId(threadIdData);
-
-	//check that the agent has attached to the target process
-	CheckAttachedL(threadId, aMessage, EFalse);
-
-	// return the threadId
-	WriteDataL(aMessage, 1, &threadId, sizeof(threadId));
-
-	// return the address
-	WriteDataL(aMessage, 2, &address, sizeof(address));
-
-	// return the mode
-	WriteDataL(aMessage, 3, &mode, sizeof(mode));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-@internalTechnology
-
-Modify a previously set breakpoint.
-
-@param aMessage.Int0() - The breakpoint id of the breakpoint to modify
-@param aMessage.Ptr1() - The new Thread Id for the breakpoint
-@param aMessage.Int2() - The new virtual memory address for the breakpoint
-@param aMessage.Int3() - The new architecture mode for the breakpoint
-@return KErrNone if succesful. KErrPermissionDenied if the security check fails.
- KErrAlreadyExists if there is a breakpoint overlapping the desired address.
- KErrNotSupported if the architecture type is unrecognised.
- KErrNoMemory if there is no more memory to complete the operation.
- KErrArgument if the breakpoint address alignment is unsuitable for the requested
- breakpoint.
- KErrOverflow if there are too many breakpoints set.
-*/
-void CSecuritySvrSession::ModifyBreakL(const RMessage2& aMessage)
-	{
-	const TBreakId breakId = (TBreakId)aMessage.Int0();
-	const TThreadId threadId = ReadTThreadIdL(aMessage, 1);
-	const TUint32 address = aMessage.Int2();
-	const TArchitectureMode mode = (TArchitectureMode)aMessage.Int3();
-
-	// Get information on the breakpoint to check the security status
-	TUint64 checkThreadId;
-	TUint32 checkAddress;
-	TArchitectureMode checkMode;
-	TBool threadSpecific;
-
-	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,checkThreadId,checkAddress,checkMode,threadSpecific));
-
-	// Security check that the thread Id is associated with the debug agent
-
-	//check that the agent has attached to the target process
-	CheckAttachedL(TThreadId(checkThreadId), aMessage, EFalse);
-
-	// now check that the thread Id which is being set is permitted
-	//check that the agent has attached to the target process
-	CheckAttachedL(threadId, aMessage, EFalse);
-
-	User::LeaveIfError(Server().iKernelDriver.ModifyBreak(breakId,threadId,address,mode));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-@internalTechnology
-
-Notes: This call is used to set a process wide breakpoint. Its input arguments
-are the process id, address and architecture type of the breakpoint. It returns success
-or failure, and if successful, it sets the TBreakId in the Debug Agent to the 
-breakpoint id by which it can be referenced in future calls to ModifyBreak,ClearBreak and
-BreakInfo.
-
-@param aMessage.Ptr0() - aProcessId is process id of the target debug process
-@param aMessage.Ptr1() - Address of a TBreakInfo in the Debug Agent
-@param aMessage.Ptr2() - Address of a TBreakId in the Debug Agent
-@leave KErrPermissionDenied if the security check fails.
- KErrAlreadyExists if there is a breakpoint overlapping the desired address.
- KErrNotSupported if the architecture type is unrecognised.
- KErrNoMemory if there is no more memory to complete the operation.
- KErrArgument if the breakpoint address alignment is unsuitable for the requested
- breakpoint.
- KErrOverflow if there are too many breakpoints set.
-*/
-void CSecuritySvrSession::SetProcessBreakL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::SetProcessBreakL()\n" );
-
-	//get debug app thread ID
-	TProcessId procId = ReadTProcessIdL(aMessage, 0);
-
-	//check that the agent has attached to the target process
-	CheckAttachedL(procId, aMessage, EFalse);
-
-	//create and initialise the memory info object
-	TBreakInfo breakInfo;
-	TPtr8 breakInfoPtr( (TUint8 *)&breakInfo, sizeof(TBreakInfo) );
-
-	aMessage.ReadL(1,breakInfoPtr);
-
-	//set break in target app
-	TBreakId breakId = 0;
-	User::LeaveIfError(Server().iKernelDriver.SetProcessBreak(breakId, procId, breakInfo.iAddress, breakInfo.iArchitectureMode));
-
-	//attempt to write the break id back to the debug agent
-	WriteDataL(aMessage, 2, &breakId, sizeof(breakId));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-@internalTechnology
-
-Modify a previously set process breakpoint.
-
-@param aMessage.Int0() - The breakpoint id of the breakpoint to modify
-@param aMessage.Ptr1() - The new Process Id for the breakpoint
-@param aMessage.Int2() - The new virtual memory address for the breakpoint
-@param aMessage.Int3() - The new architecture mode for the breakpoint
-@return KErrNone if succesful. KErrPermissionDenied if the security check fails.
- KErrAlreadyExists if there is a breakpoint overlapping the desired address.
- KErrNotSupported if the architecture type is unrecognised.
- KErrNoMemory if there is no more memory to complete the operation.
- KErrArgument if the breakpoint address alignment is unsuitable for the requested
- breakpoint.
- KErrOverflow if there are too many breakpoints set.
-*/
-void CSecuritySvrSession::ModifyProcessBreakL(const RMessage2& aMessage)
-	{
-	const TBreakId breakId = (TBreakId)aMessage.Int0();
-	const TProcessId processId = ReadTProcessIdL(aMessage, 1);
-	const TUint32 address = aMessage.Int2();
-	const TArchitectureMode mode = (TArchitectureMode)aMessage.Int3();
-
-	// Get information on the breakpoint to check the security status
-	TUint64 checkProcessId;
-	TUint32 checkAddress;
-	TArchitectureMode checkMode;
-	TBool threadSpecific;
-
-	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,checkProcessId,checkAddress,checkMode,threadSpecific));
-
-	// Security check that the thread Id is associated with the debug agent
-
-	//check that the agent has attached to the target process
-	CheckAttachedL(TProcessId(checkProcessId), aMessage, EFalse);
-
-	// now check that the thread Id which is being set is permitted
-	//check that the agent has attached to the target process
-	CheckAttachedL(processId, aMessage, EFalse);
-
-	User::LeaveIfError(Server().iKernelDriver.ModifyProcessBreak(breakId,processId,address,mode));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-@param aMessage.Int0() - Breakpoint Id of interest
-@param aMessage.Ptr1() - Address in Debug Agent to place process Id of the breakpoint
-@param aMessage.Ptr2() - Address in Debug Agent to place address of the breakpoint
-@param aMessage.Ptr3() - Address in Debug Agent to place the architecture mode of the breakpoint
-@leave Any error which may be returned by RSessionBase::SendReceive()
-*/
-void CSecuritySvrSession::ProcessBreakInfoL(const RMessage2& aMessage)
-	{
-	const TBreakId breakId = (TBreakId)aMessage.Int0();
-
-	TProcessId procId;
-	TUint32 address;
-	TArchitectureMode mode;
-	TBool threadSpecific;
-
-	TUint64 procIdData;
-	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,procIdData,address,mode,threadSpecific));
-	if(threadSpecific)
-		{
-		User::Leave(KErrNotFound);
-		}
-	procId = TProcessId(procIdData);
-
-	//check that the agent has attached to the target process
-	CheckAttachedL(procId, aMessage, EFalse);
-
-	// return the processId
-	WriteDataL(aMessage, 1, &procId, sizeof(procId));
-
-	// return the address
-	WriteDataL(aMessage, 2, &address, sizeof(address));
-
-	// return the mode
-	WriteDataL(aMessage, 3, &mode, sizeof(mode));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Read register values.
-
-@param aMessage should contain:
-        * at offset 0 a pointer to the thread ID of the target thread
-        * at offset 1 a descriptor representing an array of TRegisterInfo 
-          register IDs
-        * at offset 2 a descriptor representing an array into which TRegisterValue 
-          register values will be written
-        * at offset 3 a descriptor representing an array into which TUint8 
-          register flags will be written
-
-@leave KErrArgument if the max length of the array at offset 1 is not a 
-       multiple of sizeof(TRegisterInfo), if the max length of the array 
-       at offset 2 is not a multiple of sizeof(TRegisterValue), if the max 
-       length of the array at offset 3 is not a multiple of sizeof(TUint8), if
-       any of the descriptors have max length of 0, or if the three 
-       descriptors do not represent the same number of registers,
-       KErrNoMemory if there is insufficient memory,
-       KErrDied, if the thread with thread ID aThreadId is dead
-*/
-void CSecuritySvrSession::ReadRegistersL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::ReadRegistersL()\n" );
-
-	const TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-
-	//check the agent is attached to the thread
-	CheckAttachedL(threadId, aMessage, ETrue);
-
-	//number of registers being requested
-	TUint32 numberOfRegisters;
-
-	//check length of descriptors is acceptable
-	ValidateRegisterBuffersL(aMessage, numberOfRegisters);
-
-	// Passed data will be saved in this descriptor.
-	RBuf8 ids;
-	ids.CreateL(numberOfRegisters * sizeof(TRegisterInfo));
-	// Do the right cleanup if anything subsequently goes wrong
-	ids.CleanupClosePushL();
-	
-	//read the data from the client thread
-	aMessage.ReadL(1, ids);
-
-	//create buffer to fill with data from target debug thread
-	HBufC8 *data = HBufC8::NewLC(aMessage.GetDesMaxLength(2));
-	TPtr8 values(data->Des());   
-	
-	HBufC8 *flagsData = HBufC8::NewLC(numberOfRegisters * sizeof(TUint8));
-	TPtr8 flags(flagsData->Des());   
-	
-	//get register info and return relevant parts back to agent
-	User::LeaveIfError(Server().iKernelDriver.ReadRegisters(threadId, ids, values, flags));
-	aMessage.WriteL(2, values);
-	aMessage.WriteL(3, flags);
-	
-	//delete temporary buffers and return status
-	CleanupStack::PopAndDestroy(flagsData);
-	CleanupStack::PopAndDestroy(data);
-	CleanupStack::PopAndDestroy(&ids);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Write register values.
-
-@param aMessage should contain:
-        * at offset 0 a pointer to the thread ID of the target thread
-        * at offset 1 a descriptor representing an array of TRegisterInfo 
-          register IDs
-        * at offset 2 a descriptor representing an array of TRegisterValue register 
-          values
-        * at offset 3 a descriptor representing an array into which TUint8 
-          register flags will be written
-
-@leave KErrArgument if the max length of the array at offset 1 is not a 
-       multiple of sizeof(TRegisterInfo), if the max length of the array 
-       at offset 2 is not a multiple of sizeof(TRegisterValue), if the max 
-       length of the array at offset 3 is not a multiple of sizeof(TUint8), if
-       any of the descriptors have max length of 0, or if the three 
-       descriptors do not represent the same number of registers,
-       KErrNoMemory if there is insufficient memory,
-       KErrDied, if the thread with thread ID aThreadId is dead
-*/
-void CSecuritySvrSession::WriteRegistersL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::WriteRegistersL()\n" );
-
-	const TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-
-	CheckAttachedL(threadId, aMessage, EFalse);
-
-	//number of registers attempting to set
-	TUint32 numberOfRegisters;
-
-	//check length of descriptors is acceptable
-	ValidateRegisterBuffersL(aMessage, numberOfRegisters);
-
-	// Passed register ids will be saved in this descriptor.
-	RBuf8 ids;
-
-	//allocate buffer
-	ids.CreateL(numberOfRegisters * sizeof(TRegisterInfo));
-
-	// Do the right cleanup if anything subsequently goes wrong
-	ids.CleanupClosePushL();
-
-	//read the data from the client thread
-	aMessage.ReadL(1, ids);
-
-	// Passed register values will be saved in this descriptor.
-	RBuf8 values;
-
-	//allocate buffer
-	values.CreateL(aMessage.GetDesMaxLength(2));
-	// Do the right cleanup if anything subsequently goes wrong
-	values.CleanupClosePushL();
-	//read the data from the client thread
-	aMessage.ReadL(2,values);
-
-	HBufC8 *flagsData = HBufC8::NewLC(numberOfRegisters*sizeof(TUint8));
-	TPtr8 flags(flagsData->Des());
-
-	//get register info and return relevant parts back to agent
-	User::LeaveIfError(Server().iKernelDriver.WriteRegisters(threadId, ids, values, flags));
-
-	//write flags data back
-	aMessage.WriteL(3, flags);
-
-	CleanupStack::PopAndDestroy(flagsData);
-	CleanupStack::PopAndDestroy(&values);
-	CleanupStack::PopAndDestroy(&ids);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Processes an attach request from a debug agent. Gets the target debug
-processes' original FileName as an argument. The method sets completion
-status of the aMessage argument to KErrNone if successfully attached and to
-another of the system wide error codes if there were problems.
-
-@param aMessage contains:
-       * a boolean at offset 0 which indicates whether the agent wishes to
-       attach passively
-       * a buffer at offset 1 which contains the FileName
-       of the target debug process.
-*/
-void CSecuritySvrSession::AttachProcessL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::AttachProcessL()\n" );
-
-	const TBool passive = aMessage.Int0();
-
-	TInt deslen = aMessage.GetDesLengthL(1);
-
-	// Passed data will be saved in this descriptor.
-	RBuf processName;
-
-	// Max length set to the value of "deslen", but current length is zero
-	processName.CreateL(deslen);
-
-	// Do the right cleanup if anything subsequently goes wrong
-	processName.CleanupClosePushL();
-
-	// Copy the client's descriptor data into our buffer.
-	aMessage.ReadL(1,processName);
-
-	//
-	// Security Check
-	//
-	// It is not permitted to debug the debug security server!
-	//
-	// get the secure id of the executable
-	TUid secureId(TUid::Null());
-	GetSecureIdL(processName, secureId);
-	if (KUidDebugSecurityServer.iUid == secureId.iUid)
-		{
-		// The debug agent has requested to debug the Debug Security Server
-		// This is either an error, or an attempt to breach security. We
-		// therefore refuse to agree to this request, and return KErrPermissionDenied
-		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Debug Agent attempted to debug the Debug Security Server\n");
-
-		User::Leave(KErrPermissionDenied);
-		}
-
-	//get the debug agent's thread and push handle onto clean up stack
-	RThread clientThread;
-	User::LeaveIfError(aMessage.Client(clientThread));
-	CleanupClosePushL(clientThread);
-
-	//get the debug agent's process
-	RProcess clientProcess;
-	User::LeaveIfError(clientThread.Process(clientProcess));
-
-	//finished with thread so close handle and destroy
-	CleanupStack::PopAndDestroy(&clientThread);
-	
-	//get the debug agent's process id
-	TProcessId processId = clientProcess.Id();
-
-	//store the debug agent's process id for forced detaching later if the
-	//agent doesn't tidy up after itself
-	StoreDebugAgentId(processId);
-
-	// Read the OEM Debug token capabilities (if any)
-	GetDebugAgentOEMTokenCapsL();
-
-	//finished with process so close handle
-	clientProcess.Close();
-	
-	// Get the Security info via rlibrary::getinfo
-	RLibrary::TInfo info;
-	TPckg<RLibrary::TInfo> infoBuf(info);
-
-	TInt err = RLibrary::GetInfo(processName, infoBuf);
-	if (err != KErrNone)
-		{
-		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Cannot parse the target executable header\n");
-		
-		// Could not read the header for this executable :-(
-
-		CleanupStack::PopAndDestroy(&processName);
-		
-		aMessage.Complete(KErrPermissionDenied);
- 
-		return;
-		}
-	
-	// Special case for AllFiles - OEM Debug tokens MUST have
-	// AllFiles, as this is what allows them to read contents
-	// of other executables.
-	TBool checkDebuggable = ETrue;
-
-	// Does an OEM Debug Token permit debug where it would normally not be
-	// permitted?
-	if ( Server().OEMTokenPermitsDebugL(iOEMDebugCapabilities, info.iSecurityInfo.iCaps) )
-		{
-		// OEM Debug token is valid and has sufficient capabilities
-		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Debug Agent has sufficient capabilites based on OEM Debug Token");	
-		
-		checkDebuggable = EFalse;
-		}
-
-	if (checkDebuggable)
-		{
-		// OEM Debug token (if any), does not confer sufficient capabilities to
-		// debug the specified target executable. Therefore debugging can only
-		// be permitted if the target executable itself has been built as 'Debuggable'
-		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Debug Agent has insufficient capabilites based on OEM Debug Token");	
-
-		IsDebuggableL(processName);
-		}
-
-	User::LeaveIfError(Server().AttachProcessL(processName, processId, passive));
-
-	// Inform the kernel driver about the attachment, so that it
-	// can track per-agent data about the process.
-	RBuf8 processName8;
-
-	processName8.CreateL(deslen);
-
-	processName8.CleanupClosePushL();
-
-	processName8.Copy(processName);
-
-	User::LeaveIfError(Server().iKernelDriver.AttachProcess(processName8, processId.Id()));
-
-	// Create an Active Object to handle asynchronous calls to GetEvent
-	CSecuritySvrAsync* handler = CSecuritySvrAsync::NewL(this,processName8,processId);
-
-	err = iAsyncHandlers.Insert(handler,0);
-	if (err != KErrNone)
-		{
-		// If we don't have an asynchronous handler, we should detach
-		// the driver as well.
-		if( (KErrNone != Server().iKernelDriver.DetachProcess(processName8,processId.Id()))
-			|| (KErrNone != Server().DetachProcess(processName, processId)) )
-			{
-			// this is a serious error, neither of these calls should fail so
-			// we panic the server after closing the driver and printing a message
-
-			LOG_MSG("CSecuritySvrSession::AttachProcessL(): critical error during cleanup\n");
-			Server().iKernelDriver.Close();
-			RProcess process;
-			process.Panic(_L("AttachProcessL() failed"), KErrServerTerminated);
-			}
-		}
-
-	User::LeaveIfError(err);
-
-	CleanupStack::PopAndDestroy(&processName8);
-
-	CleanupStack::PopAndDestroy(&processName);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-Reads the OEM Debug Token associated with the debug agent if any. The OEM Debug Token
-allows the Debug Agent to debug certain executables which have not been built as
-'Debuggable'.
-
-This works as follows: The OEM Debug Token is an executable with a special name
-of the form "OEMDebug_<DA_SID>.exe" where <DA_SID> is the Secure ID of the Debug Agent
-in hexadecimal. For example: "OEMDebug_F123ABCD.exe" would be a valid name. This token executable
-must be signed with 'AllFiles' + X, where X is the set of PlatSec capabilities that are
-possessed by the target executable to be debugged.
-
-This function reads the capabilities possessed by the token by creating a process based
-on the executable, and reading the TSecurityInfo associated with the process. This ensures
-that the loader has validated the token has not been tampered with and that the security
-information is valid.
-
-The security information is then stored for future use as member data in iOEMDebugCapabilities.
-
-Leaves if there is an error, otherwise simply fills in the capabilities
-in iOEMDebugCapabilities.
-
-It is not an error for the OEM Debug token not to exist. In this case, the function simply returns.
-*/
-void CSecuritySvrSession::GetDebugAgentOEMTokenCapsL(void)
-	{
-	// Sanity check
-	if (!iDebugAgentProcessIdStored)
-		{
-		LOG_MSG("CSecuritySvrSession::GetDebugAgentOEMTokenCapsL() - Debug Agent Process Id not stored");
-		
-		// We have not stored the debug agent process id!
-		User::Leave(KErrNotReady);
-		}
-
-	// Obtain the security info about the debug agent process
-	//get the debug agent's process
-	RProcess debugAgentProcess;
-
-	CleanupClosePushL(debugAgentProcess);
-
-	debugAgentProcess.Open(iDebugAgentProcessId);
-
-	// We have now obtained a process handle based on the token executable, so we can check its security properties.
-	TSecurityInfo secInfo(debugAgentProcess);
-
-// Compute the name of the OEM debug token based on the SID of the debug agent
-_LIT(KDSSOEMDebugTokenPrefix,"OEMDebug_");
-_LIT(KDSSOEMDebugTokenAppendFmt,"%08X.exe");
-
-	RBuf agentTokenName;
-	agentTokenName.CreateL(KDSSOEMDebugTokenPrefix().Size()+8+1);	// allow space for SID+null terminator
-	agentTokenName.CleanupClosePushL();
-
-	agentTokenName.SetLength(0);
-
-	// Add OEMDebug_
-	agentTokenName.Append(KDSSOEMDebugTokenPrefix());
-
-	// Add debug agent Secure ID
-	agentTokenName.AppendFormat(KDSSOEMDebugTokenAppendFmt,secInfo.iSecureId.iId);
-	
-	// just log the token name for the moment.
-	RBuf8 agentTokenName8;
-
-	agentTokenName8.CreateL(agentTokenName.Length()+1);
-
-	agentTokenName8.CleanupClosePushL();
-
-	agentTokenName8.Copy(agentTokenName);
-
-	agentTokenName8.Append(TChar(0));
-
-	//LOG_MSG2("CSecuritySvrSession::GetDebugAgentOEMTokenCapsL() - OEM Debug Token Name is %s",agentTokenName8.Ptr()); 
-
-	// Cleanup
-	CleanupStack::PopAndDestroy(&agentTokenName8);
-
-	// Now locate and start the executable...
-	RProcess agentToken;
-	TInt err = agentToken.Create(agentTokenName, KNullDesC);
-	if (KErrNone != err)
-		{
-		// Failed to create a process based on the token, just give up
-		LOG_MSG2("CSecuritySvrSession::GetDebugAgentOEMTokenCapsL() - Could not create process based on token due to err 0x%8x\n",err);
-		
-		// Cleanup remaining items from the stack
-		CleanupStack::PopAndDestroy(&agentTokenName);
-
-		CleanupStack::PopAndDestroy(&debugAgentProcess);
-		return;
-		}
-
-	// Synchronise with the process to make sure it hasn't died straight away
-	TRequestStatus stat;
-	agentToken.Rendezvous(stat);
-	if (stat != KRequestPending)
-		{
-		// logon failed - agentToken is not yet running, so cannot have terminated
-		agentToken.Kill(0);             // Abort startup
-		}
-
-	// store the OEM Debug Token security data 
-	TSecurityInfo agentSecInfo(agentToken);
-
-	// Note capabilities for future use
-	iOEMDebugCapabilities=agentSecInfo.iCaps;
-	
-	// resume the token. It _should_ just exit, but we don't really care.
-	agentToken.Resume();
-
-	// Wait to synchronise with agentToken - if it dies in the meantime, it
-	// also gets completed
-	User::WaitForRequest(stat);
-
-	// Just close the handle to it again.
-	agentToken.Close();
-
-	// Cleanup remaining items from the stack
-	CleanupStack::PopAndDestroy(&agentTokenName);
-
-	CleanupStack::PopAndDestroy(&debugAgentProcess);
-
-	}
-
-/**
-  Checks whether the file passed in as aExecutable is XIP or not
-
-  @param aExecutable file to check
-  @return ETrue if the file is XIP, EFalse otherwise
-  */
-TBool CSecuritySvrSession::IsExecutableXipL(RFile& aExecutable)
-	{
-	TUint atts;
-	User::LeaveIfError(aExecutable.Att(atts));
-
-	return atts & KEntryAttXIP;
-	}
-/**
-  Gets access to the symbian crash partition for crash access operation.
-  */
-void CSecuritySvrSession::ConnectCrashPartitionL (void)
-	{
-	LOG_MSG("CSecuritySvrSession::ConnectCrashPartitionL()");
-	
-	TBool changed;
-	TInt error = KErrNone;
-	TInt i=0;
-	
-	//Intialising to EFalse
-	iCrashConnected = EFalse;
-	
-	TPckg<TLocalDriveCapsV2> capsBuf(iCaps);
-	
-	//check for the symbian crash partition
-	for (i=0; i<KMaxLocalDrives; i++)
-		{
-		error = iLocalDrive.Connect (i, changed);
-		if ( error == KErrNone)
-			{
-			error = iLocalDrive.Caps(capsBuf);
-			if ( error != KErrNone)
-				{
-				//continue if not found
-				continue;
-				}
-			if ( iCaps.iPartitionType == (TUint16)KPartitionTypeSymbianCrashLog)
-				{				
-				LOG_MSG2("Found Symbian crash log partition on drive: %d",i);
-				iCrashConnected = ETrue;
-				break;
-				}			
-			}
-		}
-	if ( i == KMaxLocalDrives)
-		{
-		LOG_MSG("No crash log partition found with valid crash log signature found.  Exiting...");
-		User::Leave (KErrNotFound);
-		}
-
-	// Nand Flash not currently supported.
-	if (iCaps.iType == EMediaNANDFlash)
-		{
-		LOG_MSG( "CSecuritySvrSession::ConnectCrashPartitionL()  Nand Flash not currently supported\n" );
-		User::Leave (KErrNotSupported);
-		}
-	}
-/** Checks that aHeaderData contains enough data to cast it to the
-  appropriate header type.
-
-  @param aHeaderData buffer containing header data read from a file
-  @param aXip boolean indicating whether the header data is for an XIP image
-
-  @return ETrue if enough data in buffer, EFalse otherwise
-  */
-TBool CSecuritySvrSession::CheckSufficientData(const TDesC8& aHeaderData, const TBool aXip) const
-	{
-	TUint minimumHeaderSize = aXip ? sizeof(TRomImageHeader) : sizeof(E32ImageHeaderV);
-	return (aHeaderData.Length() >= minimumHeaderSize);
-	}
-
-/**
-  Opens a file handle to aFileName using aFileHandle
-  @param aFileName file to open handle to
-  @param aFs file system to use to open the handle
-  @param aFileHandle file handle to open
-
-  @leave one of the system wide error codes
-  */
-void CSecuritySvrSession::OpenFileHandleL(const TDesC& aFileName, RFs& aFs, RFile& aFileHandle)
-	{
-	TInt err = aFileHandle.Open(aFs, aFileName, EFileRead | EFileShareReadersOnly);
-	if (err != KErrNone)
-		{
-		// Could not open the file for reading
-		LOG_MSG("CSecuritySvrSession::OpenFileHandleL - Failed to open executable\n");
-
-		User::Leave(err);
-		}
-	}
-
-/**
-  Checks whether an executable has the debug bit set
-
-  @param aHeaderData buffer containing the header of the executable
-  @param aXip indication of whether the executable is XIP or not
-
-  @return ETrue if debug bit is set, EFalse otherwise
-  */
-TBool CSecuritySvrSession::IsDebugBitSet(const TDesC8& aHeaderData, const TBool aXip)
-	{
-	if(!CheckSufficientData(aHeaderData, aXip))
-		{
-		return EFalse;
-		}
-
-	if (aXip)
-		{
-		TRomImageHeader* hdr = (TRomImageHeader*)aHeaderData.Ptr();
-		return (hdr->iFlags & KRomImageDebuggable);
-		}
-	else
-		{
-		// it is an epoc32 image
-		E32ImageHeaderV* hdr = (E32ImageHeaderV*)aHeaderData.Ptr();
-		return (hdr->iFlags & KImageDebuggable);
-		}
-	}
-
-/**
-Determines whether a particular executable is marked as 'debuggable'
-
-Notes:
-This function is currently hard coded to understand the format of e32 and
-TRomImage file headers. Ideally this will be replaced by a call to RLibrary::GetInfo
-which can return the 'debuggable' information. Unfortunately, this call currently
-does not provide the information for XIP executables :-(
-
-@leave KErrPermissionDenied if the debug bit is not set, or one of the other
-system wide error codes
-*/
-void CSecuritySvrSession::IsDebuggableL(const TDesC& aFileName)
-	{
-#ifndef IGNORE_DEBUGGABLE_BIT
-
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-
-	RFile targetExe;
-	OpenFileHandleL(aFileName, fs, targetExe);
-	CleanupClosePushL(targetExe);
-
-	// Read in the entire header
-	RBuf8 e32HdrBuf;
-	e32HdrBuf.CreateL(RLibrary::KRequiredImageHeaderSize);
-	e32HdrBuf.CleanupClosePushL();
-
-	// Read the entire header as far as possible
-	TInt err = targetExe.Read(e32HdrBuf);
-	if (err != KErrNone)
-		{
-		// Could not read the file 
-		LOG_MSG("CSecuritySvrSession::IsDebuggableL - Failed to read executable\n");
-
-		User::Leave(err);
-		}
-
-	if(!CheckSufficientData(e32HdrBuf, IsExecutableXipL(targetExe)))
-		{
-		User::Leave(KErrGeneral);
-		}
-
-	if(! IsDebugBitSet(e32HdrBuf, IsExecutableXipL(targetExe)))
-		{
-		User::Leave(KErrPermissionDenied);
-		}
-	CleanupStack::PopAndDestroy(3, &fs);
-
-#else
-	LOG_MSG("CSecuritySvrSession::IsDebuggableL() Debuggable bit temporarily ignored!!!");
-#endif
-	}
-
-/**
-Processes a detach request from a debug agent. Gets the target debug
-processes' original FileName as an argument. The method sets completion
-status of the aMessage argument to KErrNone if successfully detached and to
-another of the system wide error codes if there were problems.
-
-@param aMessage contains:
-       * a buffer at offset 0 which contains the FileName
-       of the target debug process.
-*/
-void CSecuritySvrSession::DetachProcessL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::DetachProcessL()\n" );
-
-	TInt deslen = aMessage.GetDesLengthL(0);
-	// Passed data will be saved in this descriptor.
-	RBuf processName;
-
-	// Max length set to the value of "deslen", but current length is zero
-	processName.CreateL(deslen);
-
-	// Do the right cleanup if anything subsequently goes wrong
-	processName.CleanupClosePushL();
-
-	// Copy the client's descriptor data into our buffer.
-	aMessage.ReadL(0,processName);
-
-	User::LeaveIfError(Server().DetachProcess(processName, iDebugAgentProcessId));
-
-	// Inform the kernel driver about the detachment, so that
-	// it can stop tracking per-agent data for the debugged process.
-	RBuf8 processName8;
-
-	processName8.CreateL(deslen);
-
-	processName8.CleanupClosePushL();
-
-	processName8.Copy(processName);
-
-	// Remove the Asynchronous Object associated with this process
-	for(TInt i=0; i<iAsyncHandlers.Count(); i++)
-		{
-		if (processName8.Compare(iAsyncHandlers[i]->ProcessName()) == 0)
-			{
-			delete iAsyncHandlers[i];
-			iAsyncHandlers.Remove(i);
-
-			break;
-			}
-		}
-	
-	// Inform the driver that we are no longer attached to this process
-	User::LeaveIfError(Server().iKernelDriver.DetachProcess(processName8,iDebugAgentProcessId.Id()));
-	
-	CleanupStack::PopAndDestroy(&processName8);
-	CleanupStack::PopAndDestroy(&processName);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
-@param aMessage The RMessage2 object is expected to contain:
-  * aMessage.Int0() - TDes8 Containing the process name.
-  * aMessage.Int1() - Address of TPtr8 containing TEventInfo
-
-*/
-void CSecuritySvrSession::GetEventL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::GetEventL()\n" );
-
-	// Local descriptor to contain target process name
-	TInt deslen = aMessage.GetDesLengthL(0);
-
-	RBuf processName;
-
-	processName.CreateL(deslen);
-	
-	processName.CleanupClosePushL();
-
-	// Read the target process name into processName
-	aMessage.ReadL(0,processName);
-
-	// Check if debug agent is attached to process
-	if(!Server().CheckAttachedProcess(processName, aMessage, EFalse))
-		{
-		LOG_MSG("CSecuritySvrSession::GetEventL() - Not attached to this process\n");
-
-		// Debug Agent is not attached at all to the requested process
-		User::Leave(KErrPermissionDenied);
-		}
-
-	// Identify which process is being debugged, so that
-	// we can locate the appropriate active object handler.
-	RBuf8 processName8;
-
-	processName8.CreateL(processName.Length());
-
-	processName8.CleanupClosePushL();
-
-	processName8.Copy(processName);
-
-	// Find the Asynchronous Object associated with this process,
-	// as it is permissible to have an outstanding GetEvent call
-	// for each attached process.
-	TBool foundHandler = EFalse;
-	for(TInt i=0; i<iAsyncHandlers.Count(); i++)
-		{
-		if (processName8.Compare(iAsyncHandlers[i]->ProcessName()) == 0)
-			{
-			iAsyncHandlers[i]->GetEvent(aMessage);
-			foundHandler = ETrue;
-			break;
-			}
-		}
-
-	if (foundHandler == EFalse)
-		{
-		// could not find an async handler object. Report the problem.
-		LOG_MSG("CSecuritySvrSessionL - Could not find a handler object\n");
-		User::Leave(KErrNotFound);
-		}
-
-	// Actually make the driver call, passing in the agent Id
-	// so that the driver knows which per-agent event queue
-	// to interrogate to retrieve the latest event.
-	CleanupStack::PopAndDestroy(&processName8);
-	CleanupStack::PopAndDestroy(&processName);
-	}
-
-/**
-Cancels a pre-issued GetEvent call for a specific debugged process.
-
-@param aMessage.Int0() - TDes8 containing aProcessName
-*/
-void CSecuritySvrSession::CancelGetEventL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::CancelGetEventL()\n" );
-
-	// Local descriptor to contain target process name
-	TInt deslen = aMessage.GetDesLengthL(0);
-
-	RBuf processName;
-
-	processName.CreateL(deslen);
-
-	processName.CleanupClosePushL();
-
-	// Read the target process name into processName
-	aMessage.ReadL(0,processName,0);
-
-	// Debug Agent is not an active debugger. Check if the DA is passively attached
-	if(!Server().CheckAttachedProcess(processName, aMessage, EFalse))
-		{
-		// Debug Agent is not attached at all to the requested process
-		User::Leave(KErrPermissionDenied);
-		}
-
-	// Identify the appropriate active object associate
-	// with this process.
-	RBuf8 processName8;
-
-	processName8.CreateL(processName.Length());
-
-	processName8.CleanupClosePushL();
-
-	processName8.Copy(processName);
-
-	// Find the Asynchronous Object associated with this process
-	TBool foundHandler = EFalse;
-	for(TInt i=0; i<iAsyncHandlers.Count(); i++)
-		{
-		if (processName8.Compare(iAsyncHandlers[i]->ProcessName()) == 0)
-			{
-
-			// Found the AO handler, so cancel the outstanding getevent call.
-			iAsyncHandlers[i]->Cancel();
-			foundHandler = ETrue;
-			break;
-			}
-		}
-
-	if(!foundHandler)
-		{
-		// We could not found a handler, so report the problem to the debug agent
-		User::Leave(KErrNotFound);
-		}
-
-	//do cleanup
-	CleanupStack::PopAndDestroy(&processName8);
-	CleanupStack::PopAndDestroy(&processName);
-
-	aMessage.Complete(KErrNone);
-	}
-
-/*
- Purpose: Sets the required event action to be taken for a specific
- process and event combination
-
-@param aMessage The RMessage2 object is expected to contain:
-  * aMessage.Int0() - TDes8 Containing the process name.
-  * aMessage.Int1() - TEventType
-  * aMessage.Int2() - TKernelEventAction
-  *
-*/
-void CSecuritySvrSession::SetEventActionL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::SetEventActionL()\n" );
-
-	// Local descriptor to contain target process name
-	TInt deslen = aMessage.GetDesLengthL(0);
-
-	RBuf processName;
-
-	processName.CreateL(deslen);
-
-	processName.CleanupClosePushL();
-
-	// Read the target process name into processName
-	aMessage.ReadL(0,processName);
-
-	//check that the agent has attached to the target process
-	if(!Server().CheckAttachedProcess(processName, aMessage, EFalse))
-		{
-		// Debug Agent is not attached at all to the requested process
-		User::Leave(KErrPermissionDenied);
-		}
-
-	// Extract and validate the arguments from aMessage
-	TUint32 event  = aMessage.Int1();
-	if (event >= EEventsLast)
-		{
-		// Supplied event Id was not recognised
-		User::Leave(KErrArgument);
-		}
-
-	TUint32 action = aMessage.Int2();
-	if(action >= EActionLast)
-	{
-		// Supplied event action was not recognised
-		User::Leave(KErrArgument);
-	}
-
-	RBuf8 processName8;
-
-	processName8.CreateL(processName.Length());
-
-	processName8.CleanupClosePushL();
-
-	processName8.Copy(processName);
-
-	// Make the call to the device driver
-	TInt err = Server().iKernelDriver.SetEventAction(processName8, \
-		(TEventType)event,\
-		(TKernelEventAction)action,\
-		iDebugAgentProcessId.Id());
-
-	User::LeaveIfError(err);
-
-	CleanupStack::PopAndDestroy(&processName8);
-	CleanupStack::PopAndDestroy(&processName);
-
-	aMessage.Complete(KErrNone);
-}
-
-/**
-Purpose: Single-step a thread for a specified number of instructions
-
-@param aMessage.Ptr0() - Thread Id of the thread to be stepped
-@param aMessage.Int1() - Number of instructions to step.
-
-@leave one of the system wide error codes
-
-*/
-void CSecuritySvrSession::StepL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::StepL()\n" );
-
-	const TThreadId threadId = ReadTThreadIdL(aMessage, 0);
-	const TInt32 numSteps = aMessage.Int1();
-
-	CheckAttachedL(threadId, aMessage, EFalse);
-
-	User::LeaveIfError(Server().iKernelDriver.Step( threadId, numSteps ));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/**
- * This checks whether or not the agent is permitted access to the flash partition
- * @return KErrNone if allowed, otherwise one of the system wide error codes
- * @leave one of the system wide error codes
- */
-TInt CSecuritySvrSession::CheckFlashAccessPermissionL(const RThread aClientThread)
-	{
-	//get the debug agent's process
-	RProcess clientProcess;
-	User::LeaveIfError(aClientThread.Process(clientProcess));
-	
-	//get the debug agent's process id
-	TProcessId processId = clientProcess.Id();
-
-	//store the debug agent's process id for forced detaching later if the
-	//agent doesn't tidy up after itself
-	StoreDebugAgentId(processId);
-	
-	// Read the OEM Debug token capabilities (if any)
-	GetDebugAgentOEMTokenCapsL();
-	
-	if(Server().OEMTokenPermitsFlashAccessL((iOEMDebugCapabilities)))
-		{
-		return KErrNone;
-		}
-
-	return KErrPermissionDenied;
-	}
-
-/**
-Purpose: Read the crash log from the crash flash partition
-@param aMessage.Int0() - Position to read from.
-@param aMessage.Ptr1() - Buffer to hold the data retrieved
-@param aMessage.Int2() - Size of the data to read.
-
-@leave one of the system wide error codes
-*/
-void CSecuritySvrSession::ReadCrashLogL (const RMessage2& aMessage)
-	{	
-	//get the debug agent's thread and push handle onto clean up stack
-	RThread clientThread;
-	User::LeaveIfError(aMessage.Client(clientThread));
-	CleanupClosePushL(clientThread);
-	
-	TInt err = CheckFlashAccessPermissionL(clientThread);
-	
-	CleanupStack::PopAndDestroy(&clientThread);
-	
-	if(KErrNone != err)
-		{
-		LOG_MSG2( "CSecuritySvrSession::ReadCrashLogL()  Access Not Granted - [%d]\n", err );
-		aMessage.Complete(err);
-		return;
-		}
-	
-	//Check whether drive connected.
-	if(!iCrashConnected)
-		ConnectCrashPartitionL();	
-
-	TInt readPosition = aMessage.Int0(); //read position
-	
-	TInt readSize = aMessage.Int2(); //read size
-	
-	RBuf8 readBuf;
-	readBuf.CreateL(readSize);
-	readBuf.CleanupClosePushL();
-	
-	err = iLocalDrive.Read (readPosition, readSize, readBuf);
-	
-	//write the list data back
-	aMessage.WriteL (1, readBuf);	
-	
-	CleanupStack::PopAndDestroy (&readBuf);	
-	
-	//Complete message
-	aMessage.Complete(err);	
-	}
-/**
-Purpose: Function to write the crash config to the crash flash partition
-
-@param aMessage.Int0() - write position in bytes from start position in flash partition.
-@param aMessage.Ptr1() - Buffer containing the data to be written onto the flash. 
-                         The size could be 0 if only flash partition size is needed. 
-@param aMessage.Int2() - returns the size of the flash partition.
-
-@leave one of the system wide error codes
-*/
-void CSecuritySvrSession::WriteCrashConfigL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::WriteCrashConfigL()\n" );
-	
-	//get the debug agent's thread and push handle onto clean up stack
-	RThread clientThread;
-	User::LeaveIfError(aMessage.Client(clientThread));
-	CleanupClosePushL(clientThread);
-	
-	TInt err = CheckFlashAccessPermissionL(clientThread);
-	
-	CleanupStack::PopAndDestroy(&clientThread);
-	
-	if(KErrNone != err)
-		{
-		LOG_MSG2( "CSecuritySvrSession::WriteCrashConfigL()  Access Not Granted - [%d]\n", err );
-		aMessage.Complete(err);
-		return;
-		}
-	
-	//Check whether drive connected.
-	if(!iCrashConnected)
-		ConnectCrashPartitionL();	
-	
-	// Get the length of the buffer
-	TInt deslen = aMessage.GetDesLengthL(1);
-
-	RBuf8 dataBuf;
-	dataBuf.CreateL(deslen);
-	dataBuf.CleanupClosePushL();
-
-	// data to be written to flash
-	aMessage.ReadL(1,dataBuf);
-	
-	TUint32 position = aMessage.Int0(); //position to start from
-		
-	err = iLocalDrive.Write(position,(const TDesC8&)dataBuf);
-	
-	TPtr8 dataSize((TUint8*)&deslen,4, 4);
-	
-	//write the size of the data written back
-	aMessage.WriteL(2,dataSize);
-		
-	//destroy buffer
-	CleanupStack::PopAndDestroy(&dataBuf); 
-	
-	aMessage.Complete(err);	
-	}
-/**
-Purpose: Method to erase the crash flash block
-
-@param aMessage.Int0() - write position in bytes from start position in flash partition.
-@param aMessage.Int2() - Number of blocks to erase.
-
-@leave one of the system wide error codes
-*/
-
-void CSecuritySvrSession::EraseCrashLogL(const RMessage2& aMessage)
-	{	
-	LOG_MSG( "CSecuritySvrSession::EraseCrashLogL()\n" );
-	
-	//get the debug agent's thread and push handle onto clean up stack
-	RThread clientThread;
-	User::LeaveIfError(aMessage.Client(clientThread));
-	CleanupClosePushL(clientThread);
-	
-	TInt err = CheckFlashAccessPermissionL(clientThread);
-	
-	CleanupStack::PopAndDestroy(&clientThread);
-	
-	if(KErrNone != err)
-		{
-		LOG_MSG2( "CSecuritySvrSession::EraseCrashLogL()  Access Not Granted - [%d]\n", err );
-		aMessage.Complete(err);
-		return;
-		}
-			
-	//Check whether drive connected.
-	if(!iCrashConnected)
-		ConnectCrashPartitionL();	
-	
-	TInt64 position = aMessage.Int0();	
-	TInt size = aMessage.Int1();
-	
-	//Format drive
-	err = iLocalDrive.Format(position,size*iCaps.iEraseBlockSize);		
- 
-	aMessage.Complete(err);	
-	}
-
-/**
-Purpose: Method to erase the entire crash flash block
-@leave one of the system wide error codes
-*/
-
-void CSecuritySvrSession::EraseEntireCrashLogL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::EraseEntireCrashLogL()\n" );
-	
-	//get the debug agent's thread and push handle onto clean up stack
-	RThread clientThread;
-	User::LeaveIfError(aMessage.Client(clientThread));
-	CleanupClosePushL(clientThread);
-	
-	TInt err = CheckFlashAccessPermissionL(clientThread);
-	
-	CleanupStack::PopAndDestroy(&clientThread);
-	
-	if(KErrNone != err)
-		{
-		LOG_MSG2( "CSecuritySvrSession::EraseEntireCrashLogL()  Access Not Granted - [%d]\n", err );
-		aMessage.Complete(err);
-		return;
-		}	
-	
-	//Check whether drive connected.
-	if(!iCrashConnected)
-		ConnectCrashPartitionL();
-	
-	TUint numberBlocks = iCaps.iSize /iCaps.iEraseBlockSize;
-	
-	//Format drive
-	for(TInt i = 0; i < numberBlocks; i++)
-		{
-		err = iLocalDrive.Format(i*iCaps.iEraseBlockSize,iCaps.iEraseBlockSize);
-		if(KErrNone != err)
-			{
-			RDebug::Printf("err = %d", err);
-			aMessage.Complete(err);
-			return;
-			}
-		}
-	
-	
-	aMessage.Complete(err);
-	}
-
-
-/**
-Purpose: Kill a specified process
-
-@param aMessage.Ptr0() - Process Id of the thread to be stepped
-@param aMessage.Int1() - Reason code to supply when killing the process.
-
-@leave one of the system wide error codes
-
-*/
-void CSecuritySvrSession::KillProcessL(const RMessage2& aMessage)
-	{
-	LOG_MSG( "CSecuritySvrSession::KillProcessL()\n" );
-
-	const TProcessId processId = ReadTProcessIdL(aMessage, 0);
-	const TInt32 reason = aMessage.Int1();
-
-	CheckAttachedL(processId, aMessage, EFalse);
-
-	User::LeaveIfError(Server().iKernelDriver.KillProcess( processId, reason ));
-
-	aMessage.Complete(KErrNone);
-	}
-
-/** Gets the secure id of aFileName
-  @param aFileName file name of executable to get SID for
-  @param aSecureId on return will contain the SID of aFileName
-
-  @leave one of the system wide error codes
-  */
-void CSecuritySvrSession::GetSecureIdL(const TDesC& aFileName, TUid& aSecureId)
-	{
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-
-	RFile targetExe;
-	OpenFileHandleL(aFileName, fs, targetExe);
-	CleanupClosePushL(targetExe);
-
-	// Read in the entire header
-	RBuf8 e32HdrBuf;
-	e32HdrBuf.CreateL(RLibrary::KRequiredImageHeaderSize);
-	e32HdrBuf.CleanupClosePushL();
-
-	// Read the entire header as far as possible
-	TInt err = targetExe.Read(e32HdrBuf);
-	if (err != KErrNone)
-		{
-		// Could not read the file 
-		LOG_MSG("CSecuritySvrSession::GetSecureIdL - Failed to read executable\n");
-
-		User::Leave(err);
-		}
-
-	if(!CheckSufficientData(e32HdrBuf, IsExecutableXipL(targetExe)))
-		{
-		User::Leave(KErrGeneral);
-		}
-
-	aSecureId = GetSecureIdL(e32HdrBuf, IsExecutableXipL(targetExe));
-
-	CleanupStack::PopAndDestroy(3, &fs);
-	}
-
-/** Get the secure id from aHeaderData
-  @param aHeaderData an executable's header data to read SID from
-  @param aXip indication of whether the header data is from an XIP file
-
-  @return secure ID from aHeaderData
-  */
-TUid CSecuritySvrSession::GetSecureIdL(const TDesC8& aHeaderData, TBool aXip)
-	{
-	if(!CheckSufficientData(aHeaderData, aXip))
-		{
-		User::Leave(KErrGeneral);
-		}
-
-	if (aXip)
-		{
-		TRomImageHeader* hdr = (TRomImageHeader*)aHeaderData.Ptr();
-		return TUid::Uid(hdr->iS.iSecureId);
-		}
-	else
-		{
-		// it is an epoc32 image
-		E32ImageHeaderV* hdr = (E32ImageHeaderV*)aHeaderData.Ptr();
-		return TUid::Uid(hdr->iS.iSecureId);
-		}
-	}
-
-/**
-@param aMessage contains:
- * aMessage.Ptr0() a TListDetails object
- * aMessage.Ptr1() a client supplied TDes8 for the driver to return data in
- * aMessage.Ptr2() a TUint32 for the driver to return the size of the requested listing's data in
-
-@leave KErrTooBig if the buffer passed as argument 1 of aMessage is too
-       small to contain the requested data,
-       KErrNoMemory if a temporary buffer could not be allocated,
-       or one of the other system wide error codes
-*/
-void CSecuritySvrSession::GetListL(const RMessage2& aMessage)
-	{
-	LOG_MSG("CSecuritySvrSession::GetListL()");
-
-	// buffer to write list data into before copying back to agent
-	RBuf8 listDetailsBuf;
-
-	//allocate buffer
-	listDetailsBuf.CreateL(sizeof(TListDetails));
-
-	// Do the right cleanup if anything subsequently goes wrong
-	listDetailsBuf.CleanupClosePushL();
-
-	//read the data from the client thread
-	aMessage.ReadL(0, listDetailsBuf);
-	TListDetails* listDetails = (TListDetails*)listDetailsBuf.Ptr();
-
-	//get the type of list requested
-	TListId type = (TListId)aMessage.Int0();
-
-	//create a buffer to store the data in
-	RBuf8 buffer;
-	buffer.CreateL(aMessage.GetDesMaxLength(1));
-	buffer.CleanupClosePushL();
-
-	//create a temporary variable to potentially store data length in
-	TUint32 size = 0;
-
-	TInt err = KErrNone;
-
-	// the executables list is generated in the DSS rather than in the driver
-	// so is treated separately
-	if(listDetails->iListId == EExecutables)
-		{
-		if(listDetails->iListScope != EScopeGlobal)
-			{
-			User::Leave(KErrArgument);
-			}
-		if(listDetails->iTargetId != 0)
-			{
-			User::Leave(KErrArgument);
-			}
-		err = GetExecutablesListL(buffer, size);
-		}
-	else
-		{
-		err = Server().iKernelDriver.GetList(listDetails->iListId, listDetails->iListScope, listDetails->iTargetId, iDebugAgentProcessId, buffer, size);
-		}
-
-	if(err == KErrNone)
-		{
-		//write the list data back
-		aMessage.WriteL(1, buffer);
-		}
-
-	TPtr8 sizePtr((TUint8*)&size, sizeof(TUint32), sizeof(TUint32));
-	//write size back to agent
-	aMessage.WriteL(2, sizePtr);
-
-	CleanupStack::PopAndDestroy(&buffer);
-	CleanupStack::PopAndDestroy(&listDetailsBuf);
-
-	aMessage.Complete(err);
-	}
-
-/**
-Gets the executables list and returns it in aBuffer if it's big enough
-
-@param aBuffer caller supplied buffer to write data into
-@param aSize on return contains the size of the data in the buffer, or the
-       size that the buffer would need to be to contain the data
-
-@return KErrNone on success, or KErrTooBig if the requested data will not fit in aBuffer
-
-@leave one of the system wide error codes
-*/
-TInt CSecuritySvrSession::GetExecutablesListL(TDes8& aBuffer, TUint32& aSize) const
-	{
-	LOG_MSG("CSecuritySvrSession::GetExecutablesList()");
-
-	//initialise values and connect to file system
-	aSize = 0;
-	aBuffer.SetLength(0);
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-
-	// uids corresponding to executable image
-	TUidType uids(KExecutableImageUid, KNullUid, KNullUid);
-
-	//create a string containing the directory name. The drive letter is represented
-	//by X but will be replaced by the appropriate drive letter for each drive
-	_LIT(KColonSysBin,":\\sys\\bin\\");
-
-	//create a modifiable copy of KColonSysBin, preceeded by an empty space for the drive letter
-	RBuf dirName;
-	dirName.CreateL(1 + KColonSysBin().Length());
-	dirName.CleanupClosePushL();
-
-	//set the length to 1 (to later fill with the drive letter) and then append KColonSysBin
-	dirName.SetLength(1);
-	dirName.Append(KColonSysBin());
-
-	//get the list of valid drives for the device
-	TDriveList driveList;
-	User::LeaveIfError(fs.DriveList(driveList));
-
-	//check each valid sys/bin directory for executables
-	for(TInt i=0; i<KMaxDrives; i++)
-		{
-		//if the drive is not valid then skip this drive
-		if(!driveList[i])
-			{
-			//skip processing this drive
-			continue;
-			}
-
-		//get the drive letter and insert it as the drive letter for dirName
-		TChar driveLetter;
-	       	User::LeaveIfError(fs.DriveToChar(i, driveLetter));
-		dirName[0] = (TUint)driveLetter;
-
-		//get a list of the exes in this drive's sys/bin directory
-		CDir* localDir = NULL;
-		TInt err = fs.GetDir(dirName, uids, ESortByName, localDir);
-		if(KErrNoMemory == err)
-			{
-			User::Leave(err);
-			}
-		if(!localDir)
-			{
-			//skip processing this drive
-			continue;
-			}
-
-		//push onto cleanup stack in case we leave
-		CleanupStack::PushL(localDir);
-
-		//iterate through the files
-		for(TInt j=0; j<localDir->Count(); j++)
-			{
-			//will store x:\sys\bin\<file-name> type string
-			RBuf fullPathName;
-
-			TUint16 nameLength = dirName.Length() + (*localDir)[j].iName.Length();
-			fullPathName.CreateL(nameLength);
-			fullPathName.CleanupClosePushL();
-			fullPathName.Copy(dirName);
-			fullPathName.Append((*localDir)[j].iName);
-
-			//add the data to the buffer
-			AppendExecutableData(aBuffer, aSize, fullPathName);
-
-			//do cleanup
-			CleanupStack::PopAndDestroy(&fullPathName);
-			}
-
-		//do cleanup
-		CleanupStack::PopAndDestroy(localDir);
-		}
-
-	//do cleanup
-	CleanupStack::PopAndDestroy(2, &fs);
-
-	//return appropriate value as to whether the kernel's data was too big
-	return (aSize <= aBuffer.MaxLength()) ? KErrNone : KErrTooBig;
-	}
-
-
-/**
-  Append data to aBuffer and update size of aSize if the data will fit. If it will
-  not fit then just puts the nee size in aSize.
-
-  @param aBuffer buffer to append the data to
-  @param aSize on return contains the new size of the buffer if the data could be
-  appended, otherwise aSize is updated to reflect the size the buffer would have if
-  the data had fitted.
-  @param aEntryName file name of the entry to add to the buffer
-  */
-void CSecuritySvrSession::AppendExecutableData(TDes8& aBuffer, TUint32& aSize, const TDesC& aEntryName) const
-	{
-	//update aSize to include the size of the data for this entry
-	aSize = Align4(aSize + sizeof(TExecutablesListEntry) + (2*aEntryName.Length()) - sizeof(TUint16));
-
-	//if the data will fit, and we haven't already stopped putting data in, then append the data,
-	//if we've stopped putting data in then aSize will be bigger than aBuffer.MaxLength()
-	if(aSize <= aBuffer.MaxLength())
-		{
-		TExecutablesListEntry& entry = *(TExecutablesListEntry*)(aBuffer.Ptr() + aBuffer.Length());
-		//check whether an agent has registered to actively debug fullPathName
-		TBool activelyDebugged = IsDebugged(aEntryName, EFalse);
-		entry.iIsActivelyDebugged = activelyDebugged ? 1 : 0;
-
-		//check whether any agents have registered to passively debug fullPathName
-		TBool passivelyDebugged = IsDebugged(aEntryName, ETrue);
-		entry.iIsPassivelyDebugged = passivelyDebugged ? 1 : 0;
-
-		entry.iNameLength = aEntryName.Length();
-		TPtr name(&(entry.iName[0]), aEntryName.Length(), aEntryName.Length());
-		name = aEntryName;
-		//pad the buffer to a four byte boundary
-		aBuffer.SetLength(aSize);
-		}
-	}
-/**
-Helper function
-
-Write data back to the thread that owns aMessage
-
-@param aMessage the message which is passed between processes
-@param aIndex the message slot which the data will be passed back in
-@param aPtr pointer to data in this thread to be written into aMessage
-@param aPtrSize size in bytes of the data to be written
-
-@leave one of the system wide error codes
-*/
-void CSecuritySvrSession::WriteDataL(const RMessage2& aMessage, const TInt aIndex, const TAny* aPtr, const TUint32 aPtrSize) const
-	{
-	TPtr8 dataPtr((TUint8*)aPtr, aPtrSize, aPtrSize);
-
-	aMessage.WriteL(aIndex, dataPtr);
-	}
-
-/**
-Stores the PID of the debug agent, if it is not already stored.
-
-@param aDebugAgentProcessId PID of the debug agent
-*/
-void CSecuritySvrSession::StoreDebugAgentId(const TProcessId aDebugAgentProcessId)
-	{
-	if(! iDebugAgentProcessIdStored)
-		{
-		iDebugAgentProcessIdStored = ETrue;
-		iDebugAgentProcessId = aDebugAgentProcessId;
-		}
-	}
-
-/**
-Helper function.
-
-Checks whether the debug agent (the owner of the aMessage) is attached to the
-thread with thread id of aThreadId.
-
-@param aThreadId thread ID of target debug thread
-@param aMessage message owned by the debug agent
-@param aPassive indicates whether to check if attached passively or actively
-
-@leave KErrPermissionDenied if the agent is not attached to the process,
-       KErrNoMemory if the security server could not be accessed
-*/
-void CSecuritySvrSession::CheckAttachedL(const TThreadId aThreadId, const RMessage2& aMessage, const TBool aPassive) const
-	{
-	//check that the agent has attached to the target process
-	if(! Server().CheckAttached(aThreadId, aMessage, aPassive))
-		{
-		LOG_MSG("CSecuritySvrSession::CheckAttachedL() failed");
-		User::Leave(KErrPermissionDenied);
-		}
-	}
-
-/**
-Helper function.
-
-Checks whether the debug agent (the owner of the aMessage) is attached to the
-process with process id of aProcessId.
-
-@param aProcessId process ID of target debug thread
-@param aMessage message owned by the debug agent
-@param aPassive indicates whether to check if attached passively or actively
-
-@leave KErrPermissionDenied if the agent is not attached to the process,
-       KErrNoMemory if the security server could not be accessed
-*/
-void CSecuritySvrSession::CheckAttachedL(const TProcessId aProcessId, const RMessage2& aMessage, const TBool aPassive) const
-	{
-	
-	//check that the agent has attached to the target process
-	if(! Server().CheckAttached(aProcessId, aMessage, aPassive))
-		{
-		LOG_MSG("CSecuritySvrSession::CheckAttachedL() (process) failed");
-		User::Leave(KErrPermissionDenied);
-		}
-	}
-
-/**
-Check whether the debug agent is permitted to attach to the target process.
-Note that this function does not actually attach the agent to the process, it
-simply tests whether an attach call would potentially be successful.
-
-Currently this method returns ETrue in all cases but will be updated once
-the security checking framework is in place.
-
-@param aDebugAgentProcessId process id of the debug agent
-@param aTargetProcessName original file name of the target process
-
-@return ETrue if the debug agent would be allowed to attch to the target process,
-        EFalse otherwise
-*/
-TBool CSecuritySvrSession::PermitDebugL(const TProcessId aDebugAgentProcessId, const TDesC& aTargetProcessName) const
-	{
-	return ETrue;
-	}
-
-/**
-Helper function
-
-Validates that the memory info passed in meets the debug driver's requirements
-
-@param aMemoryInfo memory info passed in from client
-
-@leave KErrArgument if:
-	  * size is zero
-	  * size is greater than the max block size
-	  * size + address > 0xffffffff
-	  * address is not access size aligned
-	  * size is not a multiple of the access size
-	KErrNotSupported if:
-	  * iAccess is not TAccess::EAccess32
-	  * iEndianess is not TEndianess::EEndLE8
-	KErrUnknown if:
-	  * the max memory block size cannot be determined
-        or one of the other system wide error codes
-*/
-void CSecuritySvrSession::ValidateMemoryInfoL(const TThreadId aThreadId, const TMemoryInfo &aMemoryInfo, const TBool aReadOperation)
-	{
-	//check size is not 0
-	if(aMemoryInfo.iSize == 0)
-		User::Leave(KErrArgument);
-
-	//get the max block size supported
-	TUint32 maxSize = 0;
-	User::LeaveIfError(Server().iKernelDriver.GetMemoryOperationMaxBlockSize(maxSize));
-
-	//check that the block size given is less than the max block size
-	if(aMemoryInfo.iSize > maxSize)
-		User::Leave(KErrArgument);
-
-	//must ensure that address + size <= 0xffffffff as will attempt to
-	//read past 0xffffffff, which wouldn't be good
-	TUint32 maxAddress = (~aMemoryInfo.iSize) + 1;
-	if(aMemoryInfo.iAddress > maxAddress)
-		User::Leave(KErrArgument);
-
-	//check that arguments are supported
-	if(aMemoryInfo.iAccess != EAccess32)
-		User::Leave(KErrNotSupported);
-
-	if(aMemoryInfo.iEndianess != EEndLE8)
-		User::Leave(KErrNotSupported);
-
-	//check that address is multiple of access size
-	TInt addressIndicator = aMemoryInfo.iAddress % aMemoryInfo.iAccess;
-	if(addressIndicator != 0)
-		{
-		User::Leave(KErrArgument);
-		}
-
-	//check that size is multiple of access size
-	TInt sizeIndicator = aMemoryInfo.iSize % aMemoryInfo.iAccess;
-	if(sizeIndicator != 0)
-		User::Leave(KErrArgument);
-	}
-
-/**
-Helper function
-
-Validates that the three buffers relating to reading register data are of
-appropriate sizes, and calculates the number of registers being requested.
-
-@param aMessage message which in offsets 1, 2 and 3 contains descriptors
-@param aNumberOfRegisters if the function returns with KErrNone this will
-       contain the number of registers being requested, guaranteed to be non-zero
-
-@leave KErrArgument if descriptors do not represent the same number of
-       registers, if any of the descriptors have max length of 0, if any of
-       the descriptors have max lengths which are not multiples of their data
-       type's size or if any of the descriptors have max lengths greater than
-       the max block size for memory operations
-       or one of the other system wide error codes if there were problems 
-       in getting the descriptors' lengths.
-*/
-void CSecuritySvrSession::ValidateRegisterBuffersL(const RMessage2& aMessage, TUint32& aNumberOfRegisters)
-	{
-	//get lengths of buffers, if error occurs returned value will be less then zero
-	TInt idsBufferLength = aMessage.GetDesMaxLength(1);
-	if(idsBufferLength < 0)
-		{
-		User::Leave(idsBufferLength);
-		}
-	TInt valuesBufferLength = aMessage.GetDesMaxLength(2);
-	if(valuesBufferLength < 0)
-		{
-		User::Leave(valuesBufferLength);
-		}
-	TInt flagsBufferLength = aMessage.GetDesMaxLength(3);
-	if(flagsBufferLength < 0)
-		{
-		User::Leave(flagsBufferLength);
-		}
-
-	//get the max block size supported
-	TUint32 maxSize = 0;
-	User::LeaveIfError(Server().iKernelDriver.GetMemoryOperationMaxBlockSize(maxSize));
-
-	//check none of the descriptors have size greater than the max block size
-	if((idsBufferLength > maxSize) || (valuesBufferLength > maxSize) || (flagsBufferLength > maxSize))
-		User::Leave(KErrArgument);
-
-	//get sizes of the three types of data the buffers represent arrays of
-	//and validate that the buffer lengths are multiples of the data sizes
-	TUint idSize = sizeof(TRegisterInfo);
-	if(idsBufferLength % idSize != 0)
-		User::Leave(KErrArgument);
-
-	TUint flagSize = sizeof(TUint8);
-	if(flagsBufferLength % flagSize != 0)
-		User::Leave(KErrArgument);
-
-	//perform check on id buffer length
-	if(idsBufferLength == 0)
-		User::Leave(KErrArgument);
-
-	//calculate number of registers being requested
-	aNumberOfRegisters = idsBufferLength / idSize;
-
-	//check flags buffer is of appropriate size
-	if(flagsBufferLength != (aNumberOfRegisters * flagSize))
-		User::Leave(KErrArgument);
-	}
-
-/**
-Establish whether any agents have registered to debug the specified aFileName
-
-@param aFileName originating file name of the target process
-@param aPassive indicates whether to check if there has been active attachment,
-or passive attachment.
-
-@return ETrue if aFileName is being debugged, EFalse otherwise
-
-*/
-TBool CSecuritySvrSession::IsDebugged(const TDesC& aFileName, const TBool aPassive) const
-	{
-	//check whether the target process is being debugged
-	return Server().IsDebugged(aFileName, aPassive);
-	}
-
-/**
-  Helper function which reads a TThreadId object from a client
-
-  @param aMessage the message object containing the reference to the TThreadId
-  @param aIndex the message argument containing the reference
-
-  @return the TThreadId passed in by the client
-  @leave KErrArgument if aIndex is outside of the valid range
-  */
-TThreadId CSecuritySvrSession::ReadTThreadIdL(const RMessagePtr2& aMessage, const TInt aIndex) const
-	{
-	//create a temporary TThreadId to read the data into
-	TThreadId tempThreadId;
-	TPtr8 threadIdPtr((TUint8*)&tempThreadId, sizeof(TThreadId));
-
-	// read the data in from the client
-	aMessage.ReadL(aIndex, threadIdPtr);
-
-	return tempThreadId;
-	}
-
-/**
-  Helper function which reads a TProcessId object from a client
-
-  @param aMessage the message object containing the reference to the TProcessId
-  @param aIndex the message argument containing the reference
-
-  @return the TProcessId passed in by the client
-  @leave KErrArgument if aIndex is outside of the valid range
-  */
-TProcessId CSecuritySvrSession::ReadTProcessIdL(const RMessagePtr2& aMessage, const TInt aIndex) const
-	{
-	//create a temporary TProcessId to read the data into
-	TProcessId tempProcessId;
-	TPtr8 processIdPtr((TUint8*)&tempProcessId, sizeof(TProcessId));
-
-	// read the data in from the client
-	aMessage.ReadL(aIndex, processIdPtr);
-
-	return tempProcessId;
-	}
-
-// End of file - c_security_svr_session.cpp
--- a/kernel/eka/debug/securityServer/src/c_shutdown_timer.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Provides the debug security server's shutdown timer implementation
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#include <rm_debug_api.h>
-#include "c_shutdown_timer.h"
-#include "rm_debug_logging.h"
-
-/**
-Constructor. Adds the timer to the thread's active scheduler,
-*/
-CShutdownTimer::CShutdownTimer()
-	:CTimer(KActivePriorityShutdown)
-	{
-	LOG_MSG("CShutdownTimer::CShutdownTimer()\n");
-	CActiveScheduler::Add(this);
-	}
-
-/**
-Initialisation of timer
-*/
-void CShutdownTimer::ConstructL()
-	{
-	LOG_MSG("CShutdownTimer::ConstructL()\n");
-	CTimer::ConstructL();
-	}
-
-/**
-Starts the timer which would expire after KShutdownDelay
-*/
-void CShutdownTimer::Start()
-	{
-	LOG_MSG("CShutdownTimer::Start()\n");
-	After(KShutdownDelay);
-	}
-
-/**
-Stops the active scheduler. Stopping the active scheduler effectively closes
-the Debug Security Server
-*/
-void CShutdownTimer::RunL()
-	{
-	LOG_MSG("CShutdownTimer::RunL()\n");
-	CActiveScheduler::Stop();
-	}
-
--- a/kernel/eka/debug/securityServer/src/rm_debug_svr.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Entry point to debug security server, sets up server/session
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <rm_debug_api.h>
-
-#include "c_security_svr_server.h"
-#include "c_security_svr_session.h"
-#include "rm_debug_logging.h"
-
-using namespace Debug;
-
-/**
-Perform all server initialisation, in particular creation of the
-scheduler and server and then run the scheduler
-*/
-void RunServerL()
-	{
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> new(ELeave) CActiveScheduler\n" );
-	CActiveScheduler* s=new(ELeave) CActiveScheduler;
-
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CleanupStack::PushL(s)\n" );
-	CleanupStack::PushL(s);
-
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CActiveScheduler::Install()\n" );
-	CActiveScheduler::Install(s);
-
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CSecuritySvrServer::NewLC()\n" );
-	CSecuritySvrServer::NewLC();
-
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> Rendezvous(KErrNone)\n" );
-	// Signal whoever has started us that we have done so.
-	RProcess::Rendezvous(KErrNone);
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : <- Rendezvous()\n" );
-
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CActiveScheduler::Start()\n" );
-	CActiveScheduler::Start();
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() <- CActiveScheduler::Start()\n" );
-
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CleanupStack::PopAndDestroy()\n" );
-	CleanupStack::PopAndDestroy(2, s);
-	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : <- CleanupStack::PopAndDestroy()\n" );
-	}
-
-/**
-Entry point for debug security server
-*/
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	TInt r = KErrNoMemory;
-	if (cleanup)
-		{
-		TRAP(r,RunServerL());
-		delete cleanup;
-		}
-	__UHEAP_MARKEND;
-	return r;
-	}
--- a/kernel/eka/drivers/debug/common/d_debug_functionality.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/common/d_debug_functionality.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -22,10 +22,8 @@
 #include <e32cmn_private.h>
 #include <u32std.h>
 #include <kernel/kernel.h>
-#include <rm_debug_api.h>
 #include <sm_debug_api.h>
-#include "d_rmd_breakpoints.h"
-#include "rm_debug_kerneldriver.h"
+
 #include "d_debug_functionality.h"
 #include "d_buffer_manager.h"
 
@@ -89,15 +87,9 @@
 
 const TTag StopModeFunctionalityFunctionsInfo[] =
 	{
-#ifdef __LAUNCH_AS_EXTENSION__
 	{EStopModeFunctionsExitPoint,ETagTypePointer,0,(TUint32)&StopModeDebug::ExitPoint}, 
 	{EStopModeFunctionsGetList,ETagTypePointer,0,(TUint32)&StopModeDebug::GetList},
 	{EStopModeFunctionsTestAPI,ETagTypePointer,0,(TUint32)&StopModeDebug::TestAPI} 
-#else
-	{EStopModeFunctionsExitPoint,ETagTypePointer,0,NULL}, 
-	{EStopModeFunctionsGetList,ETagTypePointer,0,NULL},
-	{EStopModeFunctionsTestAPI,ETagTypePointer,0,NULL} 
-#endif
 	};
 
 const TSubBlock StopModeFunctionalityFunctions[]=
--- a/kernel/eka/drivers/debug/common/debug_utils.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/common/debug_utils.h	Thu Sep 02 21:54:16 2010 +0300
@@ -24,7 +24,6 @@
 #define DEBUG_UTILS_H
 
 #include <kernel/kern_priv.h>
-#include <rm_debug_api.h>
 
 class DebugUtils
 	{
--- a/kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-# component name "Run mode debugger"
+# component name "Stop mode debugger"
 
 component	base_e32_drivers_debug
 
--- a/kernel/eka/drivers/debug/group/bld.inf	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/group/bld.inf	Thu Sep 02 21:54:16 2010 +0300
@@ -51,10 +51,7 @@
 
 #if defined(MARM_ARMV5) || defined(MARM_ARMV4)
 
-
-rm_debug_kerneldriver
-rm_debug_kerneldriver_ext
-../../../debug/securityServer/group/rm_debug_svr
+sm_debug_kerneldriver
 
 #if defined(GENERIC_MARM) 
 ../../../debug/crashMonitor/group/scmusr_lib
--- a/kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmh	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description:
-//
-
-#include "../../../kernel/kern_ext.mmh"
-
-UID             0x100000AF 0x101F7157
-
-SOURCEPATH      ../common
-SOURCE          debug_utils.cpp
-SOURCE          d_debug_functionality.cpp
-
-SOURCEPATH      ../rmdebug
-SOURCE          d_list_manager.cpp
-SOURCE          rm_debug_kerneldriver.cpp
-SOURCE          rm_debug_eventhandler.cpp
-SOURCE          d_process_tracker.cpp
-SOURCE          d_target_process.cpp
-SOURCE          d_debug_agent.cpp
-SOURCE          d_rmd_breakpoints.cpp
-SOURCE          d_rmd_stepping.cpp
-SOURCE          d_driver_event_info.cpp
-
-SOURCEPATH		../smdebug
-SOURCE			d_buffer_manager.cpp
-
-systeminclude     ../../../include/drivers
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-SYMBIAN_BASE_SYSTEMINCLUDE(memmodel/epoc/mmubase)
-SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
-#endif
-
-userinclude		../common
-userinclude		../rmdebug
-userinclude		../smdebug
-
-VENDORID 0x70000001
-
-//Specified to allow global data
-EPOCALLOWDLLDATA
-
-capability			all
-
-SMPSAFE
--- a/kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description:
-//
-
-#include "rm_debug_kerneldriver.mmh"
-
-TARGET			rm_debug.ldd
-
-TARGETTYPE LDD
--- a/kernel/eka/drivers/debug/group/rm_debug_kerneldriver_ext.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description:
-//
-
-macro __LAUNCH_AS_EXTENSION__
-
-#include "rm_debug_kerneldriver.mmh"
-
-SOURCEPATH		../smdebug
-SOURCE 			d_stopmode.cpp
-SOURCE			d_sm_codeseg.cpp
-SOURCE			d_sm_process.cpp
-SOURCE          d_sm_staticinfo.cpp
-
-TARGET			rm_debug_ext.ldd
-
-TARGETTYPE KEXT
-
-deffile ../../../~/rm_debug_ext.def
-
-linkas rm_debug.ldd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/group/sm_debug_kerneldriver.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,57 @@
+// Copyright (c) 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:
+//
+// Description:
+//
+
+
+#include "../../../kernel/kern_ext.mmh"
+
+UID             0x100000AF 0x101F7157
+
+userinclude		../common
+userinclude		../smdebug
+
+SOURCEPATH      ../common
+SOURCE          debug_utils.cpp
+SOURCE          d_debug_functionality.cpp
+
+SOURCEPATH		../smdebug
+SOURCE          sm_debug_kerneldriver.cpp
+SOURCE			d_buffer_manager.cpp
+SOURCE			d_sm_codeseg.cpp
+SOURCE			d_sm_process.cpp
+SOURCE          d_sm_staticinfo.cpp 
+SOURCE 			d_stopmode.cpp
+
+
+TARGET			sm_debug.dll
+
+TARGETTYPE KEXT
+
+systeminclude     ../../../include/drivers
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+SYMBIAN_BASE_SYSTEMINCLUDE(memmodel/epoc/mmubase)
+SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
+#endif
+
+
+deffile ../../../~/sm_debug.def
+
+VENDORID 0x70000001
+
+//Specified to allow global data
+EPOCALLOWDLLDATA
+
+capability			all
+
+SMPSAFE
\ No newline at end of file
--- a/kernel/eka/drivers/debug/rmdebug/d_debug_agent.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,420 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Purpose: Kernel-side tracking of debug agent information associated
-// with each process being debugged.
-// 
-//
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <kernel/kernel.h> 
-#include <kernel/kern_priv.h>
-#include <nk_trace.h>
-#include <arm.h>
-
-#include "d_process_tracker.h"
-#include "debug_logging.h"
-
-#include "d_debug_agent.h"
-#include "debug_utils.h"
-
-#include "d_debug_agent.inl"
-
-using namespace Debug;
-
-// ctor
-DDebugAgent::DDebugAgent(TUint64 aId) :
-	iId(aId),
-	iRequestGetEventStatus(NULL),
-	iClientThread(0),
-	iEventQueue(KNumberOfEventsToQueue, 0),
-	iHead(0),
-	iTail(0),
-	iEventQueueLock(NULL),
-	iFreeSlots(KNumberOfEventsToQueue),
-	iIgnoringTrace(EFalse),
-	iEventBalance(0)
-	{
-	LOG_MSG2("DDebugAgent::DDebugAgent(), this=0x%x ", this);
-
-	// Initialize all the Event Actions to Ignore
-	for(TInt i=0; i<EEventsLast; i++)
-		{
-		iEventActions[i] = EActionIgnore;
-		}
-	}
-
-DDebugAgent* DDebugAgent::New(TUint64 aId)
-	{
-	LOG_MSG("DDebugAgent::New()");
-	DDebugAgent* agent = new DDebugAgent(aId);
-	if(agent == NULL)
-		{
-		return (NULL);
-		}
-	if(KErrNone != agent->Construct())
-		{
-		delete agent;
-		return (NULL);
-		}
-
-	// Use a semaphore to serialise access
-	TInt err = Kern::SemaphoreCreate(agent->iEventQueueLock, _L("RM_DebugAgentQueueLock"), 1 /* Initial count */);
-	if (err != KErrNone)
-		return NULL;
-
-	return agent;
-	}
-
-/** Standard contructor.
- * Fills event queue with empty events
- * @return : standard system error code
- */
-TInt DDebugAgent::Construct()
-	{
-	// Empty the event queue
-	LOG_MSG("DDebugAgent::Construct()");
-	TDriverEventInfo emptyEvent;
-	TInt err = KErrNone;
-
-	for (TInt i=0; i<KNumberOfEventsToQueue; i++)
-		{
-		err = iEventQueue.Append(emptyEvent);
-		if (err != KErrNone)
-			{
-			LOG_MSG("Error appending blank event entry");
-			return err;
-			}
-		}
-
-	err = Kern::CreateClientDataRequest(iRequestGetEventStatus);
-	if(err != KErrNone)
-		{
-		LOG_MSG("Error creating TClientDataRequest");
-		return err;
-		}
-
-	LOG_MSG2("DDebugAgent::Construct() iRequestGetEventStatus=0x%08x", iRequestGetEventStatus);
-
-	return err;
-	}
-
-// dtor
-DDebugAgent::~DDebugAgent()
-	{
-	iEventQueue.Reset();
-
-	if (iEventQueueLock)
-		iEventQueueLock->Close(NULL);
-	
-	if(iRequestGetEventStatus)
-		Kern::DestroyClientRequest(iRequestGetEventStatus);
-	
-	}
-
-// Associate an action with a particular kernel event
-TInt DDebugAgent::SetEventAction(TEventType aEvent, TKernelEventAction aEventAction)
-	{
-	// Valid Event?
-	if (aEvent >= EEventsLast)
-		{
-		LOG_MSG2("DDebugAgent::EventAction: Bad Event number %d",aEvent);
-		return KErrArgument;
-		}
-
-	iEventActions[aEvent] = aEventAction;
-
-	return KErrNone;
-	}
-
-/** Get the aEventAction associated with aEvent
- *
- * @return : aEventAction (always +ve), or KErrArgument.
- */
-TInt DDebugAgent::EventAction(TEventType aEvent)
-	{
-	// Validate the Event id
-	if (aEvent >= EEventsLast)
-		{
-		LOG_MSG2("DDebugAgent::EventAction: Bad Event number %d",aEvent);
-		return KErrArgument;
-		}
-
-	// Return the action associated with this event
-	return iEventActions[aEvent];
-	}
-
-/** Obtain the details of the latest kernel event (if it exists) and place the details in aEventInfo
- * If there is no event in the queue for this process+agent combination, store the details
- * so that it can be notified later when an event actually occurs.
- * 
- * @param aAsyncGetValueRequest - TClientDataRequest object used for pinning user memory
- * @param aClientThread - The ThreadId of the requesting user-side process. In this case the DSS.
- */
-void DDebugAgent::GetEvent(TClientDataRequest<TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread)
-	{
-	LockEventQueue();
-
-	iRequestGetEventStatus->Reset();
-	TInt err = iRequestGetEventStatus->SetStatus( aAsyncGetValueRequest->StatusPtr() );
-	if (err != KErrNone)
-		{
-		LOG_MSG2("Error :iRequestGetEventStatus->SetStatus ret %d", err);
-		return;
-		}
-	
-	iRequestGetEventStatus->SetDestPtr( aAsyncGetValueRequest->DestPtr() );
-
-	iEventBalance++;
-	
-	LOG_MSG4("DDebugAgent::GetEvent: this=0x%08x, iRequestGetEventStatus=0x%08x, iEventBalance=%d", 
-		this, iRequestGetEventStatus, iEventBalance );
-	
-	iClientThread = aClientThread;
-	
-	if (BufferEmpty())
-		{
-		LOG_MSG2("Event buffer empty, iEventBalance=%d", iEventBalance);		
-		UnlockEventQueue();
-		return;
-		}
-
-	LOG_MSG2("Event already available at queue pos=%d", iTail);
-
-	// returning the event to the client
-	err = iEventQueue[iTail].WriteEventToClientThread(iRequestGetEventStatus,iClientThread);
-	if (err != KErrNone)
-		{
-		LOG_MSG2("Error writing event info: %d", err);
-		UnlockEventQueue();
-		return;
-		}
-
-	// signal the DSS thread
-	Kern::QueueRequestComplete(iClientThread, iRequestGetEventStatus, KErrNone);
-	iEventBalance--;
-
-	iEventQueue[iTail].Reset();
-
-	// move to the next slot
-	IncrementTailPosition();
-
-	UnlockEventQueue();
-	}
-
-/**
- * Stop waiting for an event to occur. This means events will be placed 
- * in the iEventQueue (by setting iEventBalance to 0) until GetEvent is called. 
- */ 
-TInt DDebugAgent::CancelGetEvent(void)
-	{
-	LOG_MSG2("DDebugAgent::CancelGetEvent. iEventBalance=%d. > QueueRequestComplete", iEventBalance);
-	Kern::QueueRequestComplete(iClientThread, iRequestGetEventStatus, KErrCancel);
-	iEventBalance=0;
-	iClientThread = 0;
-	return KErrNone;
-	}
-
-/** Signal a kernel event to the user-side DSS when it occurs, or queue it for later
- * if the user-side has not called GetEvent (see above).
- * 
- * @param aEventInfo - the details of the event to queue.
- */
-void DDebugAgent::NotifyEvent(const TDriverEventInfo& aEventInfo)
-	{
-
-	if(aEventInfo.iEventType >= EEventsLast)
-		{
-		LOG_MSG3("DDebugAgent::NotifyEvent(),iEventType %d, this=0x%x. Ignoring since > EEventsLast", aEventInfo.iEventType, this);
-		return;
-		}
-
-	LockEventQueue();
-
-	DThread* currentThread = &Kern::CurrentThread();
-	
-	LOG_MSG5("DDebugAgent::NotifyEvent(), iEventType %d, this=0x%x currThrd=0x%08x, iEventBalance=%d",
-		aEventInfo.iEventType, this, currentThread, iEventBalance );
-	TKernelEventAction action = iEventActions[aEventInfo.iEventType];
-
-	switch (action)
-		{
-		case EActionSuspend:
-			{
-			LOG_MSG("DDebugAgent::NotifyEvent() Suspend thread");
-
-			switch(aEventInfo.iEventType)
-				{
-				case EEventsAddLibrary:
-				case EEventsRemoveLibrary:
-					currentThread = DebugUtils::OpenThreadHandle(aEventInfo.iThreadId);
-					if(currentThread)
-						{
-						currentThread->Close(NULL);
-						}
-					break;
-				default:
-					break;
-				}
-			TInt err = TheDProcessTracker.SuspendThread(currentThread, aEventInfo.FreezeOnSuspend());
-			if((err != KErrNone) && (err != KErrAlreadyExists))
-				{
-				// Is there anything we can do in the future to deal with this error having happened?
-				LOG_MSG2("DDebugAgent::NotifyEvent() Problem while suspending thread: %d", err);
-				}
-
-			// now drop through to the continue case, which typically notifies
-			// the debug agent of the event
-			}
-		case EActionContinue:
-			{
-			// Queue this event
-			QueueEvent(aEventInfo);
-
-			// Tell the user about the oldest event in the queue
-			if ( iClientThread )
-				{
-				if( iRequestGetEventStatus && (iEventBalance > 0) )
-					{
-					// Fill the event data
-					TInt err = iEventQueue[iTail].WriteEventToClientThread(iRequestGetEventStatus,iClientThread);
-					if (err != KErrNone)
-						{
-						LOG_MSG2("Error writing event info: %d", err);
-						}
-
-					// signal the debugger thread 
-					LOG_MSG4("> QueueRequestComplete iRequestGetEventStatus=0x%08x, iEventBalance=%d, iTail=%d",
-						iRequestGetEventStatus->iStatus, iEventBalance, iTail );
-					Kern::QueueRequestComplete(iClientThread, iRequestGetEventStatus, KErrNone);
-
-					iEventBalance--;
-
-					iEventQueue[iTail].Reset();
-
-					// move to the next slot
-					IncrementTailPosition();
-					}
-				else
-					{
-					if( !iRequestGetEventStatus )
-						{
-						LOG_MSG("iRequestGetEventStatus is NULL so not signalling client" );
-						}
-					else
-						{
-						LOG_MSG2("Queued event. iEventBalance=%d (unbalanced event requests vs notifications)", 
-							iEventBalance );
-						}
-					}
-				}
-			else
-				{
-				 LOG_MSG("DDebugAgent::NotifyEvent() : Not informing client since its thread is NULL");
-				}
-			break;
-			}
-		case EActionIgnore:
-		default:
-			LOG_EVENT_MSG("DDebugAgent::NotifyEvent() fallen through to default case");
-			// Ignore everything we don't understand.
-
-		}
-
-	UnlockEventQueue();
-
-	}
-
-// Used to identify which Debug Agent this DDebugAgent is associated with.
-TUint64 DDebugAgent::Id(void)
-	{
-	return iId;
-	}
-
-/**
- * Used to add an event to the event queue for this debug agent if event 
- * queue is not at critical level. If it is at critical and it is trace event, 
- * we start ignoring trace events and insert a lost trace event.
- * If the buffer cannot store an event, only insert a buffer full event.
- * @see EEventsBufferFull
- * @see EEventsUserTracesLost
- * @see TDriverEventInfo
- * @see iEventQueue
- */
-void DDebugAgent::QueueEvent(const TDriverEventInfo& aEventInfo)
-	{
-	// Have we caught the tail?
-	if(BufferFull())
-		{
-		LOG_MSG("DDebugAgent::QueueEvent : BufferFull. Not queueing");
-		return;
-		}
-
-	// Assert if we think there is space but the slot is not marked empty
-	__NK_ASSERT_DEBUG(iEventQueue[iHead].iEventType == EEventsUnknown);
-
-	const TBool bufferAtCritical = BufferAtCriticalLevel();
-
-	if(!bufferAtCritical)
-		{
-		//reset the iIgnoringTrace flag as we are not at 
-		//critical level and can store event
-		iIgnoringTrace = EFalse; 
-		
-		// Insert the event into the ring buffer at iHead
-		iEventQueue[iHead] = aEventInfo;
-		IncrementHeadPosition();
-		}
-	else if(bufferAtCritical && BufferCanStoreEvent())
-		{
-		LOG_MSG("DDebugAgent::QueueEvent : BufferCritical");
-		if(aEventInfo.iEventType == EEventsUserTrace)
-			{
-			if(!iIgnoringTrace)
-				{
-				//if this is the first time we are ignoring trace events, 
-				//we need to issue a EEventsUserTracesLost event
-				iEventQueue[iHead].Reset();
-				iEventQueue[iHead].iEventType = EEventsUserTracesLost;
-				IncrementHeadPosition();
-
-				iIgnoringTrace = ETrue;
-				}
-			else
-				{
-				//otherwise, ignore this event
-				LOG_MSG("DDebugAgent::QueueEvent : Ignore EEventsUserTrace event");
-				}
-			}
-		else
-			{
-			// Store the event since its not a trace event
-			iEventQueue[iHead] = aEventInfo;
-			IncrementHeadPosition();
-			}
-		}
-	else
-		{
-		//At critical level and cannot store new events, so 
-		//only one space left. Store a EEventsBufferFull event
-		LOG_MSG("DDebugAgent::QueueEvent : Event Buffer Full, ignoring event");
-		iEventQueue[iHead].Reset();
-		iEventQueue[iHead].iEventType = EEventsBufferFull;
-		IncrementHeadPosition();
-		}
-	}
-
-// End of file - d_debug_agent.cpp
--- a/kernel/eka/drivers/debug/rmdebug/d_debug_agent.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Purpose: Kernel-side tracking of debug agent information associated
-// with each process being debugged.
-// 
-//
-
-#ifndef D_DEBUG_AGENT_H
-#define D_DEBUG_AGENT_H
-
-#include <rm_debug_api.h>
-#include "d_driver_event_info.h"
-
-/**
-* Handles events from the kernel, filters them according to the debug agent's requests, 
-* and signals these events to the user side in FIFO-style. 
-* @see TKernelEventAction
-* @see TEventInfo
-*/
-class DDebugAgent : public DBase
-{
-public:
-	static DDebugAgent* New(TUint64);
-	~DDebugAgent();
-
-	TInt SetEventAction(Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction);
-	void GetEvent(TClientDataRequest<Debug::TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread);
-	TInt EventAction(Debug::TEventType aEvent);
-
-	TInt CancelGetEvent(void);
-	void NotifyEvent(const TDriverEventInfo& aEventInfo);
-	TUint64 Id();
-
-protected:
-	DDebugAgent(TUint64 aId);
-	TInt Construct();
-
-private:
-	void QueueEvent(const TDriverEventInfo& aEventInfo);
-	TBool BufferEmpty() const;
-	TBool BufferFull() const;
-	TBool BufferCanStoreEvent() const;
-	TBool BufferAtCriticalLevel() const;
-	void IncrementHeadPosition(void);
-	void IncrementTailPosition(void);
-	TInt NumberOfEmptySlots() const;
-	void LockEventQueue(void);
-	void UnlockEventQueue(void);
-
-private:
-
-	TUint64	iId;
-	Debug::TKernelEventAction iEventActions[Debug::EEventsLast];
-
-	/**
-	* Object used to write events back to DSS thread
-	* @see TEventInfo
-	*/
-	TClientDataRequest<Debug::TEventInfo>* iRequestGetEventStatus;
-
-	DThread* iClientThread;
-
-	/** 
-	* Ring buffer of pending events. Access to it is controlled by 
-	* @see iEventQueueLock
-	*/
-	RArray<TDriverEventInfo> iEventQueue;
-
-	/**
-	* Ring buffer head. Points to the next empty slot in iEventQueue
-	* @see iEventQueue
-	*/
-	TInt iHead;	
-
-	/**
-	* Ring buffer tail. Points to the oldest full slot in iEventQueue
-	* @see iEventQueue 
-	*/
-	TInt iTail;
-
-	/** 
-	* Control access to event queue.
-	* @see iEventQueue
-	*/
-	DSemaphore* iEventQueueLock;
-
-	/**
-	* Keeps track of how many free slots are available in the event queue.
-	* @see iEventQueue
-	*/
-	TInt iFreeSlots;
-
-	/**
-	* Boolean to indicate if we have told the agent that we are ignoring trace events
-	* @see QueueEvent
-	*/
-	TBool iIgnoringTrace;
-	
-	/**
-	* Used to control the delivery of events to the client so that only 
-	* when more requests than deliveries have taken place can we deliver the 
-	* next event
-	* 
-	* Incremented when a request for event takes place
-	* @see GetEvent
-	* 
-	* Decremented when an event is delivered. 
-	* @see NotifyEvent
-	* 
-	* Cleared when event requests are cancelled
-	* @see CancelGetEvent
-	* 
-	*/
-	TInt   iEventBalance;
-
-	/**
-	* Length of kernel-event queue.
-	* This is a power of two for efficiency when using the 
-	* remainder operator
-	* @see DDebugAgent::iEventQueue
-	*/
-	static const TUint KNumberOfEventsToQueue = 128;
-
-	/**
-	* This determines the number of events at which we stop accepting 
-	* low priority events into the event queue.
-	* @see DDebugAgent::BufferAtCriticalLevel
-	* @see DDebugAgent::iEventQueue
-	*/
-	static const TUint KCriticalBufferSize = 64;
-
-};
-
-#endif // D_DEBUG_AGENT_H
-
--- a/kernel/eka/drivers/debug/rmdebug/d_debug_agent.inl	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description:
-// Inline methods for debug agent class
-//
-
-
-/**
- @file
- @internalComponent
- @released
-*/
-
-#ifndef D_DEBUG_AGENT_INL
-#define D_DEBUG_AGENT_INL
-
-
-/**
- Checks whether the event queue is empty
-*/
-inline TBool DDebugAgent::BufferEmpty() const
-	{
-	return (NumberOfEmptySlots() == KNumberOfEventsToQueue);
-	}
-
-/**
- Checks whether the event queue is full
-*/
-inline TBool DDebugAgent::BufferFull() const
-	{
-	return (NumberOfEmptySlots() == 0);
-	}
-
-/**
- Checks whether there is room in the event queue to store an event
-*/
-inline TBool DDebugAgent::BufferCanStoreEvent() const
-	{
-	return (NumberOfEmptySlots() > 0);
-	}
-
-/**
- This looks to see if the buffer is close to being full and should only
- accept higher priority debug events (user trace is the only low priority event) 
-*/
-inline TBool DDebugAgent::BufferAtCriticalLevel() const
-	{
-	return (NumberOfEmptySlots() < KNumberOfEventsToQueue - KCriticalBufferSize);
-	}
-
-/**
- Increments Head position, wrapping at KNumberOfEventsToQueue if necessary
-*/
-inline void DDebugAgent::IncrementHeadPosition(void)
-	{
-	iHead = (iHead + 1) % KNumberOfEventsToQueue;
-
-	iFreeSlots--;
-	}
-
-/**
- Increments Tail position, wrapping at KNumberOfEventsToQueue if necessary
-*/
-inline void DDebugAgent::IncrementTailPosition(void)
-	{
-	iTail = (iTail + 1) % KNumberOfEventsToQueue;
-
-	iFreeSlots++;
-}
-
-/**
- Returns the number of free slots in the event queue
-*/
-inline TInt DDebugAgent::NumberOfEmptySlots() const
-	{
-	return iFreeSlots;
-	}
-
-/**
- Lock access to this agent's event queue
-*/
-inline void DDebugAgent::LockEventQueue(void)
-	{
-	Kern::SemaphoreWait(*iEventQueueLock);
-	}
-
-/**
- Release the lock on this agent's event queue
-*/
-inline void DDebugAgent::UnlockEventQueue(void)
-	{
-	Kern::SemaphoreSignal(*iEventQueueLock);
-	}
-
-
-#endif	// D_DEBUG_AGENT_INL
--- a/kernel/eka/drivers/debug/rmdebug/d_driver_event_info.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,337 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-//
-
-#include "d_driver_event_info.h"
-#include <kernel/kernel.h>
-#include <kernel/kern_priv.h>
-
-using namespace Debug;
-
-TDriverEventInfo::TDriverEventInfo()
-	{
-	Reset();
-	}
-
-void TDriverEventInfo::Reset()
-	{
-	iProcessId = 0;
-	iThreadId = 0;
-	iCurrentPC = 0;
-	iExceptionNumber = 0;
-	iFileName.FillZ();
-	iPanicCategory.FillZ();
-	iCodeAddress = 0;
-	iDataAddress = 0;
-	iThreadIdValid = (TUint8)EFalse;
-	iProcessIdValid = (TUint8)EFalse;
-	iEventType = EEventsUnknown;
-	iUidsValid = (TUint8)EFalse;
-	};
-
-/**
-  Copy the data from this object into the object pointed to by aEventInfo in
-  the client thread aClientThread. It is assumed that the write is performed
-  on behalf of aClientThread.
-
-  @param aClientThread client thread to write the data to
-  @param aEventInfo TEventInfo object in the client thread to populate with data
-  @param aAsyncGetValueRequest TClientDataRequest object used for pinning user memory
-
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-TInt TDriverEventInfo::WriteEventToClientThread(TClientDataRequest<TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread) const
-	{
-	// create a temporary TEventInfo to populate with the relevant data
-	TEventInfo eventInfo;
-	TInt err = KErrNone;	
-	
-	// populate the data that is common to all events
-	err = PopulateCommonEventInfo(eventInfo);
-
-	if(KErrNone != err)
-		{
-		return err;
-		}
-	
-	// populate the event specific data (means filling in the correct union member)
-	err = PopulateEventSpecificInfo(eventInfo);
-
-	// write the data to the client and return any error
-	if(KErrNone == err)
-		{
-		aAsyncGetValueRequest->Data() = eventInfo;
-		}
-	
-	return err;
-	}
-	
-/**
-  Write the common event values into aEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateCommonEventInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iEventType = iEventType;
-	aEventInfo.iProcessId = iProcessId;
-	aEventInfo.iProcessIdValid = iProcessIdValid;
-	aEventInfo.iThreadId = iThreadId;
-	aEventInfo.iThreadIdValid = iThreadIdValid;
-	
-	return KErrNone;
-	}
-
-/**
-  Write the event specific values into aEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateEventSpecificInfo(TEventInfo& aEventInfo) const
-	{
-	TInt ret = KErrNone;
-	
-	switch(aEventInfo.iEventType)
-		{
-		case EEventsBreakPoint:
-			ret = PopulateThreadBreakPointInfo(aEventInfo);
-			return ret;
-		case EEventsProcessBreakPoint:
-			ret = PopulateThreadBreakPointInfo(aEventInfo);
-			return ret;
-		case EEventsSwExc:
-			ret = PopulateThreadSwExceptionInfo(aEventInfo);
-			return ret;
-		case EEventsHwExc:
-			ret = PopulateThreadHwExceptionInfo(aEventInfo);
-			return ret;
-		case EEventsKillThread:
-			ret = PopulateThreadKillInfo(aEventInfo);
-			return ret;
-		case EEventsAddLibrary:
-			ret = PopulateLibraryLoadedInfo(aEventInfo);
-			return ret;
-		case EEventsRemoveLibrary:
-			ret = PopulateLibraryUnloadedInfo(aEventInfo);
-			return ret;
-		case EEventsUserTrace:
-			ret = PopulateUserTraceInfo(aEventInfo);
-			return ret;
-		case EEventsStartThread:
-			ret = PopulateStartThreadInfo(aEventInfo);
-			return ret;
-		case EEventsUserTracesLost:
-			//no event specific data to be filled here
-			return KErrNone;
-		case EEventsAddProcess:
-			ret = PopulateAddProcessInfo(aEventInfo);
-			return ret;
-		case EEventsRemoveProcess:
-			ret = PopulateRemoveProcessInfo(aEventInfo);
-			return ret;
-		}
-	
-	return KErrArgument;
-	}
-
-/**
-  Write the event specific values for a break point event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateThreadBreakPointInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iThreadBreakPointInfo.iExceptionNumber = (TExcType)iExceptionNumber;
-	TInt ret = PopulateRmdArmExcInfo(aEventInfo);
-	
-	return ret;
-	}
-
-/**
-  Write the event specific values for a thread exception event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateThreadSwExceptionInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iThreadSwExceptionInfo.iCurrentPC = iCurrentPC;
-	aEventInfo.iThreadSwExceptionInfo.iExceptionNumber = (TExcType)iExceptionNumber;
-	
-	return KErrNone;
-	}
-
-/**
-  Write the event specific values for a thread exception event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateThreadHwExceptionInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iThreadHwExceptionInfo.iExceptionNumber = (TExcType)iExceptionNumber;
-	TInt ret = PopulateRmdArmExcInfo(aEventInfo);
-	return ret;
-	}
-
-/**
-  Write the event specific values for a thread panic event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateThreadKillInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iThreadKillInfo.iCurrentPC = iCurrentPC;
-	aEventInfo.iThreadKillInfo.iExitReason = iExceptionNumber;
-	aEventInfo.iThreadKillInfo.iExitType = iExitType;
-	aEventInfo.iThreadKillInfo.iPanicCategoryLength = iPanicCategory.Length();
-	TPtr8 panicCategoryPtr(&(aEventInfo.iThreadKillInfo.iPanicCategory[0]), iPanicCategory.Length());
-	panicCategoryPtr = iPanicCategory;
-	
-	return KErrNone;
-	}
-
-/**
-  Write the event specific values for a library loaded event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateStartThreadInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iStartThreadInfo.iFileNameLength = iFileName.Length();
-	TPtr8 fileNamePtr(&(aEventInfo.iStartThreadInfo.iFileName[0]), iFileName.Length());
-	fileNamePtr = iFileName;
-	
-	return KErrNone;
-	}
-
-/**
-  Write the event specific values for an AddProcess event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateAddProcessInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iAddProcessInfo.iFileNameLength = iFileName.Length();
-	TPtr8 fileNamePtr(&(aEventInfo.iAddProcessInfo.iFileName[0]), iFileName.Length());
-	fileNamePtr = iFileName;
-
-	const TInt uid3offset = 2;
-	aEventInfo.iAddProcessInfo.iUid3 = iUids.iUid[uid3offset].iUid;
-	aEventInfo.iAddProcessInfo.iCreatorThreadId = iCreatorThreadId;
-
-	return KErrNone;
-	}
-
-/**
-  Write the event specific values for a RemoveProcess event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateRemoveProcessInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iRemoveProcessInfo.iFileNameLength = iFileName.Length();
-	TPtr8 fileNamePtr(&(aEventInfo.iRemoveProcessInfo.iFileName[0]), iFileName.Length());
-	fileNamePtr = iFileName;
-	
-	return KErrNone;
-	}
-
-/**
-  Write the event specific values for a library loaded event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateLibraryLoadedInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iLibraryLoadedInfo.iCodeAddress = iCodeAddress;
-	aEventInfo.iLibraryLoadedInfo.iDataAddress = iDataAddress;
-	aEventInfo.iLibraryLoadedInfo.iFileNameLength = iFileName.Length();
-	TPtr8 fileNamePtr(&(aEventInfo.iLibraryLoadedInfo.iFileName[0]), iFileName.Length());
-	fileNamePtr = iFileName;
-	
-	return KErrNone;
-	}
-
-/**
-  Write the event specific values for a library unloaded event into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateLibraryUnloadedInfo(TEventInfo& aEventInfo) const
-	{
-	aEventInfo.iLibraryUnloadedInfo.iFileNameLength = iFileName.Length();
-	TPtr8 fileNamePtr(&(aEventInfo.iLibraryUnloadedInfo.iFileName[0]), iFileName.Length());
-	fileNamePtr = iFileName;
-	
-	return KErrNone;
-	}
-
-/**
-  Write the ArmExcInfo values into TEventInfo
-
-  @param aEventInfo TEventInfo object to write data into
-  */
-TInt TDriverEventInfo::PopulateRmdArmExcInfo(TEventInfo& aEventInfo) const
-	{
-	switch(iEventType)
-		{
-		case EEventsProcessBreakPoint:
-		case EEventsBreakPoint:
-			aEventInfo.iThreadBreakPointInfo.iRmdArmExcInfo = iRmdArmExcInfo;
-			break;
-		case EEventsHwExc:
-			aEventInfo.iThreadHwExceptionInfo.iRmdArmExcInfo = iRmdArmExcInfo;
-			break;
-		}
-	
-	return KErrNone;
-	}
-
-/**
- * Writes the user trace into TEventInfo
- * 
- * @param aEventInfo TEventInfo object to write data into
- */
-TInt TDriverEventInfo::PopulateUserTraceInfo(TEventInfo& aEventInfo) const
-	{	
-	aEventInfo.iUserTraceInfo.iUserTraceLength = (TInt)iArg2;
-	
-	TPtr8 ptr(aEventInfo.iUserTraceInfo.iUserTraceText, (TInt)iArg2, TUserTraceSize );
-	ptr.Copy(iUserTraceText, (TInt)iArg2);
-		
-	return KErrNone;
-	}
-
-TBool TDriverEventInfo::FreezeOnSuspend() const
-	{
-	switch(iEventType)
-		{
-		case EEventsHwExc:
-		case EEventsBreakPoint:
-		case EEventsProcessBreakPoint:
-			return ETrue;
-		case EEventsKillThread:
-			{
-			return (iExitType == EExitPanic);
-			}
-		}
-	return EFalse;
-	}
-
-TBool TDriverEventInfo::TookException() const
-	{
-	return iExitType == EExitPanic &&
-		iExceptionNumber == ECausedException &&
-		iPanicCategory == KLitKernExec;
-	}
-
--- a/kernel/eka/drivers/debug/rmdebug/d_driver_event_info.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Purpose: Kernel-side tracking of event information
-//
-//
-
-#ifndef T_DRIVER_EVENT_INFO_H
-#define T_DRIVER_EVENT_INFO_H
-
-#include <rm_debug_api.h>
-#include <kernel/kernel.h> 
-
-/**
-@file
-@internalComponent
-*/
-
-class TDriverEventInfo
-	{
-public:
-	TDriverEventInfo();
-	void Reset();
-	TInt WriteEventToClientThread(TClientDataRequest<Debug::TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread) const;
-	TBool FreezeOnSuspend() const;
-
-private:
-	TInt PopulateCommonEventInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateEventSpecificInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateThreadBreakPointInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateThreadHwExceptionInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateThreadSwExceptionInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateThreadKillInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateLibraryLoadedInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateLibraryUnloadedInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateRmdArmExcInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateUserTraceInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateStartThreadInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateAddProcessInfo(Debug::TEventInfo& aEventInfo) const;
-	TInt PopulateRemoveProcessInfo(Debug::TEventInfo& aEventInfo) const;
-	TBool TookException() const;
-
-public:
-	Debug::TEventType iEventType;
-	TUint64 iProcessId;
-	TUint64 iThreadId;
-	TUint64 iCreatorThreadId;
-	TUint32 iCurrentPC;
-	TInt iExceptionNumber;
-	TBuf8<KMaxName> iFileName;
-	TBuf8<Debug::KPanicCategoryMaxName> iPanicCategory;
-	TUint32 iCodeAddress;
-	TUint32 iDataAddress;
-	TUint8 iExitType;
-	TUint8 iThreadIdValid;
-	TUint8 iProcessIdValid;
-	TUidType iUids;
-	TUint8 iUidsValid;
-
-	//The objects that these pointers point to are not
-	//owned by the Debug::TEventInfo class so no cleanup is required
-	TAny* iArg1;	// a1
-	TAny* iArg2;	// a2
-
-	union
-	{
-		Debug::TRmdArmExcInfo iRmdArmExcInfo;
-		//To store Trace info
-		TUint8 iUserTraceText[Debug::TUserTraceSize];
-	};
-
-	//status of trace message
-	Debug::TUserTraceMessageContext iMessageStatus;
-
-	};
-
-
-#endif //T_DRIVER_EVENT_INFO_H
--- a/kernel/eka/drivers/debug/rmdebug/d_list_manager.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1007 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Provides a class to manage the generation of lists
-// 
-//
-
-#include "d_list_manager.h"
-#include "d_process_tracker.h"
-#include "debug_utils.h"
-#include "plat_priv.h"
-#include "debug_logging.h"
-#include <arm.h>
-
-// make accessing DThread's MState more intuitive
-#define iMState iWaitLink.iSpare1
-// make accessing NThread's NState more intuitive
-#define iNState iSpare3
-
-//constants to match against a rom entry's attributes,
-//these are defined in the file server (can't be included kernel side)
-//and in the ROM tools (also inaccessible) so redefined here
-const TUint KEntryAttXIP=0x0080;
-const TUint KEntryAttDir=0x0010;
-
-using namespace Debug;
-
-/**
-  Get thread listing for the specified thread, if the thread data will not fit
-  in the buffer then an error is returned.
-
-  @param aBuffer buffer to put data in
-  @param aDataSize on return will contain size of data
-  @param aTargetThreadId thread ID to return listing for
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer
-  or one of the other system wide error codes on failure
-  */
-TInt TListManager::GetThreadListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const
-	{
-	LOG_MSG("TListManager::GetThreadListForThread()");
-
-	// open a handle to check whether the thread actually exists
-	DThread* thread = DebugUtils::OpenThreadHandle(aTargetThreadId);
-	if(!thread)
-		{
-		return KErrArgument;
-		}
-	DProcess* process = thread->iOwningProcess;
-	if(!process)
-		{
-		return KErrArgument;
-		}
-	TUint64 processId = process->iId;
-	thread->Close(NULL);
-
-	//request a process specific list
-	return GetThreadListForProcess(aBuffer, aDataSize, processId);
-	}
-
-TInt TListManager::GetThreadListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const
-	{
-	LOG_MSG("TListManager::GetThreadListForProcess()");
-
-	// open a handle to check whether the process actually exists
-	DProcess* process = DebugUtils::OpenProcessHandle(aTargetProcessId);
-	if(!process)
-		{
-		return KErrArgument;
-		}
-	process->Close(NULL);
-
-	//request a process specific list
-	return GetThreadList(aBuffer, aDataSize, EFalse, aTargetProcessId);
-	}
-
-/**
-  Get global thread listing
-
-  @param aBuffer buffer to put data in
-  @param aDataSize on return will contain size of data
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer
-  or one of the other system wide error codes on failure
-  */
-TInt TListManager::GetGlobalThreadList(TDes8& aBuffer, TUint32& aDataSize) const
-	{
-	LOG_MSG("TListManager::GetGlobalThreadList()");
-
-	//request a global list
-	return GetThreadList(aBuffer, aDataSize, ETrue, 0);
-	}
-
-/**
-  Get thread listing, if the thread data will not fit
-  in the buffer then an error is returned.
-
-  @param aBuffer buffer to put data in
-  @param aDataSize on return will contain size of data
-  @param aGlobal whether or not the listing should be global or thread specific
-  @param aTargetProcessId process ID to return listing for, relevant only if aGlobal == ETrue
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer
-  or one of the other system wide error codes on failure
-  */
-TInt TListManager::GetThreadList(TDes8& aBuffer, TUint32& aDataSize, TBool aGlobal, const TUint64 aTargetProcessId) const
-	{
-
-	LOG_MSG("TListManager::GetThreadList\n");
-
-	//have to read the threads in a critical section
-	NKern::ThreadEnterCS();
-
-	//get a pointer to the kernel's thread list
-	DObjectCon *threads = Kern::Containers()[EThread];
-
-	//if can't get container then exit
-	if(threads == NULL)
-		{
-		NKern::ThreadLeaveCS();
-
-		return KErrGeneral;
-		}
-
-	//stop the thread list from changing while we are processing them
-	threads->Wait();
-
-	aDataSize = 0;
-	aBuffer.SetLength(0);
-	//iterate through the threads adding them to the buffer
-	for(TInt i=0; i<threads->Count(); i++)
-		{
-		DThread* thread = (DThread*)(*threads)[i];
-
-		//skip this thread pointer is the thread is NULL
-		if(thread)
-			{
-			NThread& nThread = thread->iNThread;
-
-			// if the thread is marked as being dead then don't return information about it in the listing
-#ifndef __SMP__
-			if((NThread::EDead != nThread.iNState) && (DThread::EDead != thread->iMState))
-#else
- 			if((!nThread.IsDead()) && (DThread::EDead != thread->iMState))
-#endif
-				{
-				if( aGlobal || (aTargetProcessId == (TUint64)thread->iOwningProcess->iId))
-					{
-					//store the data in the buffer
-					AppendThreadData(aBuffer, aDataSize, thread);
-					}
-				}
-			}
-		}
-
-	//leave critical section
-	threads->Signal();
-	NKern::ThreadLeaveCS();
-
-	//return indication of whether the kernel's data was too big
-	return (aDataSize > aBuffer.Length()) ? KErrTooBig : KErrNone;
-	}
-
-/**
-  Helper function for writing thread data into a buffer
-
-  @pre call in a critical section
-  @pre call only on threads which have NThread state not equal to NThread::EDead
-
-  @param aBuffer buffer to put data in
-  @param aDataSize on return will contain size of data
-  @param aThread thread object to include information about
-
-  @return KErrNone on success, or one of the other system wide error codes
-*/
-void TListManager::AppendThreadData(TDes8& aBuffer, TUint32& aDataSize, DThread* aThread) const
-	{
-	//get aThread's name
-	TFileName fileName;
-	aThread->FullName(fileName);
-	TUint16 nameLength = fileName.Length();
-
-	//increase aDataSize by the size of this entry
-	aDataSize = Align4(aDataSize + (2*nameLength) + sizeof(TThreadListEntry) - sizeof(TUint16));
-	//if the data would not cause overflow then add it to the buffer
-	if(aDataSize <= aBuffer.MaxLength())
-		{
-		//Create a TThreadListEntry which references the buffer.
-		TThreadListEntry& entry = *(TThreadListEntry*)(aBuffer.Ptr()+aBuffer.Length());
-		//add data to entry
-		entry.iProcessId = (TUint64)aThread->iOwningProcess->iId;
-		entry.iThreadId = (TUint64)aThread->iId;
-		entry.iSupervisorStackBase = (TUint32)aThread->iSupervisorStack;
-		entry.iSupervisorStackBaseValid = ETrue;
-		entry.iSupervisorStackSize = aThread->iSupervisorStackSize;
-		entry.iSupervisorStackSizeValid = ETrue;
-		entry.iNameLength = nameLength;
-
-		//only ask for the supervisor stack pointer if aThread is suspended
-		entry.iSupervisorStackPtrValid = EInValid;
-		entry.iSupervisorStackPtr = 0;
-		if(TheDProcessTracker.CheckSuspended(aThread))
-			{
-			NThread& nThread = aThread->iNThread;
-
-			TArmRegSet regSet;
-			TUint32 flags;
-			NKern::ThreadGetSystemContext(&nThread, &regSet, flags);
-			entry.iSupervisorStackPtr = (TUint32)regSet.iR13;
-			//need to check that the stack pointer flag is valid
-			if(flags & (1<<EArmSp))
-				{
-				entry.iSupervisorStackPtrValid = EValid;
-				}
-			}
-
-		//copy name data into the buffer
-		TUint16* ptr = &(entry.iName[0]);
-		const TUint8* ptr8 = fileName.Ptr();
-		const TUint8* ptr8End = ptr8 + nameLength;
-		while(ptr8 < ptr8End)
-			{
-			*ptr++ = (TUint16)*ptr8++;
-			}
- 
-		aBuffer.SetLength(aDataSize);
-		}
-	}
-
-/**
-  Get global process listing
-
-  @param aBuffer buffer to put data in
-  @param aDataSize on return will contain size of data
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer
-  or one of the other system wide error codes on failure
-  */
-TInt TListManager::GetProcessList(TDes8& aBuffer, TUint32& aDataSize) const
-	{
-	LOG_MSG("TListManager::GetProcessList()");
-
-	//get a pointer to the kernel's process list
-	DObjectCon* processes = Kern::Containers()[EProcess];
-
-	if(processes == NULL)
-		{
-		//if can't get container then something is seriously wrong
-		return KErrNotFound;
-		}
-
-	//have to read the processes in a critical section
-	NKern::ThreadEnterCS();
-	processes->Wait();
-
-	aDataSize = 0;
-	//iterate through the processes adding them to the buffer
-	for(TInt i=0; i<processes->Count(); i++)
-		{
-		DProcess* process = (DProcess*)(*processes)[i];
-		if(process)
-			{
-			//get process's file name length
-			DCodeSeg* codeSeg = process->iCodeSeg;
-			TUint16 fileNameLength = (codeSeg) ? (*codeSeg->iFileName).Length() : 0;
-
-			//get process's dynamic name length and name
-			TFullName fullName;
-			process->FullName(fullName);
-			TUint16 dynamicNameLength = fullName.Length();
-
-			//increase aDataSize to reflect size of entry
-			aDataSize = Align4(aDataSize + (2*fileNameLength) + (2*dynamicNameLength) + sizeof(TProcessListEntry) - sizeof(TUint16));
-			//if the data would not cause overflow then add it to the buffer
-			if(aDataSize <= aBuffer.MaxLength())
-				{
-				//Create a TProcessListEntry which references the buffer.
-				TProcessListEntry& entry = *(TProcessListEntry*)(aBuffer.Ptr() + aBuffer.Length());
-
-				//set values
-				entry.iProcessId = (TUint64)process->iId;
-				entry.iFileNameLength = fileNameLength;
-				entry.iDynamicNameLength = dynamicNameLength;
-				entry.iUid3 = process->iUids.iUid[2].iUid;
-
-				if(codeSeg)
-					{
-					//create TPtr to where the file name should be written
-					TPtr name = TPtr((TUint8*)&(entry.iNames[0]), fileNameLength*2, fileNameLength*2);
-					//copy the file name
-					TInt err = CopyAndExpandDes(*codeSeg->iFileName, name);
-					if(err != KErrNone)
-						{
-						processes->Signal();
-						NKern::ThreadLeaveCS();
-						return KErrGeneral;
-						}
-					}
-
-				//create TPtr to where the dynamic name should be written
-				TPtr name = TPtr((TUint8*)(&(entry.iNames[0]) + fileNameLength), dynamicNameLength*2, dynamicNameLength*2);
-				//copy the dynamic name
-				TInt err = CopyAndExpandDes(fullName, name);
-				if(err != KErrNone)
-					{
-					processes->Signal();
-					NKern::ThreadLeaveCS();
-					return KErrGeneral;
-					}
-
-				//set length same as aDataSize
-				aBuffer.SetLength(aDataSize);
-				}
-			}
-		}
-
-	//leave critical section
-	processes->Signal();
-	NKern::ThreadLeaveCS();
-
-	//return indication of whether the kernel's data was too big
-	return (aDataSize > aBuffer.Length()) ? KErrTooBig : KErrNone;
-	}
-
-/**
-  Copy the descriptor aSrc to aDest and converting each byte from aSrc
-  into the two-byte equivalent. For example if aSrc contains 'XYZ' then
-  aDest will be filled with 'X\0Y\0Z\0' where \0 is the null character.
-  The length of aDest is set to twice the length of aSrc.
-
-  @param aSrc source descriptor
-  @param aDest destination descriptor to copy and expand aSrc into
-
-  @return KErrNone on success,
-  KErrArgument if the max length of aDest is less than twice the length of aSrc
-  */
-TInt TListManager::CopyAndExpandDes(const TDesC& aSrc, TDes& aDest) const
-	{
-	//check bounds
-	if(aSrc.Length() * 2 > aDest.MaxLength())
-		{
-		return KErrArgument;
-		}
-
-	//get a pointer to the start of the destination descriptor
-	TUint16* destPtr = (TUint16*)aDest.Ptr();
-
-	//get pointers to the start and end of the aSrc descriptor
-	const TUint8* srcPtr = aSrc.Ptr();
-	const TUint8* srcEnd = srcPtr + aSrc.Length();
-
-	//copy the characters from aSrc into aDest, expanding to make them 16-bit characters
-	while(srcPtr < srcEnd)
-		{
-		*destPtr = (TUint16)*srcPtr;
-		destPtr++;
-		srcPtr++;
-		}
-
-	//set aDest's length to reflect the new contents
-	aDest.SetLength(2*aSrc.Length());
-	return KErrNone;
-	}
-
-/**
-  Get global code segment listing
-
-  @param aBuffer buffer to put data in
-  @param aDataSize on return will contain size of data
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer,
-  or one of the other system wide error codes
-  */
-TInt TListManager::GetGlobalCodeSegList(TDes8& aBuffer, TUint32& aDataSize) const
-	{
-	LOG_MSG("TListManager::GetGlobalCodeSegList()");
-
-	// Acquire code seg lock mutex
-	NKern::ThreadEnterCS();
-	DMutex* codeMutex = Kern::CodeSegLock();
-	Kern::MutexWait(*codeMutex);
-
-	//get global code seg list
-	SDblQue* codeSegList = Kern::CodeSegList();
-
-	//create a memory info object for use in the loop
-	TModuleMemoryInfo memoryInfo;
-
-	//iterate through the list
-	aDataSize = 0;
-	for (SDblQueLink* codeSegPtr= codeSegList->First(); codeSegPtr!=(SDblQueLink*) (codeSegList); codeSegPtr=codeSegPtr->iNext)
-		{
-		DEpocCodeSeg* codeSeg = (DEpocCodeSeg*)_LOFF(codeSegPtr,DCodeSeg, iLink);
-		//the code seg shouldn't be null as we're in critical section, ignore if it is null
-		if(codeSeg)
-			{
-			//get the memory info
-			TInt err = codeSeg->GetMemoryInfo(memoryInfo, NULL);
-			if(err != KErrNone)
-				{
-				// Release the codeseglock mutex again
-				Kern::MutexSignal(*codeMutex);
-				NKern::ThreadLeaveCS();
-
-				//there's been an error so return it
-				return err;
-				}
-			//calculate data values
-			TFileName fileName(codeSeg->iFileName->Ptr());
-			TBool isXip = (TBool)(codeSeg->iXIP);
-
-			//get the code seg type, can ignore error as have already checked codeSeg is not NULL
-			TCodeSegType type = EUnknownCodeSegType;
-			err = GetCodeSegType(codeSeg, type);
-			if(err != KErrNone)
-				{
-				LOG_MSG("TListManager::GetGlobalCodeSegList() : code seg is NULL");
-				}
-
-			TUint32 uid3 = codeSeg->iUids.iUid[2].iUid;
-			//append data to buffer
-			err = AppendCodeSegData(aBuffer, aDataSize, memoryInfo, isXip, type, fileName, uid3);
-			if(err != KErrNone)
-				{
-				// Release the codeseglock mutex again
-				Kern::MutexSignal(*codeMutex);
-				NKern::ThreadLeaveCS();
-
-				return KErrGeneral;
-				}
-			}
-		}
-
-	// Release the codeseglock mutex again
-	Kern::MutexSignal(*codeMutex);
-	NKern::ThreadLeaveCS();
-
-	return (aDataSize > aBuffer.MaxLength()) ? KErrTooBig : KErrNone;
-	}
-
-/**
-  Get code segment list for a thread
-
-  @param aBuffer buffer to store data in
-  @param aDataSize size of kernel's data
-  @param thread ID to get listing for
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer,
-  or one of the other system wide error codes
-  */
-TInt TListManager::GetCodeSegListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const
-	{
-	LOG_MSG("TListManager::GetCodeSegListForThread()");
-
-	// open a handle to check whether the thread actually exists
-	DThread* thread = DebugUtils::OpenThreadHandle(aTargetThreadId);
-	if(!thread)
-		{
-		return KErrArgument;
-		}
-	DProcess* process = thread->iOwningProcess;
-	if(!process)
-		{
-		return KErrArgument;
-		}
-	TUint64 processId = process->iId;
-	thread->Close(NULL);
-
-	return GetCodeSegListForProcess(aBuffer, aDataSize, processId);
-	}
-/**
-  Get code segment list for a process
-
-  @param aBuffer buffer to store data in
-  @param aDataSize size of kernel's data
-  @param process ID to get listing for
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer,
-  or one of the other system wide error codes
-  */
-TInt TListManager::GetCodeSegListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const
-	{
-	LOG_MSG("TListManager::GetCodeSegListForProcess()");
-
-	//get the process
-	DProcess* process = DebugUtils::OpenProcessHandle(aTargetProcessId);
-
-	if(!process)
-		{
-		return KErrArgument;
-		}
-
-	//enter thread critical section and acquire code segment mutex
-	Kern::AccessCode();
-
-	//memory info object to use in loop
-	TModuleMemoryInfo memoryInfo;
-
-	//get code seg list
-	SDblQue queue;
-	process->TraverseCodeSegs(&queue, NULL, DCodeSeg::EMarkDebug, DProcess::ETraverseFlagAdd);
-
-	//iterate through the list
-	aDataSize = 0;
-	for(SDblQueLink* codeSegPtr= queue.First(); codeSegPtr!=(SDblQueLink*) (&queue); codeSegPtr=codeSegPtr->iNext)
-		{
-		//get the code seg
-		DEpocCodeSeg* codeSeg = (DEpocCodeSeg*)_LOFF(codeSegPtr,DCodeSeg, iTempLink);
-
-		//the code seg shouldn't be null as we're in critical section, ignore if it is null
-		if(codeSeg)
-			{
-			TInt err = codeSeg->GetMemoryInfo(memoryInfo, NULL);
-			if(err != KErrNone)
-				{
-				process->Close(NULL);
-				return err;
-				}
-
-			TFileName fileName(codeSeg->iFileName->Ptr());
-			TBool isXip = (TBool)(codeSeg->iXIP);
-
-			//get the code seg type, can ignore error as have already checked codeSeg is not NULL
-			TCodeSegType type = EUnknownCodeSegType;
-			err = GetCodeSegType(codeSeg, type);
-			if(err != KErrNone)
-				{
-				LOG_MSG("TListManager::GetCodeSegListForProcess() : code seg is NULL");
-				}
-
-			TUint32 uid3 = codeSeg->iUids.iUid[2].iUid;
-			//append data to buffer
-			err = AppendCodeSegData(aBuffer, aDataSize, memoryInfo, isXip, type, fileName, uid3);
-			if(err != KErrNone)
-				{
-				process->Close(NULL);
-				return KErrGeneral;
-				}
-			}
-		}
-
-	//un mark the code segs that we've iterated over
-	DCodeSeg::EmptyQueue(queue, DCodeSeg::EMarkDebug);
-
-	//release mutex and leave CS
-	Kern::EndAccessCode();
-
-	process->Close(NULL);
-	return (aDataSize > aBuffer.MaxLength()) ? KErrTooBig : KErrNone;
-	}
-
-/**
-  Appends data to a specified buffer and puts the resulting size in aDataSize.
-  If the data won't fit then aDataSize is updated to reflect what the new length
-  would be.
-
-  @param aBuffer buffer to append data to
-  @param aDataSize will contain buffer size (or the size the buffer would be) on return
-  @param aMemoryInfo info to append to buffer
-  @param aIsXip boolean indicating whether the code segment is XIP
-  @param aFileName file name to append to buffer
-
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-TInt TListManager::AppendCodeSegData(TDes8& aBuffer, TUint32& aDataSize, const TModuleMemoryInfo& aMemoryInfo, const TBool aIsXip, const TCodeSegType aCodeSegType, const TDesC8& aFileName, const TUint32 aUid3) const
-	{
-	//get some data elements to put in buffer
-	TUint16 fileNameLength = aFileName.Length();
-
-	//calculate the resultant size
-	aDataSize = Align4(aDataSize + sizeof(TCodeSegListEntry) + (2*fileNameLength) - sizeof(TUint16));
-	if(aDataSize <= aBuffer.MaxLength())
-		{
-		//Create a TCodeSegListEntry which references the buffer.
-		TCodeSegListEntry& entry = *(TCodeSegListEntry*)(aBuffer.Ptr() + aBuffer.Length());
-		entry.iCodeBase = aMemoryInfo.iCodeBase;
-		entry.iCodeSize = aMemoryInfo.iCodeSize;
-		entry.iConstDataSize = aMemoryInfo.iConstDataSize;
-		entry.iInitialisedDataBase = aMemoryInfo.iInitialisedDataBase;
-		entry.iInitialisedDataSize = aMemoryInfo.iInitialisedDataSize;
-		entry.iUninitialisedDataSize = aMemoryInfo.iUninitialisedDataSize;
-		entry.iIsXip = aIsXip;
-		entry.iCodeSegType = aCodeSegType;
-		entry.iNameLength = fileNameLength;
-		entry.iUid3 = aUid3;
-
-		//have to convert the stored name to 16 bit unicode
-		TPtr name = TPtr((TUint8*)&(entry.iName[0]), fileNameLength*2, fileNameLength*2);
-		TInt err = CopyAndExpandDes(aFileName, name);
-		if(err != KErrNone)
-			{
-			return KErrGeneral;
-			}
-
-		//increase length
-		aBuffer.SetLength(aDataSize);
-		}
-
-	return KErrNone;
-	}
-
-/**
-  Get global XIP libraries list. The ROM file system is searched for files in
-  z:\sys\bin. The files are filtered to only include library files which
-  correspond to the correct hardware variant.
-
-  In the rom, a directory is represented as a list of TRomEntrys, corresponding to
-  the files and directories in that directory. A TRomEntry corresponding to a file
-  contains a pointer to that file's location in the rom. If the TRomEntry
-  corresponds to a directory then it contains a pointer to that directory in the
-  ROM header. As such, from a pointer to the root directory of the z: drive, it is
-  possible to extract the directory contents for a particular directory (i.e. z:\sys\bin)
-  by recursively finding the subdirectories (i.e. find 'sys' in 'z:', then 'bin' in 'sys')
-  and then listing the contents of that directory.
-
-  @param aBuffer buffer to store data in
-  @param aDataSize size of kernel's data
-
-  @return KErrNone on success,
-  KErrTooBig if data won't fit in aBuffer,
-  or one of the other system wide error codes
-  */
-TInt TListManager::GetXipLibrariesList(TDes8& aBuffer, TUint32& aDataSize) const
-	{
-	LOG_MSG("TListManager::GetXipLibrariesList()");
-
-	// z:\sys\bin expressed as 16 bit unicode..
-	_LIT(KZSysBin, "z\0:\0\\\0s\0y\0s\0\\\0b\0i\0n\0\\\0");
-
-	//array to store pointers to directory entries in
-	RPointerArray<TRomEntry> entries;
-	//get the entries in KZSysBin
-	TInt err = GetDirectoryEntries(entries, KZSysBin());
-	if(KErrNone != err)
-		{
-		entries.Close();
-		return err;
-		}
-
-	aDataSize = 0;
-	for(TInt i=0; i<entries.Count(); i++)
-		{
-		//if the entry is XIP and it's not a directory then it's a candidate to add
-		if( (entries[i]->iAtt & KEntryAttXIP) && ! (entries[i]->iAtt & KEntryAttDir) )
-			{
-			//get a reference to the dll's header
-			const TRomImageHeader& header = *(const TRomImageHeader*)(entries[i]->iAddressLin);
-
-			//check that it's uid1 value corresponds to that for a library
-			if(header.iUid1 == KDynamicLibraryUidValue)
-				{
-				//get the current hardware variant
-				TSuperPage& superPage = Kern::SuperPage();
-				TUint variant = superPage.iActiveVariant;
-				TUint cpu = (variant >> 16) & 0xff;
-				TUint asic = (variant >> 24);
-
-				//check this dll is compatible with the current variant
-				if(THardwareVariant(header.iHardwareVariant).IsCompatibleWith(cpu,asic,variant))
-					{
-					const TInt fileNameLength16 = entries[i]->iNameLength;
-					const TInt fullNameLength16 = (KZSysBin().Length() / 2) + fileNameLength16;
-					aDataSize += Align4((2 * fullNameLength16) + sizeof(TXipLibraryListEntry) - sizeof(TUint16));
-
-					if(aDataSize <= aBuffer.MaxLength())
-						{
-						//Create a TXipLibraryListEntry which references the buffer.
-						TXipLibraryListEntry& libraryInfo = *(TXipLibraryListEntry*)(aBuffer.Ptr() + aBuffer.Length());
-
-						//add the data
-						libraryInfo.iCodeBase = header.iCodeAddress;
-						libraryInfo.iCodeSize = header.iTextSize;
-						libraryInfo.iConstDataSize = header.iCodeSize - header.iTextSize;
-						libraryInfo.iInitialisedDataBase = header.iDataBssLinearBase;
-						libraryInfo.iInitialisedDataSize = header.iDataSize;
-						libraryInfo.iUninitialisedDataSize = header.iBssSize;
-						libraryInfo.iNameLength = fullNameLength16;
-
-						//create a TPtr8 to contain the fully qualified name (i.e. z:\sys\bin\ prefixed)
-						TPtr8 name((TUint8*)&(libraryInfo.iName[0]), 0, 2 * fullNameLength16);
-						name.Append(KZSysBin());
-						name.Append(TPtr8((TUint8*)&(entries[i]->iName), 2 * fileNameLength16, 2 * fileNameLength16));
-
-						//increase the buffer's length to reflect the new data size
-						aBuffer.SetLength(aDataSize);
-						}
-					}
-				}
-			}
-		}
-	entries.Close();
-	return (aDataSize == aBuffer.Length()) ? KErrNone : KErrTooBig;
-	}
-
-/**
-Get the list of TRomEntry objects in the specified directory aDirectory
-
-@param aRomEntryArray array to store pointers to the TRomEntry objects in
-@param aDirectoryName directory to get contents of. The passed in string should be
-16 bit unicode and should begin with z:. Single backslashes should be used as delimiters
-rather than forward slashes and a terminating backslash is optional.
-For example: z:\sys\bin
-
-@return KErrNone on success, or one of the other system wide error codes
-*/
-TInt TListManager::GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, const TDesC& aDirectoryName) const
-	{
-	LOG_MSG("TListManager::GetDirectoryEntries()");
-
-	//definition in 16 bit unicode
-	_LIT(KForwardSlash, "/\0");
-
-	//if directory has forward slashes then exit
-	if(aDirectoryName.Find(KForwardSlash()) != KErrNotFound)
-		{
-		return KErrArgument;
-		}
-
-	//create an array to hold the folders in aDirectoryName
-	RArray<TPtr8> folders;
-
-	//split the directory up into its folders, i.e. z:\sys\bin is split into { 'z:', 'sys', 'bin' }
-	TInt err = SplitDirectoryName(aDirectoryName, folders);
-	if(KErrNone != err)
-		{
-		folders.Close();
-		return err;
-		}
-
-	if(folders.Count() == 0)
-		{
-		folders.Close();
-		//empty string passed in
-		return KErrArgument;
-		}
-
-	// z: as 16 bit unicode
-	_LIT(KZColon, "z\0:\0");
-	if(folders[0].CompareF(KZColon()) != 0)
-		{
-		//first argument must be z: otherwise not in rom
-		folders.Close();
-		return KErrArgument;
-		}
-	//remove z: from array
-	folders.Remove(0);
-	for(TInt i=0; i<folders.Count(); i++)
-		{
-		if(folders[i].Length() == 0)
-			{
-			// there were two backslashes in a row
-			folders.Close();
-			return KErrArgument;
-			}
-		}
-
-	//get a pointer to the start of the rom root directory list
-	TLinAddr romRootDirectoryList = Epoc::RomHeader().iRomRootDirectoryList;
-
-	//the first 4 bytes of the rom root directory list is a count of how many sections (rom roots) there are
-	TUint32 rootDirectoryCount = (TUint32)*(TLinAddr*)romRootDirectoryList;
-
-	//rootDirectoryPointer will be shifted through the rom root directory list and will contain pointers to the sections in the rom
-	TLinAddr rootDirectoryPointer = romRootDirectoryList;
-	for(TInt i=0; i<rootDirectoryCount; i++)
-		{
-		//the address of the section is stored in the second four bytes of the 8 byte pair reserved for each section
-		rootDirectoryPointer += 8;
-
-		//romRoot contains the address of the root of the section
-		TLinAddr romRoot = *(TLinAddr*)rootDirectoryPointer;
-
-		//append the directory entries from romRoot's z:\sys\bin subdirectory
-		TInt err = GetDirectoryEntries(aRomEntryArray, folders, romRoot);
-		if(KErrNone != err)
-			{
-			folders.Close();
-			return err;
-			}
-		}
-	folders.Close();
-	return KErrNone;
-	}
-
-/**
-  Recursively finds the subdirectories in aArray and stores references to the
-  entries in the most derived subdirectory in aRomEntryArray
-
-  @param aRomEntryArray on return will contain the entries in the directory corresponding to aArray
-  @param aArray an array containing the directory to get the entries for, i.e. { 'sys', 'bin' }
-  @param aAddress address in rom to being searching from
-
-  @param KErrNone on success, or one of the other system wide error codes
-*/
-TInt TListManager::GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, RArray<TPtr8>& aArray, TLinAddr& aAddress) const
-	{
-	LOG_MSG2("TListManager::GetDirectoryEntries() aAddress: 0x%08x", aAddress);
-
-	//find the next subdirectory and store its address in aAddress, return error if we can't find it
-	TInt err = FindDirectory(aArray[0], aAddress);
-	if(err != KErrNone)
-		{
-		return err;
-		}
-
-	//if this is the most derived sub-directory (i.e. the bin of z:\sys\bin) then get the dir contents
-	if(aArray.Count() == 1)
-		{
-		return GetDirectoryContents(aRomEntryArray, aAddress);
-		}
-	else
-		{
-		//get the next subdirectory's contents
-		aArray.Remove(0);
-		return GetDirectoryEntries(aRomEntryArray, aArray, aAddress);
-		}
-	}
-
-/**
-Return the entries of a directory in the rom
-
-@param aRomEntryArray array to store the entries in
-@param aAddress address of a directory block in the rom
-*/
-TInt TListManager::GetDirectoryContents(RPointerArray<TRomEntry>& aRomEntryArray, const TLinAddr aAddress) const
-	{
-	LOG_MSG("TListManager::GetDirectoryContents()");
-
-	TLinAddr address = aAddress;
-
-	//get the size in bytes of the block of rom to iterate over
-	const TUint32 sizeInBytes = *(TUint32*)aAddress;
-
-	//get address of first TRomEntry
-	const TLinAddr initialAddress = aAddress + sizeof(TUint32);
-
-	//get pointer to subdir count
-	address = initialAddress + sizeInBytes;
-
-	//the upper two bytes of this entry contain the number of files in this directory, and the lower two bytes
-	//contains the number of subdirectories in this directory
-	TUint32 filesAndDirectories = *(TUint32*)address;
-
-	//get number of subdirectories in this directory
-	const TUint16 subDirCount = filesAndDirectories & 0xFFFF;
-
-	//get the number of files in this dir
-	const TUint16 filesCount = filesAndDirectories >> 16;
-
-	//get total number of entries in dir
-	const TUint numDirectoryEntries = subDirCount + filesCount;
-
-	//set address to start of first entry
-	address = initialAddress;
-
-	for(TInt i=0; i<numDirectoryEntries; i++)
-		{
-		TRomEntry* romEntry = (TRomEntry*)address;
-
-		//store the entry
-		TInt err = aRomEntryArray.Append(romEntry);
-		if(KErrNone != err)
-			{
-			return err;
-			}
-
-		//length of the name of the rom entry
-		TInt nameLength = romEntry->iNameLength;
-
-		//get the size of the entry including the name
-		TUint32 romEntrySize = sizeof(TRomEntry) - sizeof(romEntry->iName) + (2 * nameLength);
-		//adjust the address to the next entry
-		address += Align4(romEntrySize);
-		}
-	return KErrNone;
-	}
-
-/**
-  Finds the subdirectory with name aDirectory in the directory at aAddress
-
-  @param aDirectory name of subdirectory to search for (i.e. 'bin')
-  @param aAddress address in rom of containing directory (i.e. address of 'sys' directory)
-
-  @param KErrNone if aDirectory could be found in aAddress, KErrNotFound if it could not be found
-  */
-TInt TListManager::FindDirectory(const TDesC& aDirectory, TLinAddr& aAddress) const
-	{
-	LOG_MSG3("TListManager::FindDirectory() aDirectory: %S, aAddress: 0x%08x", &aDirectory, aAddress);
-
-	//get the directory's contents
-	RPointerArray<TRomEntry> dirContents;
-	TInt err = GetDirectoryContents(dirContents, aAddress);
-	if(KErrNone != err)
-		{
-		dirContents.Close();
-		return err;
-		}
-	for(TInt i=0; i<dirContents.Count(); i++)
-		{
-		//create a reference to the TRomEntry in the rom to access its attributes
-		TRomEntry& romEntry = *(dirContents[i]);
-		if(romEntry.iAtt & KEntryAttDir)
-			{
-			// this entry's a directory so check if it matches aDirectory
-			const TInt nameLength = romEntry.iNameLength;
-			TPtr8 name((TUint8*)&(romEntry.iName), nameLength * 2, nameLength * 2);
-			if(0 == aDirectory.CompareF(name))
-				{
-				// names matched so get the address of this directory's contents
-				aAddress = romEntry.iAddressLin;
-				dirContents.Close();
-				return KErrNone;
-				}
-			}
-		}
-	dirContents.Close();
-	//couldn't find it so return error
-	return KErrNotFound;
-	}
-
-/**
-  Helper function to get code seg type.
-
-  @param aCodeSeg code seg to get type of
-  @param aType will contain type on return
-
-  @return KErrNone on success, KErrNotFound if aCodeSeg is NULL
-  */
-TInt TListManager::GetCodeSegType(const DCodeSeg* aCodeSeg, TCodeSegType& aType) const
-	{
-	if(!aCodeSeg)
-		{
-		return KErrNotFound;
-		}
-
-	if(aCodeSeg->IsExe())
-		{
-		aType = EExeCodeSegType;
-		return KErrNone;
-		}
-
-	if(aCodeSeg->IsDll())
-		{
-		aType = EDllCodeSegType;
-		return KErrNone;
-		}
-
-	aType = EUnknownCodeSegType;
-	return KErrNone;
-	}
-
-
-/**
-  Split a directory name into its subdirectories, using a 16-bit backslash ('\\\0') as a delimiter.
-  For example z:\sys\bin would be split into { 'z:', 'sys', 'bin' }
-
-  @param aDirectoryName directory name to split into subdirectories
-  @param aSubDirectories array to store the subdirectories in
-  */
-TInt TListManager::SplitDirectoryName(const TDesC& aDirectoryName, RArray<TPtr8>& aSubDirectories) const
-	{
-	//definition in 16 bit unicode
-	_LIT(KBackSlash, "\\\0");
-
-	//split the directory up into its folders, i.e. z:\sys\bin is split into 
-	TPtr8 string((TUint8*)aDirectoryName.Ptr(), aDirectoryName.Length(), aDirectoryName.Length());
-	while(string.Ptr() < aDirectoryName.Ptr() + aDirectoryName.Length())
-		{
-		TInt offset = string.Find(KBackSlash());
-		if(offset == KErrNotFound)
-			{
-			//reached the end of the string
-			offset = string.Length();
-			}
-		//adjustedOffset takes account of the end of the string case
-		TInt adjustedOffset = (offset == string.Length()) ? offset : offset + KBackSlash().Length();
-		//add sub-folder name
-		TInt err = aSubDirectories.Append(TPtr8((TUint8*)string.Ptr(), offset, offset));
-		if(KErrNone != err)
-			{
-			return err;
-			}
-		//remove the sub-folder name and continue
-		string.Set((TUint8*)string.Ptr() + adjustedOffset, string.Length() - adjustedOffset, string.Length() - adjustedOffset);
-		}
-	return KErrNone;
-	}
-
-
-
--- a/kernel/eka/drivers/debug/rmdebug/d_list_manager.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Definitions for the list manager
-// 
-//
-
-#ifndef T_LIST_MANAGER_H
-#define T_LIST_MANAGER_H
-
-#include <e32cmn.h>
-#include <kernel/kern_priv.h>
-#include <rm_debug_api.h>
-
-/**
-@file
-@internalComponent
-@released
-*/
-
-class TListManager
-{
-public:
-	TInt GetThreadListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const;
-	TInt GetThreadListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const;
-	TInt GetGlobalThreadList(TDes8& aBuffer, TUint32& aDataSize) const;
-	TInt GetProcessList(TDes8& aBuffer, TUint32& aDataSize) const;
-	TInt GetCodeSegListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const;
-	TInt GetCodeSegListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const;
-	TInt GetGlobalCodeSegList(TDes8& aBuffer, TUint32& aDataSize) const;
-	TInt GetXipLibrariesList(TDes8& aBuffer, TUint32& aDataSize) const;
-private:
-	TInt GetThreadList(TDes8& aBuffer, TUint32& aDataSize, TBool aGlobal, const TUint64 aTargetProcessId) const;
-	TInt GetDirectoryContents(RPointerArray<TRomEntry>& aRomEntryArray, const TLinAddr aAddress) const;
-	TInt GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, const TDesC& aDirectoryName) const;
-	TInt FindDirectory(const TDesC& aDirectory, TLinAddr& aAddress) const;
-	TInt GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, RArray<TPtr8>& aArray, TLinAddr& aAddress) const;
-
-	TInt AppendCodeSegData(TDes8& aBuffer, TUint32& aDataSize, const TModuleMemoryInfo& aMemoryInfo, const TBool aIsXip, const Debug::TCodeSegType aCodeSegType, const TDesC8& aFileName, const TUint32 aUid3) const;
-	void AppendThreadData(TDes8& aBuffer, TUint32& aDataSize, DThread* aThread) const;
-	TInt CopyAndExpandDes(const TDesC& aSrc, TDes& aDest) const;
-	TInt GetCodeSegType(const DCodeSeg* aCodeSeg, Debug::TCodeSegType& aType) const;
-	TInt SplitDirectoryName(const TDesC& aDirectoryName, RArray<TPtr8>& aSubDirectories) const;
-};
-
-#endif //T_LIST_MANAGER_H
-
--- a/kernel/eka/drivers/debug/rmdebug/d_process_tracker.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,500 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Purpose: The DProcessTracker object tracks which processes are being
-// debugged. The DProcessTracker class uses a DTargetProcess object for
-// each process being debugged.
-// Note: Although TheDProcessTracker object is a global, it will be unique
-// as only the Debug Security Server can load and use rm_debug.ldd.
-// 
-//
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <kernel/kernel.h>
-#include <kernel/kern_priv.h>
-
-#include <rm_debug_api.h>
-#include "debug_logging.h"
-#include "d_process_tracker.h"
-#include "debug_utils.h"
-
-// Global Run-mode debugged process tracking object
-DProcessTracker TheDProcessTracker;
-
-// ctor
-DProcessTracker::DProcessTracker()
-	{
-	}
-
-/**
- * dtor
- * @internalTechnology
- */
-DProcessTracker::~DProcessTracker()
-	{
-	// Forget about all the iProcesses
-	iProcesses.ResetAndDestroy();
-	}
-
-/**
- * @internalTechnology
- *
- * Creates and stores an internal mapping of debug agent to debugged process.
- * Note that an individual process may be mapped to a number of debug agents.
- *
- * @param aProcessName - The fullly qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
- * @param aAgentId - The process id of the debug agent which is attaching to aProcessName, as returned by RProcess.Id()
- * @return KErrNone if there are no errors. KErrArgument if the processname is too long/short for a valid filepath.
- *  KErrNoMemory if there is insufficient memory.
- */
-TInt DProcessTracker::AttachProcess(const TDesC8& aProcessName,TUint64 aAgentId)
-	{
-	LOG_MSG("DProcessTracker::AttachProcess()");
-
-	// Valid ProcessName?
-	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
-		{
-		return KErrArgument;
-		}
-
-	// Create an DTargetProcess to store
-	DTargetProcess* tmpProcess = new DTargetProcess;
-	if (tmpProcess == 0)
-		{
-		return KErrNoMemory;
-		}
-	LOG_MSG2(" AttachProcess: < new DTargetProcess=0x%08x", tmpProcess );
-	
-	// Set the name
-	TInt err = KErrNone;
-	err = tmpProcess->SetProcessName(aProcessName);
-	if (err != KErrNone)
-		{
-		LOG_MSG2(" AttachProcess: < SetProcessName returned %d", err );
-		return err;
-		}
-
-	// Is this process being debugged (ie already attached?)
-	TInt index;
-	TBool found = EFalse;
-	
-	TInt numberOfProcesses = iProcesses.Count();
-	for(index=0; index<numberOfProcesses; index++)
-		{
-		const TPtr8& tmpPtr8(iProcesses[index]->ProcessName() );
-
-		if ( tmpPtr8.CompareF(aProcessName) == 0)
-			{
-			LOG_MSG3(" Proc count=%d, found proc in iProcesses at %d. Count=%d",
-				index, iProcesses.Count() );
-			found = ETrue;
-			break;
-			}
-		}
-
-	if (found)
-		{
-		// Yes, it is being debugged
-
-		// Add the agent to the list of agents for this process
-		LOG_MSG3(" > AddAgent(agent id %d) to existing iProcesses[%d]", I64LOW(aAgentId), index ); 
-
-		iProcesses[index]->AddAgent(aAgentId);
-
-		return KErrNone;
-		}
-	else
-		{
-		// No, it is not being debugged
-			
-		// Add the agent to the list of agents for this process
-		LOG_MSG2(" > AddAgent(agent %d) to new proc at index 0", I64LOW(aAgentId) ); 
-
-		tmpProcess->AddAgent(aAgentId);
-
-		// Add the process to the list of processes being debugged
-		return iProcesses.Insert(tmpProcess,0);
-		}
-	}
-
-/**
- * @internalTechnology
- * 
- * Removes a previously created mapping between a debug agent and a debugged process,
- * as created by AttachProcess.
- *
- * @param aProcessName - The fully qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
- * @param aAgentId - The process id of the debug agent which is attaching to aProcessName, as returned by RProcess.Id()
- * @return KErrNone if there are no problems. KErrArgument if the processname is too long/short for a valid filepath.
- * KErrNotFound if the mapping does not exist (and therefore cannot be removed).
- */
-TInt DProcessTracker::DetachProcess(const TDesC8& aProcessName, TUint64 aAgentId)
-	{
-	// Valid ProcessName?
-	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
-		{
-		return KErrArgument;
-		};
-
-	// Are we debugging this process?
-	TInt i;
-	TBool found = EFalse;
-	DTargetProcess* foundProcess = 0;
-
-	TInt numberOfProcesses = iProcesses.Count();
-	for(i=0; i<numberOfProcesses; i++)
-		{
-		foundProcess = iProcesses[i];
-
-		const TPtr8& tmpPtr8( foundProcess->ProcessName() );
-
-		if ( tmpPtr8.CompareF(aProcessName) == 0)
-			{
-			found = ETrue;
-			break;
-			}
-		}
-
-	if (found == EFalse)
-		{
-		return KErrNotFound;
-		}
-
-	// remove the agent from the process
-	iProcesses[i]->RemoveAgent(aAgentId);
-
-	// Found it, are there any more attached agents, or suspended threads in the process?
-	if ((iProcesses[i]->AgentCount() == 0) && !iProcesses[i]->HasSuspendedThreads() )
-		{
-		// Delete the process as no more agents are still attached
-		delete iProcesses[i];
-
-		// Remove the now obsolete pointer from our array.
-		iProcesses.Remove(i);
-		}
-
-	return KErrNone;
-	}
-
-/**
- * @internalTechnology
- *
- * Detachs a debug agent from every process being debugged. Used when a debug agent is being detached
- * from the debug security server and has not supplied a specific process name from which to detach.
- */
-TInt DProcessTracker::DetachAgent(const TUint64 aAgentId)
-	{
-	// Remove this agent from all the processes being tracked.
-	TInt numberOfProcesses = iProcesses.Count();
-	for(TInt i=0; i<numberOfProcesses; i++)
-		{
-		// remove the agent from the process (we don't care about the return code)
-		iProcesses[i]->RemoveAgent(aAgentId);
-		}
-
-	// Increment down through the array as we then don't have to worry about
-	// missing entries which have been shifted after deletes.
-	// The initial value of i correspnds to the index of the final element 
-	// in the array.
-	for(TInt i = iProcesses.Count()-1; i>=0; i--)
-		{
-		if (iProcesses[i]->AgentCount() == 0)
-			{
-			// No agents remain for this process. Delete the
-			// process object and remove the pointer from the array
-			delete iProcesses[i];
-			iProcesses.Remove(i);
-			}
-		}
-	return KErrNone;
-	}
-
-/**
- * @internalTechnology
- *
- * Returns a pointer to a DTargetProcess object representing the mapping of a debugged process
- * with all the relevant debug agents interested in that process, as determined
- * by AttachProcess.
- *
- * @param aProcessName - The fully qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
- * @return DTargetProcess* pointer to an object representing the internal mapping of a process to all associated
- * debug agents. Returns 0 if the mapping cannot be found or the aProcessName is invalid.
- */
-DTargetProcess* DProcessTracker::FindProcess(const TDesC8& aProcessName)
-	{
-	// Valid ProcessName?
-	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
-		{
-		return 0;	// not found
-		}
-
-	// Can we find this in the array?
-	TInt i;
-	TBool found = EFalse;
-	DTargetProcess* foundProcess = 0;
-
-	TInt numberOfProcesses = iProcesses.Count();
-	for(i=0; i<numberOfProcesses; i++)
-		{
-		foundProcess = iProcesses[i];
-
-		const TPtr8& tmpPtr8( foundProcess->ProcessName() );
-
-		if ( tmpPtr8.CompareF(aProcessName) == 0)
-			{
-			found = ETrue;
-			break;
-			}
-		}
-
-	if (found == EFalse)
-		{
-		LOG_EVENT_MSG("DProcessTracker::FindProcess, not found" );
-		return 0;	// not found
-		}
-
-	return foundProcess;
-	}
-
-/**
- * @internalTechnology
- *
- * Returns a pointer to a DTargetProcess object representing the mapping of a debugged process
- * with all the relevant debug agents interested in that process, as determined
- * by AttachProcess.
- *
- * Note: This does not attempt an exact match, because the AddProcess event does not provide
- * a fully-qualified path, it provides something like [t_rmdebug_security0.exe].
- *
- * So for the purposes of dealing with this event, we need a "fuzzier" match which does not use the complete
- * path.
- *
- * @param aProcessName - The fully qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
- * @return DTargetProcess* pointer to an object representing the internal mapping of a process to all associated
- * debug agents. Returns 0 if the mapping cannot be found or the aProcessName is invalid.
- */
-DTargetProcess*	DProcessTracker::FuzzyFindProcess(const TDesC8& aProcessName)
-	{
-	// Valid ProcessName?
-	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
-		{
-		return 0;	// not found
-		}
-
-	// Can we find this in the array?
-	TBool found = EFalse;
-	DTargetProcess* foundProcess = 0;
-	const TChar KBackSlash('\\');
-
-	TInt numberOfProcesses = iProcesses.Count();
-	for(TInt i=0; i < numberOfProcesses; i++)
-		{
-		foundProcess = iProcesses[i];
-
-		TInt procListBackSlash = foundProcess->ProcessName().LocateReverse( KBackSlash );
-		if( procListBackSlash == KErrNotFound )
-			{
-			procListBackSlash = 0;
-			}
-		else
-			{
-			//Now move to the char after the backlash
-			procListBackSlash++;
-			}
-
-		TInt eventBackSlash = aProcessName.LocateReverse( KBackSlash );
-		if( eventBackSlash == KErrNotFound )
-			{
-			eventBackSlash = 0;
-			}
-		else
-			{
-			//Now move to the char after the backlash
-			eventBackSlash++;
-			}
-
-		if( ( procListBackSlash == 0 ) && ( eventBackSlash == 0 ) )
-			{
-			//There were no backslashes on either name, so no point in continuing
-			break;
-			}
-
-		TPtrC8 eventCleanName( aProcessName.Mid( eventBackSlash ) );		
-		TPtrC8 procListCleanName( foundProcess->ProcessName().Mid( procListBackSlash ) );
-
-		if ( eventCleanName.CompareF( procListCleanName ) == 0 )
-			{
-			LOG_MSG2("DProcessTracker::FuzzyFindProcess() found a match : process list[%d]", i );
-			found = ETrue;
-			break;
-			}
-		}
-
-	if (found == EFalse)
-		{
-		return 0;	// not found
-		}
-
-	return foundProcess;
-	}
-
-TBool DProcessTracker::CheckSuspended(DThread* aTargetThread) const
-	{
-	//get the file name and return if NULL
-	HBuf* name = GetFileName(aTargetThread);
-	if(!name)
-		{
-		return EFalse;
-		}
-
-	//iterate through the processes trying to match the name, and check suspended if found
-	TInt numberOfProcesses = iProcesses.Count();
-	for(TInt i=0; i < numberOfProcesses; i++)
-		{
-		if(iProcesses[i]->ProcessName().CompareF(*name) == 0)
-			{
-			return iProcesses[i]->CheckSuspended(aTargetThread);
-			}
-		}
-
-	//couldn't find the process so return EFalse
-	return EFalse;
-	}
-
-TBool DProcessTracker::CheckSuspended(const TUint64 aTargetThreadId) const
-	{
-	//get a handle to the thread and return false if it's NULL
-	DThread* thread = DebugUtils::OpenThreadHandle(aTargetThreadId);
-	if(!thread)
-		{
-		return EFalse;
-		}
-
-	//check if the thread's suspended and then close the thread handle and return
-	TBool suspended = CheckSuspended(thread);
-	thread->Close(NULL);
-	return suspended;
-	}
-
-/**
-  Attempts to suspend the specified thread
-
-  @param aTargetThread thread to suspend
-
-  @return KErrNone on success, KErrAlreadyExists if the thread is already suspended,
-  or one of the other system wide error codes
-  */
-TInt DProcessTracker::SuspendThread(DThread* aTargetThread, TBool aFreezeThread)
-	{
-	LOG_MSG3("DProcessTracker::SuspendThread() Requesting suspend for: 0x%08x, freeze thread: %d", aTargetThread->iId, aFreezeThread?1:0);
-
-	//get the file name and return if NULL
-	HBuf* name = GetFileName(aTargetThread);
-	if(!name)
-		{
-		return KErrNotFound;
-		}
-
-	//iterate through the processes trying to match the name, try to suspend the thread if found
-	TInt numberOfProcesses = iProcesses.Count();
-	for(TInt i=0; i < numberOfProcesses; i++)
-		{
-		if(iProcesses[i]->ProcessName().CompareF(*name) == 0)
-			{
-			return iProcesses[i]->SuspendThread(aTargetThread, aFreezeThread);
-			}
-		}
-
-	//couldn't find process so return error
-	return KErrPermissionDenied;
-	}
-
-void DProcessTracker::FSWait()
-	{
-	TInt numberOfProcesses = iProcesses.Count();
-	for(TInt i=0; i < numberOfProcesses; i++)
-		{
-		iProcesses[i]->FSWait();
-		}
-	}
-
-/**
-  Attempts to resume the specified thread
-
-  @param aTargetThread thread to resume
-
-  @return KErrNone on success, KErrInUse if the thread is not suspended,
-  or one of the other system wide error codes
-  */
-TInt DProcessTracker::ResumeThread(DThread* aTargetThread)
-	{
-	LOG_MSG2("DProcessTracker::ResumeThread() Requesting resume for: 0x%08x", aTargetThread->iId);
-
-	//get the file name and return if NULL
-	HBuf* name = GetFileName(aTargetThread);
-	if(!name)
-		{
-		return KErrNotFound;
-		}
-
-	//iterate through the processes trying to match the name, try to resume the thread if found
-	TInt numberOfProcesses = iProcesses.Count();
-	for(TInt i=0; i < numberOfProcesses; i++)
-		{
-		if(iProcesses[i]->ProcessName().CompareF(*name) == 0)
-			{
-			return iProcesses[i]->ResumeThread(aTargetThread);
-			}
-		}
-
-	//couldn't find process so return error
-	return KErrPermissionDenied;
-	}
-
-/**
-  Get a thread's originating file name
-
-  @param aThread the thread to get the file name for
-
-  @return a pointer to the thread's file name, if there are problems accessing
-  the file name then NULL will be returned
-  */
-HBuf* DProcessTracker::GetFileName(DThread* aThread) const
-	{
-	//check if the thread is NULL and return if so
-	if(!aThread)
-		{
-		return NULL;
-		}
-
-	//get the owning process and return if it is NULL
-	DProcess* process = aThread->iOwningProcess;
-	if(!process)
-		{
-		return NULL;
-		}
-
-	//get the process' code seg and return if it is NULL
-	DCodeSeg* codeSeg = process->iCodeSeg;
-	if(!codeSeg)
-		{
-		return NULL;
-		}
-
-	//return the code seg's stored file name (which could theoretically be NULL)
-	return codeSeg->iFileName;
-	}
-
--- a/kernel/eka/drivers/debug/rmdebug/d_process_tracker.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Purpose: Kernel-side tracking of process state
-// 
-//
- 
-#ifndef D_PROCESS_TRACKER_H
-#define D_PROCESS_TRACKER_H
-
-#include "d_target_process.h"
-
-// The global class which tracks all debugged processes.
-// 
-// Note that multiple debug agents may attach to a process,
-// as the security server will ensure only one is an 'active'
-// agent, preventing conflicts. Other agents will be 'passive',
-// typically interested only in recording events.
-//
-// The above requirement generates the requirement for the class
-// to track the agent IDs, as multiple debug agents may be interested
-// in a process.
-
-class DProcessTracker : public DBase
-{
-public:
-	DProcessTracker();
-	~DProcessTracker();
-
-	TInt AttachProcess(const TDesC8& aProcessName, TUint64 aAgentId);
-
-	TInt DetachProcess(const TDesC8& aProcessName, TUint64 aAgentId);
-
-	TInt DetachAgent(TUint64 aAgentId);
-
-	DTargetProcess* FindProcess(const TDesC8& aProcessName);
-
-	DTargetProcess* FuzzyFindProcess(const TDesC8& aProcessName);
-
-	TBool CheckSuspended(const TUint64 aTargetThreadId) const;
-	TBool CheckSuspended(DThread* aTargetThread) const;
-	TInt SuspendThread(DThread* aTargetThread, TBool aFreezeThread=EFalse);
-	TInt ResumeThread(DThread* aTargetThread);
-	void FSWait();
-
-private:
-	TInt RemoveSuspendedThread(DThread* aThread);
-	TInt AddSuspendedThread(DThread* aThread);
-	HBuf* GetFileName(DThread* aThread) const;
-
-private:
-	RPointerArray<DTargetProcess> iProcesses;
-};
-
-// static global object
-extern DProcessTracker TheDProcessTracker;
-
-#endif // D_PROCESS_TRACKER_H
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1741 +0,0 @@
-// Copyright (c) 2004-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:
-//
-// Description:
-//
-
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <u32std.h>
-#include <kernel/kernel.h>
-#include <kernel/kern_priv.h>
-#include <nk_trace.h>
-#include <arm.h>
-#include <kernel/cache.h>
-#include <platform.h>
-#include <nkern.h>
-#include <u32hal.h>
-
-#include <rm_debug_api.h>
-#include <sm_debug_api.h>
-#include "d_rmd_breakpoints.h"
-#include "d_process_tracker.h"
-#include "d_rmd_stepping.h"
-#include "rm_debug_kerneldriver.h"	// needed to access DRM_DebugChannel
-#include "rm_debug_driver.h"
-#include "debug_utils.h"
-#include "debug_logging.h"
-
-using namespace Debug;
-
-/* @internalTechnology
- *
- * Checks whether aAddress is correctly aligned for placing a breakpoint of
- * cpu architecture aMode.
- *
- * @param aAddress - Virtual memory address to check
- * @param aMode - The CPU architecture mode of the breakpoint to be placed at aAddress
- * @return ETrue if aAddress is suitably aligned, EFalse otherwise.
- */
-TBool D_RMD_Breakpoints::Aligned(TUint32 aAddress, Debug::TArchitectureMode aMode)
-	{
-	switch(aMode)
-		{
-		case Debug::EArmMode:
-			// ARM breakpoints must be 32-bit aligned (lower two bits must be zero)
-			if (aAddress & 0x3)
-			{
-				// Not 32-bit aligned.
-				return EFalse;
-			}
-			break;
-		case Debug::EThumbMode:
-			// Thumb breakpoints must be 16-bit aligned (low bit must be zero)
-			if (aAddress & 0x1)
-			{
-				// Not 16-bit aligned
-				return EFalse;
-			}
-			break;
-		case Debug::EThumb2EEMode:
-			// Thumb-EE instructions are half-word aligned. See ARM ARM DDI0406A, section A3.2 Alignment Support
-			// Note that some instructions need to be word-aligned, but this function does not know which ones.
-			// It may also depend on the System Control register U bit.
-			if (aAddress & 0x1)
-			{
-				// Not 16-bit aligned
-				return EFalse;
-			}
-			break;
-		default:
-			{
-			// No idea
-			return EFalse;
-			}
-		}
-
-	// Must be OK
-	return ETrue;
-	};
-
-/* @internalTechnology
- *
- * Returns the size of a breakpoint of architecture aMode in bytes
- * 
- * @param aMode - The architure of the breakpoint
- * @return The size of the breakpoints in bytes. 0 if un-recognised architecture.
- */
-TInt D_RMD_Breakpoints::BreakSize(Debug::TArchitectureMode aMode)
-	{
-	switch(aMode)
-		{
-		case Debug::EArmMode:
-			{
-				return 4;
-			}
-		case Debug::EThumbMode:
-			{
-				return 2;
-			}
-		case Debug::EThumb2EEMode:
-			{
-			// Only needs to be two bytes in size.
-			return 2;
-			}
-		default:
-			{
-				// No idea
-				return 0;
-			}
-		}
-	};
-
-/* @internalTechnology
- *
- * Checks whether two TBreakEntrys overlap
- *
- * @param aFirst - A TBreakEntry with valid iAddress and iMode fields.
- * @param aSecond  - A TBreakEntry with valid iAddress and iMode fields.
- * @return ETrue if the aFirst and aSecond overlap or the overlap cannot be determined
- *         , EFalse otherwise
- */
-TBool D_RMD_Breakpoints::BreakpointsOverlap(TBreakEntry& aFirst, TBreakEntry& aSecond)
-	{
-	TInt firstSize = BreakSize(aFirst.iMode);
-	TInt secondSize = BreakSize(aSecond.iMode);
-
-	// Do we know the size of each breakpoint?
-	if ((firstSize <= 0) || (secondSize <= 0))
-		{
-		// We don't know the size of the breakpoint, so assume they overlap
-		return ETrue;
-		}
-
-	TInt firstStartAddress = aFirst.iAddress;
-	TInt secondStartAddress = aSecond.iAddress;
-	TInt firstEndAddress = firstStartAddress + firstSize - 1;
-	TInt secondEndAddress = secondStartAddress + secondSize - 1;
-
-	// If second breakpoint is past the end of the first then we're ok
-	if(firstEndAddress < secondStartAddress)
-		{
-		return EFalse;
-		}
-
-	// If first breakpoint is past the end of the second then we're ok
-	if(secondEndAddress < firstStartAddress)
-		{
-		return EFalse;
-		}
-
-	// The breakpoints overlap
-	return ETrue;
-	}
-
-/* @internalTechnology
- * 
- * Returns the breakpoint bitpattern to use for each architecture type
- *
- * @param aMode - the cpu architecture type
- * @return The bit-pattern to use for the specified architecture, or 0 if unsupported.
- */
-TUint32 D_RMD_Breakpoints::BreakInst(Debug::TArchitectureMode aMode)
-	{
-	switch(aMode)
-		{
-		case Debug::EArmMode:
-			{
-				return KArmBreakPoint;
-			}
-		case Debug::EThumbMode:
-			{
-				return KThumbBreakPoint;
-			}
-		case Debug::EThumb2EEMode:
-			{
-			return KT2EEBreakPoint;
-			}
-		default:
-			{
-				// No idea what the breakpoint should be
-				return 0;
-			}
-		}
-	};
-
-/**
-Constructor. Initialises its internal list of empty breakpoints.
-*/
-D_RMD_Breakpoints::D_RMD_Breakpoints(DRM_DebugChannel* aChannel)
-: iBreakPointList(NUMBER_OF_TEMP_BREAKPOINTS, 0),
-  iNextBreakId(NUMBER_OF_TEMP_BREAKPOINTS),
-  iChannel(aChannel),
-  iInitialised(EFalse)
-	{
-	iBreakPointList.Reset();	
-	TBreakEntry emptyTempBreak;
-	
-	for (TInt i = 0; i < NUMBER_OF_TEMP_BREAKPOINTS; i++)
-		{
-		emptyTempBreak.iBreakId = i;
-		
-		if (KErrNone != iBreakPointList.Append(emptyTempBreak))
-			{
-			LOG_MSG("D_RMD_Breakpoints::D_RMD_Breakpoints() - Error appending blank temp break entry");
-			}
-		}
-	}
-
-/**
-Destructor. Clears all the breakpoints in the system, deletes its internal list of breakpoints,
-and closes the exclusivity semaphore.
-*/
-D_RMD_Breakpoints::~D_RMD_Breakpoints()
-	{
-	ClearAllBreakPoints();
-	
-	// close the breakpoint list and free the memory associated with it
-	iBreakPointList.Close();
-
-	if (iLock)
-		iLock->Close(NULL);
-	}
-
-/**
-Initialises the breakpoint list exclusion semaphore. This should be called once immediately after
-the constructor.
-
-@return KErrNone if successful, one of the other system wide error codes otherwise.
-*/
-TInt D_RMD_Breakpoints::Init()
-	{
-	TInt err = KErrNone;
-
-	// Only create a semaphore if we are not initialised
-	if(!iInitialised)
-		{
-		// Initialise the semaphore ensuring exclusive access to the breakpoint list
-		err = Kern::SemaphoreCreate(iLock, _L("RM_DebugBreakpointLock"), 1 /* Initial count */);
-		if (err == KErrNone)
-			{
-			iInitialised = ETrue;
-			}
-		}
-	else
-		{
-		err = KErrNone;
-		}
-
-	return err;
-	}
-
-/** 
-Public member function which sets a thread-specific breakpoint in the specified thread
-and returns an opaque handle to the caller.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_DoSetBreak
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
- 
-@param aBreakId - Reference to a TUint32 into which the function will return a unique breakpoint Id.
-@param aThreadId - The thread Id in which to place the breakpoint
-@param aAddress - Address to place the breakpoint
-@param aMode - The cpu instruction set architecture type breakpoint (e.g. EArmMode or EThumbMode)
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::DoSetBreak(TInt32 &aBreakId, const TUint64 aId, const TBool aThreadSpecific, const TUint32 aAddress, const TArchitectureMode aMode)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	TInt err = priv_DoSetBreak(aBreakId, aId, aThreadSpecific, aAddress,aMode);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-	
-	return err;
-	}
-/**
-Private member function which sets a thread-specific breakpoint in the specified thread
-and returns an opaque handle to the caller.
-
-@see DoSetBreak
-
-@param aBreakId - Reference to a TUint32 into which the function will return a unique breakpoint Id.
-@param aThreadId - The thread Id in which to place the breakpoint
-@param aAddress - Address to place the breakpoint
-@param aMode - The cpu instruction set architecture type breakpoint (e.g. EArmMode or EThumbMode)
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::priv_DoSetBreak(TInt32 &aBreakId, const TUint64 aId, const TBool aThreadSpecific, const TUint32 aAddress, const TArchitectureMode aMode)
-	{
-	LOG_MSG4("D_RMD_Breakpoints::priv_DoSetBreak(aThreadId = 0x%016lx, aAddress = 0x%08x, aMode = %d)",aId,aAddress,aMode);
-
-	// EThumb2EEMode breakpoints are not supported
-	if (EThumb2EEMode == aMode)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - EThumb2EEMode breakpoints are not supported");
-		return KErrNotSupported;
-		}
-
-	// Check how many breakpoints we have in existence
-	if ((iBreakPointList.Count()+1) >= NUMBER_OF_MAX_BREAKPOINTS)
-		{
-		// Too many breakpoints are set!
-		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Too many breakpoints set");
-		return KErrOverflow;
-		}
-
-	// check the alignment of the breakpoint
-	if (!Aligned(aAddress,aMode))
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Unaligned address");
-		return KErrArgument;
-		}
-
-	// make sure there is not already a breakpoint at this address
-	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-		{
-		/* We need to check if the breakpoint overlaps the address at all,
-		 * and this depends upon the size of the two breakpoints as well as 
-		 * their address.
-		 */
-
-		// newInstSize = size in bytes of new breakpoint
-		TInt newInstSize = BreakSize(aMode);
-		if (newInstSize == 0)
-			{
-			LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Unknown architecture type for new breakpoint");
-			return KErrNotSupported;
-			}
-
-		// oldInstSize = size in bytes of the existing breakpoint
-		TInt oldInstSize = BreakSize(iBreakPointList[i].iMode);
-		if (oldInstSize == 0)
-			{
-			LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - : Unknown architecture type of existing breakpoint");
-			return KErrNotSupported;
-			}
-
-		// Overlap checking - temp is used as the new breakpoint description for checking purposes only
-		TBreakEntry temp;
-
-		temp.iAddress = aAddress;
-		temp.iMode = aMode;
-
-		// do they overlap?
-		if ( BreakpointsOverlap(temp,iBreakPointList[i]) )
-			{
-			// Yes
-			if(iBreakPointList[i].iThreadSpecific && aThreadSpecific)
-				{
-				if(aId == iBreakPointList[i].iId)
-					{
-					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New thread specific breakpoint overlaps an existing thread specific breakpoint");
-					return KErrAlreadyExists;
-					}
-				}
-			else if(!iBreakPointList[i].iThreadSpecific && aThreadSpecific)
-				{
-				DThread* thread = DebugUtils::OpenThreadHandle(aId);
-				if(!thread)
-					{
-					return KErrNotFound;
-					}
-				if(thread->iOwningProcess->iId == iBreakPointList[i].iId)
-					{
-					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New thread specific breakpoint overlaps an existing breakpoint");
-					thread->Close(NULL);
-					return KErrAlreadyExists;
-					}
-				thread->Close(NULL);
-				}
-			else if(iBreakPointList[i].iThreadSpecific && !aThreadSpecific)
-				{
-				DThread* thread = DebugUtils::OpenThreadHandle(iBreakPointList[i].iId);
-				if(!thread)
-					{
-					return KErrNotFound;
-					}
-				if(thread->iOwningProcess->iId == aId)
-					{
-					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New breakpoint overlaps an existing thread specific breakpoint");
-					thread->Close(NULL);
-					return KErrAlreadyExists;
-					}
-				thread->Close(NULL);
-				}
-			else // !iBreakPointList[i].iThreadSpecific && !aThreadSpecific
-				{
-				if(iBreakPointList[i].iId == aId)
-					{
-					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New breakpoint overlaps an existing breakpoint");
-					return KErrAlreadyExists;
-					}
-				}
-			}
-		}
-
-	// increment the break id
-	aBreakId = iNextBreakId++;	
-
-	// create the new breakpoint entry
-	TBreakEntry breakEntry(aBreakId, aId, aThreadSpecific, aAddress, aMode);
-
-	TInt err = priv_DoEnableBreak(breakEntry, ETrue);
-	if (KErrNone != err)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Could not enable the breakpoint");
-		
-		return err;
-		}
-
-	err = iBreakPointList.Append(breakEntry);
-	if (err != KErrNone)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Failed to append breakpoint");
-		}
-
-	LOG_MSG2("D_RMD_Breakpoints::priv_DoSetBreak(breakId = 0x%08x) done",aBreakId);
-
-	return err;
-	}
-
-/**
-Public member function which enables a previously set breakpoint.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_DoEnableBreak
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-
-Note 3
-Historically, this function accepted a reference to a TBreakEntry in the class' own
-iBreakPointList. It now checks whether the reference is to an element of its own list,
-or one invented by the caller.
-
-@param aEntry reference to a TBreakEntry datastructure describing the breakpoint to be re-enabled.
-@param aSaveOldInstruction ETrue preserves the instruction at the breakpoint address, EFalse otherwise.
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	TInt err = priv_DoEnableBreak(aEntry,aSaveOldInstruction);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Private member function which enables a previously set breakpoint, as per DoEnableBreak, but
-does not serialise access.
-
-@see DoEnableBreak
-
-@param aEntry reference to a TBreakEntry datastructure describing the breakpoint to be re-enabled.
-@param aSaveOldInstruction ETrue preserves the instruction at the breakpoint address, EFalse otherwise.
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::priv_DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction)
-	{
-	LOG_MSG("D_RMD_Breakpoints::DoEnableBreak()");
-
-	TUint32 inst = BreakInst(aEntry.iMode);	
-	TInt instSize = BreakSize(aEntry.iMode);
-	if (instSize == 0 || inst == 0)
-		{
-		// not supported
-		LOG_MSG("D_RMD_Breakpoints::priv_DoEnableBreak - unsupported breakpoint architecture");
-		return KErrNotSupported;
-		}
-
-	TInt err = KErrNone;
-
-	// Get thread id
-	TUint64 threadId = aEntry.iId + (aEntry.iThreadSpecific ? 0 : 1);
-
-	DThread* threadObj = DebugUtils::OpenThreadHandle(threadId);
-	if (!threadObj)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoEnableBreak - bad handle. Could not identify a threadObj");
-		return KErrBadHandle;
-		}
-
-	if (aSaveOldInstruction)
-		{
-		TUint32 instruction;
-
-		// read the instruction at the address so we can store it in the break entry for when we clear this breakpoint
-		// trap exceptions in case the address is invalid
-		XTRAPD(r, XT_DEFAULT, err = iChannel->TryToReadMemory(threadObj, (TAny *)aEntry.iAddress, (TAny *)&instruction, instSize));
-
-		//consider the leave as more important than the error code so store the leave if it's not KErrNone
-		if(KErrNone != r)
-			{
-			err = r;
-			}
-
-		if(KErrNone != err)
-			{
-			threadObj->Close(NULL);
-			LOG_MSG("D_RMD_Breakpoints::priv_DoEnableBreak() - failed to read memory");
-			return err;
-			}
-
-		aEntry.iInstruction.Copy((TUint8 *)&instruction, instSize);
-		}
-
-	TBool breakpointAlredySet = EFalse;
-	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-		{
-		if(iBreakPointList[i].iAddress == aEntry.iAddress && !iBreakPointList[i].iDisabledForStep )
-			{
-			breakpointAlredySet = ETrue;
-			break;
-			}
-		}
-	if(!breakpointAlredySet)
-		{
-		XTRAPD(r, XT_DEFAULT, err = DebugSupport::ModifyCode(threadObj, aEntry.iAddress, instSize, inst, DebugSupport::EBreakpointGlobal));
-		if(r != DebugSupport::EBreakpointGlobal)
-			{
-			err = r;
-			}
-		}
-
-	// Close the thread handle which has been opened by OpenThreadHandle
-	threadObj->Close(NULL);
-
-	return err;
-	}
-
-/**
-Public member function which clears a previously set breakpoint.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_DoClearBreak
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-
-@param aBreakId A breakpoint Id as previously returned by DoSetBreak.
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	TInt err = priv_DoClearBreak(aBreakId, aIgnoreTerminatedThreads);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Private member function which clears a previously set breakpoint, as per DoClearBreak, but
-does not serialise access.
-
-@see DoClearBreak
-
-@param aBreakId A breakpoint Id as previously returned by DoSetBreak.
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::priv_DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads)
-	{
-	LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak(0x%08x)",aBreakId);
-
-	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
-	TBreakEntry entry;
-	entry.iBreakId = aBreakId;
-	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
-
-	TInt err = KErrNone;
-	if (index >= 0)
-		{
-		//only let the agent clear the break if they have previously suspended the thread
-		//iThreadSpecific value decides whether the the iBreakPointList.Id has a thread id(TID) or the process id(PID) 
-		//the assumption here that TID = PID + 1
-		if(!TheDProcessTracker.CheckSuspended((iBreakPointList[index].iId + (iBreakPointList[index].iThreadSpecific ? 0 : 1))))
-			{
-			LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - Thread with id 0x%08x not suspended", iBreakPointList[index].iId);
-			// should be "return KErrInUse;" but not always possible, e.g. cleaning up threads which die after debugger disconnects
-			}
- 		// if this breakpoint was set in a library and that library has already been unloaded, don't try to clear it
-		if (!iBreakPointList[index].iObsoleteLibraryBreakpoint)
-			{
-			DThread* threadObj = DebugUtils::OpenThreadHandle(iBreakPointList[index].iId + (iBreakPointList[index].iThreadSpecific ? 0 : 1));
-			if (threadObj)
-				{
-				TBool needToCallCodeModifier = ETrue;
-				for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-					{
-					if (i != index)
-						{
-						if ( BreakpointsOverlap(iBreakPointList[index],iBreakPointList[i]) )
-							{
-							needToCallCodeModifier = EFalse;
-							break;
-							}
-						}
-					}
-				if(needToCallCodeModifier)
-					{
-					XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[index].iAddress));
-					if (r != KErrNone)
-						{
-						LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - restore code trap harness returned error %d",r);
-						}
-
-				if (err != KErrNone)
-						{
-						LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - restore code returned error %d",err);
-						}
-					err = (KErrNone == r) ? err : r;
-					}
-
-				// Close the thread handle opened by OpenThreadHandle
-				threadObj->Close(NULL);
-				}
-			else
-				{
-				err = KErrBadHandle;
-				}
-			}
-		
-		LOG_MSG4("D_RMD_Breakpoints::priv_DoClearBreak() - Clearing breakpoint at address: %x, err: %d, ignore terminated: %d", iBreakPointList[index].iAddress, err, aIgnoreTerminatedThreads?1:0);
-		if ((aIgnoreTerminatedThreads && KErrBadHandle == err) || KErrNone == err)
-			{
-			// if this is a temp breakpoint, just clear out the values, otherwise remove it from the list
-			err = KErrNone;
-			if (index < NUMBER_OF_TEMP_BREAKPOINTS)
-				{
-				iBreakPointList[index].Reset();
-				}
-			else
-				{
-				LOG_MSG3("D_RMD_Breakpoints::priv_DoClearBreak() - Removing breakpoint 0x%08x as breakid 0x%08x\n",index, entry.iBreakId);
-				iBreakPointList.Remove(index);
-				}			
-			}
-				
-		return err;
-		}
-
-	LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - Break Id %d not found", aBreakId);
-
-	return KErrNotFound;
-	}
-
-/**
-Public member function which modifies a previously set breakpoint.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_DoModifyBreak
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-
-@param aBreakInfo A TModifyBreakInfo describing the breakpoint properties that are wanted.
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::DoModifyBreak(TModifyBreakInfo* aBreakInfo)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock); 
-
-	// Really do the work
-	TInt err = priv_DoModifyBreak(aBreakInfo);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Private member function which modifies a previously set breakpoint, as per DoModifyBreak, but
-does not serialise access.
-
-@see DoModifyBreak
-
-@param aBreakInfo A TModifyBreakInfo describing the breakpoint properties that are wanted.
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::priv_DoModifyBreak(TModifyBreakInfo* aBreakInfo)
-	{
-	LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak()");
-
-	// Check arguments
-	if (!aBreakInfo)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() was passed a NULL argument");
-		return KErrArgument;
-		}
-
-	//User side memory is not accessible directly
-	TSetBreakInfo info;
-	TInt err = Kern::ThreadRawRead(iChannel->iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TSetBreakInfo));
-	if (err != KErrNone)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() was passed a bad argument");
-		return err;
-		}
-
-	// EThumb2EEMode breakpoints are not supported
-	if (EThumb2EEMode == info.iMode)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() - EThumb2EEMode breakpoints are not supported");
-		return KErrNotSupported;
-		}
-
-	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
-	TBreakEntry entry;
-	entry.iBreakId = (TUint32)info.iBreakId;
-	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
-	if (index < 0)
-		{
-		// Could not find the breakpoint
-		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak() - Could not find the breakpoint id 0x%08x",(TUint32)info.iBreakId);
-		return KErrNotFound;
-		}
-
-	//assert that the thread we're moving the break from is suspended
-	if(!TheDProcessTracker.CheckSuspended(iBreakPointList[index].iId))
-		{
-		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak() - Thread with id 0x%08x not suspended", iBreakPointList[index].iId);
-		return KErrInUse;
-		}
-
-	//assert that the thread we're moving the break to is suspended
-	if(!TheDProcessTracker.CheckSuspended(info.iId))
-		{
-		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak() - Thread with id 0x%08x not suspended", info.iId);
-		return KErrInUse;
-		}
-
-	// first check its not obsolete
-	if (!iBreakPointList[index].iObsoleteLibraryBreakpoint)
-		{
-		// its still a valid breakpoint
-
-		// remove the old breakpoint
-		DThread* threadObj = DebugUtils::OpenThreadHandle(iBreakPointList[index].iId);
-		if (threadObj)
-			{
-			LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak - Unsetting breakpoint at address 0x%08x",iBreakPointList[index].iAddress);
-
-			XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[index].iAddress));
-			if (r != 0)
-				{
-				LOG_MSG("Failed to construct trap handler for DebugSupport::RestoreCode");
-				}
-
-			// Close the thread handle which has been opened by OpenThreadHandle
-			threadObj->Close(NULL);
-			}
-		else
-			{
-			// Bad handle
-			LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - Could not identify the breakpoint thread id");
-			return KErrBadHandle;
-			}
-		}
-
-	// make sure there is not already a breakpoint at the new address
-	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-		{
-		// Ignore data for the breakpoint entry being modified.
-		if (i != index)
-			{
-			/* We need to check if the breakpoint overlaps the address at all,
-			 * and this depends upon the size of the two breakpoints as well as 
-			 * their address.
-			 */
-
-			// newInstSize = size in bytes of new breakpoint
-			TInt newInstSize = BreakSize(info.iMode);
-			if (newInstSize == 0)
-			{
-				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - Unknown architecture type for new breakpoint");
-				return KErrNotSupported;
-			}
-
-			// oldInstSize = size in bytes of the existing breakpoint
-			TInt oldInstSize = BreakSize(iBreakPointList[i].iMode);
-			if (oldInstSize == 0)
-			{
-				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - Unknown architecture type of existing breakpoint");
-				return KErrNotSupported;
-			}
-
-			// Overlap checking - temp is used as the new breakpoint description for checking purposes only
-			TBreakEntry temp;
-
-			temp.iAddress = info.iAddress;
-			temp.iMode = info.iMode;
-
-			// do they overlap?
-			if ( BreakpointsOverlap(temp,iBreakPointList[i]) )
-				{
-				// Yes
-				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() - New breakpoint overlaps an existing breakpoint");
-				return KErrAlreadyExists;
-				}
-			}
-		}
-
-	// Prepare iBreakPointList[index] with the new information, then set the breakpoint
-	iBreakPointList[index].iId = info.iId;
-	iBreakPointList[index].iAddress = info.iAddress;
-	iBreakPointList[index].iMode = info.iMode;
-
-	TBreakEntry& newBreakEntry = iBreakPointList[index];
-
-	// Decide the size of the breakpoint instruction
-	TUint32 inst = BreakInst(newBreakEntry.iMode);
-	TInt instSize = BreakSize(newBreakEntry.iMode);
-
-	if (inst == 0 || instSize == 0)
-		{
-		// Unsupported architecture
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - unsupported breakpoint architecture");
-		return KErrNotSupported;
-		}
-
-
-	//if thread id is 0xFFFFFFFF, then the breakpoint is not thread specific
-	if (newBreakEntry.iId != 0xFFFFFFFF)
-		{
-		newBreakEntry.iThreadSpecific = ETrue;
-		}
-
-	// Get thread id from the process that we are debugging
-	TProcessInfo * proc = NULL;
-	TUint64 threadId = NULL;
-
-	threadId = newBreakEntry.iId;
-
-	DThread* threadObj = DebugUtils::OpenThreadHandle(threadId);
-	//if we don't have the right thread id for the address, 
-	//then try with the thread id of the process that we are debugging 	
-	if (!threadObj && iChannel->iDebugProcessList.Count())
-		{
-		proc = &iChannel->iDebugProcessList[0];
-		if (proc)
-			{
-			threadId = proc->iId+1;	
-			}
-		threadObj = DebugUtils::OpenThreadHandle(threadId);
-		}
-
-	if(!threadObj)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() - bad handle. Could not identify a threadObj");
-		return KErrBadHandle;
-		}
-
-	// save the old instruction
-	TUint32 instruction;
-
-	// read the instruction at the address so we can store it in the break entry for when we clear this breakpoint
-	// trap exceptions in case the address is invalid
-	XTRAPD(r, XT_DEFAULT, err = iChannel->TryToReadMemory(threadObj, (TAny *)newBreakEntry.iAddress, (TAny *)&instruction, instSize));
-
-	//consider the leave as more important than the error code so store the leave if it's not KErrNone
-	if(KErrNone != r)
-		{
-		err = r;
-		}
-	if(KErrNone != err)
-		{
-		threadObj->Close(NULL);
-		return err;
-		}
-
-	newBreakEntry.iInstruction.Copy((TUint8 *)&instruction, instSize);
-
-	newBreakEntry.iId = threadId; //set the thread ID here 
-	LOG_MSG3("ModifyCode2 instSize:%d, inst: 0x%08x", instSize, inst);
-	XTRAPD(s, XT_DEFAULT, err = DebugSupport::ModifyCode(threadObj, newBreakEntry.iAddress, instSize, inst, DebugSupport::EBreakpointGlobal));
-	if(s != DebugSupport::EBreakpointGlobal)
-		{
-		err = s;
-		}
-
-	// Close the thread handle which has been opened by OpenThreadHandle
-	threadObj->Close(NULL);
-
-	return err;
-	}	
-
-//
-// D_RMD_Breakpoints::DoModifyProcessBreak
-//
-TInt D_RMD_Breakpoints::DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock); 
-
-	// Really do the work
-	TInt err = priv_DoModifyProcessBreak(aBreakInfo);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-	
-TInt D_RMD_Breakpoints::priv_DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo)
-	{	
-	LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak()");
-
-	// Check arguments
-	if (!aBreakInfo)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() was passed a NULL argument");
-		return KErrArgument;
-		}
-
-	//User side memory is not accessible directly
-	TSetBreakInfo info;
-	TInt err = Kern::ThreadRawRead(iChannel->iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TModifyProcessBreakInfo));
-	if (err != KErrNone)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() was passed a bad argument");
-		return err;
-		}
-
-	// EThumb2EEMode breakpoints are not supported
-	if (EThumb2EEMode == info.iMode)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - EThumb2EEMode breakpoints are not supported");
-		return KErrNotSupported;
-		}
-
-	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
-	TBreakEntry entry;
-	entry.iBreakId = (TUint32)info.iBreakId;
-	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
-	if (index < 0)
-		{
-		// Could not find the breakpoint
-		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Could not find the breakpoint id 0x%08x",(TUint32)info.iBreakId);
-		return KErrNotFound;
-		}
-
-	// first check its not obsolete
-	if (!iBreakPointList[index].iObsoleteLibraryBreakpoint)
-		{
-		// its still a valid breakpoint
-
-		// remove the old breakpoint
-		DProcess *process = DebugUtils::OpenProcessHandle(iBreakPointList[index].iId);
-		DThread* threadObj = NULL;
-		if(process)
-			{
-			threadObj = process->FirstThread();
-			if(threadObj)
-				{
-				threadObj = DebugUtils::OpenThreadHandle(threadObj->iId);
-				}
-			process->Close(NULL);
-			}
-
-		if (threadObj)
-			{
-			LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Unsetting breakpoint at address 0x%08x",iBreakPointList[index].iAddress);
-
-			XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[index].iAddress));
-			if (r != 0)
-				{
-				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Failed to construct trap handler for DebugSupport::RestoreCode");
-				}
-
-			// Close the thread handle which has been opened by OpenThreadHandle
-			threadObj->Close(NULL);
-			}
-		else
-			{
-			// Bad handle
-			LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Could not identify the breakpoint process id");
-			return KErrBadHandle;
-			}
-		}
-
-	// make sure there is not already a breakpoint at the new address
-	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-		{
-		// Ignore data for the breakpoint entry being modified.
-		if (i != index)
-			{
-			/* We need to check if the breakpoint overlaps the address at all,
-			 * and this depends upon the size of the two breakpoints as well as 
-			 * their address.
-			 */
-
-			// newInstSize = size in bytes of new breakpoint
-			TInt newInstSize = BreakSize(info.iMode);
-			if (newInstSize == 0)
-				{
-				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Unknown architecture type for new breakpoint");
-				return KErrNotSupported;
-				}
-
-			// oldInstSize = size in bytes of the existing breakpoint
-			TInt oldInstSize = BreakSize(iBreakPointList[i].iMode);
-			if (oldInstSize == 0)
-				{
-				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - : Unknown architecture type of existing breakpoint");
-				return KErrNotSupported;
-				}
-
-			// Overlap checking - temp is used as the new breakpoint description for checking purposes only
-			TBreakEntry temp;
-
-			temp.iAddress = info.iAddress;
-			temp.iMode = info.iMode;
-
-			// do they overlap?
-			if ( BreakpointsOverlap(temp,iBreakPointList[i]) )
-				{
-				// Yes
-				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - New breakpoint overlaps an existing breakpoint");
-				return KErrAlreadyExists;
-				}
-			}
-		}
-
-	// Prepare iBreakPointList[index] with the new information, then set the breakpoint
-	iBreakPointList[index].iId = info.iId;
-	iBreakPointList[index].iAddress = info.iAddress;
-	iBreakPointList[index].iMode = info.iMode;
-
-	TBreakEntry& newBreakEntry = iBreakPointList[index];
-
-	// Decide the size of the breakpoint instruction
-	TUint32 inst = BreakInst(newBreakEntry.iMode);
-	TInt instSize = BreakSize(newBreakEntry.iMode);
-
-	if (inst == 0 || instSize == 0)
-		{
-		// Unsupported architecture
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - unsupported breakpoint architecture");
-		return KErrNotSupported;
-		}
-
-	newBreakEntry.iThreadSpecific = EFalse;
-
-	DProcess* process = DebugUtils::OpenProcessHandle(newBreakEntry.iId);
-	if(!process)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - bad handle. Could not identify a process");
-		return KErrBadHandle;
-		}
-
-	DThread* threadObj = process->FirstThread();
-	if(threadObj)
-		{
-		threadObj = DebugUtils::OpenThreadHandle(threadObj->iId);
-		}
-	process->Close(NULL);
-	if(!threadObj)
-		{
-		return KErrNotFound;
-		}
-	// save the old instruction
-	TUint32 instruction;
-
-	// read the instruction at the address so we can store it in the break entry for when we clear this breakpoint
-	// trap exceptions in case the address is invalid
-	XTRAPD(r, XT_DEFAULT, err = iChannel->TryToReadMemory(threadObj, (TAny *)newBreakEntry.iAddress, (TAny *)&instruction, instSize));
-
-	//consider the leave as more important than the error code so store the leave if it's not KErrNone
-	if(KErrNone != r)
-		{
-		err = r;
-		}
-	if(KErrNone != err)
-		{
-		threadObj->Close(NULL);
-		return err;
-		}
-
-	newBreakEntry.iInstruction.Copy((TUint8 *)&instruction, instSize);
-
-	XTRAPD(s, XT_DEFAULT, err = DebugSupport::ModifyCode(threadObj, newBreakEntry.iAddress, instSize, inst, DebugSupport::EBreakpointGlobal));
-	if(s != DebugSupport::EBreakpointGlobal)
-		{
-		err = s;
-		}
-
-	// Close the thread handle which has been opened by OpenThreadHandle
-	threadObj->Close(NULL);
-
-	return err;
-	}
-
-/**
-Public member function which returns information about a previously set breakpoint.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_DoBreakInfo
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-
-@param aBreakInfo Address of aBreakInfo structure in user-side memory within the DSS client thread. CAN ONLY BE ACCESSED VIA Kern::ThreadRawRead()
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::DoBreakInfo(TGetBreakInfo* aBreakInfo)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	TInt err = priv_DoBreakInfo(aBreakInfo);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Private member function function which returns information about a previously set breakpoint..
-
-@see DoBreakInfo
-
-@param aBreakInfo Address of aBreakInfo structure in user-side memory within the DSS client thread. CAN ONLY BE ACCESSED VIA Kern::ThreadRawRead()
-@return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt D_RMD_Breakpoints::priv_DoBreakInfo(TGetBreakInfo* aBreakInfo)
-	{
-	LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo()");
-
-	if (!aBreakInfo)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() was passed a NULL argument");
-
-		return KErrArgument;
-		}
-
-	//User side memory is not accessible directly
-	TGetBreakInfo info;
-	TInt err = Kern::ThreadRawRead(iChannel->iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TGetBreakInfo));
-	if (err != KErrNone)
-		{
-		LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() was passed a bad argument");
-
-		return err;
-		}
-
-	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
-	TBreakEntry entry;
-	entry.iBreakId = (TUint32)info.iBreakId;
-	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
-	
-	if (index >=0)
-		{
-		// get the thread id for this breakpoint
-		TUint64 threadId = iBreakPointList[index].iId;
-
-		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iId,&threadId,sizeof(TUint64));
-		if (err != KErrNone)
-			{
-			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return breakpoint iThreadId information");
-			return err;
-			}
-
-		// get the threadSpecific-ness
-		TBool threadSpecific = iBreakPointList[index].iThreadSpecific;
-
-		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iThreadSpecific,&threadSpecific,sizeof(TBool));
-		if (err != KErrNone)
-			{
-			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return thread specific information");
-			return err;
-			}
-
-
-		// get the address
-		TUint32 address = iBreakPointList[index].iAddress;
-
-		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iAddress,&address,sizeof(TUint32));
-		if (err != KErrNone)
-			{
-			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return breakpoint iAddress information");
-			return err;
-			}
-
-
-		// get the architecture
-		TArchitectureMode mode = iBreakPointList[index].iMode;
-
-		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iMode,&mode,sizeof(TUint32));
-		if (err != KErrNone)
-			{
-			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return breakpoint iMode information");
-			return err;
-			}
-
-		return err;
-		}
-
-	LOG_MSG2("D_RMD_Breakpoints::priv_DoBreakInfo - Could not find the breakpoint id specified 0x%08x", entry.iBreakId);
-	return KErrNotFound;
-	}
-
-/**
-Public member function which clears all the breakpoints in the system. Generally used for shutting down
-the debug device driver.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_ClearAllBreakPoints
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-*/
-void D_RMD_Breakpoints::ClearAllBreakPoints()
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	priv_ClearAllBreakPoints();
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-	}
-
-/**
-Private member function which clears all the breakpoints in the system. Generally used for shutting down
-the debug device driver. 
-
-@see DoClearAllBreakPoints
-*/
-void D_RMD_Breakpoints::priv_ClearAllBreakPoints()
-	{
-	LOG_MSG("D_RMD_Breakpoints::priv_ClearAllBreakPoints()");
-
-	TInt err = KErrNone;
-
-	for (TInt i=0; i<iBreakPointList.Count(); i++)
-		{
-		if ((iBreakPointList[i].iAddress != 0) && !iBreakPointList[i].iObsoleteLibraryBreakpoint)
-			{
-			LOG_MSG2("D_RMD_Breakpoints::priv_ClearAllBreakPoints() - Clearing breakpoint at address %x", iBreakPointList[i].iAddress);
-			TUint32 id = iBreakPointList[i].iId + (iBreakPointList[i].iThreadSpecific ? 0 : 1);
-			DThread *threadObj = DebugUtils::OpenThreadHandle(id);
-			if (threadObj)
-				{
-				XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[i].iAddress));
-				err = (KErrNone == r) ? err : r;
-				threadObj->Close(NULL);
-				}
-			else
-				{
-				err = KErrBadHandle;
-				}
-
-			if (KErrNone != err)
-				{
-				LOG_MSG2("D_RMD_Breakpoints::priv_ClearAllBreakPoints() - Error 0x%08x while clearing breakpoint", err);
-				}
-			}
-		}
-
-	iBreakPointList.Reset();
-	}
-
-/**
-Public member function which disables the breakpoint at the specified address.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_DisableBreakAtAddress
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-
-@param aAddress Address at which to disable breakpoints (all threads)
-@return KErrNone if successful, one of the other system wide error codes otherwise.
-*/
-TInt D_RMD_Breakpoints::DisableBreakAtAddress(TUint32 aAddress)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	TInt err = priv_DisableBreakAtAddress(aAddress);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Private member function which clears all the breakpoints in the system. Generally used for shutting down
-the debug device driver. 
-
-@see DisableBreakAtAddress
-
-@param aAddress clears the breakpoint at the specified address
-@return KErrNone if successful, one of the other system wide error codes otherwise.
-*/
-TInt D_RMD_Breakpoints::priv_DisableBreakAtAddress(TUint32 aAddress)
-	{
-	LOG_MSG("D_RMD_Breakpoints::priv_DisableBreakAtAddress()");
-
-	TInt err = KErrNone;
-
-	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-		{
-		if (iBreakPointList[i].iAddress == aAddress)
-			{
-			iBreakPointList[i].iDisabledForStep = ETrue;
-			LOG_MSG2("D_RMD_Breakpoints::priv_DisableBreakAtAddress - Disabling breakpoint at address 0x%x", iBreakPointList[i].iAddress);
-
-			//clear the breakpoint with code modifier
-			//code modifier will restore the org instruction and also frees the shadow page if necessary
-			TUint64 id = iBreakPointList[i].iId + (iBreakPointList[i].iThreadSpecific ? 0 : 1);
-			DThread* threadObj = NULL;
-			if(iBreakPointList[i].iThreadSpecific)
-				{
-				threadObj = DebugUtils::OpenThreadHandle(id);
-				}
-			else
-				{
-				DProcess *process = DebugUtils::OpenProcessHandle(iBreakPointList[i].iId);
-				if(process)
-					{
-					threadObj = process->FirstThread();
-					if(threadObj)
-						{
-						if(KErrNone != threadObj->Open())
-							{
-							LOG_MSG("Couldn't open threadObj");
-							threadObj = NULL;
-							}
-						}
-					else
-						{
-						LOG_MSG("threadObj is NULL");
-						}
-					}
-				else
-					{
-					LOG_MSG("Process is NULL");
-					}
-				}
-			if (threadObj)
-				{
-				XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, aAddress));			
-				if(KErrNone != err || KErrNone != r)
-					{
-					LOG_MSG3("Error from DebugSupport::RestoreCode: r: %d, err: %d", r, err);
-					}
-				err = (KErrNone == r) ? err : r;
-				threadObj->Close(NULL);
-				}
-			else
-				{
-				err = KErrBadHandle;
-				break;
-				}
-			}
-		}
-		
-	return err;
-	}
-
-/**
-Public member function which enables previously disabled breakpoints within a given thread.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access. 
-
-@see priv_DoEnableDisabledBreak
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-
-@param aThreadId Thread in which to enable all previously disabled breakpoints
-@return KErrNone if successful, one of the system wide error codes otherwise.
-*/
-TInt D_RMD_Breakpoints::DoEnableDisabledBreak(TUint64 aThreadId)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return KErrNotReady;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	TInt err = priv_DoEnableDisabledBreak(aThreadId);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Private member function which enables previously disabled breakpoints within a given thread.
-
-@see DoEnableDisabledBreak
-
-@param aThreadId Thread in which to enable all previously disabled breakpoints
-@return KErrNone if successful, one of the system wide error codes otherwise.
-*/
-TInt D_RMD_Breakpoints::priv_DoEnableDisabledBreak(TUint64 aThreadId)
-	{
-	LOG_MSG("D_RMD_Breakpoints::priv_DoEnableDisabledBreak()");
-	DThread* thread = DebugUtils::OpenThreadHandle(aThreadId);
-	if(!thread)
-		{
-		LOG_MSG2("Thread: 0x%08x does not exist", aThreadId);
-		return KErrNotFound;
-		}
-	TUint64 processId = thread->iOwningProcess->iId;
-	thread->Close(NULL);
-
-	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-		{
-		TBool needsEnabling = EFalse;
-		if(iBreakPointList[i].iDisabledForStep)
-			{
-			if(iBreakPointList[i].iThreadSpecific)
-				{
-				needsEnabling = (aThreadId == iBreakPointList[i].iId);
-				}
-			else
-				{
-				needsEnabling = (processId == iBreakPointList[i].iId);
-				}
-			}
-		if (needsEnabling)
-			{
-			LOG_MSG2("Re-enabling breakpoint at address %x", iBreakPointList[i].iAddress);
-			TInt err = priv_DoEnableBreak(iBreakPointList[i], EFalse);
-			if(KErrNone != err)
-				{
-				LOG_MSG2("Error returned from DoEnableBreak: %d", err);
-				iBreakPointList[i].iDisabledForStep = EFalse;
-				return err;
-				}
-			}
-		}
-	
-	return KErrNone;
-	}
-
-/**
-Public member function which removes all the breakpoints within a given thread.
-
-Note 1:
-This function ensures exclusive access to the breakpoint data structures
-by using a semaphore to serialise access.
-
-@see priv_DoRemoveThreadBreaks
-
-Note 2:
-As implied by Note 1, the caller must have previously called Init() or this
-function will return KErrNotReady;
-
-@param aThreadId Thread from which to remove all existing breakpoints
-@return KErrNone if successful, one of the system wide error codes otherwise.
-*/
-void D_RMD_Breakpoints::DoRemoveThreadBreaks(TUint64 aThreadId)
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	priv_DoRemoveThreadBreaks(aThreadId);
-
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-	}
-
-/**
-Private member function which removes all the breakpoints particular to a particular thread
-
-@see DoRemoveThreadBreaks
-
-@param aThreadId Thread from which to remove all existing breakpoints
-@return KErrNone if successful, one of the system wide error codes otherwise.
-*/
-void D_RMD_Breakpoints::priv_DoRemoveThreadBreaks(TUint64 aThreadId)
-	{
-	LOG_MSG2("D_RMD_Breakpoints::priv_DoRemoveThreadBreaks(aThreadId = 0x%016lx)\n",aThreadId);
-
-	TInt err = KErrNone;
-	TUint64 threadId;
-
-	for (TInt i=iBreakPointList.Count()-1; i >= 0; i--)
-		{
-		if ((iBreakPointList[i].iAddress != 0) && !iBreakPointList[i].iObsoleteLibraryBreakpoint)
-			{
-			threadId = iBreakPointList[i].iId + (iBreakPointList[i].iThreadSpecific ? 0 : 1);
-			if (threadId == aThreadId)
-				{
-				LOG_MSG4("D_RMD_Breakpoints::priv_DoRemoveThreadBreaks() - Clearing breakpoint at address 0x%08x for thread id 0x%016lx with id 0x%08x", iBreakPointList[i].iAddress, iBreakPointList[i].iId, iBreakPointList[i].iBreakId);
-
-				err = priv_DoClearBreak(iBreakPointList[i].iBreakId, EFalse);
-
-				if (err != KErrNone)
-					{
-					LOG_MSG2("D_RMD_Breakpoints::priv_DoRemoveThreadBreaks()  - failed to remove break id 0x%08x\n",iBreakPointList[i].iBreakId);
-					return;
-					}
-				}
-			}
-		}	
-	}
-
-// Remove the process breakpoints for process with PID aProcessId in the range [aCodeAddress, aCodeAddress + aCodeSize)
-void D_RMD_Breakpoints::RemoveBreaksForProcess(TUint64 aProcessId, TUint32 aCodeAddress, TUint32 aCodeSize)
-	{
-	LOG_MSG("D_RMD_Breakpoints::RemoveBreaksForProcess()");
-	for (TInt i=iBreakPointList.Count() - 1; i>=0; i--)
-		{
-		TBreakEntry& breakEntry = iBreakPointList[i];
-		if(!breakEntry.iThreadSpecific && breakEntry.iId == aProcessId)
-			{
-			if ((breakEntry.iAddress >= aCodeAddress) && (breakEntry.iAddress < (aCodeAddress + aCodeSize)))
-				{
-				LOG_MSG2("Removing process breakpoint at address %x", (TUint32)breakEntry.iAddress);
-				TInt err = DoClearBreak(breakEntry.iBreakId, ETrue);
-				if(KErrNone != err)
-					{
-					LOG_MSG2("Error removing process breakpoint: %d", err);
-					}
-				}
-			}
-		}
-	}
-
-// mark the breakpoints in the range [aCodeAddress, aCodeAddress + aCodeSize)
-void D_RMD_Breakpoints::InvalidateLibraryBreakPoints(TUint32 aCodeAddress, TUint32 aCodeSize)
-	{
-	LOG_MSG("D_RMD_Breakpoints::InvalidateLibraryBreakPoints()");
-	for (TInt i=0; i<iBreakPointList.Count(); i++)
-		{
-		if ((iBreakPointList[i].iAddress >= aCodeAddress) && (iBreakPointList[i].iAddress < (aCodeAddress + aCodeSize)))
-			{
-			LOG_EVENT_MSG2("Disabling library breakpoint at address %x", iBreakPointList[i].iAddress);
-			iBreakPointList[i].iObsoleteLibraryBreakpoint = ETrue;
-			}
-		}
-	}
-
-TInt D_RMD_Breakpoints::BreakPointCount() const
-	{
-	return iBreakPointList.Count();
-	}
-
-/**
-  Gets next breakpoint in list.
-  @param aBreakEntry The break entry to get the successor of. If NULL then returns the first entry.
-  @return A pointer to the next break entry, or NULL if the end of the list has been reached
-  */
-TBreakEntry* D_RMD_Breakpoints::GetNextBreak(const TBreakEntry* aBreakEntry) const
-	{
-	if(!aBreakEntry)
-		{
-		return (TBreakEntry*)&(iBreakPointList[0]);
-		}
-	TInt index = iBreakPointList.FindInSignedKeyOrder(*aBreakEntry) + 1;
-	return (index < BreakPointCount()) ? (TBreakEntry*)&(iBreakPointList[index]) : NULL;
-	}
-
-TBool D_RMD_Breakpoints::IsTemporaryBreak(const TBreakEntry& aBreakEntry) const
-	{
-	// Ensure we have a valid semaphore
-	if (!iInitialised || !iLock)
-		{
-		return EFalse;
-		}
-
-	// Acquire the lock
-	NKern::ThreadEnterCS();
-	Kern::SemaphoreWait(*iLock);
-
-	// Really do the work
-	TBool tempBreak = priv_IsTemporaryBreak(aBreakEntry);
-	
-	// Release the lock
-	Kern::SemaphoreSignal(*iLock);
-	NKern::ThreadLeaveCS();
-	
-	return tempBreak;
-	}
-
-/**
-Private member function which tells us if a breakpoint is temporary
-
-@see IsTemporaryBreak
-
-@param aBreakEntry
-@return TBool indicating if the break is temporary or not
-*/
-TBool D_RMD_Breakpoints::priv_IsTemporaryBreak(const TBreakEntry& aBreakEntry) const 
-	{
-	return aBreakEntry.iBreakId < NUMBER_OF_TEMP_BREAKPOINTS;
-	}
-
-
-// End of file - d_rmd_breakpoints.cpp
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-// Copyright (c) 2004-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:
-//
-// Description:
-// Refactored class containing breakpoint related code from rm_debug_kerneldriver.cpp
-//
-
-
-
-/**
- @file
- @internalComponent
- @released
-*/
-
-#ifndef D_RMD_BREAKPOINTS_H
-#define D_RMD_BREAKPOINTS_H
-
-#include <rm_debug_api.h>
-#include <kernel/kern_priv.h>
-#include "rm_debug_kerneldriver.h"
-
-// fwd declaration of friend classes needed due to re-factoring
-class DRM_DebugChannel;
-
-class DRMDStepper;
-
-//
-// Macros
-//
-const TUint32 KArmBreakPoint = 0xE7F123F4;
-const TUint16 KThumbBreakPoint = 0xDE56;
-const TUint16 KT2EEBreakPoint = 0xC100;	// From ARM ARM DDI0406A, section A9.2.1 Undefined instruction encoding for Thumb2-EE.
-
-#define NUMBER_OF_TEMP_BREAKPOINTS 10
-
-#define NUMBER_OF_MAX_BREAKPOINTS 100
-
-//
-// class TBreakEntry
-//
-class TBreakEntry
-{
-public:
-
-	inline TBreakEntry() { Reset(); };
-
-	inline TBreakEntry(Debug::TBreakId aBreakId, TUint64 aId, TBool aThreadSpecific, TUint32 aAddress, Debug::TArchitectureMode aMode)
-			: iBreakId(aBreakId),
-			  iId(aId),
-			  iAddress(aAddress),
-			  iMode(aMode),
-			  iThreadSpecific(aThreadSpecific)
-	{
-		 iInstruction.FillZ(4);
-		 iPageAddress = 0;
-		 iDisabledForStep = EFalse;
-		 iObsoleteLibraryBreakpoint = EFalse;
-		 iResumeOnceOutOfRange = EFalse;
-		 iSteppingInto = EFalse;
-		 iRangeStart = 0;
-		 iRangeEnd = 0;
-		 iStepTarget = EFalse;
-		 iNumSteps = 0;
-	};
-	
-	inline void Reset()
-	{
-		 iId = 0;
-		 iAddress = 0;
-		 iMode = Debug::EArmMode;
-		 iInstruction.FillZ(4);
-		 iPageAddress = 0;
-		 iDisabledForStep = EFalse;
-		 iObsoleteLibraryBreakpoint = EFalse;
-		 iResumeOnceOutOfRange = EFalse;
-		 iSteppingInto = EFalse;
-		 iRangeStart = 0;
-		 iRangeEnd = 0;
-		 iStepTarget = EFalse;
-		 iNumSteps = 0;
-	};
-
-public:
-	// Unique Id for this breakpoint. Assigned by D_RMD_Breakpoints::DoSetBreak(). @see D_RMD_Breakpoints::DoSetBreak
-	TInt32		iBreakId;
-	// Consider making the iId into a union of TProcessId, TThreadId, global etc. to make things more obvious
-	// Object Id in which this breakpoint should operate.
-	TUint64		iId;
-	// Address at which this breakpoint should operate
-	TUint32		iAddress;
-	// CPU ISA which this breakpoint uses, e.g. EArmMode/EThumbMode.
-	Debug::TArchitectureMode iMode;
-	// The original instruction which was stored at iAddress.
-	TBuf8<4>	iInstruction;
-	TUint32		iPageAddress;   //not used: BC if we remove it
-
-	// Indicates whether this breakpoint has been temporarily replaced with original instruction to enable step-off this breakpoint
-	TBool		iDisabledForStep;
-	/* This is used when libraries and processes are removed, so that
-	 * the driver can say 'ok' when requested to remove breakpoints
-	 * that existed in these cases, rather than 'Not Found'.
-	 *
-	 * Its not logical, but its a BC break if we change it :-(
-	 */
-	TBool		iObsoleteLibraryBreakpoint;
-	// Indicates whether this thread should be resumed after stepping off this breakpoint
-	TBool		iResumeOnceOutOfRange;
-	TBool		iSteppingInto;
-	TUint32		iRangeStart;
-	TUint32		iRangeEnd;
-	TBool		iThreadSpecific;
-	TBool		iStepTarget;
-
-	// Indicates how many more instruction steps should occur after hitting this breakpoint
-	TInt		iNumSteps;
-};
-/**
-@internalTechnology
-
-This class encapsulates all the data concerning run-mode and stop mode breakpoints
-as understood by the run-mode and stop-mode debug system.
-
-Note:                                                                        
-	The internal list of breakpoints is currently divided into two sections. The range from
-	0...NUMBER_OF_TEMP_BREAKPOINTS is used internally by the debug driver for implementing
-	stepping. The range from NUMBER_OF_TEMP_BREAKPOINTS to NUMBER_OF_MAX_BREAKPOINTS is used
-	to store information about breakpoints set by the client debug agents.
-                                                                                                                                                            
-	In future, this should change, so that each breakpoint knows what kind of breakpoint it
-	is (user/temp etc).
-
-
-*/
-class D_RMD_Breakpoints : public DBase
-{
-public:
-	D_RMD_Breakpoints(DRM_DebugChannel* aChannel);
-	~D_RMD_Breakpoints();
-
-	TInt Init();
-
-	// from rm_debug_driver.h
-	TInt DoSetBreak(TInt32 &aBreakId, const TUint64 aId, const TBool aThreadSpecific, const TUint32 aAddress, const Debug::TArchitectureMode aMode );
-	TInt DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction);
-	TInt DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads=EFalse);
-	TInt DoModifyBreak(TModifyBreakInfo* aBreakInfo);
-	TInt DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo);
-	TInt DoBreakInfo(TGetBreakInfo* aBreakInfo);
-	void ClearAllBreakPoints();
-	TInt DisableBreakAtAddress(TUint32 aAddress);
-	TInt DoEnableDisabledBreak(TUint64 aThreadId);
-
-	void DoRemoveThreadBreaks(TUint64 aThreadId);
-	void RemoveBreaksForProcess(TUint64 aProcessId, TUint32 aCodeAddress, TUint32 aCodeSize);
-	void InvalidateLibraryBreakPoints(TUint32 aCodeAddress, TUint32 aCodeSize);
-	TInt BreakPointCount() const;
-	TBreakEntry* GetNextBreak(const TBreakEntry* aBreakEntry) const;
-	TBool IsTemporaryBreak(const TBreakEntry& aBreakEntry) const;
-
-	TInt DoGetBreakList(TUint32* aBuffer, const TUint32 aBufSize, const TUint32 aElement, TUint32& aLastElement);
-
-	// Useful helper functions for debugging breakpoint issues
-	inline void print_BreakpointsDisabledForStep();
-	inline void print_BreakpointsList();
-
-private:
-	// Locked versions of public functions
-	TInt priv_DoSetBreak(TInt32 &aBreakId, const TUint64 aId,  const TBool aThreadSpecific, const TUint32 aAddress, const Debug::TArchitectureMode aMode );
-	TInt priv_DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction);
-	TInt priv_DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads);
-	TInt priv_DoModifyBreak(TModifyBreakInfo* aBreakInfo);
-	TInt priv_DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo);
-	TInt priv_DoBreakInfo(TGetBreakInfo* aBreakInfo);	
-	TInt priv_DisableBreakAtAddress(TUint32 aAddress);
-	TInt priv_DoEnableDisabledBreak(TUint64 aThreadId);
-	void priv_DoRemoveThreadBreaks(TUint64 aThreadId);
-	void priv_ClearAllBreakPoints();
-	TBool priv_IsTemporaryBreak(const TBreakEntry& aBreakEntry) const;
-
-	// helper functions
-	TBool Aligned(TUint32 aAddress, Debug::TArchitectureMode aMode);
-	TInt BreakSize(Debug::TArchitectureMode aMode);
-	TBool BreakpointsOverlap(TBreakEntry& aFirst, TBreakEntry& aSecond);
-	TUint32 BreakInst(Debug::TArchitectureMode aMode);
-
-private:
-	RArray<TBreakEntry> iBreakPointList;
-	TInt iNextBreakId;
-
-	DRM_DebugChannel* iChannel;	// temporary reference back to DRM_DebugChannel to help with refactoring
-
-	/* Protect access to the breakpoint list with a DSemaphore
-	 *
-	 * This means that stop-mode debuggers know when the list is being updated by the run-mode debug subsystem.
-	 */
-	DSemaphore* iLock;
-
-	TBool iInitialised;
-};
-
-#include "d_rmd_breakpoints_debug.inl" 
-
-#endif
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints_debug.inl	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 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:
-//
-// Description:
-//
-
-#include "debug_logging.h"
-
-// Print breakpoints disabled for stepping
-inline void D_RMD_Breakpoints::print_BreakpointsDisabledForStep()
-	{
-	for (TInt i = 0; i < iBreakPointList.Count(); i++)
-		{
-		if(iBreakPointList[i].iDisabledForStep)
-			{
-				LOG_MSG2("Breakpoint disabled for stepping: iBreakPointList[%d]", i);
-				LOG_MSG4("iBreakId = %x, iId = %d, iAddress = %x", iBreakPointList[i].iBreakId, iBreakPointList[i].iId, iBreakPointList[i].iAddress );
-			}
-		}
-	}
-
-// Print breakpoint list
-inline void D_RMD_Breakpoints::print_BreakpointsList()
-	{
-	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
-		{
-			LOG_MSG2("Breakpoint list: iBreakPointList[%d]", i);
-			LOG_MSG4("iBreakId = %x, iId = %d, iAddress = %x", iBreakPointList[i].iBreakId, iBreakPointList[i].iId, iBreakPointList[i].iAddress );
-		}
-	}
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1884 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-// This file contains stepping code refactored from rm_debug_kerneldriver.cpp/rm_debug_kerneldriver.h
-//
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <kernel/kernel.h> 
-#include <kernel/kern_priv.h>
-#include <nk_trace.h>
-#include <arm.h>
-#include <rm_debug_api.h>
-
-#include "d_rmd_stepping.h"
-#include "d_rmd_breakpoints.h"
-#include "rm_debug_kerneldriver.h"	// needed to access DRM_DebugChannel
-#include "rm_debug_driver.h"
-#include "debug_logging.h"
-
-using namespace Debug;
-
-//
-// DRMDStepping::DRMDStepping
-//
-DRMDStepping::DRMDStepping(DRM_DebugChannel* aChannel)
-:
-	iChannel(aChannel)
-	{
-	// to do
-	}
-
-//
-// DRMDStepping::~DRM_DebugChannel
-//
-DRMDStepping::~DRMDStepping()
-	{
-	// to do
-	}
-
-//
-// DRMDStepping::IsExecuted
-//
-TBool DRMDStepping::IsExecuted(TUint8 aCondition ,TUint32 aStatusRegister)
-	{
-	LOG_MSG("DRMDStepping::IsExecuted()");
-
-	TBool N = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000008;
-	TBool Z = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000004;
-	TBool C = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000002;
-	TBool V = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000001;
-
-	switch(aCondition)
-		{
-		case 0:
-			return Z;
-		case 1:
-			return !Z;
-		case 2:
-			return C;
-		case 3:
-			return !C;
-		case 4:
-			return N;
-		case 5:
-			return !N;
-		case 6:
-			return V;
-		case 7:
-			return !V;
-		case 8:
-			return (C && !Z);
-		case 9:
-			return (!C || Z);
-		case 10:
-			return (N == V);
-		case 11:
-			return (N != V);
-		case 12:
-			return ((N == V) && !Z);
-		case 13:
-			return (Z || (N != V));
-		case 14:
-		case 15:
-			return ETrue;
-		}
-	
-	return EFalse;
-	}
-
-//
-// DRMDStepping::IsPreviousInstructionMovePCToLR
-//
-TBool DRMDStepping::IsPreviousInstructionMovePCToLR(DThread *aThread)
-	{
-	LOG_MSG("DRMDStepping::IsPreviousInstructionMovePCToLR()");
-
-	TInt err = KErrNone;
-	
-	// there are several types of instructions that modify the PC that aren't
-	// designated as linked or non linked branches.  the way gcc generates the
-	// code can tell us whether or not these instructions are to be treated as
-	// linked branches.  the main cases are bx and any type of mov or load or
-	// arithmatic operation that changes the PC.  if these are really just
-	// function calls that will return, gcc will generate a mov	lr, pc
-	// instruction as the previous instruction.  note that this is just for arm
-	// and armi
-	
-	// get the address of the previous instruction
-	TUint32 address = 0;
-	err = iChannel->ReadKernelRegisterValue(aThread, PC_REGISTER, address);
-	if(err != KErrNone)
-		{
-		LOG_MSG2("Non-zero error code discarded: %d", err);
-		}
-	address -= 4;
-
-	TBuf8<4> previousInstruction;
-	err = iChannel->DoReadMemory(aThread, address, 4, previousInstruction);
-	if (KErrNone != err)
-		{
-		LOG_MSG2("Error %d reading memory at address %x", address);
-		return EFalse;
-		}
-
-	const TUint32 movePCToLRIgnoringCondition = 0x01A0E00F;
-
-	TUint32 inst = *(TUint32 *)previousInstruction.Ptr();
-	
-	if ((inst & 0x0FFFFFFF) == movePCToLRIgnoringCondition)
-		{
-		return ETrue;
-		}
-		
-	return EFalse;
-	}
-
-//
-// DRMDStepping::DecodeDataProcessingInstruction
-//
-void DRMDStepping::DecodeDataProcessingInstruction(TUint8 aOpcode, TUint32 aOp1, TUint32 aOp2, TUint32 aStatusRegister, TUint32 &aBreakAddress)
-	{
-	LOG_MSG("DRMDStepping::DecodeDataProcessingInstruction()");
-
-	switch(aOpcode)
-		{
-		case 0:
-			{
-			// AND
-			aBreakAddress = aOp1 & aOp2;
-			break;
-			}
-		case 1:
-			{
-			// EOR
-			aBreakAddress = aOp1 ^ aOp2;
-			break;
-			}
-		case 2:
-			{
-			// SUB
-			aBreakAddress = aOp1 - aOp2;
-			break;
-			}
-		case 3:
-			{
-			// RSB
-			aBreakAddress = aOp2 - aOp1;
-			break;
-			}
-		case 4:
-			{
-			// ADD
-			aBreakAddress = aOp1 + aOp2;
-			break;
-			}
-		case 5:
-			{
-			// ADC
-			aBreakAddress = aOp1 + aOp2 + (aStatusRegister & arm_carry_bit()) ? 1 : 0;
-			break;
-			}
-		case 6:
-			{
-			// SBC
-			aBreakAddress = aOp1 - aOp2 - (aStatusRegister & arm_carry_bit()) ? 0 : 1;
-			break;
-			}
-		case 7:
-			{
-			// RSC
-			aBreakAddress = aOp2 - aOp1 - (aStatusRegister & arm_carry_bit()) ? 0 : 1;
-			break;
-			}
-		case 12:
-			{
-			// ORR
-			aBreakAddress = aOp1 | aOp2;
-			break;
-			}
-		case 13:
-			{
-			// MOV
-			aBreakAddress = aOp2;
-			break;
-			}
-		case 14:
-			{
-			// BIC
-			aBreakAddress = aOp1 & ~aOp2;
-			break;
-			}
-		case 15:
-			{
-			// MVN
-			aBreakAddress = ~aOp2;
-			break;
-			}
-		}
-	}
-
-//
-// DRMDStepping::CurrentInstruction
-//
-// Returns the current instruction bitpattern (either 32-bits or 16-bits) if possible
-TInt DRMDStepping::CurrentInstruction(DThread* aThread, TUint32& aInstruction)
-	{
-	LOG_MSG("DRMDStepping::CurrentInstruction");
-
-	// What is the current PC?
-	TUint32 pc;	
-	ReturnIfError(CurrentPC(aThread,pc));
-
-	// Read it one byte at a time to ensure alignment doesn't matter
-	TUint32 inst = 0;
-	for(TInt i=3;i>=0;i--)
-		{
-
-		TBuf8<1> instruction;
-		TInt err = iChannel->DoReadMemory(aThread, (pc+i), 1, instruction); 
-		if (KErrNone != err)
-			{
-			LOG_MSG2("DRMDStepping::CurrentInstruction : Failed to read memory at current PC: return 0x%08x",pc);
-			return err;
-			}
-
-		inst = (inst << 8) | (*(TUint8 *)instruction.Ptr());
-		}
-
-	aInstruction = inst;
-
-	LOG_MSG2("DRMDStepping::CurrentInstruction 0x%08x", aInstruction);
-
-	return KErrNone;
-	}
-
-//
-// DRMDStepping::CurrentArchMode
-//
-// Determines architecture mode from the supplied cpsr
-TInt DRMDStepping::CurrentArchMode(const TUint32 aCpsr, Debug::TArchitectureMode& aMode)
-	{
-// Thumb2 work will depend on having a suitable cpu architecture to compile for...
-#ifdef ECpuJf
-	// State table as per ARM ARM DDI0406A, section A.2.5.1
-	if(aCpsr & ECpuJf)
-		{
-		if (aCpsr & ECpuThumb)
-			{
-			// ThumbEE (Thumb2)
-			aMode = Debug::EThumb2EEMode;
-			}
-		else
-			{
-			// Jazelle mode - not supported
-			return KErrNotSupported;
-			}
-		}
-	else
-#endif
-		{
-		if (aCpsr & ECpuThumb)
-			{
-			// Thumb mode
-			aMode = Debug::EThumbMode;
-			}
-		else
-			{
-			// ARM mode
-			aMode = Debug::EArmMode;
-			}
-		}
-
-	return KErrNone;
-	}
-
-//
-// DRMDStepping::PCAfterInstructionExecutes
-//
-// Note, this function pretty much ignores all the arguments except for aThread.
-// The arguments continue to exist so that the function has the same prototype as
-// the original from Nokia. In the long term this function will be re-factored
-// to remove obsolete parameters.
-//
-TUint32 DRMDStepping::PCAfterInstructionExecutes(DThread *aThread, TUint32 aCurrentPC, TUint32 aStatusRegister, TInt aInstSize, /*TBool aStepInto,*/ TUint32 &aNewRangeEnd, TBool &aChangingModes)
-	{
-	LOG_MSG("DRMDStepping::PCAfterInstructionExecutes()");
-
-	// by default we will set the breakpoint at the next instruction
-	TUint32 breakAddress = aCurrentPC + aInstSize;
-
-	TInt err = KErrNone;
-
-	// determine the architecture
-	TUint32 cpuid;
-	asm("mrc p15, 0, cpuid, c0, c0, 0 ");
-	LOG_MSG2("DRMDStepping::PCAfterInstructionExecutes() - cpuid = 0x%08x\n",cpuid);
-
-	cpuid >>= 8;
-	cpuid &= 0xFF;
-
-	// determine the architecture mode for the current instruction
-	TArchitectureMode mode = EArmMode;	// Default assumption is ARM 
-
-	// Now we must examine the CPSR to read the T and J bits. See ARM ARM DDI0406A, section B1.3.3
-	TUint32 cpsr;
-
-	ReturnIfError(CurrentCPSR(aThread,cpsr));
-	LOG_MSG2("DRMDStepping::PCAfterInstructionExecutes() - cpsr = 0x%08x\n",cpsr);
-
-	// Determine the mode
-	ReturnIfError(CurrentArchMode(cpsr,mode));
-
-	// Decode instruction based on current CPU mode
-	switch(mode)
-		{
-		case Debug::EArmMode:
-			{
-			// Obtain the current instruction bit pattern
-			TUint32 inst;
-			ReturnIfError(CurrentInstruction(aThread,inst));
-			
-			LOG_MSG2("Current instruction: %x", inst);
-
-			// check the conditions to see if this will actually get executed
-			if (IsExecuted(((inst>>28) & 0x0000000F), aStatusRegister)) 
-				{
-				switch(arm_opcode(inst)) // bits 27-25
-					{
-					case 0:
-						{
-						switch((inst & 0x00000010) >> 4) // bit 4
-							{
-							case 0:
-								{
-								switch((inst & 0x01800000) >> 23) // bits 24-23
-									{
-									case 2:
-										{
-										// move to/from status register.  pc updates not allowed
-										// or TST, TEQ, CMP, CMN which don't modify the PC
-										break;
-										}
-									default:
-										{
-										// Data processing immediate shift
-										if (arm_rd(inst) == PC_REGISTER)
-											{
-											TUint32 rn = aCurrentPC + 8;
-											if (arm_rn(inst) != PC_REGISTER) // bits 19-16
-												{
-												err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), rn);
-												if(err != KErrNone)
-													{
-													LOG_MSG2("Non-zero error code discarded: %d", err);
-													}
-												}
-
-											TUint32 shifter = ShiftedRegValue(aThread, inst, aCurrentPC, aStatusRegister);
-
-											DecodeDataProcessingInstruction(((inst & 0x01E00000) >> 21), rn, shifter, aStatusRegister, breakAddress);
-											}
-										break;
-										}
-									}
-								break;
-								}
-							case 1:
-								{
-								switch((inst & 0x00000080) >> 7) // bit 7
-									{
-									case 0:
-										{
-										switch((inst & 0x01900000) >> 20) // bits 24-23 and bit 20
-											{
-											case 0x10:
-												{
-												// from figure 3-3
-												switch((inst & 0x000000F0) >> 4) // bits 7-4
-													{
-													case 1:
-														{
-														if (((inst & 0x00400000) >> 22) == 0) // bit 22
-															{
-															// BX
-															// this is a strange case.  normally this is used in the epilogue to branch the the link
-															// register.  sometimes it is used to call a function, and the LR is stored in the previous
-															// instruction.  since what we want to do is different for the two cases when stepping over,
-															// we need to read the previous instruction to see what we should do
-															err = iChannel->ReadKernelRegisterValue(aThread, (inst & 0x0000000F), breakAddress);
-															if(err != KErrNone)
-																{
-																LOG_MSG2("Non-zero error code discarded: %d", err);
-																}
-
-															if ((breakAddress & 0x00000001) == 1)
-																{
-																aChangingModes = ETrue;
-																}
-
-															breakAddress &= 0xFFFFFFFE;
-															}
-														break;
-														}
-													case 3:
-														{
-														// BLX
-															{
-															err = iChannel->ReadKernelRegisterValue(aThread, (inst & 0x0000000F), breakAddress);
-															if(err != KErrNone)
-																{
-																LOG_MSG2("Non-zero error code discarded: %d", err);
-																}
-
-															if ((breakAddress & 0x00000001) == 1)
-																{
-																aChangingModes = ETrue;
-																}
-															
-															breakAddress &= 0xFFFFFFFE;
-															}
-														break;
-														}
-													default:
-														{
-														// either doesn't modify the PC or it is illegal to
-														break;
-														}
-													}
-												break;
-												}
-											default:
-												{
-												// Data processing register shift
-												if (((inst & 0x01800000) >> 23) == 2) // bits 24-23
-													{
-													// TST, TEQ, CMP, CMN don't modify the PC
-													}
-												else if (arm_rd(inst) == PC_REGISTER)
-													{
-													// destination register is the PC
-													TUint32 rn = aCurrentPC + 8;
-													if (arm_rn(inst) != PC_REGISTER) // bits 19-16
-														{
-														err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), rn);
-														if(err != KErrNone)
-															{
-															LOG_MSG2("Non-zero error code discarded: %d", err);
-															}
-														}
-													
-													TUint32 shifter = ShiftedRegValue(aThread, inst, aCurrentPC, aStatusRegister);
-													
-													DecodeDataProcessingInstruction(((inst & 0x01E00000) >> 21), rn, shifter, aStatusRegister, breakAddress);
-													}
-												break;
-												}
-											}
-										break;
-										}
-									default:
-										{
-										// from figure 3-2, updates to the PC illegal
-										break;
-										}
-									}
-								break;
-								}
-							}
-						break;
-						}
-					case 1:
-						{
-						if (((inst & 0x01800000) >> 23) == 2) // bits 24-23
-							{
-							// cannot modify the PC
-							break;
-							}
-						else if (arm_rd(inst) == PC_REGISTER)
-							{
-							// destination register is the PC
-							TUint32 rn;
-							err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), rn); // bits 19-16
-							if(err != KErrNone)
-								{
-								LOG_MSG2("Non-zero error code discarded: %d", err);
-								}
-							TUint32 shifter = ((arm_data_imm(inst) >> arm_data_rot(inst)) | (arm_data_imm(inst) << (32 - arm_data_rot(inst)))) & 0xffffffff;
-
-							DecodeDataProcessingInstruction(((inst & 0x01E00000) >> 21), rn, shifter, aStatusRegister, breakAddress);
-							}
-						break;
-						}
-					case 2:
-						{
-						// load/store immediate offset
-						if (arm_load(inst)) // bit 20
-							{
-							// loading a register from memory
-							if (arm_rd(inst) == PC_REGISTER)
-								{
-								// loading the PC register
-								TUint32 base;
-								err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), base);
-								if(err != KErrNone)
-									{
-									LOG_MSG2("Non-zero error code discarded: %d", err);
-									}
-
-								/* Note: At runtime the PC would be 8 further on
-								 */
-								if (arm_rn(inst) == PC_REGISTER)
-									{
-									base = aCurrentPC + 8;
-									}
-
-								TUint32 offset = 0;
-
-								if (arm_single_pre(inst))
-									{
-									// Pre-indexing
-									offset = arm_single_imm(inst);
-
-									if (arm_single_u(inst))
-										{
-										base += offset;
-										}
-									else
-										{
-										base -= offset;
-										}
-									}
-
-								TBuf8<4> destination;
-								err = iChannel->DoReadMemory(aThread, base, 4, destination);
-								
-								if (KErrNone == err)
-									{
-									breakAddress = *(TUint32 *)destination.Ptr();
-
-									if ((breakAddress & 0x00000001) == 1)
-										{
-										aChangingModes = ETrue;
-										}
-									breakAddress &= 0xFFFFFFFE;
-									}
-								else
-									{
-									LOG_MSG("Error reading memory in decoding step instruction");
-									}
-								}
-							}
-						break;
-						}
-					case 3:
-						{
-						if (((inst & 0xF0000000) != 0xF0000000) && ((inst & 0x00000010) == 0))
-							{
-							// load/store register offset
-							if (arm_load(inst)) // bit 20
-								{
-								// loading a register from memory
-								if (arm_rd(inst) == PC_REGISTER)
-									{
-									// loading the PC register
-									TUint32 base = 0;
-									if(arm_rn(inst) == PC_REGISTER)
-										{
-										base = aCurrentPC + 8;
-										}
-									else
-										{
-										err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), base);
-										if(err != KErrNone)
-											{
-											LOG_MSG2("Non-zero error code discarded: %d", err);
-											}
-										}
-
-									TUint32 offset = 0;
-
-									if (arm_single_pre(inst))
-										{
-										offset = ShiftedRegValue(aThread, inst, aCurrentPC, aStatusRegister);
-
-										if (arm_single_u(inst))
-											{
-											base += offset;
-											}
-										else
-											{
-											base -= offset;
-											}
-										}
-
-									TBuf8<4> destination;
-									err = iChannel->DoReadMemory(aThread, base, 4, destination);
-
-									if (KErrNone == err)
-										{
-										breakAddress = *(TUint32 *)destination.Ptr();
-
-										if ((breakAddress & 0x00000001) == 1)
-											{
-											aChangingModes = ETrue;
-											}
-										breakAddress &= 0xFFFFFFFE;
-										}
-									else
-										{
-										LOG_MSG("Error reading memory in decoding step instruction");
-										}
-									}
-								}
-							}
-						break;
-						}
-					case 4:
-						{
-						if ((inst & 0xF0000000) != 0xF0000000)
-							{
-							// load/store multiple
-							if (arm_load(inst)) // bit 20
-								{
-								// loading a register from memory
-								if (((inst & 0x00008000) >> 15))
-									{
-									// loading the PC register
-									TInt offset = 0;	
-									if (arm_block_u(inst))
-										{
-										TUint32 reglist = arm_block_reglist(inst);
-										offset = iChannel->Bitcount(reglist) * 4 - 4;
-										if (arm_block_pre(inst))
-											offset += 4;
-										}
-									else if (arm_block_pre(inst))
-										{
-										offset = -4;
-										}
-
-									TUint32 temp = 0;
-									err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), temp);
-									if(err != KErrNone)
-										{
-										LOG_MSG2("Non-zero error code discarded: %d", err);
-										}
-
-									temp += offset;
-
-									TBuf8<4> destination;
-									err = iChannel->DoReadMemory(aThread, temp, 4, destination);
-
-									if (KErrNone == err)
-										{
-										breakAddress = *(TUint32 *)destination.Ptr();
-										if ((breakAddress & 0x00000001) == 1)
-											{
-											aChangingModes = ETrue;
-											}
-										breakAddress &= 0xFFFFFFFE;
-										}
-									else
-										{
-										LOG_MSG("Error reading memory in decoding step instruction");
-										}
-									}
-								}
-							}
-						break;
-						}
-					case 5:
-						{
-						if ((inst & 0xF0000000) == 0xF0000000)
-							{
-							// BLX
-							breakAddress = (TUint32)arm_instr_b_dest(inst, aCurrentPC);
-
-							// Unconditionally change into Thumb mode
-							aChangingModes = ETrue;
-							breakAddress &= 0xFFFFFFFE;
-							}
-						else
-							{
-							if ((inst & 0x01000000)) // bit 24
-								{
-								// BL
-									breakAddress = (TUint32)arm_instr_b_dest(inst, aCurrentPC);
-								}
-							else
-								{
-								// B
-								breakAddress = (TUint32)arm_instr_b_dest(inst, aCurrentPC);
-								}
-							}
-						break;
-						} // case 5
-					} //switch(arm_opcode(inst)) // bits 27-25
-				} // if (IsExecuted(((inst>>28) & 0x0000000F), aStatusRegister)) 
-			} // case Debug::EArmMode:
-		break;
-
-		case Debug::EThumbMode:
-			{
-			// Thumb Mode
-			//
-			// Notes: This now includes the extra code
-			// required to decode V6T2 instructions
-			
-			LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Thumb Instruction");
-
-			TUint16 inst;
-
-			// Obtain the current instruction bit pattern
-			TUint32 inst32;
-			ReturnIfError(CurrentInstruction(aThread,inst32));
-
-			inst = static_cast<TUint16>(inst32 & 0xFFFF);
-
-			LOG_MSG2("Current Thumb instruction: 0x%x", inst);
-
-			// v6T2 instructions
-
-			// Note: v6T2 decoding is only enabled for DEBUG builds or if using an
-			// an ARM_V6T2 supporting build system. At the time of writing, no
-			// ARM_V6T2 supporting build system exists, so the stepping code cannot
-			// be said to be known to work. Hence it is not run for release builds
-
-			TBool use_v6t2_decodings = EFalse;
-
-#if defined(DEBUG) || defined(__ARMV6T2__)
-			use_v6t2_decodings = ETrue;
-#endif
-			// coverity[dead_error_line]
-			if (use_v6t2_decodings)
-				{
-				// 16-bit encodings
-
-				// A6.2.5 Misc 16-bit instructions
-				// DONE Compare and branch on zero (page A8-66)
-				// If then hints
-
-				// ARM ARM DDI0406A - section A8.6.27 CBNZ, CBZ
-				//
-				// Compare and branch on Nonzero and Compare and Branch on Zero.
-				if ((inst & 0xF500) == 0xB100)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.27 CBNZ, CBZ");
-
-					// Decoding as per ARM ARM description
-					TUint32 op = (inst & 0x0800) >> 11;
-					TUint32 i = (inst & 0x0200) >> 9;
-					TUint32 imm5 = (inst & 0x00F8) >> 3;
-					TUint32 Rn = inst & 0x0007;
-
-					TUint32 imm32 = (i << 6) | (imm5 << 1);
-
-					// Obtain value for register Rn
-					TUint32 RnVal = 0;
-					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
-
-					if (op)
-						{
-						// nonzero
-						if (RnVal != 0x0)
-							{
-							// Branch
-							breakAddress = aCurrentPC + imm32;
-							}
-						}
-					else
-						{
-						// zero
-						if (RnVal == 0x0)
-							{
-							// Branch
-							breakAddress = aCurrentPC + imm32;
-							}
-						}
-				}
-
-				// ARM ARM DDI0406A - section A8.6.50 IT
-				//
-				// If Then instruction
-				if ((inst & 0xFF00) == 0xBF00)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.50 IT");
-
-					// Decoding as per ARM ARM description
-					TUint32 firstcond = inst & 0x00F0 >> 4;
-					TUint32 mask = inst & 0x000F;
-
-					if (firstcond == 0xF)
-						{
-						// unpredictable
-						LOG_MSG("ARM ARM DDI0406A - section A8.6.50 IT - Unpredictable");
-						break;
-						}
-
-					if ((firstcond == 0xE) && (BitCount(mask) != 1))
-						{
-						// unpredictable
-						LOG_MSG("ARM ARM DDI0406A - section A8.6.50 IT - Unpredictable");
-						break;
-						}
-
-					// should check if 'in-it-block'
-					LOG_MSG("Cannot step IT instructions.");
-
-					// all the conds are as per Table A8-1 (i.e. the usual 16 cases)
-					// no idea how to decode the it block 'after-the-fact'
-					// so probably need to treat instructions in the it block
-					// as 'may' be executed. So breakpoints at both possible locations
-					// depending on whether the instruction is executed or not.
-
-					// also, how do we know if we have hit a breakpoint whilst 'in' an it block?
-					// can we check the status registers to find out?
-					//
-					// see arm arm page 390.
-					//
-					// seems to depend on the itstate field. this also says what the condition code
-					// actually is, and how many instructions are left in the itblock.
-					// perhaps we can just totally ignore this state, and always do the two-instruction
-					// breakpoint thing? Not if there is any possibility that the address target
-					// would be invalid for the non-taken branch address...
-					}
-
-
-				// 32-bit encodings.
-				//
-
-				// Load word A6-23
-				// Data processing instructions a6-28
-				// 
-
-				// ARM ARM DDI0406A - section A8.6.26
-				if (inst32 & 0xFFF0FFFF == 0xE3C08F00)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.26 - BXJ is not supported");
-
-					// Decoding as per ARM ARM description
-					// TUint32 Rm = inst32 & 0x000F0000;	// not needed yet
-					}
-
-				// return from exception... SUBS PC,LR. page b6-25
-				//
-				// ARM ARM DDi046A - section B6.1.13 - SUBS PC,LR
-				//
-				// Encoding T1
-				if (inst32 & 0xFFFFFF00 == 0xF3DE8F00)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section B6.1.13 - SUBS PC,LR Encoding T1");
-
-					// Decoding as per ARM ARM description
-					TUint32 imm8 = inst32 & 0x000000FF;
-					TUint32 imm32 = imm8;
-
-					// TUint32 register_form = EFalse;	// not needed for this decoding
-					// TUint32 opcode = 0x2;	// SUB	// not needed for this decoding
-					TUint32 n = 14;
-
-					// Obtain LR
-					TUint32 lrVal;
-					ReturnIfError(RegisterValue(aThread,n,lrVal));
-
-					TUint32 operand2 = imm32;	// always for Encoding T1
-					
-					TUint32 result = lrVal - operand2;
-					
-					breakAddress = result;
-					}
-
-				// ARM ARM DDI0406A - section A8.6.16 - B
-				//
-				// Branch Encoding T3
-				if (inst32 & 0xF800D000 == 0xF0008000)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.16 - B Encoding T3");
-
-					// Decoding as per ARM ARM description
-					TUint32 S = inst32 & 0x04000000 >> 26;
-					// TUint32 cond = inst32 & 0x03C00000 >> 22;	// not needed for this decoding
-					TUint32 imm6 = inst32 & 0x003F0000 >> 16;
-					TUint32 J1 = inst32 & 0x00002000 >> 13;
-					TUint32 J2 = inst32 & 0x00000800 >> 11;
-					TUint32 imm11 = inst32 & 0x000007FF;
-
-					TUint32 imm32 = S ? 0xFFFFFFFF : 0 ;
-					imm32 = (imm32 << 1) | J2;
-					imm32 = (imm32 << 1) | J1;
-					imm32 = (imm32 << 6) | imm6;
-					imm32 = (imm32 << 11) | imm11;
-					imm32 = (imm32 << 1) | 0;
-
-					breakAddress = aCurrentPC + imm32;
-					}
-
-				// ARM ARM DDI0406A - section A8.6.16 - B
-				//
-				// Branch Encoding T4
-				if (inst32 & 0xF800D000 == 0xF0009000)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.16 - B");
-
-					// Decoding as per ARM ARM description
-					TUint32 S = inst32 & 0x04000000 >> 26;
-					TUint32 imm10 = inst32 & 0x03FF0000 >> 16;
-					TUint32 J1 = inst32 & 0x00002000 >> 12;
-					TUint32 J2 = inst32 & 0x00000800 >> 11;
-					TUint32 imm11 = inst32 & 0x000003FF;
-
-					TUint32 I1 = !(J1 ^ S);
-					TUint32 I2 = !(J2 ^ S);
-
-					TUint32 imm32 = S ? 0xFFFFFFFF : 0;
-					imm32 = (imm32 << 1) | S;
-					imm32 = (imm32 << 1) | I1;
-					imm32 = (imm32 << 1) | I2;
-					imm32 = (imm32 << 10) | imm10;
-					imm32 = (imm32 << 11) | imm11;
-					imm32 = (imm32 << 1) | 0;
-
-					breakAddress = aCurrentPC + imm32;
-					}
-
-
-				// ARM ARM DDI0406A - section A8.6.225 - TBB, TBH
-				//
-				// Table Branch Byte, Table Branch Halfword
-				if (inst32 & 0xFFF0FFE0 == 0xE8D0F000)
-						{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.225 TBB,TBH Encoding T1");
-
-					// Decoding as per ARM ARM description
-					TUint32 Rn = inst32 & 0x000F0000 >> 16;
-					TUint32 H = inst32 & 0x00000010 >> 4;
-					TUint32 Rm = inst32 & 0x0000000F;
-
-					// Unpredictable?
-					if (Rm == 13 || Rm == 15)
-						{
-						LOG_MSG("ARM ARM DDI0406A - section A8.6.225 TBB,TBH Encoding T1 - Unpredictable");
-						break;
-						}
-
-					TUint32 halfwords;
-					TUint32 address;
-					ReturnIfError(RegisterValue(aThread,Rn,address));
-
-					TUint32 offset;
-					ReturnIfError(RegisterValue(aThread,Rm,offset));
-
-					if (H)
-						{
-						address += offset << 1;
-						}
-					else
-						{
-						address += offset;
-						}
-
-					ReturnIfError(ReadMem32(aThread,address,halfwords));
-
-					breakAddress = aCurrentPC + 2*halfwords;
-					break;
-					}
-
-				// ARM ARM DDI0406A - section A8.6.55 - LDMDB, LDMEA
-				//
-				// LDMDB Encoding T1
-				if (inst32 & 0xFFD02000 == 0xE9100000)
-					{
-					LOG_MSG("ARM ARM DDI0406 - section A8.6.55 LDMDB Encoding T1");
-
-					// Decoding as per ARM ARM description
-					// TUint32 W = inst32 & 0x00200000 >> 21;	// Not needed for this encoding
-					TUint32 Rn = inst32 & 0x000F0000 >> 16;
-					TUint32 P = inst32 & 0x00008000 >> 15;
-					TUint32 M = inst32 & 0x00004000 >> 14;
-					TUint32 registers = inst32 & 0x00001FFF;
-
-					//TBool wback = (W == 1);	// not needed for this encoding
-
-					// Unpredictable?
-					if (Rn == 15 || BitCount(registers) < 2 || ((P == 1) && (M==1)))
-						{
-						LOG_MSG("ARM ARM DDI0406 - section A8.6.55 LDMDB Encoding T1 - Unpredictable");
-						break;
-						}
-
-					TUint32 address;
-					ReturnIfError(RegisterValue(aThread,Rn,address));
-
-					address -= 4*BitCount(registers);
-
-					for(TInt i=0; i<15; i++)
-						{
-						if (IsBitSet(registers,i))
-							{
-							address +=4;
-							}
-						}
-
-					if (IsBitSet(registers,15))
-						{
-						TUint32 RnVal = 0;
-						ReturnIfError(ReadMem32(aThread,address,RnVal));
-
-						breakAddress = RnVal;
-						}
-					break;
-					}
-
-				// ARM ARM DDI0406A - section A8.6.121 POP
-				//
-				// POP.W Encoding T2
-				if (inst32 & 0xFFFF2000 == 0xE8BD0000)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T2");
-
-					// Decoding as per ARM ARM description
-					TUint32 registers = inst32 & 0x00001FFF;
-					TUint32 P = inst32 & 0x00008000;
-					TUint32 M = inst32 & 0x00004000;
-
-					// Unpredictable?
-					if ( (BitCount(registers)<2) || ((P == 1)&&(M == 1)) )
-						{
-						LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T2 - Unpredictable");
-						break;
-						}
-
-					TUint32 address;
-					ReturnIfError(RegisterValue(aThread,13,address));
-					
-					for(TInt i=0; i< 15; i++)
-						{
-						if (IsBitSet(registers,i))
-							{
-							address += 4;
-							}
-						}
-
-					// Is the PC written?
-					if (IsBitSet(registers,15))
-						{
-						// Yes
-						ReturnIfError(ReadMem32(aThread,address,breakAddress));
-						}
-					}
-
-				// POP Encoding T3
-				if (inst32 & 0xFFFF0FFFF == 0xF85D0B04)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T3");
-
-					// Decoding as per ARM ARM description
-					TUint32 Rt = inst32 & 0x0000F000 >> 12;
-					TUint32 registers = 1 << Rt;
-
-					// Unpredictable?
-					if (Rt == 13 || Rt == 15)
-						{
-						LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T3 - Unpredictable");
-						break;
-						}
-					
-					TUint32 address;
-					ReturnIfError(RegisterValue(aThread,13,address));
-					
-					for(TInt i=0; i< 15; i++)
-						{
-						if (IsBitSet(registers,i))
-							{
-							address += 4;
-							}
-						}
-
-					// Is the PC written?
-					if (IsBitSet(registers,15))
-						{
-						// Yes
-						ReturnIfError(ReadMem32(aThread,address,breakAddress));
-						}
-
-					break;
-					}
-
-				// ARM ARM DDI0406A - section A8.6.53 LDM
-				//
-				// Load Multiple Encoding T2 
-				if ((inst32 & 0xFFD02000) == 0xE8900000)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section A8.6.53 LDM Encoding T2");
-
-					// Decoding as per ARM ARM description
-					TUint32 W = inst32 & 0x0020000 >> 21;
-					TUint32 Rn = inst32 & 0x000F0000 >> 16;
-					TUint32 P = inst32 & 0x00008000 >> 15;
-					TUint32 M = inst32 & 0x00004000 >> 14;
-					TUint32 registers = inst32 & 0x0000FFFF;
-					TUint32 register_list = inst32 & 0x00001FFF;
-				
-					// POP?
-					if ( (W == 1) && (Rn == 13) )
-						{
-						// POP instruction
-						LOG_MSG("ARM ARM DDI0406A - section A8.6.53 LDM Encoding T2 - POP");
-						}
-
-					// Unpredictable?
-					if (Rn == 15 || BitCount(register_list) < 2 || ((P == 1) && (M == 1)) )
-						{
-						LOG_MSG("ARM ARM DDI0406A - section A8.6.53 LDM Encoding T2 - Unpredictable");
-						break;
-						}
-					
-					TUint32 RnVal;
-					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
-
-					TUint32 address = RnVal;
-
-					// Calculate offset of address
-					for(TInt i = 0; i < 15; i++)
-						{
-						if (IsBitSet(registers,i))
-						{
-							address += 4;
-						}
-						}
-
-					// Does it load the PC?
-					if (IsBitSet(registers,15))
-						{
-						// Obtain the value loaded into the PC
-						ReturnIfError(ReadMem32(aThread,address,breakAddress));
-						}
-					break;
-
-					}
-
-				// ARM ARM DDI0406A - section B6.1.8 RFE
-				//
-				// Return From Exception Encoding T1 RFEDB
-				if ((inst32 & 0xFFD0FFFF) == 0xE810C000)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T1");
-
-					// Decoding as per ARM ARM description
-					// TUint32 W = (inst32 & 0x00200000) >> 21;	// not needed for this encoding
-					TUint32 Rn = (inst32 & 0x000F0000) >> 16;
-					
-					// TBool wback = (W == 1);	// not needed for this encoding
-					TBool increment = EFalse;
-					TBool wordhigher = EFalse;
-
-					// Do calculation
-					if (Rn == 15)
-						{
-						// Unpredictable 
-						LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T1 - Unpredictable");
-						break;
-						}
-
-					TUint32 RnVal = 0;
-					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
-
-					TUint32 address = 0;
-					ReturnIfError(ReadMem32(aThread,RnVal,address));
-
-					if (increment)
-						{
-						address -= 8;
-						}
-
-					if (wordhigher)
-						{
-						address += 4;
-						}
-
-					breakAddress = address;
-					break;
-					}
-
-				// Return From Exception Encoding T2 RFEIA
-				if ((inst32 & 0xFFD0FFFF) == 0xE990C000)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T2");
-
-					// Decoding as per ARM ARM description
-					// TUint32 W = (inst32 & 0x00200000) >> 21;	// not needed for this encoding
-					TUint32 Rn = (inst32 & 0x000F0000) >> 16;
-					
-					// TBool wback = (W == 1);	// not needed for this encoding
-					TBool increment = ETrue;
-					TBool wordhigher = EFalse;
-
-					// Do calculation
-					if (Rn == 15)
-						{
-						// Unpredictable 
-						LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T2 - Unpredictable");
-						break;
-						}
-
-					TUint32 RnVal = 0;
-					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
-
-					TUint32 address = 0;
-					ReturnIfError(ReadMem32(aThread,RnVal,address));
-
-					if (increment)
-						{
-						address -= 8;
-						}
-
-					if (wordhigher)
-						{
-						address += 4;
-						}
-
-					breakAddress = RnVal;
-					break;
-					}
-
-				// Return From Exception Encoding A1 RFE<amode>
-				if ((inst32 & 0xFE50FFFF) == 0xF8100A00)
-					{
-					LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding A1");
-
-					// Decoding as per ARM ARM description
-					TUint32 P = (inst32 & 0x01000000) >> 24;
-					TUint32 U = (inst32 & 0x00800000) >> 23;
-					// TUint32 W = (inst32 & 0x00200000) >> 21; // not needed for this encoding
-					TUint32 Rn = (inst32 & 0x000F0000) >> 16;	
-					
-					// TBool wback = (W == 1);	// not needed for this encoding
-					TBool increment = (U == 1);
-					TBool wordhigher = (P == U);
-
-					// Do calculation
-					if (Rn == 15)
-						{
-						// Unpredictable 
-						LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding A1 - Unpredictable");
-						break;
-						}
-
-					TUint32 RnVal = 0;
-					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
-
-					TUint32 address = 0;
-					ReturnIfError(ReadMem32(aThread,RnVal,address));
-
-					if (increment)
-						{
-						address -= 8;
-						}
-
-					if (wordhigher)
-						{
-						address += 4;
-						}
-
-					breakAddress = address;
-					break;
-					}
-				}
-
-			// v4T/v5T/v6T instructions
-			switch(thumb_opcode(inst))
-				{
-				case 0x08:
-					{
-					// Data-processing. See ARM ARM DDI0406A, section A6-8, A6.2.2.
-
-					if ((thumb_inst_7_15(inst) == 0x08F))
-						{
-						// BLX(2)
-						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
-						if(err != KErrNone)
-							{
-							LOG_MSG2("Non-zero error code discarded: %d", err);
-							}
-
-						if ((breakAddress & 0x00000001) == 0)
-							{
-							aChangingModes = ETrue;
-							}
-
-						breakAddress &= 0xFFFFFFFE;
-
-						// Report how we decoded this instruction
-						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BLX (2)");
-						}
-					else if (thumb_inst_7_15(inst) == 0x08E)
-						{
-						// BX
-						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
-						if(err != KErrNone)
-							{
-							LOG_MSG2("Non-zero error code discarded: %d", err);
-							}
-
-						if ((breakAddress & 0x00000001) == 0)
-							{
-							aChangingModes = ETrue;
-							}
-						
-						breakAddress &= 0xFFFFFFFE;
-
-						// Report how we decoded this instruction
-						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BX");
-						}
-					else if ((thumb_inst_8_15(inst) == 0x46) && ((inst & 0x87) == 0x87))
-						{
-						// MOV with PC as the destination
-						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
-						if(err != KErrNone)
-							{
-							LOG_MSG2("Non-zero error code discarded: %d", err);
-							}
-
-						// Report how we decoded this instruction
-						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as MOV with PC as the destination");
-						}
-					else if ((thumb_inst_8_15(inst) == 0x44) && ((inst & 0x87) == 0x87))
-						{
-						// ADD with PC as the destination
-						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
-						if(err != KErrNone)
-							{
-							LOG_MSG2("Non-zero error code discarded: %d", err);
-							}
-						breakAddress += aCurrentPC + 4; // +4 because we need to use the PC+4 according to ARM ARM DDI0406A, section A6.1.2.
-
-						// Report how we decoded this instruction
-						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as ADD with PC as the destination");
-						}
-					break;
-					}
-				case 0x13:
-					{
-					// Load/Store single data item. See ARM ARM DDI0406A, section A6-10
-
-					//This instruction doesn't modify the PC.
-
-					//if (thumb_inst_8_15(inst) == 0x9F)
-					//{
-						// LDR(4) with the PC as the destination
-					//	breakAddress = ReadRegister(aThread, SP_REGISTER) + (4 * (inst & 0x00FF));
-					//}
-
-					// Report how we decoded this instruction
-					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as This instruction doesn't modify the PC.");
-					break;
-					}
-				case 0x17:
-					{
-					// Misc 16-bit instruction. See ARM ARM DDI0406A, section A6-11
-
-					if (thumb_inst_8_15(inst) == 0xBD)
-						{
-						// POP with the PC in the list
-						TUint32 regList = (inst & 0x00FF);
-						TInt offset = 0;
-						err = iChannel->ReadKernelRegisterValue(aThread,  SP_REGISTER, (T4ByteRegisterValue&)offset);
-						if(err != KErrNone)
-							{
-							LOG_MSG2("Non-zero error code discarded: %d", err);
-							}
-						offset += (iChannel->Bitcount(regList) * 4);
-
-						TBuf8<4> destination;
-						err = iChannel->DoReadMemory(aThread, offset, 4, destination);
-						
-						if (KErrNone == err)
-							{
-							breakAddress = *(TUint32 *)destination.Ptr();
-
-							if ((breakAddress & 0x00000001) == 0)
-								{
-								aChangingModes = ETrue;
-								}
-
-							breakAddress &= 0xFFFFFFFE;
-							}
-						else
-							{
-							LOG_MSG("Error reading memory in decoding step instruction");
-							}
-
-						// Report how we decoded this instruction
-						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as POP with the PC in the list");
-						}
-					break;
-					}
-				case 0x1A:
-				case 0x1B:
-					{
-					// Conditional branch, and supervisor call. See ARM ARM DDI0406A, section A6-13
-
-					if (thumb_inst_8_15(inst) < 0xDE)
-						{
-						// B(1) conditional branch
-						if (IsExecuted(((inst & 0x0F00) >> 8), aStatusRegister))
-							{
-							TUint32 offset = ((inst & 0x000000FF) << 1);
-							if (offset & 0x00000100)
-								{
-								offset |= 0xFFFFFF00;
-								}
-							
-							breakAddress = aCurrentPC + 4 + offset;
-
-							// Report how we decoded this instruction
-							LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as B(1) conditional branch");
-							}
-						}
-					break;
-					}
-				case 0x1C:
-					{
-					// Unconditional branch, See ARM ARM DDI0406A, section A8-44.
-
-					// B(2) unconditional branch
-					TUint32 offset = (inst & 0x000007FF) << 1;
-					if (offset & 0x00000800)
-						{
-						offset |= 0xFFFFF800;
-						}
-					
-					breakAddress = aCurrentPC + 4 + offset;
-
-					// Report how we decoded this instruction
-					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as B(2) unconditional branch");
-
-					break;
-					}
-				case 0x1D:
-					{
-					if (!(inst & 0x0001))
-						{
-						// BLX(1)
-						err = iChannel->ReadKernelRegisterValue(aThread, LINK_REGISTER, breakAddress);
-						if(err != KErrNone)
-							{
-							LOG_MSG2("Non-zero error code discarded: %d", err);
-							}
-						breakAddress +=  ((inst & 0x07FF) << 1);
-						if ((breakAddress & 0x00000001) == 0)
-							{
-							aChangingModes = ETrue;
-							}
-
-						breakAddress &= 0xFFFFFFFC;
-
-						// Report how we decoded this instruction
-						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BLX(1)");
-
-						}
-					break;
-					}
-				case 0x1E:
-					{
-					// Check for ARMv7 CPU
-					if(cpuid == 0xC0)
-						{
-						// BL/BLX 32-bit instruction
-						aNewRangeEnd += 4;
-
-						breakAddress = (TUint32)thumb_instr_b_dest(inst32, aCurrentPC);
-
-						if((inst32 >> 27) == 0x1D)
-							{
-							// BLX(1)
-							if ((breakAddress & 0x00000001) == 0)
-								{
-								aChangingModes = ETrue;
-								}
-
-							breakAddress &= 0xFFFFFFFC;
-
-							// Report how we decoded this instruction
-							LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as 32-bit BLX(1)");
-							}
-						else
-							{
-							// Report how we decoded this instruction
-							LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: 32-bit BL instruction");
-							}
-						LOG_MSG2(" 32-bit BL/BLX instruction: breakAddress = 0x%X", breakAddress);
-						} // if(cpuid == 0xC0)
-					else
-						{
-						// BL/BLX prefix - destination is encoded in this and the next instruction
-						aNewRangeEnd += 2;
-
-						// Report how we decoded this instruction
-						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: BL/BLX prefix - destination is encoded in this and the next instruction");
-						}
-
-					break;
-					}
-				case 0x1F:
-					{
-					// BL
-					err = iChannel->ReadKernelRegisterValue(aThread, LINK_REGISTER, breakAddress);
-					if(err != KErrNone)
-						{
-						LOG_MSG2("Non-zero error code discarded: %d", err);
-						}
-					breakAddress += ((inst & 0x07FF) << 1);
-
-					// Report how we decoded this instruction
-					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BL");
-					break;
-					}
-				default:
-					{
-					// Don't know any better at this point!
-					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes:- default to next instruction");
-					}
-					break;
-				} // switch(thumb_opcode(inst))
-			} // case Debug::EThumbMode:
-		break;
-
-		case Debug::EThumb2EEMode:
-			{
-			// Not yet supported
-			LOG_MSG("DRMDStepping::PCAfterInstructionExecutes - Debug::EThumb2Mode is not supported");
-
-			}
-			break;
-
-		default:
-			LOG_MSG("DRMDStepping::PCAfterInstructionExecutes - Cannot determine CPU mode architecture");
-		} // switch(mode)
-
-	LOG_MSG2("DRMDStepping::PCAfterInstructionExecutes : return 0x%08x",breakAddress);
-	return breakAddress;
-	}
-
-// Obtain a 32-bit memory value with minimum fuss
-TInt DRMDStepping::ReadMem32(DThread* aThread, const TUint32 aAddress, TUint32& aValue)
-	{
-	TBuf8<4> valBuf;
-	TInt err = iChannel->DoReadMemory(aThread, aAddress, 4, valBuf);
-	if (err != KErrNone)
-		{
-		LOG_MSG2("DRMDStepping::ReadMem32 failed to read memory at 0x%08x", aAddress);
-		return err;
-		}
-
-	aValue = *(TUint32 *)valBuf.Ptr();
-
-	return KErrNone;
-	}
-
-// Obtain a 16-bit memory value with minimum fuss
-TInt DRMDStepping::ReadMem16(DThread* aThread, const TUint32 aAddress, TUint16& aValue)
-	{
-	TBuf8<2> valBuf;
-	TInt err = iChannel->DoReadMemory(aThread, aAddress, 2, valBuf);
-	if (err != KErrNone)
-		{
-		LOG_MSG2("DRMDStepping::ReadMem16 failed to read memory at 0x%08x", aAddress);
-		return err;
-		}
-
-	aValue = *(TUint16 *)valBuf.Ptr();
-
-	return KErrNone;
-	}
-
-// Obtain a 16-bit memory value with minimum fuss
-TInt DRMDStepping::ReadMem8(DThread* aThread, const TUint32 aAddress, TUint8& aValue)
-	{
-	TBuf8<1> valBuf;
-	TInt err = iChannel->DoReadMemory(aThread, aAddress, 1, valBuf);
-	if (err != KErrNone)
-		{
-		LOG_MSG2("DRMDStepping::ReadMem8 failed to read memory at 0x%08x", aAddress);
-		return err;
-		}
-
-	aValue = *(TUint8 *)valBuf.Ptr();
-
-	return KErrNone;
-	}
-
-// Obtain a core register value with minimum fuss
-TInt DRMDStepping::RegisterValue(DThread *aThread, const TUint32 aKernelRegisterId, TUint32 &aValue)
-	{
-	TInt err = iChannel->ReadKernelRegisterValue(aThread, aKernelRegisterId, aValue);
-	if(err != KErrNone)
-		{
-		LOG_MSG3("DRMDStepping::RegisterValue failed to read register %d err = %d", aKernelRegisterId, err);
-		}
-		return err;
-	}
-
-
-// Encodings from ARM ARM DDI0406A, section 9.2.1
-enum TThumb2EEOpcode
-	{
-	EThumb2HDP,		// Handler Branch with Parameter
-	EThumb2UNDEF,	// UNDEFINED
-	EThumb2HB,		// Handler Branch, Handler Branch with Link
-	EThumb2HBLP,	// Handle Branch with Link and Parameter
-	EThumb2LDRF,	// Load Register from a frame
-	EThumb2CHKA,	// Check Array
-	EThumb2LDRL,	// Load Register from a literal pool
-	EThumb2LDRA,	// Load Register (array operations)
-	EThumb2STR		// Store Register to a frame
-	};
-
-//
-// DRMDStepping::ShiftedRegValue
-//
-TUint32 DRMDStepping::ShiftedRegValue(DThread *aThread, TUint32 aInstruction, TUint32 aCurrentPC, TUint32 aStatusRegister)
-	{
-	LOG_MSG("DRMDStepping::ShiftedRegValue()");
-
-	TUint32 shift = 0;
-	if (aInstruction & 0x10)	// bit 4
-		{
-		shift = (arm_rs(aInstruction) == PC_REGISTER ? aCurrentPC + 8 : aStatusRegister) & 0xFF;
-		}
-	else
-		{
-		shift = arm_data_c(aInstruction);
-		}
-	
-	TInt rm = arm_rm(aInstruction);
-	
-	TUint32 res = 0;
-	if(rm == PC_REGISTER)
-		{
-		res = aCurrentPC + ((aInstruction & 0x10) ? 12 : 8);
-		}
-	else
-		{
-		TInt err = iChannel->ReadKernelRegisterValue(aThread, rm, res);
-		if(err != KErrNone)
-			{
-			LOG_MSG2("DRMDStepping::ShiftedRegValue - Non-zero error code discarded: %d", err);
-			}
-		}
-
-	switch(arm_data_shift(aInstruction))
-		{
-		case 0:			// LSL
-			{
-			res = shift >= 32 ? 0 : res << shift;
-			break;
-			}
-		case 1:			// LSR
-			{
-			res = shift >= 32 ? 0 : res >> shift;
-			break;
-			}
-		case 2:			// ASR
-			{
-			if (shift >= 32)
-			shift = 31;
-			res = ((res & 0x80000000L) ? ~((~res) >> shift) : res >> shift);
-			break;
-			}
-		case 3:			// ROR/RRX
-			{
-			shift &= 31;
-			if (shift == 0)
-				{
-				res = (res >> 1) | ((aStatusRegister & arm_carry_bit()) ? 0x80000000L : 0);
-				}
-			else
-				{
-				res = (res >> shift) | (res << (32 - shift));
-				}
-			break;
-			}
-		}
-
-	return res & 0xFFFFFFFF;
-}
-
-//
-// DRMDStepping::CurrentPC
-//
-// 
-//
-TInt DRMDStepping::CurrentPC(DThread* aThread, TUint32& aPC)
-	{
-	LOG_MSG("DRMDStepping::CurrentPC");
-
-	TInt err = iChannel->ReadKernelRegisterValue(aThread, PC_REGISTER, aPC);
-	if(err != KErrNone)
-		{
-		// We don't know the current PC for this thread!
-		LOG_MSG("DRMDStepping::CurrentPC - Failed to read the current PC");
-		
-		return KErrGeneral;
-		}
-
-	LOG_MSG2("DRMDStepping::CurrentPC 0x%08x", aPC);
-
-	return KErrNone;
-	}
-
-//
-// DRMDStepping::CurrentCPSR
-//
-// 
-//
-TInt DRMDStepping::CurrentCPSR(DThread* aThread, TUint32& aCPSR)
-	{
-	LOG_MSG("DRMDStepping::CurrentCPSR");
-
-	TInt err = iChannel->ReadKernelRegisterValue(aThread, STATUS_REGISTER, aCPSR);
-	if(err != KErrNone)
-		{
-		// We don't know the current PC for this thread!
-		LOG_MSG("DRMDStepping::CurrentPC - Failed to read the current CPSR");
-		
-		return KErrGeneral;
-		}
-
-	LOG_MSG2("DRMDStepping::CurrentCPSR 0x%08x", aCPSR);
-	
-	return KErrNone;
-	}
-
-//
-// DRMDStepping::ModifyBreaksForStep
-//
-// Set a temporary breakpoint at the next instruction to be executed after the one at the current PC
-// Disable the breakpoint at the current PC if one exists
-//
-TInt DRMDStepping::ModifyBreaksForStep(DThread *aThread, TUint32 aRangeStart, TUint32 aRangeEnd, /*TBool aStepInto,*/ TBool aResumeOnceOutOfRange, TBool aCheckForStubs, const TUint32 aNumSteps)
-	{
-	LOG_MSG2("DRMDStepping::ModifyBreaksForStep() Numsteps 0x%d",aNumSteps);
-
-	// Validate arguments
-	if (!aThread)
-		{
-		LOG_MSG("DRMDStepping::ModifyBreaksForStep() - No aThread specified to step");
-		return KErrArgument;
-		}
-
-	// Current PC
-	TUint32 currentPC;
-
-	ReturnIfError(CurrentPC(aThread,currentPC));
-	LOG_MSG2("Current PC: 0x%x", currentPC);
-
-	// disable breakpoint at the current PC if necessary
-	ReturnIfError(iChannel->iBreakManager->DisableBreakAtAddress(currentPC));
-
-	// Current CPSR
-	TUint32 statusRegister;
-
-	ReturnIfError(CurrentCPSR(aThread,statusRegister));
-	LOG_MSG2("Current CPSR: %x", statusRegister);
-
-	TBool thumbMode = (statusRegister & ECpuThumb);
-	if (thumbMode)
-		LOG_MSG("Thumb Mode");
-
-	TInt instSize = thumbMode ? 2 : 4;
-
-	TBool changingModes = EFalse;
-
-	TUint32 breakAddress = 0;
-
-	TUint32 newRangeEnd = aRangeEnd;
-
-	breakAddress = PCAfterInstructionExecutes(aThread, currentPC, statusRegister, instSize, /* aStepInto, */ newRangeEnd, changingModes);
-
-	/*
-	If there is already a user breakpoint at this address, we do not need to set a temp breakpoint. The program
-	should simply stop at that address.	
-	*/
-	TBreakEntry* breakEntry = NULL;
-	do
-		{
-		breakEntry = iChannel->iBreakManager->GetNextBreak(breakEntry);
-		if(breakEntry && !iChannel->iBreakManager->IsTemporaryBreak(*breakEntry))
-			{
-			if ((breakEntry->iAddress == breakAddress) && ((breakEntry->iThreadSpecific && breakEntry->iId == aThread->iId) || (!breakEntry->iThreadSpecific && breakEntry->iId == aThread->iOwningProcess->iId)))
-				{
-				LOG_MSG("DRMDStepping::ModifyBreaksForStep - Breakpoint already exists at the step target address\n");
-
-				// note also that if this is the case, we will not keep stepping if we hit a real breakpoint, so may as well set
-				// the step count = 0.
-				breakEntry->iNumSteps = 0;
-
-				return KErrNone;
-				}
-			}
-		} while(breakEntry);
-
-	breakEntry = NULL;
-	do
-		{
-		breakEntry = iChannel->iBreakManager->GetNextBreak(breakEntry);
-		if(breakEntry && iChannel->iBreakManager->IsTemporaryBreak(*breakEntry))
-			{
-			if (breakEntry->iAddress == 0)
-				{
-				breakEntry->iId = aThread->iId;
-				breakEntry->iAddress = breakAddress;
-				breakEntry->iThreadSpecific = ETrue;
-
-				TBool realThumbMode = (thumbMode && !changingModes) || (!thumbMode && changingModes);
-
-				// Need to set the correct type of breakpoint for the mode we are in
-				// and the the one we are changing into
-				if(realThumbMode)
-					{
-					// We are remaining in Thumb mode
-					breakEntry->iMode = EThumbMode;
-					}
-				else
-					{
-					// We are switching to ARM mode
-					breakEntry->iMode = EArmMode;
-					}
-
-				breakEntry->iResumeOnceOutOfRange = aResumeOnceOutOfRange;
-				breakEntry->iSteppingInto = ETrue /* aStepInto */;
-				breakEntry->iRangeStart = 0;	// no longer used
-				breakEntry->iRangeEnd = 0;		// no longer used
-
-				LOG_MSG2("Adding temp breakpoint with id: %d", breakEntry->iBreakId);
-				LOG_MSG2("Adding temp breakpoint with thread id: %d", aThread->iId);
-
-				// Record how many more steps to go after we hit this one
-				breakEntry->iNumSteps = aNumSteps;
-
-				LOG_MSG3("Setting temp breakpoint id %d with %d steps to go\n", breakEntry->iBreakId, aNumSteps);
-
-				return iChannel->iBreakManager->DoEnableBreak(*breakEntry, ETrue);			
-				}
-			}
-		} while(breakEntry);
-	LOG_MSG("ModifyBreaksForStep : Failed to set suitable breakpoint for stepping");
-	return KErrNoMemory;	// should never get here
-}
-
-// End of file - d-rmd-stepping.cpp
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-//
-
-#ifndef D_RMD_STEPPING_H
-#define D_RMD_STEPPING_H
-
-// fwd declaration of DRM_DebugChannel
-class DRM_DebugChannel;
-
-// extracted from rm_debug_kerneldriver.h
-// Register definitions
-#define SP_REGISTER			13
-#define LINK_REGISTER		14
-#define PC_REGISTER			15
-#define STATUS_REGISTER		16
-
-class DRMDStepping : public DBase
-{
-public:
-	// ctor
-	DRMDStepping(DRM_DebugChannel* aChannel);
-
-	// dtor
-	~DRMDStepping();
-
-	// extracted from rm_debug_kerneldriver.cpp
-	TBool IsExecuted(TUint8 aCondition, TUint32 aStatusRegister);
-	TBool IsPreviousInstructionMovePCToLR(DThread *aThread);
-	void DecodeDataProcessingInstruction(TUint8 aOpcode, TUint32 aOp1, TUint32 aOp2, TUint32 aStatusRegister, TUint32 &aBreakAddress);
-	TUint32 PCAfterInstructionExecutes(DThread *aThread, TUint32 aCurrentPC, TUint32 aStatusRegister, TInt aInstSize, TUint32 &aNewRangeEnd, TBool &aChangingModes);
-	TUint32 ShiftedRegValue(DThread *aThread, TUint32 aInstruction, TUint32 aCurrentPC, TUint32 aStatusRegister);
-	TInt ModifyBreaksForStep(DThread *aThread, TUint32 aRangeStart, TUint32 aRangeEnd,TBool aResumeOnceOutOfRange, TBool aCheckForStubs, const TUint32 aNumSteps);
-
-private:
-
-	// Needed to access private data until re-structuring work is complete.
-	friend class DRM_DebugChannel;
-
-	DRM_DebugChannel* iChannel;	// temporary reference back to DRM_DebugChannel to help with refactoring
-
-	// Set of inline functions for decoding instructions. Formerly these were all macros
-
-	// ARM instruction bitmasks
-	inline TUint32 arm_opcode(const TUint32 aInst);
-
-	// Generic instruction defines
-	inline TUint32 arm_rm(const TUint32 aInst);
-	inline TUint32 arm_rs(const TUint32 aInst);
-	inline TUint32 arm_rd(const TUint32 aInst);
-	inline TUint32 arm_rn(const TUint32 aInst);
-	inline TUint32 arm_load(const TUint32 aInst);
-
-	// Data processing instruction defines
-	inline TUint32 arm_data_shift(const TUint32 aInst);
-	inline TUint32 arm_data_c(const TUint32 aInst);
-	inline TUint32 arm_data_imm(const TUint32 aInst);
-	inline TUint32 arm_data_rot(const TUint32 aInst);
-
-	// Single date transfer instruction defines
-	inline TUint32 arm_single_imm(const TUint32 aInst);
-	inline TUint32 arm_single_byte(const TUint32 aInst);
-	inline TUint32 arm_single_u(const TUint32 aInst);
-	inline TUint32 arm_single_pre(const TUint32 aInst);
-
-	// Block data transfer instruction defines
-	inline TUint32 arm_block_reglist(const TUint32 aInst);
-	inline TUint32 arm_block_u(const TUint32 aInst);
-	inline TUint32 arm_block_pre(const TUint32 aInst);
-
-	// Branch instruction defines
-	inline TUint32 arm_b_addr(const TUint32 aInst);
-	inline TUint32 arm_instr_b_dest(const TUint32 aInst, TUint32& aAddr);
-	inline TUint32 thumb_b_addr(const TUint32 aInst);
-	inline TUint32 thumb_instr_b_dest(const TUint32 aInst, TUint32& aAddr);
-	inline TUint32 arm_carry_bit(void);
-	
-
-	// Thumb instruction bitmasks
-	inline TUint16 thumb_opcode(const TUint16 aInst);
-	inline TUint16 thumb_inst_7_15(const TUint16 aInst);
-	inline TUint16 thumb_inst_8_15(const TUint16 aInst);
-
-	// Thumb2 decode support functions
-	inline TUint16 t2opcode16(const TUint16 aInst);
-
-	inline TUint16 t2opcode16special(const TUint16 aInst);
-
-	// Helper functions
-	TInt CurrentPC(DThread* aThread, TUint32& aPC);
-
-	TInt CurrentCPSR(DThread* aThread, TUint32& aCPSR);	
-
-	TInt CurrentInstruction(DThread* aThread, TUint32& aInstruction);
-
-	TInt CurrentArchMode(const TUint32 cpsr, Debug::TArchitectureMode& mode);
-
-	TInt RegisterValue(DThread *aThread, const TUint32 aKernelRegisterId, TUint32 &aValue);
-
-	TInt ReadMem32(DThread* aThread, const TUint32 aAddress, TUint32& aValue);
-
-	TInt ReadMem16(DThread* aThread, const TUint32 aAddress, TUint16& aValue);
-
-	TInt ReadMem8(DThread* aThread, const TUint32 aAddress, TUint8& aValue);
-
-	inline TUint32 BitCount(const TUint32 aVal);
-
-	inline TUint32 IsBitSet(const TUint32 aBitset, const TUint8 aBitNum);
-};
-
-#include "d_rmd_stepping.inl"
-
-#endif	// D_RMD_STEPPPING_H
-
-// End of file - d-rmd-stepping.h
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.inl	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-//
-
-
-
-/**
- @file
- @internalComponent
- @released
-*/
-
-#ifndef D_RMD_STEPPING_INL
-#define D_RMD_STEPPING_INL
-
-//
-// IsBitSet
-//
-// Returns 1 if the bit 'aNum' is set within aBitset, 0 otherwise
-inline TUint32 DRMDStepping::IsBitSet(const TUint32 aBitset, const TUint8 aNum)
-	{
-	return (aBitset & (1 << aNum) );
-	}
-
-// 
-// BitCount
-//
-// Count number of bits in aVal
-inline TUint32 DRMDStepping::BitCount(const TUint32 aVal)
-	{
-	TUint32 num = 0;
-
-	for(TInt i = 0; i < 32; i++)
-		{
-		if ((1 << i) & aVal)
-			{
-			num++;
-			}
-		}
-	return num;
-	}
-
-//
-// Thumb2 opcode decoding
-//
-// Special data instructions and branch and exchange.
-//
-// Returns Opcode as defined in ARM ARM DDI0406A, section A6.2.3
-inline TUint16 DRMDStepping::t2opcode16special(const TUint16 aInst)
-	{
-	TUint8 aVal = (aInst & 0x03C0) >> 5;
-
-	return aVal;
-	}
-
-
-// Thumb2 opcode decoding instructions
-// 
-// Returns Opcode as defined in ARM ARM DDI0406A, section A6.2
-// 16-bit Thumb instruction encoding
-inline TUint16 DRMDStepping::t2opcode16(const TUint16 aInst)
-{
-	TUint16 aVal = (aInst & 0xFC00) >> 9;
-
-	return aVal;
-}
-
-// ARM opcode decoding functions
-inline TUint32 DRMDStepping::arm_opcode(const TUint32 aInst)
-{
-// #define ARM_OPCODE(x)		(((TUint32)(x) & 0x0E000000) >> 25)
-
-	TUint32 aVal = ((aInst) & 0x0E000000) >> 25;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping:: arm_rm(const TUint32 aInst)
-{
-//#define ARM_RM(x)				((TUint32)(x) & 0x0000000F)			// bit 0- 4
-
-	TUint32 aVal = (aInst) & 0x0000000F;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping:: arm_rs(const TUint32 aInst)
-{
-//#define ARM_RS(x)				(((TUint32)(x) & 0x00000F00) >> 8)	// bit 8-11
-
-	TUint32 aVal = ((aInst) & 0x00000F00) >> 8;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping:: arm_rd(const TUint32 aInst)
-{
-//#define ARM_RD(x)				(((TUint32)(x) & 0x0000F000) >> 12)	// bit 12-15
-
-	TUint32 aVal = ((aInst) & 0x0000F000) >> 12;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping:: arm_rn(const TUint32 aInst)
-{
-//#define ARM_RN(x)				(((TUint32)(x) & 0x000F0000) >> 16)	// bit 16-19
-
-	TUint32 aVal = ((aInst) & 0x000F0000) >> 16;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_load(const TUint32 aInst)
-{
-//#define ARM_LOAD(x)				(((TUint32)(x) & 0x00100000) >> 20)	// bit 20
-
-	TUint32 aVal = ((aInst) & 0x00100000) >> 20;
-
-	return aVal;
-}
-
-// Data processing instruction defines
-inline TUint32 DRMDStepping::arm_data_shift(const TUint32 aInst)
-{
-//#define ARM_DATA_SHIFT(x)		(((TUint32)(x) & 0x00000060) >> 5) 	// bit 5- 6
-	
-	TUint32 aVal = ((aInst) & 0x00000060) >> 5;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_data_c(const TUint32 aInst)
-{
-//#define ARM_DATA_C(x)			(((TUint32)(x) & 0x00000F80) >> 7) 	// bit 7-11
-
-	TUint32 aVal = ((aInst) & 0x00000F80) >> 7;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_data_imm(const TUint32 aInst)
-{
-//#define ARM_DATA_IMM(x)			((TUint32)(x) & 0x000000FF)			// bit 0-7
-
-	TUint32 aVal = (aInst) & 0x000000FF;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_data_rot(const TUint32 aInst)
-{
-//#define ARM_DATA_ROT(x)			(((TUint32)(x) & 0x00000F00) >> 8) 	// bit 8-11
-
-	TUint32 aVal = ((aInst) & 0x00000F00) >> 8;
-
-	return aVal;
-}
-
-// Single date transfer instruction defines
-inline TUint32 DRMDStepping::arm_single_imm(const TUint32 aInst)
-{
-//#define ARM_SINGLE_IMM(x)		((TUint32)(x) & 0x00000FFF)			// bit 0-11
-
-	TUint32 aVal = (aInst) & 0x00000FFF;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_single_byte(const TUint32 aInst)
-{
-//#define ARM_SINGLE_BYTE(x)		(((TUint32)(x) & 0x00400000) >> 22)	// bit 22
-
-	TUint32 aVal = ((aInst) & 0x00400000) >> 22;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_single_u(const TUint32 aInst)
-{
-//#define ARM_SINGLE_U(x)			(((TUint32)(x) & 0x00800000) >> 23)	// bit 23
-
-	TUint32 aVal = ((aInst) & 0x00800000) >> 23;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_single_pre(const TUint32 aInst)
-{
-//#define ARM_SINGLE_PRE(x)		(((TUint32)(x) & 0x01000000) >> 24)	// bit 24
-
-	TUint32 aVal = ((aInst) & 0x01000000) >> 24;
-
-	return aVal;
-}
-
-// Block data transfer instruction defines
-inline TUint32 DRMDStepping::arm_block_reglist(const TUint32 aInst)
-{
-//#define ARM_BLOCK_REGLIST(x)	((TUint32)(x) & 0x0000FFFF)		// bit 0-15
-
-	TUint32 aVal = (aInst) & 0x0000FFFF;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_block_u(const TUint32 aInst)
-{
-//#define ARM_BLOCK_U(x)			(((TUint32)(x) & 0x00800000) >> 23)	// bit 23
-
-	TUint32 aVal = ((aInst) & 0x00800000) >> 23;
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_block_pre(const TUint32 aInst)
-{
-//#define ARM_BLOCK_PRE(x)		(((TUint32)(x) & 0x01000000) >> 24)	// bit 24
-
-	TUint32 aVal = ((aInst) & 0x01000000) >> 24;
-
-	return aVal;
-}
-
-// Branch instruction defines
-inline TUint32 DRMDStepping::arm_b_addr(const TUint32 aInst)
-{
-//#define ARM_B_ADDR(x)			((x & 0x00800000) ? ((TUint32)(x) & 0x00FFFFFF | 0xFF000000) : (TUint32)(x) & 0x00FFFFFF)
-
-	TUint32 aVal = ((aInst & 0x00800000) ? ((TUint32)(aInst) & 0x00FFFFFF | 0xFF000000) : (TUint32)(aInst) & 0x00FFFFFF);
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_instr_b_dest(const TUint32 aInst, TUint32& aAddress)
-{
-//#define ARM_INSTR_B_DEST(x,a)	(ARM_B_ADDR(x) << 2) + ((TUint32)(a) + 8)
-
-	TUint32 aVal = (arm_b_addr(aInst) << 2) + ((TUint32)(aAddress) + 8);
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::thumb_b_addr(const TUint32 aInst)
-{
-//#define THUMB_B_ADDR(x) ((x & 0x0400) ? ((((TUint32)(x) & 0x07FF)<<11) | (((TUint32)(x) & 0x07FF0000)>>16) | 0xFFC00000) :\
-                                            ((TUint32)(x) & 0x07FF)<<11) | (((TUint32)(x) & 0x07FF0000)>>16)
-
-	TUint32 aVal = ((((TUint32)(aInst) & 0x07FF)<<11) | ((TUint32)(aInst) & 0x07FF0000)>>16);
-
-	return ((aInst & 0x0400) ? (aVal | 0xFFC00000) : aVal);
-}
-
-inline TUint32 DRMDStepping::thumb_instr_b_dest(const TUint32 aInst, TUint32& aAddress)
-{
-//#define THUMB_INSTR_B_DEST(x,a)	(THUMB_B_ADDR(x) << 1) + ((TUint32)(a) + 4)
-
-	TUint32 aVal = (thumb_b_addr(aInst) << 1) + ((TUint32)(aAddress) + 4);
-
-	return aVal;
-}
-
-inline TUint32 DRMDStepping::arm_carry_bit(void)
-{
-//#define ARM_CARRY_BIT			0x20000000	// bit 30
-
-	TUint32 aVal = 0x20000000;
-
-	return aVal;
-}
-
-// Thumb instruction bitmasks
-inline TUint16 DRMDStepping::thumb_opcode(const TUint16 aInst)
-{
-//	#define THUMB_OPCODE(x)		(((TUint16)(x) & 0xF800) >> 11)
-
-	TUint16 aVal = ((aInst) & 0xF800) >> 11;
-
-	return aVal;
-}
-
-inline TUint16 DRMDStepping::thumb_inst_7_15(const TUint16 aInst)
-{
-//	#define THUMB_INST_7_15(x)	(((TUint16)(x) & 0xFF80) >> 7)
-
-	TUint16 aVal = ((aInst) & 0xFF80) >> 7;
-
-	return aVal;
-}
-
-inline TUint16 DRMDStepping::thumb_inst_8_15(const TUint16 aInst)
-{
-//	#define THUMB_INST_8_15(x)	(((TUint16)(x) & 0xFF00) >> 8)
-
-	TUint16 aVal = ((aInst) & 0xFF00) >> 8;
-
-	return aVal;
-}
-
-#endif	// D_RMD_STEPPPING_INL
-
-// End of file - d-rmd-stepping.inl
--- a/kernel/eka/drivers/debug/rmdebug/d_target_process.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,420 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Purpose: The DProcessTracker object tracks which processes are being
-// debugged. The DProcessTracker class uses a DTargetProcess object for
-// each process being debugged.
-// Note: Although TheDProcessTracker object is a global, it should be unique
-// as only the Debug Security Server should load and use this driver.
-//
-//
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <kernel/kernel.h>
-#include <kernel/kern_priv.h>
-#include "nk_priv.h"
-#include <rm_debug_api.h>
-
-#include "d_target_process.h"
-#include "debug_logging.h"
-#include "debug_utils.h"
-
-// ctor
-DTargetProcess::DTargetProcess()
-	:iProcessName(0,0,0)
-	{
-	}
-
-// dtor
-DTargetProcess::~DTargetProcess()
-	{
-	// Delete the space allocated for the name if any
-	if (iProcessName.Ptr() != 0)
-		{
-		NKern::ThreadEnterCS();
-		Kern::Free((TAny*)iProcessName.Ptr());
-		NKern::ThreadLeaveCS();
-		}
-	//Reset the array and delete the objects that its members point to
-	NKern::ThreadEnterCS();
-	iAgentList.ResetAndDestroy();
-	NKern::ThreadLeaveCS();
-	}
-
-// Compare two DTargetProcess items. They are the same if they have the same name.
-TInt DTargetProcess::Compare(const DTargetProcess& aFirst, const DTargetProcess& aSecond)
-	{
-	return aFirst.iProcessName.Compare(aSecond.iProcessName);
-	}
-
-// Set the name of the process we are tracking
-TInt DTargetProcess::SetProcessName(const TDesC8& aProcessName)
-	{
-	// Argument checking
-	if (aProcessName.Length() < 1)
-		{
-		return KErrArgument;
-		}
-
-	// Allocate some memory to store the name
-	TUint length = aProcessName.Length();
-
-	NKern::ThreadEnterCS();
-	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
-	NKern::ThreadLeaveCS();
-	if (buffer==NULL)
-		{
-		// Out of memory
-		return KErrNoMemory;
-		}
-
-	// Set iProcessName to use the alloc'd buffer
-	iProcessName.Set(buffer,length,length);
-
-	// Store aProcessName within this object
-	iProcessName.Copy(aProcessName);
-
-	return KErrNone;
-	}
-
-// Obtain the name of the process being tracked
-const TPtr8& DTargetProcess::ProcessName(void)
-	{
-	return iProcessName;
-	}
-
-// Returns a pointer to the DDebugAgent with aAgentId.
-// If the agent is not in the list, it returns NULL.
-DDebugAgent* DTargetProcess::Agent(TUint64 aAgentId)
-	{
-	for(TInt i = 0; i < iAgentList.Count(); i++)
-		{
-		if (iAgentList[i]->Id() == aAgentId)
-			{
-			return iAgentList[i];
-			}
-		}
-
-	// what do we return if we don't have any agents?
-	return NULL;
-	}
-
-// Adds aAgentId as a tracking agent for this process.
-TInt DTargetProcess::AddAgent(TUint64 aAgentId)
-	{
-	
-	DDebugAgent* agent = DDebugAgent::New(aAgentId);
-	LOG_MSG4("DTargetProcess::AddAgent(), agentId=%d, curr iAgentList.Count=%d, new agent=0x%08x",
-		I64LOW(aAgentId), iAgentList.Count(), agent );
-
-	if(agent == NULL)
-		{
-		LOG_MSG("DTargetProcess::AddAgent() couldn't allocate memory for DDebugAgent");
-		return KErrNoMemory;
-		}
-	return iAgentList.Insert(agent,0);
-	}
-
-// Stops tracking the process with this agent
-TInt DTargetProcess::RemoveAgent(TUint64 aAgentId)
-	{
-	// We need to find and then remove the agent
-	for(TUint i = 0; i < iAgentList.Count(); i++)
-		{
-		if (iAgentList[i]->Id() == aAgentId)
-			{
-			delete iAgentList[i];
-			iAgentList.Remove(i);
-			return KErrNone;
-			}
-		}
-
-	return KErrNotFound;
-	}
-
-// Index through the agents by position
-DDebugAgent* DTargetProcess::operator[](TInt aIndex)
-	{
-	return iAgentList[aIndex];
-	}
-
-// returns the number of agents tracking this process.
-TInt DTargetProcess::AgentCount(void)
-	{
-	return iAgentList.Count();
-	}
-
-/**
-  Resume the specified thread
-
-  @param aThread thread to resume
-
-  @return KErrNone if the thread has previously been suspended and is resumed,
-  KErrNotFound if the thread has not previously been suspended
-  */
-TInt DTargetProcess::ResumeThread(DThread* aThread)
-	{
-	LOG_MSG2("DTargetProcess::ResumeSuspendedThread(): thread=0x%08x", aThread);
-	TInt err1 = ResumeSuspendedThread(aThread);
-	LOG_MSG2("DTargetProcess::ResumeSuspendedThread(): ret=%d)", err1); 
-	TInt err2 = ResumeFrozenThread(aThread->iNThread);
-	LOG_MSG2("DTargetProcess::ResumeFrozenThread(): ret=%d)", err2);
-	//if resuming the suspended thread failed for an obscure reason return it
-	if((err1 != KErrNotFound) && (err1 != KErrNone))
-		{
-		LOG_MSG2("DTargetProcess::ResumeThread() BUG : unexpected exit, err1: %d", err1);
-		return err1;
-		}
-	//if resuming the frozen thread failed for an obscure reason return it
-	if((err2 != KErrNotFound) && (err2 != KErrNone))
-		{
-		LOG_MSG2("DTargetProcess::ResumeThread() BUG : unexpected exit, err2: %d", err2);
-		return err2;
-		}
-	// if resuming the suspended thread succeeded in both cases, we have a consistency problem
-	if ((err1 == KErrNone) && (err2 == KErrNone))
-		{
-		LOG_MSG("DTargetProcess::ResumeThread() BUG : unexpected exit, err1 == err2 == KErrNone");
-		}
-
-	//if the thread was in neither list return KErrNotFound, otherwise KErrNone
-	return ((err1 == KErrNone) || (err2 == KErrNone)) ? KErrNone : KErrNotFound;
-	}
-
-/**
-  Resume the specified frozen thread
-
-  @param aThread thread to resume
-
-  @return KErrNone if the thread has previously been suspended and is resumed,
-  KErrNotFound if the thread has not previously been suspended
-  */
-TInt DTargetProcess::ResumeFrozenThread(NThread& aThread)
-	{
-	for(TInt i=0; i<iFrozenThreadSemaphores.Count(); i++)
-		{
-		if(iFrozenThreadSemaphores[i]->iOwningThread == &aThread)
-			{
-			NKern::FSSignal(iFrozenThreadSemaphores[i]);
-			NKern::ThreadEnterCS();
-			delete iFrozenThreadSemaphores[i];
-			NKern::ThreadLeaveCS();
-			iFrozenThreadSemaphores.Remove(i);
-			return KErrNone;
-			}
-		}
-	return KErrNotFound;
-	}
-
-/**
-  Resume the specified suspended thread
-
-  @param aThread thread to resume
-
-  @return KErrNone if the thread has previously been suspended and is resumed,
-  KErrNotFound if the thread has not previously been suspended
-  */
-TInt DTargetProcess::ResumeSuspendedThread(DThread* aThread)
-	{
-	TUint64 threadId = (TUint64)aThread->iId;
-	for(TInt i=0; i<iSuspendedThreads.Count(); i++)
-		{
-		if(iSuspendedThreads[i] == threadId)
-			{
-			iSuspendedThreads.Remove(i);
-			LOG_MSG2("DTargetProcess::ResumeSuspendedThread()> Kern::ThreadResume() 0x%08x", aThread);
-			Kern::ThreadResume(*aThread);
-			return KErrNone;
-			}
-		}
-	return KErrNotFound;
-	}
-
-/**
-  Suspend the specified thread
-
-  @param aThread thread to suspend
-
-  @param aFreezeThread suspend the thread on a Fast Semaphore if
-  ETrue. EFalse means suspend by calling Kern::Suspend.
-
-  @return KErrNone if the thread is successfully suspended,
-  KErrAlreadyExists if the agent has already suspended the thread,
-  or one of the other system wide error codes
-  
-   This function suspends a thread by calling Kern::Thread Suspend.
-                                                                                                       
-  An alternative means of suspending the _current_ thread only
-  is by call DTargetProcess::FreezeThread. This will ensure that
-  the current thread is suspended when exception processing for this
-  thread completes (see rm_debug_eventhandler.cpp)
-  
-  */
-TInt DTargetProcess::SuspendThread(DThread* aThread, TBool aFreezeThread)
-	{
-	// should check if this thread is already suspended/frozen and return if so
-	// but just warn for the moment.
-	if (CheckSuspended(aThread))
-		{
-		// thread was already suspended, don't bother doing it again
-		LOG_MSG2("DTargetProcess::SuspendThread - Thread Id 0x%08x already suspended\n",aThread->iId);
-		//return KErrAlreadyExists;	
-		}
-
-	return aFreezeThread ? FreezeThread() : DoSuspendThread(aThread);
-	}
-
-/**
-  Freeze the current thread
-
-  @return KErrNone if the thread is successfully suspended,
-  KErrAlreadyExists if the agent has already suspended the thread,
-  or one of the other system wide error codes
-
-  This marks the current thread for waiting on a Fast Semaphore
-  when exception handling for this thread has completed - see
-  rm_debug_eventhandler.cpp for details.
-  */
-TInt DTargetProcess::FreezeThread()
-	{
-	// create and store a fast semaphore to stop the thread on
-	NKern::ThreadEnterCS();
-	NFastSemaphore* sem = new NFastSemaphore();
-	NKern::ThreadLeaveCS();
-	sem->iOwningThread = &(Kern::CurrentThread().iNThread);
-	LOG_MSG3("DTargetProcess::FreezeThread(): new NFastSemaphore() owning thread==curr NThread=0x%08x, DThread=0x%08x", 
-		sem->iOwningThread, &(Kern::CurrentThread()) );
-	return iFrozenThreadSemaphores.Append(sem);
-	}
-
-/**
-  Suspend the specified thread
-
-  @param aThread thread to suspend
-
-  @return KErrNone if the thread is successfully suspended,
-  KErrAlreadyExists if the agent has already suspended the thread,
-  or one of the other system wide error codes
-  */
-TInt DTargetProcess::DoSuspendThread(DThread* aThread)
-	{
-	TUint64 threadId = (TUint64)aThread->iId;
-	
-	// Don't suspend if this thread is already suspended (by FSWait or
-	// Kern::ThreadSuspend
-	if (CheckSuspended(aThread))
-		{
-		// thread was already suspended, don't bother doing it again
-		LOG_MSG2("DTargetProcess::SuspendThread - Thread Id 0x%08x already suspended\n",threadId);
-		return KErrAlreadyExists;	
-		}
-
-	// Add thread to the suspend list
-	TInt err = iSuspendedThreads.Append(threadId);
-	if(err == KErrNone)
-		{
-		LOG_MSG2("DTargetProcess::DoSuspendThread >Kern::ThreadSuspend() 0x%08x", aThread ); 
-		Kern::ThreadSuspend(*aThread, 1);
-		}
-	return err;
-	}
-
-/**
- Waits the current thread on a Fast Semaphore.
-
- This is useful for situations where the current thread
- has hit a breakpoint within a critical section, and
- otherwise could not be suspended at this point.
-
- Note that the Fast Semaphore structure on which the thread
- waits must be a member data item of this class instance,
- as it needs to be FSSignal()'d by another thread to resume
- again.
- */
-void DTargetProcess::FSWait()
-	{
-	NThread* currentNThread = &(Kern::CurrentThread().iNThread);	
-	for(TInt i=0; i<iFrozenThreadSemaphores.Count(); i++)
-		{
-		if(iFrozenThreadSemaphores[i]->iOwningThread == currentNThread)
-			{
-			LOG_MSG4("DTargetProcess::FSWait(): > FSWait frozen sem %d, currentNThread=0x%08x, id=0x%x", 
-				i, currentNThread, Kern::CurrentThread().iId );
-			NKern::FSWait(iFrozenThreadSemaphores[i]);
-			return;
-			}
-		}
-	}
-
-/**
-  Checks that the thread has been suspended
-
-  @param aThread thread to check suspended
-
-  @return ETrue if the thread has been suspended,
-  EFalse if the thread has not been suspended
-  */
-TBool DTargetProcess::CheckSuspended(DThread* aThread) const
-	{
-	if(!aThread)
-		{
-		return EFalse;
-		}
-	//check if the thread is in the suspended threads list
-	for(TInt i=0; i<iSuspendedThreads.Count(); i++)
-		{
-		if(iSuspendedThreads[i] == (TUint64)aThread->iId)
-			{
-			return ETrue;
-			}
-		}
-	// not in the suspended threads list so check in the frozen threads list
-	NThread* nThread = &(aThread->iNThread);
-	for(TInt i=0; i<iFrozenThreadSemaphores.Count(); i++)
-		{
-		if(iFrozenThreadSemaphores[i]->iOwningThread == nThread)
-			{
-			return ETrue;
-			}
-		}
-	return EFalse;
-	}
-
-/*
-@return ETrue if the debug driver has suspended any of the process' threads, EFalse otherwise
-*/
-TBool DTargetProcess::HasSuspendedThreads() const
-	{
-	return (iSuspendedThreads.Count() > 0) || (iFrozenThreadSemaphores.Count() > 0);
-	}
-
-void DTargetProcess::NotifyEvent(const TDriverEventInfo& aEventInfo)
-	{
-	// Stuff the event info into all the tracking agents event queues
-	LOG_MSG4("DTargetProcess::NotifyEvent(): num attached agents: %d, iEventType=%d, this=0x%08x", 
-		AgentCount(), aEventInfo.iEventType, this);
-
-	for(TInt i = 0; i < AgentCount(); i++)
-		{
-		// Index through all the relevant debug agents
-		DDebugAgent* debugAgent = iAgentList[i];
-		if(debugAgent != NULL)
-			{
-			debugAgent->NotifyEvent(aEventInfo);
-			}
-		}
-	}
-
--- a/kernel/eka/drivers/debug/rmdebug/d_target_process.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Purpose: Kernel-side tracking of process state
-// 
-//
- 
-#ifndef D_TARGET_PROCESS_H
-#define D_TARGET_PROCESS_H
-
-#include "d_debug_agent.h"
-
-// Debug Process Tracker class
-class DTargetProcess : public DBase
-{
-public:
-	DTargetProcess();
-	~DTargetProcess();
-
-	static TInt Compare(const DTargetProcess& aFirst, const DTargetProcess& aSecond);
-
-	TInt SetProcessName(const TDesC8& aProcessName);
-
-	const TPtr8& ProcessName(void);
-
-	TInt AddAgent(const TUint64 aAgentId);
-
-	TInt RemoveAgent(TUint64 aAgentId);
-
-	DDebugAgent* operator[](TInt aIndex);
-
-	DDebugAgent* Agent(TUint64 aAgentId);
-
-	TInt AgentCount(void);
-	TInt ResumeThread(DThread* aThread);
-	TInt SuspendThread(DThread* aThread, TBool aFreezeThread=EFalse);
-	TBool CheckSuspended(DThread* aThread) const;
-	void FSWait();
-	TBool HasSuspendedThreads() const;
-	void NotifyEvent(const TDriverEventInfo& aEventInfo);
-
-private:
-	TInt ResumeFrozenThread(NThread& aThread);
-	TInt ResumeSuspendedThread(DThread* aThread);
-	TInt FreezeThread();
-	TInt DoSuspendThread(DThread* aThread);
-
-private:
-	TPtr8 iProcessName;
-
-	RPointerArray<DDebugAgent> iAgentList;
-
-	RArray<TUint64> iSuspendedThreads;
-
-	RPointerArray<NFastSemaphore> iFrozenThreadSemaphores;
-
-};
-
-#endif // D_TARGET_PROCESS_H
-
--- a/kernel/eka/drivers/debug/rmdebug/rm_debug_eventhandler.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-// Kernel Event handler for Run Mode Debug.
-//
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <kernel/arm/arm.h>
-#include <kernel/kernel.h>
-#include <kernel/kern_priv.h>
-#include <nk_trace.h>
-
-#include <rm_debug_api.h>
-#include "debug_logging.h"
-#include "d_process_tracker.h"
-#include "d_rmd_stepping.h"
-#include "rm_debug_kerneldriver.h"
-#include "rm_debug_driver.h"
-#include "rm_debug_eventhandler.h"
-
-
-DRM_DebugEventHandler::DRM_DebugEventHandler()
-	:	DKernelEventHandler(EventHandler, this)
-{
-	LOG_MSG("DRM_DebugEventHandler::DRM_DebugEventHandler()");
-
-	for(TInt i=0; i<EEventLimit; i++)
-		{
-		iEventHandlers[i] = &DRM_DebugChannel::HandleUnsupportedEvent;
-		}
-	iEventHandlers[EEventUserTrace] = &DRM_DebugChannel::HandleUserTrace;
-	iEventHandlers[EEventRemoveLibrary] = &DRM_DebugChannel::RemoveLibrary;
-	iEventHandlers[EEventAddLibrary] = &DRM_DebugChannel::AddLibrary;
-	iEventHandlers[EEventStartThread] = &DRM_DebugChannel::StartThread;
-	iEventHandlers[EEventSwExc] = &DRM_DebugChannel::HandleSwException;
-	iEventHandlers[EEventHwExc] = &DRM_DebugChannel::HandleHwException;
-	iEventHandlers[EEventKillThread] = &DRM_DebugChannel::HandleEventKillThread;
-	iEventHandlers[EEventAddProcess] = &DRM_DebugChannel::HandleAddProcessEvent;
-	iEventHandlers[EEventRemoveProcess] = &DRM_DebugChannel::HandleRemoveProcessEvent;
-}
-
-TInt DRM_DebugEventHandler::Create(DLogicalDevice* aDevice, DLogicalChannel* aChannel, DThread* aClient)
-{
-	LOG_MSG3("DRM_DebugEventHandler::Create(), aClientthread=0x%08x id=%d", aClient, aClient->iId);
-
-	TInt err;
-	err = aDevice->Open();
-	if (err != KErrNone)
-		return err;
-	iDevice = aDevice;
-	
-	iChannel = (DRM_DebugChannel*)aChannel; //Don't add ref the channel, since channel closes the event handler before it ever gets destroyed.
-
-	err = aClient->Open();
-	if (err != KErrNone)
-		return err;
-	iClientThread = aClient;
-
-	// Use a semaphore to protect our data structures from concurrent access.
-	err = Kern::SemaphoreCreate(iProtectionLock, _L("RM_DebugEventHandlerLock"), 1 /* Initial count */);
-	if (err != KErrNone)
-		return err;
-
-
-	return Add();
-}
-
-
-DRM_DebugEventHandler::~DRM_DebugEventHandler()
-{
-	LOG_MSG("DRM_DebugEventHandler::~DRM_DebugEventHandler()");
-
-	if (iProtectionLock)
-		iProtectionLock->Close(NULL);
-	
-	if (iDevice)
-		iDevice->Close(NULL);	
-	
-	if (iClientThread)
-		Kern::SafeClose((DObject*&)iClientThread, NULL);
-		
-}
-
-
-TInt DRM_DebugEventHandler::Start()
-{
-	LOG_MSG("DRM_DebugEventHandler::Start()");
-
-	iTracking = ETrue;
-
-	return KErrNone;
-}
-
-
-TInt DRM_DebugEventHandler::Stop()
-{
-	LOG_MSG("DRM_DebugEventHandler::Stop()");
-
-	iTracking = EFalse;
-
-	return KErrNone;
-}
-
-
-TUint DRM_DebugEventHandler::EventHandler(TKernelEvent aType, TAny* a1, TAny* a2, TAny* aThis)
-{
-	return ((DRM_DebugEventHandler*)aThis)->HandleEvent(aType, a1, a2);
-}
-
-
-
-TUint DRM_DebugEventHandler::HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2)
-	{
-	
-	/*
-	 * Check if we are tracking things at all OR 
-	 * this event is beyond the limit of known events OR 
-	 * this event is from the debug thread itself (don't want to debug ourselves) OR
-	 * this event has a handler (there is no point in proceeding without a handler)
-	 */
-	if( (!iTracking) || 
-			(aType > (TUint32)EEventLimit) ||
-			(iClientThread == &Kern::CurrentThread()) ||
-	    (iEventHandlers[aType] == &DRM_DebugChannel::HandleUnsupportedEvent) )
-		{
-		return ERunNext;
-		}
-	return HandleSpecificEvent(aType,a1,a2) ? EExcHandled : ERunNext;
-	}
-
-TBool DRM_DebugEventHandler::HandleSpecificEvent(TKernelEvent aType, TAny* a1, TAny* a2)
-	{
-	TBool ret = EFalse;
-
-	NKern::ThreadEnterCS();
-	LockDataAccess();
-
-
-	if (iChannel)
-		{
-		ret = (iChannel->*(iEventHandlers[aType]))(a1, a2);
-		}
-	ReleaseDataAccess();
-	NKern::ThreadLeaveCS();
-
-	switch(aType)
-		{
-		case EEventHwExc:
-		case EEventKillThread:
-			{
-			LOG_MSG2("DRM_DebugEventHandler::HandleEvent() -> FSWait(), kernel event type: %d", (TUint32)aType);
-			TheDProcessTracker.FSWait();
-			LOG_MSG("DRM_DebugEventHandler::HandleEvent() <- FSWait()");
-			break;
-			}
-		default:
-			break;
-		}
-	return ret;
-	}
-
--- a/kernel/eka/drivers/debug/rmdebug/rm_debug_kerneldriver.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3791 +0,0 @@
-// Copyright (c) 2004-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:
-//
-// Description:
-// Device driver for kernel side debug assist
-//
-
-#ifdef __WINS__
-#error - this driver cannot be built for emulation
-#endif
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <e32ldr.h>
-#include <u32std.h>
-#include <kernel/kernel.h>
-#include <kernel/kern_priv.h>
-#include <nk_trace.h>
-#include <arm.h>
-#include <kernel/cache.h>
-#include <platform.h>
-#include <nkern.h>
-#include <u32hal.h>
-#include <kernel/kdebug.h>
-#include <rm_debug_api.h>
-
-#include "debug_logging.h"
-#include "d_rmd_breakpoints.h"	// moved breakpoints code lives here
-#include "d_rmd_stepping.h"		// moved stepping code lives here
-#include "rm_debug_kerneldriver.h"
-#include "d_list_manager.h"
-#include "rm_debug_driver.h"
-#include "rm_debug_eventhandler.h"
-#include "d_debug_functionality.h"
-#include "d_process_tracker.h"
-#include "debug_utils.h"
-#include "d_buffer_manager.h"
-
-using namespace Debug;
-
-/////////////////////////////////////////////////////////////////////////
-//
-// DRM_DebugDriverFactory implementation
-//
-/////////////////////////////////////////////////////////////////////////
-
-//
-// DRM_DebugDriverFactory constructor
-//
-DRM_DebugDriverFactory::DRM_DebugDriverFactory()
-	{
-	iVersion = TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
-	}
-
-//
-// DRM_DebugDriverFactory::Create
-//
-TInt DRM_DebugDriverFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-	if (iOpenChannels != 0)
-		return KErrInUse; // a channel is already open
-
-	aChannel = new DRM_DebugChannel(this);
-
-	return aChannel ? KErrNone : KErrNoMemory;
-	}
-
-//
-// DRM_DebugDriverFactory::Install
-//
-TInt DRM_DebugDriverFactory::Install()
-	{
-	return(SetName(&KRM_DebugDriverName));
-	}
-
-//
-// DRM_DebugDriverFactory::Install
-//
-void DRM_DebugDriverFactory::GetCaps(TDes8& aDes) const
-	{
-	TCapsRM_DebugDriver b;
-	b.iVersion = TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber);
-
-	Kern::InfoCopy(aDes,(TUint8*)&b,sizeof(b));
-	}
-
-/////////////////////////////////////////////////////////////////////////
-//
-// DRM_DebugChannel implementation
-//
-/////////////////////////////////////////////////////////////////////////
-
-//
-// DRM_DebugChannel constructor
-//
-DRM_DebugChannel::DRM_DebugChannel(DLogicalDevice* aLogicalDevice)
-	: iExcludedROMAddressStart(ROM_LINEAR_BASE),
-	iExcludedROMAddressEnd(0),
-	iPageSize(0x1000),
-	iBreakManager(0),
-	iStepper(0),
-	iStepLock(0),
-	iDfcQ(NULL),
-	iInitialisedCodeModifier(0),
-	iAsyncGetValueRequest(NULL)
-	{
-	LOG_MSG("DRM_DebugChannel::DRM_DebugChannel()");
-
-	iDevice = aLogicalDevice;
-
-	iClientThread = &Kern::CurrentThread();
-	iClientThread->Open();
-
-	LOG_MSG3("DRM_DebugChannel::DRM_DebugChannel() clientThread = 0x%08x, id=%d", 
-	            iClientThread, iClientThread->iId );
-
-
-	iPageSize = Kern::RoundToPageSize(1);
-	}
-
-//
-// DRM_DebugChannel destructor
-//
-DRM_DebugChannel::~DRM_DebugChannel()
-	{
-	LOG_MSG("DRM_DebugChannel::~DRM_DebugChannel()");
-
-	if (iAsyncGetValueRequest)
-		{
-		Kern::QueueRequestComplete(iClientThread, iAsyncGetValueRequest, KErrCancel); // does nothing if request not pending
-		Kern::DestroyClientRequest(iAsyncGetValueRequest);
-		}
-
-	NKern::ThreadEnterCS();
-	Kern::SafeClose((DObject*&)iClientThread, NULL);
-	NKern::ThreadLeaveCS();
-
-	// Close breakpoint manager
-	if (iBreakManager)
-		{
-		NKern::ThreadEnterCS();
-		delete iBreakManager;
-		NKern::ThreadLeaveCS();
-		}
-
-	// Close stepping manager
-	if (iStepper)
-		{
-		NKern::ThreadEnterCS();
-		delete iStepper;
-		NKern::ThreadLeaveCS();
-		}
-
-	//close the debug process list
-	iDebugProcessList.Close();
-
-	DestroyDfcQ();
-
-	//close the code modifier
-	if (iInitialisedCodeModifier)
-		{
-		DebugSupport::CloseCodeModifier();
-		}
-	}
-
-void DRM_DebugChannel::DestroyDfcQ()
-	{
-	LOG_MSG("DRM_DebugChannel::DestroyDfcQ()");
-	if (iDfcQ)
-		{
-		NKern::ThreadEnterCS();
-		iDfcQ->Destroy();
-		NKern::ThreadLeaveCS();
-		}
-	}
-
-//
-// DRM_DebugChannel::DoCreate
-//
-TInt DRM_DebugChannel::DoCreate(TInt /*aUnit*/, const TDesC* anInfo, const TVersion& aVer)
-	{
-	LOG_MSG("DRM_DebugChannel::DoCreate()");
-	TInt err = Kern::CreateClientDataRequest(iAsyncGetValueRequest);
-	if(err != KErrNone)
-		return err;
-
-	if (!Kern::QueryVersionSupported(TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber), aVer))
-		return KErrNotSupported;
-
-	// Do the security check here so that any arbitrary application doesn't make
-	// use of Trk kernel driver.
-	if (!DoSecurityCheck())
-		{
-		LOG_MSG("DRM_DebugChannel::DoCreate() - permission denied!");
-			return KErrPermissionDenied;
-		}
-
-	if (anInfo)
-		{
-		// this is the end address of the user library.
-		// this doesn't seem to be valid for EKA2.
-		// right now we dont need this for EKA2 since we are not worried
-		// about kernel being stopped as kernel is multithreaded.
-		// just retaining this for future use.
-		TBuf8<32> buf;
-		TInt err = Kern::ThreadRawRead(iClientThread, anInfo, &buf, 32);
-		if(err != KErrNone)
-			return err;
-		}
-
-	// Allocate a D_RMD_Breakpoints class as a breakpoint manager
-	NKern::ThreadEnterCS();
-	iBreakManager = new D_RMD_Breakpoints(this);
-	NKern::ThreadLeaveCS();
-	if (iBreakManager == NULL)
-		{
-		LOG_MSG("DRM_DebugChannel::DRM_DebugChannel - could not construct breakpoint manager");
-		return KErrNoMemory;
-		}
-
-	// Initialise the new breakpoint manager object
-	iBreakManager->Init();
-
-	// Allocate a DRMDStepping class as the stepping manager
-	NKern::ThreadEnterCS();
-	iStepper = new DRMDStepping(this);
-	NKern::ThreadLeaveCS();
-	if (iStepper == NULL)
-		{
-		LOG_MSG("DRM_DebugChannel::DRM_DebugChannel - could not construct stepper manager");
-		return KErrNoMemory;
-		}
-
-	// Initialize the code modifier for managing breakpoints.
-	TUint caps; //ignored for now
-	err = DebugSupport::InitialiseCodeModifier(caps, NUMBER_OF_MAX_BREAKPOINTS);
-	//if code modifier initializer failed,
-	//return here, since we can't set an breakpoints
-	if(err != KErrNone)
-		{
-		return err;
-		}
-	else
-		{
-		iInitialisedCodeModifier = ETrue;
-		}
-
-	//create and set the driver's Dfc queue
-	err = CreateDfcQ();
-	if(err != KErrNone)
-		{
-		LOG_MSG("DRM_DebugChannel::DoCreate() Creating Dfc queue failed.");
-		}
-	SetDfcQ(iDfcQ);
-
-	iMsgQ.Receive();
-
-	iEventHandler = new DRM_DebugEventHandler;
-	if (!iEventHandler)
-		return KErrNoMemory;
-	err = iEventHandler->Create(iDevice, this, iClientThread);
-	if (err != KErrNone)
-		return err;
-
-	//return KErrNone;
-	return iEventHandler->Start();
-	}
-
-/**
-Forward call to either synch or asynch methods while serialising all calls via lock.
- 
-Protect access via a the event handler lock to 
-serialise all calls and protect concurrent access to data structures
-
-@param aMsg pointer to a TMessageBase object 
-
-@return error returned by called methods
-
-@see DRM_DebugEventHandler::HandleSpecificEvent where lock is also used
-@see DRM_DebugEventHandler::iProtectionLock
-
-*/
-TInt DRM_DebugChannel::SendMsg(TMessageBase* aMsg)
-	{
-	DThread * currThread = &Kern::CurrentThread();
-	LOG_MSG3("DRM_DebugChannel::SendMsg() currThread = 0x%08x, iClientThread=0x%08x", currThread, iClientThread );
-
-	iEventHandler->LockDataAccess();
-	
-	TThreadMessage& m = *(TThreadMessage*)aMsg;
-	TInt id = m.iValue;
-	TInt err = KErrNone;
-
-	if (id != (TInt)ECloseMsg && id != KMaxTInt && id < 0)
-		{
-		// DoRequest
-		TRequestStatus* pStatus = (TRequestStatus*)m.Ptr0();
-		err = SendRequest(aMsg);
-		if (err != KErrNone)
-			Kern::RequestComplete(pStatus,err);
-		}
-	else
-		{
-		err = DLogicalChannel::SendMsg(aMsg);
-		}
-	
-	iEventHandler->ReleaseDataAccess();
-	return err;
-	}
-
-//
-// DRM_DebugChannel::SendRequest
-//
-TInt DRM_DebugChannel::SendRequest(TMessageBase* aMsg)
-	{
-	LOG_MSG("DRM_DebugChannel::SendRequest()");
-
-	TThreadMessage& m = *(TThreadMessage*)aMsg;
-	TInt function = ~m.iValue;
-	TRequestStatus* pStatus = (TRequestStatus*)m.Ptr0();
-	TAny* a1 = m.Ptr1();
-
-	TInt err = KErrNotSupported;
-	switch(function)
-		{
-		case RRM_DebugDriver::ERequestGetEvent:
-			err = PreAsyncGetValue((TEventInfo*)a1,pStatus);
-			break;
-		}
-	if (err == KErrNone)
-		err = DLogicalChannel::SendMsg(aMsg);
-	return err;
-	}
-
-//
-// DRM_DebugChannel::PreAsyncGetValue
-//
-TInt DRM_DebugChannel::PreAsyncGetValue(TEventInfo* aValue, TRequestStatus* aStatus)
-	{
-	LOG_MSG3("DRM_DebugChannel::PreAsyncGetValue() TEventInfo=0x%08x, TRequestStatus=0x%08x",
-		aValue, aStatus );
-	
-	iAsyncGetValueRequest->Reset();
-	
-	TInt err = iAsyncGetValueRequest->SetStatus(aStatus);
-	if (err != KErrNone)
-		return err;
-	
-	iAsyncGetValueRequest->SetDestPtr(aValue);
-	return KErrNone;
-	}
-
-/**
-  Create the Dfc queue for receiving messages
-  */
-TInt DRM_DebugChannel::CreateDfcQ()
-	{
-	LOG_MSG("DRM_DebugChannel::CreateDfcQ()");
-	TInt r = Kern::DynamicDfcQCreate(iDfcQ, KRmDebugDriverThreadPriority, KRM_DebugDriverName);
-	// Fix to stop t_rmdebug2 etc crashing the device.
-	// This should be removed once the rm debug driver has been updated for WDP.
-	if (r == KErrNone)
-		iDfcQ->SetRealtimeState(ERealtimeStateOff);
-	return r;
-	}
-
-//
-// DRM_DebugChannel::DoCancel
-//
-// New: The cancel call does not take an enum parameter describing
-// the request to be cancelled. Rather it supplies a pointer
-// to a user-side struct defining the cancellation
-//
-void DRM_DebugChannel::DoCancel(TInt aReqNo)
-	{
-	LOG_MSG("DRM_DebugChannel::DoCancel()");
-
-	TRMD_DebugCancelInfo info;
-
-	TInt err = Kern::ThreadRawRead(iClientThread,(TAny*)aReqNo,(TAny*)&info,sizeof(info));
-	if (err != KErrNone)
-		{
-		// How do we cancel something we know nothing about???
-		LOG_MSG("DRM_DebugChannel::DoCancel - bad arguments");
-		return;
-		}
-
-	// Find the process
-	DTargetProcess* pProcess = TheDProcessTracker.FindProcess(info.iProcessName);
-	if (pProcess == NULL)
-		{
-		// We are doomed. We don't know which event to cancel..
-		LOG_MSG2("Cannot determine which process is being debugged: %S", &(info.iProcessName));
-
-		return;
-		}
-
-	// Find the agent
-	DDebugAgent* debugAgent = pProcess->Agent(info.iAgentId);
-	if (debugAgent == NULL)
-		{
-		// Bad agent means there is no tracking agent
-		LOG_MSG2("Cannot locate debug agent with pid 0x%0x16lx",info.iAgentId);
-		return;
-		}
-
-	// Agent completes/pends the request as appropriate.
-	debugAgent->CancelGetEvent();
-
-	}
-
-//
-// DRM_DebugChannel::DoRequest
-//
-void DRM_DebugChannel::DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2)
-	{
-	LOG_MSG4("DRM_DebugChannel::DoRequest(), iClientThread=0x%08x, tid=0x%08x, TRequestStatus=0x%08x", 
-		iClientThread, I64LOW(iClientThread->iId), aStatus);
-
-	switch(aReqNo)
-		{
-		case RRM_DebugDriver::ERequestGetEvent:
-			{
-			TEventMetaData eventMetaData;
-			TInt err = Kern::ThreadRawRead(iClientThread, a2, (TUint8 *)&eventMetaData, sizeof(TEventMetaData) );
-			if (err != KErrNone)
-				{
-				LOG_MSG("Error: could not read argument data from the DSS (TEventMetaData)");
-
-				// We could not read information from the user, so the a2 argument is probably wrong
-				Kern::RequestComplete(iClientThread, aStatus, KErrArgument);
-				return;
-				}
-
-			// Find the process
-			DTargetProcess* pProcess = TheDProcessTracker.FindProcess(eventMetaData.iTargetProcessName);
-			if (pProcess == NULL)
-				{
-				LOG_MSG("Cannot identify process being debugged");
-
-				// We could not locate the process, so the user asked for the wrong one.
-				Kern::RequestComplete(iClientThread, aStatus, KErrArgument);
-				return;
-				}
-
-			// Find the agent
-			DDebugAgent* debugAgent = pProcess->Agent(eventMetaData.iDebugAgentProcessId);
-			LOG_MSG5(" For agent pid=%d, DTargetProcess=0x%08x, Agent=0x%08x, iAsyncGetValueRequest0x%08x", 
-				I64LOW(eventMetaData.iDebugAgentProcessId), pProcess, debugAgent, iAsyncGetValueRequest );
-
-			if (debugAgent == NULL)
-				{
-				// Bad agent means there is no tracking agent
-				LOG_MSG2("Cannot locate debug agent with pid 0x%0x16lx",eventMetaData.iDebugAgentProcessId);
-				return;
-				}
-			// Agent completes/pends the request as appropriate.
-			debugAgent->GetEvent(iAsyncGetValueRequest, iClientThread);
-
-			break;
-			}
-		default:
-			{
-			// Don't know what to do, should not get here!
-			LOG_MSG("DRM_DebugChannel::DoRequest was passed an unsupported request aReqNo");
-
-			Kern::RequestComplete(iClientThread, aStatus, KErrNotSupported);
-			}
-		}
-	}
-
-//
-// DRM_DebugChannel::DoControl
-//
-TInt DRM_DebugChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
-	{
-	LOG_MSG("DRM_DebugChannel::DoControl()");
-
-	LOG_MSG2("DoControl Function %d", aFunction);
-
-	TInt err = KErrBadHandle;
-	DThread* threadObj = NULL;
-
-	switch(aFunction)
-		{
-		/* Security first */
-		case RRM_DebugDriver::EControlIsDebuggable:
-			{
-			err = IsDebuggable((TUint32)a1);
-			break;
-			}
-		case RRM_DebugDriver::EControlSetBreak:
-			{
-			err = SetBreak((TSetBreakInfo*)a1);
-			break;
-			}
-		case RRM_DebugDriver::EControlClearBreak:
-			{
-			err = iBreakManager->DoClearBreak((TInt32)a1);
-			break;
-			}
-		case RRM_DebugDriver::EControlModifyBreak:
-			{
-			err = iBreakManager->DoModifyBreak((TModifyBreakInfo*)a1);
-			break;
-			}
-		case RRM_DebugDriver::EControlModifyProcessBreak:
-			{
-			err = iBreakManager->DoModifyProcessBreak((TModifyProcessBreakInfo*)a1);
-			break;
-			}
-		case RRM_DebugDriver::EControlBreakInfo:
-			{
-			err = iBreakManager->DoBreakInfo((TGetBreakInfo*)a1);
-			break;
-			}
-		case RRM_DebugDriver::EControlSuspendThread:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-			{
-				err = DoSuspendThread(threadObj);
-			}
-			break;
-			}
-		case RRM_DebugDriver::EControlResumeThread:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = DoResumeThread(threadObj);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlStepRange:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = StepRange(threadObj, (TRM_DebugStepInfo*)a2);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlReadMemory:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = ReadMemory(threadObj, (TRM_DebugMemoryInfo*)a2);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlWriteMemory:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = WriteMemory(threadObj, (TRM_DebugMemoryInfo*)a2);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlReadRegistersLegacy:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = ReadRegistersLegacy(threadObj, (TRM_DebugRegisterInfo*)a2);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlWriteRegistersLegacy:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = WriteRegistersLegacy(threadObj, (TRM_DebugRegisterInfo*)a2);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlReadRegisters:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = ReadRegisters(threadObj, (TRM_DebugRegisterInformation*)a2);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlWriteRegisters:
-			{
-			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
-			if (threadObj)
-				{
-				err = WriteRegisters(threadObj, (TRM_DebugRegisterInformation*)a2);
-				}
-			break;
-			}
-		case RRM_DebugDriver::EControlGetDebugFunctionalityBufSize:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlGetDebugFunctionalityBufSize\n");
-
-			TDebugFunctionality df;
-
-			TUint size = df.GetDebugFunctionalityBufSize();
-
-			// Return size to user-side in a safe manner
-			err = Kern::ThreadRawWrite(iClientThread, a1, (TUint8*)&size, sizeof(TUint), iClientThread);
-			break;
-			}
-		case RRM_DebugDriver::EControlGetDebugFunctionality:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlGetDebugFunctionality\n");
-
-			TDebugFunctionality df;
-
-			TUint32 dfsize = df.GetDebugFunctionalityBufSize();
-
-			// Alloc tmp buffer for Debug Functionality data
-			NKern::ThreadEnterCS();
-			TUint8* dfbuffer = (TUint8*)Kern::AllocZ(dfsize);
-			NKern::ThreadLeaveCS();
-			if (dfbuffer==NULL)
-				{
-				LOG_MSG2("Could not allocate memory for %d bytes\n",dfsize);
-
-				// could not allocate memory
-				return KErrNoMemory;
-				}
-
-			// Temporary descriptor to hold DF data
-			TPtr8 tmpPtr(dfbuffer,0,dfsize);
-
-			// Obtain the DF data
-			if (df.GetDebugFunctionality(tmpPtr) )
-				{
-				// Return the DF data to the user-side
-				err = Kern::ThreadDesWrite(iClientThread, a1, tmpPtr, 0, KChunkShiftBy0, iClientThread);
-				}
-			else
-				{
-				// Failed.
-				err = KErrGeneral;
-				}
-
-			// Free tmp buffer
-			NKern::ThreadEnterCS();
-			Kern::Free(dfbuffer);
-			NKern::ThreadLeaveCS();
-			break;
-			}
-		case RRM_DebugDriver::EControlAttachProcess:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlAttachProcess");
-
-			err = AttachProcess(a1,a2);
-			break;
-			}
-		case RRM_DebugDriver::EControlDetachProcess:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlDetachProcess");
-
-			err = DetachProcess(a1,a2);
-			break;
-			}
-		case RRM_DebugDriver::EControlDetachAgent:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlDetachAgent");
-
-			err = DetachAgent(a1,a2);
-			break;
-			}
-		case RRM_DebugDriver::EControlSetEventAction:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlSetEventAction");
-
-			err = SetEventAction(a1,a2);
-			break;
-			}
-		case RRM_DebugDriver::EControlGetMemoryOperationMaxBlockSize:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlGetMemoryOperationMaxBlockSize\n");
-
-			TUint32 maxSize = TDebugFunctionality::GetMemoryOperationMaxBlockSize();
-
-			// Return size to user-side in a safe manner
-			err = Kern::ThreadRawWrite(iClientThread, a1, (TUint8*)&maxSize, sizeof(TUint32), iClientThread);
-			break;
-			}
-		case RRM_DebugDriver::EControlGetList:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlGetList\n");
-			err = GetList((TListInformation*)a1);
-			break;
-			}
-		case RRM_DebugDriver::EControlStep:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlStep\n");
-
-			err = Step((TUint32)a1,(TUint32)a2);
-			break;
-			}
-		case RRM_DebugDriver::EControlKillProcess:
-			{
-			LOG_MSG("RRM_DebugDriver::EControlKillProcess\n");
-
-			err = KillProcess((TUint32)a1,(TUint32)a2);
-			break;
-			}
-		default:
-			{
-			err = KErrGeneral;
-			}
-		}
-
-	if (KErrNone != err)
-		{
-		LOG_MSG2("Error %d from control function", err);
-		}
-
-	if (threadObj)
-		{
-		// Close the thread handle which has been opened by DebugUtils::OpenThreadHandle
-		threadObj->Close(NULL);
-		}
-
-	return err;
-	}
-
-void DRM_DebugChannel::HandleMsg(TMessageBase* aMsg)
-	{
-	LOG_MSG("DRM_DebugChannel::HandleMsg()");
-
-	TThreadMessage& m = *(TThreadMessage*)aMsg;
-	TInt id = m.iValue;
-
-	if (id == (TInt)ECloseMsg)
-		{
-		if (iEventHandler)
-			{
-			iEventHandler->Stop();
-			iEventHandler->Close();
-			iEventHandler = NULL;
-			}
-		m.Complete(KErrNone, EFalse);
-		return;
-		}
-
-	if (id == KMaxTInt)
-		{
-		// DoCancel
-		DoCancel(m.Int0());
-		m.Complete(KErrNone, ETrue);
-		return;
-		}
-
-	if (id < 0)
-		{
-		// DoRequest
-		TRequestStatus* pStatus = (TRequestStatus*)m.Ptr0();
-		DoRequest(~id, pStatus, m.Ptr1(), m.Ptr2());
-		m.Complete(KErrNone, ETrue);
-		}
-	else
-		{
-		// DoControl
-		TInt err = DoControl(id, m.Ptr0(), m.Ptr1());
-		m.Complete(err, ETrue);
-		}
-	}
-
-//
-// DRM_DebugChannel::RemoveProcess
-//
-TBool DRM_DebugChannel::RemoveProcess(TAny* a1, TAny* a2)
-	{
-	LOG_MSG("DRM_DebugChannel::RemoveProcess()");
-
-	DProcess *aProcess = (DProcess*)a1;
-
-	// Sanity check
-	if (!aProcess)
-		{
-		// No process was specified!
-		LOG_MSG("DRM_DebugChannel::RemoveProcess was called with an invalid process ID");
-		return EFalse;
-		}
-
-	// this is called when a process dies.  we want to mark any breakpoints in this
-	// process space as obsolete.  the main reason for this is so we don't return
-	// an error when the host debugger tries to clear breakpoints for the process
-
-	TUint32 codeAddress = 0;
-	TUint32 codeSize = 0;
-
-	LOG_EVENT_MSG2("Process being removed, Name %S", aProcess->iName);
-
-	DCodeSeg* codeSeg = aProcess->iCodeSeg;
-
-	if (codeSeg)
-		{
-		TModuleMemoryInfo processMemoryInfo;
-		TInt err = codeSeg->GetMemoryInfo(processMemoryInfo, aProcess);
-		if (err != KErrNone)
-			{
-			codeAddress = processMemoryInfo.iCodeBase;
-			codeSize = processMemoryInfo.iCodeSize;
-			}
-		else
-			{
-			LOG_MSG2("Error in getting memory info: %d", err);
-			}
-		}
-
-	if (!codeAddress || !codeSize)
-		{
-		LOG_EVENT_MSG2("Code segment not available for process %d", aProcess->iId);
-		// make sure there is not already a breakpoint at this address
-		for (TInt i = 0; i < iDebugProcessList.Count(); i++)
-			{
-			if (iDebugProcessList[i].iId == aProcess->iId)
-				{
-				codeAddress = iDebugProcessList[i].iCodeAddress;
-				codeSize = iDebugProcessList[i].iCodeSize;
-
-				//now remove from the list
-				iDebugProcessList.Remove(i);
-				break;
-				}
-			}
-		}
-
-	if (!codeAddress || !codeSize)
-		{
-		return EFalse;
-		}
-
-	iBreakManager->RemoveBreaksForProcess(aProcess->iId, codeAddress, codeSize);
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::StartThread
-//
-TBool DRM_DebugChannel::StartThread(TAny* a1, TAny* a2)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::StartThread()");
-
-	DThread *aThread = (DThread*)a1;
-	if(!aThread)
-		{
-		LOG_MSG("Error getting DThread object");
-		__NK_ASSERT_DEBUG(aThread);
-		return EFalse;
-		}
-
-	//a2 points to the thread creating the new thread.
-	//We have no use for it at the moment so just ignore it for now
-
-	TDriverEventInfo info;
-	info.iEventType = EEventsStartThread;
-	info.iThreadId = aThread->iId;
-	info.iThreadIdValid = ETrue;
-	DProcess* owningProcess = aThread->iOwningProcess;
-	if(owningProcess)
-		{
-		info.iProcessId = owningProcess->iId;
-		info.iProcessIdValid = ETrue;
-		DCodeSeg* p = owningProcess->iCodeSeg;
-		if(p && p->iFileName)
-			{
-			info.iFileName.Copy(*(p->iFileName));
-			DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(p->iFileName));
-			if(foundProcess)
-				{
-				foundProcess->NotifyEvent(info);
-				}
-			else
-				{
-				LOG_EVENT_MSG2("Couldn't find process with name [%S]", p->iFileName);
-				}
-			}
-		else
-			{
-			if(p)
-				{
-				LOG_EVENT_MSG("\tCode segment name missing");
-				}
-			else
-				{
-				LOG_EVENT_MSG("\tCode segment is NULL");
-				}
-			}
-		}
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::HandleAddProcessEvent
-//
-TBool DRM_DebugChannel::HandleAddProcessEvent(TAny* a1, TAny* a2)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::AddProcess()");
-
-	DProcess *aProcess = (DProcess*)a1;
-	// a2 points to the thread creating the new process.
-	DThread *aThread = (DThread*)a2;
-
-	if(!aProcess)
-		{
-		LOG_MSG("Error getting DProcess object");
-		__NK_ASSERT_DEBUG(aProcess);
-		return EFalse;
-		}
-
-	TDriverEventInfo info;
-	info.iEventType = EEventsAddProcess;
-	info.iProcessId = aProcess->iId;
-
-	info.iCreatorThreadId  = aThread ? aThread->iId : 0;
-	info.iProcessIdValid = ETrue;
-
-	// Copy TUids
-	info.iUids = aProcess->iUids;
-
-	info.iUidsValid = ETrue;
-
-	// copy name of the process
-	if (aProcess->iName)
-		{
-		// copy the name of the process
-		info.iFileName.Copy(*aProcess->iName);
-
-		DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(aProcess->iName));
-		if(foundProcess)
-			{
-			foundProcess->NotifyEvent(info);
-			}
-		else
-			{
-			// AddProcess event does not have fully-qualified path, it has "filename.exe"
-			// So we try a less-precise match
-			DTargetProcess* foundProcess = TheDProcessTracker.FuzzyFindProcess(*(aProcess->iName));
-			if(foundProcess)
-				{
-				foundProcess->NotifyEvent(info);
-				}
-			else
-				{
-				LOG_EVENT_MSG2("Couldn't find process with name [%S]", aProcess->iName);
-				}
-			}
-		}
-	else
-		{
-		LOG_EVENT_MSG("DRM_DebugChannel::AddProcess - No iName for this process");
-		}
-
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::HandleRemoveProcessEvent
-//
-TBool DRM_DebugChannel::HandleRemoveProcessEvent(TAny* a1, TAny* a2)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::RemoveProcess()");
-
-	DProcess *aProcess = (DProcess*)a1;
-	if(!aProcess)
-		{
-		LOG_MSG("Error getting DProcess object");
-		__NK_ASSERT_DEBUG(aProcess);
-		return EFalse;
-		}
-
-	// a2 points to the thread creating the new process.
-	// We have no use for it at the moment so just ignore it for now
-	// Also, it may not be known and therefore NULL
-
-	TDriverEventInfo info;
-	info.iEventType = EEventsRemoveProcess;
-	info.iProcessId = aProcess->iId;
-	info.iProcessIdValid = ETrue;
-
-	// copy name of the process
-	if (aProcess->iName)
-		{
-		// copy the name of the process
-		info.iFileName.Copy(*aProcess->iName);
-
-		DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(aProcess->iName));
-		if(foundProcess)
-			{
-			foundProcess->NotifyEvent(info);
-			}
-		else
-			{
-			// RemoveProcess event does not have fully-qualified path, it has "filename.exe"
-			// So we try a less-precise match
-			DTargetProcess* foundProcess = TheDProcessTracker.FuzzyFindProcess(*(aProcess->iName));
-			if(foundProcess)
-				{
-				foundProcess->NotifyEvent(info);
-				}
-			else
-				{
-				LOG_EVENT_MSG2("Couldn't find process with name [%S]", aProcess->iName);
-				}
-			}
-
-		}
-	else
-		{
-		LOG_EVENT_MSG("DRM_DebugChannel::AddProcess - No iName for this process");
-		}
-
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::AddLibrary
-//
-TBool DRM_DebugChannel::AddLibrary(TAny* a1, TAny* a2)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::AddLibrary()");
-
-	DLibrary *aLibrary = (DLibrary*)a1;
-	DThread *aThread = (DThread*)a2;
-
-	// sanity check
-	if (!aLibrary)
-		{
-		LOG_EVENT_MSG("DRM_DebugChannel::AddLibrary called with no library specified");
-		return EFalse;
-		}
-
-	if (!aThread)
-		{
-		LOG_EVENT_MSG("DRM_DebugChannel::AddLibrary called with no thread specified");
-		return EFalse;
-		}
-
-	LOG_EVENT_MSG2(("Lib loaded: %S"), aLibrary->iName);
-
-	if (aThread)
-		{
-		// make sure this is not the debugger thread
-		if ((aThread != iClientThread) && (aThread->iOwningProcess->iId != iClientThread->iOwningProcess->iId))
-			{
-			TDriverEventInfo info;
-
-			info.iEventType = EEventsAddLibrary;
-			info.iProcessId = aThread->iOwningProcess->iId;
-			info.iProcessIdValid = ETrue;
-			info.iThreadId = aThread->iId;
-			info.iThreadIdValid = ETrue;
-
-			//get the code address
-			DCodeSeg* codeSeg = aLibrary->iCodeSeg;
-			if (!codeSeg)
-				{
-				LOG_EVENT_MSG2("Code segment not available for library %S", aLibrary->iName);
-				return EFalse;
-				}
-
-			// Uid3
-			info.iUids = codeSeg->iUids;
-			info.iUidsValid = ETrue;
-
-			TModuleMemoryInfo memoryInfo;
-			TInt err = codeSeg->GetMemoryInfo(memoryInfo, NULL); //NULL for DProcess should be ok;
-			if (err != KErrNone)
-				{
-				LOG_EVENT_MSG2("Error in getting memory info: %d", err);
-				return EFalse;
-				}
-
-			info.iCodeAddress = memoryInfo.iCodeBase;
-			info.iDataAddress = memoryInfo.iInitialisedDataBase;
-
-			info.iFileName.Copy(*(aLibrary->iName)); //just the name, without uid info.
-
-			//queue up or complete the event
-			info.iArg1 = a1;
-			info.iArg2 = a2;
-			NotifyEvent(info);
-			}
-
-		}
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::RemoveLibrary
-//
-TBool DRM_DebugChannel::RemoveLibrary(TAny* a1, TAny* a2)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::RemoveLibrary()");
-	DLibrary *aLibrary = (DLibrary*)a1;
-
-	// sanity check
-	if (!aLibrary)
-		{
-		LOG_EVENT_MSG("DRM_DebugChannel::RemoveLibrary called with no library specified");
-		return EFalse;
-		}
-
-	LOG_EVENT_MSG2(("Lib unloaded: %S"), aLibrary->iName);
-
-	// this is called when all handles to this library have been closed.  this can happen when a process dies, or when a dll is
-	// unloaded while the process lives on.  in former case, we don't need to notify the host debugger because that process is
-	// dying anyway.  for the latter case, we do need to notify the host so it can unload the symbolics, etc.
-
-	DThread* aThread = &Kern::CurrentThread();
-
-	if ((aThread) &&
-			(aThread != iClientThread) &&
-			(aThread->iOwningProcess->iId != iClientThread->iOwningProcess->iId))
-		{
-		//the library gets unloaded only when the mapcount is 0.
-		if (aLibrary->iMapCount != 0)
-			return EFalse;
-
-		DCodeSeg* codeSeg = aLibrary->iCodeSeg;
-		if (!codeSeg)
-			{
-			LOG_EVENT_MSG2("Code segment not available for library %S", aLibrary->iName);
-			return EFalse;
-			}
-
-		TModuleMemoryInfo processMemoryInfo;
-		TInt err = codeSeg->GetMemoryInfo(processMemoryInfo, NULL); //passing NULL for the DProcess argument should be ok;
-		if (err != KErrNone)
-			{
-			LOG_EVENT_MSG2("Error in getting memory info: %d", err);
-			return EFalse;
-			}
-
-		TUint32 codeAddress = processMemoryInfo.iCodeBase;
-		TUint32 codeSize = processMemoryInfo.iCodeSize;
-
-		// first invalidate all breakpoints that were set in the library code
-		iBreakManager->InvalidateLibraryBreakPoints(codeAddress, codeSize);
-		DProcess *process = &Kern::CurrentProcess();
-		RArray<SCodeSegEntry>* dynamicCode = &(process->iDynamicCode);
-
-		for (TInt j=0; j<dynamicCode->Count(); j++)
-			{
-			if ((*dynamicCode)[j].iLib == aLibrary)
-				{
-				TDriverEventInfo info;
-
-				info.iEventType = EEventsRemoveLibrary;
-				info.iFileName.Copy(*(aLibrary->iName)); //lib name without uid info
-				//info.iFileName.ZeroTerminate();
-				info.iProcessId = process->iId;
-				info.iProcessIdValid = ETrue;
-				info.iThreadId = 0xFFFFFFFF; // don't care!
-				info.iThreadIdValid = EFalse;
-				// Uid3
-				info.iUids = codeSeg->iUids;
-				info.iUidsValid = ETrue;
-
-				//queue up or complete the event
-				info.iArg1 = a1;
-				info.iArg2 = a2;
-				NotifyEvent(info);
-				}
-			}
-		}
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::HandleEventKillThread
-//
-TBool DRM_DebugChannel::HandleEventKillThread(TAny* a1, TAny* a2)
-	{
-
-	LOG_MSG2("DRM_DebugChannel::HandleEventKillThread(Thread a1=0x%08x)", a1 );
-
-	DThread* currentThread = &Kern::CurrentThread();
-	if (!currentThread)
-		{
-		LOG_MSG("Error getting current thread");
-		__NK_ASSERT_DEBUG(currentThread);
-		return EFalse;
-		}
-
-	// a1 should point to the current thread, check this to make sure it does
-	__NK_ASSERT_DEBUG((DThread*)a1 == currentThread);
-
-	TDriverEventInfo info;
-
-	info.iProcessId = currentThread->iOwningProcess->iId;
-	info.iProcessIdValid = ETrue;
-	info.iThreadId = currentThread->iId;
-	info.iThreadIdValid = ETrue;
-	// 14 should probably be replaced by PC_REGISTER, for some reason PC_REGISTER had been replaced with 14 in the code
-	TInt err = ReadKernelRegisterValue(currentThread, 14, info.iCurrentPC);
-	if(err != KErrNone)
-		{
-		LOG_EVENT_MSG2("DRM_DebugChannel::HandleEventKillThread - Non-zero error code discarded: %d", err);
-		}
-
-	if (currentThread->iExitType == EExitPanic)
-		{
-		info.iPanicCategory.Copy(currentThread->iExitCategory);
-		}
-	info.iExceptionNumber = currentThread->iExitReason;
-	info.iExitType = currentThread->iExitType;
-	info.iEventType = EEventsKillThread;
-
-	// Are we debugging this process - decide based on iFileName
-	DCodeSeg* codeSeg = currentThread->iOwningProcess->iCodeSeg;
-
-	// remove all the breakpoints in this thread, whether we are debugging it or not.
-	iBreakManager->DoRemoveThreadBreaks(info.iThreadId);
-
-	// if the code seg exists then get the file name from it and check we're debugging it
-	if(codeSeg)
-		{
-		DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(codeSeg->iFileName));
-		if(!foundProcess)
-			{
-			// not debugging this process so return false
-			return EFalse;
-			}
-		}
-	else
-		{
-		// can't validate that we are debugging the thread
-		return EFalse;
-		}
-
-	info.iArg1 = a1;
-	info.iArg2 = a2;
-	NotifyEvent(info);
-
-	return ETrue;
-	}
-
-//
-// DRM_DebugChannel::HandleSwException
-//
-TBool DRM_DebugChannel::HandleSwException(TAny* a1, TAny* a2)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::HandleSwException");
-	TExcType aExcType = (TExcType)(TInt)a1;
-
-	TDriverEventInfo info;
-
-	DThread* currentThread = &Kern::CurrentThread();
-	if (!currentThread)
-		{
-		LOG_MSG("Error getting current thread");
-		__NK_ASSERT_DEBUG(currentThread);
-		return EFalse;
-		}
-
-	info.iProcessId = currentThread->iOwningProcess->iId;
-	info.iProcessIdValid = ETrue;
-	info.iThreadId = currentThread->iId;
-	info.iThreadIdValid = ETrue;
-	TInt err = ReadKernelRegisterValue(currentThread, PC_REGISTER, info.iCurrentPC);
-	if(err != KErrNone)
-		{
-		LOG_EVENT_MSG2("DRM_DebugChannel::HandleSwException - Non-zero error code discarded: %d", err);
-		}
-	info.iExceptionNumber = aExcType;
-	info.iEventType = EEventsSwExc;
-	info.iArg1 = a1;
-	info.iArg2 = a2;
-
-	NotifyEvent(info);
-
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::HandleHwException
-//
-TBool DRM_DebugChannel::HandleHwException(TAny* a1, TAny* a2)
-	{
-	TArmExcInfo* aExcInfo = (TArmExcInfo*)a1;
-
-	// sanity check
-	if (!aExcInfo)
-		{
-		LOG_MSG("DRM_DebugChannel::HandleHwException called with no aExcInfo");
-		__NK_ASSERT_DEBUG(aExcInfo);
-		return EFalse;
-		}
-
-	TDriverEventInfo info;
-
-	DThread* currentThread = &Kern::CurrentThread();
-
-	if (!currentThread)
-		{
-		LOG_MSG("Error getting current thread");
-		__NK_ASSERT_DEBUG(currentThread);
-		return EFalse;
-		}
-
-	info.iProcessId = currentThread->iOwningProcess->iId;
-	info.iProcessIdValid = ETrue;
-	info.iThreadId = currentThread->iId;
-	info.iThreadIdValid = ETrue;
-	info.iRmdArmExcInfo.iFaultAddress= aExcInfo->iFaultAddress;
-	info.iRmdArmExcInfo.iFaultStatus= aExcInfo->iFaultStatus;
-
-	LOG_MSG5("DRM_DebugChannel::HandleHwException current thread = 0x%08x, CritSect count=%d,\n"
-		" iFaultAddress=0x%08x, iFaultStatus=0x%08x",
-		currentThread, currentThread->iNThread.iCsCount, aExcInfo->iFaultAddress, aExcInfo->iFaultStatus);
-
-	info.iRmdArmExcInfo.iR0= aExcInfo->iR0;
-	info.iRmdArmExcInfo.iR1= aExcInfo->iR1;
-	info.iRmdArmExcInfo.iR2= aExcInfo->iR2;
-	info.iRmdArmExcInfo.iR3= aExcInfo->iR3;
-
-	info.iRmdArmExcInfo.iR4= aExcInfo->iR4;
-	info.iRmdArmExcInfo.iR5= aExcInfo->iR5;
-	info.iRmdArmExcInfo.iR6= aExcInfo->iR6;
-	info.iRmdArmExcInfo.iR7= aExcInfo->iR7;
-	info.iRmdArmExcInfo.iR8= aExcInfo->iR8;
-	info.iRmdArmExcInfo.iR9= aExcInfo->iR9;
-	info.iRmdArmExcInfo.iR10= aExcInfo->iR10;
-	info.iRmdArmExcInfo.iR11= aExcInfo->iR11;
-	info.iRmdArmExcInfo.iR12= aExcInfo->iR12;
-
-	info.iRmdArmExcInfo.iR13= aExcInfo->iR13;
-	info.iRmdArmExcInfo.iR14= aExcInfo->iR14;
-	info.iRmdArmExcInfo.iR15= aExcInfo->iR15;
-
-	info.iRmdArmExcInfo.iCpsr= aExcInfo->iCpsr;
-	info.iRmdArmExcInfo.iR13Svc= aExcInfo->iR13Svc;
-	info.iRmdArmExcInfo.iR14Svc= aExcInfo->iR14Svc;
-	info.iRmdArmExcInfo.iSpsrSvc= aExcInfo->iSpsrSvc;
-	LOG_MSG5(" iCpsr=0x%x, iExcCode=0x%x, R14=0x%x, R15=0x%x",
-			aExcInfo->iCpsr, aExcInfo->iExcCode, aExcInfo->iR14, aExcInfo->iR15);
-
-	switch (aExcInfo->iExcCode)
-		{
-		case 0:
-			info.iExceptionNumber = EExcCodeAbort;
-			LOG_EVENT_MSG(" iExcCode == 0 => EExcCodeAbort");
-			break;
-		case 1:
-			info.iExceptionNumber = EExcDataAbort;
-			LOG_EVENT_MSG(" iExcCode == 1 => EExcDataAbort");
-			break;
-		case 2:
-			info.iExceptionNumber = EExcInvalidOpCode;
-			LOG_EVENT_MSG(" iExcCode == 2 => EExcInvalidOpCode");
-			break;
-		default:
-			// new event? Something gone wrong?
-			__NK_ASSERT_DEBUG(EFalse);
-			return EFalse;
-		}
-
-	info.iEventType = EEventsHwExc;
-
-	info.iArg1 = a1;
-	info.iArg2 = a2;
-
-	if(EExcInvalidOpCode == info.iExceptionNumber)
-		{
-		return HandleInvalidOpCodeException(info, currentThread);
-		}
-
-	NotifyEvent(info);
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::HandUserTrace
-//
-TBool DRM_DebugChannel::HandleUserTrace(TAny* a1, TAny* a2)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::HandleUserTrace()");
-
-	DThread* currentThread = &Kern::CurrentThread();
-	if (!currentThread)
-		{
-		LOG_EVENT_MSG("Error getting current thread");
-		__NK_ASSERT_DEBUG(currentThread);
-		return EFalse;
-		}
-
-	TDriverEventInfo info;
-	info.iProcessId = currentThread->iOwningProcess->iId;
-	info.iProcessIdValid = ETrue;
-	info.iThreadId = currentThread->iId;
-	info.iThreadIdValid = ETrue;
-	info.iEventType = EEventsUserTrace;
-	info.iArg1 = a1;
-	info.iArg2 = a2;
-
-	TInt err = KErrNone;
-
-	//User Trace info
-	XTRAP(err, XT_DEFAULT, kumemget(info.iUserTraceText, info.iArg1, (TInt)a2));
-	if(KErrNone != err)
-		{
-		return EFalse;
-		}
-
-	info.iMessageStatus = ESingleMessage;
-
-	NotifyEvent(info);
-
-	return EFalse;
-	}
-
-//
-// DRM_DebugChannel::HandleException
-//
-TBool DRM_DebugChannel::HandleInvalidOpCodeException(TDriverEventInfo& aEventInfo, DThread* aCurrentThread)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::HandleInvalidOpCodeException()");
-
-	TInt err = KErrNone;
-
-	TUint32 inst = KArmBreakPoint;
-	TInt instSize = 4;
-
-	// change these for thumb mode
-	TUint32 regValue;
-	err = ReadKernelRegisterValue(aCurrentThread, STATUS_REGISTER, regValue);
-	if(err != KErrNone)
-		{
-		LOG_EVENT_MSG2("DRM_DebugChannel::HandleInvalidOpCodeException - Non-zero error code discarded: %d", err);
-		}
-
-	if (regValue & ECpuThumb)
-		{
-		inst = KThumbBreakPoint;
-		instSize = 2;
-		}
-
-	TUint32 instruction = 0;
-	err = Kern::ThreadRawRead(aCurrentThread, (TUint32 *)aEventInfo.iRmdArmExcInfo.iR15, (TUint8 *)&instruction, instSize);
-
-	if (KErrNone != err)
-		LOG_MSG2("Error reading instruction at currentpc: %d", err);
-
-	if (!memcompare((TUint8 *)&inst, instSize, (TUint8 *)&instruction, instSize))
-		{
-		TInt err = DoSuspendThread(aCurrentThread);
-		if(! ((KErrNone == err) || (KErrAlreadyExists == err)) )
-			{
-			LOG_MSG2("DRM_DebugChannel::HandleInvalidOpCodeException() Thread with id 0x%08x could not be suspended.", aCurrentThread->iId);
-			return EFalse;
-			}
-
-		// the exception was a breakpoint instruction.  see if we have a breakpoint at that address
-		TBreakEntry* breakEntry = NULL;
-		do
-			{
-			breakEntry = iBreakManager->GetNextBreak(breakEntry);
-			if (breakEntry && ((breakEntry->iThreadSpecific && breakEntry->iId == aEventInfo.iThreadId) || (!breakEntry->iThreadSpecific && breakEntry->iId == aEventInfo.iProcessId)) && breakEntry->iAddress == aEventInfo.iRmdArmExcInfo.iR15)
-				{
-				LOG_EVENT_MSG2("Breakpoint with Id %d has been hit", breakEntry->iBreakId);
-
-				TBreakEntry tempBreakEntry = *breakEntry;
-
-				//change the event type to breakpoint type
-				aEventInfo.iEventType = breakEntry->iThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint;
-
-				// enable any breakpoints we had to disable for this thread
-				err = iBreakManager->DoEnableDisabledBreak(aEventInfo.iThreadId);
-				if (KErrNone != err)
-					LOG_MSG2("Error %d enabling disabled breakpoints", err);
-
-				// see if this is a temp breakpoint
-				if (iBreakManager->IsTemporaryBreak(*breakEntry))
-					{
-					// this was a temp breakpoint, so we need to clear it now
-					err = iBreakManager->DoClearBreak(breakEntry->iBreakId);
-					if (KErrNone != err)
-						LOG_MSG2("Error %d clearing temp breakpoint", err);
-
-					// Find out how many steps remain to be done
-
-					// reduce the number of steps to complete by 1
-					tempBreakEntry.iNumSteps--;
-
-					LOG_EVENT_MSG2("There are %d steps remaining\n", tempBreakEntry.iNumSteps);
-
-					// New. If we have not finished do all the steps, continue stepping and don't notify event
-					if (tempBreakEntry.iNumSteps)
-						{
-						LOG_EVENT_MSG("Continuing stepping...not telling the agent yet\n");
-						err = DoStepRange(aCurrentThread, aEventInfo.iRmdArmExcInfo.iR15, aEventInfo.iRmdArmExcInfo.iR15, ETrue, tempBreakEntry.iResumeOnceOutOfRange /*EFalse*/, tempBreakEntry.iNumSteps, ETrue);
-						if (err != KErrNone)
-							{
-							LOG_EVENT_MSG("Failed to continue stepping\n");
-
-							// what do we do? might as well stop here and tell the user
-							NotifyEvent(aEventInfo);
-
-							return ETrue;
-							}
-
-						// continue as though no event occured. No need to suspend/resume anything...
-						LOG_EVENT_MSG("Continuing to step\n");
-						return ETrue;
-						}
-
-					// Is this a case where we just want to continue?
-					if (tempBreakEntry.iResumeOnceOutOfRange)
-						{
-						LOG_EVENT_MSG("PC is out of range, continuing thread");
-						DoResumeThread(aCurrentThread);
-
-						return ETrue;
-						}
-					}
-
-				// if the breakpoint is thread specific, make sure it's the right thread
-				// if not, just continue the thread.  take special care if it's the debugger
-				// thread.  if it hits a regular breakpoint, we NEVER want to stop at it.  if
-				// it hits a temp breakpoint, we're probably just stepping past a real breakpoint
-				// and we do need to handle it.
-				TBool needToResume = (tempBreakEntry.iThreadSpecific && tempBreakEntry.iId != aEventInfo.iThreadId) ||
-					(!tempBreakEntry.iThreadSpecific && tempBreakEntry.iId != aEventInfo.iProcessId);
-
-				if (needToResume)
-					{
-					LOG_EVENT_MSG("breakpoint does not match threadId, calling DoResumeThread");
-					err = DoResumeThread(aCurrentThread);
-					if (KErrNone != err)
-						LOG_MSG2("Error in DoResumeThread: %d", err);
-
-					return EFalse;
-					}
-
-				//normal user break point, just notify the event
-				break;
-				}
-			} while(breakEntry);
-		}
-
-	NotifyEvent(aEventInfo);
-
-	return (aEventInfo.iEventType == EEventsBreakPoint) || (aEventInfo.iEventType == EEventsProcessBreakPoint);
-	}
-
-//
-// DRM_DebugChannel::SetBreak
-//
-TInt DRM_DebugChannel::SetBreak(TSetBreakInfo* aBreakInfo)
-	{
-	LOG_MSG("DRM_DebugChannel::SetBreak()");
-
-	TInt err = KErrNone;
-
-	if (!aBreakInfo)
-		{
-		LOG_MSG("DRM_DebugChannel::SetBreak() was passed a NULL argument");
-		return KErrArgument;
-		}
-
-	//User side memory is not accessible directly
-	TSetBreakInfo info;
-	err = Kern::ThreadRawRead(iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TSetBreakInfo));
-	if (err != KErrNone)
-		{
-		LOG_MSG("DRM_DebugChannel::SetBreak() was passed a bad argument");
-		return err;
-		}
-
-	DProcess* process = NULL;
-	if(info.iThreadSpecific)
-		{
-		// if the target thread is not suspended then return KErrInUse
-		if(!TheDProcessTracker.CheckSuspended(info.iId))
-			{
-			LOG_MSG2("DRM_DebugChannel::SetBreak() Thread with id 0x%08x not suspended.", info.iId);
-			return KErrInUse;
-			}
-		DThread* thread = DebugUtils::OpenThreadHandle(info.iId);
-		if(!thread)
-			{
-			LOG_MSG2("DRM_DebugChannel::SetBreak() Thread with id 0x%08x not found", info.iId);
-			return KErrNotFound;
-			}
-		process = DebugUtils::OpenProcessHandle(thread->iOwningProcess->iId);
-		thread->Close(NULL);
-		}
-	else
-		{
-		process = DebugUtils::OpenProcessHandle(info.iId);
-		}
-
-	if(!process)
-		{
-		LOG_MSG2("DRM_DebugChannel::SetBreak() Process with id 0x%08x not found", process->iId);
-		return KErrNotFound;
-		}
-
-	TBool found = EFalse;
-	for(TInt i=0; i<iDebugProcessList.Count(); i++)
-		{
-		if(process->iId == iDebugProcessList[i].iId)
-			{
-			found = ETrue;
-			}
-		}
-
-	if(!found)
-		{
-		DCodeSeg* codeSeg = process->iCodeSeg;
-		if (!codeSeg)
-			{
-			LOG_MSG2("DRM_DebugChannel::SetBreak() Code seg for process with id 0x%08x not found", process->iId);
-			return KErrNotFound;
-			}
-
-		TModuleMemoryInfo memoryInfo;
-		TInt err = codeSeg->GetMemoryInfo(memoryInfo, process);
-		if (err != KErrNone)
-			{
-			LOG_MSG2("DRM_DebugChannel::SetBreak() Error getting memory info for process with id 0x%08x", process->iId);
-			return err;
-			}
-
-		//add this process to the list of processes that we are debugging
-		TProcessInfo processInfo(process->iId, memoryInfo.iCodeBase, memoryInfo.iCodeSize, memoryInfo.iInitialisedDataBase);
-		iDebugProcessList.Append(processInfo);
-		process->Close(NULL);
-		}
-
-	if (!info.iBreakId) //first check if the iId address is valid
-		return KErrArgument;
-
-	if (err == KErrNone)
-		{
-		TInt32 iBreakId;
-
-		err = iBreakManager->DoSetBreak(iBreakId, info.iId, info.iThreadSpecific, info.iAddress, info.iMode );
-
-		if (err == KErrNone)
-			{
-			err = Kern::ThreadRawWrite(iClientThread, (TUint8 *)info.iBreakId, &iBreakId, sizeof(TInt32), iClientThread);
-			}
-		}
-
-	return err;
-	}
-
-//
-// DRM_DebugChannel::StepRange
-//
-TInt DRM_DebugChannel::StepRange(DThread* aThread, TRM_DebugStepInfo* aStepInfo)
-	{
-	LOG_MSG("DRM_DebugChannel::StepRange()");
-
-	TInt err = KErrNone;
-
-	if(!TheDProcessTracker.CheckSuspended(aThread))
-		{
-		LOG_MSG2("DRM_DebugChannel::StepRange() Thread with id 0x%08x not suspended.", aThread->iId);
-		return KErrInUse;
-		}
-
-	if (!aStepInfo)
-		return KErrArgument;
-
-	TRM_DebugStepInfo info(0, 0, 0);
-	err = Kern::ThreadRawRead(iClientThread, aStepInfo, (TUint8*)&info, sizeof(TRM_DebugStepInfo));
-
-	if (err != KErrNone)
-		return err;
-
-	err = DoStepRange(aThread, info.iStartAddress, info.iStopAddress, info.iStepInto, EFalse, ETrue);
-
-	return err;
-	}
-
-/**
-Read memory from a target thread and return the data to the client. If the
-memory block has breakpoints in it then the correct values are placed in the
-returned data
-
-@param aThread pointer to thread whose memory space the memory is to be read from
-@param aMemoryInfo information about what memory to read
-
-@return KErrNone if memory read successfully,
-        KErrArgument if aMemoryInfo is not initialised correctly,
-        KErrNoMemory if a temporary buffer could not be allocated,
-        KErrBadHandle if aThread is invalid,
-        or another of the system wide error codes
-*/
-TInt DRM_DebugChannel::ReadMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo)
-	{
-	LOG_MSG("DRM_DebugChannel::ReadMemory()");
-
-	TInt err = KErrNone;
-
-	if (!aMemoryInfo)
-		return KErrArgument;
-
-	TRM_DebugMemoryInfo info(0, 0, 0);
-	err = Kern::ThreadRawRead(iClientThread, aMemoryInfo, (TUint8*)&info, sizeof(TRM_DebugMemoryInfo));
-	if (err != KErrNone)
-		return err;
-
-	if (!info.iData)
-		return KErrArgument;
-
-	NKern::ThreadEnterCS();
-	TUint8 *data = (TUint8*)Kern::Alloc(info.iLength);
-	NKern::ThreadLeaveCS();
-	if (!data)
-		{
-		return KErrNoMemory;
-		}
-
-	TPtr8 dataDes(data, info.iLength);
-
-	err = DoReadMemory(aThread, info.iAddress, info.iLength, dataDes);
-	if (err == KErrNone)
-		{
-		err = Kern::ThreadDesWrite(iClientThread, info.iData, dataDes, 0, KChunkShiftBy0, iClientThread);
-		}
-
-	NKern::ThreadEnterCS();
-	Kern::Free(data);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Attempt to write memory to aThread's address space
-
-@param aThread thread to whose address space memory is to be written
-@param aMemoryInfo memory info object representing the data to write
-
-@return KErrNone if memory written successfully,
-        KErrNoMemory if memory could not be allocated
-        KErrArgument if aMemoryInfo is NULL, if aMemoryInfo.iData is NULL,
-        if aMemoryInfo.iLength is greater than than the length of the passed
-        in descrptor
-        KErrBadHandle if aThread is invalid,
-	or another of the system wide error codes
-*/
-TInt DRM_DebugChannel::WriteMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo)
-	{
-	LOG_MSG("DRM_DebugChannel::WriteMemory()");
-
-	TInt err = KErrNone;
-
-	if (!aMemoryInfo)
-		return KErrArgument;
-
-	TRM_DebugMemoryInfo info(0, 0, 0);
-	err = Kern::ThreadRawRead(iClientThread, aMemoryInfo, (TUint8*)&info, sizeof(TRM_DebugMemoryInfo));
-	if (err != KErrNone)
-		return err;
-
-	if (!info.iData)
-		return KErrArgument;
-
-	NKern::ThreadEnterCS();
-	TUint8 *data = (TUint8*)Kern::Alloc(info.iLength);
-	NKern::ThreadLeaveCS();
-	if (!data)
-		{
-		return KErrNoMemory;
-		}
-
-	TPtr8 dataDes(data, info.iLength);
-
-	err = Kern::ThreadDesRead(iClientThread, info.iData, dataDes, 0);
-	if (err == KErrNone)
-		{
-		err = DoWriteMemory(aThread, info.iAddress, info.iLength, dataDes);
-		}
-
-	NKern::ThreadEnterCS();
-	Kern::Free(data);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-//
-// DRM_DebugChannel::ReadRegisters
-//
-TInt DRM_DebugChannel::ReadRegistersLegacy(DThread* aThread, TRM_DebugRegisterInfo* aRegisterInfo)
-	{
-	LOG_MSG("DRM_DebugChannel::ReadRegistersLegacy()");
-
-	TInt err = KErrNone;
-
-	if (!aRegisterInfo)
-		return KErrArgument;
-
-	TRM_DebugRegisterInfo info(0, 0, 0);
-	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInfo));
-	if (err != KErrNone)
-		return err;
-
-	if (!info.iValues)
-		return KErrArgument;
-
-	TUint length = (info.iLastRegister - info.iFirstRegister + 1) * 4;
-
-	NKern::ThreadEnterCS();
-	TUint8 *values = (TUint8*)Kern::Alloc(length);
-	NKern::ThreadLeaveCS();
-	if (!values)
-		{
-		return KErrNoMemory;
-		}
-
-	TPtr8 valuesDes(values, length);
-
-	err = DoReadRegisters(aThread, info.iFirstRegister, info.iLastRegister, valuesDes);
-	if (err == KErrNone)
-		{
-		err = Kern::ThreadDesWrite(iClientThread, info.iValues, valuesDes, 0, KChunkShiftBy0, iClientThread);
-		}
-
-	NKern::ThreadEnterCS();
-	Kern::Free(values);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Get listing information.
-
-@param aListInformation pointer to a TListInformation object containing the
-       user specified listings information
-
-@return KErrNone on success,
-        KErrTooBig if the kernel's data is too big to fit in the passed buffer,
-        KErrArgument if aListInformation is NULL,
-	or one of the other system-wide error codes
-*/
-TInt DRM_DebugChannel::GetList(TListInformation* aListInformation) const
-	{
-	LOG_MSG("DRM_DebugChannel::GetList()");
-
-	TInt err = KErrNone;
-
-	if(aListInformation == NULL)
-		{
-		return KErrArgument;
-		}
-
-	//read DSS' data into local structure
-	TListInformation info;
-	err = Kern::ThreadRawRead(iClientThread, aListInformation, (TUint8*)&info, sizeof(TListInformation));
-	if(err != KErrNone)
-		{
-		return err;
-		}
-
-	//check arguments
-	TPtr8 buffer(NULL, 0);
-	err = AllocAndReadDes(iClientThread, *info.iBuffer, buffer);
-	if(err != KErrNone)
-		{
-		//need to free the buffer if it was allocated
-		if(err != KErrNoMemory)
-			{
-			NKern::ThreadEnterCS();
-			Kern::Free((TAny*)buffer.Ptr());
-			NKern::ThreadLeaveCS();
-			}
-		return err;
-		}
-
-	//get the list
-	TUint32 dataSize = 0;
-	TListManager manager;
-	err = KErrArgument;
-	switch(info.iType)
-		{
-		case EXipLibraries:
-			if(Debug::EScopeGlobal == info.iListScope)
-				{
-				err = manager.GetXipLibrariesList(buffer, dataSize);
-				}
-			break;
-
-		case EThreads:
-			if(Debug::EScopeGlobal == info.iListScope)
-				{
-				err = manager.GetGlobalThreadList(buffer, dataSize);
-				}
-			else if(Debug::EScopeProcessSpecific == info.iListScope)
-				{
-				err = manager.GetThreadListForProcess(buffer, dataSize, info.iTargetId);
-				}
-			else if(Debug::EScopeThreadSpecific == info.iListScope)
-				{
-				err = manager.GetThreadListForThread(buffer, dataSize, info.iTargetId);
-				}
-			break;
-
-		case EProcesses:
-			if(Debug::EScopeGlobal == info.iListScope)
-				{
-				err = manager.GetProcessList(buffer, dataSize);
-				}
-			break;
-
-		case ECodeSegs:
-			if(Debug::EScopeGlobal == info.iListScope)
-				{
-				err = manager.GetGlobalCodeSegList(buffer, dataSize);
-				}
-			else if(Debug::EScopeProcessSpecific == info.iListScope)
-				{
-				err = manager.GetCodeSegListForProcess(buffer, dataSize, info.iTargetId);
-				}
-			else if(Debug::EScopeThreadSpecific == info.iListScope)
-				{
-				err = manager.GetCodeSegListForThread(buffer, dataSize, info.iTargetId);
-				}
-			break;
-
-		default:
-			err = KErrNotSupported;
-		}
-
-	if(err == KErrNone)
-		{
-		//if no error then write the buffer back
-		err = Kern::ThreadDesWrite(iClientThread, info.iBuffer, buffer, 0, KChunkShiftBy0, iClientThread);
-		}
-
-	//write back the size of the data regardless of any error
-	TInt writeErr = Kern::ThreadRawWrite(iClientThread, info.iDataSize, (TUint8*)&dataSize, sizeof(TUint32), iClientThread);
-	if(writeErr != KErrNone)
-		{
-		//if there was an error writing the size return that error instead
-		err = writeErr;
-		}
-
-	//free the buffer
-	NKern::ThreadEnterCS();
-	Kern::Free((TAny*)buffer.Ptr());
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Read registers and store register data in aRegisterInfo
-
-@param aThread thread to read registers from
-@param aRegisterInfo structure specifying which registers to read and providing
-       descriptors to write the register data into
-
-@return KErrNone if registers were read successfully. Note that this does not
-        mean that all the registers could be read, the
-        aRegisterInfo.iRegisterFlags array should be checked as to whether each
-        individual register could be read,
-        KErrArgument if aRegisterInfo is NULL, or if any of the pointers that
-        are members of aRegisterInfo are NULL, if an unknown register is
-        specified or if the passed in register values buffer is too small
-        KErrNoMemory if there is insufficient memory,
-        KErrDied, if the thread with thread ID aThreadId is dead
-*/
-TInt DRM_DebugChannel::ReadRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const
-	{
-	LOG_MSG("DRM_DebugChannel::ReadRegisters()");
-
-	TInt err = KErrNone;
-
-	if (!aRegisterInfo)
-		return KErrArgument;
-
-	TRM_DebugRegisterInformation info;
-	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInformation));
-	if (err != KErrNone)
-		return err;
-
-	if ((!info.iRegisterIds) || (!info.iRegisterValues) || (!info.iRegisterFlags))
-		return KErrArgument;
-
-	//read ids from client thread
-	TPtr8 ids(NULL, 0);
-	err = AllocAndReadDes(iClientThread, *info.iRegisterIds, ids);
-	if(err != KErrNone)
-		{
-		if(err == KErrNoMemory)
-			{
-			NKern::ThreadEnterCS();
-			Kern::Free((TAny*)ids.Ptr());
-			NKern::ThreadLeaveCS();
-			}
-		return err;
-		}
-
-	//read values from client thread
-	TPtr8 values(NULL, 0);
-	err = AllocAndReadDes(iClientThread, *info.iRegisterValues, values, EFalse);
-	if(err != KErrNone)
-		{
-		if(err == KErrNoMemory)
-			{
-			NKern::ThreadEnterCS();
-			Kern::Free((TAny*)values.Ptr());
-			NKern::ThreadLeaveCS();
-			}
-
-		NKern::ThreadEnterCS();
-		Kern::Free((TAny*)ids.Ptr());
-		NKern::ThreadLeaveCS();
-		return err;
-		}
-
-	//read flags from client thread
-	TPtr8 flags(NULL, 0);
-	err = AllocAndReadDes(iClientThread, *info.iRegisterFlags, flags, EFalse);
-	if(err != KErrNone)
-		{
-		if(err == KErrNoMemory)
-			{
-			NKern::ThreadEnterCS();
-			Kern::Free((TAny*)flags.Ptr());
-			NKern::ThreadLeaveCS();
-			}
-		NKern::ThreadEnterCS();
-		Kern::Free((TAny*)ids.Ptr());
-		Kern::Free((TAny*)values.Ptr());
-		NKern::ThreadLeaveCS();
-		return err;
-		}
-
-	err = DoReadRegisters(aThread, ids, values, flags);
-	if (err == KErrNone)
-		{
-		err = Kern::ThreadDesWrite(iClientThread, info.iRegisterValues, values, 0, KChunkShiftBy0, iClientThread);
-		if(err == KErrNone)
-			{
-			err = Kern::ThreadDesWrite(iClientThread, info.iRegisterFlags, flags, 0, KChunkShiftBy0, iClientThread);
-			}
-		}
-
-	NKern::ThreadEnterCS();
-	Kern::Free((TAny*)ids.Ptr());
-	Kern::Free((TAny*)values.Ptr());
-	Kern::Free((TAny*)flags.Ptr());
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-@deprecated use DRM_DebugChannel::WriteRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) instead
-*/
-TInt DRM_DebugChannel::WriteRegistersLegacy(DThread* aThread, const TRM_DebugRegisterInfo* aRegisterInfo)
-	{
-	LOG_MSG("DRM_DebugChannel::WriteRegistersLegacy()");
-
-	TInt err = KErrNone;
-
-	if (!aRegisterInfo)
-		return KErrArgument;
-
-	TRM_DebugRegisterInfo info(0, 0, 0);
-	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInfo));
-	if (err != KErrNone)
-		return err;
-
-	if (!info.iValues)
-		return KErrArgument;
-
-	TUint length = (info.iLastRegister - info.iFirstRegister + 1) * 4;
-
-	NKern::ThreadEnterCS();
-	TUint8 *values = (TUint8*)Kern::Alloc(length);
-	NKern::ThreadLeaveCS();
-	if (!values)
-		{
-		return KErrNoMemory;
-		}
-
-	TPtr8 valuesDes(values, length);
-
-	err = Kern::ThreadDesRead(iClientThread, info.iValues, valuesDes, 0);
-	if (err == KErrNone)
-		{
-		err = DoWriteRegisters(aThread, info.iFirstRegister, info.iLastRegister, valuesDes);
-		}
-
-	NKern::ThreadEnterCS();
-	Kern::Free(values);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Write registers and store flags data in aRegisterInfo
-
-@param aThread thread to write registers to
-@param aRegisterInfo structure specifying which registers to write and providing
-       descriptors to write the register flags data into
-
-@return KErrNone if registers were written successfully. Note that this does not
-        mean that all the registers could be written, the flags array
-        should be checked as to whether each individual register could be read,
-        KErrArgument if aRegisterInfo is NULL, or if any of the pointers that
-        are members of aRegisterInfo are NULL, if an unknown register is
-        specified or if the passed in register values buffer is too small, or
-        if aThread is NULL,
-        KErrGeneral if there was a problem initialising the register set,
-        KErrNoMemory if there is insufficient memory,
-        KErrDied, if the thread with thread ID aThreadId is dead
-*/
-TInt DRM_DebugChannel::WriteRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const
-	{
-	LOG_MSG("DRM_DebugChannel::WriteRegisters()");
-
-	TInt err = KErrNone;
-
-	if (!aRegisterInfo)
-		return KErrArgument;
-
-	TRM_DebugRegisterInformation info;
-	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInformation));
-	if (err != KErrNone)
-		return err;
-
-	if ((!info.iRegisterIds) || (!info.iRegisterValues) ||(!info.iRegisterFlags))
-		return KErrArgument;
-
-	//read ids from client thread
-	TPtr8 ids(NULL, 0);
-	err = AllocAndReadDes(iClientThread, *info.iRegisterIds, ids);
-	if(err != KErrNone)
-		{
-		if(err == KErrNoMemory)
-			{
-			NKern::ThreadEnterCS();
-			Kern::Free((TAny*)ids.Ptr());
-			NKern::ThreadLeaveCS();
-			}
-		return err;
-		}
-
-	//read values from client thread
-	TPtr8 values(NULL, 0);
-	err = AllocAndReadDes(iClientThread, *info.iRegisterValues, values);
-	if(err != KErrNone)
-		{
-		if(err == KErrNoMemory)
-			{
-			NKern::ThreadEnterCS();
-			Kern::Free((TAny*)values.Ptr());
-			NKern::ThreadLeaveCS();
-			}
-		NKern::ThreadEnterCS();
-		Kern::Free((TAny*)ids.Ptr());
-		NKern::ThreadLeaveCS();
-		return err;
-		}
-
-	//read flags from client thread
-	TPtr8 flags(NULL, 0);
-	err = AllocAndReadDes(iClientThread, *info.iRegisterFlags, flags, EFalse);
-	if(err != KErrNone)
-		{
-		if(err == KErrNoMemory)
-			{
-			NKern::ThreadEnterCS();
-			Kern::Free((TAny*)flags.Ptr());
-			NKern::ThreadLeaveCS();
-			}
-		NKern::ThreadEnterCS();
-		Kern::Free((TAny*)ids.Ptr());
-		Kern::Free((TAny*)values.Ptr());
-		NKern::ThreadLeaveCS();
-		return err;
-		}
-
-	err = DoWriteRegisters(aThread, ids, values, flags);
-	if(err == KErrNone)
-		{
-		err = Kern::ThreadDesWrite(iClientThread, info.iRegisterFlags, flags, 0, KChunkShiftBy0, iClientThread);
-		}
-
-	NKern::ThreadEnterCS();
-	Kern::Free((TAny*)ids.Ptr());
-	Kern::Free((TAny*)values.Ptr());
-	Kern::Free((TAny*)flags.Ptr());
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/**
-Suspends execution of the specified thread.
-
-@param aThread thread to resume
-
-@return KErrNone if there were no problems or KErrArgument if aThread is NULL
-*/
-TInt DRM_DebugChannel::DoSuspendThread(DThread *aThread)
-	{
-	LOG_MSG("DRM_DebugChannel::DoSuspendThread()");
-
-	if (!aThread)
-		{
-		LOG_MSG("Invalid dthread object");
-		return KErrArgument;
-		}
-
-	return TheDProcessTracker.SuspendThread(aThread);
-	}
-
-/**
-Resumes execution of the specified thread.
-
-@param aThread thread to resume
-
-@return KErrNone if there were no problems, KErrArgument if aThread is NULL
-        or an error value returned from DoStepRange()
-*/
-TInt DRM_DebugChannel::DoResumeThread(DThread *aThread)
-	{
-	LOG_MSG("DRM_DebugChannel::DoResumeThread()");
-
-	if (!aThread)
-		return KErrArgument;
-
-	// get the current PC
-	TUint32 currentPC;
-	TInt err = ReadKernelRegisterValue(aThread, PC_REGISTER, currentPC);
-	if(err != KErrNone)
-		{
-		LOG_MSG2("DRM_DebugChannel::DoResumeThread - Non-zero error code discarded: %d", err);
-		}
-
-	// if there is a breakpoint at the current PC, we need to single step past it
-	TBreakEntry* breakEntry = NULL;
-	do
-		{
-		breakEntry = iBreakManager->GetNextBreak(breakEntry);
-		if(breakEntry && !iBreakManager->IsTemporaryBreak(*breakEntry))
-			{
-			if (breakEntry->iAddress == currentPC)
-				{
-				return DoStepRange(aThread, currentPC, currentPC+1, ETrue, 1, ETrue);
-				}
-			}
-		} while(breakEntry);
-
-	return TheDProcessTracker.ResumeThread(aThread);
-	}
-
-//
-// DRM_DebugChannel::DoStepRange
-//
-TInt DRM_DebugChannel::DoStepRange(DThread *aThread, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto, TBool aResumeOnceOutOfRange, const TUint32 aNumSteps, TBool aUserRequest)
-	{
-	LOG_MSG("DRM_DebugChannel::DoStepRange()");
-
-	if (!aThread)
-		return KErrArgument;
-
-	//check that the thread is suspended
-	if(!TheDProcessTracker.CheckSuspended(aThread))
-		{
-		LOG_MSG2("DRM_DebugChannel::DoStepRange() Thread with id 0x%08x not suspended.", aThread->iId);
-		return KErrInUse;
-		}
-
-	TUint32 startAddress = (aStartAddress & 0x1) ? aStartAddress + 1 : aStartAddress;
-	TUint32 stopAddress = (aStopAddress & 0x1) ? aStopAddress + 1 : aStopAddress;;
-
-	// don't allow the user to step in the excluded ROM region.  this could be called
-	// internally however.  for example, the the special breakpoints we set to handle
-	// panics, exceptions, and library loaded events are in the user library, and we
-	// will need to step past the breakpoint before continuing the thread.
-	//if (aUserRequest && (startAddress >= iExcludedROMAddressStart) && (startAddress < iExcludedROMAddressEnd))
-	//{
-	//	return KErrNotSupported;
-	//}
-
-	// set the temp breakpoint, and disable the breakpoint at the current PC if necessary
-	// if its not a user request, and we are just trying to resume from a breakpoint,
-	// then we don't need to check for stubs. The last parameter aUserRequest tells
-	// ModifyBreaksForStep to check for stubs or not. In some cases, the check for stubs
-	// is true even if its not a user request.For example, this is true in cases where
-	// we are doing a step range and the instruction in the range modified PC.
-	// in this case, DoStepRange will be called from the exception handler where
-	// we need to check for the stubs for the valid behavior. So truly, we don't need to check
-	// for stubs only when resuming from  a breakpoint.
-	ReturnIfError(iStepper->ModifyBreaksForStep(aThread, startAddress, stopAddress, aResumeOnceOutOfRange, aUserRequest, aNumSteps));
-
-	LOG_MSG("DRM_DebugChannel::DoStepRange() - resuming thread\n");
-
-	return TheDProcessTracker.ResumeThread(aThread);
-	}
-
-/**
-Read memory from the specified addres into the aData descriptor. If there is a
-breakpoint set in the region of memory returned then the correct data value is
-inserted into the descriptor
-
-@param aThread pointer to thread whose address space memory is to be read from
-@param aAddress address to start reading memory from
-@param aLength length of memory block to read
-@param aData descriptor to read memory into
-
-@return KErrNone if memory read successfully,
-        KErrNotSupported if reading from the rom section is not supported,
-        KErrBadHandle if aThread is invalid,
-        or one of the other system wide error codes
-*/
-TInt DRM_DebugChannel::DoReadMemory(const DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData) const
-	{
-	LOG_MSG("DRM_DebugChannel::DoReadMemory()");
-
-	// make sure the parameters are valid
-	if (aLength > aData.MaxSize())
-		return KErrArgument;
-
-	TInt err = KErrNone;
-
-	// trap exceptions in case the address is invalid
-	XTRAPD(r, XT_DEFAULT, err = TryToReadMemory(aThread, (TAny *)aAddress, (TAny *)aData.Ptr(), aLength));
-
-	err = (KErrNone == r) ? err : r;
-
-	if (KErrNone == err)
-		{
-		aData.SetLength(aLength);
-
-		TPtr8 data((TUint8 *)aData.Ptr(), aLength, aLength);
-
-		// if we have any breakpoints in this range, put the actual instruction in the buffer
-		TBreakEntry* breakEntry = NULL;
-		do
-			{
-			breakEntry = iBreakManager->GetNextBreak(breakEntry);
-			if(breakEntry && !iBreakManager->IsTemporaryBreak(*breakEntry))
-				{
-				if ((breakEntry->iAddress >= aAddress) && (breakEntry->iAddress < (aAddress + aLength)))
-					{
-					TInt instSize;
-
-					switch(breakEntry->iMode)
-						{
-						case EArmMode:
-							instSize = 4;
-							break;
-
-						case EThumbMode:
-							instSize = 2;
-							break;
-
-						case EThumb2EEMode:
-						default:
-							LOG_MSG("DRM_DebugChannel::DoReadMemory() cannot fixup breakpoints with unsupported architecture");
-							return KErrNotSupported;
-						}
-					memcpy((TAny*)&data[breakEntry->iAddress - aAddress], (TAny *)breakEntry->iInstruction.Ptr(), instSize);
-					}
-				}
-			} while(breakEntry);
-		}
-
-	return err;
-	}
-
-/**
-Attempt to write memory to aThread's address space
-
-@param aThread thread to whose address space memory is to be written
-@param aAddress memory location to write memory to
-@param aLength number of bytes of data to write
-@param aData descriptor containing memory to write
-
-@return KErrNone if memory written successfully,
-        KErrArgument if aLength is greater than than the length of the aData
-        KErrBadHandle if aThread is invalid,
-	or another of the system wide error codes
-*/
-TInt DRM_DebugChannel::DoWriteMemory(DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData)
-	{
-	LOG_MSG("DRM_DebugChannel::DoWriteMemory()");
-
-	// make sure the parameters are valid
-	if (aLength > aData.Length())
-		return KErrArgument;
-
-	TInt err = KErrNone;
-
-	// trap exceptions in case the address is invalid
-	XTRAPD(r, XT_DEFAULT, err = TryToWriteMemory(aThread, (TAny *)aAddress, (TAny *)aData.Ptr(), aLength));
-
-	err = (KErrNone == r) ? err : r;
-
-	// reset any breakpoints we may have just overwritten
-	if (KErrNone == err)
-		{
-		TPtr8 data((TUint8 *)aData.Ptr(), aLength, aLength);
-
-		TBreakEntry* breakEntry = NULL;
-		do
-			{
-			breakEntry = iBreakManager->GetNextBreak(breakEntry);
-			if(breakEntry && !iBreakManager->IsTemporaryBreak(*breakEntry))
-				{
-				if ((breakEntry->iAddress >= aAddress) && (breakEntry->iAddress < (aAddress + aLength)))
-					{
-					// default to arm mode
-					TUint32 inst;
-					TInt instSize;
-
-					switch (breakEntry->iMode)
-						{
-						case EArmMode:
-							inst = KArmBreakPoint;
-							instSize = 4;
-							break;
-
-						case EThumbMode:
-							inst = KThumbBreakPoint;
-							instSize = 2;
-							break;
-
-						case EThumb2EEMode:
-						default:
-							LOG_MSG("DRM_DebugChannel::DoWriteMemory() cannot fixup breakpoints of unsupported architecture type");
-
-							return KErrNotSupported;
-						}
-
-					breakEntry->iInstruction.Copy(&data[breakEntry->iAddress - aAddress], instSize);
-					memcpy((TAny*)breakEntry->iAddress, (TAny *)&inst, instSize);
-					}
-				}
-
-			} while(breakEntry);
-		}
-	return err;
-	}
-
-//
-// DRM_DebugChannel::DoReadRegisters
-//
-TInt DRM_DebugChannel::DoReadRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDes8 &aValues)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::DoReadRegisters()");
-
-	// make sure the parameters are valid
-	if (!aThread || (aFirstRegister < 0) || (aLastRegister >= (TInt16)(sizeof(TArmRegSet)/sizeof(TArmReg))))
-		return KErrArgument;
-
-	// make sure the descriptor is big enough to hold the requested data
-	if ((TInt)((aLastRegister - aFirstRegister + 1) * sizeof(TArmReg)) > (aValues.MaxSize()))
-		return KErrArgument;
-
-	TArmRegSet regSet;
-	TUint32 unused;
-
-	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, unused);
-
-	LOG_MSG2( "DRM_DebugChannel::DoReadRegistersLegacy() : unused = 0x%X\n", unused );
-
-	TArmReg *reg = &regSet.iR0;
-
-	if (!reg)
-		return KErrGeneral;
-
-	for (TInt16 i = aFirstRegister; i <= aLastRegister; i++)
-		aValues.Append((TUint8 *)&reg[i], sizeof(TArmReg));
-
-	return KErrNone;
-}
-
-/**
-  @prototype
-
-  Experimental function for determining whether a thread is suspended.
-
-  @param aThread thread to check if suspended
-
-  @return ETrue if the thread is suspended, EFalse if it isn't or does not exist
-  */
-TBool DRM_DebugChannel::CheckSuspended(const DThread *aThread) const
-	{
-	if(!aThread)
-		{
-		return EFalse;
-		}
-
-	if( (aThread->iNThread.iCsCount>0) && (aThread->iNThread.iCsFunction>0) )
-		{
-		return ETrue;
-		}
-
-	if(aThread->iNThread.iSuspendCount > 0)
-		{
-		return ETrue;
-		}
-	return EFalse;
-	}
-
-/**
-Read registers and store register values in aRegisterValues and the flags
-indicating which registers could be read in aRegisterFlags
-
-@param aThread thread to read registers from
-@param aRegisterIds array containing register IDs to read
-@param aRegisterValues array to store register values in
-@param aRegisterFlags array to store flags in
-
-@return KErrNone if registers were read successfully. Note that this does not
-        mean that all the registers could be read, the aRegisterFlags array
-        should be checked as to whether each individual register could be read,
-        KErrArgument if aThread is NULL, if an unknown register is specified in
-        aRegisterValues or if aRegisterValues is too small
-        KErrGeneral if there was a problem initialising the register set
-*/
-TInt DRM_DebugChannel::DoReadRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDes8 &aRegisterValues, TDes8& aRegisterFlags) const
-	{
-	LOG_MSG("DRM_DebugChannel::DoReadRegisters()");
-
-	// make sure the parameters are valid
-	if (!aThread)
-		return KErrArgument;
-
-	//Need to revisit this to determine whether there is a way to validate this
-#if 0
-	if ( !CheckSuspended(aThread) )
-		{
-		LOG_MSG2("DRM_DebugChannel::DoReadRegisters() thread with id 0x%08x is not suspended", aThread->iId);
-		return KErrInUse;
-		}
-#endif
-
-	//set lengths of output descriptors to 0 prior to filling
-	aRegisterValues.SetLength(0);
-	aRegisterFlags.SetLength(0);
-
-	TArmRegSet regSet;
-	TUint32 flags;
-
-	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, flags);
-
-	LOG_MSG2( "DRM_DebugChannel::DoReadRegisters() : flags = 0x%X\n", flags );
-
-	TArmReg *regPtr = &regSet.iR0;
-
-	if (!regPtr)
-		return KErrGeneral;
-
-	TUint numberOfRegisters = aRegisterIds.Length() / sizeof(TRegisterInfo);
-
-	//iterate through registers setting the relevant aFlags value
-	for(TUint i=0; i<numberOfRegisters; i++)
-		{
-		//get current register id
-		TRegisterInfo reg;
-		TInt err = GetTRegisterInfo(aRegisterIds, i, reg);
-		//exit with the error value if there was an error
-		if(err != KErrNone)
-			return err;
-
-		//if unknown register then exit as can't know how many bytes this entry will
-		//represent in aRegisterValues
-		TTag registerTag;
-		TDebugFunctionality::GetRegister(reg, registerTag);
-		if(registerTag.iValue == EAccessUnknown)
-			{
-			return KErrArgument;
-			}
-
-		//get the current register id as a kernel register
-		TArmReg armReg;
-		err = GetKernelRegisterId(reg, armReg);
-		if((err == KErrNotSupported) || (registerTag.iValue == EAccessNone) || (registerTag.iValue == EAccessWriteOnly))
-			{
-			//reading this register is not supported
-			aRegisterFlags.Append(ENotSupported);
-			//just skip over this entry in the values buffer
-			if(aRegisterValues.Length() + registerTag.iSize > aRegisterValues.MaxLength())
-				{
-				//writing this value would cause overflow so exit
-				return KErrArgument;
-				}
-			aRegisterValues.SetLength(aRegisterValues.Length() + registerTag.iSize);
-			}
-		else
-			{
-			if(registerTag.iSize == sizeof(TArmReg))
-				{
-				if(GetFlagAtOffset(flags, armReg))
-					{
-					//set flag as valid
-					aRegisterFlags.Append(EValid);
-					}
-				else
-					{
-					// Even though the flag is invalid, we can return the value of the register
-					// and let the user decide what to do
-					aRegisterFlags.Append(EInValid);
-					}
-
-				if(aRegisterValues.Length() + sizeof(TArmReg) > aRegisterValues.MaxLength())
-					{
-					//writing this value would cause overflow so exit
-					return KErrArgument;
-					}
-				//write value into register into regSet
-				aRegisterValues.Append((TUint8 *)&regPtr[armReg], registerTag.iSize);
-				}
-			else
-				{
-				//currently all kernel supported registers are 4 bytes so
-				//return EBadSize. Would need updating if/when other register
-				//value sizes are supported
-				aRegisterFlags.Append(EBadSize);
-				aRegisterValues.SetLength(aRegisterValues.Length() + registerTag.iSize);
-				}
-			}
-		}
-	return KErrNone;
-	}
-
-//
-// DRM_DebugChannel::DoWriteRegisters
-//
-TInt DRM_DebugChannel::DoWriteRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDesC8 &aValues)
-	{
-	LOG_MSG("DRM_DebugChannel::DoWriteRegisters()");
-
-	// make sure the parameters are valid
-	if (!aThread || (aFirstRegister < 0) || (aLastRegister >= (TInt16)(sizeof(TArmRegSet)/sizeof(TArmReg))))
-		return KErrArgument;
-
-	// make sure the descriptor is big enough to hold the data to write
-	if ((TInt)((aLastRegister - aFirstRegister + 1) * sizeof(TArmReg)) > (aValues.Length()))
-		return KErrArgument;
-
-	TArmRegSet regSet;
-	TUint32 unused;
-
-	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, unused);
-
-	TArmReg *reg = &regSet.iR0;
-
-	for (TInt16 i = aFirstRegister; i <= aLastRegister; i++)
-		reg[i] = *(TUint32 *)&aValues[(i-aFirstRegister)*sizeof(TArmReg)];
-
-	NKern::ThreadSetUserContext(&aThread->iNThread, &regSet);
-
-	return KErrNone;
-	}
-
-/**
-Write registers and store flags indicating which registers could be read in
-aRegisterFlags
-
-@param aThread thread to write registers to
-@param aRegisterIds array containing register IDs to write
-@param aRegisterValues array containing register values to write
-@param aRegisterFlags array to store flags in
-
-@return KErrNone if registers were written successfully. Note that this does not
-        mean that all the registers could be written, the aRegisterFlags array
-        should be checked as to whether each individual register could be read,
-        KErrArgument if aThread is NULL, if the buffer passed in as
-        aRegisterValue is too small, or if an unknown register is requested,
-        KErrGeneral if there was a problem initialising the register set
-*/
-TInt DRM_DebugChannel::DoWriteRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDesC8 &aRegisterValues, TDes8 &aRegisterFlags) const
-	{
-	LOG_MSG("DRM_DebugChannel::DoWriteRegisters()");
-
-	// make sure the parameters are valid
-	if (!aThread)
-		return KErrArgument;
-
-	//check that the thread is suspended before reading the registers
-	if(!TheDProcessTracker.CheckSuspended(aThread))
-		{
-		LOG_MSG2("DRM_DebugChannel::DoWriteRegisters() thread with id 0x%08x is not suspended", aThread->iId);
-		return KErrInUse;
-		}
-
-	//get register values from kernel
-	TArmRegSet regSet;
-	TUint32 flags;
-	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, flags);
-
-	//set lengths of output descriptors to 0 prior to filling
-	aRegisterFlags.SetLength(0);
-
-	//pointer to first kernel register
-	TArmReg *regPtr = &regSet.iR0;
-
-	if (!regPtr)
-		return KErrGeneral;
-
-	//calculate number of registers
-	TUint numberOfRegisters = aRegisterIds.Length() / sizeof(TRegisterInfo);
-
-	//iterate through registers setting the relevant aRegisterFlags value and
-	//setting the necessary value in regSet ready to write to kernel
-	for(TUint i=0, offset = 0; i<numberOfRegisters; i++)
-		{
-		//get current register id
-		TRegisterInfo reg;
-		TInt err = GetTRegisterInfo(aRegisterIds, i, reg);
-		//exit with the error value if there was an error
-		if(err != KErrNone)
-			{
-			return err;
-			}
-
-		//if unknown register then exit as can't know how many bytes this entry will
-		//represent in aRegisterValues
-		TTag registerTag;
-		TDebugFunctionality::GetRegister(reg, registerTag);
-		if(registerTag.iValue == EAccessUnknown)
-			{
-			return KErrArgument;
-			}
-
-		//get the current register id as a kernel register
-		TArmReg armReg;
-		err = GetKernelRegisterId(reg, armReg);
-		if((err == KErrNotSupported) || (registerTag.iValue == EAccessNone) || (registerTag.iValue == EAccessReadOnly))
-			{
-			//writing to this register is not supported
-			aRegisterFlags.Append(ENotSupported);
-			}
-		else if(GetFlagAtOffset(flags, armReg))
-			{
-			if(registerTag.iSize == sizeof(TArmReg))
-				{
-				//set flag as valid
-				aRegisterFlags.Append(EValid);
-				if(offset + sizeof(TArmReg) > aRegisterValues.Length())
-					{
-					//getting this value would cause overflow so exit
-					return KErrArgument;
-					}
-				//write value into register into regSet
-				regPtr[armReg] = *(TUint32 *)&aRegisterValues[offset];
-				}
-			else
-				{
-				//currently all kernel supported registers are 4 bytes so
-				//return EBadSize. Would need updating if/when other register
-				//value sizes are supported
-				aRegisterFlags.Append(EBadSize);
-				}
-
-			}
-		else
-			{
-			//set flag as invalid as register value couldn't be read
-			aRegisterFlags.Append(EInValid);
-			}
-		offset+=registerTag.iSize;
-		}
-
-	//write the input data into the registers
-	NKern::ThreadSetUserContext(&aThread->iNThread, &regSet);
-
-	//return normally
-	return KErrNone;
-	}
-
-//
-// DRM_DebugChannel::DoSecurityCheck
-//
-TBool DRM_DebugChannel::DoSecurityCheck()
-	{
-	LOG_MSG("DRM_DebugChannel::DoSecurityCheck");
-	DProcess* clientProcess = iClientThread->iOwningProcess;
-	if (clientProcess)
-		{
-		SSecurityInfo secureInfo = clientProcess->iS;
-
-		LOG_MSG2("DoSecurityCheck - client secure id is 0x%08x",secureInfo.iSecureId);
-
-		// Ensure we really are communicating with the Debug Security Server
-		if (secureInfo.iSecureId == KUidDebugSecurityServer.iUid )
-			{
-			return ETrue;
-			}
-		}
-	return EFalse;
-	}
-
-/**
-Attempt to read memory from aThread's address space
-
-@param aThread thread from whose address space memory is to be read
-@param aSrc pointer to memory location to read memory from
-@param aDest pointer to memory location to write memory to
-@param aLength number of bytes of data to read
-
-@return KErrNone if memory read successfully,
-	or another of the system wide error codes
-*/
-TInt DRM_DebugChannel::TryToReadMemory(const DThread *aThread, const TAny *aSrc, TAny *aDest, const TUint32 aLength) const
-	{
-	LOG_MSG("DRM_DebugChannel::TryToReadMemory()");
-
-	// make sure the parameters are valid
-	if (!aThread)
-		return KErrArgument;
-
-	//Need to revisit this to determine whether there is a way to validate this
-#if 0
-	//check that the thread is suspended before reading the memory
-	if ( !CheckSuspended(aThread) )
-		{
-		LOG_MSG2("DRM_DebugChannel::TryToReadMemory() thread with id 0x%08x is not suspended", aThread->iId);
-		return KErrInUse;
-		}
-#endif
-
-	LOG_MSG2("Using Kern::ThreadRawRead to read memory at address %x", aSrc);
-	return Kern::ThreadRawRead((DThread *)aThread, aSrc, aDest, aLength);
-	}
-
-/**
-Attempt to write memory to aThread's address space
-
-@param aThread thread to whose address space memory is to be written
-@param aDest pointer to memory location to write memory to
-@param aSrc pointer to memory location to read memory from
-@param aLength number of bytes of data to write
-
-@return KErrNone if memory written successfully, or another of the system wide
-        error codes
-*/
-TInt DRM_DebugChannel::TryToWriteMemory(const DThread *aThread, TAny *aDest, const TAny *aSrc, const TUint32 aLength)
-	{
-	LOG_MSG("DRM_DebugChannel::TryToWriteMemory()");
-
-	//check that the thread is suspended before writing the memory
-	if(!TheDProcessTracker.CheckSuspended((DThread*)aThread))
-		{
-		LOG_MSG2("DRM_DebugChannel::TryToWriteMemory() thread with id 0x%08x is not suspended", aThread->iId);
-		return KErrInUse;
-		}
-
-	LOG_MSG2("Using Kern::ThreadRawWrite to write memory at address %x", (TUint32)aDest);
-	return Kern::ThreadRawWrite((DThread *)aThread, aDest, aSrc, aLength, iClientThread);
-	}
-
-/**
-@deprecated use DRM_DebugChannel::ReadKernelRegisterValue(DThread *aThread, const TArmReg aKernelRegisterId, T4ByteRegisterValue &aValue) instead
-*/
-TInt32 DRM_DebugChannel::ReadRegister(DThread *aThread, TInt aNum)
-	{
-	LOG_MSG("DRM_DebugChannel::ReadRegister()");
-
-	if (!aThread || (aNum < 0) || (aNum >= (TInt16)(sizeof(TArmRegSet)/sizeof(TArmReg))))
-		{
-		LOG_MSG2("Invalid register number (%d) passed to ReadRegister", aNum);
-		return 0;
-		}
-
-	TArmRegSet regSet;
-	TUint32 unused;
-
-	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, unused);
-
-	TArmReg *reg = &regSet.iR0;
-
-	return ((TUint32 *)reg)[aNum];
-	}
-
-/**
-Given a TArmReg register ID, read the value of the register. The register value
-will be stored in aValue if the register could be read.
-
-@param aThread thread to read register from
-@param aKernelRegisterId ID of register to read from
-@param aValue value read from register
-
-@return KErrNone if value was successfully stored in aValue,
-        KErrNotSupported if aKernelRegister is not supported by the debug
-	security server,
-        or a return value from DRM_DebugChannel::ReadDebugRegisterValue()
-*/
-TInt32 DRM_DebugChannel::ReadKernelRegisterValue(DThread *aThread, const TArmReg aKernelRegisterId, T4ByteRegisterValue &aValue) const
-	{
-	//get register ID as a TRegisterInfo ID
-	TRegisterInfo regId;
-	TInt err = GetDebugRegisterId(aKernelRegisterId, regId);
-	if(err != KErrNone)
-		return err;
-
-	//get the value for the register
-	err = ReadDebugRegisterValue(aThread, regId, aValue);
-	return err;
-	}
-
-/**
-Given a TRegisterInfo register ID, read the value of this register. The
-register value will be stored in aValue if the register could be read.
-
-@param aThread thread to read register from
-@param aDebugRegisterId ID of register to read from
-@param aValue value read from register
-
-@return KErrNone if value was successfully stored in aValue,
-        TRegisterFlag::EInValid if value could not be read from the register,
-        TRegisterFlag::ENotSupported if the register is not supported,
-        KErrNoMemory if temporary memory could not be allocated,
-        or a return value from DRM_DebugChannel::DoReadRegisters
-*/
-TInt32 DRM_DebugChannel::ReadDebugRegisterValue(DThread *aThread, const TRegisterInfo aDebugRegisterId, T4ByteRegisterValue &aValue) const
-	{
-	//allocate temporary buffers to store data
-	NKern::ThreadEnterCS();
-	TUint8* id = (TUint8*)Kern::Alloc(sizeof(TRegisterInfo));
-	NKern::ThreadLeaveCS();
-	if(id == NULL)
-		{
-		return KErrNoMemory;
-		}
-
-	TPtr8 idPtr(id, sizeof(TRegisterInfo));
-
-	NKern::ThreadEnterCS();
-	TUint8* value = (TUint8*)Kern::Alloc(sizeof(T4ByteRegisterValue));
-	NKern::ThreadLeaveCS();
-	if(value == NULL)
-		{
-		return KErrNoMemory;
-		}
-	TPtr8 valuePtr(value, sizeof(T4ByteRegisterValue));
-
-	NKern::ThreadEnterCS();
-	TUint8* flag = (TUint8*)Kern::Alloc(sizeof(TUint8));
-	NKern::ThreadLeaveCS();
-	if(flag == NULL)
-		{
-		return KErrNoMemory;
-		}
-	TPtr8 flagPtr(flag, sizeof(TUint8));
-
-	//store register id in buffer
-	idPtr.Append((TUint8*)&aDebugRegisterId, sizeof(TRegisterInfo));
-
-	//read registers
-	TInt err = DoReadRegisters(aThread, idPtr, valuePtr, flagPtr);
-	if(err == KErrNone)
-		{
-		if(*flag == EValid)
-			{
-			//register could be read so store value
-			aValue = *(T4ByteRegisterValue*)value;
-			}
-		else
-			{
-			//register couldn't be read for some reason
-			err = *flag;
-			}
-		}
-
-	//free memory
-	NKern::ThreadEnterCS();
-	Kern::Free(id);
-	Kern::Free(value);
-	Kern::Free(flag);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-//
-// DRM_DebugChannel::NotifyEvent
-//
-void DRM_DebugChannel::NotifyEvent(const TDriverEventInfo& aEventInfo)
-	{
-	LOG_EVENT_MSG("DRM_DebugChannel::NotifyEvent()");
-
-	// Look for the relevant DTargetProcess
-	// We can find out the relevant process id from aEventInfo
-	TUint32 pid = aEventInfo.iProcessId;
-
-	//opening handle to process
-	DProcess* targetProcess = DebugUtils::OpenProcessHandle(pid);
-
-	if(!targetProcess)
-		{
-		LOG_EVENT_MSG("DRM_DebugChannel::NotifyEvent - process does not exist!");
-		return;
-		}
-
-	// Are we debugging this process - decide based on iFileName
-	DCodeSeg* p = targetProcess->iCodeSeg;
-	DTargetProcess* foundProcess;
-	if (p)
-		{
-		 foundProcess = TheDProcessTracker.FindProcess(*(p->iFileName));
-		}
-	else
-		{
-		// special case: may not have a code seg in some cases. in which case we tell everyone!
-		if (targetProcess->iName)
-			{
-			// copy the name of the process
-			foundProcess = TheDProcessTracker.FindProcess(*(targetProcess->iName));
-			}
-		else
-			{
-			foundProcess = NULL;
-			}
-		}
-
-	//close the handle
-	targetProcess->Close(NULL);
-
-	if (!foundProcess)
-		{
-		// No: just ignore this exception
-		LOG_EVENT_MSG("DRM_DebugChannel::NotifyEvent - we are not debugging this process!");
-		return;
-		}
-
-	foundProcess->NotifyEvent(aEventInfo);
-	}
-
-#ifndef __LAUNCH_AS_EXTENSION__
-DECLARE_STANDARD_LDD()
-	{
-	return new DRM_DebugDriverFactory;
-	}
-#else
-
-DStopModeExtension* TheStopModeExtension = NULL;
-
-DECLARE_EXTENSION_LDD()
-	{
-	return new DRM_DebugDriverFactory;
-	}
-
-/**
-  This value is used as an initialiser for the size of the Stop-Mode Debug API's
-  default request buffer.
-  */
-const TInt KRequestBufferSize = 0x200;
-/**
-  This value is used as an initialiser for the size of the Stop-Mode Debug API's
-  default response buffer.
-  */
-const TInt KResponseBufferSize = 0x1000;
-
-DECLARE_STANDARD_EXTENSION()
-	{
-	__KTRACE_OPT(KBOOT,Kern::Printf("Starting RM_DEBUG extension"));
-
-	// get a reference to the DDebuggerInfo and to the DStopModeExtension
-	TSuperPage& superPage = Kern::SuperPage();
-
-	if(!superPage.iDebuggerInfo)
-		{
-		//kdebug has not been installed so create DDebuggerInfo using our stub constructor
-		superPage.iDebuggerInfo = new DDebuggerInfo();
-		}
-
-	if(!TheStopModeExtension)
-		{
-		TheStopModeExtension = new DStopModeExtension();
-		}
-
-	// create the request buffer and store a reference to it
-	TTag tag;
-	tag.iTagId = EBuffersRequest;
-	tag.iType = ETagTypePointer;
-	tag.iSize = KRequestBufferSize;
-	TInt err = TheDBufferManager.CreateBuffer(tag);
-	if(KErrNone != err)
-		{
-		return KErrNone;
-		}
-
-	// create the response buffer and store a reference to it
-	tag.iTagId = EBuffersResponse;
-	tag.iSize = KResponseBufferSize;
-	err = TheDBufferManager.CreateBuffer(tag);
-	if(KErrNone != err)
-		{
-		return KErrNone;
-		}
-	// create the debug functionality buffer and store a reference to it
-	TDebugFunctionality df;
-	TUint dfSize = df.GetStopModeFunctionalityBufSize();
-	tag.iTagId = EBuffersFunctionality;
-	tag.iSize = dfSize;
-	err = TheDBufferManager.CreateBuffer(tag);
-	if(KErrNone != err)
-		{
-		return KErrNone;
-		}
-
-	// fill the functionality buffer with the functionality data and store it in
-	// the super page
-	TPtr8 dfBlockPtr((TUint8*)tag.iValue, dfSize);
-	if(!df.GetStopModeFunctionality(dfBlockPtr))
-		{
-		return KErrNone;
-		}
-	TheStopModeExtension->iFunctionalityBlock = (DFunctionalityBlock*)tag.iValue;
-
-	DStopModeExtension::Install(TheStopModeExtension);
-
-	return KErrNone;
-	}
-
-/**
- * This stub constructor is intended to be used in the case where the old deprecated
- * stop mode api, kdebug, is not in place. It will initialise all values to NULL except
- * the pointer to the new stop mode api extension. This allows the new stop mode solution
- * to both co-exist and exist independantly of the existing one *
- */
-DDebuggerInfo::DDebuggerInfo():
-	iObjectOffsetTable(NULL),
-	iObjectOffsetTableCount(NULL),
-	iThreadContextTable(NULL),
-	iStopModeExtension(new DStopModeExtension()),
-	iContainers(NULL),
-	iCodeSegLock(NULL),
-	iCodeSegGlobalList(NULL),
-	iScheduler(NULL),
-	iShadowPages(NULL),
-	iShadowPageCount(0),
-	iCurrentThread(NULL),
-	iEventMask(),
-	iEventHandlerBreakpoint(0),
-	iMemModelObjectOffsetTable(NULL),
-	iMemModelObjectOffsetTableCount(0)
-	{
-	}
-
-/**
- * Installs the stop-mode debugger extension
- * Make the stop-mode API visible to a JTAG debugger, by publishing its
- * existence in the superpage
-*/
-void DStopModeExtension::Install(DStopModeExtension* aExt)
-	{
-	Kern::SuperPage().iDebuggerInfo->iStopModeExtension = aExt;
-	}
-
-#endif
-
-/**
-Helper function
-
-Allocates memory in current thread with a max length the same as aSrcDes. If
-aReadFromClient is true (as it is by default) then the data from aSrdDes is
-copied into the allocated aDestDes buffer.
-
-Use of this function should be followed at a later time by a call such as
-Kern::Free(aDestDes.Ptr())
-
-@param aThread pointer to thread to read data from
-@param aSrcDes descriptor in aThread to read data from
-@param aDestDes location to read data to. Memory is allocated at this location,
-       if memory is already allocated at this location then the function will
-       return KErrArgument
-@param aReadFromClient if false then data is not actually read from the
-       client, the memory is simply allocated
-@param aOffest offset into aSrcDes to start reading from. Default is 0.
-
-@return KErrNone if there were no problems,
-        KErrArgument if aDestDes.Ptr() != NULL or aSrcDes has max length 0,
-        KErrNoMemory if could not allocate memory,
-        or one of the other system wide error codes
-*/
-TInt DRM_DebugChannel::AllocAndReadDes(DThread *aThread, const TDesC8& aSrcDes, TPtr8& aDestDes, const TBool aReadFromClient, const TUint aOffset) const
-	{
-
-	//check thread is not null
-	if(!aThread)
-		{
-		return KErrArgument;
-		}
-
-	//check aDestDes is empty
-	if(aDestDes.Ptr() != NULL)
-		{
-		return KErrArgument;
-		}
-
-	//get the source descriptor's max length and exit if 0
-	TUint srcMaxLength = Kern::ThreadGetDesMaxLength(aThread, &aSrcDes);
-	if(srcMaxLength == 0)
-		{
-		return KErrNone;
-		}
-
-	//allocate memory and return if none available
-	NKern::ThreadEnterCS();
-	TUint8 *destPtr = (TUint8*)Kern::Alloc(srcMaxLength);
-	NKern::ThreadLeaveCS();
-	if (!destPtr)
-		{
-		return KErrNoMemory;
-		}
-
-	//point the TPtr8 at the target memory
-	aDestDes.Set(destPtr, srcMaxLength, srcMaxLength);
-
-	if(aReadFromClient)
-		{
-		//read data from the client thread and return status code
-		return Kern::ThreadDesRead(aThread, &aSrcDes, aDestDes, aOffset);
-		}
-	else
-		{
-		return KErrNone;
-		}
-	}
-
-/**
-Helper function to extract a TRegisterInfo value from a descriptor containing
-binary data.
-
-@param aRegisterIds descriptor containing register IDs
-@param aOffset offset in bytes into the descriptor to start reading data from.
-       If this value is not a multiple of sizeof(TRegisterInfo) then a
-       KErrArgument error is returned.
-@param aValue will contain the returned value
-
-@return KErrNone if aValue was set correctly, KErrArgument if bad arguments
-        were passed in
-*/
-TInt DRM_DebugChannel::GetTRegisterInfo(const TDesC8 &aRegisterIds, const TUint aIndex, TRegisterInfo &aValue) const
-	{
-	TUint length = aRegisterIds.Length();
-
-	TUint size = sizeof(TRegisterInfo);
-
-	//check that not trying to read past end of descriptor
-	if((aIndex + 1) * size > length)
-		return KErrArgument;
-
-	//get pointer to descriptor's data
-	const TUint8 *dataPtr = aRegisterIds.Ptr();
-	const TRegisterInfo *registerId = reinterpret_cast<const TRegisterInfo*>(dataPtr + (aIndex * size));
-
-	aValue = *registerId;
-
-	return KErrNone;
-	}
-
-/**
-Helper function to get the kernel register ID of the TRegisterInfo defined register.
-
-@param aDebugRegister the debug register ID to return the kernel ID for
-@param aKernelRegister corresponding value of register aDebugRegister
-
-@return KErrNone if translation occurred without problems
-        KErrNotSupported if aDebugRegister is not supported by the kernel
-*/
-TInt DRM_DebugChannel::GetKernelRegisterId(const TRegisterInfo aDebugRegister, TArmReg& aKernelRegister) const
-	{
-	if(Register::IsCoreReg(aDebugRegister))
-		{
-		TUint id = Register::GetCoreRegId(aDebugRegister);
-		//first 17 registers match the first 17 kernel registers
-		if(id < 17)
-			{
-			aKernelRegister = id;
-			}
-		else
-			{
-			return KErrNotSupported;
-			}
-		}
-	else if(Register::IsCoproReg(aDebugRegister))
-		{
-		TUint32 crn = Register::GetCRn(aDebugRegister);
-		TUint32 crm = Register::GetCRm(aDebugRegister);
-		TUint32 opcode1 = Register::GetOpcode1(aDebugRegister);
-		TUint32 opcode2 = Register::GetOpcode2(aDebugRegister);
-		TUint32 coproNum = Register::GetCoproNum(aDebugRegister);
-
-		//each coprocessor register has potentially different characteristics
-		//so need to identify each individually
-
-		//this is the DACR, the ARM ARM specifies that the CRn and the
-		//Opcodes are not relevant, section B3-24, point 3.7.3
-		if((coproNum == 15) && (crm == 3))
-			{
-			aKernelRegister = EArmDacr;
-			}
-		else
-			{
-			return KErrNotSupported;
-			}
-		}
-	else // might be supported at a later date
-		{
-		return KErrNotSupported;
-		}
-
-	return KErrNone;
-	}
-
-/**
-Helper function to get the debug register ID of the kernel defined register.
-
-@param aKernelRegister the kernel register ID to return the debug ID for
-@param aDebugRegister corresponding value of register aKernelRegister
-
-@return KErrNone if translation occured without problems
-        KErrNotSupported if aKernelRegister is not supported by the debug
-	security server
-*/
-TInt DRM_DebugChannel::GetDebugRegisterId(const TArmReg aKernelRegister, TRegisterInfo &aDebugRegister) const
-	{
-
-	// registers 0 - 15 and the CPSR share the same values as with the debug enums
-	if(aKernelRegister < 17)
-		{
-		TUint32 id = aKernelRegister;
-		aDebugRegister = id << 8;
-		}
-	//the DACR value is special and corresponds to EDF_Register_DACR
-	else if(aKernelRegister == EArmDacr)
-		{
-		aDebugRegister = 0x00300f01;
-		}
-	// must be an unsupported register, return an error as such
-	else
-		{
-		return KErrNotSupported;
-		}
-
-	//found a supported register so return KErrNone
-	return KErrNone;
-	}
-
-/**
-Helper function to find out whether the aIndex flag is set. This is equivalent
-to the aIndex bit of aFlags being non-zero.
-
-@param aFlags set of flags
-@param aIndex offset into aFlags to get flag from
-
-@return ETrue if bit is set, EFalse if not
-*/
-TBool DRM_DebugChannel::GetFlagAtOffset(const TUint32 aFlags, const TArmReg aIndex) const
-	{
-	return aFlags & (1<<aIndex);
-	}
-
-/* Register the attachment of a debug agent to a process to be debugged
- *
- * @param a1 - TDes8 target process name
- * @param a2 - &TUint64 - Debug Agent Id
- *
- * @return - KErrNone if successful. KErrArgument if the filepath is not a valid size.
- * KErrOutOfMemory if there is insufficient memory. Or one of the other system wide error codes
- * if appropriate.
- */
-TInt DRM_DebugChannel::AttachProcess(TAny* a1, TAny* a2)
-	{
-	LOG_MSG("DRM_DebugChannel::AttachProcess()");
-
-	// Validate the supplied TDes8 target process name in a1
-	TInt length, maxLength;
-	TUint8* aPtr;
-
-	TInt err = Kern::ThreadGetDesInfo(iClientThread,\
-		a1,\
-		length,\
-		maxLength,\
-		aPtr,\
-		EFalse);
-	if (err != KErrNone)
-		{
-		// Could not read the descriptor information
-		return err;
-		}
-
-	// Check the processname is a valid size for a filepath
-	if (length < 1 || length >= KMaxPath)
-		{
-		return KErrArgument;
-		}
-
-	if (maxLength < 1 || maxLength >= KMaxPath)
-		{
-		return KErrArgument;
-		}
-
-	// Allocate space to store the target process name in a kernel-side TPtr8
-	NKern::ThreadEnterCS();
-	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
-	NKern::ThreadLeaveCS();
-	if (buffer==NULL)
-		{
-		// Out of memory
-		return KErrNoMemory;
-		}
-
-	// A temporary descriptor to store the target process name
-	TPtr8 targetProcessName(buffer,length,length);
-
-	// Read the user-side data into targetProcessName
-	err = Kern::ThreadDesRead(iClientThread,a1,targetProcessName,0,KChunkShiftBy0);
-	if (err != KErrNone)
-		{
-		// Could not read the user-side descriptor containing the target process name
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-
-		return err;
-		}
-
-	// Obtain the Debug Agent Id
-	TUint64 debugAgentId = 0;
-
-	err = Kern::ThreadRawRead(iClientThread,a2,&debugAgentId,sizeof(debugAgentId));
-	if (err != KErrNone)
-		{
-		// Something bad happened so free the memory and return
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-		return err;
-		}
-
-	// Add the target process to our list of tracked processes
-	err = TheDProcessTracker.AttachProcess(targetProcessName, debugAgentId);
-
-	// Free the kernel-side memory containing targetProcessName data
-	NKern::ThreadEnterCS();
-	Kern::Free(buffer);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/* Register the detachment of a debug agent to a process to be debugged.
- *
- * @param - a1 TDes8 target process name in a1
- * @param a2 - &TUint64 - Debug Agent Id
- *
- * @return - KErrNone if successful. KErrArgument if the filepath is not a valid size.
- * KErrOutOfMemory if there is insufficient memory. Or one of the other system wide error codes
- * if appropriate.
- */
-TInt DRM_DebugChannel::DetachProcess(TAny* a1, TAny* a2)
-	{
-	// Validate the supplied TDes8 target process name in a1
-	TInt length, maxLength;
-	TUint8* aPtr;
-
-	TInt err = Kern::ThreadGetDesInfo(iClientThread,\
-		a1,\
-		length,\
-		maxLength,\
-		aPtr,\
-		EFalse);
-	if (err != KErrNone)
-		{
-		return err;
-		}
-
-	if (length < 1 || length >= KMaxPath)
-		{
-		return KErrArgument;
-		}
-
-	if (maxLength < 1 || maxLength >= KMaxPath)
-		{
-		return KErrArgument;
-		}
-
-	// Allocate space to store the target process name in a kernel-side TPtr8
-	NKern::ThreadEnterCS();
-	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
-	NKern::ThreadLeaveCS();
-	if (buffer==NULL)
-		{
-		// Out of memory
-		return KErrNoMemory;
-		}
-
-	TPtr8 targetProcessName(buffer,length,length);
-
-	// Read the user-side data into targetProcessName
-	err = Kern::ThreadDesRead(iClientThread,a1,targetProcessName,0,KChunkShiftBy0);
-	if (err != KErrNone)
-		{
-		// Something bad happened so free the memory and return
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-
-		return err;
-		}
-
-	// Obtain the AgentId
-	TUint64 debugAgentId = 0;
-
-	err = Kern::ThreadRawRead(iClientThread,a2,&debugAgentId,sizeof(debugAgentId));
-	if (err != KErrNone)
-		{
-		// Something bad happened so free the memory and return
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-
-		return err;
-		}
-
-	// Remove the process from our list of tracked processes
-	err = TheDProcessTracker.DetachProcess(targetProcessName, debugAgentId);
-
-	// Free the kernel-side memory containing targetProcessName data
-	NKern::ThreadEnterCS();
-	Kern::Free(buffer);
-	NKern::ThreadLeaveCS();
-
-	return err;
-	}
-
-/* Register the detachment of a debug agent from all processes being debugged.
- *
- * @param - a1 - &TUint64 Debug Agent Id.
- * @return - KErrNone if successful. One of the system-wide error codes otherwise.
- */
-TInt DRM_DebugChannel::DetachAgent(TAny* a1, TAny* a2)
-	{
-	// Obtain the AgentId
-	TUint64 debugAgentId = 0;
-
-	TInt err = Kern::ThreadRawRead(iClientThread,a1,&debugAgentId,sizeof(debugAgentId));
-	if (err != KErrNone)
-		{
-		return err;
-		}
-
-	// Remove the process from our list of tracked processes
-	return TheDProcessTracker.DetachAgent(debugAgentId);
-	}
-
-/* Set the action associated with a particular kernel event for a given agent and target process
- *
- * @param - a1 TDes8 target process name in a1
- * @param - a2 &TRM_DebugEventActionInfo
- * @return - KErrNone if successful. KErrArgument if the filepath is an invalid size. Or one of
- * the other system wide error codes if appropriate.
- */
-TInt DRM_DebugChannel::SetEventAction(TAny* a1, TAny* a2)
-	{
-	// Validate the supplied TDes8 target process name in a1
-	TInt length, maxLength;
-	TUint8* aPtr;
-
-	TInt err = Kern::ThreadGetDesInfo(iClientThread,\
-		a1,\
-		length,\
-		maxLength,\
-		aPtr,\
-		EFalse);
-	if (err != KErrNone)
-		{
-		return err;
-		}
-
-	if (length < 1 || length >= KMaxPath)
-		{
-		return KErrArgument;
-		}
-
-	if (maxLength < 1 || maxLength >= KMaxPath)
-		{
-		return KErrArgument;
-		}
-
-	// Allocate space to store the target process name in a kernelspace TPtr8
-	NKern::ThreadEnterCS();
-	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
-	NKern::ThreadLeaveCS();
-	if (buffer==NULL)
-		{
-		// Out of memory
-		return KErrNoMemory;
-		}
-	TPtr8 targetProcessName(buffer,length,length);
-
-	// Read the user-side data into targetProcessName
-	err = Kern::ThreadDesRead(iClientThread,a1,targetProcessName,0,KChunkShiftBy0);
-	if (err != KErrNone)
-		{
-		// Something bad happened so free the memory and return
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-
-		return err;
-		}
-
-	// Read the Event and Action from the user-side
-	TRM_DebugEventActionInfo info(0,0,0);
-
-	err = Kern::ThreadRawRead(iClientThread, a2, &info, sizeof(info));
-	if (err != KErrNone)
-		{
-		// Could not read event action data from the user-side
-
-		// Free memory used for targetProcessName
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-
-		return err;
-		}
-
-	// Find the target process
-	DTargetProcess* pProcess = TheDProcessTracker.FindProcess(targetProcessName);
-	if (pProcess == NULL)
-		{
-		// Could not find this process
-
-		// Free memory used for targetProcessName
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-
-		return KErrArgument;
-		}
-
-	TUint64 debugAgentId = info.iAgentId;
-
-	// Find the agent
-	DDebugAgent* debugAgent = pProcess->Agent(debugAgentId);
-	if (debugAgent == NULL)
-		{
-		// Bad agent means there is no tracking agent
-		LOG_MSG2("Cannot locate debug agent with pid 0x%0x16lx",info.iAgentId);
-
-		// Free memory used for targetProcessName
-		NKern::ThreadEnterCS();
-		Kern::Free(buffer);
-		NKern::ThreadLeaveCS();
-
-		return KErrGeneral;
-		}
-
-	// Set the event action
-	debugAgent->SetEventAction((TEventType)info.iEvent,(TKernelEventAction)info.iAction);
-
-	// Free memory used for targetProcessName
-	NKern::ThreadEnterCS();
-	Kern::Free(buffer);
-	NKern::ThreadLeaveCS();
-
-	return KErrNone;
-	}
-
-TInt DRM_DebugChannel::Step(const TUint32 aThreadId, const TUint32 aNumSteps)
-	{
-	LOG_MSG3("DRM_DebugChannel::Step(aThreadId = 0x%08x, aNumSteps = 0x%08x)\n",aThreadId,aNumSteps);
-
-	DThread* thread = DebugUtils::OpenThreadHandle(aThreadId);
-
-	if (thread == NULL)
-		{
-		// The thread terminated before we could open it.
-		LOG_MSG2("DRM_DebugChannel::Step - Could not open thread %u", aThreadId);
-
-		return KErrArgument;
-		}
-
-	// We simply repeat this for desired number of steps
-	TInt err = KErrNone;
-
-	// Need to step from the current location for 'n' steps
-	TUint32 startAddress;
-
-	// We always step from the current PC.
-	err = ReadKernelRegisterValue(thread, PC_REGISTER, startAddress);
-	if(err != KErrNone)
-		{
-		LOG_MSG2("DRM_DebugChannel::Step - Could not read the PC: %d", err);
-
-		// Close the handle
-		thread->Close(NULL);
-
-		return err;
-		}
-
-	err = DoStepRange(thread, startAddress, startAddress, ETrue, EFalse, aNumSteps, ETrue);
-
-	if (err != KErrNone)
-		{
-		// There was a problem, return straightaway
-		LOG_MSG("DRM_DebugChannel::Step - failed to step");
-		}
-
-	// Close the handle
-	thread->Close(NULL);
-
-	return err;
-	}
-
-TInt DRM_DebugChannel::KillProcess(const TUint32 aProcessId, const TInt aReason)
-	{
-	LOG_MSG3("DRM_DebugChannel::KillProcess(aProcessId = 0x%08x, aReason = 0x%08x)\n",aProcessId,aReason);
-
-	DProcess* process = DebugUtils::OpenProcessHandle(aProcessId);
-
-	if (process == NULL)
-		{
-		// The process terminated before we could open it to kill it ourselves.
-		LOG_MSG2("DRM_DebugChannel::KillProcess - Could not open process %u", aProcessId);
-
-		return KErrArgument;
-		}
-
-	TInt err = KErrNone;
-
-	DebugSupport::TerminateProcess(process,aReason);
-
-	// Close the handle
-	process->Close(NULL);
-
-	return err;
-	}
-
-/* Security critical - this checks whether the specified process is debuggable or not
- *
- * @param aProcessId - The process id of the process to check
- * @return KErrNone if debuggable, KErrPermissionDenied if not debuggable.
- */
-TInt DRM_DebugChannel::IsDebuggable(const TUint32 aProcessId)
-	{
-	/* In order to ensure that only processes which are debuggable
-	 * can be debugged, this function enables the security server
-	 * to read the DProcess.iDebugAttributes field and ensure
-	 * the process was created from a debuggable executable.
-	 */
-	LOG_MSG2("DRM_DebugChannel::IsDebuggable(aProcessId 0x%08x)\n",aProcessId);
-
-	TInt err = KErrPermissionDenied;
-
-	DProcess* process = DebugUtils::OpenProcessHandle(aProcessId);
-	if (process)
-		{
-		if (process->iDebugAttributes & TProcessCreateInfo::EDebugAllowed)
-			{
-			// Yes this process exists and is debuggable
-			err = KErrNone;
-			}
-		process->Close(NULL);
-		}
-
-	if (err == KErrNone)
-		{
-		LOG_MSG2("DRM_DebugChannel::IsDebuggable(aProcessId 0x%08x) - Yes it is debuggable\n",aProcessId);
-		}
-
-	return err;
-	}
--- a/kernel/eka/drivers/debug/smdebug/d_sm_codeseg.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_sm_codeseg.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -20,11 +20,7 @@
  * @prototype
 */
 
-#ifdef __LAUNCH_AS_EXTENSION__
-
-#include <rm_debug_api.h>
 #include <sm_debug_api.h>
-#include "d_rmd_breakpoints.h"
 
 using namespace Debug;
 
@@ -184,5 +180,3 @@
 	return KErrNone;
 	}
 
-#endif
-
--- a/kernel/eka/drivers/debug/smdebug/d_sm_process.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_sm_process.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -20,11 +20,7 @@
  * @prototype
  */
 
-#ifdef __LAUNCH_AS_EXTENSION__
-
-#include <rm_debug_api.h>
 #include <sm_debug_api.h>
-#include "d_rmd_breakpoints.h"
 
 using namespace Debug;
 
@@ -149,5 +145,4 @@
 		}
 	}
 
-#endif
 
--- a/kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -20,12 +20,8 @@
  * @prototype
  */
 
-#ifdef __LAUNCH_AS_EXTENSION__
-
-#include <rm_debug_api.h>
 #include <sm_debug_api.h>
 #include <e32rom.h>
-#include "d_rmd_breakpoints.h"
 
 using namespace Debug;
 
@@ -80,5 +76,4 @@
 	return KErrNone;
 	}
 
-#endif
 
--- a/kernel/eka/drivers/debug/smdebug/d_stopmode.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_stopmode.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -20,14 +20,8 @@
 @prototype
 */
 
-#include <rm_debug_api.h>
 #include <sm_debug_api.h>
 
-#include "d_rmd_breakpoints.h"
-
-
-#ifdef __LAUNCH_AS_EXTENSION__
-
 using namespace Debug;
 
 _LIT(KLitLocal,"Local-");
@@ -169,7 +163,4 @@
         }
 	}
 
-#endif
-
-
 // End of file d_stopmode.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/smdebug/sm_debug_kerneldriver.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,155 @@
+// Copyright (c) 2004-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:
+//
+// Description:
+// Device driver for kernel side stop mode debugging
+//
+
+#ifdef __WINS__
+#error - this driver cannot be built for emulation
+#endif
+
+#include <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <e32ldr.h>
+#include <u32std.h>
+#include <kernel/kernel.h>
+#include <kernel/kern_priv.h>
+#include <nk_trace.h>
+#include <arm.h>
+#include <kernel/cache.h>
+#include <platform.h>
+#include <nkern.h>
+#include <u32hal.h>
+#include <kernel/kdebug.h>
+
+
+#include "debug_logging.h"
+#include "d_debug_functionality.h"
+#include "debug_utils.h"
+#include "d_buffer_manager.h"
+
+
+using namespace Debug;
+
+
+DStopModeExtension* TheStopModeExtension = NULL;
+
+/**
+  This value is used as an initialiser for the size of the Stop-Mode Debug API's
+  default request buffer.
+  */
+const TInt KRequestBufferSize = 0x200;
+/**
+  This value is used as an initialiser for the size of the Stop-Mode Debug API's
+  default response buffer.
+  */
+const TInt KResponseBufferSize = 0x1000;
+
+DECLARE_STANDARD_EXTENSION()
+	{
+	__KTRACE_OPT(KBOOT,Kern::Printf("Starting Stop Mode Debugger V2"));
+
+	// get a reference to the DDebuggerInfo and to the DStopModeExtension
+	TSuperPage& superPage = Kern::SuperPage();
+
+	if(!superPage.iDebuggerInfo)
+		{
+		//kdebug has not been installed so create DDebuggerInfo using our stub constructor
+		superPage.iDebuggerInfo = new DDebuggerInfo();
+		}
+
+	if(!TheStopModeExtension)
+		{
+		TheStopModeExtension = new DStopModeExtension();
+		}
+
+	// create the request buffer and store a reference to it
+	TTag tag;
+	tag.iTagId = EBuffersRequest;
+	tag.iType = ETagTypePointer;
+	tag.iSize = KRequestBufferSize;
+	TInt err = TheDBufferManager.CreateBuffer(tag);
+	if(KErrNone != err)
+		{
+		return KErrNone;
+		}
+
+	// create the response buffer and store a reference to it
+	tag.iTagId = EBuffersResponse;
+	tag.iSize = KResponseBufferSize;
+	err = TheDBufferManager.CreateBuffer(tag);
+	if(KErrNone != err)
+		{
+		return KErrNone;
+		}
+	// create the debug functionality buffer and store a reference to it
+	TDebugFunctionality df;
+	TUint dfSize = df.GetStopModeFunctionalityBufSize();
+	tag.iTagId = EBuffersFunctionality;
+	tag.iSize = dfSize;
+	err = TheDBufferManager.CreateBuffer(tag);
+	if(KErrNone != err)
+		{
+		return KErrNone;
+		}
+
+	// fill the functionality buffer with the functionality data and store it in
+	// the super page
+	TPtr8 dfBlockPtr((TUint8*)tag.iValue, dfSize);
+	if(!df.GetStopModeFunctionality(dfBlockPtr))
+		{
+		return KErrNone;
+		}
+	TheStopModeExtension->iFunctionalityBlock = (DFunctionalityBlock*)tag.iValue;
+
+	DStopModeExtension::Install(TheStopModeExtension);
+
+	return KErrNone;
+	}
+
+/**
+ * This stub constructor is intended to be used in the case where the old deprecated
+ * stop mode api, kdebug, is not in place. It will initialise all values to NULL except
+ * the pointer to the new stop mode api extension. This allows the new stop mode solution
+ * to both co-exist and exist independantly of the existing one *
+ */
+DDebuggerInfo::DDebuggerInfo():
+	iObjectOffsetTable(NULL),
+	iObjectOffsetTableCount(NULL),
+	iThreadContextTable(NULL),
+	iStopModeExtension(new DStopModeExtension()),
+	iContainers(NULL),
+	iCodeSegLock(NULL),
+	iCodeSegGlobalList(NULL),
+	iScheduler(NULL),
+	iShadowPages(NULL),
+	iShadowPageCount(0),
+	iCurrentThread(NULL),
+	iEventMask(),
+	iEventHandlerBreakpoint(0),
+	iMemModelObjectOffsetTable(NULL),
+	iMemModelObjectOffsetTableCount(0)
+	{
+	}
+
+/**
+ * Installs the stop-mode debugger extension
+ * Make the stop-mode API visible to a JTAG debugger, by publishing its
+ * existence in the superpage
+*/
+void DStopModeExtension::Install(DStopModeExtension* aExt)
+	{
+	Kern::SuperPage().iDebuggerInfo->iStopModeExtension = aExt;
+	}
--- a/kernel/eka/drivers/locmedia/locmedia.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/locmedia/locmedia.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -2654,7 +2654,7 @@
 		}
 
 	__KTRACE_OPT(KFAIL,Kern::Printf("mdrq %d",m.Id()));
-	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::HandleMsg state %d req %d",iMediaId,iState,m.Id()));
+	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::HandleMsg(%08X) state %d req %d",iMediaId,&m,iState,m.Id()));
 
 	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_REQUEST, DPRIMARYMEDIABASE_HANDLEMSG2, "iMediaId=%d; iState=%d; req Id=%d", iMediaId, iState, m.Id());
 	
@@ -2754,7 +2754,7 @@
 */
 	{
 	OstTraceFunctionEntry1( DPRIMARYMEDIABASE_DOREQUEST_ENTRY, this );
-	__KTRACE_OPT2(KLOCDRV,KLOCDPAGING,Kern::Printf("DPrimaryMediaBase::DoRequest %d",m.Id()));
+	__KTRACE_OPT2(KLOCDRV,KLOCDPAGING,Kern::Printf("DPrimaryMediaBase(%d)::DoRequest(%08X) req %d", iMediaId, &m, m.Id()));
 	TLocDrv* pL=m.Drive();
 	DMedia* media=pL->iMedia;
 	TInt r=KErrNone;
@@ -3138,11 +3138,16 @@
 #ifdef __DEMAND_PAGING__
 			if (DataPagingMedia(this))
 				{
-				__KTRACE_OPT(KLOCDRV,Kern::Printf("DoPartitionInfoComplete(%d) Close Media Driver aborted for data paging media %08X", this));
+				__KTRACE_OPT(KLOCDRV,Kern::Printf("DoPartitionInfoComplete() Close Media Driver aborted for data paging media %08X", this));
 				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_DEMANDPAGING, DPRIMARYMEDIABASE_DOPARTITIONINFOCOMPLETE2, "Close Media Driver for data paging media 0x%08x", this);
 				}
 			else
 #endif
+			if (iBody->iMediaExtension)
+				{
+				__KTRACE_OPT(KLOCDRV,Kern::Printf("DoPartitionInfoComplete() Close Media Driver aborted for extension media %08X", this));
+				}
+			else
 				{
 				pM->iDriver->Close();
 				pM->iDriver=NULL;
@@ -3299,6 +3304,10 @@
 	{
 	OstTraceFunctionEntry1( DPRIMARYMEDIABASE_COMPLETEREQUEST_ENTRY, this );
 	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_REQUEST, DPRIMARYMEDIABASE_COMPLETEREQUEST1, "TLocDrvRequest Object=0x%x; aResult=%d", (TUint) &aMsg, aResult);
+
+
+	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::CompleteRequest(%08x) r %d",iMediaId,&aMsg, aResult));
+
 	aMsg.Complete(aResult,EFalse);
 	OstTraceFunctionExit1( DPRIMARYMEDIABASE_COMPLETEREQUEST_EXIT, this );
 	}
--- a/kernel/eka/drivers/medmmc/medmmc.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/medmmc/medmmc.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -2726,6 +2726,9 @@
 	iMedReq = aRequest;
 	SetCurrentConsumption(aCurrent);
 
+	// Reset the card pointer just in case the stack has changed it.
+	iSession->SetCard(iCard);
+
 	TInt r = InCritical();
 	if (r == KErrNone)
 		{
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -106,7 +106,7 @@
 	DeclareCardAsGone__12TSDCardArrayUi @ 105 NONAME R3UNUSED ; TSDCardArray::DeclareCardAsGone(unsigned int)
 	Dummy1__8DSDStack @ 106 NONAME R3UNUSED ; DSDStack::Dummy1(void)
 	Dummy2__8DSDStack @ 107 NONAME R3UNUSED ; DSDStack::Dummy2(void)
-	Dummy3__8DSDStack @ 108 NONAME R3UNUSED ; DSDStack::Dummy3(void)
+	GetInterface__8DSDStackQ29DMMCStack12TInterfaceIdRPQ29DMMCStack10MInterface @ 108  NONAME R3UNUSED ; DSDStack::GetInterface(DMMCStack::TInterfaceId, DMMCStack::MInterface *&)
 	CardType__8DSDStackii @ 109 NONAME R3UNUSED ; DSDStack::CardType(int, int)
 	InitStackAfterUnlockSM__8DSDStack @ 110 NONAME R3UNUSED ; DSDStack::InitStackAfterUnlockSM(void)
 	Init__8DSDStack @ 111 NONAME R3UNUSED ; DSDStack::Init(void)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/sdio/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/sdio/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -106,7 +106,7 @@
 	DeclareCardAsGone__12TSDCardArrayUi @ 105 NONAME R3UNUSED ; TSDCardArray::DeclareCardAsGone(unsigned int)
 	Dummy1__8DSDStack @ 106 NONAME R3UNUSED ; DSDStack::Dummy1(void)
 	Dummy2__8DSDStack @ 107 NONAME R3UNUSED ; DSDStack::Dummy2(void)
-	Dummy3__8DSDStack @ 108 NONAME R3UNUSED ; DSDStack::Dummy3(void)
+	GetInterface__8DSDStackQ29DMMCStack12TInterfaceIdRPQ29DMMCStack10MInterface @ 108  NONAME R3UNUSED ; DSDStack::GetInterface(DMMCStack::TInterfaceId, DMMCStack::MInterface *&)
 	CardType__8DSDStackii @ 109 NONAME R3UNUSED ; DSDStack::CardType(int, int)
 	InitStackAfterUnlockSM__8DSDStack @ 110 NONAME R3UNUSED ; DSDStack::InitStackAfterUnlockSM(void)
 	Init__8DSDStack @ 111 NONAME R3UNUSED ; DSDStack::Init(void)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -107,7 +107,7 @@
 	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
 	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
 	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
-	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
 	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
 	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
 	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/sdio/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/sdio/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -107,7 +107,7 @@
 	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
 	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
 	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
-	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
 	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
 	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
 	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -107,7 +107,7 @@
 	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
 	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
 	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
-	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
 	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
 	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
 	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/sdio/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/sdio/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -107,7 +107,7 @@
 	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
 	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
 	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
-	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
 	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
 	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
 	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -134,7 +134,7 @@
 	_ZN8DSDStack4InitEv @ 133 NONAME
 	_ZN8DSDStack6Dummy1Ev @ 134 NONAME
 	_ZN8DSDStack6Dummy2Ev @ 135 NONAME
-	_ZN8DSDStack6Dummy3Ev @ 136 NONAME
+	_ZN8DSDStack12GetInterfaceEN9DMMCStack12TInterfaceIdERPNS0_10MInterfaceE @ 136 NONAME
 	_ZN8DSDStack8CardTypeEii @ 137 NONAME
 	_ZNK8DSDStack12AllocSessionERK12TMMCCallBack @ 138 NONAME
 	_ZTI12TSDCardArray @ 139 NONAME ; #<TI>#
--- a/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/sdio/epbusmu.def	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/sdio/epbusmu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -134,7 +134,7 @@
 	_ZN8DSDStack4InitEv @ 133 NONAME
 	_ZN8DSDStack6Dummy1Ev @ 134 NONAME
 	_ZN8DSDStack6Dummy2Ev @ 135 NONAME
-	_ZN8DSDStack6Dummy3Ev @ 136 NONAME
+	_ZN8DSDStack12GetInterfaceEN9DMMCStack12TInterfaceIdERPNS0_10MInterfaceE @ 136 NONAME
 	_ZN8DSDStack8CardTypeEii @ 137 NONAME
 	_ZNK8DSDStack12AllocSessionERK12TMMCCallBack @ 138 NONAME
 	_ZTI12TSDCardArray @ 139 NONAME ; #<TI>#
--- a/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -424,6 +424,10 @@
 EXPORT_C TInt DSDStack::Init()
 	{
 	OstTraceFunctionEntry1( DSDSTACK_INIT_ENTRY, this );
+
+	if((iAddressCard = new DAddressCard(*this)) == NULL)
+        return KErrNoMemory;
+	
 	TInt ret = DMMCStack::Init();
 	OstTraceFunctionExitExt( DSDSTACK_INIT_EXIT, this, ret );
 	return ret;
@@ -1136,7 +1140,7 @@
 		    {
 			AddressCard(KBroadcastToAllCards);
 			__KTRACE_OPT(KPBUS1, Kern::Printf("<DSDStack::InitStackAfterUnlockSM()"));
-		    }
+ 		    }
 
 	SMF_END
 	
@@ -1654,6 +1658,31 @@
     }
 
 
+DAddressCard::DAddressCard(DSDStack& aStack) :iStack(aStack)
+	{
+	}
+
+void DAddressCard::AddressCard(TInt aCardNumber)
+	{
+	iStack.AddressCard(aCardNumber);
+	}
+
+/**
+Gets an interface from a derived class
+
+N.B the derived class should call this function if it does not support the specified interface
+*/
+EXPORT_C void DSDStack::GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr)
+	{
+	if (aInterfaceId == KInterfaceAddressCard)
+		{
+		aInterfacePtr = (DMMCStack::MInterface*) iAddressCard;
+		}
+	else
+		{
+		DMMCStack::GetInterface(aInterfaceId, aInterfacePtr);
+		}
+	}
+
 EXPORT_C void DSDStack::Dummy1() {}
 EXPORT_C void DSDStack::Dummy2() {}
-EXPORT_C void DSDStack::Dummy3() {}
--- a/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdio/sdiostack.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdio/sdiostack.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -2823,3 +2823,6 @@
 EXPORT_C void DSDIOStack::Dummy2() {}
 EXPORT_C void DSDIOStack::Dummy3() {}
 EXPORT_C void DSDIOStack::Dummy4() {}
+#if defined(__WINS__) || defined (__X86__)
+EXPORT_C void Dummy1() {}
+#endif
--- a/kernel/eka/drivers/pbus/mmc/session.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/session.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -464,6 +464,10 @@
 		return KErrNotReady;
 	    }
 
+	// Save the callers card pointer as some state machines 
+	// (e.g. ECIMLockUnlock, ECIMInitStackAfterUnlock) can change it
+	SaveCard();
+
 	SetupCIMControl(iSessionID);
 
 	iStackP->Add(this);
--- a/kernel/eka/drivers/pbus/mmc/stack.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/stack.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1804,9 +1804,11 @@
 	if( sessP->iCardP != NULL && sessP->iCardP->iUsingSessionP == sessP )
 		sessP->iCardP->iUsingSessionP = NULL;
 
-	// iAutoUnlockSession may attach to more than once card, so need to iterate 
+	// Some sessions may attach to more than once card, so need to iterate 
 	// through all cards and clear their session pointers if they match sessP
-	if (sessP == &iAutoUnlockSession)
+	if (sessP == &iAutoUnlockSession || 
+		sessP->iSessionID == ECIMLockUnlock || 
+		sessP->iSessionID == ECIMInitStackAfterUnlock)
 		{
 		for (TUint i = 0; i < iMaxCardsInStack; i++)
 			{
@@ -1942,6 +1944,11 @@
 
 			if(doCallback)
 				{
+				// Restore the callers card pointer as some state machines 
+				// (e.g. ECIMLockUnlock, ECIMInitStackAfterUnlock) can change it
+				sessP->RestoreCard();
+
+
 				// call media driver completion routine or StackSessionCBST().
 				sessP->iCallBack.CallBack();
 				}
@@ -6063,6 +6070,8 @@
 			return KMMCErrNotSupported;
 		    }
 
+		DoAddressCard(s.iCardP->iIndex-1);
+
 		s.iState |= KMMCSessStateInProgress;
 		m.SetTraps( KMMCErrInitContext );
 
@@ -6474,30 +6483,31 @@
 		// Upon completion, test the next card before performing further initialisation.
 		//
 		
-		SMF_STATE(EStSendStatus)
+		DoAddressCard(iAutoUnlockIndex); 	// Address the card
+		TMMCard* cd = iCardArray->CardP(iAutoUnlockIndex);
+		s.SetCard(cd);
+
+	SMF_STATE(EStSendStatus)
 		        
 		s.FillCommandDesc(ECmdSendStatus, 0);
 		                        
 		SMF_INVOKES(ExecCommandSMST,EStGetStatus)
 		                        
-		SMF_STATE(EStGetStatus)
+	SMF_STATE(EStGetStatus)
 		                        
 		const TMMCStatus st = s.LastStatus();
 		if((st & KMMCStatCardIsLocked) == 0)
 			{
-		    SMF_RETURN(err)
+			SMF_GOTOS(EStNextIndex);
 		    }
 		                        
-		SMF_STATE(EStUnlock)
+	SMF_STATE(EStUnlock)
 		                        
 		const TMapping *mp = NULL;
 		mp = iSocket->iPasswordStore->FindMappingInStore(iCardArray->CardP(iAutoUnlockIndex)->CID());
 
-		TMMCard &cd = *(iCardArray->CardP(iAutoUnlockIndex++));
-		OstTrace1( TRACE_INTERNALS, DMMCSTACK_CIMAUTOUNLOCKSM4, "Attempting to unlock card %d", cd.Number() );
+		OstTrace1( TRACE_INTERNALS, DMMCSTACK_CIMAUTOUNLOCKSM4, "Attempting to unlock card %d", iCardArray->CardP(iAutoUnlockIndex)->Number() );
 		
-		s.SetCard(&cd);
-
 		const TInt kPWD_LEN = mp->iPWD.Length();
 		iPSLBuf[0] = 0;				// LOCK_UNLOCK = 0; unlock
 		iPSLBuf[1] = static_cast<TUint8>(kPWD_LEN);
@@ -6774,6 +6784,21 @@
 	return busWidth;
 	}
 
+void DMMCStack::DoAddressCard(TInt aCardNumber)
+	{
+	MAddressCard* addressCardInterface = NULL;
+	GetInterface(KInterfaceAddressCard, (MInterface*&) addressCardInterface);
+	if (addressCardInterface)
+		addressCardInterface->AddressCard(aCardNumber);
+	else
+		{
+		// if the interface isn't supported on a multiplexed bus, then panic if the card number > 0 - 
+		// one cause of this panic is if the PSL 's implementation of GetInterface() does not call the 
+		// base class's implementation of GetInterface()
+		__ASSERT_ALWAYS((!iMultiplexedBus) || (aCardNumber <= 0), DMMCSocket::Panic(DMMCSocket::EMMCAddressCardNotSupported));
+		}
+	}
+
 /**
  * class DMMCSocket 
  */
--- a/kernel/eka/drivers/resmanus/d_resmanus.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/resmanus/d_resmanus.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -482,8 +482,7 @@
 			{
 			__ASSERT_ALWAYS(m.Ptr2() != NULL, RESMANUS_FAULT());
 #ifdef _DUMP_TRACKERS
-			if((r=DumpTracker(iSetStateTracker))!=KErrNone)
-				break;
+			DumpTracker(iSetStateTracker);
 #endif
 			r = GetAndInitTrackingBuffer(iSetStateTracker, trackBuf, (TUint)m.Ptr1(), pS);
 			if( r != KErrNone)
@@ -500,8 +499,7 @@
 			__ASSERT_ALWAYS(m.Ptr2() != NULL, RESMANUS_FAULT());
 			umemget32(&(parms[0]), m.Ptr2(), 3*sizeof(TInt));
 #ifdef _DUMP_TRACKERS
-			if((r=DumpTracker(iGetStateTracker))!=KErrNone)
-				break;
+			DumpTracker(iGetStateTracker);
 #endif
 			r = GetStateBuffer(iGetStateTracker, trackBuf, (TUint)m.Ptr1(), (TInt*)parms[1], (TInt*)parms[2], callBack, pS);
 			if(r != KErrNone)
@@ -1269,10 +1267,8 @@
 				if((r==KErrNone) && (stateRes[2]>0))
 					r=InitTrackingControl(iListenableTracker,ENotify,stateRes[2]);
 #ifdef _DUMP_TRACKERS
-			if((r=DumpTracker(iGetStateTracker))!=KErrNone)
-				break;
-			if((r=DumpTracker(iSetStateTracker))!=KErrNone)
-				break;
+				DumpTracker(iGetStateTracker);
+				DumpTracker(iSetStateTracker);
 #endif
 				}
 			break;
@@ -2014,14 +2010,16 @@
 	return r;
 	}
 
-
 #ifdef _DUMP_TRACKERS
-TInt DChannelResManUs::DumpTracker(TTrackingControl* aTracker)
+void DChannelResManUs::DumpTracker(TTrackingControl* aTracker)
 	{
 	Kern::Printf("\nDChannelResManUs::DumpTracker");
 	Kern::Printf("Tracker at 0x%x\n",aTracker);
-	if(NULL==aTracker)
-		return KErrGeneral;
+	if(!aTracker)
+		{
+		Kern::Printf("Nothing to dump..");
+		return;
+		}
 	Kern::Printf("iType=%d",aTracker->iType);
 	switch(aTracker->iType)
 		{
@@ -2043,14 +2041,14 @@
 		buf=aTracker->iFreeQue->First();
 		while(buf!=aTracker->iFreeQue->Last())
 			{
-			Kern::Printf("iFreeQue buffer at 0x%x\n",buf);
+			Kern::Printf("iFreeQue first buffer at 0x%x\n",buf);
 			TAny* intermediatePtr = (TAny*)buf;
 			if((aTracker->iType == EGetState)||(aTracker->iType == ESetState))
 				{
-				TTrackStateBuf* tempBuf =(TTrackStateBuf*)intermediatePtr;
-				Kern::Printf("buffer control block at 0x%x\n",tempBuf->iCtrlBlock);
+				TTrackSetStateBuf* tempBuf =(TTrackSetStateBuf*)intermediatePtr;
+				Kern::Printf("buffer control block at 0x%x\n",(TInt)&tempBuf->iCtrlBlock);
 				}
-			buf= buf->iNext;
+			buf = buf->iNext;
 			};
 		}
 	Kern::Printf("iBusyQue at 0x%x\n",aTracker->iBusyQue);
@@ -2063,14 +2061,12 @@
 			TAny* intermediatePtr = (TAny*)buf;
 			if((aTracker->iType == EGetState)||(aTracker->iType == ESetState))
 				{
-				TTrackStateBuf* tempBuf =(TTrackStateBuf*)intermediatePtr;
-				Kern::Printf("buffer control block at 0x%x\n",tempBuf->iCtrlBlock);
+				TTrackSetStateBuf* tempBuf =(TTrackSetStateBuf*)intermediatePtr;
+				Kern::Printf("buffer control block at 0x%x\n", (TInt)&tempBuf->iCtrlBlock);
 				}
 			buf= buf->iNext;
 			};
 		}
-
-	return KErrNone;
 	}
 #endif
 
@@ -2165,13 +2161,11 @@
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("DChannelResManUs::RemoveTrackingControl()"));
 
 	// Free the resource-tracking links and their respective queues
-	TAny* buf;
 	if(aTracker->iFreeQue!=NULL)
 		{
 		while(!aTracker->iFreeQue->IsEmpty())
 			{
-			buf = (TAny*)(aTracker->iFreeQue->GetFirst()); // Dequeues the element
-			delete buf;
+			delete aTracker->iFreeQue->GetFirst(); // Dequeues the element;
 			}
 		delete aTracker->iFreeQue;
 		}
@@ -2180,8 +2174,7 @@
 		{
 		while(!aTracker->iBusyQue->IsEmpty())
 			{
-			buf = (TAny*)(aTracker->iBusyQue->GetFirst()); // Dequeues the element
-			delete buf;
+			delete aTracker->iBusyQue->GetFirst(); // Dequeues the element;
 			}
 		delete aTracker->iBusyQue;
 		}
--- a/kernel/eka/drivers/resourceman/rescontrol_export.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/resourceman/rescontrol_export.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\drivers\resourceman\rescontrol_export.cpp
-// 
+//
 //
 
 #include <drivers/resourcecontrol.h>
@@ -55,7 +55,7 @@
 	if(!pRC)
 		return KErrNotFound;
 	pRC->Lock();
-    CHECK_CONTEXT(thread)
+    CHECK_CONTEXT(thread);
 	//Accept the postboot level only if issued before controller is fully initialised.
 	if(pRC->iInitialised == EResConStartupCompleted)
 		{
@@ -66,15 +66,15 @@
 #ifndef PRM_ENABLE_EXTENDED_VERSION
     // coverity[deref_ptr]
     // aResId is checked to be more than the array entries before dereferencing pRC->iStaticResourceArray
-	if((!aResId) || (aResId > pRC->iStaticResourceArrayEntries) || (!pRC->iStaticResourceArray[aResId-1]))
+	if((!aResId) || (aResId > (TUint)pRC->iStaticResourceArray.Count()) || (!pRC->iStaticResourceArray[aResId-1]))
 		{
 		pRC->UnLock();
 		LOCK_AND_CRITICAL_SECTION_COUNT_CHECK(thread)
 		return KErrNotFound;
 		}
 #else
-	if(!aResId || ((aResId & KIdMaskResourceWithDependencies) && ((aResId & ID_INDEX_BIT_MASK) > pRC->iStaticResDependencyCount)) 
-				|| (!(aResId & KIdMaskResourceWithDependencies) && ((aResId > pRC->iStaticResourceArrayEntries)
+	if(!aResId || ((aResId & KIdMaskResourceWithDependencies) && ((aResId & ID_INDEX_BIT_MASK) > (TUint)pRC->iStaticResDependencyArray.Count())) 
+				|| (!(aResId & KIdMaskResourceWithDependencies) && ((aResId > (TUint)pRC->iStaticResourceArray.Count())
 				|| (!pRC->iStaticResourceArray[aResId-1]))))
 		{
 		pRC->UnLock();
@@ -90,7 +90,7 @@
 		}
 	else
 #endif
-    if(pRC->iStaticResourceArray) 
+    if((TUint)pRC->iStaticResourceArray.Count() > aResId - 1)
 		{
 		DStaticPowerResource* pR=pRC->iStaticResourceArray[--aResId];
 		pR->iPostBootLevel=aLevel;
@@ -107,7 +107,9 @@
 	Kernel extensions or variants can call this API to register the static resources before resource controller
 	is fully initialised.
 	@Param aClientId             ID of the client that is requesting resource registration
-	@Param aStaticResourceArray  Static resources to register with RC. 
+	@Param aStaticResourceArray  Static resources to register with RC.
+	                             Note, that in the special case, when aResCount equals to one, this parameter is treated as a pointer to the
+	                             DStaticPowerResource (DStaticPowerResource*). Otherwise - is the pointer to array of such pointers (DStaticPowerResource*).
 	@Param aResCount             Number of static resources to register with RC. This equals the size of the passed array.
 	@return KErrNone, if operation is success
 	        KErrAccessDenied if clientId could not be found in the current list of registered clients or if this
@@ -127,7 +129,7 @@
 
 	if(!aStaticResourceArray || (aResCount == 0))
 		return KErrArgument;
-    CHECK_CONTEXT(thread)
+	CHECK_CONTEXT(thread);
 	//Accept the registration of static resource only if issued before controller is fully initialised.
 	if(pRC->iInitialised == EResConStartupCompleted)
 		{
@@ -139,10 +141,10 @@
 		return KErrNotSupported;
 		}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
+	// if aResCount equals to 1 aStaticResourceArray contains not an array, but simply a pointer to the resource.
 	if(aResCount == 1)
 		{
-		if((((DStaticPowerResource*)aStaticResourceArray)->iResourceId & KIdMaskResourceWithDependencies) ||
-										(((DStaticPowerResource*)aStaticResourceArray)->iResourceId & KIdMaskDynamic))
+		if(((DStaticPowerResource*)aStaticResourceArray)->iResourceId & (KIdMaskResourceWithDependencies | KIdMaskDynamic))
 			{
 			return KErrNotSupported;
 			}
@@ -151,56 +153,60 @@
 		{
 		for(TUint rescount = 0; rescount < aResCount; rescount++)
 			{
-			if(aStaticResourceArray[rescount] && ((aStaticResourceArray[rescount]->iResourceId & KIdMaskResourceWithDependencies) || 
-				                          (aStaticResourceArray[rescount]->iResourceId & KIdMaskDynamic)))
+			if(aStaticResourceArray[rescount] &&
+			  (aStaticResourceArray[rescount]->iResourceId & (KIdMaskResourceWithDependencies | KIdMaskDynamic)))
 				{
 				return KErrNotSupported;
 				}
 			}
 		}
 #endif
-	SPowerResourceClient* pC = pRC->iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];								
-	if(!pC)																										
-		{																										
-		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));											
-		return KErrAccessDenied;																		
-		}																										
-	if(pC->iClientId != aClientId)				
-		{																										
-		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID instance count does not match"));						
-		return KErrAccessDenied;																		
-		}																										
-	if(pC->iClientId & CLIENT_THREAD_RELATIVE_BIT_MASK)															
-		{																										
-		if(pC->iThreadId != thread.iId)																				
-			{																									
-			__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client not called from thread context(Thread Relative)"));	
-			return KErrAccessDenied;																	
-			}																									
+	SPowerResourceClient* pC = pRC->iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];
+	if(!pC)
+		{
+		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));
+		return KErrAccessDenied;
+		}
+	if(pC->iClientId != aClientId)
+		{
+		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID instance count does not match"));
+		return KErrAccessDenied;
 		}
- 
-    TInt r = Kern::SafeReAlloc((TAny*&)pRC->iStaticResourceArray, pRC->iStaticResourceArrayEntries*sizeof(DStaticPowerResource*), 
-		                                         (pRC->iStaticResourceArrayEntries + aResCount)*sizeof(DStaticPowerResource*));
-    if(r != KErrNone)
+	if(pC->iClientId & CLIENT_THREAD_RELATIVE_BIT_MASK)
 		{
-        return r;
+		if(pC->iThreadId != thread.iId)
+			{
+			__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client not called from thread context(Thread Relative)"));
+			return KErrAccessDenied;
+			}
 		}
+
+    TInt r = KErrNone;
 	if(aResCount == 1)
 		{
-		pRC->iStaticResourceArray[pRC->iStaticResourceArrayEntries++] = (DStaticPowerResource*)aStaticResourceArray;
-		if((DStaticPowerResource*)aStaticResourceArray)
+		// if aResCount equals to one, threat the pointer as a pointer to resource
+		r = pRC->iStaticResourceArray.Append((DStaticPowerResource*)aStaticResourceArray);
+		// increment count of valid resources
+		if(r == KErrNone && aStaticResourceArray)
 			pRC->iStaticResourceCount++;
 		}
 	else
 		{
 		for(TUint count = 0; count < aResCount; count++)
 			{
-			pRC->iStaticResourceArray[pRC->iStaticResourceArrayEntries++] = aStaticResourceArray[count];
+			r = pRC->iStaticResourceArray.Append(aStaticResourceArray[count]);
+			if(r != KErrNone)
+				{
+				__KTRACE_OPT(KRESMANAGER, Kern::Printf("Could not add new static resources, r = %d", r));
+				break;
+				}
+			// increment count of valid resources
 			if(aStaticResourceArray[count])
 				pRC->iStaticResourceCount++;
 			}
 		}
-    return KErrNone;
+
+	return r;
 	}
 
 /**
@@ -229,6 +235,10 @@
 	This function initialises the controller. 
 	@return KErrNone, if operation is success or one of the system wide errors.
 	*/
+RPointerArray <DStaticPowerResource> *StaticResourceArrayPtr;
+#ifdef PRM_ENABLE_EXTENDED_VERSION
+RPointerArray <DStaticPowerResourceD> *StaticResourceDependencyArrayPtr;
+#endif
 EXPORT_C TInt DPowerResourceController::InitController()
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::InitController()"));
@@ -252,13 +262,31 @@
 	if(!pRC->iMsgQDependency)
 		return KErrNoMemory;
 #endif
-	// Call PSL to create all static resources and populate the iStaticResourceArray with pointers to resources and
-	// update static resource count
-    r=pRC->DoRegisterStaticResources(pRC->iStaticResourceArray, pRC->iStaticResourceArrayEntries);
-    if(r!=KErrNone)
+	// This method can be called in two situations - before the constructor of DPowerResourceController was called 
+	// for the second time (placement new in the extension psl entry macro) e.g. as a result of the call to InitResources() 
+	// from the variant::Init3() method) or after that.
+
+	// In order not to make any assumption on number of constructor invocations, a copy (binary) of the iStaticResourceArray object 
+	// is created below, so that it could be used to later restore the original iStaticResoureceArray object if the constructor
+	// was called after this method. The reason for that is, that in this destructor calls the default RPointerArrayBase()
+	// which resets the array, i.e. it looses the information, but allocated area and pointers still exist in the memory. 
+	// It is then valid to restore the object directly (which will copy all members, including iSize and iEntries pointers). 
+	// This temporary object will be deleted in DPowerResourceController::InitResources() at the last stage of initialization.
+	// (see also comments in DPowerResourceController::DPowerResourceController()) 
+
+	StaticResourceArrayPtr = new RPointerArray <DStaticPowerResource>;
+	if(!StaticResourceArrayPtr)
+		return KErrNoMemory;
+
+	r = pRC->DoRegisterStaticResources(pRC->iStaticResourceArray);
+	if(r != KErrNone)
 		return r;
-	//Get the actual number of static resource registered count
-	for(TInt resCnt = 0; resCnt < pRC->iStaticResourceArrayEntries; resCnt++)
+
+	// make a copy (see above comment)
+	*StaticResourceArrayPtr = pRC->iStaticResourceArray; 
+
+	// Get the actual number of static resource registered count
+	for(TInt resCnt = 0; resCnt < pRC->iStaticResourceArray.Count(); resCnt++)
 		{
 		if(pRC->iStaticResourceArray[resCnt])
 			pRC->iStaticResourceCount++;
@@ -269,7 +297,7 @@
 	DStaticPowerResource* pR = NULL;
 	TPowerResourceInfoBuf01 resInfo;
 	TPowerResourceInfoV01 *pResInfo;
-	for(TInt resCount = 0; resCount < pRC->iStaticResourceArrayEntries; resCount++)
+	for(TInt resCount = 0; resCount < pRC->iStaticResourceArray.Count(); resCount++)
 		{
 		pR = pRC->iStaticResourceArray[resCount];
 		if(!pR)
@@ -281,16 +309,25 @@
 #endif
 
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	//Call PSL to register static resources with dependency if any exists
-	r = pRC->DoRegisterStaticResourcesDependency(pRC->iStaticResDependencyArray, pRC->iStaticResDependencyCount);
+	StaticResourceDependencyArrayPtr = new RPointerArray <DStaticPowerResourceD>;
+	if(!StaticResourceDependencyArrayPtr)
+		return KErrNoMemory;
+
+	// Call PSL to register static resources with dependency if any exists
+	r = pRC->DoRegisterStaticResourcesDependency(pRC->iStaticResDependencyArray);
+
 	if(r != KErrNone)
 		return r;
-	if(pRC->iStaticResDependencyCount)
+
+	// make a copy (see above comments for StaticResourceArrayPtr)
+	*StaticResourceDependencyArrayPtr = pRC->iStaticResDependencyArray;
+
+	if(pRC->iStaticResDependencyArray.Count())
 		{
 		DStaticPowerResourceD* pRD = NULL;
 		TUint count;
 		//Assign resource index in resource id
-		for(count = 0; count < pRC->iStaticResDependencyCount; count++)
+		for(count = 0; count < (TUint)pRC->iStaticResDependencyArray.Count(); count++)
 			{
 			pRD = pRC->iStaticResDependencyArray[count];
 			if(!pRD)
@@ -298,7 +335,7 @@
 			pRD->iResourceId |= ((count + 1) & ID_INDEX_BIT_MASK);
 			}
 		//Check for dependency closed loops
-		for(count = 0; count < pRC->iStaticResDependencyCount; count++)
+		for(count = 0; count < (TUint)pRC->iStaticResDependencyArray.Count(); count++)
 			{
 			pRD = pRC->iStaticResDependencyArray[count];
 			if(!(pRD->iResourceId & KIdMaskStaticWithDependencies))
@@ -309,7 +346,7 @@
 			pRC->CheckForDependencyLoop(pRD, pRD->iResourceId, pRD->iResourceId);
 			}
 #ifdef PRM_INSTRUMENTATION_MACRO
-		for(count = 0; count < pRC->iStaticResDependencyCount; count++)
+		for(count = 0; count < (TUint)pRC->iStaticResDependencyArray.Count(); count++)
 			{
 			pR = pRC->iStaticResDependencyArray[count];
 			pR->GetInfo((TDes8*)resInfo.Ptr());
--- a/kernel/eka/drivers/resourceman/resourcecontrol.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/resourceman/resourcecontrol.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\drivers\resourceman\resourcecontrol.cpp
-// 
+//
 //
 
 #include <drivers/resourcecontrol.h>
@@ -313,19 +313,44 @@
     return PowerResourceController->GetInterface(aClientId, aFunction, aParam1, aParam2, aParam3);
     }
 
-/** Resouce controller panic */
+/** Resource controller panic */
 void DPowerResourceController::Panic(TUint8 aPanic)
 	{
 	Kern::Fault("Power Resource Controller", aPanic);
 	}
 
 /** Constructor for power controller. Creates message queue and generates ID for power controller to use. */
+extern RPointerArray <DStaticPowerResource> *StaticResourceArrayPtr;
+#ifdef PRM_ENABLE_EXTENDED_VERSION
+extern RPointerArray <DStaticPowerResourceD> *StaticResourceDependencyArrayPtr;
+#endif
 DPowerResourceController::DPowerResourceController()
 	{
-    __KTRACE_OPT(KRESMANAGER, Kern::Printf("DPowerResourceController::DPowerResouceController()"));
-	//Constructor is expected to invoke multiple times (during creation, variant init 0 and extension init 1)
-	if(PowerResourceController) 
+	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DPowerResourceController::DPowerResouceController()"));
+	// Constructor is expected to invoke multiple times, i.e.: 
+	// during creation: variant init 0(KModuleEntryReasonVariantInit0) and later extension init 1 (KModuleEntryReasonExtensionInit1)
+	if(PowerResourceController)
+		{
+		// If InitController() was called in the Init3() static resource arrays were populated already and invocation of this 
+		// constructor has zeroed the dynamic pointer arrays (calling their default constructors). In such case we need to 
+		// restore these arrays from their temporary shadow copies (i.e. copies of RPointerArray objects, not their content)
+		// (See comments in RegisterStaticResources())
+		if(StaticResourceArrayPtr)
+			{
+			// by making a (binary) copy of RPointerArray object (compiler's auto-generated code)
+			// we are taking the ownership of content (pointers stored/owned by that array) of this temporary array
+			iStaticResourceArray = *StaticResourceArrayPtr;
+			}
+#ifdef PRM_ENABLE_EXTENDED_VERSION
+		// the same applies to static resources with dependencies for extended version.
+		// Temporary object are de-allocated in InitResources()
+		if(StaticResourceDependencyArrayPtr)
+			{
+			iStaticResDependencyArray = *StaticResourceDependencyArrayPtr;
+			}
+#endif
 		return;
+		}
     PowerResourceController = this;
 	iClientList.Initialise(0);
 	iUserSideClientList.Initialise(0);
@@ -336,58 +361,6 @@
 #endif
 	}
 
-/** Destructor for power controller. Frees the memory allocated in kernel heap. */
-DPowerResourceController::~DPowerResourceController()
-	{
-	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DPowerResourceController::~DPowerResourceController()"));
-#ifdef RESOURCE_MANAGER_SIMULATED_PSL
-	iCleanList.ResetAndDestroy();
-#endif
-	iClientList.Delete();
-	iUserSideClientList.Delete();
-
-
-		
-#ifdef PRM_ENABLE_EXTENDED_VERSION
-	iDynamicResourceList.Delete();
-	iDynamicResDependencyList.Delete();
-#endif
-
-	SPowerResourceClientLevel *pCL = iClientLevelPool;
-	while(iClientLevelPool) //Find the starting position of array to delete
-		{
-		if(iClientLevelPool < pCL)
-			pCL = iClientLevelPool;
-		iClientLevelPool = iClientLevelPool->iNextInList;
-		}
-	//delete pCL;
-	delete []pCL;
-	SPowerRequest *pReq = iRequestPool;
-	while(iRequestPool) //Find the starting position of array to delete
-		{
-		if(iRequestPool < pReq)
-			pReq = iRequestPool;
-		iRequestPool = iRequestPool->iNext;
-		}
-	//delete pR
-	delete []pReq;
-#ifdef PRM_ENABLE_EXTENDED_VERSION
-	pCL = iResourceLevelPool;
-	while(iResourceLevelPool)
-		{
-		if(iResourceLevelPool < pCL)
-			pCL = iResourceLevelPool;
-		iResourceLevelPool = iResourceLevelPool->iNextInList;
-		}
-	//delete resource pool
-	delete []pCL;
-	//delete Message Queue dependency
-	delete iMsgQDependency;
-#endif
-	//delete Message Queue
-	delete iMsgQ;
-	}
-
 /** Send notificatins to clients registered for it for the specified resource. */
 void DPowerResourceController::CompleteNotifications(TInt aClientId, DStaticPowerResource* aResource, TInt aState, 
 													      TInt aReturnCode, TInt aLevelOwnerId, TBool aLock)
@@ -712,7 +685,7 @@
 		PRM_CLIENT_CHANGE_STATE_END_TRACE
 		}
 #endif
-	//Check whether callback is cancelled and if not queue the DFC.
+	//Check whether callback is canceled and if not queue the DFC.
     TPowerResourceCb* pCb = aReq->ResourceCb();
     if(pCb)
 		{
@@ -758,10 +731,18 @@
 		pC->iClientId = aReq->ClientId();
 		DDynamicPowerResourceD* pDRes;
 		if(aReq->ClientId() & KIdMaskDynamic)
-			pDRes = pRC->iDynamicResDependencyList[(TUint16)(aReq->ClientId() & ID_INDEX_BIT_MASK)];	
+			pDRes = pRC->iDynamicResDependencyList[(aReq->ClientId() & ID_INDEX_BIT_MASK)];	
 		else
 			pDRes = (DDynamicPowerResourceD*)pRC->iStaticResDependencyArray[(aReq->ClientId() & ID_INDEX_BIT_MASK) - 1];
-		pC->iName = pDRes->iName;
+		
+		if (pDRes != NULL)
+		    {
+            pC->iName = pDRes->iName;
+		    }
+		else
+		    {
+            pC->iName = &KNullDesC;
+		    }
 		}
 	else if((aReq->ClientId() == -1) || (aReq->ClientId() == KDynamicResourceDeRegistering))
 		{
@@ -787,7 +768,7 @@
 		PRM_CLIENT_CHANGE_STATE_END_TRACE
 		}
 #endif
-	//Check whether callback is cancelled and if not queue the DFC.
+	//Check whether callback is canceled and if not queue the DFC.
     TPowerResourceCb* pCb = aReq->ResourceCb();
     if(pCb)
 		{
@@ -856,13 +837,13 @@
 TInt DPowerResourceController::InitResources()
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::InitResources()"));
-	TUint16 count;
+	TInt count;
 	//Create a Kernel client object for Power Controller
 	Lock();
 	SPowerResourceClient * pC = NULL;
 	// By now client pool should be created
 	LIST_POP(iClientPool, pC, iNextInList);
-	TUint16 growBy = iClientList.GrowBy();
+	TInt growBy = iClientList.GrowBy();
 	if(!pC)
 		{
 		UnLock();
@@ -900,7 +881,15 @@
 	iPowerControllerId = pC->iClientId;
     iClientCount++;
     if(TPowerController::PowerController())
-       TPowerController::PowerController()->RegisterResourceController(this, iPowerControllerId);
+		{
+		if(TPowerController::PowerController()->RegisterResourceController(this, iPowerControllerId))
+			{
+#ifndef RESOURCE_MANAGER_SIMULATED_PSL
+			Panic(EControllerAlreadyExists);	//	Panic with this error for any error returned by RegisterResourceController
+#endif
+			}
+		}
+
 	iInitialised =EResConStartupCompleted;
 	UnLock();
 	//Check the resource for postboot level and send notifications to clients registered for it.
@@ -908,7 +897,7 @@
 	TInt r;
 	TPowerRequest req = TPowerRequest::Get();
 	//For Static resource with no dependencies
-    for(count = 0; count< iStaticResourceArrayEntries; count++)
+    for(count = 0; count < iStaticResourceArray.Count(); count++)
 		{
 		pR = iStaticResourceArray[count];
 		if(pR && (pR->iFlags & SET_VALID_POST_BOOT_LEVEL))
@@ -931,7 +920,7 @@
 		}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	//For Static resource with dependencies 
-	for(count = 0; count < iStaticResDependencyCount; count++)
+	for(count = 0; count < iStaticResDependencyArray.Count(); count++)
 		{
 		pR = iStaticResDependencyArray[count];
 		if(pR->iFlags & SET_VALID_POST_BOOT_LEVEL)
@@ -948,6 +937,21 @@
 			}
 		}
 #endif
+	
+	// delete the temporary copy of static resource array used during initialization.
+	if(StaticResourceArrayPtr)
+		{
+		delete StaticResourceArrayPtr;
+		StaticResourceArrayPtr = NULL;
+		}
+#ifdef PRM_ENABLE_EXTENDED_VERSION
+	// the same applies to dependency resources array for extended version.
+	if(StaticResourceDependencyArrayPtr)
+		{
+		delete StaticResourceDependencyArrayPtr;
+		StaticResourceDependencyArrayPtr = NULL;
+		}
+#endif
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("<DPowerResourceController::InitResources()"));
     return KErrNone;
 	}
@@ -1261,9 +1265,9 @@
 		}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	SPowerResourceClientLevel* pRL = NULL;
-	if(iStaticResDependencyCount)
+	if(iStaticResDependencyArray.Count())
 		{
-		pRL = new SPowerResourceClientLevel[iStaticResDependencyCount];
+		pRL = new SPowerResourceClientLevel[iStaticResDependencyArray.Count()];
 		if(!pRL)
 			{
 			__KTRACE_OPT(KRESMANAGER, Kern::Printf("Resource level Pool Allocation Failed"));
@@ -1279,12 +1283,12 @@
 	iCleanList.Append(pC);
 #endif
 	Lock();
-	TUint16 c;
-	for(c = 0; c < iStaticResDependencyCount; c++)
+	TInt c;
+	for(c = 0; c < iStaticResDependencyArray.Count(); c++)
 		{
 		LIST_PUSH(iResourceLevelPool, &pRL[c], iNextInList);
 		}
-	iResourceLevelPoolCount = iStaticResDependencyCount;
+	iResourceLevelPoolCount = (TUint16)iStaticResDependencyArray.Count();
 #else
 #ifdef RESOURCE_MANAGER_SIMULATED_PSL
     iCleanList.Append(pC);
@@ -1293,7 +1297,7 @@
     TUint16 c;
 #endif
     // Create Client pool list
-    for(c = 0; c< (aKClients + aUClients); c++)
+    for(c = 0; c < TUint16(aKClients + aUClients); c++)
 		{
         LIST_PUSH(iClientPool, &pC[c], iNextInList);
 		}
@@ -1379,7 +1383,7 @@
 	req->SendReceive(iMsgQ);
 	if(req->ReturnCode() == KErrNone)
 		{
-		pC = iClientList[(TUint16)(req->ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iClientList[(req->ClientId() & ID_INDEX_BIT_MASK)];
 		if(aType == EOwnerThread)
 			{
 			pC->iClientId |= CLIENT_THREAD_RELATIVE_BIT_MASK; //Set 31st bit;
@@ -1388,9 +1392,9 @@
 			}
 		pC->iName = &aName;
 		aClientId = pC->iClientId;
+	    PRM_CLIENT_REGISTER_TRACE
+	    __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterClient, clientId = 0x%x", aClientId));
 		}
-    PRM_CLIENT_REGISTER_TRACE
-	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterClient, clientId = 0x%x", aClientId));
 	return(req->ReturnCode());
 	}
 
@@ -1428,7 +1432,7 @@
 		//Get Next client from FreePool
 		LIST_POP(iClientPool, pC, iNextInList);
 
-		TUint16 growBy = iClientList.GrowBy();
+		TInt growBy = iClientList.GrowBy();
 		if(!pC)
 			{
 			//Free Pool is empty, so try to grow the pool.
@@ -1473,7 +1477,7 @@
 		{
 		//Get Next client from FreePool
 		LIST_POP(iClientPool, pC, iNextInList);
-		TUint16 growBy = iUserSideClientList.GrowBy();
+		TInt growBy = iUserSideClientList.GrowBy();
 		if(!pC)
 			{
 			//Free Pool is empty, so try to grow the pool.
@@ -1486,7 +1490,7 @@
 			iCleanList.Append(pCL);
 #endif
 			Lock();
-			TUint16 count;
+			TInt count;
 			for(count = 0; count < growBy - 1; count++)
 				LIST_PUSH(iClientPool, &pCL[count], iNextInList);
 			UnLock();
@@ -1552,29 +1556,29 @@
 		{
         __KTRACE_OPT(KRESMANAGER, Kern::Printf("Client 0x%x has requirement on resource %d", pCL->iClientId, pCL->iResourceId));
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-		switch((pCL->iResourceId >>RESOURCE_BIT_IN_ID_CHECK) & 0x3)													
-		{																		
-		case PRM_STATIC_RESOURCE:												
-			pR = iStaticResourceArray[pCL->iResourceId - 1];								
-			break;																
-		case PRM_DYNAMIC_RESOURCE:												
-			pR = (iDynamicResourceList[(TUint16)(pCL->iResourceId & ID_INDEX_BIT_MASK)]);			
-			break;																
-		case PRM_STATIC_DEPENDENCY_RESOURCE:									
-			pR = (iStaticResDependencyArray[(TUint16)(pCL->iResourceId & ID_INDEX_BIT_MASK) - 1]);						
-			break;																
-		case PRM_DYNAMIC_DEPENDENCY_RESOURCE:									
-			pR = (iDynamicResDependencyList[(TUint16)(pCL->iResourceId & ID_INDEX_BIT_MASK)]);		
-			break;																
-		}
+		switch((pCL->iResourceId >>RESOURCE_BIT_IN_ID_CHECK) & 0x3)
+			{
+			case PRM_STATIC_RESOURCE:
+			pR = iStaticResourceArray[pCL->iResourceId - 1];
+				break;
+			case PRM_DYNAMIC_RESOURCE:
+			pR = (iDynamicResourceList[(pCL->iResourceId & ID_INDEX_BIT_MASK)]);
+				break;
+			case PRM_STATIC_DEPENDENCY_RESOURCE:
+			pR = (iStaticResDependencyArray[(pCL->iResourceId & ID_INDEX_BIT_MASK) - 1]);
+				break;
+			case PRM_DYNAMIC_DEPENDENCY_RESOURCE:
+			pR = (iDynamicResDependencyList[(pCL->iResourceId & ID_INDEX_BIT_MASK)]);
+				break;
+			}
 #else
-		pR = iStaticResourceArray[pCL->iResourceId -1];
+		pR = iStaticResourceArray[pCL->iResourceId - 1];
 #endif
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-		if(((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId)) && (!(pCL->iResourceId & KIdMaskDynamic) ||
-			         ((pCL->iResourceId & KIdMaskDynamic) && (((DDynamicPowerResource*)pR)->LockCount() != 0))))
+		if(pR  &&  (((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId)) && (!(pCL->iResourceId & KIdMaskDynamic) ||
+			         ((pCL->iResourceId & KIdMaskDynamic) && (((DDynamicPowerResource*)pR)->LockCount() != 0)))))
 #else
-		if((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId)) 
+		if(pR  &&  ((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId))) 
 #endif
 		    {
             pReq->ReqType() = TPowerRequest::ESetDefaultLevel;
@@ -1693,7 +1697,7 @@
 		return KErrArgument;
 	//Get the index from client ID
 	Lock();
-	SPowerResourceClient* pC = iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];
+	SPowerResourceClient* pC = iClientList[(aClientId & ID_INDEX_BIT_MASK)];
     if(!pC)
 	    {
         __KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));
@@ -1737,7 +1741,7 @@
 	iRequestPoolCount = (TUint16)(iRequestPoolCount + (TUint16)pC->iReservedRm);
 	PRM_CLIENT_DEREGISTER_TRACE
 	//Increment the free pool count for client level and request level.
-	iClientList.Remove(pC, (TUint16)(pC->iClientId & ID_INDEX_BIT_MASK));
+	iClientList.Remove(pC, (pC->iClientId & ID_INDEX_BIT_MASK));
 	pC->iName = NULL;
 	iClientCount--; //Decrement client count
 	LIST_PUSH(iClientPool, pC, iNextInList);
@@ -1874,9 +1878,9 @@
 		return KErrTooBig;
 	Lock();
 	VALIDATE_CLIENT(thread);
-	TUint count = 0;
+	TInt count = 0;
 	//Search in static resource with no dependencies array for specified resource name.
-	for(count = 0; count < iStaticResourceArrayEntries; count++)
+	for(count = 0; count < iStaticResourceArray.Count(); count++)
 		{
 		if((iStaticResourceArray[count]) && (!(aResourceName.Compare(*(const TDesC8*)iStaticResourceArray[count]->iName))))
 			{
@@ -1896,7 +1900,7 @@
 		UNLOCK_RETURN(KErrNone);
 		}
 	//Search in static resource with dependencies (if exists) for specified resource name
-	for(count = 0; count < iStaticResDependencyCount; count++)
+	for(count = 0; count < iStaticResDependencyArray.Count(); count++)
 		{
 		if(!(aResourceName.Compare(*(const TDesC8*)iStaticResDependencyArray[count]->iName)))
 			{
@@ -1965,7 +1969,7 @@
 	   UNLOCK_RETURN(KErrArgument);
 
 #ifndef PRM_ENABLE_EXTENDED_VERSION
-	if((!aResourceId) || (aResourceId > iStaticResourceArrayEntries))
+	if((!aResourceId) || (aResourceId > (TUint)iStaticResourceArray.Count()))
 		UNLOCK_RETURN(KErrNotFound);
 	//Get resource from static resource array. 0(1) operation.
 	pR = iStaticResourceArray[aResourceId-1];
@@ -2036,7 +2040,7 @@
 	if(!aTargetClientId)
 		{
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-		aNumResource = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyCount + 
+		aNumResource = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyArray.Count() + 
 			                                                          iDynamicResDependencyCount; 
 #else
 		aNumResource = iStaticResourceCount;
@@ -2115,22 +2119,22 @@
          UNLOCK_RETURN(KErrArgument);
     TPowerResourceInfoBuf01 buf;
 
-	TUint16 count = 0;
+	TInt count = 0;
 	TInt r = KErrNone;
 	//Special case, if aTargetClientId is 0 fill with all the resource
 	if(!aTargetClientId)
 		{
-		TUint numResources = aNumResources;
+		TInt numResources = aNumResources;
 #ifndef PRM_ENABLE_EXTENDED_VERSION
 		aNumResources = iStaticResourceCount;
 #else
-		aNumResources = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyCount + 
+		aNumResources = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyArray.Count() + 
 			                                                           iDynamicResDependencyCount;
 #endif
 		UnLock();
-		while(count < iStaticResourceArrayEntries)
+		while(count < iStaticResourceArray.Count())
 			{
-			if(numResources <=0)
+			if(numResources == 0)
 				return KErrNone;
 			pR = iStaticResourceArray[count++];
 			if(!pR)
@@ -2145,7 +2149,7 @@
 			}	
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 		count = 0;
-		while(count < iStaticResDependencyCount)
+		while(count < iStaticResDependencyArray.Count())
 			{
 			if(count >= numResources)
 				return KErrNone;
@@ -2157,11 +2161,11 @@
 				return r;
 			pInfo->Append(buf);
 			}
-		numResources -= iStaticResDependencyCount;
+		numResources -= iStaticResDependencyArray.Count();
 		if((!numResources) || (!iDynamicResourceCount && !iDynamicResDependencyCount))
 			return r;
 		Lock();
-		TUint resCount = 0;
+		TInt resCount = 0;
 		for(count = 0; count < iDynamicResourceList.Allocd(); count++)
 			{
 			pR = iDynamicResourceList[count];
@@ -2178,7 +2182,7 @@
 			}
 		numResources -= resCount;
 		resCount = 0;
-		for(count = 0; count < iDynamicResDependencyList.Allocd(); count++) 
+		for(count = 0; count < (TInt)iDynamicResDependencyList.Allocd(); count++) 
 			{
 			pR = iDynamicResDependencyList[count];
 			if(!pR)
@@ -2200,7 +2204,7 @@
 	SPowerResourceClientLevel* pCL = pC->iLevelList;
 	for (count= 0; pCL; count++, pCL = pCL->iNextInList)
 		{
-		if(count >= aNumResources)
+		if(count >= (TInt)aNumResources)
 			continue;
 #ifndef PRM_ENABLE_EXTENDED_VERSION
 		pR = iStaticResourceArray[pCL->iResourceId-1];
@@ -2267,7 +2271,7 @@
 	DStaticPowerResource* pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR) 
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource* pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2371,7 +2375,7 @@
 	DStaticPowerResource* pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR) 
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource* pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2385,9 +2389,9 @@
 			continue;
 		pCL = (SPowerResourceClientLevel*)pRC;
 		if(pCL->iClientId & USER_SIDE_CLIENT_BIT_MASK)
-			pC = iUserSideClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];
+			pC = iUserSideClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];
 		else
-			pC = iClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];
+			pC = iClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];
 		info.iClientId = pC->iClientId;
 		info.iClientName =  (TDesC8*)pC->iName;
         pInfo->Append(TPckgC<TPowerClientInfoV01>(info));
@@ -2405,7 +2409,7 @@
 NOTE: If a resource callback is specified for instantaneous resource, then callback
       will be called after resource change and will be executed in the context of the
       client thread.
-      If a resource callback is specified for long latency reosurces, then it will be
+      If a resource callback is specified for long latency resources, then it will be
       executed asynchronously.When the request is accepted the API returns immediately
 	  and the calling thread is unblocked: the callback (called in the client's context) 
 	  will be invoked when the resource change finally takes place.
@@ -2424,7 +2428,7 @@
 @param aCb         For Long latency resource
                        A pointer to a resource callback object which encapsulates a
                        callback function to be called whenever the resource state change
-                       happens (if left NULL the API will execute synchrounously).
+                       happens (if left NULL the API will execute synchronously).
                    For Instantaneous resource
                        A pointer to a resource callback object which encapsulates a callback
                        function to be called after resource change. This executes in the
@@ -2479,7 +2483,7 @@
 	DStaticPowerResource *pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR) 
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource* pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2563,8 +2567,8 @@
 	SPowerRequest* pS=NULL;
 	if(pR->LatencySet() && aCb)
 		{
-		// Get request object from free pool, as it is long latency reosurce as client
-		// will be unblocked once message is sent to controller, so cant use thread message.
+		// Get request object from free pool, as it is long latency resource as client
+		// will be unblocked once message is sent to controller, so can't use thread message.
 		if(pC->iReservedRm ==0 && !iRequestPoolCount)
 			{
             r = KErrUnderflow;
@@ -2617,7 +2621,7 @@
 			else
 #endif
 				{
-				req->Send(iMsgQ); // Send the request to Resource Controler thread.
+				req->Send(iMsgQ); // Send the request to Resource Controller thread.
 				return KErrNone;
 				}
 			}
@@ -2768,7 +2772,7 @@
                    state is read from resource.
 @param aState      Returns the resource state if operation was successful. This
                    could be a binary value for a binary resource, an integer level
-                   for a multilevel resource or some platform specific tolen for a
+                   for a multilevel resource or some platform specific token for a
                    multi-property resource.
 @param aLevelOwnerId Returns the Id of the client that is currently holding the resource.
 					 -1	is returned when no client is holding the resource.
@@ -2815,7 +2819,7 @@
 			UNLOCK_RETURN(KErrNotFound);
 		}
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource *pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2899,7 +2903,7 @@
 @publishedPartner
 @prototype 9.5
 
-Request the state of the resource asynchrounously for long latency resource and
+Request the state of the resource asynchronously for long latency resource and
 synchronously for instantaneous resource
 
 @param aClientId  ID of the client which is requesting the resource state.
@@ -2961,7 +2965,7 @@
 			UNLOCK_RETURN(KErrNotFound);
 		}
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource *pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -3098,19 +3102,19 @@
 Cancel an asynchronous request(or its callback).
 
 @param aClientId       ID of the client which is requesting the cancellation of the request.
-@param aResourceId     ID for the resource which the request that is being cancelled operates
+@param aResourceId     ID for the resource which the request that is being canceled operates
                        upon.
 @param aCb             A reference to the resource callback object specified with the request
-                       that is being cancelled.
+                       that is being canceled.
 
-@return KErrCancel if the request was cancelled.
+@return KErrCancel if the request was canceled.
         KErrNotFound if this resource ID could not be found in the current list of controllable
                      resources.
         KErrCompletion if request is no longer pending.
         KErrAccessDenied if the client ID could not be found in the current list of registered
 		clients or if the client was registered to be thread relative and this API is not called
 		from the same thread or if client is not the same that requested the resource state change.
-		KErrInUse if the request cannot be cancelled as processing of the request already started 
+		KErrInUse if the request cannot be canceled as processing of the request already started 
 		and will run to completion. 
 
 @pre Interrupts must be enabled
@@ -3230,7 +3234,7 @@
 NOTE: This API should return immediately; however the notification will
 only happen when a resource change occurs.Notification request is idempotent, 
 if the same notification has already been requested for this resource ID, 
-the API returns with no further action.Notifications remain queued until they are cancelled.
+the API returns with no further action.Notifications remain queued until they are canceled.
 
 @pre Interrupts must be enabled
 @pre Kernel must be unlocked
@@ -3258,7 +3262,7 @@
 	DStaticPowerResource *pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR)
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		{
         r = KErrNotFound;
 		PRM_POSTNOTIFICATION_REGISTER_TRACE
@@ -3322,7 +3326,7 @@
 
 @return KErrNone if the operation of requesting a notification was successful.
         KErrNotFound if this resource ID could not be found in the current list
-                     of controllable reosurces.
+                     of controllable resources.
         KErrAccessDenied if the client ID could not be found in the list of
                          registered clients or if the client was registered to be thread
 						 relative and this API is not called from the same thread. 
@@ -3331,7 +3335,7 @@
 NOTE: This API should return immediately; however the notification will only
 happen when a resource change occurs. Notification request is idempotent, 
 if the same notification has already been requested for this resource ID, 
-the API returns with no further action. Notification remain queued until they are cancelled.
+the API returns with no further action. Notification remain queued until they are canceled.
 
 @pre Interrupts must be enabled
 @pre Kernel must be unlocked
@@ -3361,7 +3365,7 @@
 	DStaticPowerResource *pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR)
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		{
         r = KErrNotFound;
         PRM_POSTNOTIFICATION_REGISTER_TRACE
@@ -3425,12 +3429,12 @@
 
 @param aClientId ID of the client which is requesting to cancel the notification
 @param aResourceId for the resource whose pending notification of state changes
-                   is being cancelled.
+                   is being canceled.
 @param aN          A reference to the notification object that was associated with
-                   the notification request that is being cancelled. This will be
-                   used to identify the notification that is being cancelled.
+                   the notification request that is being canceled. This will be
+                   used to identify the notification that is being canceled.
 
-@return KErrCancel if the notification request was successfully cancelled.
+@return KErrCancel if the notification request was successfully canceled.
         KErrNotFound if the specified notification object is 
 					 not found in the current list of notification objects for the 
 					 specified resource.
@@ -3584,9 +3588,9 @@
 	TInt requestPoolCount = iRequestPoolCount;
 	SPowerResourceClient* pC;
 	if(aRequest.ClientId() & USER_SIDE_CLIENT_BIT_MASK)
-		pC = iUserSideClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iUserSideClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
 	else																				
-		pC = iClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
 	UnLock();
 
 	if(clientPoolCount < aRequest.ClientLevelCount())
@@ -3685,14 +3689,14 @@
 	req->SendReceive(iMsgQ);
 	if(req->ReturnCode() == KErrNone)
 		{
-		pC = iUserSideClientList[(TUint16)(req->ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iUserSideClientList[(req->ClientId() & ID_INDEX_BIT_MASK)];
 		pC->iName=&aName;
 		//Store the current thread Id;
 		pC->iThreadId = t.iId;
 		aClientId = pC->iClientId;
+	    __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterProxyClient, clientId = 0x%x", aClientId));
+	    PRM_CLIENT_REGISTER_TRACE
 		}
-	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterProxyClient, clientId = 0x%x", aClientId));
-    PRM_CLIENT_REGISTER_TRACE
 	LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
 	return KErrNone;
 	}
@@ -3710,7 +3714,7 @@
 	if(!(aClientId & USER_SIDE_CLIENT_BIT_MASK))
 		return KErrArgument;
 	Lock();
-	SPowerResourceClient* pC = iUserSideClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];
+	SPowerResourceClient* pC = iUserSideClientList[(aClientId & ID_INDEX_BIT_MASK)];
 	if(!pC)
 		{
 		UnLock();
@@ -3758,7 +3762,7 @@
 	iRequestPoolCount = (TUint16)(iRequestPoolCount + pC->iReservedRm);
 	PRM_CLIENT_DEREGISTER_TRACE
 	//Increment the free pool count for client level and request level.
-	iUserSideClientList.Remove(pC, (TUint16)(pC->iClientId & ID_INDEX_BIT_MASK));
+	iUserSideClientList.Remove(pC, (pC->iClientId & ID_INDEX_BIT_MASK));
 	pC->iName = NULL;
 	iUserSideClientCount--; //Decrement client count
 	LIST_PUSH(iClientPool, pC, iNextInList);
@@ -3795,7 +3799,7 @@
 	for(count=0;count<aNumResources;count++) //Check for valid resource ID.
 		{
 #ifndef PRM_ENABLE_EXTENDED_VERSION
-		if((!pS->iResourceId) || (pS->iResourceId > iStaticResourceArrayEntries) || (!iStaticResourceArray[pS->iResourceId-1]))
+		if((!pS->iResourceId) || (pS->iResourceId > (TUint)iStaticResourceArray.Count()) || (!iStaticResourceArray[pS->iResourceId-1]))
 			{
 			UnLock();
 			LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
@@ -3809,8 +3813,8 @@
 			return KErrNotSupported;
 			}
 		if((!pS->iResourceId) || ((pS->iResourceId & KIdMaskResourceWithDependencies) && 
-			     (pS->iResourceId > iStaticResDependencyCount)) || (!(pS->iResourceId & KIdMaskResourceWithDependencies) && 
-					((pS->iResourceId > iStaticResourceArrayEntries) || (!iStaticResourceArray[pS->iResourceId-1]))))
+			     (pS->iResourceId > (TUint)iStaticResDependencyArray.Count())) || (!(pS->iResourceId & KIdMaskResourceWithDependencies) && 
+					((pS->iResourceId > (TUint)iStaticResourceArray.Count()) || (!iStaticResourceArray[pS->iResourceId-1]))))
 			{
 			UnLock();
 			LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
@@ -3835,7 +3839,6 @@
 		pS++;
 		}
 	iListForIdle=(SIdleResourceInfo*)aBuf->Ptr();
-	pS = (SIdleResourceInfo*)aBuf->Ptr();
 	UnLock();
 	LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
 	return KErrNone;
@@ -3885,7 +3888,7 @@
 	if(aResourceId & KIdMaskDynamic)
 		((DDynamicPowerResource*)pR)->Lock();
 #else
-	if(aResourceId > iStaticResourceArrayEntries)
+	if(aResourceId > (TUint)iStaticResourceArray.Count())
 		{
 		UNLOCK_RETURN(KErrNotFound);
 		}
--- a/kernel/eka/drivers/resourceman/resourcecontrol_extended.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/resourceman/resourcecontrol_extended.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -35,14 +35,14 @@
 		iResourceLevelPoolCount = (TUint16)(iResourceLevelPoolCount - aCount);
 	else
 		{
-		TUint allocCount = (iStaticResDependencyCount / 2) + aCount;
+		TUint allocCount = (iStaticResDependencyArray.Count() / 2) + aCount;
 		// coverity[alloc_fn]
 		SPowerResourceClientLevel* pCL = new SPowerResourceClientLevel[allocCount];
 		if(!pCL)
 			return KErrNoMemory;
 		for(TUint count = 0;count<(TUint)(allocCount);count++)
 			LIST_PUSH(iResourceLevelPool, &pCL[count], iNextInList);
-		iResourceLevelPoolCount= (TUint16)(iResourceLevelPoolCount + (iStaticResDependencyCount / 2));
+		iResourceLevelPoolCount= (TUint16)(iResourceLevelPoolCount + (iStaticResDependencyArray.Count() / 2));
 #ifdef PRM_INSTRUMENTATION_MACRO
 		TUint size = allocCount * sizeof(SPowerResourceClientLevel);
 		PRM_MEMORY_USAGE_TRACE
@@ -79,16 +79,16 @@
 	SNode* pN;
 	if(aResourceId & KIdMaskDynamic)
 		{
-		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];		
+		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(aResourceId & ID_INDEX_BIT_MASK)];		
 		if(!pDR)														
 			return KErrNotFound;
 		pN = pDR->iDependencyList;
 		}
 	else
 		{
-		if((aResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
+		if((aResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
 			return KErrNotFound;
-		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(TUint16)(aResourceId & ID_INDEX_BIT_MASK) - 1];
+		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(aResourceId & ID_INDEX_BIT_MASK) - 1];
 		pN = pDR->iDependencyList;
 		}
 	*aNumResources = 0;
@@ -123,16 +123,16 @@
 	SNode* pN;
 	if(aResourceId & KIdMaskDynamic)
 		{
-		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];
+		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(aResourceId & ID_INDEX_BIT_MASK)];
 		if(!pDR)
 			return KErrNotFound;
 		pN = pDR->iDependencyList;
 		}
 	else
 		{
-		if((aResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
+		if((aResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
 			return KErrNotFound;
-		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(TUint16)(aResourceId & ID_INDEX_BIT_MASK) -1];
+		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(aResourceId & ID_INDEX_BIT_MASK) -1];
 		pN = pDR->iDependencyList;
 		}
 	TUint count = 0;
@@ -184,31 +184,31 @@
 	//Retrieve resource1 from the corresponding list.
 	if(aInfo1->iResourceId & KIdMaskDynamic)
 		{
-		pR1 = iDynamicResDependencyList[(TUint16)(aInfo1->iResourceId & ID_INDEX_BIT_MASK)];
+		pR1 = iDynamicResDependencyList[(aInfo1->iResourceId & ID_INDEX_BIT_MASK)];
 		if(!pR1)
 			return KErrNotFound;
 		pN1 = pR1->iDependencyList;
 		}
 	else 
 		{
-		if((aInfo1->iResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
+		if((aInfo1->iResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
 			return KErrNotFound;
-		pR1 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(TUint16)(aInfo1->iResourceId & ID_INDEX_BIT_MASK) - 1];
+		pR1 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aInfo1->iResourceId & ID_INDEX_BIT_MASK) - 1];
 		pN1 = ((DStaticPowerResourceD*)pR1)->iDependencyList;
 		}
 	//Retrieve resource2 from the corresponding list.
 	if(aInfo2->iResourceId & KIdMaskDynamic)
 		{
-		pR2 = iDynamicResDependencyList[(TUint16)(aInfo2->iResourceId & ID_INDEX_BIT_MASK)];
+		pR2 = iDynamicResDependencyList[(aInfo2->iResourceId & ID_INDEX_BIT_MASK)];
 		if(!pR2)
 			return KErrNotFound;
 		pN2 = pR2->iDependencyList;
 		}
 	else
 		{
-		if((aInfo2->iResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
+		if((aInfo2->iResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
 			return KErrNotFound;
-		pR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(TUint16)(aInfo2->iResourceId & ID_INDEX_BIT_MASK) - 1];
+		pR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aInfo2->iResourceId & ID_INDEX_BIT_MASK) - 1];
 		pN2 = ((DStaticPowerResourceD*)pR2)->iDependencyList;
 		}
 
@@ -325,13 +325,13 @@
 	//Get the resource from appropriate container
 	if(aResourceId & KIdMaskResourceWithDependencies)
 		{
-		pDR = iDynamicResDependencyList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];		
+		pDR = iDynamicResDependencyList[(aResourceId & ID_INDEX_BIT_MASK)];		
 		if(!pDR)														
 			return KErrNotFound;
 		}
 	else
 		{
-		pDR = iDynamicResourceList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];		
+		pDR = iDynamicResourceList[(aResourceId & ID_INDEX_BIT_MASK)];		
 		if(!pDR)														
 			return KErrNotFound;
 		}
@@ -460,9 +460,9 @@
 		{
 		pCL = (SPowerResourceClientLevel*)pRC;
 		if(pCL->iClientId & USER_SIDE_CLIENT_BIT_MASK)
-			pC = iUserSideClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];								
+			pC = iUserSideClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];								
 		else																										
-			pC = iClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];										
+			pC = iClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];										
 		LIST_REMOVE(pC->iLevelList, pCL, iNextInList, SPowerResourceClientLevel);
 		LIST_PUSH(iClientLevelPool, pCL, iNextInList);
 		if(pC->iUnderFlowClCount > 0)
@@ -477,12 +477,12 @@
 	aClientPtr->iDynamicResCount--;
 	if(aResourceId & KIdMaskResourceWithDependencies)
 		{
-		iDynamicResDependencyList.Remove((DDynamicPowerResourceD*)pDR, (TUint16)(pDR->iResourceId & ID_INDEX_BIT_MASK));
+		iDynamicResDependencyList.Remove((DDynamicPowerResourceD*)pDR, (pDR->iResourceId & ID_INDEX_BIT_MASK));
 		iDynamicResDependencyCount--;
 		}
 	else
 		{
-		iDynamicResourceList.Remove(pDR, (TUint16)(pDR->iResourceId & ID_INDEX_BIT_MASK));
+		iDynamicResourceList.Remove(pDR, (pDR->iResourceId & ID_INDEX_BIT_MASK));
 		iDynamicResourceCount--;
 		}
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("<DExtendedResourceController::DeregisterDynamicResource"));
@@ -498,12 +498,10 @@
 @prototype 9.6
 Default implementation, PSL re-implements this if features supported.
 */
-TInt DPowerResourceController::DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, 
-																    TUint16& aStaticResourceDCount)
+TInt DPowerResourceController::DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray)
 	{
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DExtendedResourceController::DoRegisterStaticResourcesDependency default implementation"));
-	aStaticResourceDArray = NULL;
-	aStaticResourceDCount = 0;
+	aStaticResourceDArray.Reset();
 	return KErrNone;
 	}
 
@@ -708,18 +706,18 @@
 			{																							
 			DStaticPowerResourceD* pResource;												
 			if(aRequest.ClientId() & KIdMaskDynamic)										
-				pResource = (DStaticPowerResourceD*)iDynamicResDependencyList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
+				pResource = (DStaticPowerResourceD*)iDynamicResDependencyList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
 			else																						
-				pResource = iStaticResDependencyArray[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)  - 1];	
+				pResource = iStaticResDependencyArray[(aRequest.ClientId() & ID_INDEX_BIT_MASK)  - 1];	
 			name = pResource->iName;																	
 			}																							
 		else																							
 			{																							
 			SPowerResourceClient* pClient;																
 			if(aRequest.ClientId() & USER_SIDE_CLIENT_BIT_MASK)										
-				pClient = iUserSideClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];	
+				pClient = iUserSideClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];	
 			else // coverity[returned_null]
-				pClient = iClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];			
+				pClient = iClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];			
 			name = pClient->iName;				
 			}
 		}
@@ -762,7 +760,7 @@
 
 	if(aResId1 & KIdMaskDynamic)
 		{
-		pDR1 = iDynamicResDependencyList[(TUint16)(aResId1 & ID_INDEX_BIT_MASK)];	
+		pDR1 = iDynamicResDependencyList[(aResId1 & ID_INDEX_BIT_MASK)];	
 		if(!pDR1)															
 			UNLOCK_RETURN(KErrNotFound);
 		pN1 = pDR1->iDependencyList;
@@ -770,7 +768,7 @@
 		}
 	else
 		{
-		if((aResId1 & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)			
+		if((aResId1 & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())			
 			UNLOCK_RETURN(KErrNotFound);			
 		pDR1 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aResId1 & ID_INDEX_BIT_MASK) - 1];
 		pN1 = ((DStaticPowerResourceD*)pDR1)->iDependencyList;
@@ -780,7 +778,7 @@
 	//Get second resource from list
 	if(aResId2 & KIdMaskDynamic)
 		{
-		pDR2 = iDynamicResDependencyList[(TUint16)(aResId2 & ID_INDEX_BIT_MASK)];	
+		pDR2 = iDynamicResDependencyList[(aResId2 & ID_INDEX_BIT_MASK)];	
 		if(!pDR2)															
 			UNLOCK_RETURN(KErrNotFound);
 		pN2 = pDR2->iDependencyList;
@@ -788,9 +786,9 @@
 		}
 	else
 		{
-		if((aResId2 & ID_INDEX_BIT_MASK)> iStaticResDependencyCount)			
+		if((aResId2 & ID_INDEX_BIT_MASK)> (TUint)iStaticResDependencyArray.Count())			
 				UNLOCK_RETURN(KErrNotFound);			
-		pDR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(TUint16)(aResId2 & ID_INDEX_BIT_MASK) - 1];
+		pDR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aResId2 & ID_INDEX_BIT_MASK) - 1];
 		pN2 = ((DStaticPowerResourceD*)pDR2)->iDependencyList;
 		pCL2 = ((DStaticPowerResourceD*)pDR2)->iResourceClientList;
 		}
--- a/kernel/eka/drivers/usbc/d_usbc.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbc/d_usbc.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,6 +23,11 @@
 */
 
 #include <drivers/usbc.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "d_usbcTraces.h"
+#endif
+
 
 
 _LIT(KUsbLddName, "Usbc");
@@ -95,7 +100,9 @@
 	// Only proceed if we have the Controller underneath us
 	if (!DUsbClientController::UsbcControllerPointer())
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("LDD Install: USB Controller Not Present"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLOGDEVICE_INSTALL,
+		        "LDD Install: USB Controller Not Present" );
+		
 		return KErrGeneral;
 		}
 	return SetName(&KUsbLddName);
@@ -134,7 +141,9 @@
 	  iDeviceStatusNeeded(EFalse),
 	  iChannelClosing(EFalse)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("*** DLddUsbcChannel::DLddUsbcChannel CTOR"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS, 
+	        "*** DLddUsbcChannel::DLddUsbcChannel CTOR" );
+	
 	iClient = &Kern::CurrentThread();
 	iClient->Open();
 	for (TInt i = 1; i <= KMaxEndpointsPerClient; i++)
@@ -150,7 +159,9 @@
 
 DLddUsbcChannel::~DLddUsbcChannel()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::~DLddUsbcChannel()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES, 
+	        "DLddUsbcChannel::~DLddUsbcChannel()" );
+	
 	if (iController)
 		{
 		iController->DeRegisterClient(this);
@@ -196,8 +207,9 @@
 //
 TInt DLddUsbcChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("LDD DoCreateL 1 Ver = %02d %02d %02d",
-									aVer.iMajor, aVer.iMinor, aVer.iBuild));
+	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCREATE, 
+	        "LDD DoCreateL 1 Ver = %02d %02d %02d", aVer.iMajor, aVer.iMinor, aVer.iBuild );
+	
 	if (!Kern::CurrentThreadHasCapability(ECapabilityCommDD,
 										  __PLATSEC_DIAGNOSTIC_STRING("Checked by USBC.LDD (USB Driver)")))
 		{
@@ -427,7 +439,8 @@
 //
 TInt DLddUsbcChannel::RequestUserHandle(DThread* aThread, TOwnerType /*aType*/)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::RequestUserHandle"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_REQUESTUSERHANDLE,
+	        "DLddUsbcChannel::RequestUserHandle" );
 	// The USB client LDD is not designed for a channel to be shared between
 	// threads. It saves a pointer to the current thread when it is opened, and
 	// uses this to complete any asynchronous requests.
@@ -450,7 +463,8 @@
 void DLddUsbcChannel::DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2)
 	{
 	// Check on request status
-	__KTRACE_OPT(KUSB, Kern::Printf("DoRequest 0x%08x", aReqNo));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOREQUEST, 
+	        "DoRequest 0x%08x", aReqNo );
 		TInt r = KErrNone;
 		if (iRequestStatus[aReqNo] != NULL)
 			{
@@ -519,7 +533,8 @@
 		{
 	case RDevUsbcClient::ERequestAlternateDeviceStatusNotify:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlReqDeviceStatusNotify"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ, 
+		        "EControlReqDeviceStatusNotify" );
 		if (a1 != NULL)
 			{
 			iDeviceStatusNeeded = ETrue;
@@ -532,14 +547,16 @@
 		}
 	case RDevUsbcClient::ERequestReEnumerate:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestReEnumerate"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP1, 
+	            "ERequestReEnumerate" );
 		// If successful, this will complete via the status notification.
 		r = iController->ReEnumerate();
 		break;
 		}
 	case RDevUsbcClient::ERequestEndpointStatusNotify:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestEndpointStatusNotify"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP2, 
+	            "ERequestEndpointStatusNotify" );
 		if (a1 != NULL)
 			{
 			iEndpointStatusChangePtr = a1;
@@ -550,7 +567,8 @@
 			}
 	case RDevUsbcClient::ERequestOtgFeaturesNotify:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestOtgFeaturesNotify"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP3, 
+		        "ERequestOtgFeaturesNotify" );
 		if (a1 != NULL)
 			{
             iOtgFeatureChangePtr = a1;
@@ -589,7 +607,8 @@
 		// ep0 requests
 		if (!(iValidInterface || iOwnsDeviceControl))
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DoRequest rejected: not configured (Ep0)"));
+			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ,
+			        "DoRequest rejected: not configured (Ep0)" );
 			r = KErrUsbInterfaceNotReady;
 			goto exit;
 			}
@@ -601,7 +620,8 @@
 		                          iDeviceState == EUsbcDeviceStateSuspended))
 		   )
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DoRequest rejected not configured (Ep %d)", aEndpointNum));
+			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP1,
+			        "DoRequest rejected not configured (Ep %d)", aEndpointNum );
 			r = KErrUsbInterfaceNotReady;
 			goto exit;
 			}
@@ -609,7 +629,8 @@
 
 	if (!ValidEndpoint(aEndpointNum))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Read: in error complete"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP2,
+		        "  Error: DoRequest Read: in error complete" );
 		r = KErrUsbEpNotInInterface;
 		goto exit;
  		}
@@ -629,13 +650,15 @@
 	pEndpoint = iEndpoint[aEndpointNum];
 	if (!pEndpoint)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Read: in error complete"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP3,
+		        "  Error: DoRequest Read: in error complete" );
 		r = KErrUsbEpNotInInterface;
 		goto exit;
 		}
 
 	pEndpointInfo = pEndpoint->EndpointInfo();
-	__KTRACE_OPT(KUSB, Kern::Printf("DoRequest %d", aEndpointNum));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP4,
+	        "DoRequest %d", aEndpointNum );
 
 	switch (pTfr->iTransferType)
 		{
@@ -645,21 +668,25 @@
 	case ETransferTypeReadUntilShort:
 	case ETransferTypeReadOneOrMore:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP5,
+		        "DoRequest Read" );
 		if (pEndpoint->iDmaBuffers->RxIsActive())
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("**** ReadReq ep%d RxActive", aEndpointNum));
+			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP6,
+			        "**** ReadReq ep%d RxActive", aEndpointNum );
 			}
 		else
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("**** ReadReq ep%d RxInActive", aEndpointNum));
+			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP7,
+			        "**** ReadReq ep%d RxInActive", aEndpointNum );
 			}
 
 		if (pEndpointInfo->iDir != KUsbEpDirOut &&
 			pEndpointInfo->iDir != KUsbEpDirBidirect)
 			{
 			// Trying to do the wrong thing
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Read: in error complete"));
+			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP8,
+			        "  Error: DoRequest Read: in error complete" );
 			r = KErrUsbEpBadDirection;
 			break;
 			}
@@ -677,7 +704,8 @@
 			{
 			if (pTfr->iTransferType == ETransferTypeReadPacket)
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read packet: data available complete"));
+				OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP9,
+				        "DoRequest Read packet: data available complete" );
 				r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 				aNeedsCompletion = ETrue;
 				break;
@@ -686,7 +714,8 @@
 				{
 				if (pTfr->iTransferSize <= pEndpoint->RxBytesAvailable())
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read data: data available complete"));
+					OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP10,
+					        "DoRequest Read data: data available complete");
 					r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 					aNeedsCompletion = ETrue;
 					break;
@@ -700,7 +729,8 @@
 				{
 				if (pEndpoint->RxBytesAvailable() > 0)
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read data: data available complete"));
+					OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP11,
+					        "DoRequest Read data: data available complete" );
 					r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 					aNeedsCompletion = ETrue;
 					break;
@@ -718,7 +748,9 @@
 					(nRx < maxPacketSize) ||
 					pEndpoint->iDmaBuffers->ShortPacketExists())
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read data: data available complete"));
+                    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP12,
+                            "DoRequest Read data: data available complete" );
+
 					r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 					aNeedsCompletion = ETrue;
 					}
@@ -731,7 +763,9 @@
 		r = pEndpoint->TryToStartRead(EFalse);
 		if (r != KErrNone)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read: couldn't start read"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP13,
+                    "DoRequest Read: couldn't start read" );
+
 			r = KErrNone;									// Reader full isn't a userside error;
 			}
 		break;
@@ -739,42 +773,48 @@
 
 	case ETransferTypeWrite:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Write 1"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP14,
+                "DoRequest Write 1" );
 		if (pEndpointInfo->iDir != KUsbEpDirIn &&
 			pEndpointInfo->iDir != KUsbEpDirBidirect)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Write: wrong direction complete"));
+			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP15,
+			        "  Error: DoRequest Write: wrong direction complete" );
 			r = KErrUsbEpBadDirection;
 			break;
 			}
-		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Write 2"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP16,
+		        "DoRequest Write 2" );
 
 
 		TInt desLength=iClientAsynchNotify[aEndpointNum]->iClientBuffer->Length();
 		
 		if (desLength < pTfr->iTransferSize)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Write: user buffer too short"));
+			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP17,
+			        "  Error: DoRequest Write: user buffer too short" );
 			r = KErrUsbTransferSize;
 			break;
 			}
 
-		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Write 3 length=%d maxlength=%d",
-										pTfr->iTransferSize, desLength));
+		OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP18,
+		        "DoRequest Write 3 length=%d maxlength=%d", pTfr->iTransferSize, desLength);
 		// Zero length writes are acceptable
 		pEndpoint->SetClientWritePending(ETrue);
 		r = pEndpoint->TryToStartWrite(pTfr);
 		if (r != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Write: couldn't start write"));
+			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP19,
+			        "  Error: DoRequest Write: couldn't start write" );
 			pEndpoint->SetClientWritePending(EFalse);
 			}
 		break;
 		}
 
 	default:
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoTransferAsyncReq: pTfr->iTransferType = %d not supported",
-										  pTfr->iTransferType));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP20,
+                "  Error: DoTransferAsyncReq: pTfr->iTransferType = %d not supported", pTfr->iTransferType);
+
 		r = KErrNotSupported;
 		break;
 		}
@@ -790,15 +830,20 @@
 TInt DLddUsbcChannel::DoCancel(TInt aReqNo)
 	{
 	TInt r = KErrNone;
-	__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: 0x%x", aReqNo));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL, 
+	        "DoCancel: 0x%x", aReqNo );
 	if (aReqNo <= iNumberOfEndpoints)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel endpoint: 0x%x", aReqNo));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP1, 
+		        "DoCancel endpoint: 0x%x", aReqNo );
+
 		iEndpoint[aReqNo]->CancelTransfer(iClient,iClientAsynchNotify[aReqNo]->iClientBuffer);
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestAlternateDeviceStatusNotify)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP2, 
+		        "DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo );
+
 		iDeviceStatusNeeded = EFalse;
 		iStatusFifo->FlushQueue();
 		if (iStatusChangePtr)
@@ -816,11 +861,15 @@
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestReEnumerate)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestReEnumerate: 0x%x", aReqNo));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP3, 
+                "DoCancel ERequestReEnumerate: 0x%x", aReqNo );
+
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestEndpointStatusNotify)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP4,
+                "DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo );
+
 		CancelNotifyEndpointStatus();
 		if (iEndpointStatusChangeReq->IsReady())
 			{
@@ -831,7 +880,9 @@
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestOtgFeaturesNotify)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP5,
+                "DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo );
+
 		CancelNotifyOtgFeatures();
 		if (iOtgFeatureChangeReq->IsReady())
 			{
@@ -841,7 +892,9 @@
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Unknown! 0x%x", aReqNo));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP6,
+                "DoCancel Unknown! 0x%x", aReqNo );
+
 		}
 
 		if (r == KErrNone)
@@ -1118,7 +1171,8 @@
 
 TInt DLddUsbcChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DoControl: %d", aFunction));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL, 
+            "DoControl: %d", aFunction );
 
 	TInt r = KErrNone;
 	TInt ep;
@@ -1133,7 +1187,9 @@
 	switch (aFunction)
 		{
 	case RDevUsbcClient::EControlEndpointZeroRequestError:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroRequestError"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP1, 
+	            "EControlEndpointZeroRequestError" );
+
 		r = KErrNone;
 		if (iOwnsDeviceControl || (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured))
 			{
@@ -1149,7 +1205,9 @@
 		break;
 
 	case RDevUsbcClient::EControlGetAlternateSetting:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetAlternateSetting"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP2,
+                "EControlGetAlternateSetting" );
+
 		if (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured)
 			{
 			r = iController->GetInterfaceNumber(this, *(TInt*)a1);
@@ -1164,12 +1222,16 @@
 		break;
 
 	case RDevUsbcClient::EControlDeviceStatus:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceStatus"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP3,
+                "EControlDeviceStatus" );
+
 		*(TInt*)a1 = iController->GetDeviceStatus();
 		break;
 
 	case RDevUsbcClient::EControlEndpointStatus:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointStatus"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP4,
+                "EControlEndpointStatus" );
+
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			pEndpoint = iEndpoint[(TInt)a1];
@@ -1190,7 +1252,9 @@
 		break;
 
 	case RDevUsbcClient::EControlQueryReceiveBuffer:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlQueryReceiveBuffer"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP5,
+                "EControlQueryReceiveBuffer" );
+
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			pEndpoint=iEndpoint[(TInt) a1];
@@ -1198,7 +1262,8 @@
 				r = KErrNotSupported;
 			else if (pEndpoint->EndpointInfo()->iDir != KUsbEpDirIn)
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("  bytes = %d", pEndpoint->RxBytesAvailable()));
+		        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP6,
+		                "  bytes = %d", pEndpoint->RxBytesAvailable());
 				*(TInt*)a2 = pEndpoint->RxBytesAvailable();
 				}
 			}
@@ -1212,7 +1277,8 @@
 		break;
 
 	case RDevUsbcClient::EControlEndpointCaps:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointCaps"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP7,
+                "EControlEndpointCaps" );
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1220,7 +1286,8 @@
 		break;
 
 	case RDevUsbcClient::EControlDeviceCaps:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceCaps"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP8,
+                "EControlDeviceCaps" );
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1228,12 +1295,14 @@
 		break;
 
 	case RDevUsbcClient::EControlSendEp0StatusPacket:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSendEp0StatusPacket"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP9,
+                "EControlSendEp0StatusPacket" );
 		iController->SendEp0StatusPacket(this);
 		break;
 
 	case RDevUsbcClient::EControlHaltEndpoint:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlHaltEndpoint"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP10,
+                "EControlHaltEndpoint" );
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->HaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1248,7 +1317,8 @@
 		break;
 
 	case RDevUsbcClient::EControlClearHaltEndpoint:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlClearHaltEndpoint"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP11,
+                "EControlClearHaltEndpoint" );
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->ClearHaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1263,33 +1333,39 @@
 		break;
 
 	case RDevUsbcClient::EControlDumpRegisters:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDumpRegisters"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP12,
+                "EControlDumpRegisters" );
 		iController->DumpRegisters();
 		break;
 
 	case RDevUsbcClient::EControlReleaseDeviceControl:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseDeviceControl"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP13,
+                "EControlReleaseDeviceControl" );
 		iController->ReleaseDeviceControl(this);
 		iOwnsDeviceControl = EFalse;
 		break;
 
 	case RDevUsbcClient::EControlEndpointZeroMaxPacketSizes:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroMaxPacketSizes"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP14,
+                "EControlEndpointZeroMaxPacketSizes" );
 		r = iController->EndpointZeroMaxPacketSizes();
 		break;
 
 	case RDevUsbcClient::EControlSetEndpointZeroMaxPacketSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointZeroMaxPacketSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP15,
+                "EControlSetEndpointZeroMaxPacketSize" );
 		r = iController->SetEndpointZeroMaxPacketSize(reinterpret_cast<TInt>(a1));
 		break;
 
 	case RDevUsbcClient::EControlGetEndpointZeroMaxPacketSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointZeroMaxPacketSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP16,
+                "EControlGetEndpointZeroMaxPacketSize" );
 		r = iController->Ep0PacketSize();
 		break;
 
 	case RDevUsbcClient::EControlGetDeviceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP17,
+                "EControlGetDeviceDescriptor" );
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1297,7 +1373,8 @@
 		break;
 
 	case RDevUsbcClient::EControlSetDeviceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP18,
+                "EControlSetDeviceDescriptor" );
 		if (a1 != NULL)
 			r = iController->SetDeviceDescriptor(iClient, *((TDes8*) a1));
 		else
@@ -1305,7 +1382,8 @@
 		break;
 
 	case RDevUsbcClient::EControlGetDeviceDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptorSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP19,
+                "EControlGetDeviceDescriptorSize" );
 		if (a1 != NULL)
 			r = iController->GetDeviceDescriptorSize(iClient, *((TDes8*) a1));
 		else
@@ -1313,7 +1391,8 @@
 		break;
 
 	case RDevUsbcClient::EControlGetConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP20,
+                "EControlGetConfigurationDescriptor" );
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1321,7 +1400,8 @@
 		break;
 
 	case RDevUsbcClient::EControlGetConfigurationDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptorSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP21,
+                "EControlGetConfigurationDescriptorSize" );
 		if (a1 != NULL)
 			{
 			r = iController->GetConfigurationDescriptorSize(iClient, *((TDes8*) a1));
@@ -1331,27 +1411,32 @@
 		break;
 
 	case RDevUsbcClient::EControlSetConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP22,
+                "EControlSetConfigurationDescriptor" );
 		r = iController->SetConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlGetInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP23,
+                "EControlGetInterfaceDescriptor" );
 		r = iController->GetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlGetInterfaceDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptorSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP24,
+                "EControlGetInterfaceDescriptorSize" );
 		r = iController->GetInterfaceDescriptorSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcClient::EControlSetInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterfaceDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP25,
+                "EControlSetInterfaceDescriptor" );
 		r = iController->SetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlGetEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP26,
+                "EControlGetEndpointDescriptor" );
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1361,7 +1446,8 @@
 		break;
 
 	case RDevUsbcClient::EControlGetEndpointDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptorSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP27,
+                "EControlGetEndpointDescriptorSize" );
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1371,7 +1457,8 @@
 		break;
 
 	case RDevUsbcClient::EControlSetEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP28,
+                "EControlSetEndpointDescriptor" );
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1381,7 +1468,8 @@
 		break;
 
 	case RDevUsbcClient::EControlGetDeviceQualifierDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceQualifierDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP29,
+                "EControlGetDeviceQualifierDescriptor" );
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1389,7 +1477,8 @@
 		break;
 
 	case RDevUsbcClient::EControlSetDeviceQualifierDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceQualifierDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP30,
+                "EControlSetDeviceQualifierDescriptor" );
 		if (a1 != NULL)
 			r = iController->SetDeviceQualifierDescriptor(iClient, *((TDes8*) a1));
 		else
@@ -1397,7 +1486,8 @@
 		break;
 
 	case RDevUsbcClient::EControlGetOtherSpeedConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtherSpeedConfigurationDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP31,
+                "EControlGetOtherSpeedConfigurationDescriptor" );
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1405,23 +1495,27 @@
 		break;
 
 	case RDevUsbcClient::EControlSetOtherSpeedConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetOtherSpeedConfigurationDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP32,
+                "EControlSetOtherSpeedConfigurationDescriptor" );
 		r = iController->SetOtherSpeedConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 
 	case RDevUsbcClient::EControlGetCSInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP33,
+                "EControlGetCSInterfaceDescriptor" );
 		r = iController->GetCSInterfaceDescriptorBlock(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlGetCSInterfaceDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptorSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP34,
+                "EControlGetCSInterfaceDescriptorSize" );
 		r = iController->GetCSInterfaceDescriptorBlockSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcClient::EControlGetCSEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP35,
+                "EControlGetCSEndpointDescriptor" );
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1431,7 +1525,8 @@
 		break;
 
 	case RDevUsbcClient::EControlGetCSEndpointDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptorSize"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP36,
+                "EControlGetCSEndpointDescriptorSize" );
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1441,38 +1536,46 @@
 		break;
 
 	case RDevUsbcClient::EControlSignalRemoteWakeup:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSignalRemoteWakeup"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP37,
+                "EControlSignalRemoteWakeup" );
 		r = iController->SignalRemoteWakeup();
 		break;
 
 	case RDevUsbcClient::EControlDeviceDisconnectFromHost:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceDisconnectFromHost"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP38,
+                "EControlDeviceDisconnectFromHost" );
 		r = iController->UsbDisconnect();
 		break;
 
 	case RDevUsbcClient::EControlDeviceConnectToHost:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceConnectToHost"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP39,
+                "EControlDeviceConnectToHost" );
 		r = iController->UsbConnect();
 		break;
 
 	case RDevUsbcClient::EControlDevicePowerUpUdc:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDevicePowerUpUdc"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP40,
+                "EControlDevicePowerUpUdc" );
 		r = iController->PowerUpUdc();
 		break;
 
 	case RDevUsbcClient::EControlSetDeviceControl:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP41,
+                "EControlSetDeviceControl" );
 		r = iController->SetDeviceControl(this);
 		if (r == KErrNone)
 			{
 			iOwnsDeviceControl = ETrue;
 			if (iEndpoint[0] == NULL)
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl 11"));
+		        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP42,
+		                "EControlSetDeviceControl 11" );
 				r = SetupEp0();
 				if (r != KErrNone)
 					{
-					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetupEp0() failed"));
+	               OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOCONTROL_DUP43,
+	                       "  Error: SetupEp0() failed" );
+
 					iController->ReleaseDeviceControl(this);
 					DestroyEp0();
 					iOwnsDeviceControl = EFalse;
@@ -1485,12 +1588,14 @@
 		break;
 
 	case RDevUsbcClient::EControlCurrentlyUsingHighSpeed:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlCurrentlyUsingHighSpeed"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP44,
+                "EControlCurrentlyUsingHighSpeed" );
 		r = iController->CurrentlyUsingHighSpeed();
 		break;
 
 	case RDevUsbcClient::EControlSetInterface:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterface"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP45,
+                "EControlSetInterface" );
 		r = Kern::ThreadRawRead(iClient, a2, &ifcInfo, sizeof(ifcInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1516,7 +1621,8 @@
 		break;
 
 	case RDevUsbcClient::EControlReleaseInterface:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseInterface"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP46,
+                "EControlReleaseInterface" );
 		r = iController->ReleaseInterface(this, (TInt) a1);
 		if (r == KErrNone)
 			{
@@ -1524,12 +1630,14 @@
 			}
 		else
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error in PIL: LDD interface won't be released."));
+	        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOCONTROL_DUP47,
+	                "  Error in PIL: LDD interface won't be released." );
 			}
 		break;
 
 	case RDevUsbcClient::EControlSetCSInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSInterfaceDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP48,
+                "EControlSetCSInterfaceDescriptor" );
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1539,7 +1647,8 @@
 		break;
 
 	case RDevUsbcClient::EControlSetCSEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSEndpointDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP49,
+                "EControlSetCSEndpointDescriptor" );
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1550,87 +1659,104 @@
 		break;
 
 	case RDevUsbcClient::EControlGetStringDescriptorLangId:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptorLangId"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP50,
+                "EControlGetStringDescriptorLangId" );
 		r = iController->GetStringDescriptorLangId(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetStringDescriptorLangId:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptorLangId"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP51,
+                "EControlSetStringDescriptorLangId" );
 		r = iController->SetStringDescriptorLangId(reinterpret_cast<TUint>(a1));
 		break;
 
 	case RDevUsbcClient::EControlGetManufacturerStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetManufacturerStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP52,
+                "EControlGetManufacturerStringDescriptor" );
 		r = iController->GetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetManufacturerStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetManufacturerStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP53,
+                "EControlSetManufacturerStringDescriptor" );
 		r = iController->SetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveManufacturerStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveManufacturerStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP54,
+                "EControlRemoveManufacturerStringDescriptor" );
 		r = iController->RemoveManufacturerStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetProductStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetProductStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP55,
+                "EControlGetProductStringDescriptor" );
 		r = iController->GetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetProductStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetProductStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP56,
+                "EControlSetProductStringDescriptor" );
 		r = iController->SetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveProductStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveProductStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP57,
+                "EControlRemoveProductStringDescriptor" );
 		r = iController->RemoveProductStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetSerialNumberStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetSerialNumberStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP58,
+                "EControlGetSerialNumberStringDescriptor" );
 		r = iController->GetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetSerialNumberStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetSerialNumberStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP59,
+                "EControlSetSerialNumberStringDescriptor" );
 		r = iController->SetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveSerialNumberStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveSerialNumberStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP60,
+                "EControlRemoveSerialNumberStringDescriptor" );
 		r = iController->RemoveSerialNumberStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetConfigurationStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP61,
+                "EControlGetConfigurationStringDescriptor" );
 		r = iController->GetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetConfigurationStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP62,
+                "EControlSetConfigurationStringDescriptor" );
 		r = iController->SetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveConfigurationStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveConfigurationStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP63,
+                "EControlRemoveConfigurationStringDescriptor" );
 		r = iController->RemoveConfigurationStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP64,
+                "EControlGetStringDescriptor" );
 		r = iController->GetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlSetStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP65,
+                "EControlSetStringDescriptor" );
 		r = iController->SetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlRemoveStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveStringDescriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP66,
+                "EControlRemoveStringDescriptor" );
 		r = iController->RemoveStringDescriptor((TUint8) (TInt) a1);
 		break;
 
@@ -1689,7 +1815,8 @@
 		break;
 
     default:
-		__KTRACE_OPT(KUSB, Kern::Printf("Function code not supported"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP67,
+                "Function code not supported" );
 		r = KErrNotSupported;
 		}
 
@@ -1704,14 +1831,16 @@
 	const TInt srcLen = Kern::ThreadGetDesLength(iClient, ifc_info_buf_ptr);
 	if (srcLen < ifc_info_buf.Length())
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface can't copy"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE, 
+		        "SetInterface can't copy" );
 		PanicClientThread(EDesOverflow);
 		}
 
 	TInt r = Kern::ThreadDesRead(iClient, ifc_info_buf_ptr, ifc_info_buf, 0, KChunkShiftBy0);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Copy failed reason=%d", r));
+	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP1,
+	            "SetInterface Copy failed reason=%d", r );
 		PanicClientThread(r);
 		}
 
@@ -1720,7 +1849,8 @@
 	// If an alternate interface is being asked for then do nothing,
 	// just pass it down to the Controller.
 	const TInt num_endpoints = ifc_info_buf().iTotalEndpointsUsed;
-	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface num_endpoints=%d", num_endpoints));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP2,
+            "SetInterface num_endpoints=%d", num_endpoints );
 
 	// [The next 4 variables have to be initialized here because of the goto's that follow.]
 	// Both IN and OUT buffers will be fully cached:
@@ -1731,7 +1861,8 @@
 	TInt real_ep_numbers[6] = {-1, -1, -1, -1, -1, -1};
 
     // See if PIL will accept this interface
-	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Calling controller"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP3,
+            "SetInterface Calling controller" );
 	r = iController->SetInterface(this,
 								  iClient,
 								  aInterfaceNumber,
@@ -1742,10 +1873,12 @@
 								  &real_ep_numbers,
 								  ifc_info_buf().iFeatureWord);
 
-	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface controller returned %d", r));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP4,
+            "SetInterface controller returned %d", r );
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("SetInterface failed reason=%d", r));
+	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP5, 
+	            "SetInterface failed reason=%d", r );
 		return r;
 		}
 
@@ -1755,11 +1888,13 @@
 	// ep0
 	if (iEndpoint[0] == NULL)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface 11"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP6,
+	            "SetInterface 11" );
 		r = SetupEp0();
 		if (r != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetupEp0() failed"));
+		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP7,
+		            "  Error: SetupEp0() failed" );
 			DestroyEp0();
 			goto F1;
 			}
@@ -1772,13 +1907,15 @@
 		goto F1;
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::SetInterface num_endpoints=%d", num_endpoints));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP8,
+            "DLddUsbcChannel::SetInterface num_endpoints=%d", num_endpoints );
 
 	// other endpoints
 	// calculate the total buffer size
 	for (TInt i = 1; i <= num_endpoints; i++, pEndpointData++)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d", i));
+	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP9,
+	            "SetInterface for ep=%d", i );
 		if (!ValidateEndpoint(pEndpointData))
 			{
 			r = KErrUsbBadEndpoint;
@@ -1798,8 +1935,9 @@
 			goto F2;
 			}
 
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d rec=0x%08x ep==0x%08x",
-										i, alternateSettingListRec, ep));
+	    OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP10,
+	            "SetInterface for ep=%d rec=0x%08x ep==0x%08x", i, 
+	            reinterpret_cast<TUint>(alternateSettingListRec), reinterpret_cast<TUint>(ep) );
 		}
 
 	// buf size of each endpoint
@@ -1819,7 +1957,8 @@
 	    bufSizes[i] = alternateSettingListRec->iEndpoint[i]->BufferSize();
 	    }
 
-	__KTRACE_OPT(KUSB, Kern::Printf("Sort the endpoints:"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP11,
+            "Sort the endpoints:" );
 
     // sort the endpoint number by the bufsize decreasely
 	for( TInt i=1;i<num_endpoints;i++ )
@@ -1842,11 +1981,13 @@
 
 	    alternateSettingListRec->iEpNumDeOrderedByBufSize[i] = epNum[i];
 
-	    __KTRACE_OPT(KUSB, Kern::Printf(" %d:%d", epNum[i], bufSizes[i]));
+	    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP12,
+	            " %d:%d", epNum[i], bufSizes[i] );
 	    }
     alternateSettingListRec->iEpNumDeOrderedByBufSize[num_endpoints] = epNum[num_endpoints];
-    __KTRACE_OPT(KUSB, Kern::Printf(" %d:%d", epNum[num_endpoints], bufSizes[num_endpoints]));
-    __KTRACE_OPT(KUSB, Kern::Printf("\n"));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP13,
+            " %d:%d", epNum[num_endpoints], bufSizes[num_endpoints] );
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP14, "\n" );
 
 	// chain in this alternate setting
 	alternateSettingListRec->iNext = iAlternateSettingList;
@@ -1864,20 +2005,23 @@
 	r = SetupInterfaceMemory(iHwChunks, cacheAttribs );
 	if( r==KErrNone )
 	    {
-        __KTRACE_OPT(KUSB, Kern::Printf("SetInterface ready to exit"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP15,
+                "SetInterface ready to exit" );
     
         if (aInterfaceNumber == 0)
             {
             // make sure we're ready to go with the main interface
             iValidInterface = ETrue;
-            __KTRACE_OPT(KUSB, Kern::Printf("SetInterface SelectAlternateSetting"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP16,
+                    "SetInterface SelectAlternateSetting" );
             SelectAlternateSetting(0);
             }
         return KErrNone;
 	    }
 	else
 	    {
-        __KTRACE_OPT(KUSB, Kern::Printf("Destroying all interfaces"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP17,
+                "Destroying all interfaces" );
         DestroyAllInterfaces();
         DestroyEp0();
         return r;
@@ -1889,8 +2033,13 @@
  
  F1:
 #if _DEBUG
+#ifdef OST_TRACE_COMPILER_IN_USE
 	TInt r1 = iController->ReleaseInterface(this, aInterfaceNumber);
-	__KTRACE_OPT(KUSB, Kern::Printf("Release Interface controller returned %d", r1));
+#else
+	(void)  iController->ReleaseInterface(this, aInterfaceNumber);
+#endif
+    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP18,
+            "Release Interface controller returned %d", r1 );
 #else
 	(void)	iController->ReleaseInterface(this, aInterfaceNumber);
 #endif
@@ -1909,13 +2058,15 @@
  
     // 1, collect all bufs' sizes for the current interface
     //    to realloc all the chunks
-    __KTRACE_OPT(KUSB, Kern::Printf("Collect all buffer sizes:"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY, 
+            "Collect all buffer sizes:" );
     RArray<TInt> bufSizes;
     for(TInt i=1;i<=numOfEp;i++)
         {
         TInt nextEp = asRec->iEpNumDeOrderedByBufSize[i];
         TInt epBufCount = asRec->iEndpoint[nextEp]->BufferNumber();
-        __KTRACE_OPT(KUSB, Kern::Printf(" ep %d, buf count %d", nextEp, epBufCount ));
+        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP1,
+                " ep %d, buf count %d", nextEp, epBufCount );
         for(TInt k=0;k<epBufCount;k++)
             {
             TInt epBufSize = asRec->iEndpoint[nextEp]->BufferSize();
@@ -1926,17 +2077,20 @@
                 bufSizes.Close();
                 return r;
                 }
-            __KTRACE_OPT(KUSB,Kern::Printf(" %d", epBufSize ));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP2,
+                    " %d", epBufSize );
             }
-        __KTRACE_OPT(KUSB, Kern::Printf("\n"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP3, "\n" );
 
         }
    
     // 2, alloc the buffer decreasely, biggest-->smallest
     //   2.1 check the existing chunks
     TInt bufCount = bufSizes.Count();
-    __KTRACE_OPT(KUSB, Kern::Printf(" ep buf number needed %d", bufCount ));
-    __KTRACE_OPT(KUSB, Kern::Printf(" chunks available %d", aHwChunks.Count() ));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP4,
+            " ep buf number needed %d", bufCount );
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP5,
+            " chunks available %d", aHwChunks.Count() );
 
     TInt chunkInd = 0;
     while( (chunkInd<aHwChunks.Count())&& (chunkInd<bufCount))
@@ -1947,7 +2101,8 @@
         DPlatChunkHw* chunk = ReAllocate(bufSizes[chunkInd], aHwChunks[chunkInd], aCacheAttribs);
         if (chunk == NULL)
             {
-            __KTRACE_OPT(KUSB, Kern::Printf("Failed to alloc chunks size %d!", bufSizes[chunkInd]));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP6,
+                    "Failed to alloc chunks size %d!", bufSizes[chunkInd] );
             // lost all interfaces:
             // Tell Controller to release Interface and h/w resources associated with this
             iController->DeRegisterClient(this);
@@ -1958,7 +2113,9 @@
             {
             // Parcel out the memory between endpoints
             TUint8* newAddr = reinterpret_cast<TUint8*>(chunk->LinearAddress());
-            __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory alloc new chunk=0x%x, size=%d", newAddr,bufSizes[chunkInd]));
+            OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP7,
+                    "SetupInterfaceMemory alloc new chunk=0x%x, size=%d", 
+                    reinterpret_cast<TUint>(newAddr), bufSizes[chunkInd] );
             // The check is important to avoid chunkChanged to be corrupted.
             // This code change is to fix the problem that one chunk is used by multiple interfaces.
             if(!chunkChanged)
@@ -1977,7 +2134,8 @@
         chunk = Allocate( bufSizes[chunkInd], aCacheAttribs);
         if (chunk == NULL)
             {
-            __KTRACE_OPT(KUSB, Kern::Printf("Failed to alloc chunk, size %d!", bufSizes[chunkInd]));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP8,
+                    "Failed to alloc chunk, size %d!", bufSizes[chunkInd] );
             // lost all interfaces:
             // Tell Controller to release Interface and h/w resources associated with this
             iController->DeRegisterClient(this);
@@ -1987,8 +2145,10 @@
         else
             {
             // Parcel out the memory between endpoints
-            __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory alloc new chunk=0x%x, size=%d",
-            						reinterpret_cast<TUint8*>(chunk->LinearAddress()), bufSizes[chunkInd]));
+            OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP9,
+                    "SetupInterfaceMemory alloc new chunk=0x%x, size=%d",
+                    static_cast<TUint>(chunk->LinearAddress()), bufSizes[chunkInd]);
+
             TInt r = aHwChunks.Append(chunk);
             if(r!=KErrNone)
                 {
@@ -2007,12 +2167,14 @@
 
     if(chunkChanged)
         {
-        __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory readdressing."));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP10,
+                "SetupInterfaceMemory readdressing." );
         asRec = asRec->iNext;
         while (asRec)
             {
             // Interfaces are not concurrent so they can all start at the same logical address
-            __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory readdressing setting=%d", asRec->iSetting));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP11,
+                    "SetupInterfaceMemory readdressing setting=%d", asRec->iSetting );
             ReSetInterfaceMemory(asRec, aHwChunks);
             asRec = asRec->iNext;
             }
@@ -2022,7 +2184,8 @@
 
 TInt DLddUsbcChannel::SetupEp0()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("SetupEp0 entry %x", this));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPEP0, 
+	        "SetupEp0 entry %x", this );
 	TInt ep0Size = iController->Ep0PacketSize();
 	TUsbcEndpointInfo ep0Info = TUsbcEndpointInfo(KUsbEpTypeControl, KUsbEpDirBidirect, ep0Size);
 	TUsbcEndpoint* ep0 = new TUsbcEndpoint(this, iController, &ep0Info, 0, 0);
@@ -2058,8 +2221,10 @@
         TUint8 * buf;
         buf = (TUint8*) chunk->LinearAddress();
         ep0->SetBufferAddr( i, buf);
-        __KTRACE_OPT(KUSB, Kern::Printf("SetupEp0 60 buffer number %d", i));
-        __KTRACE_OPT(KUSB, Kern::Printf("SetupEp0 60 buffer size %d", bufferSize));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPEP0_DUP1,
+                "SetupEp0 60 buffer number %d", i );
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPEP0_DUP2,
+                "SetupEp0 60 buffer size %d", bufferSize );
         }
 
     ep0->SetRealEpNumber(0);
@@ -2089,11 +2254,17 @@
                 TUint8* pBuf = NULL;
                 pBuf = reinterpret_cast<TUint8*>(aHwChunks[chunkInd]->LinearAddress());
                 ep->SetBufferAddr( k, pBuf);
-                __KTRACE_OPT(KUSB, Kern::Printf("  ep %d, buf %d, addr 0x%x", nextEp, k, pBuf ));
+                OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_RESETINTERFACEMEMORY,
+                        "  ep %d, buf %d, addr 0x%x", nextEp, k, reinterpret_cast<TUint>(pBuf) );
                 chunkInd++;
-                __ASSERT_DEBUG(chunkInd<=aHwChunks.Count(),
-                               Kern::Printf("  Error: available chunks %d, run out at epInd%d, bufInd%d",
-                                       aHwChunks.Count(), i, k));
+#ifdef _DEBUG
+                if (chunkInd > aHwChunks.Count())
+                    {
+                    OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP1,
+                            "  Error: available chunks %d, run out at epInd%d, bufInd%d",
+                            aHwChunks.Count(), i, k );
+                    }
+#endif
                 __ASSERT_DEBUG(chunkInd<=aHwChunks.Count(),
                                    Kern::Fault("usbc.ldd", __LINE__));
                 }
@@ -2189,7 +2360,8 @@
 
 void DLddUsbcChannel::EndpointStatusChangeCallback(TAny* aDLddUsbcChannel)
     {
-	__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK,
+            "EndpointStatusChangeCallback" );
     DLddUsbcChannel* dUsbc = (DLddUsbcChannel*) aDLddUsbcChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -2197,7 +2369,8 @@
 	const TInt reqNo = (TInt) RDevUsbcClient::ERequestEndpointStatusNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback Notify status"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1,
+	            "EndpointStatusChangeCallback Notify status" );
 		DThread* client = dUsbc->iClient;
 		
 		dUsbc->iEndpointStatusChangeReq->Data() = endpointState;
@@ -2220,7 +2393,8 @@
  		 (i < KUsbcDeviceStateRequests) && ((deviceState = dUsbc->iStatusCallbackInfo.State(i)) != EUsbcNoState);
  		 ++i)
 		{
- 		__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallBack status=%d", deviceState));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_STATUSCHANGECALLBACK, 
+		        "StatusChangeCallBack status=%d", static_cast<TInt>(deviceState) );
 		if (deviceState & KUsbAlternateSetting)
 			{
 			dUsbc->ProcessAlternateSetting(deviceState);
@@ -2250,7 +2424,8 @@
 
 void DLddUsbcChannel::OtgFeatureChangeCallback(TAny* aDLddUsbcChannel)
     {
-	__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK,
+            "OtgFeatureChangeCallback" );
     DLddUsbcChannel* dUsbc = (DLddUsbcChannel*) aDLddUsbcChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -2262,7 +2437,8 @@
     const TInt reqNo = (TInt) RDevUsbcClient::ERequestOtgFeaturesNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback Notify status"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1,
+	            "OtgFeatureChangeCallback Notify status" );
 		dUsbc->iOtgFeatureChangeReq->Data()=features;
 		dUsbc->iRequestStatus[reqNo] = NULL;
 		Kern::QueueRequestComplete(dUsbc->iClient,dUsbc->iOtgFeatureChangeReq,KErrNone);
@@ -2313,14 +2489,15 @@
 				}
 			else
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aEndpoint %d wrong for aAlternateSetting %d",
-												  aEndpoint, aAlternateSetting));
+				OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_EPFROMALTERNATESETTING,
+				        "  Error: aEndpoint %d wrong for aAlternateSetting %d", aEndpoint, aAlternateSetting );
 				return -1;
 				}
 			}
 		alternateSettingListRec = alternateSettingListRec->iNext;
 		}
-	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no aAlternateSetting %d found", aAlternateSetting));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_EPFROMALTERNATESETTING_DUP1,
+            "  Error: no aAlternateSetting %d found", aAlternateSetting );
 	return -1;
 	}
 
@@ -2328,9 +2505,12 @@
 TInt DLddUsbcChannel::ProcessAlternateSetting(TUint aAlternateSetting)
 	{
 	ResetInterface(KErrUsbInterfaceChange);					// kill any outstanding transfers
-	__KTRACE_OPT(KUSB, Kern::Printf("ProcessAlternateSetting 0x%08x", aAlternateSetting));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSALTERNATESETTING,
+	        "ProcessAlternateSetting 0x%08x", aAlternateSetting );
 	TUint newSetting = aAlternateSetting&(~KUsbAlternateSetting);
-	__KTRACE_OPT(KUSB, Kern::Printf("ProcessAlternateSetting selecting alternate setting 0x%08x", newSetting));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1,
+            "ProcessAlternateSetting selecting alternate setting 0x%08x", newSetting );
+
 	TInt r = SelectAlternateSetting(newSetting);
 	if (r != KErrNone)
 		return r;
@@ -2342,19 +2522,23 @@
 
 TInt DLddUsbcChannel::ProcessDeviceState(TUsbcDeviceState aDeviceState)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE,
+	        "ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState );
 	if (iDeviceState == aDeviceState)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  No state change => nothing to be done."));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP1,
+                "  No state change => nothing to be done." );
 		return KErrNone;
 		}
 	if (iDeviceState == EUsbcDeviceStateSuspended)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Coming out of Suspend: old state = %d", iOldDeviceState));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP2,
+                "  Coming out of Suspend: old state = %d", iOldDeviceState );
 		iDeviceState = iOldDeviceState;
 		if (iDeviceState == aDeviceState)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  New state same as before Suspend => nothing to be done."));
+	        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP3,
+	                "  New state same as before Suspend => nothing to be done." );
 			return KErrNone;
 			}
 		}
@@ -2363,7 +2547,8 @@
 	TInt cancellationCode = KErrNone;
 	if (aDeviceState == EUsbcDeviceStateSuspended)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Suspending..."));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP4,
+                "  Suspending..." );
 		iOldDeviceState = iDeviceState;
 		// Put PSL into low power mode here
 		}
@@ -2383,7 +2568,8 @@
 				cancellationCode = KErrUsbDeviceNotConfigured;
 			}
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  %d --> %d", iDeviceState, aDeviceState));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP5,
+            "  %d --> %d", iDeviceState, aDeviceState );
 	iDeviceState = aDeviceState;
 	if (iValidInterface || iOwnsDeviceControl)
 		{
@@ -2426,17 +2612,24 @@
 		const TInt size = iController->EndpointPacketSize(this, iEndpoint[i]->RealEpNumber());
 		if (size < 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Packet size < 0 for ep %d", i));
+			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES,
+			        "  Error: Packet size < 0 for ep %d", i );
 			continue;
 			}
 		iEndpoint[i]->SetMaxPacketSize(size);
 		}
-	__ASSERT_DEBUG(i == iNumberOfEndpoints + 1,
-				   Kern::Printf("  Error: iNumberOfEndpoints wrong (%d)", iNumberOfEndpoints));
+#ifdef _DEBUG
+	if (i != iNumberOfEndpoints + 1)
+	    {
+        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_FATAL, DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES_DUP1,
+                "  Error: iNumberOfEndpoints wrong (%d)", iNumberOfEndpoints );
+
+	    }
+#endif
 	}
 
 
-DPlatChunkHw* DLddUsbcChannel::ReAllocate(TInt aBuffersize, DPlatChunkHw* aHwChunk, TUint32 aCacheAttribs)
+DPlatChunkHw* DLddUsbcChannel::ReAllocate(TInt aBuffersize, DPlatChunkHw* aHwChunk,TUint32 aCacheAttribs)
 	{
 	DPlatChunkHw* chunk = aHwChunk;
 	if ((!chunk) || (chunk->iSize < aBuffersize))
@@ -2445,7 +2638,8 @@
 			{
 			ClosePhysicalChunk(chunk);
 			}
-		__KTRACE_OPT(KUSB, Kern::Printf("ReAllocate need to get new chunk"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_REALLOCATE, 
+		        "ReAllocate need to get new chunk" );
 		chunk = Allocate(aBuffersize, aCacheAttribs);
 		}
 	return chunk;
@@ -2511,7 +2705,8 @@
 			{
 			// Device state waiting to be sent userside
 			completeNow = ETrue;
-			__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallback Notify status"));
+			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE,
+			        "StatusChangeCallback Notify status" );
 			iStatusChangeReq->Data()=deviceState;
 			iStatusChangePtr = NULL;
 			}
@@ -2528,7 +2723,8 @@
 
 void DLddUsbcChannel::DeConfigure(TInt aErrorCode)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::DeConfigure()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DECONFIGURE,
+	        "DLddUsbcChannel::DeConfigure()" );
 	// Called after deconfiguration. Cancels transfers on all endpoints.
 	ResetInterface(aErrorCode);
 	// Cancel the endpoint status notify request if it is outstanding.
@@ -2566,7 +2762,8 @@
 		// Reset each endpoint except ep0
 		for (TInt i = 1; i <= iNumberOfEndpoints; i++)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("Cancelling transfer ep=%d", i));
+			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_RESETINTERFACE,
+			        "Cancelling transfer ep=%d", i );
 			iEndpoint[i]->CancelTransfer(iClient,iClientAsynchNotify[i]->iClientBuffer);			// Copies data userside
 			iEndpoint[i]->AbortTransfer();					// kills any ldd->pil outstanding transfers
 			iEndpoint[i]->iDmaBuffers->Flush();
@@ -2611,14 +2808,16 @@
 
 TInt DLddUsbcChannel::DoEmergencyComplete()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::DoEmergencyComplete"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE,
+	        "TUsbcEndpoint::DoEmergencyComplete" );
 	// cancel any pending DFCs
 	// complete all client requests
     for (TInt i = 0; i < KUsbcMaxRequests; i++)
         {
         if (iRequestStatus[i])
             {
-            __KTRACE_OPT(KUSB, Kern::Printf("Complete request 0x%x", iRequestStatus[i]));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE_DUP1,
+                    "Complete request 0x%x", iRequestStatus[i] );
 
             if (i == RDevUsbcClient::ERequestAlternateDeviceStatusNotify)
                 {
@@ -2724,7 +2923,8 @@
 	  iBandwidthPriority(aBandwidthPriority)
 	{
  	ResetTransferInfo();
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::TUsbcEndpoint 2"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINT_TUSBCENDPOINT_CONS, 
+	        "TUsbcEndpoint::TUsbcEndpoint 2" );
 	}
 
 
@@ -2756,7 +2956,8 @@
 
 TUsbcEndpoint::~TUsbcEndpoint()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::~TUsbcEndpoint(%d)", iEndpointNumber));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINT_TUSBCENDPOINT_DES, 
+	        "TUsbcEndpoint::~TUsbcEndpoint(%d)", iEndpointNumber );
 	AbortTransfer();
 	delete iRequestCallbackInfo;
 	delete iDmaBuffers;
@@ -2765,7 +2966,8 @@
 
 void TUsbcEndpoint::RequestCallback(TAny* aTUsbcEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::RequestCallback"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_REQUESTCALLBACK, 
+	        "TUsbcEndpoint::RequestCallback" );
 	((TUsbcEndpoint*) aTUsbcEndpoint)->EndpointComplete();
 	}
 
@@ -2779,12 +2981,13 @@
 
 TInt TUsbcEndpoint::EndpointComplete()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::EndpointComplete ep=%d %d",
-									iEndpointNumber, iRequestCallbackInfo->iEndpointNum));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE, 
+            "TUsbcEndpoint::EndpointComplete ep=%d %d", iEndpointNumber, iRequestCallbackInfo->iEndpointNum );
 
 	if (iLdd->ChannelClosing())
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("We're going home -> completions no longer accepted"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP1,
+	            "We're going home -> completions no longer accepted" );
 		return KErrNone;
 		}
 
@@ -2796,10 +2999,12 @@
 
 	case EControllerWrite:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::EndpointComplete Write 2"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP2,
+                "TUsbcEndpoint::EndpointComplete Write 2" );
 		if (!iDmaBuffers->TxIsActive())
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  TX completion but !iDmaBuffers->TxIsActive()"));
+	        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP3,
+	                "  TX completion but !iDmaBuffers->TxIsActive()" );
 			break;
 			}
 
@@ -2855,8 +3060,10 @@
 		if (iClientReadPending)
 			{
 			//Complete outstanding read
-			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::EndpointComplete Read 3 (bytes "
-											"available=%d)", iDmaBuffers->RxBytesAvailable()));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP4,
+                    "TUsbcEndpoint::EndpointComplete Read 3 (bytes available=%d)", 
+                    iDmaBuffers->RxBytesAvailable());
+
 			TInt bytesReqd = iTransferInfo.iTransferSize - iBytesTransferred;
 			TBool completeNow = EFalse;
 
@@ -2957,7 +3164,8 @@
 	const TBool KReadData = EFalse;
 	const TBool KReadUntilShort = ETrue;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("CopyToClient: length = %d", length));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_COPYTOCLIENT, 
+            "CopyToClient: length = %d", length );
 
 	if (iTransferInfo.iTransferType == ETransferTypeReadPacket)
 		{
@@ -2993,13 +3201,15 @@
 
 TInt TUsbcEndpoint::TryToStartRead(TBool aReEntrant)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead 1 ep=%d", iEndpointNumber));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD,
+	        "TryToStartRead 1 ep=%d", iEndpointNumber );
 	TInt r = KErrNone;
 	if (iEndpointInfo.iDir != KUsbEpDirOut &&
 		iEndpointInfo.iDir != KUsbEpDirBidirect)
 		{
 		// Verify ep direction
-		__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead wrong direction ep=%d", iEndpointNumber));
+		  OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP1,
+		          "TryToStartRead wrong direction ep=%d", iEndpointNumber );
 		return KErrUsbEpBadDirection;
 		}
 
@@ -3008,12 +3218,15 @@
 		// Can't issue an Ep0 read if reader or writer is active
 		if (iDmaBuffers->TxIsActive())
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead ep0 Tx already active FATAL"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP2,
+                    "TryToStartRead ep0 Tx already active FATAL" );
+
 			return KErrUsbEpNotReady;
 			}
 		if (iDmaBuffers->RxIsActive())
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead ep0 Rx already active non-FATAL"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP3,
+                    "TryToStartRead ep0 Rx already active non-FATAL" );
 			}
 		}
 
@@ -3029,14 +3242,15 @@
 			{
 			iDmaBuffers->RxSetActive();
 			iRequestCallbackInfo->SetRxBufferInfo(bufferAddr, physAddr, indexArray, sizeArray, length);
-
-			__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead 2 bufferAddr=0x%08x", bufferAddr));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP4,
+                    "TryToStartRead 2 bufferAddr=0x%08x", bufferAddr );
 
 			r = iController->SetupReadBuffer(*iRequestCallbackInfo);
 			if (r != KErrNone)
 				{
 				iDmaBuffers->RxSetInActive();
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: TryToStartRead controller rejects read"));
+	            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP5,
+	                    "  Error: TryToStartRead controller rejects read" );
 				}
 			}
 		else
@@ -3062,7 +3276,8 @@
 
 TInt TUsbcEndpoint::TryToStartWrite(TEndpointTransferInfo* pTfr)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TryToStartWrite 1 ep=%d", iEndpointNumber));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTWRITE,
+	        "TryToStartWrite 1 ep=%d", iEndpointNumber );
 	if (iEndpointInfo.iDir != KUsbEpDirIn &&
 		iEndpointInfo.iDir != KUsbEpDirBidirect)
 		{
@@ -3091,14 +3306,16 @@
 
 TInt TUsbcEndpoint::ContinueWrite()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("ContinueWrite 2"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CONTINUEWRITE, "ContinueWrite 2" );
 	TUint8* bufferAddr;
 	TPhysAddr physAddr;
 	TInt bufferLength;
 	TInt r = iDmaBuffers->TxGetNextXfer(bufferAddr, bufferLength, physAddr);
 	if (r != KErrNone)											// probably already active
 		return r;
-	__KTRACE_OPT(KUSB, Kern::Printf("ContinueWrite 3"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CONTINUEWRITE_DUP1,
+            "ContinueWrite 3" );
+
 	iDmaBuffers->TxSetActive();
 	TBool zlpReqd = EFalse;
 	TUint32 transferSize = iTransferInfo.iTransferSize;
@@ -3117,7 +3334,9 @@
 #if 0
 	for (TInt i = 0; i < iRequestCallbackInfo->iLength; i++)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Buffer[%d] = 0x%02x", i, iRequestCallbackInfo->iBufferStart[i]));
+	    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CONTINUEWRITE_DUP2,
+	            "Buffer[%d] = 0x%02x", i, iRequestCallbackInfo->iBufferStart[i] );
+
 		}
 #endif
 	r = iController->SetupWriteBuffer(*iRequestCallbackInfo);
@@ -3127,19 +3346,21 @@
 
 void TUsbcEndpoint::CancelTransfer(DThread* aThread, TClientBuffer *aTcb)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("CancelTransfer"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CANCELTRANSFER, "CancelTransfer" );
 	if (iDmaBuffers != NULL)
 		{
 		if (iClientWritePending)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientWritePending)"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CANCELTRANSFER_DUP1,
+                    "  (iClientWritePending)" );
 			iClientWritePending = EFalse;
 			iController->CancelWriteBuffer(iLdd, iRealEpNumber);
 			iDmaBuffers->TxSetInActive();
 			}
 		if (iClientReadPending)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientReadPending)"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CANCELTRANSFER_DUP2,
+                    "  (iClientReadPending)" );
 			iClientReadPending = EFalse;
 			CopyToClient(aThread,aTcb);
 			}
@@ -3149,18 +3370,20 @@
 
 void TUsbcEndpoint::AbortTransfer()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("Abort Transfer"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ABORTTRANSFER, "Abort Transfer" );
 	if (iDmaBuffers != NULL)
 		{
 		if (iDmaBuffers->TxIsActive())
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientWritePending)"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ABORTTRANSFER_DUP1,
+                    "  (iClientWritePending)" );
 			iController->CancelWriteBuffer(iLdd, iRealEpNumber);
 			iDmaBuffers->TxSetInActive();
 			}
 		if (iDmaBuffers->RxIsActive())
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientReadPending)"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ABORTTRANSFER_DUP2,
+                    "  (iClientReadPending)" );
 			iController->CancelReadBuffer(iLdd, iRealEpNumber);
 			iDmaBuffers->RxSetInActive();
 			}
@@ -3184,7 +3407,8 @@
 
 TUsbcAlternateSettingList::~TUsbcAlternateSettingList()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAlternateSettingList::~TUsbcAlternateSettingList()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST_DES,
+	        "TUsbcAlternateSettingList::~TUsbcAlternateSettingList()" );
 	for (TInt i = 0; i <= KMaxEndpointsPerClient; i++)
 		{
 		delete iEndpoint[i];
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/usbc/traces/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+// #define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/usbc/traces/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,442 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP43=0x24
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP47=0x25
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP15=0x20
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP17=0x21
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP19=0x22
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP2=0x1d
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP20=0x23
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP3=0x1e
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP8=0x1f
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING=0x27
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING_DUP1=0x28
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_SETINTERFACE_DUP7=0x26
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES=0x29
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES_DUP1=0x2a
+[TRACE]TRACE_FATAL[0x81]_DUSBCLOGDEVICE_INSTALL=0x1c
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS=0x7
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES=0x8
+[TRACE]TRACE_FLOW[0x8A]_TDMABUF_TDMABUF_DES=0x6
+[TRACE]TRACE_FLOW[0x8A]_TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST_DES=0xb
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_CONS=0x9
+[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_DES=0xa
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE=0x16d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DECONFIGURE=0x16e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL=0xf3
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP1=0xf4
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP2=0xf5
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP3=0xf6
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP4=0xf7
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP5=0xf8
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP6=0xf9
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL=0xfa
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP1=0xfb
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP10=0x104
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP11=0x105
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP12=0x106
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP13=0x107
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP14=0x108
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP15=0x109
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP16=0x10a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP17=0x10b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP18=0x10c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP19=0x10d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP2=0xfc
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP20=0x10e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP21=0x10f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP22=0x110
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP23=0x111
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP24=0x112
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP25=0x113
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP26=0x114
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP27=0x115
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP28=0x116
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP29=0x117
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP3=0xfd
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP30=0x118
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP31=0x119
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP32=0x11a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP33=0x11b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP34=0x11c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP35=0x11d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP36=0x11e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP37=0x11f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP38=0x120
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP39=0x121
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP4=0xfe
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP40=0x122
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP41=0x123
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP42=0x124
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP44=0x125
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP45=0x126
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP46=0x127
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP48=0x128
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP49=0x129
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP5=0xff
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP50=0x12a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP51=0x12b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP52=0x12c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP53=0x12d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP54=0x12e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP55=0x12f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP56=0x130
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP57=0x131
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP58=0x132
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP59=0x133
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP6=0x100
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP60=0x134
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP61=0x135
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP62=0x136
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP63=0x137
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP64=0x138
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP65=0x139
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP66=0x13a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP67=0x13b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP7=0x101
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP8=0x102
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP9=0x103
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCREATE=0xde
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE=0x170
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE_DUP1=0x171
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ=0xe1
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP1=0xe2
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP2=0xe3
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP3=0xe4
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOREQUEST=0xe0
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ=0xe5
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP1=0xe6
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP10=0xec
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP11=0xed
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP12=0xee
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP13=0xef
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP14=0xf0
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP16=0xf1
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP18=0xf2
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP4=0xe7
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP5=0xe8
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP6=0xe9
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP7=0xea
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP9=0xeb
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK=0x15f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1=0x160
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK=0x162
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1=0x163
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING=0x164
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1=0x165
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE=0x166
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP1=0x167
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP2=0x168
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP3=0x169
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP4=0x16a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP5=0x16b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REALLOCATE=0x16c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REQUESTUSERHANDLE=0xdf
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACE=0x16f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY=0x15d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP1=0x15e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE=0x13c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP1=0x13d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP10=0x145
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP11=0x146
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP12=0x147
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP13=0x148
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP14=0x149
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP15=0x14a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP16=0x14b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP17=0x14c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP18=0x14d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP2=0x13e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP3=0x13f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP4=0x140
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP5=0x141
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP6=0x142
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP8=0x143
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP9=0x144
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0=0x15a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP1=0x15b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP2=0x15c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY=0x14e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP1=0x14f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP10=0x158
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP11=0x159
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP2=0x150
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP3=0x151
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP4=0x152
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP5=0x153
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP6=0x154
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP7=0x155
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP8=0x156
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP9=0x157
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_STATUSCHANGECALLBACK=0x161
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_ADDTODRAINQUEUE=0xd9
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT=0xdd
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT_DUP1=0xb9
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT_DUP2=0xbb
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_FLUSH=0xbd
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_ISREADEREMPTY=0xc0
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_NEXTDRAINABLEBUFFER=0xd7
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_READXFERCOMPLETE=0xc1
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT=0xce
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP1=0xcf
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP2=0xd0
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP3=0xd1
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP4=0xd2
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP5=0xd3
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP6=0xd4
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP7=0xd5
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP8=0xd6
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT=0xc6
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP1=0xc7
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP2=0xc8
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP3=0xc9
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP4=0xcb
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP5=0xcc
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP6=0xcd
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER=0xc2
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER_DUP1=0xc3
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER_DUP2=0xc4
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER_DUP3=0xc5
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXSETACTIVE=0xbe
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXSETINACTIVE=0xbf
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_SETBUFFERADDR=0xbc
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_SHORTPACKETEXISTS=0xd8
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_TXSTOREDATA=0xda
+[TRACE]TRACE_NORMAL[0x86]_TDMABUF_TXSTOREDATA_DUP1=0xdb
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER=0x186
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP1=0x187
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP2=0x188
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER=0x183
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP1=0x184
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP2=0x185
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE=0x180
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP1=0x181
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP2=0x182
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_COPYTOCLIENT=0x178
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE=0x173
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP1=0x174
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP2=0x175
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP3=0x176
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP4=0x177
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_REQUESTCALLBACK=0x172
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD=0x179
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP1=0x17a
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP2=0x17b
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP3=0x17c
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP4=0x17d
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP5=0x17e
+[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTWRITE=0x17f
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL=0xb
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP1=0xc
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP2=0xd
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP3=0xe
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP4=0xf
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP5=0x10
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP6=0x11
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP43=0x12
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP47=0x13
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP15=0x5
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP17=0x6
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP19=0x9
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP2=0x2
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP20=0xa
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP3=0x3
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP8=0x4
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING=0x15
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING_DUP1=0x16
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING=0x17
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1=0x18
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE=0x19
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_SETINTERFACE_DUP7=0x14
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES=0x1a
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES_DUP1=0x1b
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DUSBCLOGDEVICE_INSTALL=0x1
+[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS=0x1
+[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES=0x2
+[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST_DES=0x5
+[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_CONS=0x3
+[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_DES=0x4
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE=0x98
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DECONFIGURE=0x99
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL=0x1
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS=0x3
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES=0x4
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL=0x1a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP1=0x1b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP2=0x1c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP3=0x1d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP4=0x1e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP5=0x1f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP6=0x20
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL=0x21
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP1=0x22
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP10=0x2b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP11=0x2c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP12=0x2d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP13=0x2e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP14=0x2f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP15=0x30
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP16=0x31
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP17=0x32
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP18=0x33
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP19=0x34
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP2=0x23
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP20=0x35
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP21=0x36
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP22=0x37
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP23=0x38
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP24=0x39
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP25=0x3a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP26=0x3b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP27=0x3c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP28=0x3d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP29=0x3e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP3=0x24
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP30=0x3f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP31=0x40
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP32=0x41
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP33=0x42
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP34=0x43
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP35=0x44
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP36=0x45
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP37=0x46
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP38=0x47
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP39=0x48
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP4=0x25
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP40=0x49
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP41=0x4a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP42=0x4b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP44=0x4c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP45=0x4d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP46=0x4e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP48=0x4f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP49=0x50
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP5=0x26
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP50=0x51
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP51=0x52
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP52=0x53
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP53=0x54
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP54=0x55
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP55=0x56
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP56=0x57
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP57=0x58
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP58=0x59
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP59=0x5a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP6=0x27
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP60=0x5b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP61=0x5c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP62=0x5d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP63=0x5e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP64=0x5f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP65=0x60
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP66=0x61
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP67=0x62
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP7=0x28
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP8=0x29
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP9=0x2a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCREATE=0x5
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE=0x9b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE_DUP1=0x9c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ=0x8
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP1=0x9
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP2=0xa
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP3=0xb
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOREQUEST=0x7
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ=0xc
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP1=0xd
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP10=0x13
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP11=0x14
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP12=0x15
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP13=0x16
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP14=0x17
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP16=0x18
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP18=0x19
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP4=0xe
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP5=0xf
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP6=0x10
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP7=0x11
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP9=0x12
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK=0x8a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1=0x8b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK=0x8d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1=0x8e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING=0x8f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1=0x90
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE=0x91
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP1=0x92
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP2=0x93
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP3=0x94
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP4=0x95
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP5=0x96
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REALLOCATE=0x97
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REQUESTUSERHANDLE=0x6
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACE=0x9a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY=0x88
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP1=0x87
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP2=0x89
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE=0x63
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP1=0x64
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP10=0x75
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP11=0x6d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP12=0x6e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP13=0x6f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP14=0x70
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP15=0x71
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP16=0x72
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP17=0x73
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP18=0x74
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP2=0x65
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP3=0x66
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP4=0x67
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP5=0x68
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP6=0x69
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP8=0x6a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP9=0x6b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0=0x83
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP1=0x84
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP2=0x85
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY=0x76
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP1=0x77
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP10=0x81
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP11=0x82
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP2=0x78
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP3=0x79
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP4=0x7a
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP5=0x7b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP6=0x7c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP7=0x7d
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP8=0x7e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP9=0x80
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_STATUSCHANGECALLBACK=0x8c
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DUP1_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL=0x2
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DUP1_TUSBCENDPOINT_TUSBCENDPOINT=0x9e
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT=0xdc
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP4=0xca
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TDMABUF_TDMABUF_DES=0xba
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST=0xb6
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER=0xb3
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP1=0xb4
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP2=0xb5
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER=0xb0
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP1=0xb1
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP2=0xb2
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE=0xad
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP1=0xae
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP2=0xaf
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_COPYTOCLIENT=0xa5
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE=0xa0
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP1=0xa1
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP2=0xa4
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP3=0xa2
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP4=0xa3
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_REQUESTCALLBACK=0x9f
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD=0xa6
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP1=0xa7
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP2=0xa8
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP3=0xa9
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP4=0xaa
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP5=0xab
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTWRITE=0xac
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TUSBCENDPOINT=0x9d
--- a/kernel/eka/drivers/usbc/usbc.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbc/usbc.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -18,6 +18,7 @@
 #include "../../kernel/kern_ext.mmh"
 
 USERINCLUDE	../../include/drivers
+USERINCLUDE    traces
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 target			usbc.ldd
--- a/kernel/eka/drivers/usbc/usbdma.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbc/usbdma.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -23,6 +23,11 @@
 */
 
 #include <drivers/usbc.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "usbdmaTraces.h"
+#endif
+
 
 
 #if defined(_DEBUG)
@@ -102,20 +107,25 @@
 		// At most 2 packets (clump of max packet size packets) + possible zlp
 		TUsbcPacketArray* bufPtr = iPacketInfoStorage;
 		// this divides up the packet indexing & packet size array over the number of buffers
-		__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Construct() array base=0x%08x", bufPtr));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_CONSTRUCT,
+		        "TDmaBuf::Construct() array base=0x%08x", bufPtr );
 		for (TInt i = 0; i < iNumberofBuffers; i++)
 			{
 			iPacketIndex[i] = bufPtr;
 			bufPtr += KUsbcDmaBufMaxPkts;
 			iPacketSize[i] = bufPtr;
 			bufPtr += KUsbcDmaBufMaxPkts;
-			__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Construct() packetIndex[%d]=0x%08x packetSize[%d]=0x%08x",
-											i, iPacketIndex[i], i, iPacketSize[i]));
+            OstTraceDefExt4( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_CONSTRUCT_DUP1,
+                    "TDmaBuf::Construct() packetIndex[%d]=0x%08x packetSize[%d]=0x%08x",
+                    i, reinterpret_cast<TUint>(iPacketIndex[i]), i, 
+                    reinterpret_cast<TUint>(iPacketSize[i]) );
+
 			}
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Construct() IN endpoint"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_CONSTRUCT_DUP2,
+                "TDmaBuf::Construct() IN endpoint" );
 		}
 	Flush();
 	return KErrNone;
@@ -124,7 +134,7 @@
 
 TDmaBuf::~TDmaBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::~TDmaBuf()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TDMABUF_TDMABUF_DES, "TDmaBuf::~TDmaBuf()" );
 	}
 
 TInt TDmaBuf::BufferTotalSize() const
@@ -144,7 +154,9 @@
     iDrainable[aBufInd] = iCanBeFreed[aBufInd] = EFalse;
     iBuffers[aBufInd] = aBufAddr;
     iBufferPhys[aBufInd] = Epoc::LinearToPhysical((TLinAddr)aBufAddr);
-    __KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::SetBufferAddr() iBuffers[%d]=0x%08x", aBufInd, iBuffers[aBufInd]));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_SETBUFFERADDR,
+            "TDmaBuf::SetBufferAddr() iBuffers[%d]=0x%08x", aBufInd, 
+            reinterpret_cast<TUint>(iBuffers[aBufInd]) );
     return KErrNone;
     }
 
@@ -161,7 +173,8 @@
 
 void TDmaBuf::Flush()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Flush %x", this));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_FLUSH,
+	        "TDmaBuf::Flush %x", this );
 	iRxActive = EFalse;
 	iTxActive = EFalse;
 	iExtractOffset = 0;
@@ -196,14 +209,16 @@
 
 void TDmaBuf::RxSetActive()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxSetActive %x", this));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXSETACTIVE, 
+	        "TDmaBuf::RxSetActive %x", this );
 	iRxActive = ETrue;
 	}
 
 
 void TDmaBuf::RxSetInActive()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxSetInActive %x", this));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXSETINACTIVE, 
+	        "TDmaBuf::RxSetInActive %x", this );
 	iRxActive = EFalse;
 	}
 
@@ -314,8 +329,8 @@
 // used to decide whether a client read can complete straight away
 TBool TDmaBuf::IsReaderEmpty()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::IsReaderEmpty iTotalRxPacketsAvail=%d",
-									iTotalRxPacketsAvail));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_ISREADEREMPTY, 
+	        "TDmaBuf::IsReaderEmpty iTotalRxPacketsAvail=%d", iTotalRxPacketsAvail);
 	return (iTotalRxPacketsAvail == 0);
 	}
 
@@ -340,8 +355,8 @@
 	iNumberofPacketsRxRemain[iCurrentFillingBufferIndex] = aNoPacketsRecv;
 #endif
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::ReadXferComplete 2 # of bytes=%d # of packets=%d",
-									iTotalRxBytesAvail, iTotalRxPacketsAvail));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_READXFERCOMPLETE,
+	        "TDmaBuf::ReadXferComplete 2 # of bytes=%d # of packets=%d", iTotalRxBytesAvail, iTotalRxPacketsAvail );
 	iDrainable[iCurrentFillingBufferIndex] = ETrue;
 	iError[iCurrentFillingBufferIndex] = aErrorCode;
 	AddToDrainQueue(iCurrentFillingBufferIndex);
@@ -355,15 +370,17 @@
 TInt TDmaBuf::RxGetNextXfer(TUint8*& aBufferAddr, TUsbcPacketArray*& aIndexArray,
 							TUsbcPacketArray*& aSizeArray, TInt& aLength, TPhysAddr& aBufferPhys)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxGetNextXfer 1"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER,
+	        "TDmaBuf::RxGetNextXfer 1" );
 	if (RxIsActive())
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf(" ---> RxIsActive, returning"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER_DUP1,
+                " ---> RxIsActive, returning" );
 		return KErrInUse;
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxGetNextXfer Current buffer=%d",
-									iCurrentFillingBufferIndex));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER_DUP2,
+            "TDmaBuf::RxGetNextXfer Current buffer=%d", iCurrentFillingBufferIndex );
 	if (iDrainable[iCurrentFillingBufferIndex])
 		{
 		// If the controller refused the last read request, then the current buffer will still be marked
@@ -375,8 +392,8 @@
 			}
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxGetNextXfer New buffer=%d",
-									iCurrentFillingBufferIndex));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER_DUP3,
+            "TDmaBuf::RxGetNextXfer New buffer=%d", iCurrentFillingBufferIndex );
 	aBufferAddr = iBuffers[iCurrentFillingBufferIndex];
 	aBufferPhys = iBufferPhys[iCurrentFillingBufferIndex];
 	aIndexArray = iPacketIndex[iCurrentFillingBufferIndex];
@@ -393,7 +410,8 @@
 
 TInt TDmaBuf::RxCopyPacketToClient(DThread* aThread, TClientBuffer *aTcb, TInt aLength)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyPacketToClient 1"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT,
+            "TDmaBuf::RxCopyPacketToClient 1" );
 
 #if defined(USBC_LDD_BUFFER_TRACE)
 	const TInt numPkts = NoRxPackets();
@@ -403,25 +421,26 @@
 
 	if (numPkts != numPktsAlt)
 		{
-		Kern::Printf(
-			"TDmaBuf::RxCopyPacketToClient: Error: #pkts mismatch global=%d actual=%d",
-			numPkts, numPktsAlt);
+	    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP1,
+	            "TDmaBuf::RxCopyPacketToClient: Error: #pkts mismatch global=%d actual=%d",
+	            numPkts, numPktsAlt);
 		}
 	if (numBytes != numBytesAlt)
 		{
-		Kern::Printf(
-			"TDmaBuf::RxCopyPacketToClient: Error: #bytes mismatch global=%d actual=%d",
-			numBytes, numBytesAlt);
+        OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP2,
+                "TDmaBuf::RxCopyPacketToClient: Error: #bytes mismatch global=%d actual=%d",
+                numBytes, numBytesAlt);
+
 		}
 	if ((numPkts == 0) && (numBytes !=0))
 		{
-		Kern::Printf(
+    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP3,
 			"TDmaBuf::RxCopyPacketToClient: Error: global bytes & pkts mismatch pkts=%d bytes=%d",
 			numPkts, numBytes);
 		}
 	if ((numPktsAlt == 0) && (numBytesAlt !=0))
 		{
-		Kern::Printf(
+    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP4,
 			"TDmaBuf::RxCopyPacketToClient: Error: actual bytes & pkts mismatch pkts=%d bytes=%d",
 			numPktsAlt, numBytesAlt);
 		}
@@ -430,7 +449,8 @@
 	if (!NoRxPackets())
 		return KErrNotFound;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyPacketToClient 2"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP5,
+            "TDmaBuf::RxCopyPacketToClient 2" );
 	// the next condition should be true because we have some packets available
 	// coverity[var_tested_neg]
 	if (iCurrentDrainingBufferIndex == KUsbcInvalidBufferIndex)
@@ -504,7 +524,9 @@
 		{
 		r = errorCode;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyPacketToClient 3"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP6,
+            "TDmaBuf::RxCopyPacketToClient 3" );
+
 
 	FreeDrainedBuffers();
 
@@ -516,7 +538,8 @@
 TInt TDmaBuf::RxCopyDataToClient(DThread* aThread, TClientBuffer *aTcb, TInt aLength, TUint32& aDestOffset,
 								 TBool aRUS, TBool& aCompleteNow)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyDataToClient 1"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT,
+	        "TDmaBuf::RxCopyDataToClient 1" );
 	aCompleteNow = ETrue;
 
 #if defined(USBC_LDD_BUFFER_TRACE)
@@ -527,25 +550,25 @@
 
 	if (numPkts != numPktsAlt)
 		{
-		Kern::Printf(
+    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP1,
 			"TDmaBuf::RxCopyDataToClient: Error: #pkts mismatch global=%d actual=%d",
 			numPkts, numPktsAlt);
 		}
 	if (numBytes != numBytesAlt)
 		{
-		Kern::Printf(
+    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP2,
 			"TDmaBuf::RxCopyDataToClient: Error: #bytes mismatch global=%d actual=%d",
 			numBytes, numBytesAlt);
 		}
 	if ((numPkts == 0) && (numBytes != 0))
 		{
-		Kern::Printf(
+    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP3,
 			"TDmaBuf::RxCopyDataToClient: Error: global bytes & pkts mismatch pkts=%d bytes=%d",
 			numPkts, numBytes);
 		}
 	if ((numPktsAlt == 0) && (numBytesAlt != 0))
 		{
-		Kern::Printf(
+    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP4,
 			"TDmaBuf::RxCopyDataToClient: Error: actual bytes & pkts mismatch pkts=%d bytes=%d",
 			numPktsAlt, numBytesAlt);
 		}
@@ -566,8 +589,9 @@
 		if (!NextDrainableBuffer())
 			{
 #if defined(USBC_LDD_BUFFER_TRACE)
-			Kern::Printf("TDmaBuf::RxCopyDataToClient: Error:  No buffer draining=%d, packets=%d",
-						 iCurrentDrainingBufferIndex, iTotalRxPacketsAvail);
+            OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP5,
+                    "TDmaBuf::RxCopyDataToClient: Error:  No buffer draining=%d, packets=%d",
+				    iCurrentDrainingBufferIndex, iTotalRxPacketsAvail);
 #endif
 			return KErrNotFound;
 			}
@@ -579,11 +603,13 @@
 		
 	if (iDrainingOrder != iFillingOrderArray[iCurrentDrainingBufferIndex])
 		{
-		Kern::Printf("!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 10 draining=%d",
-					 iCurrentDrainingBufferIndex);
+        OstTrace1( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP6,
+		        "!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 10 draining=%d",
+			    iCurrentDrainingBufferIndex);
 		}
 #endif
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyDataToClient 2"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP7,
+            "TDmaBuf::RxCopyDataToClient 2" );
 
 	TUint8* blockStartAddr = iCurrentDrainingBuffer + iCurrentPacketIndexArray[iCurrentPacket] + iExtractOffset;
 	TUint8* lastEndAddr = blockStartAddr;					// going to track the contiguity of the memory
@@ -603,8 +629,9 @@
 			bufnum = iCurrentDrainingBufferIndex;
 			if (iDrainingOrder != iFillingOrderArray[iCurrentDrainingBufferIndex])
 				{
-				Kern::Printf("!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 20 draining=%d",
-							 iCurrentDrainingBufferIndex);
+                OstTrace1( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP8,
+				        "!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 20 draining=%d",
+					    iCurrentDrainingBufferIndex);
 				}
 			}
 #endif
@@ -735,9 +762,9 @@
 		TUint& pktsRemain = iNumberofPacketsRxRemain[iCurrentDrainingBufferIndex];
 		if ((bytesRemain != 0) || (pktsRemain != 0))
 			{
-			Kern::Printf(
-				"TDmaBuf::NextDrainableBuffer: Error: data discarded buffer=%d pkts=%d bytes=%d",
-				iCurrentDrainingBufferIndex, pktsRemain, bytesRemain);
+			OstTraceExt3( TRACE_NORMAL, TDMABUF_NEXTDRAINABLEBUFFER,
+				    "TDmaBuf::NextDrainableBuffer: Error: data discarded buffer=%d pkts=%d bytes=%d",
+				    iCurrentDrainingBufferIndex, pktsRemain, bytesRemain);
 			bytesRemain = 0;
 			pktsRemain = 0;
 			}
@@ -819,7 +846,8 @@
 TBool TDmaBuf::ShortPacketExists()
 	{
 	// Actually, a short packet or residue data
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::ShortPacketExists 1"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_SHORTPACKETEXISTS,
+	        "TDmaBuf::ShortPacketExists 1" );
 	TInt index = iCurrentDrainingBufferIndex;
 	TUsbcPacketArray* pktSizeArray = iCurrentPacketSizeArray;
 
@@ -898,7 +926,7 @@
 	if (iDrainQueue[iDrainQueueIndex + 1] != KUsbcInvalidBufferIndex)
 		{
 #if defined(USBC_LDD_BUFFER_TRACE)
-		Kern::Printf("TDmaBuf::AddToDrainQueue: Error: invalid iDrainQueue[x]");
+		OstTrace0( TRACE_NORMAL, TDMABUF_ADDTODRAINQUEUE, "TDmaBuf::AddToDrainQueue: Error: invalid iDrainQueue[x]" );
 #endif
 		}
 	iDrainQueue[++iDrainQueueIndex] = aBufferIndex;
@@ -938,12 +966,13 @@
 // We only store 1 transaction, no other buffering is done
 TInt TDmaBuf::TxStoreData(DThread* aThread, TClientBuffer *aTcb, TInt aTxLength, TUint32 aBufferOffset)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::TxStoreData 1"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_TXSTOREDATA,
+	        "TDmaBuf::TxStoreData 1" );
 	if (!IsReaderEmpty())
 		return KErrInUse;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::TxStoreData 2"));
-	
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_TXSTOREDATA_DUP1,
+	        "TDmaBuf::TxStoreData 2" );
 	TInt remainTxLength = aTxLength;
 	TUint32 bufferOffset = aBufferOffset;
 	// Store each buffer separately
--- a/kernel/eka/drivers/usbcc/chapter9.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcc/chapter9.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,6 +23,11 @@
 */
 
 #include <drivers/usbc.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "chapter9Traces.h"
+#endif
+
 
 
 //#define ENABLE_EXCESSIVE_DEBUG_OUTPUT
@@ -61,7 +66,8 @@
 */
 TUsbcEp0State DUsbClientController::EnquireEp0NextState(const TUint8* aSetupBuf) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnquireEp0NextState()"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE,
+            "DUsbClientController::EnquireEp0NextState()" );
 
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
@@ -69,17 +75,21 @@
 
 	if (SWAP_BYTES_16((reinterpret_cast<const TUint16*>(aSetupBuf)[3])) == 0) // iLength
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  --> EEp0StateStatusIn"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP1,
+	            "  --> EEp0StateStatusIn" );
+
 		return EEp0StateStatusIn;							// No-data Control => Status_IN
 		}
 	else if ((aSetupBuf[0] & KUsbRequestType_DirMask) == KUsbRequestType_DirToDev)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  --> EEp0StateDataOut"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP2,
+		        "  --> EEp0StateDataOut" );
 		return EEp0StateDataOut;							// Control Write => Data_OUT
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  --> EEp0StateDataIn"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP3,
+		        "  --> EEp0StateDataIn" );
 		return EEp0StateDataIn;								// Control Read => Data_IN
 		}
 	}
@@ -87,7 +97,8 @@
 
 TInt DUsbClientController::ProcessEp0ReceiveDone(TInt aCount)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0ReceiveDone()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0RECEIVEDONE,
+	        "DUsbClientController::ProcessEp0ReceiveDone()" );
 	TInt r;
 	if (iEp0DataReceiving == EFalse)
 		{
@@ -111,7 +122,8 @@
 
 TInt DUsbClientController::ProcessEp0TransmitDone(TInt aCount, TInt aError)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0TransmitDone()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE,
+	        "DUsbClientController::ProcessEp0TransmitDone()" );
 	// In any case: there's now no longer a write pending
 	iEp0WritePending = EFalse;
 	// If it was a client who set up this transmission, we report to that client
@@ -127,7 +139,8 @@
 			ProcessDataTransferDone(*p);
 			return KErrNone;
 			}
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DUsbClientController::ProcessEpTransmitDone: Stalling Ep0"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE_DUP1,
+		        "  Error: DUsbClientController::ProcessEpTransmitDone: Stalling Ep0" );
 		StallEndpoint(KEp0_In);								// request not found
 		return KErrNotFound;
 		}
@@ -135,18 +148,10 @@
 	return KErrNone;
 	}
 
-
-#define USB_PROCESS_REQUEST(request) \
-	if (Process ## request(packet) != KErrNone) \
-		{ \
-		__KTRACE_OPT(KUSB, \
-					 Kern::Printf("  ProcessEp0SetupReceived: Stalling Ep0")); \
-		StallEndpoint(KEp0_In); \
-		}
-
 TInt DUsbClientController::ProcessEp0SetupReceived(TInt aCount)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0SetupReceived()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED, 
+	        "DUsbClientController::ProcessEp0SetupReceived()" );
 
 	if (aCount > iEp0MaxPacketSize)
 		{
@@ -160,69 +165,73 @@
 
 #if defined(_DEBUG) && defined(ENABLE_EXCESSIVE_DEBUG_OUTPUT)
 	// let's see what we've got:
-	__KTRACE_OPT(KUSB, Kern::Printf("  bmRequestType = 0x%02x", packet.iRequestType));
+	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP1, 
+	        "  bmRequestType = 0x%02x", packet.iRequestType );
 	if ((packet.iRequestType & KUsbRequestType_TypeMask) == KUsbRequestType_TypeStd)
 		{
 		switch (packet.iRequest)
 			{
 		case KUsbRequest_GetStatus:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_STATUS)",
-											KUsbRequest_GetStatus));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP2, 
+		            "  bRequest      = 0x%02x (GET_STATUS)", KUsbRequest_GetStatus );
 			break;
 		case KUsbRequest_ClearFeature:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (CLEAR_FEATURE)",
-											KUsbRequest_ClearFeature));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP3, 
+		            "  bRequest      = 0x%02x (CLEAR_FEATURE)", KUsbRequest_ClearFeature );
 			break;
 		case KUsbRequest_SetFeature:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_FEATURE)",
-											KUsbRequest_SetFeature));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP4, 
+		            "  bRequest      = 0x%02x (SET_FEATURE)", KUsbRequest_SetFeature );
 			break;
 		case KUsbRequest_SetAddress:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_ADDRESS)",
-											KUsbRequest_SetAddress));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP5, 
+		            "  bRequest      = 0x%02x (SET_ADDRESS)", KUsbRequest_SetAddress );
 			break;
 		case KUsbRequest_GetDescriptor:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_DESCRIPTOR)",
-											KUsbRequest_GetDescriptor));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP6, 
+		            "  bRequest      = 0x%02x (GET_DESCRIPTOR)", KUsbRequest_GetDescriptor );
 			break;
 		case KUsbRequest_SetDescriptor:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_DESCRIPTOR)",
-											KUsbRequest_SetDescriptor));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP7, 
+		            "  bRequest      = 0x%02x (SET_DESCRIPTOR)", KUsbRequest_SetDescriptor );
 			break;
 		case KUsbRequest_GetConfig:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_CONFIGURATION)",
-											KUsbRequest_GetConfig));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP8, 
+		            "  bRequest      = 0x%02x (GET_CONFIGURATION)", KUsbRequest_GetConfig );
 			break;
 		case KUsbRequest_SetConfig:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_CONFIGURATION)",
-											KUsbRequest_SetConfig));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP9, 
+		            "  bRequest      = 0x%02x (SET_CONFIGURATION)", KUsbRequest_SetConfig );
 			break;
 		case KUsbRequest_GetInterface:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_INTERFACE)",
-											KUsbRequest_GetInterface));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP10, 
+		            "  bRequest      = 0x%02x (GET_INTERFACE)", KUsbRequest_GetInterface );
 			break;
 		case KUsbRequest_SetInterface:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_INTERFACE)",
-											KUsbRequest_SetInterface));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP11, 
+		            "  bRequest      = 0x%02x (SET_INTERFACE)", KUsbRequest_SetInterface );
 			break;
 		case KUsbRequest_SynchFrame:
-			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SYNCH_FRAME)",
-											KUsbRequest_SynchFrame));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP12, 
+		            "  bRequest      = 0x%02x (SYNCH_FRAME)", KUsbRequest_SynchFrame );
 			break;
 		default:
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bRequest = 0x%02x (UNKNWON STANDARD REQUEST)",
-											  packet.iRequest));
+		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP13, 
+		            "  Error: bRequest = 0x%02x (UNKNWON STANDARD REQUEST)", packet.iRequest );
 			break;
 			}
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (NON-STANDARD REQUEST)",
-										packet.iRequest));
+        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP14, 
+                "  bRequest      = 0x%02x (NON-STANDARD REQUEST)", packet.iRequest );
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  wValue        = 0x%04x", packet.iValue));
-	__KTRACE_OPT(KUSB, Kern::Printf("  wIndex        = 0x%04x", packet.iIndex));
-	__KTRACE_OPT(KUSB, Kern::Printf("  wLength       = 0x%04x", packet.iLength));
+	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP15, 
+	        "  wValue        = 0x%04x", packet.iValue );
+	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP16, 
+	        "  wIndex        = 0x%04x", packet.iIndex );
+	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP17, 
+	        "  wLength       = 0x%04x", packet.iLength );
 #endif // defined(_DEBUG) && defined(ENABLE_EXCESSIVE_DEBUG_OUTPUT)
 
 	// now the actual analysis
@@ -235,18 +244,34 @@
 			switch (packet.iRequestType & KUsbRequestType_DestMask)
 				{ // Recipient
 			case KUsbRequestType_DestDevice:
-				USB_PROCESS_REQUEST(GetDeviceStatus);
+			    if (ProcessGetDeviceStatus(packet) != KErrNone)
+			        {
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP18, 
+                            "ProcessEp0SetupReceived: Stalling Ep0" );
+                    StallEndpoint(KEp0_In);
+                    }
 				break;
 			case KUsbRequestType_DestIfc:
-				USB_PROCESS_REQUEST(GetInterfaceStatus);
+                if (ProcessGetInterfaceStatus(packet) != KErrNone)
+                    {
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP19, 
+                            "ProcessEp0SetupReceived: Stalling Ep0" );
+                    StallEndpoint(KEp0_In);
+                    }
 				break;
 			case KUsbRequestType_DestEp:
-				USB_PROCESS_REQUEST(GetEndpointStatus);
+                if (ProcessGetEndpointStatus(packet) != KErrNone)
+                    {
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP20, 
+                            "ProcessEp0SetupReceived: Stalling Ep0" );
+                    StallEndpoint(KEp0_In);
+                    }
 				break;
 			default:
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: GET STATUS - Other or Unknown recipient"));
-				__KTRACE_OPT(KPANIC, Kern::Printf("  -> DUsbClientController::ProcessEp0SetupReceived: "
-												  "Stalling Ep0"));
+			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP21, 
+			            "  Error: GET STATUS - Other or Unknown recipient" );
+			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP22, 
+			            "  -> DUsbClientController::ProcessEp0SetupReceived: Stalling Ep0" );
 				StallEndpoint(KEp0_In);
 				break;
 				}
@@ -256,49 +281,107 @@
 			switch (packet.iRequestType & KUsbRequestType_DestMask)
 				{ // Recipient
 			case KUsbRequestType_DestDevice:
-				USB_PROCESS_REQUEST(SetClearDevFeature);
+                if (ProcessSetClearDevFeature(packet) != KErrNone)
+                    {
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP23, 
+                            "ProcessEp0SetupReceived: Stalling Ep0" );
+                    StallEndpoint(KEp0_In);
+                    }
 				break;
 			case KUsbRequestType_DestIfc:
-				USB_PROCESS_REQUEST(SetClearIfcFeature);
+                if (ProcessSetClearIfcFeature(packet) != KErrNone)
+                    {
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP24, 
+                            "ProcessEp0SetupReceived: Stalling Ep0" );
+                    StallEndpoint(KEp0_In);
+                    }
 				break;
 			case KUsbRequestType_DestEp:
-				USB_PROCESS_REQUEST(SetClearEpFeature);
+                if (ProcessSetClearEpFeature(packet) != KErrNone)
+                    {
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP25, 
+                            "ProcessEp0SetupReceived: Stalling Ep0" );
+                    StallEndpoint(KEp0_In);
+                    }
 				break;
 			default:
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SET/CLEAR FEATURE - "
-												  "Other or Unknown recipient"));
-				__KTRACE_OPT(KPANIC, Kern::Printf("  -> Stalling Ep0"));
+			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP26, 
+			            "  Error: SET/CLEAR FEATURE - Other or Unknown recipient" );
+			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP27, 
+			            "  -> Stalling Ep0" );
 				StallEndpoint(KEp0_In);
 				break;
 				}
 			break;
 		case KUsbRequest_SetAddress:
-			USB_PROCESS_REQUEST(SetAddress);
+            if (ProcessSetAddress(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP28, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		case KUsbRequest_GetDescriptor:
-			USB_PROCESS_REQUEST(GetDescriptor);
+            if (ProcessGetDescriptor(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP29, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		case KUsbRequest_SetDescriptor:
-			USB_PROCESS_REQUEST(SetDescriptor);
+            if (ProcessSetDescriptor(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP30, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		case KUsbRequest_GetConfig:
-			USB_PROCESS_REQUEST(GetConfiguration);
+            if (ProcessGetConfiguration(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP31, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		case KUsbRequest_SetConfig:
-			USB_PROCESS_REQUEST(SetConfiguration);
+            if (ProcessSetConfiguration(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP32, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		case KUsbRequest_GetInterface:
-			USB_PROCESS_REQUEST(GetInterface);
+            if (ProcessGetInterface(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP33, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		case KUsbRequest_SetInterface:
-			USB_PROCESS_REQUEST(SetInterface);
+            if (ProcessSetInterface(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP34, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		case KUsbRequest_SynchFrame:
-			USB_PROCESS_REQUEST(SynchFrame);
+            if (ProcessSynchFrame(packet) != KErrNone)
+                {
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP35, 
+                        "ProcessEp0SetupReceived: Stalling Ep0" );
+                StallEndpoint(KEp0_In);
+                }
 			break;
 		default:
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown/unsupported Std Setup Request"));
-			__KTRACE_OPT(KPANIC, Kern::Printf("  -> Stalling Ep0"));
+		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP36, 
+		            "  Error: Unknown/unsupported Std Setup Request" );
+		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP37, 
+		            "  -> Stalling Ep0" );
 			StallEndpoint(KEp0_In);
 			break;
 			}
@@ -321,7 +404,8 @@
 		        }
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP38, 
+                        "  Error: Invalid device state" );
 				}
 			else
 				{
@@ -334,7 +418,8 @@
 					{
 					if (ifcset_ptr->CurrentInterface()->iNoEp0Requests)
 						{
-						__KTRACE_OPT(KUSB, Kern::Printf("  Recipient says: NoEp0RequestsPlease"));
+                        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP39, 
+                                "  Recipient says: NoEp0RequestsPlease" );
 						}
 					else
 						{
@@ -343,8 +428,8 @@
 					}
 				else
 					{
-					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface 0x%02x does not exist",
-													  packet.iIndex));
+                    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP40, 
+                            "  Error: Interface 0x%02x does not exist", packet.iIndex );
 					}
 				}
 	        if (NKern::CurrentContext() == EThread)
@@ -360,12 +445,13 @@
 	            }
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP41, 
+                        "  Error: Invalid device state" );
 				}
 			else if (EndpointExists(packet.iIndex) == EFalse)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint 0x%02x does not exist",
-												  packet.iIndex));
+                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP42, 
+                        "  Error: Endpoint 0x%02x does not exist", packet.iIndex );
 				}
 			else
 				{
@@ -374,7 +460,8 @@
 					iRealEndpoints[idx].iLEndpoint->iInterface->iInterfaceSet;
 				if (ifcset_ptr->CurrentInterface()->iNoEp0Requests)
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("  Recipient says: NoEp0RequestsPlease"));
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP43, 
+                            "  Recipient says: NoEp0RequestsPlease" );
 					}
 				else
 					{
@@ -387,7 +474,8 @@
                 }
 			break;
 		default:
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Other or Unknown recipient"));
+		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP44, 
+		            "  Error: Other or Unknown recipient" );
 			break;
 			}
 		if (client != NULL)
@@ -401,13 +489,15 @@
 					{
 					__ASSERT_DEBUG((p->iEndpointNum == 0), Kern::Fault(KUsbPILPanicCat, __LINE__));
 					__ASSERT_DEBUG((p->iTransferDir == EControllerRead), Kern::Fault(KUsbPILPanicCat, __LINE__));
-					__KTRACE_OPT(KUSB, Kern::Printf("  Found Ep0 read request"));
+					OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP45, 
+					        "  Found Ep0 read request" );
 					if (packet.iLength != 0)
 						{
 						if ((packet.iRequestType & KUsbRequestType_DirMask) == KUsbRequestType_DirToDev)
 							{
 							// Data transfer & direction OUT => there'll be a DATA_OUT stage
-							__KTRACE_OPT(KUSB, Kern::Printf("  Next is DATA_OUT: setting up DataOutVars"));
+                            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP46, 
+                                    "  Next is DATA_OUT: setting up DataOutVars" );
 							SetEp0DataOutVars(packet, client);
 							}
 						else if ((packet.iRequestType & KUsbRequestType_DirMask) == KUsbRequestType_DirToHost)
@@ -425,14 +515,16 @@
 					return KErrNone;
 					}
 				}
-			__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 read request not found: setting RxExtra vars (Setup)"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP47, 
+			        "  Ep0 read request not found: setting RxExtra vars (Setup)" );
 			iEp0_RxExtraCount = aCount;
 			iEp0_RxExtraData = ETrue;
 			return KErrNotFound;
 			}
 		else // if (client == NULL)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Ep0 request error: Stalling Ep0"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP48, 
+                    "  Ep0 request error: Stalling Ep0" );
 			StallEndpoint(KEp0_In);
 			return KErrGeneral;
 			}
@@ -440,18 +532,16 @@
 	return KErrNone;
 	}
 
-#undef USB_PROCESS_REQUEST
-
-
 TInt DUsbClientController::ProcessEp0DataReceived(TInt aCount)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0DataReceived()"));
-
-	__KTRACE_OPT(KUSB, Kern::Printf("  : %d bytes", aCount));
-
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED, 
+	        "DUsbClientController::ProcessEp0DataReceived()" );
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP1, 
+	        "  : %d bytes", aCount );
 	if (aCount > iEp0MaxPacketSize)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Too much data"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP2, 
+                "  Error: Too much data" );
 		aCount = iEp0MaxPacketSize;
 		}
 	iEp0DataReceived += aCount;
@@ -467,8 +557,10 @@
 			break;
 #endif
 		default:
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid request in iSetup"));
-			__KTRACE_OPT(KPANIC, Kern::Printf("  -> DUsbClientController::ProcessEp0DataReceived: Stalling Ep0"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP3, 
+                    "  Error: invalid request in iSetup" );
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP4, 
+                    "  -> DUsbClientController::ProcessEp0DataReceived: Stalling Ep0" );
 			StallEndpoint(KEp0_In);
 			ResetEp0DataOutVars();
 			break;
@@ -485,7 +577,8 @@
 				{
 				__ASSERT_DEBUG((p->iEndpointNum == 0), Kern::Fault(KUsbPILPanicCat, __LINE__));
 				__ASSERT_DEBUG((p->iTransferDir == EControllerRead), Kern::Fault(KUsbPILPanicCat, __LINE__));
-				__KTRACE_OPT(KUSB, Kern::Printf("  Found Ep0 read request"));
+	            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP5,
+	                    "  Found Ep0 read request" );
 				memcpy(p->iBufferStart, iEp0_RxBuf, aCount);
 				p->iError = KErrNone;						// if it wasn't 'KErrNone' we wouldn't be here
 				*(p->iPacketSize) = aCount;
@@ -495,7 +588,8 @@
 				goto found;
 				}
 			}
-		__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 read request not found: setting RxExtra vars (Data)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP6,
+                "  Ep0 read request not found: setting RxExtra vars (Data)" );
 		iEp0_RxExtraCount = aCount;
 		iEp0_RxExtraData = ETrue;
 		iEp0DataReceived -= aCount;
@@ -515,15 +609,18 @@
 
 TInt DUsbClientController::ProcessGetDeviceStatus(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetDeviceStatus()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS, 
+	        "DUsbClientController::ProcessGetDeviceStatus()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	const TUint16 status = ((DeviceSelfPowered() ? KUsbDevStat_SelfPowered : 0) |
 					  (iRmWakeupStatus_Enabled ? KUsbDevStat_RemoteWakeup : 0));
-	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting device status: 0x%02x", status));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP2, 
+	        "  Reporting device status: 0x%02x", status );
 	*reinterpret_cast<TUint16*>(iEp0_TxBuf) = SWAP_BYTES_16(status);
 	if (SetupEndpointZeroWrite(iEp0_TxBuf, sizeof(status)) == KErrNone)
 		{
@@ -535,19 +632,23 @@
 
 TInt DUsbClientController::ProcessGetInterfaceStatus(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetInterfaceStatus()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS, 
+	        "DUsbClientController::ProcessGetInterfaceStatus()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	if (InterfaceExists(aPacket.iIndex) == EFalse)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface does not exist"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP2, 
+                "  Error: Interface does not exist" );
 		return KErrGeneral;
 		}
 	const TUint16 status = 0x0000;							// as of USB Spec 2.0
-	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting interface status: 0x%02x", status));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP3,
+            "  Reporting interface status: 0x%02x", status );
 	*reinterpret_cast<TUint16*>(iEp0_TxBuf) = SWAP_BYTES_16(status);
 	if (SetupEndpointZeroWrite(iEp0_TxBuf, sizeof(status)) == KErrNone)
 		{
@@ -559,23 +660,26 @@
 
 TInt DUsbClientController::ProcessGetEndpointStatus(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetEndpointStatus()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS, 
+	        "DUsbClientController::ProcessGetEndpointStatus()" );
 	if (iTrackDeviceState &&
 		((iDeviceState < EUsbcDeviceStateAddress) ||
 		 (iDeviceState == EUsbcDeviceStateAddress && (aPacket.iIndex & KUsbEpAddress_Portmask) != 0)))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	if (EndpointExists(aPacket.iIndex) == EFalse)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint does not exist"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP2, 
+                "  Error: Endpoint does not exist" );
 		return KErrGeneral;
 		}
 	const TInt ep = EpAddr2Idx(aPacket.iIndex);
 	const TUint16 status = (iRealEndpoints[ep].iHalt) ?	 KUsbEpStat_Halt : 0;
-	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting endpoint status 0x%02x for real endpoint %d",
-									status, ep));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP3, 
+	        "  Reporting endpoint status 0x%02x for real endpoint %d", status, ep );
 	*reinterpret_cast<TUint16*>(iEp0_TxBuf) = SWAP_BYTES_16(status);
 	if (SetupEndpointZeroWrite(iEp0_TxBuf, 2) == KErrNone)
 		{
@@ -587,10 +691,12 @@
 
 TInt DUsbClientController::ProcessSetClearDevFeature(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetClearDevFeature()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE,
+	        "DUsbClientController::ProcessSetClearDevFeature()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateDefault)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP1,
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 
@@ -603,7 +709,8 @@
 		case KUsbFeature_RemoteWakeup:
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP2,
+                        "  Error: Invalid device state" );
 				return KErrGeneral;
 				}
 			iRmWakeupStatus_Enabled = ETrue;
@@ -611,30 +718,35 @@
 		case KUsbFeature_TestMode:
 			if (!iHighSpeed)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported in High-Speed mode"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP3,
+                        "  Error: Request only supported in High-Speed mode" );
 				return KErrGeneral;
 				}
 			if (LowByte(aPacket.iIndex) != 0)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Lower byte of wIndex must be zero"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP4,
+                        "  Error: Lower byte of wIndex must be zero" );
 				return KErrGeneral;
 				}
 			test_sel = HighByte(aPacket.iIndex);
 			if ((test_sel < KUsbTestSelector_Test_J) || (test_sel > KUsbTestSelector_Test_Force_Enable))
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid test selector: %d", test_sel));
+                OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP5,
+                        "  Error: Invalid test selector: %d", test_sel );
 				return KErrGeneral;
 				}
 			break;
 		case KUsbFeature_B_HnpEnable:
 			if (!iOtgSupport)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP6,
+                        "  Error: Request only supported on a OTG device" );
 				return KErrGeneral;
 				}
 			if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP7,
+                        "  Error: Request only valid if OTG device supports HNP" );
 				return KErrGeneral;
 				}
 			iOtgFuncMap |= KUsbOtgAttr_B_HnpEnable;
@@ -643,12 +755,14 @@
 		case KUsbFeature_A_HnpSupport:
 			if (!iOtgSupport)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP8,
+                        "  Error: Request only supported on a OTG device" );
 				return KErrGeneral;
 				}
 			if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP9,
+                        "  Error: Request only valid if OTG device supports HNP" );
 				return KErrGeneral;
 				}
 			iOtgFuncMap |= KUsbOtgAttr_A_HnpSupport;
@@ -657,19 +771,22 @@
 		case KUsbFeature_A_AltHnpSupport:
 			if (!iOtgSupport)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP10,
+                        "  Error: Request only supported on a OTG device" );
 				return KErrGeneral;
 				}
 			if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP11,
+                        "  Error: Request only valid if OTG device supports HNP" );
 				return KErrGeneral;
 				}
 			iOtgFuncMap |= KUsbOtgAttr_A_AltHnpSupport;
 			OtgFeaturesNotify();
 			break;
 		default:
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown feature requested"));
+		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP12,
+		            "  Error: Unknown feature requested" );
 			return KErrGeneral;
 			}
 		}
@@ -680,13 +797,15 @@
 		case KUsbFeature_RemoteWakeup:
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP13,
+                        "  Error: Invalid device state" );
 				return KErrGeneral;
 				}
 			iRmWakeupStatus_Enabled = EFalse;
 			break;
 		default:
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown feature requested"));
+		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP14,
+		            "  Error: Unknown feature requested" );
 			return KErrGeneral;
 			}
 		}
@@ -697,7 +816,8 @@
 	// after the status stage of the request."
 	if (test_sel)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Entering HS Test Mode %d", test_sel));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP15,
+                "  Entering HS Test Mode %d", test_sel );
 		EnterTestMode(test_sel);
 		}
 
@@ -707,10 +827,12 @@
 
 TInt DUsbClientController::ProcessSetClearIfcFeature(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetClearIfcFeature()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE,
+	        "DUsbClientController::ProcessSetClearIfcFeature()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE_DUP1,
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	// No interface features defined in USB spec, thus
@@ -720,29 +842,34 @@
 
 TInt DUsbClientController::ProcessSetClearEpFeature(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetClearEpFeature()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE, 
+	        "DUsbClientController::ProcessSetClearEpFeature()" );
 	if (iTrackDeviceState &&
 		((iDeviceState < EUsbcDeviceStateAddress) ||
 		 (iDeviceState == EUsbcDeviceStateAddress && (aPacket.iIndex & KUsbEpAddress_Portmask) != 0)))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	if (aPacket.iValue != KUsbFeature_EndpointHalt)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown feature requested"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP2, 
+                "  Error: Unknown feature requested" );
 		return KErrGeneral;
 		}
 	if (EndpointExists(aPacket.iIndex) == EFalse)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint does not exist"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP3, 
+                "  Error: Endpoint does not exist" );
 		return KErrGeneral;
 		}
 	const TInt ep = EpAddr2Idx(aPacket.iIndex);
 	if (iRealEndpoints[ep].iLEndpoint->iInfo.iType == KUsbEpTypeControl ||
 		iRealEndpoints[ep].iLEndpoint->iInfo.iType == KUsbEpTypeIsochronous)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint is Control or Isochronous"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP4, 
+                "  Error: Endpoint is Control or Isochronous" );
 		return KErrGeneral;
 		}
 	SetClearHaltFeature(ep, aPacket.iRequest);
@@ -753,16 +880,19 @@
 
 TInt DUsbClientController::ProcessSetAddress(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetAddress()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS,
+	        "DUsbClientController::ProcessSetAddress()" );
 	if (iTrackDeviceState && iDeviceState > EUsbcDeviceStateAddress)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP1,
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	const TUint16 addr = aPacket.iValue;
 	if (addr > 127)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad address value: %d (>127)", addr));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP2,
+                "  Error: Bad address value: %d (>127)", addr );
 		return KErrGeneral;
 		}
 	if (addr == 0)
@@ -770,7 +900,8 @@
 		// Enter Default state (from Default or Address)
 		NextDeviceState(EUsbcDeviceStateDefault);
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  USB address: %d", addr));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP3,
+	        "  USB address: %d", addr );
 	// The spec says, under section 9.4.6:
 	// "Stages after the initial Setup packet assume the same device address as the Setup packet. The USB
 	// device does not change its device address until after the Status stage of this request is completed
@@ -785,10 +916,12 @@
 
 TInt DUsbClientController::ProcessGetDescriptor(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR, 
+	        "DUsbClientController::ProcessGetDescriptor()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateDefault)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 
@@ -804,16 +937,18 @@
 	if ((result != KErrNone) || (size == 0))
 		{
 		// This doesn't have to be an error - protocol-wise it's OK.
-		__KTRACE_OPT(KUSB, Kern::Printf("  Couldn't retrieve descriptor"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP2, 
+                "  Couldn't retrieve descriptor" );
 		return KErrGeneral;
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("  Descriptor found, size: %d (requested: %d)",
-									size, aPacket.iLength));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP3,
+            "  Descriptor found, size: %d (requested: %d)", size, aPacket.iLength );
 	if (size > KUsbcBufSz_Ep0Tx)
 		{
 		// This should actually not be possible (i.e. we should never get here).
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ep0_Tx buffer too small"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP4,
+                "  Error: Ep0_Tx buffer too small" );
 		}
 	if (size > aPacket.iLength)
 		{
@@ -822,10 +957,8 @@
 		}
 
 #ifdef ENABLE_EXCESSIVE_DEBUG_OUTPUT
-	__KTRACE_OPT(KUSB,
-				 Kern::Printf("  Data: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x ...",
-							  iEp0_TxBuf[0], iEp0_TxBuf[1], iEp0_TxBuf[2], iEp0_TxBuf[3],
-							  iEp0_TxBuf[4], iEp0_TxBuf[5], iEp0_TxBuf[6], iEp0_TxBuf[7]));
+    OstTraceDefExt1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP5,
+            "  Data: %{uint8[]}", TOstArray<TUint8>(iEp0_TxBuf, 8) );
 #endif
 	// If we're about to send less bytes than expected by the host AND our number is a
 	// multiple of the packet size, in order to indicate the end of the control transfer,
@@ -842,7 +975,8 @@
 
 TInt DUsbClientController::ProcessSetDescriptor(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR, 
+	        "DUsbClientController::ProcessSetDescriptor()" );
 #ifndef USB_SUPPORTS_SET_DESCRIPTOR_REQUEST
 	return KErrGeneral;
 #else
@@ -854,7 +988,8 @@
 	if (aPacket.iLength > KUsbcBufSz_Ep0Rx)
 		{
 		// Error: Our Rx buffer is too small! (Raise a defect to make it larger)
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ep0_Rx buffer too small"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR_DUP1,
+	            "  Error: Ep0_Rx buffer too small" );
 		return KErrGeneral;
 		}
 	SetEp0DataOutVars(aPacket);
@@ -866,27 +1001,33 @@
 
 TInt DUsbClientController::ProcessGetConfiguration(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetConfiguration()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION, 
+	        "DUsbClientController::ProcessGetConfiguration()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	if (iTrackDeviceState && iDeviceState == EUsbcDeviceStateAddress && iCurrentConfig != 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DeviceState Address && Config != 0"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP2, 
+                "  Error: DeviceState Address && Config != 0" );
 		return KErrGeneral;
 		}
 	if (iTrackDeviceState && iDeviceState == EUsbcDeviceStateConfigured && iCurrentConfig == 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DeviceState Configured && Config == 0"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP3, 
+                "  Error: DeviceState Configured && Config == 0" );
 		return KErrGeneral;
 		}
 	if (aPacket.iLength != 1)								// "unspecified behavior"
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Warning: wLength != 1 (= %d)", aPacket.iLength));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP4, 
+                "  Warning: wLength != 1 (= %d)", aPacket.iLength );
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting configuration value %d", iCurrentConfig));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP5, 
+	        "  Reporting configuration value %d", iCurrentConfig );
 	if (SetupEndpointZeroWrite(&iCurrentConfig, sizeof(iCurrentConfig)) == KErrNone)
 		{
 		iEp0WritePending = ETrue;
@@ -906,32 +1047,36 @@
 */
 TInt DUsbClientController::ProcessSetConfiguration(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetConfiguration()"));
-
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION, 
+	        "DUsbClientController::ProcessSetConfiguration()" );
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
 	// from here).
 
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	const TUint16 value = aPacket.iValue;
 	if (value > 1)											// we support only one configuration
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Configuration value too large: %d", value));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP2, 
+                "  Error: Configuration value too large: %d", value );
 		return KErrGeneral;
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("  Configuration value: %d", value));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP3,
+            "  Configuration value: %d", value );
 	ChangeConfiguration(value);
 
 	// In 9.4.5 under GET_STATUS we read, that after SET_CONFIGURATION the HALT feature
 	// for all endpoints is reset to zero.
 	TInt num = 0;
 	(TAny) DoForEveryEndpointInUse(&DUsbClientController::ClearHaltFeature, num);
-	__KTRACE_OPT(KUSB, Kern::Printf("  Called ClearHaltFeature() for %d endpoints", num));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP4,
+	        "  Called ClearHaltFeature() for %d endpoints", num );
 	SendEp0ZeroByteStatusPacket();							// success: zero bytes data during status stage
 	return KErrNone;
 	}
@@ -939,27 +1084,32 @@
 
 TInt DUsbClientController::ProcessGetInterface(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetInterface()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE, 
+	        "DUsbClientController::ProcessGetInterface()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	if (iCurrentConfig == 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device not configured"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP2, 
+                "  Error: Device not configured" );
 		return KErrGeneral;
 		}
 	const TInt number = aPacket.iIndex;
 	if (!InterfaceExists(number))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad interface index: %d", number));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP3, 
+                "  Error: Bad interface index: %d", number );
 		return KErrGeneral;
 		}
 	// Send alternate setting code of iCurrentInterface of Interface(set) <number> of the current
 	// config (iCurrentConfig).
 	const TUint8 setting = InterfaceNumber2InterfacePointer(number)->iCurrentInterface;
-	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting interface setting %d", setting));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP4, 
+	        "  Reporting interface setting %d", setting );
 	if (SetupEndpointZeroWrite(&setting, 1) == KErrNone)
 		{
 		iEp0WritePending = ETrue;
@@ -970,21 +1120,25 @@
 
 TInt DUsbClientController::ProcessSetInterface(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetInterface()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE,
+	        "DUsbClientController::ProcessSetInterface()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP1,
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	if (iCurrentConfig == 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device not configured"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP2,
+                "  Error: Device not configured" );
 		return KErrGeneral;
 		}
 	const TInt number = aPacket.iIndex;
 	if (!InterfaceExists(number))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad interface index: %d", number));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP3,
+                "  Error: Bad interface index: %d", number );
 		return KErrGeneral;
 		}
 	const TInt setting = aPacket.iValue;
@@ -992,10 +1146,12 @@
 	RPointerArray<TUsbcInterface>& ifcs = ifcset_ptr->iInterfaces;
 	if (setting >= ifcs.Count())
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Alt Setting >= bNumAltSettings: %d", setting));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP4,
+                "  Error: Alt Setting >= bNumAltSettings: %d", setting );
 		return KErrGeneral;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Interface setting:: %d", setting));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP5,
+            "  Interface setting:: %d", setting );
 	// Set iCurrentInterface of Interface(set) <number> of the current config
 	// (iCurrentConfig) to alternate setting <setting>.
 	ChangeInterface(ifcs[setting]);
@@ -1015,21 +1171,25 @@
 
 TInt DUsbClientController::ProcessSynchFrame(const TUsbcSetup& aPacket)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSynchFrame()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME, 
+	        "DUsbClientController::ProcessSynchFrame()" );
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP1, 
+                "  Error: Invalid device state" );
 		return KErrGeneral;
 		}
 	const TInt ep = aPacket.iIndex;
 	if (EndpointExists(ep) == EFalse)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint does not exist"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP2, 
+                "  Error: Endpoint does not exist" );
 		return KErrGeneral;
 		}
 	if (iRealEndpoints[EpAddr2Idx(ep)].iLEndpoint->iInfo.iType != KUsbEpTypeIsochronous)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint is not isochronous"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP3, 
+                "  Error: Endpoint is not isochronous" );
 		return KErrGeneral;
 		}
 	// We always send 0:
@@ -1045,7 +1205,8 @@
 #ifdef USB_SUPPORTS_SET_DESCRIPTOR_REQUEST
 void DUsbClientController::ProceedSetDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProceedSetDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCEEDSETDESCRIPTOR,
+	        "DUsbClientController::ProceedSetDescriptor()" );
 	// iEp0DataReceived already reflects the current buffer state
 	if (iEp0DataReceived < iSetup.iLength)
 		{
@@ -1078,17 +1239,19 @@
 
 void DUsbClientController::SetClearHaltFeature(TInt aRealEndpoint, TUint8 aRequest)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetClearHaltFeature()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE, 
+	        "DUsbClientController::SetClearHaltFeature()" );
 	if (aRequest == KUsbRequest_SetFeature)
 		{
 		if (iRealEndpoints[aRealEndpoint].iHalt)
 			{
 			// (This condition is not really an error)
-			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: HALT feature already set"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP1, 
+                    "  Warning: HALT feature already set" );
 			return;
 			}
-		__KTRACE_OPT(KUSB, Kern::Printf("  setting HALT feature for real endpoint %d",
-										aRealEndpoint));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP2, 
+		        "  setting HALT feature for real endpoint %d", aRealEndpoint );
 		StallEndpoint(aRealEndpoint);
 		iRealEndpoints[aRealEndpoint].iHalt = ETrue;
 		}
@@ -1097,12 +1260,13 @@
 		if (iRealEndpoints[aRealEndpoint].iHalt == EFalse)
 			{
 			// In this case, before we return, the data toggles are reset to DATA0.
-			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: HALT feature already cleared"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP3, 
+                    "  Warning: HALT feature already cleared" );
 			ResetDataToggle(aRealEndpoint);
 			return;
 			}
-		__KTRACE_OPT(KUSB, Kern::Printf("  clearing HALT feature for real endpoint %d",
-										aRealEndpoint));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP4, 
+		        "  clearing HALT feature for real endpoint %d", aRealEndpoint );
 		ResetDataToggle(aRealEndpoint);
 		ClearStallEndpoint(aRealEndpoint);
 		iRealEndpoints[aRealEndpoint].iHalt = EFalse;
@@ -1113,7 +1277,8 @@
 
 TInt DUsbClientController::ClearHaltFeature(TInt aRealEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ClearHaltFeature()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CLEARHALTFEATURE, 
+	        "DUsbClientController::ClearHaltFeature()" );
 	if (iRealEndpoints[aRealEndpoint].iHalt != EFalse)
 		{
 		ClearStallEndpoint(aRealEndpoint);
@@ -1125,19 +1290,21 @@
 
 void DUsbClientController::ChangeConfiguration(TUint16 aValue)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ChangeConfiguration()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION, 
+	        "DUsbClientController::ChangeConfiguration()" );
 	// New configuration is the same as the old one: 0
 	if (iCurrentConfig == 0 && aValue == 0)
 		{
 		// no-op
-		__KTRACE_OPT(KUSB, Kern::Printf("  Configuration: New == Old == 0 --> exiting"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP1, 
+                "  Configuration: New == Old == 0 --> exiting" );
 		return;
 		}
 	// New configuration is the same as the old one (but not 0)
 	if (iCurrentConfig == aValue)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Configuration: New == Old == %d --> exiting", aValue));
-
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP2, 
+                "  Configuration: New == Old == %d --> exiting", aValue );
 		// From the spec 9.1.1.5, Data toggle is reset to zero here when 
 		// setconfiguration(x->x)(x!=0) received, although we only support
 		// single configuration currently.
@@ -1145,21 +1312,24 @@
 		TInt ret = DoForEveryEndpointInUse(&DUsbClientController::ResetDataToggle, num);
 		if(ret != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint data toggle reset failed"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP3, 
+                    "  Error: Endpoint data toggle reset failed" );
 			}
-		__KTRACE_OPT(KUSB, Kern::Printf("  Called ResetDataToggle()for %d endpoints", num));	
-	
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP4, 
+		        "  Called ResetDataToggle()for %d endpoints", num );	
 		return;
 		}
 	// Device is already configured
 	if (iCurrentConfig != 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Device was configured: %d", iCurrentConfig));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP5, 
+                "  Device was configured: %d", iCurrentConfig );
 		// Tear down all interface(set)s of the old configuration
 		RPointerArray<TUsbcInterfaceSet>& ifcsets = CurrentConfig()->iInterfaceSets;
 		for (TInt i = 0; i < ifcsets.Count(); ++i)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Tearing down InterfaceSet %d", i));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP6, 
+                    "  Tearing down InterfaceSet %d", i );
 			InterfaceSetTeardown(ifcsets[i]);
 			}
 		iCurrentConfig = 0;
@@ -1170,7 +1340,8 @@
 	// Device gets a new configuration
 	if (aValue != 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Device gets new configuration..."));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP7, 
+                "  Device gets new configuration..." );
 		// Setup all alternate settings 0 of all interfaces
 		// (Don't separate the next two lines of code.)
 		iCurrentConfig = aValue;
@@ -1178,20 +1349,23 @@
 		const TInt n = ifcsets.Count();
 		for (TInt i = 0; i < n; ++i)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Setting up InterfaceSet %d", i));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP8, 
+                    "  Setting up InterfaceSet %d", i );
 			InterfaceSetup(ifcsets[i]->iInterfaces[0]);
 			}
 		// Enter Configured state (from Address or Configured)
 		NextDeviceState(EUsbcDeviceStateConfigured);
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  New configuration: %d", iCurrentConfig));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP9, 
+            "  New configuration: %d", iCurrentConfig );
 	return;
 	}
 
 
 void DUsbClientController::InterfaceSetup(TUsbcInterface* aIfc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::InterfaceSetup()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_INTERFACESETUP, 
+	        "DUsbClientController::InterfaceSetup()" );
 	const TInt num_eps = aIfc->iEndpoints.Count();
 	for (TInt i = 0; i < num_eps; i++)
 		{
@@ -1201,24 +1375,27 @@
 		//  adjusted in its constructor.)
 		if (iHighSpeed)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Setting Ep info size to %d (HS)", ep->iEpSize_Hs));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP1, 
+                    "  Setting Ep info size to %d (HS)", ep->iEpSize_Hs );
 			ep->iInfo.iSize = ep->iEpSize_Hs;
 			}
 		else
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Setting Ep info size to %d (FS)", ep->iEpSize_Fs));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP2, 
+                    "  Setting Ep info size to %d (FS)", ep->iEpSize_Fs );
 			ep->iInfo.iSize = ep->iEpSize_Fs;
 			}
 		const TInt idx = EpAddr2Idx(ep->iPEndpoint->iEndpointAddr);
 		if (ConfigureEndpoint(idx, ep->iInfo) != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint %d configuration failed", idx));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP3, 
+                    "  Error: Endpoint %d configuration failed", idx );
 			continue;
 			}
 		// Should there be a problem with it then we could try resetting the ep
 		// data toggle at this point (or before the Configure) as well.
-		__KTRACE_OPT(KUSB, Kern::Printf("  Connecting real ep addr 0x%02x & logical ep #%d",
-										ep->iPEndpoint->iEndpointAddr, ep->iLEndpointNum));
+        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP4, 
+                "  Connecting real ep addr 0x%02x & logical ep #%d", ep->iPEndpoint->iEndpointAddr, ep->iLEndpointNum );
 		ep->iPEndpoint->iLEndpoint = ep;
 		}
 	aIfc->iInterfaceSet->iCurrentInterface = aIfc->iSettingCode;
@@ -1228,10 +1405,12 @@
 
 void DUsbClientController::InterfaceSetTeardown(TUsbcInterfaceSet* aIfcSet)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::InterfaceSetTeardown()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN,
+	        "DUsbClientController::InterfaceSetTeardown()" );
 	if (aIfcSet->iInterfaces.Count() == 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  No interfaces exist - returning"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP1,
+                "  No interfaces exist - returning" );
 		return;
 		}
 	RPointerArray<TUsbcLogicalEndpoint>& eps = aIfcSet->CurrentInterface()->iEndpoints;
@@ -1245,24 +1424,29 @@
 
 		if (!ep->iPEndpoint->iLEndpoint)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  real ep %d not configured: skipping", idx));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP2,
+                    "  real ep %d not configured: skipping", idx );
 			continue;
 			}
 		if (ResetDataToggle(idx) != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint %d data toggle reset failed", idx));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP3,
+                    "  Error: Endpoint %d data toggle reset failed", idx );
 			}
 		if (DeConfigureEndpoint(idx) != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint %d de-configuration failed", idx));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP4,
+                    "  Error: Endpoint %d de-configuration failed", idx );
 			}
 
-		__KTRACE_OPT(KUSB, Kern::Printf("  disconnecting real ep & logical ep"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP5,
+                "  disconnecting real ep & logical ep" );
 		ep->iPEndpoint->iLEndpoint = NULL;
 		}
 	if (aIfcSet->CurrentInterface() != 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Resetting alternate interface setting to 0"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP6,
+                "  Resetting alternate interface setting to 0" );
 		//Add this mutex to protect the interface set data structure
 		if (NKern::CurrentContext() == EThread)
 		    {
@@ -1281,15 +1465,18 @@
 
 void DUsbClientController::ChangeInterface(TUsbcInterface* aIfc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ChangeInterface()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CHANGEINTERFACE, 
+	        "DUsbClientController::ChangeInterface()" );
 	TUsbcInterfaceSet* ifcset = aIfc->iInterfaceSet;
 	const TUint8 setting = aIfc->iSettingCode;
 	if (ifcset->iCurrentInterface == setting)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  New Ifc == old Ifc: nothing to do"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP1, 
+                "  New Ifc == old Ifc: nothing to do" );
 		return;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Setting new interface setting #%d", setting));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP2,
+            "  Setting new interface setting #%d", setting );
 	InterfaceSetTeardown(ifcset);
 	InterfaceSetup(aIfc);
 	StatusNotify(static_cast<TUsbcDeviceState>(KUsbAlternateSetting | setting), ifcset->iClientId);
@@ -1301,12 +1488,14 @@
 //
 TInt DUsbClientController::DoForEveryEndpointInUse(TInt (DUsbClientController::*aFunction)(TInt), TInt& aCount)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DoForEveryEndpointInUse()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE, 
+	        "DUsbClientController::DoForEveryEndpointInUse()" );
 	aCount = 0;
 	TUsbcConfiguration* const config = CurrentConfig();
 	if (!config)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Device is not configured - returning"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE_DUP1, 
+                "  Device is not configured - returning" );
 		return KErrNone;
 		}
 	RPointerArray<TUsbcInterfaceSet>& ifcsets = config->iInterfaceSets;
--- a/kernel/eka/drivers/usbcc/descriptors.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcc/descriptors.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -24,6 +24,11 @@
 
 #include <kernel/kern_priv.h>
 #include <drivers/usbc.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "descriptorsTraces.h"
+#endif
+
 
 
 // Debug Support
@@ -39,13 +44,15 @@
 #endif
 	iBufPtr(NULL, 0)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorBase::TUsbcDescriptorBase()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_CONS,
+	        "TUsbcDescriptorBase::TUsbcDescriptorBase()" );
 	}
 
 
 TUsbcDescriptorBase::~TUsbcDescriptorBase()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorBase::~TUsbcDescriptorBase()"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_DES,
+	        "TUsbcDescriptorBase::~TUsbcDescriptorBase()" );
 	}
 
 
@@ -146,7 +153,8 @@
 TUsbcDeviceDescriptor::TUsbcDeviceDescriptor()
 	: iBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::TUsbcDeviceDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_TUSBCDEVICEDESCRIPTOR_CONS, 
+	        "TUsbcDeviceDescriptor::TUsbcDeviceDescriptor()" );
 	}
 
 
@@ -155,7 +163,8 @@
 												  TUint16 aVendorId, TUint16 aProductId,
 												  TUint16 aDeviceRelease, TUint8 aNumConfigurations)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_NEW, 
+	        "TUsbcDeviceDescriptor::New()" );
 	TUsbcDeviceDescriptor* self = new TUsbcDeviceDescriptor();
 	if (self)
 		{
@@ -174,7 +183,8 @@
 									  TUint8 aMaxPacketSize0, TUint16 aVendorId, TUint16 aProductId,
 									  TUint16 aDeviceRelease, TUint8 aNumConfigurations)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_CONSTRUCT,
+	        "TUsbcDeviceDescriptor::Construct()" );
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -198,14 +208,16 @@
 
 void TUsbcDeviceDescriptor::UpdateFs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::UpdateFs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_UPDATEFS, 
+	        "TUsbcDeviceDescriptor::UpdateFs()" );
 	SetByte(7, iEp0Size_Fs);								// bMaxPacketSize0
 	}
 
 
 void TUsbcDeviceDescriptor::UpdateHs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::UpdateHs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_UPDATEHS,
+	        "TUsbcDeviceDescriptor::UpdateHs()" );
 	SetByte(7, 64);											// bMaxPacketSize0
 	}
 
@@ -215,7 +227,8 @@
 TUsbcDeviceQualifierDescriptor::TUsbcDeviceQualifierDescriptor()
 	: iBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::TUsbcDeviceQualifierDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_TUSBCDEVICEQUALIFIERDESCRIPTOR_CONS,
+	        "TUsbcDeviceQualifierDescriptor::TUsbcDeviceQualifierDescriptor()" );
 	}
 
 
@@ -226,7 +239,8 @@
 																	TUint8 aNumConfigurations,
 																	TUint8 aReserved)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_NEW, 
+	        "TUsbcDeviceQualifierDescriptor::New()" );
 	TUsbcDeviceQualifierDescriptor* self = new TUsbcDeviceQualifierDescriptor();
 	if (self)
 		{
@@ -245,7 +259,8 @@
 											   TUint8 aDeviceProtocol, TUint8 aMaxPacketSize0,
 											   TUint8 aNumConfigurations, TUint8 aReserved)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_CONSTRUCT,
+	        "TUsbcDeviceQualifierDescriptor::Construct()" );
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -265,7 +280,8 @@
 
 void TUsbcDeviceQualifierDescriptor::UpdateFs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::UpdateFs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEFS,
+	        "TUsbcDeviceQualifierDescriptor::UpdateFs()" );
 	// Here we do exactly the opposite of what's done in the Device descriptor (as this one's
 	// documenting the 'other than the current speed').
 	SetByte(7, 64);											// bMaxPacketSize0
@@ -274,7 +290,8 @@
 
 void TUsbcDeviceQualifierDescriptor::UpdateHs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::UpdateHs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEHS,
+	        "TUsbcDeviceQualifierDescriptor::UpdateHs()" );
 	// Here we do exactly the opposite of what's done in the Device descriptor (as this one's
 	// documenting the 'other than the current speed').
 	SetByte(7, iEp0Size_Fs);								// bMaxPacketSize0
@@ -286,14 +303,16 @@
 TUsbcConfigDescriptor::TUsbcConfigDescriptor()
 	: iBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfigDescriptor::TUsbcConfigDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGDESCRIPTOR_TUSBCCONFIGDESCRIPTOR_CONS,
+	        "TUsbcConfigDescriptor::TUsbcConfigDescriptor()" );
 	}
 
 
 TUsbcConfigDescriptor* TUsbcConfigDescriptor::New(TUint8 aConfigurationValue, TBool aSelfPowered,
 												  TBool aRemoteWakeup, TUint16 aMaxPower)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfigDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGDESCRIPTOR_NEW,
+	        "TUsbcConfigDescriptor::New()" );
 	TUsbcConfigDescriptor* self = new TUsbcConfigDescriptor();
 	if (self)
 		{
@@ -310,7 +329,8 @@
 TInt TUsbcConfigDescriptor::Construct(TUint8 aConfigurationValue, TBool aSelfPowered,
 									   TBool aRemoteWakeup, TUint16 aMaxPower)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfigDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGDESCRIPTOR_CONSTRUCT,
+	        "TUsbcConfigDescriptor::Construct()" );
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -323,7 +343,8 @@
 		(aSelfPowered ? KUsbDevAttr_SelfPowered : 0) |
 		(aRemoteWakeup ? KUsbDevAttr_RemoteWakeup : 0);		// bmAttributes (bit 7 always 1)
 	if (aMaxPower > 510)
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid value for bMaxPower: %d", aMaxPower));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUP1_TUSBCCONFIGDESCRIPTOR_CONSTRUCT_DUP1,
+		        "  Error: Invalid value for bMaxPower: %d", aMaxPower );
 	iBuf[8] = aMaxPower / 2;								// bMaxPower (2mA units!)
 	return KErrNone;
 	}
@@ -334,14 +355,16 @@
 TUsbcInterfaceDescriptor::TUsbcInterfaceDescriptor()
 	: iBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceDescriptor::TUsbcInterfaceDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACEDESCRIPTOR_TUSBCINTERFACEDESCRIPTOR_CONS,
+	        "TUsbcInterfaceDescriptor::TUsbcInterfaceDescriptor()" );
 	}
 
 
 TUsbcInterfaceDescriptor* TUsbcInterfaceDescriptor::New(TUint8 aInterfaceNumber, TUint8 aAlternateSetting,
 														TInt aNumEndpoints, const TUsbcClassInfo& aClassInfo)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACEDESCRIPTOR_NEW,
+	        "TUsbcInterfaceDescriptor::New()" );
 	TUsbcInterfaceDescriptor* self = new TUsbcInterfaceDescriptor();
 	if (self)
 		{
@@ -358,7 +381,8 @@
 TInt TUsbcInterfaceDescriptor::Construct(TUint8 aInterfaceNumber, TUint8 aAlternateSetting,
 										 TInt aNumEndpoints, const TUsbcClassInfo& aClassInfo)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACEDESCRIPTOR_CONSTRUCT,
+	        "TUsbcInterfaceDescriptor::Construct()" );
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -378,20 +402,24 @@
 
 TUsbcEndpointDescriptorBase::TUsbcEndpointDescriptorBase()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::TUsbcEndpointDescriptorBase()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_TUSBCENDPOINTDESCRIPTORBASE_CONS,
+	        "TUsbcEndpointDescriptorBase::TUsbcEndpointDescriptorBase()" );
 	}
 
 
 TInt TUsbcEndpointDescriptorBase::Construct(const TUsbcEndpointInfo& aEpInfo)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT,
+	        "TUsbcEndpointDescriptorBase::Construct()" );
 	//  Adjust FS/HS endpoint sizes
 	if (aEpInfo.AdjustEpSizes(iEpSize_Fs, iEpSize_Hs) != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown endpoint type: %d", aEpInfo.iType));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP1,
+		        "  Error: Unknown endpoint type: %d", aEpInfo.iType );
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (aEpInfo.iSize=%d)",
-									iEpSize_Fs, iEpSize_Hs, aEpInfo.iSize));
+	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP2,
+	        "  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (aEpInfo.iSize=%d)",
+	        iEpSize_Fs, iEpSize_Hs, aEpInfo.iSize );
 
 	//  Adjust HS endpoint size for additional transactions
 	if ((aEpInfo.iType == KUsbEpTypeIsochronous) || (aEpInfo.iType == KUsbEpTypeInterrupt))
@@ -400,14 +428,16 @@
 			{
 			// Bits 12..11 specify the number of additional transactions per microframe
 			iEpSize_Hs |= (aEpInfo.iTransactions << 12);
-			__KTRACE_OPT(KUSB, Kern::Printf("  Adjusted for add. transact.: iEpSize_Hs=0x%02x "
-											"(aEpInfo.iTransactions=%d)",
-											iEpSize_Hs, aEpInfo.iTransactions));
+			 OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP3,
+			         "  Adjusted for add. transact.: iEpSize_Hs=0x%02x (aEpInfo.iTransactions=%d)",
+			         iEpSize_Hs, aEpInfo.iTransactions );
+
 			}
 		else if (aEpInfo.iTransactions != 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Invalid iTransactions value: %d (ignored)",
-											  aEpInfo.iTransactions));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP4,
+                    "  Warning: Invalid iTransactions value: %d (ignored)", aEpInfo.iTransactions );
+
 			}
 		}
 
@@ -415,20 +445,22 @@
 	TUsbcEndpointInfo info(aEpInfo);						// create local writeable copy
 	if (info.AdjustPollInterval() != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown ep type (%d) or invalid interval value (%d)",
-										  info.iType, info.iInterval));
+        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP5,
+                "  Error: Unknown ep type (%d) or invalid interval value (%d)", info.iType, info.iInterval );
 		}
 	iInterval_Fs = info.iInterval;
 	iInterval_Hs = info.iInterval_Hs;
-	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iInterval_Fs=%d iInterval_Hs=%d",
-									iInterval_Fs, iInterval_Hs));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP6,
+            "  Now set: iInterval_Fs=%d iInterval_Hs=%d", iInterval_Fs, iInterval_Hs );
+
 	return KErrNone;
 	}
 
 
 void TUsbcEndpointDescriptorBase::UpdateFs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::UpdateFs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_UPDATEFS,
+	        "TUsbcEndpointDescriptorBase::UpdateFs" );
 	// (TUsbcEndpointDescriptorBase's FS/HS endpoint sizes and interval values got
 	//  adjusted in its Construct() method.)
 	SetWord(4, iEpSize_Fs);									// wMaxPacketSize
@@ -438,7 +470,8 @@
 
 void TUsbcEndpointDescriptorBase::UpdateHs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::UpdateHs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_UPDATEHS,
+	        "TUsbcEndpointDescriptorBase::UpdateHs()" );
 	// (TUsbcEndpointDescriptorBase's FS/HS endpoint sizes and interval values get
 	//  adjusted in its Construct() method.)
 	SetWord(4, iEpSize_Hs);									// wMaxPacketSize
@@ -451,14 +484,16 @@
 TUsbcEndpointDescriptor::TUsbcEndpointDescriptor()
 	: iBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptor::TUsbcEndpointDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTOR_TUSBCENDPOINTDESCRIPTOR_CONS,
+	        "TUsbcEndpointDescriptor::TUsbcEndpointDescriptor()" );
 	}
 
 
 TUsbcEndpointDescriptor* TUsbcEndpointDescriptor::New(TUint8 aEndpointAddress,
 													  const TUsbcEndpointInfo& aEpInfo)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTOR_NEW,
+	        "TUsbcEndpointDescriptor::New()" );
 	TUsbcEndpointDescriptor* self = new TUsbcEndpointDescriptor();
 	if (self)
 		{
@@ -474,7 +509,8 @@
 
 TInt TUsbcEndpointDescriptor::Construct(TUint8 aEndpointAddress, const TUsbcEndpointInfo& aEpInfo)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTOR_CONSTRUCT,
+	        "TUsbcEndpointDescriptor::Construct()" );
 	(void) TUsbcEndpointDescriptorBase::Construct(aEpInfo);	// Init Base class
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
@@ -493,14 +529,16 @@
 TUsbcAudioEndpointDescriptor::TUsbcAudioEndpointDescriptor()
 	: iBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAudioEndpointDescriptor::TUsbcAudioEndpointDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCAUDIOENDPOINTDESCRIPTOR_TUSBCAUDIOENDPOINTDESCRIPTOR_CONS,
+	        "TUsbcAudioEndpointDescriptor::TUsbcAudioEndpointDescriptor()" );
 	}
 
 
 TUsbcAudioEndpointDescriptor* TUsbcAudioEndpointDescriptor::New(TUint8 aEndpointAddress,
 																const TUsbcEndpointInfo& aEpInfo)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAudioEndpointDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCAUDIOENDPOINTDESCRIPTOR_NEW,
+	        "TUsbcAudioEndpointDescriptor::New()" );
 	TUsbcAudioEndpointDescriptor* self = new TUsbcAudioEndpointDescriptor();
 	if (self)
 		{
@@ -516,7 +554,8 @@
 
 TInt TUsbcAudioEndpointDescriptor::Construct(TUint8 aEndpointAddress, const TUsbcEndpointInfo& aEpInfo)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAudioEndpointDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCAUDIOENDPOINTDESCRIPTOR_CONSTRUCT,
+	        "TUsbcAudioEndpointDescriptor::Construct()" );
 	(void) TUsbcEndpointDescriptorBase::Construct(aEpInfo);	// Init Base class
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
@@ -536,7 +575,8 @@
 
 TUsbcOtgDescriptor* TUsbcOtgDescriptor::New(TBool aHnpSupport, TBool aSrpSupport)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCOTGDESCRIPTOR_NEW,
+	        "TUsbcOtgDescriptor::New()" );
 	TUsbcOtgDescriptor* self = new TUsbcOtgDescriptor();
 	if (self && (self->Construct(aHnpSupport, aSrpSupport) != KErrNone))
 		{
@@ -550,13 +590,15 @@
 TUsbcOtgDescriptor::TUsbcOtgDescriptor()
 	: iBuf()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::TUsbcOtgDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCOTGDESCRIPTOR_TUSBCOTGDESCRIPTOR_CONS, 
+	        "TUsbcOtgDescriptor::TUsbcOtgDescriptor()" );
 	}
 
 
 TInt TUsbcOtgDescriptor::Construct(TBool aHnpSupport, TBool aSrpSupport)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCOTGDESCRIPTOR_CONSTRUCT,
+	        "TUsbcOtgDescriptor::Construct()" );
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -572,20 +614,23 @@
 TUsbcClassSpecificDescriptor::TUsbcClassSpecificDescriptor()
 	: iBuf(NULL)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::TUsbcClassSpecificDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_CONS,
+	        "TUsbcClassSpecificDescriptor::TUsbcClassSpecificDescriptor()" );
 	}
 
 
 TUsbcClassSpecificDescriptor::~TUsbcClassSpecificDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::~TUsbcClassSpecificDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_DES,
+	        "TUsbcClassSpecificDescriptor::~TUsbcClassSpecificDescriptor()" );
 	delete iBuf;
 	}
 
 
 TUsbcClassSpecificDescriptor* TUsbcClassSpecificDescriptor::New(TUint8 aType, TInt aSize)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::New()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_NEW,
+	        "TUsbcClassSpecificDescriptor::New()" );
 	TUsbcClassSpecificDescriptor* self = new TUsbcClassSpecificDescriptor();
 	if (self)
 		{
@@ -601,11 +646,13 @@
 
 TInt TUsbcClassSpecificDescriptor::Construct(TUint8 aType, TInt aSize)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::Construct()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT, 
+	        "TUsbcClassSpecificDescriptor::Construct()" );
 	iBuf = HBuf8::New(aSize);
 	if (!iBuf)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Allocation of CS desc buffer failed"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT_DUP1,
+		        "  Error: Allocation of CS desc buffer failed" );
 		return KErrNoMemory;
 		}
 	iBuf->SetMax();
@@ -620,13 +667,15 @@
 TUsbcStringDescriptorBase::TUsbcStringDescriptorBase()
 	: /*iIndex(0),*/ iSBuf(0), iBufPtr(NULL, 0)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptorBase::TUsbcStringDescriptorBase()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_CONS,
+	        "TUsbcStringDescriptorBase::TUsbcStringDescriptorBase()" );
 	}
 
 
 TUsbcStringDescriptorBase::~TUsbcStringDescriptorBase()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptorBase::~TUsbcStringDescriptorBase()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_DES, 
+	        "TUsbcStringDescriptorBase::~TUsbcStringDescriptorBase()" );
 	}
 
 
@@ -634,8 +683,8 @@
 	{
 	if (aPosition <= 1)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Word(%d) in string descriptor "
-										  "(TUsbcStringDescriptorBase::Word)", aPosition));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCSTRINGDESCRIPTORBASE_WORD,
+		        "  Error: Word(%d) in string descriptor (TUsbcStringDescriptorBase::Word)", aPosition );
 		return 0;
 		}
 	else
@@ -651,8 +700,8 @@
 	{
 	if (aPosition <= 1)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetWord(%d) in string descriptor "
-										  "(TUsbcStringDescriptorBase::SetWord)", aPosition));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCSTRINGDESCRIPTORBASE_SETWORD,
+		        "  Error: SetWord(%d) in string descriptor (TUsbcStringDescriptorBase::SetWord)", aPosition );
 		return;
 		}
 	else
@@ -713,20 +762,23 @@
 TUsbcStringDescriptor::TUsbcStringDescriptor()
 	: iBuf(NULL)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::TUsbcStringDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_CONS, 
+	        "TUsbcStringDescriptor::TUsbcStringDescriptor()" );
 	}
 
 
 TUsbcStringDescriptor::~TUsbcStringDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::~TUsbcStringDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_DES,
+	        "TUsbcStringDescriptor::~TUsbcStringDescriptor()" );
 	delete iBuf;
 	}
 
 
 TUsbcStringDescriptor* TUsbcStringDescriptor::New(const TDesC8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::New"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_NEW, 
+	        "TUsbcStringDescriptor::New()" );
 	TUsbcStringDescriptor* self = new TUsbcStringDescriptor();
 	if (self)
 		{
@@ -742,11 +794,13 @@
 
 TInt TUsbcStringDescriptor::Construct(const TDesC8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::Construct"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_CONSTRUCT,
+	        "TUsbcStringDescriptor::Construct()" );
 	iBuf = HBuf8::New(aString.Size());						// bytes, not UNICODE chars
 	if (!iBuf)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Allocation of string buffer failed"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCSTRINGDESCRIPTOR_CONSTRUCT_DUP1,
+		        "  Error: Allocation of string buffer failed" );
 		return KErrNoMemory;
 		}
 	iBuf->SetMax();
@@ -764,19 +818,22 @@
 TUsbcLangIdDescriptor::TUsbcLangIdDescriptor()
 	: iBuf(NULL)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::TUsbcLangIdDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_CONS, 
+	        "TUsbcLangIdDescriptor::TUsbcLangIdDescriptor()" );
 	}
 
 
 TUsbcLangIdDescriptor::~TUsbcLangIdDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::~TUsbcLangIdDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_DES,
+	        "TUsbcLangIdDescriptor::~TUsbcLangIdDescriptor()" );
 	}
 
 
 TUsbcLangIdDescriptor* TUsbcLangIdDescriptor::New(TUint16 aLangId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::New"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_NEW, 
+	        "TUsbcLangIdDescriptor::New()" );
 	TUsbcLangIdDescriptor* self = new TUsbcLangIdDescriptor();
 	if (self)
 		{
@@ -792,7 +849,8 @@
 
 TInt TUsbcLangIdDescriptor::Construct(TUint16 aLangId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::Construct"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_CONSTRUCT,
+	        "TUsbcLangIdDescriptor::Construct()" );
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBufPtr[0] = LowByte(SWAP_BYTES_16(aLangId));			// Language ID value
@@ -812,17 +870,22 @@
 //
 	: iDescriptors(), iStrings(), iIfcIdx(0), iEp0_TxBuf(aEp0_TxBuf), iHighSpeed(EFalse)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::TUsbcDescriptorPool()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_CONS,
+	        "TUsbcDescriptorPool::TUsbcDescriptorPool()" );
 	}
 
 
 TUsbcDescriptorPool::~TUsbcDescriptorPool()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::~TUsbcDescriptorPool()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES, 
+	        "TUsbcDescriptorPool::~TUsbcDescriptorPool()" );
 	// The destructor of each <class T> object is called before the objects themselves are destroyed.
-	__KTRACE_OPT(KUSB, Kern::Printf("  iDescriptors.Count(): %d", iDescriptors.Count()));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP1,
+	        "  iDescriptors.Count(): %d", iDescriptors.Count() );
 	iDescriptors.ResetAndDestroy();
-	__KTRACE_OPT(KUSB, Kern::Printf("  iStrings.Count(): %d", iStrings.Count()));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP2,
+            "  iStrings.Count(): %d", iStrings.Count() );
+
 	iStrings.ResetAndDestroy();
 	}
 
@@ -832,19 +895,27 @@
 							   TUsbcStringDescriptor* aProduct, TUsbcStringDescriptor* aSerialNum,
 							   TUsbcStringDescriptor* aConfig, TUsbcOtgDescriptor* aOtgDesc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::Init()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INIT, 
+	        "TUsbcDescriptorPool::Init()" );
 	if (!aDeviceDesc || !aConfigDesc)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: No Device or Config descriptor specified"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INIT_DUP1, 
+		        "  Error: No Device or Config descriptor specified" );
 		return KErrArgument;
 		}
 	for (TInt n = 0; n < KDescPosition_FirstAvailable; n++)
 		{
 		iDescriptors.Append(NULL);
 		}
-	__ASSERT_DEBUG((iDescriptors.Count() == KDescPosition_FirstAvailable),
-				   Kern::Printf("  Error: iDescriptors.Count() (%d) != KDescPosition_FirstAvailable (%d)",
-								iDescriptors.Count(), KDescPosition_FirstAvailable));
+#ifdef _DEBUG
+	if (iDescriptors.Count() != KDescPosition_FirstAvailable)
+	    {
+        OstTraceDefExt2( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INIT_DUP2,
+                "  Error: iDescriptors.Count() (%d) != KDescPosition_FirstAvailable (%d)",
+                iDescriptors.Count(), KDescPosition_FirstAvailable );
+
+	    }
+#endif
 	iDescriptors[KDescPosition_Device] = aDeviceDesc;
 	iDescriptors[KDescPosition_Config] = aConfigDesc;
 	if (aOtgDesc)
@@ -859,7 +930,9 @@
 		// that contains an array of two-byte LANGID codes supported by the device. ...
 		// USB devices that omit all string descriptors must not return an array of LANGID codes."
 		// So if we have at least one string descriptor, we must also have a LANGID descriptor.
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: No LANGID string descriptor specified"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INIT_DUP3, 
+                "  Error: No LANGID string descriptor specified" );
+
 		return KErrArgument;
 		}
 	iStrings.Insert(aLangId, KStringPosition_Langid);
@@ -867,12 +940,18 @@
 	iStrings.Insert(aProduct, KStringPosition_Product);
 	iStrings.Insert(aSerialNum, KStringPosition_Serial);
 	iStrings.Insert(aConfig, KStringPosition_Config);
-	__ASSERT_DEBUG((iStrings.Count() == 5),
-				   Kern::Printf("  Error: iStrings.Count() != 5 (%d)", iStrings.Count()));
+#ifdef _DEBUG
+	if (iStrings.Count() != 5)
+	    {
+        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INIT_DUP4,
+                "  Error: iStrings.Count() != 5 (%d)", iStrings.Count() );
+	    }
+#endif
 #ifdef _DEBUG
 	for (TInt i = KStringPosition_Langid; i <= KStringPosition_Config; i++)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool.iStrings[%d] = 0x%x", i, iStrings[i]));
+        OstTraceDefExt2( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INIT_DUP5,
+                "TUsbcDescriptorPool.iStrings[%d] = 0x%x", i, reinterpret_cast<TUint>(iStrings[i]) );
 		}
 #endif
 	// Set string indices
@@ -894,9 +973,16 @@
 
 TInt TUsbcDescriptorPool::InitHs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InitHs()"));
-	__ASSERT_DEBUG((iDescriptors.Count() >= KDescPosition_FirstAvailable),
-				   Kern::Printf("  Error: Call Init() first)"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INITHS, 
+	        "TUsbcDescriptorPool::InitHs()" );
+#ifdef _DEBUG
+	if (iDescriptors.Count() < KDescPosition_FirstAvailable)
+	    {
+        OstTraceDef0( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INITHS_DUP1, 
+                "  Error: Call Init() first)" );
+
+	    }
+#endif
 
 	TUsbcDeviceQualifierDescriptor* const dq_desc = TUsbcDeviceQualifierDescriptor::New(
 		iDescriptors[KDescPosition_Device]->Byte(4),		// aDeviceClass
@@ -906,7 +992,8 @@
 		iDescriptors[KDescPosition_Device]->Byte(17));		// aNumConfigurations
 	if (!dq_desc)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for dev qualif desc failed."));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INITHS_DUP2,
+                "  Error: Memory allocation for dev qualif desc failed." );
 		return KErrGeneral;
 		}
 	iDescriptors[KDescPosition_DeviceQualifier] = dq_desc;
@@ -918,7 +1005,8 @@
 		iDescriptors[KDescPosition_Config]->Byte(8) * 2);	// aMaxPower (mA)
 	if (!osc_desc)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for other speed conf desc failed."));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INITHS_DUP3,
+                "  Error: Memory allocation for other speed conf desc failed." );
 		return KErrGeneral;
 		}
 
@@ -939,7 +1027,8 @@
 
 TInt TUsbcDescriptorPool::UpdateDescriptorsFs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateDescriptorsFs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSFS,
+	        "TUsbcDescriptorPool::UpdateDescriptorsFs()" );
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -953,7 +1042,8 @@
 
 TInt TUsbcDescriptorPool::UpdateDescriptorsHs()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateDescriptorsHs()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSHS,
+	        "TUsbcDescriptorPool::UpdateDescriptorsHs()" );
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -970,18 +1060,21 @@
 //
 TInt TUsbcDescriptorPool::FindDescriptor(TUint8 aType, TUint8 aIndex, TUint16 aLangid, TInt& aSize) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR, 
+	        "TUsbcDescriptorPool::FindDescriptor()" );
 	TInt result = KErrGeneral;
 	switch (aType)
 		{
 	case KUsbDescType_Device:
 		if (aLangid != 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
+		 OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP1,
+		         "  Error: bad langid: 0x%04x", aLangid );
 			}
 		else if (aIndex > 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad device index: %d", aIndex));
+	       OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP2,
+	               "  Error: bad device index: %d", aIndex );
 			}
 		else
 			{
@@ -992,11 +1085,13 @@
 	case KUsbDescType_Config:
 		if (aLangid != 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP3,
+                    "  Error: bad langid: 0x%04x", aLangid );
 			}
 		else if (aIndex > 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad config index: %d", aIndex));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP4,
+                    "  Error: bad config index: %d", aIndex );
 			}
 		else
 			{
@@ -1007,11 +1102,13 @@
 	case KUsbDescType_DeviceQualifier:
 		if (aLangid != 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP5,
+                    "  Error: bad langid: 0x%04x", aLangid );
 			}
 		else if (aIndex > 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad device index: %d", aIndex));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP6,
+                    "  Error: bad device index: %d", aIndex );
 			}
 		else
 			{
@@ -1022,11 +1119,13 @@
 	case KUsbDescType_OtherSpeedConfig:
 		if (aLangid != 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP7,
+                    "  Error: bad langid: 0x%04x", aLangid );
 			}
 		else if (aIndex > 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad config index: %d", aIndex));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP8,
+                    "  Error: bad config index: %d", aIndex );
 			}
 		else
 			{
@@ -1048,24 +1147,25 @@
 				}
 			else
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("  No string descriptors: not returning LANGID array"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP9,
+                        "  No string descriptors: not returning LANGID array" );
 				}
 			}
 		else
 			{
    			if (!aLangid)
    				{
-   				__KTRACE_OPT(KUSB,
- 							 Kern::Printf("  Strange: LANGID=0 for a $ descriptor (ignoring LANGID)"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP10,
+                        "  Strange: LANGID=0 for a $ descriptor (ignoring LANGID)" );
 				// The USB spec doesn't really say what to do in this case, but as there are host apps
 				// that fail if we return an error here, we choose to ignore the issue.
    				}
 			else if (aLangid != iStrings[KStringPosition_Langid]->Word(2))
 				{
 				// We have only one (this) language
-				__KTRACE_OPT(KUSB,
-							 Kern::Printf("  Bad LANGID: 0x%04X requested, 0x%04X supported (ignoring LANGID)",
-										  aLangid, iStrings[KStringPosition_Langid]->Word(2)));
+                OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP11,
+                        "  Bad LANGID: 0x%04X requested, 0x%04X supported (ignoring LANGID)",
+                        aLangid, iStrings[KStringPosition_Langid]->Word(2) );
 				// We could return an error here, but rather choose to ignore the discrepancy
 				// (the USB spec is not very clear what to do in such a case anyway).
 				}
@@ -1076,10 +1176,12 @@
 	case KUsbDescType_CS_Interface:
 		/* fall through */
 	case KUsbDescType_CS_Endpoint:
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: finding of class specific descriptors not supported"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP12,
+                "  Warning: finding of class specific descriptors not supported" );
 		break;
 	default:
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: unknown descriptor type requested: %d", aType));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP13,
+                "  Error: unknown descriptor type requested: %d", aType );
 		break;
 		}
 	return result;
@@ -1088,7 +1190,8 @@
 
 void TUsbcDescriptorPool::InsertDescriptor(TUsbcDescriptorBase* aDesc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InsertDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR, 
+	        "TUsbcDescriptorPool::InsertDescriptor()" );
 	switch (aDesc->Type())
 		{
 	case KUsbDescType_Interface:
@@ -1098,19 +1201,21 @@
 		InsertEpDesc(aDesc);
 		break;
 	default:
-		__KTRACE_OPT(KUSB, Kern::Printf("  Error: unsupported descriptor type"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR_DUP1,
+	            "  Error: unsupported descriptor type" );
 		}
 	}
 
 
 void TUsbcDescriptorPool::SetIfcStringDescriptor(TUsbcStringDescriptor* aDesc, TInt aNumber, TInt aSetting)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetIfcDescriptor(%d, %d)", aNumber, aSetting));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR,
+	        "TUsbcDescriptorPool::SetIfcDescriptor(%d, %d)", aNumber, aSetting );
 	const TInt i = FindIfcDescriptor(aNumber, aSetting);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ifc descriptor not found (%d, %d)",
-										  aNumber, aSetting));
+	    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP1,
+	           "  Error: Ifc descriptor not found (%d, %d)", aNumber, aSetting );
 		return;
 		}
 	// Try to find available NULL postition
@@ -1126,7 +1231,8 @@
 		str_idx = iStrings.Count();
 		if (str_idx > 0xff)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: $ descriptor array full (idx=%d)", str_idx));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP2,
+                    "  Error: $ descriptor array full (idx=%d)", str_idx );
 			return;
 			}
 		while (str_idx < KStringPosition_FirstAvailable)
@@ -1139,19 +1245,21 @@
 		}
 	// Update this ifc descriptor's string index field
 	iDescriptors[i]->SetByte(8, str_idx);
-	__KTRACE_OPT(KUSB, Kern::Printf("  String for ifc %d/%d (@ pos %d): \"%S\"", aNumber, aSetting, str_idx,
-									&iStrings[str_idx]->StringData()));
+	OstTraceDefExt4( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP3,
+	        "  String for ifc %d/%d (@ pos %d): \"%s\"", aNumber, aSetting, str_idx,
+	        iStrings[str_idx]->StringData() );
 	}
 
 
 void TUsbcDescriptorPool::DeleteIfcDescriptor(TInt aNumber, TInt aSetting)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::DeleteIfcDescriptor(%d, %d)", aNumber, aSetting));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR,
+	        "TUsbcDescriptorPool::DeleteIfcDescriptor(%d, %d)", aNumber, aSetting );	        
 	const TInt i = FindIfcDescriptor(aNumber, aSetting);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DeleteIfcDescriptor - descriptor not found (%d, %d)",
-										  aNumber, aSetting));
+        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR_DUP1,
+                "  Error: DeleteIfcDescriptor - descriptor not found (%d, %d)", aNumber, aSetting );
 		return;
 		}
 	// Delete (if necessary) specified interface's string descriptor
@@ -1179,14 +1287,16 @@
 
 TInt TUsbcDescriptorPool::GetDeviceDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::GetDeviceDescriptorTC()" );
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[KDescPosition_Device]->DescriptorData(), 0);
 	}
 
 
 TInt TUsbcDescriptorPool::SetDeviceDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetDeviceDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETDEVICEDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::SetDeviceDescriptorTC()" );
 	TBuf8<KUsbDescSize_Device> device;
 	const TInt r = Kern::ThreadDesRead(aThread, &aBuffer, device, 0);
 	if (r != KErrNone)
@@ -1210,14 +1320,16 @@
 
 TInt TUsbcDescriptorPool::GetConfigurationDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetConfigurationDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::GetConfigurationDescriptorTC()" );
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[KDescPosition_Config]->DescriptorData(), 0);
 	}
 
 
 TInt TUsbcDescriptorPool::SetConfigurationDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetConfigurationDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::SetConfigurationDescriptorTC()" );
 	TBuf8<KUsbDescSize_Config> config;
 	const TInt r = Kern::ThreadDesRead(aThread, &aBuffer, config, 0);
 	if (r != KErrNone)
@@ -1246,11 +1358,13 @@
 TInt TUsbcDescriptorPool::GetInterfaceDescriptorTC(DThread* aThread, TDes8& aBuffer,
 												   TInt aInterface, TInt aSetting) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetInterfaceDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC,
+	        "TUsbcDescriptorPool::GetInterfaceDescriptorTC()" );
 	const TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC_DUP1,
+                "  Error: no such interface" );
 		return KErrNotFound;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[i]->DescriptorData(), 0);
@@ -1259,11 +1373,13 @@
 
 TInt TUsbcDescriptorPool::SetInterfaceDescriptor(const TDes8& aBuffer, TInt aInterface, TInt aSetting)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetInterfaceDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR, 
+	        "TUsbcDescriptorPool::SetInterfaceDescriptor()" );
 	const TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR_DUP1,
+                "  Error: no such interface" );
 		return KErrNotFound;
 		}
 	iDescriptors[i]->SetByte(2, aBuffer[2]);				// bInterfaceNumber
@@ -1277,11 +1393,13 @@
 TInt TUsbcDescriptorPool::GetEndpointDescriptorTC(DThread* aThread, TDes8& aBuffer,
 												  TInt aInterface, TInt aSetting, TUint8 aEndpointAddress) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetEndpointDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC,
+	        "TUsbcDescriptorPool::GetEndpointDescriptorTC()" );
 	const TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC_DUP1,
+                "  Error: no such endpoint" );
 		return KErrNotFound;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[i]->DescriptorData(), 0);
@@ -1291,11 +1409,13 @@
 TInt TUsbcDescriptorPool::SetEndpointDescriptorTC(DThread* aThread, const TDes8& aBuffer,
 												  TInt aInterface, TInt aSetting, TUint8 aEndpointAddress)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetEndpointDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::SetEndpointDescriptorTC()" );
 	const TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC_DUP1, 
+	            "  Error: no such endpoint" );
 		return KErrNotFound;
 		}
 	TBuf8<KUsbDescSize_AudioEndpoint> ep;					// it could be an audio endpoint
@@ -1318,11 +1438,13 @@
 TInt TUsbcDescriptorPool::GetEndpointDescriptorSize(TInt aInterface, TInt aSetting, TUint8 aEndpointAddress,
 													TInt& aSize) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetEndpointDescriptorSize()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE,
+	        "TUsbcDescriptorPool::GetEndpointDescriptorSize()" );
 	const TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE_DUP1,
+                "  Error: no such endpoint" );
 		return KErrNotFound;
 		}
 	aSize = iDescriptors[i]->Size();
@@ -1332,10 +1454,12 @@
 
 TInt TUsbcDescriptorPool::GetDeviceQualifierDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceQualifierDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::GetDeviceQualifierDescriptorTC()" );
 	if (iDescriptors[KDescPosition_DeviceQualifier] == NULL)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Device_Qualifier descriptor not supported"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC_DUP1, 
+	            "  Warning: Device_Qualifier descriptor not supported" );
 		return KErrNotSupported;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer,
@@ -1345,10 +1469,12 @@
 
 TInt TUsbcDescriptorPool::SetDeviceQualifierDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetDeviceQualifierDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC,
+	        "TUsbcDescriptorPool::SetDeviceQualifierDescriptorTC()" );
 	if (iDescriptors[KDescPosition_DeviceQualifier] == NULL)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Device_Qualifier descriptor not supported"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC_DUP1,
+                "  Warning: Device_Qualifier descriptor not supported" );
 		return KErrNotSupported;
 		}
 	TBuf8<KUsbDescSize_DeviceQualifier> device;
@@ -1368,10 +1494,12 @@
 
 TInt TUsbcDescriptorPool::GetOtherSpeedConfigurationDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetOtherSpeedConfigurationDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::GetOtherSpeedConfigurationDescriptorTC()" );
 	if (iDescriptors[KDescPosition_OtherSpeedConfig] == NULL)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Other_Speed_Configuration descriptor not supported"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1, 
+	            "  Warning: Other_Speed_Configuration descriptor not supported" );
 		return KErrNotSupported;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer,
@@ -1381,10 +1509,12 @@
 
 TInt TUsbcDescriptorPool::SetOtherSpeedConfigurationDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetOtherSpeedConfigurationDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::SetOtherSpeedConfigurationDescriptorTC()" );
 	if (iDescriptors[KDescPosition_OtherSpeedConfig] == NULL)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Other_Speed_Configuration descriptor not supported"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1, 
+	            "  Warning: Other_Speed_Configuration descriptor not supported" );
 		return KErrNotSupported;
 		}
 	TBuf8<KUsbDescSize_OtherSpeedConfig> config;
@@ -1406,7 +1536,8 @@
 	TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORTC,
+		        "  Error: no such interface" );
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1431,7 +1562,8 @@
 	TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC, 
+		        "  Error: no such interface" );
 		return KErrNotFound;
 		}
 	// Find a position where to insert the new class specific interface descriptor(s)
@@ -1444,7 +1576,8 @@
 		{
 		return KErrNoMemory;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  inserting descriptor at position %d", i));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC_DUP1,
+            "  inserting descriptor at position %d", i );
 	iDescriptors.Insert(desc, i);
 
 	// Update the config descriptor's wTotalLength field
@@ -1461,7 +1594,8 @@
 	TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORSIZE, 
+                "  Error: no such interface" );
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1485,7 +1619,8 @@
 	TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORTC,
+		        "  Error: no such endpoint" );
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1510,7 +1645,8 @@
 	TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCSENDPOINTDESCRIPTORTC,
+		        "  Error: no such endpoint" );
 		return KErrNotFound;
 		}
 	// find a position where to insert the new class specific endpoint descriptor(s)
@@ -1538,7 +1674,8 @@
 	TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORSIZE, 
+		        "  Error: no such endpoint" );
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1636,14 +1773,16 @@
 	if (str_idx)
 		{
 		__ASSERT_ALWAYS((str_idx == KStringPosition_Config), Kern::Fault(KUsbPanicCat, __LINE__));
-		__KTRACE_OPT(KUSB, Kern::Printf("  String @ pos %d (conf $): \"%S\"",
-										str_idx, &iStrings[str_idx]->StringData()));
+		OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC, 
+		        "  String @ pos %d (conf $): \"%s\"", str_idx, iStrings[str_idx]->StringData() );
 		return Kern::ThreadDesWrite(aThread, &aString,
 									iStrings[str_idx]->StringData(), 0);
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  No config string descriptor @ pos %d", str_idx));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1,
+                "  No config string descriptor @ pos %d", str_idx );
+
 		return KErrNotFound;
 		}
 	}
@@ -1655,13 +1794,15 @@
 	TUint strlen = Kern::ThreadGetDesLength(aThread, &aString);
 	if (strlen > KUsbStringDescStringMaxSize)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: config $ descriptor too long - will be truncated"));
+		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC,
+		        "  Warning: config $ descriptor too long - will be truncated" );
 		strlen = KUsbStringDescStringMaxSize;
 		}
 	HBuf8* const strbuf = HBuf8::New(strlen);
 	if (!strbuf)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for config $ desc string failed (1)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1,
+                "  Error: Memory allocation for config $ desc string failed (1)" );
 		return KErrNoMemory;
 		}
 	strbuf->SetMax();
@@ -1669,14 +1810,16 @@
 	const TInt r = Kern::ThreadDesRead(aThread, &aString, *strbuf, 0);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP2,
+                "  Error: Thread read error" );
 		delete strbuf;
 		return r;
 		}
 	TUsbcStringDescriptor* sd = TUsbcStringDescriptor::New(*strbuf);
 	if (!sd)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for config $ desc failed (2)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP3,
+                "  Error: Memory allocation for config $ desc failed (2)" );
 		delete strbuf;
 		return KErrNoMemory;
 		}
@@ -1697,8 +1840,8 @@
 	{
 	if (iDescriptors[KDescPosition_Config]->Byte(KUsbDescStringIndex_Config) == 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  RemoveConfigurationStringDescriptor: no $ desc @ index %d",
-										KUsbDescStringIndex_Config));
+		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVECONFIGURATIONSTRINGDESCRIPTOR,
+		        "  RemoveConfigurationStringDescriptor: no $ desc @ index %d", KUsbDescStringIndex_Config );
 		return KErrNotFound;
 		}
 	// Delete old string, put in NULL pointer
@@ -1714,31 +1857,35 @@
 
 TInt TUsbcDescriptorPool::GetStringDescriptorTC(DThread* aThread, TInt aIndex, TDes8& aString) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetStringDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC,
+	        "TUsbcDescriptorPool::GetStringDescriptorTC()" );
 	if (!StringDescriptorExists(aIndex))
 		{
 		return KErrNotFound;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  String @ pos %d: \"%S\"",
-									aIndex, &iStrings[aIndex]->StringData()));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC_DUP1,
+	        "  String @ pos %d: \"%s\"", aIndex, iStrings[aIndex]->StringData() );
 	return Kern::ThreadDesWrite(aThread, &aString, iStrings[aIndex]->StringData(), 0);
 	}
 
 
 TInt TUsbcDescriptorPool::SetStringDescriptorTC(DThread* aThread, TInt aIndex, const TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetStringDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC,
+	        "TUsbcDescriptorPool::SetStringDescriptorTC()" );
 	// we don't know the length of the string, so we have to allocate memory dynamically
 	TUint strlen = Kern::ThreadGetDesLength(aThread, &aString);
 	if (strlen > KUsbStringDescStringMaxSize)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: $ descriptor too long - will be truncated"));
+	   OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP1,
+	           "  Warning: $ descriptor too long - will be truncated" );
 		strlen = KUsbStringDescStringMaxSize;
 		}
 	HBuf8* strbuf = HBuf8::New(strlen);
 	if (!strbuf)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Mem alloc for $ desc string failed (1)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP2,
+                "  Error: Mem alloc for $ desc string failed (1)" );
 		return KErrNoMemory;
 		}
 	strbuf->SetMax();
@@ -1746,14 +1893,16 @@
 	const TInt r = Kern::ThreadDesRead(aThread, &aString, *strbuf, 0);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP3,
+                "  Error: Thread read error" );
 		delete strbuf;
 		return r;
 		}
 	TUsbcStringDescriptor* const sd = TUsbcStringDescriptor::New(*strbuf);
 	if (!sd)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Mem alloc for $ desc failed (2)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP4,
+                "  Error: Mem alloc for $ desc failed (2)" );
 		delete strbuf;
 		return KErrNoMemory;
 		}
@@ -1776,13 +1925,14 @@
 
 TInt TUsbcDescriptorPool::RemoveStringDescriptor(TInt aIndex)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::RemoveStringDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR, 
+	        "TUsbcDescriptorPool::RemoveStringDescriptor()" );
 	if (!StringDescriptorExists(aIndex))
 		{
 		return KErrNotFound;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Removing string @ pos %d: \"%S\"",
-									aIndex, &iStrings[aIndex]->StringData()));
+   OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP1, 
+           "  Removing string @ pos %d: \"%s\"", aIndex, iStrings[aIndex]->StringData() );
 	ExchangeStringDescriptor(aIndex, NULL);
 
 	// Make sure there's no $ after aIndex.
@@ -1791,28 +1941,33 @@
 		{
 		if (iStrings[i] != NULL)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Found $ @ idx %d - not compressing", i));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP2, 
+                    "  Found $ @ idx %d - not compressing", i );
 			return KErrNone;
 			}
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("  No $ found after idx %d - compressing array", aIndex));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP3,
+            "  No $ found after idx %d - compressing array", aIndex );
 	// Move aIndex back just before the first !NULL element.
 	while (iStrings[--aIndex] == NULL)
 		;
 	// Let aIndex point to first NULL.
 	aIndex++;
-	__KTRACE_OPT(KUSB, Kern::Printf("  Starting at index %d", aIndex));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP4,
+            "  Starting at index %d", aIndex );
 	// Now remove NULL pointers until (Count() == aIndex).
-	__KTRACE_OPT(KUSB, Kern::Printf("  iStrings.Count() before: %d", iStrings.Count()));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP5,
+            "  iStrings.Count() before: %d", iStrings.Count() );
 	do
 		{
 		iStrings.Remove(aIndex);
-		__KTRACE_OPT(KUSB, Kern::Printf("  Removing $"));
+	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP6,
+	            "  Removing $" );
 		}
 	while (iStrings.Count() > aIndex);
-	__KTRACE_OPT(KUSB, Kern::Printf("  iStrings.Count() after: %d", iStrings.Count()));
-
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP7,
+            "  iStrings.Count() after: %d", iStrings.Count() );
 	// Regain some memory.
 	iStrings.Compress();
 
@@ -1829,7 +1984,8 @@
 //
 void TUsbcDescriptorPool::InsertIfcDesc(TUsbcDescriptorBase* aDesc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InsertIfcDesc()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INSERTIFCDESC, 
+	        "TUsbcDescriptorPool::InsertIfcDesc()" );
 
 	const TInt count = iDescriptors.Count();
 	TBool ifc_exists = EFalse;								// set to 'true' if we're adding an alternate
@@ -1837,7 +1993,8 @@
 	TInt i = KDescPosition_FirstAvailable;
 	while (i < count)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  already descriptors there (%d)...", count));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP1, 
+                "  already descriptors there (%d)...", count );
 		if (iDescriptors[i]->Type() == KUsbDescType_Interface)
 			{
 			if (iDescriptors[i]->Byte(2) > aDesc->Byte(2))
@@ -1856,8 +2013,8 @@
 					}
 				else if (iDescriptors[i]->Byte(3) == aDesc->Byte(3))
 					{
-					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: first delete old desc "
-													  "(TUsbcDescriptorPool::InsertIfcDesc)"));
+                    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP2, 
+                            "  Error: first delete old desc (TUsbcDescriptorPool::InsertIfcDesc)" );
 					return;
 					}
 				}
@@ -1865,7 +2022,8 @@
 		++i;
 		}
 	// In any case: put the new descriptor at position i.
-	__KTRACE_OPT(KUSB, Kern::Printf("  inserting descriptor at position %d", i));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP3,
+            "  inserting descriptor at position %d", i );
 	iDescriptors.Insert(aDesc, i);
 
 	// Update the config descriptor's wTotalLength field.
@@ -1886,11 +2044,12 @@
 //
 void TUsbcDescriptorPool::InsertEpDesc(TUsbcDescriptorBase* aDesc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InsertEpDesc()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INSERTEPDESC, 
+	        "TUsbcDescriptorPool::InsertEpDesc()" );
 	if (iIfcIdx == 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: only after interface "
-										  "(TUsbcDescriptorPool::InsertEpDesc)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INSERTEPDESC_DUP1, 
+                "  Error: only after interface (TUsbcDescriptorPool::InsertEpDesc)" );
 		return;
 		}
 	const TInt count = iDescriptors.Count();
@@ -1913,8 +2072,8 @@
 //
 TInt TUsbcDescriptorPool::FindIfcDescriptor(TInt aIfcNumber, TInt aIfcSetting) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindIfcDescriptor(%d, %d)",
-									aIfcNumber, aIfcSetting));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR,
+	        "TUsbcDescriptorPool::FindIfcDescriptor(%d, %d)", aIfcNumber, aIfcSetting );
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -1925,7 +2084,8 @@
 			return i;
 			}
 		}
-	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR_DUP1,
+	        "  Error: no such interface" );
 	return -1;
 	}
 
@@ -1935,13 +2095,14 @@
 //
 TInt TUsbcDescriptorPool::FindEpDescriptor(TInt aIfcNumber, TInt aIfcSetting, TUint8 aEpAddress) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindEpDescriptor(%d, %d, 0x%02x)",
-									aIfcNumber, aIfcSetting, aEpAddress));
+	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR,
+	        "TUsbcDescriptorPool::FindEpDescriptor(%d, %d, 0x%02x)", aIfcNumber, aIfcSetting, aEpAddress );
 	// first find the interface
 	const TInt ifc = FindIfcDescriptor(aIfcNumber, aIfcSetting);
 	if (ifc < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP1,
+                "  Error: no such interface" );
 		return ifc;
 		}
 	const TInt count = iDescriptors.Count();
@@ -1950,7 +2111,8 @@
 		{
 		if (iDescriptors[i]->Type() == KUsbDescType_Interface)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint before next interface"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP2,
+                    "  Error: no such endpoint before next interface" );
 			return -1;
 			}
 		else if ((iDescriptors[i]->Type() == KUsbDescType_Endpoint) &&
@@ -1960,7 +2122,8 @@
 			return i;
 			}
 		}
-	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
+    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP3,
+            "  Error: no such endpoint" );
 	return -1;
 	}
 
@@ -1970,18 +2133,22 @@
 //
 void TUsbcDescriptorPool::DeleteDescriptors(TInt aIndex, TInt aCount)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::DeleteDescriptors()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS, 
+	        "TUsbcDescriptorPool::DeleteDescriptors()" );
 	if (aIndex < KDescPosition_FirstAvailable)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aIndex < KDescPosition_FirstAvailable"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP1, 
+                "  Error: aIndex < KDescPosition_FirstAvailable" );
 		return;
 		}
 	if (aCount <= 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aCount <= 0"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP2, 
+                "  Error: aCount <= 0" );
 		return;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Removing descriptors at index %d:", aIndex));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP3, 
+            "  Removing descriptors at index %d:", aIndex );
 	// Try to update wTotalLength field in Config descriptor
 	while (aCount--)
 		{
@@ -1991,22 +2158,27 @@
 		switch (ptr->Type())
 			{
 		case KUsbDescType_Interface:
-			__KTRACE_OPT(KUSB, Kern::Printf("  - an interface descriptor"));
+		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP4,
+		            "  - an interface descriptor" );
 			UpdateConfigDescriptorLength(-KUsbDescSize_Interface);
 			break;
 		case KUsbDescType_Endpoint:
-			__KTRACE_OPT(KUSB, Kern::Printf("  - an endpoint descriptor"));
+			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP5,
+			        "  - an endpoint descriptor" );
 			UpdateConfigDescriptorLength(-ptr->Size());
 			break;
 		case KUsbDescType_CS_Interface:
 			/* fall through */
 		case KUsbDescType_CS_Endpoint:
-			__KTRACE_OPT(KUSB, Kern::Printf("  - a class specific descriptor"));
+		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP6,
+		            "  - a class specific descriptor" );
 			UpdateConfigDescriptorLength(-ptr->Size());
 			break;
 		default:
-			__KTRACE_OPT(KUSB, Kern::Printf("  - an unknown descriptor"));
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: unknown descriptor type"));
+		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP7,
+		            "  - an unknown descriptor" );
+		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP8,
+		            "  Error: unknown descriptor type" );
 			}
 		iDescriptors.Remove(aIndex);
 		delete ptr;
@@ -2019,12 +2191,15 @@
 //
 void TUsbcDescriptorPool::UpdateConfigDescriptorLength(TInt aLength)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateConfigDescriptorLength(%d)", aLength));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH,
+	        "TUsbcDescriptorPool::UpdateConfigDescriptorLength(%d)", aLength );
 	TUsbcDescriptorBase* const cnf = iDescriptors[KDescPosition_Config];
-	__KTRACE_OPT(KUSB, Kern::Printf("  wTotalLength old: %d", cnf->Word(2)));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP1,
+	        "  wTotalLength old: %d", cnf->Word(2) );
 	// Update Config descriptor
 	cnf->SetWord(2, cnf->Word(2) + aLength);
-	__KTRACE_OPT(KUSB, Kern::Printf("  wTotalLength new: %d", cnf->Word(2)));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP2,
+	        "  wTotalLength new: %d", cnf->Word(2) );
 	// Update Other_Speed_Config descriptor as well, if applicable
 	if (iDescriptors[KDescPosition_OtherSpeedConfig])
 		iDescriptors[KDescPosition_OtherSpeedConfig]->SetWord(2, cnf->Word(2));
@@ -2036,18 +2211,22 @@
 //
 void TUsbcDescriptorPool::UpdateConfigDescriptorNumIfcs(TInt aNumber)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateConfigDescriptorNumIfcs(%d)", aNumber));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS,
+	        "TUsbcDescriptorPool::UpdateConfigDescriptorNumIfcs(%d)", aNumber );
 	TUsbcDescriptorBase* const cnf = iDescriptors[KDescPosition_Config];
-	__KTRACE_OPT(KUSB, Kern::Printf("  bNumInterfaces old: %d", cnf->Byte(4)));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP1,
+	        "  bNumInterfaces old: %d", cnf->Byte(4) );
 	const TInt n = cnf->Byte(4) + aNumber;
 	if (n < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bNumInterfaces + aNumber < 0"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP2,
+                "  Error: bNumInterfaces + aNumber < 0" );
 		return;
 		}
 	// Update Config descriptor
 	cnf->SetByte(4, n);
-	__KTRACE_OPT(KUSB, Kern::Printf("  bNumInterfaces new: %d", cnf->Byte(4)));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP3,
+            "  bNumInterfaces new: %d", cnf->Byte(4) );
 	// Update Other_Speed_Config descriptor as well, if applicable
 	if (iDescriptors[KDescPosition_OtherSpeedConfig])
 		iDescriptors[KDescPosition_OtherSpeedConfig]->SetByte(4, n);
@@ -2059,7 +2238,8 @@
 //
 void TUsbcDescriptorPool::UpdateIfcNumbers(TInt aNumber)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateIfcNumbers(%d)", aNumber));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATEIFCNUMBERS,
+	        "TUsbcDescriptorPool::UpdateIfcNumbers(%d)", aNumber );
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -2081,14 +2261,21 @@
 //
 TInt TUsbcDescriptorPool::GetDeviceDescriptor(TInt aIndex) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceDescriptor()"));
-	__ASSERT_DEBUG((aIndex == KDescPosition_Device) || (aIndex == KDescPosition_DeviceQualifier),
-				   Kern::Printf("  Error: invalid descriptor index: %d", aIndex));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR, 
+	        "TUsbcDescriptorPool::GetDeviceDescriptor()" );
+#ifdef _DEBUG
+	if (!((aIndex == KDescPosition_Device) || (aIndex == KDescPosition_DeviceQualifier)))
+	    {
+        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP1, 
+                "  Error: invalid descriptor index: %d", aIndex );
+	    }
+#endif
 	if (iDescriptors[aIndex] == NULL)
 		{
 		// This doesn't have to be an error - we might get asked here for the Device_Qualifier descriptor
 		// on a FS-only device.
-		__KTRACE_OPT(KUSB, Kern::Printf("  Descriptor #%d requested but not available", aIndex));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP2, 
+                "  Descriptor #%d requested but not available", aIndex );
 		return 0;
 		}
 	return iDescriptors[aIndex]->GetDescriptorData(iEp0_TxBuf, KUsbcBufSz_Ep0Tx);
@@ -2102,14 +2289,21 @@
 //
 TInt TUsbcDescriptorPool::GetConfigurationDescriptor(TInt aIndex) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetConfigDescriptor(%d)", aIndex));
-	__ASSERT_DEBUG((aIndex == KDescPosition_Config) || (aIndex == KDescPosition_OtherSpeedConfig),
-				   Kern::Printf("  Error: invalid descriptor index: %d", aIndex));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR,
+	        "TUsbcDescriptorPool::GetConfigDescriptor(%d)", aIndex );
+#ifdef _DEBUG
+	if (!((aIndex == KDescPosition_Config) || (aIndex == KDescPosition_OtherSpeedConfig)))
+	    {
+        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP1,
+                "  Error: invalid descriptor index: %d", aIndex );
+	    }
+#endif
 	if (iDescriptors[aIndex] == NULL)
 		{
 		// This is always an error: We should always have a Configuration descriptor and we should never
 		// get asked for the Other_Speed_Configuration descriptor if we don't have one (9.6.2).
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Descriptor %d requested but not available", aIndex));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP2,
+                "  Warning: Descriptor %d requested but not available", aIndex );
 		return 0;
 		}
 		
@@ -2138,7 +2332,8 @@
 				if (iDescriptors[KDescPosition_Otg] == NULL)
 					{
 					// Skip since there is no otg descriptor
-					__KTRACE_OPT(KUSB, Kern::Printf("  no otg descriptor"));
+                    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP3,
+                            "  no otg descriptor" );
 					continue;				
 					}
 				else
@@ -2168,28 +2363,29 @@
 				}
 			}
 
-		__KTRACE_OPT(KUSB, Kern::Printf("  desc[%02d]: type = 0x%02x size = %d ",
-										pos, ptr->Type(), ptr->Size()));				
+        OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP4,
+                "  desc[%02d]: type = 0x%02x size = %d ", pos, ptr->Type(), ptr->Size() );			
 		const TInt size = ptr->GetDescriptorData(buf, KUsbcBufSz_Ep0Tx - copied);
 		if (size == 0)
 			{
 			
-			__KTRACE_OPT(KPANIC,
-						 Kern::Printf("  Error: No Tx buffer space to copy this descriptor -> exiting"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP5,
+                    "  Error: No Tx buffer space to copy this descriptor -> exiting" );
 			break;
 			}
 		copied += size;
 		if (copied >= KUsbcBufSz_Ep0Tx)
 			{
-			__KTRACE_OPT(KPANIC,
-						 Kern::Printf("  Error: No Tx buffer space left -> stopping here"));
+            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP6,
+                    "  Error: No Tx buffer space left -> stopping here" );
 			break;
 			}
 		buf += size;
 		}
 		
 		
-	__KTRACE_OPT(KUSB, Kern::Printf("  copied %d bytes", copied));
+    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP7,
+            "  copied %d bytes", copied );
 	return copied;
 	}
 
@@ -2200,10 +2396,12 @@
 //
 TInt TUsbcDescriptorPool::GetOtgDescriptor() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetOtgDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR,
+	        "TUsbcDescriptorPool::GetOtgDescriptor()" );
 	if (iDescriptors[KDescPosition_Otg] == NULL)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  OTG Descriptor not set"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR_DUP1,
+                "  OTG Descriptor not set" );
 		return 0;
 		}
 	return iDescriptors[KDescPosition_Otg]->GetDescriptorData(iEp0_TxBuf, KUsbcBufSz_Ep0Tx);
@@ -2216,7 +2414,8 @@
 //
 TInt TUsbcDescriptorPool::GetStringDescriptor(TInt aIndex) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetStringDescriptor(%d)", aIndex));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTOR,
+	        "TUsbcDescriptorPool::GetStringDescriptor(%d)", aIndex );
 	// I really would have liked to display the descriptor contents here, but without trailing zero
 	// we got a problem: how can we tell printf where the string ends? We would have to
 	// dynamically allocate memory (since we don't know the size in advance), copy the descriptor
@@ -2236,19 +2435,21 @@
 TInt TUsbcDescriptorPool::GetDeviceStringDescriptorTC(DThread* aThread, TDes8& aString,
 													  TInt aIndex, TInt aPosition) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceStringDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC, 
+	        "TUsbcDescriptorPool::GetDeviceStringDescriptorTC()" );
 	const TInt str_idx = iDescriptors[KDescPosition_Device]->Byte(aIndex);
 	if (str_idx)
 		{
 		__ASSERT_ALWAYS((str_idx == aPosition), Kern::Fault(KUsbPanicCat, __LINE__));
-		__KTRACE_OPT(KUSB, Kern::Printf("  String @ pos %d (device $): \"%S\"",
-										str_idx, &iStrings[str_idx]->StringData()));
+        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP1, 
+                "  String @ pos %d (device $): \"%s\"", str_idx, iStrings[str_idx]->StringData() );
 		return Kern::ThreadDesWrite(aThread, &aString,
 									iStrings[str_idx]->StringData(), 0);
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  No string descriptor @ pos %d", aIndex));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP2, 
+                "  No string descriptor @ pos %d", aIndex );
 		return KErrNotFound;
 		}
 	}
@@ -2261,18 +2462,21 @@
 TInt TUsbcDescriptorPool::SetDeviceStringDescriptorTC(DThread* aThread, const TDes8& aString,
 													  TInt aIndex, TInt aPosition)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetDeviceStringDescriptorTC()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC,
+	        "TUsbcDescriptorPool::SetDeviceStringDescriptorTC()" );
 	// we don't know the length of the string, so we have to allocate memory dynamically
 	TUint strlen = Kern::ThreadGetDesLength(aThread, &aString);
 	if (strlen > KUsbStringDescStringMaxSize)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: $ descriptor too long - will be truncated"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP1,
+                "  Warning: $ descriptor too long - will be truncated" );
 		strlen = KUsbStringDescStringMaxSize;
 		}
 	HBuf8* const strbuf = HBuf8::New(strlen);
 	if (!strbuf)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for dev $ desc string failed (1)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP2,
+                "  Error: Memory allocation for dev $ desc string failed (1)" );
 		return KErrNoMemory;
 		}
 	strbuf->SetMax();
@@ -2280,14 +2484,16 @@
 	const TInt r = Kern::ThreadDesRead(aThread, &aString, *strbuf, 0);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP3,
+                "  Error: Thread read error" );
 		delete strbuf;
 		return r;
 		}
 	TUsbcStringDescriptor* const sd = TUsbcStringDescriptor::New(*strbuf);
 	if (!sd)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for dev $ desc failed (2)"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP4,
+                "  Error: Memory allocation for dev $ desc failed (2)" );
 		delete strbuf;
 		return KErrNoMemory;
 		}
@@ -2304,10 +2510,12 @@
 //
 TInt TUsbcDescriptorPool::RemoveDeviceStringDescriptor(TInt aIndex, TInt aPosition)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::RemoveDeviceStringDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR, 
+	        "TUsbcDescriptorPool::RemoveDeviceStringDescriptor()" );
 	if (iDescriptors[KDescPosition_Device]->Byte(aIndex) == 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  RemoveDeviceStringDescriptor: no $ desc @ index %d", aIndex));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR_DUP1, 
+                "  RemoveDeviceStringDescriptor: no $ desc @ index %d", aIndex );
 		return KErrNotFound;
 		}
 	ExchangeStringDescriptor(aPosition, NULL);
@@ -2321,12 +2529,15 @@
 //
 void TUsbcDescriptorPool::ExchangeStringDescriptor(TInt aIndex, const TUsbcStringDescriptor* aDesc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::ExchangeStringDescriptor()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR,
+	        "TUsbcDescriptorPool::ExchangeStringDescriptor()" );
 	TUsbcStringDescriptorBase* const ptr = iStrings[aIndex];
-	__KTRACE_OPT(KUSB, Kern::Printf("  Deleting string descriptor at index %d: 0x%x", aIndex, ptr));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP1,
+            "  Deleting string descriptor at index %d: 0x%x", aIndex, reinterpret_cast<TUint>(ptr) );
 	iStrings.Remove(aIndex);
 	delete ptr;
-	__KTRACE_OPT(KUSB, Kern::Printf("  Inserting string descriptor at index %d: 0x%x", aIndex, aDesc));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP2,
+            "  Inserting string descriptor at index %d: 0x%x", aIndex, reinterpret_cast<TUint>(aDesc) );
 	iStrings.Insert(aDesc, aIndex);
 	}
 
@@ -2351,15 +2562,18 @@
 //
 TBool TUsbcDescriptorPool::StringDescriptorExists(TInt aIndex) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::StringDescriptorExists()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS, 
+	        "TUsbcDescriptorPool::StringDescriptorExists" );
 	if (aIndex >= iStrings.Count())
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad string index: %d", aIndex));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP1, 
+                "  Error: Bad string index: %d", aIndex );
 		return EFalse;
 		}
 	else if (iStrings[aIndex] == NULL)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: No $ descriptor @ pos %d", aIndex));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP2,
+                "  Error: No $ descriptor @ pos %d", aIndex );
 		return EFalse;
 		}
 	return ETrue;
@@ -2371,14 +2585,16 @@
 //
 TInt TUsbcDescriptorPool::FindAvailableStringPos() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindAvailableStringPos()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS,
+	        "TUsbcDescriptorPool::FindAvailableStringPos()" );
 	const TInt n = iStrings.Count();
 	// We don't start from 0 because the first few locations are 'reserved'.
 	for (TInt i = KStringPosition_FirstAvailable; i < n; i++)
 		{
 		if (iStrings[i] == NULL)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf(" Found available NULL position: %d", i));
+            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS_DUP1,
+                    " Found available NULL position: %d", i );
 			return i;
 			}
 		}
--- a/kernel/eka/drivers/usbcc/misc.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcc/misc.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,6 +23,11 @@
 */
 
 #include <drivers/usbc.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "miscTraces.h"
+#endif
+
 
 
 /** Helper function for logical endpoints and endpoint descriptors:
@@ -97,8 +102,8 @@
 			{
 			if (aEpSize_Hs < 513)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep size too small: %d < 513. Correcting...",
-												  aEpSize_Hs));
+				OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTINFO_ADJUSTEPSIZES,
+				        "  Warning: Ep size too small: %d < 513. Correcting...", aEpSize_Hs );
 				aEpSize_Hs = 513;
 				}
 			}
@@ -106,8 +111,8 @@
 			{
 			if (aEpSize_Hs < 683)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep size too small: %d < 683. Correcting...",
-												  aEpSize_Hs));
+                OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTINFO_ADJUSTEPSIZES_DUP1,
+                        "  Warning: Ep size too small: %d < 683. Correcting...", aEpSize_Hs );
 				aEpSize_Hs = 683;
 				}
 			}
@@ -194,13 +199,15 @@
 TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint()
 	: iEndpointAddr(0), iIfcNumber(NULL), iLEndpoint(NULL), iSettingReserve(EFalse), iHalt(EFalse)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_CONS,
+	        "TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint()" );
 	}
 
 
 TInt TUsbcPhysicalEndpoint::TypeAvailable(TUint aType) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::TypeAvailable"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TYPEAVAILABLE, 
+	        "TUsbcPhysicalEndpoint::TypeAvailable" );
 	switch (aType)
 		{
 	case KUsbEpTypeControl:
@@ -212,7 +219,8 @@
 	case KUsbEpTypeInterrupt:
 		return (iCaps.iTypesAndDir & KUsbEpTypeInterrupt);
 	default:
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid EP type: %d", aType));
+	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCPHYSICALENDPOINT_TYPEAVAILABLE_DUP1, 
+	            "  Error: invalid EP type: %d", aType );
 		return 0;
 		}
 	}
@@ -220,7 +228,8 @@
 
 TInt TUsbcPhysicalEndpoint::DirAvailable(TUint aDir) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::DirAvailable"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_DIRAVAILABLE, 
+	        "TUsbcPhysicalEndpoint::DirAvailable" );
 	switch (aDir)
 		{
 	case KUsbEpDirIn:
@@ -228,7 +237,8 @@
 	case KUsbEpDirOut:
 		return (iCaps.iTypesAndDir & KUsbEpDirOut);
 	default:
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid EP direction: %d", aDir));
+	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCPHYSICALENDPOINT_DIRAVAILABLE_DUP1, 
+	            "  Error: invalid EP direction: %d", aDir );
 		return 0;
 		}
 	}
@@ -236,12 +246,15 @@
 
 TInt TUsbcPhysicalEndpoint::EndpointSuitable(const TUsbcEndpointInfo* aEpInfo, TInt aIfcNumber) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::EndpointSuitable"));
-	__KTRACE_OPT(KUSB, Kern::Printf("  looking for EP: type=0x%x dir=0x%x size=%d (ifc_num=%d)",
-									aEpInfo->iType, aEpInfo->iDir, aEpInfo->iSize, aIfcNumber));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE,
+	        "TUsbcPhysicalEndpoint::EndpointSuitable" );
+	OstTraceDefExt4( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP1,
+	        "  looking for EP: type=0x%x dir=0x%x size=%d (ifc_num=%d)",
+	        aEpInfo->iType, aEpInfo->iDir, aEpInfo->iSize, aIfcNumber );
 	if (iSettingReserve)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  -> setting conflict"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP2,
+                "  -> setting conflict" );
 		return 0;
 		}
 	// (aIfcNumber == -1) means the ep is for a new default interface setting
@@ -254,22 +267,26 @@
 		// to different alternate settings of the *same* interface, and
 		// because we check for available endpoints for every alternate setting
 		// as a whole.
-		__KTRACE_OPT(KUSB, Kern::Printf("  -> ifc conflict"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP3,
+                "  -> ifc conflict" );
 		return 0;
 		}
 	else if (!TypeAvailable(aEpInfo->iType))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  -> type conflict"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP4,
+                "  -> type conflict" );
 		return 0;
 		}
 	else if (!DirAvailable(aEpInfo->iDir))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  -> direction conflict"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP5,
+                "  -> direction conflict" );
 		return 0;
 		}
 	else if (!(iCaps.iSizes & PacketSize2Mask(aEpInfo->iSize)) && !(iCaps.iSizes & KUsbEpSizeCont))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  -> size conflict"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP6,
+                "  -> size conflict" );
 		return 0;
 		}
 	else
@@ -279,7 +296,8 @@
 
 TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_DES,
+	        "TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()" );
 	iLEndpoint = NULL;
 	}
 
@@ -290,34 +308,37 @@
 	: iController(aController), iLEndpointNum(aEndpointNum), iInfo(aEpInfo), iInterface(aInterface),
 	  iPEndpoint(aPEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLogicalEndpoint::TUsbcLogicalEndpoint()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS, 
+	        "TUsbcLogicalEndpoint::TUsbcLogicalEndpoint()" );
 	//  Adjust FS/HS endpoint sizes
 	if (iInfo.AdjustEpSizes(iEpSize_Fs, iEpSize_Hs) != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown endpoint type: %d", iInfo.iType));
+        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP1, 
+                "  Error: Unknown endpoint type: %d", iInfo.iType );
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (iInfo.iSize=%d)",
-									iEpSize_Fs, iEpSize_Hs, iInfo.iSize));
+	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP2, 
+	        "  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (iInfo.iSize=%d)", iEpSize_Fs, iEpSize_Hs, iInfo.iSize );
 	//  Adjust HS polling interval
 	if (iInfo.AdjustPollInterval() != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown ep type (%d) or invalid interval value (%d)",
-										  iInfo.iType, iInfo.iInterval));
+        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP3, 
+                "  Error: Unknown ep type (%d) or invalid interval value (%d)", iInfo.iType, iInfo.iInterval );
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iInfo.iInterval=%d iInfo.iInterval_Hs=%d",
-									iInfo.iInterval, iInfo.iInterval_Hs));
+	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP4, 
+	        "  Now set: iInfo.iInterval=%d iInfo.iInterval_Hs=%d", iInfo.iInterval, iInfo.iInterval_Hs );
 	// Additional transactions requested on a non High Bandwidth ep?
 	if ((iInfo.iTransactions > 0) && !aPEndpoint->iCaps.iHighBandwidth)
 		{
-		__KTRACE_OPT(KPANIC,
-					 Kern::Printf("  Warning: Additional transactions requested but not a High Bandwidth ep"));
+        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP5, 
+                "  Warning: Additional transactions requested but not a High Bandwidth ep" );
 		}
 	}
 
 
 TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint: #%d", iLEndpointNum));
+	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES, 
+	        "TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint: #%d", iLEndpointNum );
 	// If the real endpoint this endpoint points to is also used by
 	// any other logical endpoint in any other setting of this interface
 	// then we leave the real endpoint marked as used. Otherwise we mark
@@ -332,17 +353,20 @@
 			const TUsbcLogicalEndpoint* const ep = ifc->iEndpoints[j];
 			if ((ep->iPEndpoint == iPEndpoint) && (ep != this))
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("  Physical endpoint still in use -> we leave it as is"));
+                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP1, 
+                        "  Physical endpoint still in use -> we leave it as is" );
 				return;
 				}
 			}
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Closing DMA channel"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP2, 
+	        "  Closing DMA channel" );
 	const TInt idx = iController->EpAddr2Idx(iPEndpoint->iEndpointAddr);
 	// If the endpoint doesn't support DMA (now or ever) the next operation will be a no-op.
 	iController->CloseDmaChannel(idx);
-	__KTRACE_OPT(KUSB, Kern::Printf("  Setting physical ep 0x%02x ifc number to NULL (was %d)",
-									iPEndpoint->iEndpointAddr, *iPEndpoint->iIfcNumber));
+    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP3, 
+            "  Setting physical ep 0x%02x ifc number to NULL (was %d)",
+            iPEndpoint->iEndpointAddr, *iPEndpoint->iIfcNumber );
 	iPEndpoint->iIfcNumber = NULL;
 	}
 
@@ -350,13 +374,15 @@
 TUsbcInterface::TUsbcInterface(TUsbcInterfaceSet* aIfcSet, TUint8 aSetting, TBool aNoEp0Requests)
 	: iEndpoints(2), iInterfaceSet(aIfcSet), iSettingCode(aSetting), iNoEp0Requests(aNoEp0Requests)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterface::TUsbcInterface()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACE_TUSBCINTERFACE_CONS,
+	        "TUsbcInterface::TUsbcInterface()" );
 	}
 
 
 TUsbcInterface::~TUsbcInterface()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterface::~TUsbcInterface()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACE_TUSBCINTERFACE_DES,
+	        "TUsbcInterface::~TUsbcInterface()" );
 	iEndpoints.ResetAndDestroy();
 	}
 
@@ -364,13 +390,15 @@
 TUsbcInterfaceSet::TUsbcInterfaceSet(const DBase* aClientId, TUint8 aIfcNum)
 	: iInterfaces(2), iClientId(aClientId), iInterfaceNumber(aIfcNum), iCurrentInterface(0)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceSet::TUsbcInterfaceSet()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACESET_TUSBCINTERFACESET_CONS, 
+	        "TUsbcInterfaceSet::TUsbcInterfaceSet()" );
 	}
 
 
 TUsbcInterfaceSet::~TUsbcInterfaceSet()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceSet::~TUsbcInterfaceSet()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACESET_TUSBCINTERFACESET_DES,
+	        "TUsbcInterfaceSet::~TUsbcInterfaceSet()" );
 	iInterfaces.ResetAndDestroy();
 	}
 
@@ -378,13 +406,15 @@
 TUsbcConfiguration::TUsbcConfiguration(TUint8 aConfigVal)
 	: iInterfaceSets(1), iConfigValue(aConfigVal)			// iInterfaceSets(1): granularity
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfiguration::TUsbcConfiguration()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGURATION_TUSBCCONFIGURATION_CONS, 
+	        "TUsbcConfiguration::TUsbcConfiguration()" );
 	}
 
 
 TUsbcConfiguration::~TUsbcConfiguration()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfiguration::~TUsbcConfiguration()"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGURATION_TUSBCCONFIGURATION_DES, 
+	        "TUsbcConfiguration::~TUsbcConfiguration()" );
 	iInterfaceSets.ResetAndDestroy();
 	}
 
--- a/kernel/eka/drivers/usbcc/ps_usbc.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcc/ps_usbc.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,6 +23,11 @@
 */
 
 #include <drivers/usbc.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "ps_usbcTraces.h"
+#endif
+
 
 
 /**
@@ -118,7 +123,8 @@
 */
 DUsbClientController::~DUsbClientController()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::~DUsbClientController()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES, "DUsbClientController::~DUsbClientController()" );
+	
 	if (iPowerHandler)
 		{
 		iPowerHandler->Remove();
@@ -127,7 +133,7 @@
 	// ResetAndDestroy() will call for every array element the destructor of the pointed-to object,
 	// before deleting the element itself, and closing the array.
 	iConfigs.ResetAndDestroy();
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::~DUsbClientController(): Done."));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES_DUP1, "DUsbClientController::~DUsbClientController(): Done." );
 	}
 
 
@@ -147,17 +153,17 @@
 */
 EXPORT_C void DUsbClientController::DisableClientStack()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DisableClientStack()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK, "DUsbClientController::DisableClientStack()" );
 	if (!iStackIsActive)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Already disabled - returning"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP1, "  Already disabled - returning" );
 		return;
 		}
 	iOtgClientConnect = EFalse;
 	TInt r = EvaluateOtgConnectFlags();					 // will disconnect UDC
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EvaluateOtgConnectFlags() failed: %d", r));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP2, "  Error: EvaluateOtgConnectFlags() failed: %d", r );
 		}
 
 	// Reset OTG features, leave attributes as is (just as in USB Reset case)
@@ -205,10 +211,10 @@
 */
 EXPORT_C void DUsbClientController::EnableClientStack()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnableClientStack()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK, "DUsbClientController::EnableClientStack()" );
 	if (iStackIsActive)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Already enabled - returning"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP1, "  Already enabled - returning" );
 		return;
 		}
 	iStackIsActive = ETrue;
@@ -216,13 +222,13 @@
 	TInt r = ActivateHardwareController();
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ActivateHardwareController() failed: %d", r));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP2, "  Error: ActivateHardwareController() failed: %d", r);
 		}
 	iOtgClientConnect = ETrue;
 	r = EvaluateOtgConnectFlags();							// may connect UDC
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EvaluateOtgConnectFlags() failed: %d", r));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP3, "  Error: EvaluateOtgConnectFlags() failed: %d", r);
 		}
 	}
 
@@ -233,7 +239,7 @@
 */
 EXPORT_C TBool DUsbClientController::IsActive()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::IsActive()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ISACTIVE, "DUsbClientController::IsActive()" );
 	return iStackIsActive;
 	}
 
@@ -244,11 +250,12 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterClientCallback(TUsbcClientCallback& aCallback)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterClientCallback()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK, "DUsbClientController::RegisterClientCallback()" );
 	if (iClientCallbacks.Elements() == KUsbcMaxListLength)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
-										  KUsbcMaxListLength));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP1, "  Error: Maximum list length reached: %d",
+                                          KUsbcMaxListLength);
+
 		return KErrGeneral;
 		}
 	TSglQueIter<TUsbcClientCallback> iter(iClientCallbacks);
@@ -256,7 +263,7 @@
 	while ((p = iter++) != NULL)
 		if (p == &aCallback)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("	 Error: ClientCallback @ 0x%x already registered", &aCallback));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP2, "    Error: ClientCallback @ 0x%x already registered", &aCallback);
 			return KErrAlreadyExists;
 			}
 	iClientCallbacks.AddLast(aCallback);
@@ -274,10 +281,10 @@
 */
 EXPORT_C DUsbClientController* DUsbClientController::UsbcControllerPointer(TInt aUdc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::UsbcControllerPointer()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER, "DUsbClientController::UsbcControllerPointer()" );
 	if (aUdc < 0 || aUdc > 1)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aUdc out of range (%d)", aUdc));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER_DUP1, "  Error: aUdc out of range (%d)", aUdc);
 		return NULL;
 		}
 	return UsbClientController[aUdc];
@@ -297,7 +304,7 @@
 */
 EXPORT_C void DUsbClientController::EndpointCaps(const DBase* aClientId, TDes8& aCapsBuf) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointCaps()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENDPOINTCAPS, "DUsbClientController::EndpointCaps()" );
 	// Here we do not simply call DUsbClientController::DeviceEndpointCaps(),
 	// because that function fills an array which comprises of _all_ endpoints,
 	// whereas this function omits ep0 and all unusable endpoints.
@@ -306,10 +313,10 @@
 	const TInt ifcset_num = ClientId2InterfaceNumber(aClientId);
 	for (TInt i = 2, j = 0; i < iDeviceTotalEndpoints; ++i)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Caps: RealEndpoint #%d", i));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP1, "DUsbClientController::Caps: RealEndpoint #%d", i);
 		if (iRealEndpoints[i].iCaps.iTypesAndDir != KUsbEpNotAvailable)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Caps: --> UsableEndpoint #%d", j));
+		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP2, "DUsbClientController::Caps: --> UsableEndpoint #%d", j);
 			data[j].iCaps = iRealEndpoints[i].iCaps;
 			if (ifcset_num < 0)
 				{
@@ -354,7 +361,7 @@
 */
 EXPORT_C void DUsbClientController::DeviceCaps(const DBase* aClientId, TDes8& aCapsBuf) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceCaps()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICECAPS, "DUsbClientController::DeviceCaps()" );
 	TUsbDeviceCaps caps;
 	caps().iTotalEndpoints = iDeviceUsableEndpoints;		// not DeviceTotalEndpoints()!
 	caps().iConnect = SoftConnectCaps();
@@ -435,17 +442,18 @@
 												 const TUsbcEndpointInfoArray aEndpointData,
 												 TInt aRealEpNumbers[], TUint32 aFeatureWord)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetInterface()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETINTERFACE, "DUsbClientController::SetInterface()" );
 	if (aInterfaceNum != 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  alternate interface setting request: #%d", aInterfaceNum));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP1, "  alternate interface setting request: #%d", aInterfaceNum);
+
 		}
 #ifndef USB_SUPPORTS_CONTROLENDPOINTS
 	for (TInt i = 0; i < aTotalEndpointsUsed; ++i)
 		{
 		if (aEndpointData[i].iType == KUsbEpTypeControl)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: control endpoints not supported"));
+		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP2, "  Error: control endpoints not supported");
 			return KErrNotSupported;
 			}
 		}
@@ -455,21 +463,21 @@
 	// The passed-in ifcset_num may be -1 now, but that's intended.
 	if (!CheckEpAvailability(aTotalEndpointsUsed, aEndpointData, ifcset_num))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: endpoints not (all) available"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP3, "  Error: endpoints not (all) available");
 		return KErrInUse;
 		}
 	// Create & setup new interface
 	TUsbcInterface* ifc = CreateInterface(aClientId, aInterfaceNum, aFeatureWord);
 	if (ifc == NULL)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ifc == NULL"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP4, "  Error: ifc == NULL");
 		return KErrGeneral;
 		}
 	// Create logical endpoints
 	TInt r = CreateEndpoints(ifc, aTotalEndpointsUsed, aEndpointData, aRealEpNumbers);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: CreateEndpoints() != KErrNone"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP5, "  Error: CreateEndpoints() != KErrNone");
 		DeleteInterface(ifc->iInterfaceSet->iInterfaceNumber, aInterfaceNum);
 		return r;
 		}
@@ -496,31 +504,31 @@
 */
 EXPORT_C TInt DUsbClientController::ReleaseInterface(const DBase* aClientId, TInt aInterfaceNum)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReleaseInterface(..., %d)", aInterfaceNum));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE, "DUsbClientController::ReleaseInterface(..., %d)", aInterfaceNum);
+	
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf(" interface not found")); // no error
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP1, " interface not found");
 		return KErrNone;
 		}
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf(" Error: interface number %d doesn't exist", ifcset));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP2, "Error: interface number %d doesn't exist", ifcset);
 		return KErrNotFound;
 		}
 	const TInt setting_count = ifcset_ptr->iInterfaces.Count();
 	if ((setting_count - 1) != aInterfaceNum)
 		{
-		__KTRACE_OPT(KUSB,
-					 Kern::Printf(" > Error: interface settings must be released in descending order:\n\r"
-								  "   %d setting(s) exist, #%d was requested to be released.\n\r"
-								  "   (#%d has to be released first)",
-								  setting_count, aInterfaceNum, setting_count - 1));
+	    OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP3, "> Error: interface settings must be released in descending order:\n\r"
+                                  "   %d setting(s) exist, #%d was requested to be released.\n\r"
+                                  "   (#%d has to be released first)",
+                                  setting_count, aInterfaceNum, setting_count - 1);
 		return KErrArgument;
 		}
 	// Tear down current setting (invalidate configured state)
-	__KTRACE_OPT(KUSB, Kern::Printf(" > tearing down InterfaceSet %d", ifcset));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP4, " > tearing down InterfaceSet %d", ifcset);
 	// Cancel all transfers on the current setting of this interface and deconfigure all its endpoints.
 	InterfaceSetTeardown(ifcset_ptr);
 	// 'Setting 0' means: delete all existing settings.
@@ -571,7 +579,7 @@
 	// If it was the last interface(set)...
 	if (iConfigs[0]->iInterfaceSets.Count() == 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  No ifc left -> turning off UDC"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP5, "  No ifc left -> turning off UDC");
 		// First disconnect the device from the bus
 		UsbDisconnect();
 		DeActivateHardwareController();
@@ -588,13 +596,13 @@
 */
 EXPORT_C TInt DUsbClientController::ReEnumerate()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReEnumerate()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REENUMERATE, "DUsbClientController::ReEnumerate()" );
 	// If, in an OTG setup, the client stack is disabled, there's no point in
 	// trying to reenumerate the device. In fact, we then don't even want to
 	// turn on the UDC via ActivateHardwareController().
 	if (!iStackIsActive)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Client stack disabled -> returning here"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REENUMERATE_DUP1, " Client stack disabled -> returning here" );
 		return KErrNotReady;
 		}
 	// We probably don't check here whether SoftConnectCaps() is ETrue, and
@@ -603,7 +611,7 @@
 	// no-ops if not supported by the PSL.
 	if (iConfigs[0]->iInterfaceSets.Count() == 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  > No interface registered -> no need to re-enumerate"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REENUMERATE_DUP2, "  > No interface registered -> no need to re-enumerate" );
 		return KErrNone;;
 		}
 	if (!iHardwareActivated)
@@ -612,7 +620,7 @@
 		const TInt r = ActivateHardwareController();
 		if (r != KErrNone)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ActivateHardwareController() failed: %d", r));
+		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REENUMERATE_DUP3, "  Error: ActivateHardwareController() failed: %d", r);
 				return r;
 				}
 		// Finally connect the device to the bus
@@ -638,25 +646,25 @@
 */
 EXPORT_C TInt DUsbClientController::PowerUpUdc()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerUpUdc()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERUPUDC, "DUsbClientController::PowerUpUdc()" );
 	// If, in an OTG setup, the client stack is disabled, we mustn't turn on
 	// the UDC via ActivateHardwareController() as that would already configure
 	// Ep0.
 	if (!iStackIsActive)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Client stack disabled -> returning here"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERUPUDC_DUP1, "  Client stack disabled -> returning here" );
 		return KErrNotReady;
 		}
 	if (iConfigs[0]->iInterfaceSets.Count() == 0)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  > No interface registered -> won't power up UDC"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERUPUDC_DUP2, "   > No interface registered -> won't power up UDC" );
 		return KErrNotReady;
 		}
 	// If the UDC is still off, we switch it on here.
 	const TInt r = ActivateHardwareController();
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ActivateHardwareController() failed: %d", r));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_POWERUPUDC_DUP3, "  Error: ActivateHardwareController() failed: %d", r);
 		}
 	return r;
 	}
@@ -670,14 +678,14 @@
 */
 EXPORT_C TInt DUsbClientController::UsbConnect()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::UsbConnect()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_USBCONNECT, "DUsbClientController::UsbConnect()" );
 #ifdef USB_OTG_CLIENT
 	iClientSupportReady = ETrue;
 	const TInt r = EvaluateOtgConnectFlags();
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	if (iUsbResetDeferred) // implies (iOtgHnpHandledByHw == ETrue)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Resetting USB Reset 'defer' flag"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_USBCONNECT_DUP1, "  Resetting USB Reset 'defer' flag" );
 		iUsbResetDeferred = EFalse;
 		(void) ProcessResetEvent(EFalse);
 		}
@@ -697,7 +705,7 @@
 */
 EXPORT_C TInt DUsbClientController::UsbDisconnect()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::UsbDisconnect()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_USBDISCONNECT, "DUsbClientController::UsbDisconnect()" );   
 #ifdef USB_OTG_CLIENT
 	iClientSupportReady = EFalse;
 	const TInt r = EvaluateOtgConnectFlags();
@@ -733,16 +741,16 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterForStatusChange(TUsbcStatusCallback& aCallback)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterForStatusChange()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE, "DUsbClientController::RegisterForStatusChange()" );
 	if (iStatusCallbacks.Elements() == KUsbcMaxListLength)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
-										  KUsbcMaxListLength));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP1, "  Error: Maximum list length reached: %d",
+                                          KUsbcMaxListLength);
 		return KErrGeneral;
 		}
 	if (IsInTheStatusList(aCallback))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Error: StatusCallback @ 0x%x already registered", &aCallback));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP2, "  Error: StatusCallback @ 0x%x already registered", &aCallback);
 		return KErrGeneral;
 		}
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
@@ -761,7 +769,7 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterForStatusChange(const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterForStatusChange()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE, "DUsbClientController::DeRegisterForStatusChange()" );
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcStatusCallback> iter(iStatusCallbacks);
@@ -770,13 +778,13 @@
 		{
 		if (p->Owner() == aClientId)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  removing StatusCallback @ 0x%x", p));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP1, "  removing StatusCallback @ 0x%x", p);
 			iStatusCallbacks.Remove(*p);
 		    __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 			return KErrNone;
 			}
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  client not found"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP2, "  client not found");
     __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 	return KErrNotFound;
 	}
@@ -799,16 +807,17 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterForEndpointStatusChange(TUsbcEndpointStatusCallback& aCallback)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterForEndpointStatusChange()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE, "DUsbClientController::RegisterForEndpointStatusChange()" );
 	if (iEpStatusCallbacks.Elements() == KUsbcMaxListLength)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
-										  KUsbcMaxListLength));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP1, "  Error: Maximum list length reached: %d",
+                                          KUsbcMaxListLength);
+
 		return KErrGeneral;
 		}
 	if (IsInTheEpStatusList(aCallback))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Error: EpStatusCallback @ 0x%x already registered", &aCallback));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP2, "  Error: EpStatusCallback @ 0x%x already registered", &aCallback);
 		return KErrGeneral;
 		}
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
@@ -827,7 +836,7 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterForEndpointStatusChange(const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterForEndpointStatusChange()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE, "DUsbClientController::DeRegisterForEndpointStatusChange()" );
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcEndpointStatusCallback> iter(iEpStatusCallbacks);
@@ -836,13 +845,13 @@
 		{
 		if (p->Owner() == aClientId)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  removing EpStatusCallback @ 0x%x", p));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP1, "  removing EpStatusCallback @ 0x%x", p);
 			iEpStatusCallbacks.Remove(*p);
 		    __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 			return KErrNone;
 			}
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  client not found"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP2, "  client not found");
     __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 	return KErrNotFound;
 	}
@@ -858,17 +867,18 @@
 */
 EXPORT_C TInt DUsbClientController::GetInterfaceNumber(const DBase* aClientId, TInt& aInterfaceNum) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetInterfaceNumber()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETINTERFACENUMBER, "DUsbClientController::GetInterfaceNumber()" );
+	
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error (ifc < 0)"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP1, "  Error (ifc < 0)");
 		return KErrNotFound;
 		}
 	const TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number %d doesn't exist", ifcset));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP2, "  Error: interface number %d doesn't exist", ifcset);
 		return KErrNotFound;
 		}
 	aInterfaceNum = ifcset_ptr->iCurrentInterface;
@@ -893,7 +903,8 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterClient(const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterClient(0x%x)", aClientId));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENT, "DUsbClientController::DeRegisterClient(0x%x)", aClientId);
+	
 	// Cancel all device state notification requests
 	DeRegisterForStatusChange(aClientId);
 	// Cancel all endpoint state notification requests
@@ -905,7 +916,7 @@
 	const TInt r = ReleaseInterface(aClientId, 0);
 	// Cancel all remaining (if any) read/write requests
 	DeleteRequestCallbacks(aClientId);
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterClient: Done."));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENT_DUP1, "DUsbClientController::DeRegisterClient: Done.");
 	return r;
 	}
 
@@ -919,12 +930,13 @@
 	const TUsbcLogicalEndpoint* const ep = iRealEndpoints[0].iLEndpoint;
 	if (iHighSpeed)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 size = %d (HS)", ep->iEpSize_Hs));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0PACKETSIZE, "  Ep0 size = %d (HS)", ep->iEpSize_Hs);
+		
 		return ep->iEpSize_Hs;
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 size = %d (FS)", ep->iEpSize_Fs));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0PACKETSIZE_DUP1, "  Ep0 size = %d (FS)", ep->iEpSize_Fs);
 		return ep->iEpSize_Fs;
 		}
 	}
@@ -938,7 +950,7 @@
 */
 EXPORT_C TInt DUsbClientController::Ep0Stall(const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Ep0Stall()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_EP0STALL, "DUsbClientController::Ep0Stall()" );
 	if (aClientId == iEp0ClientId)
 		{
 		ResetEp0DataOutVars();
@@ -959,7 +971,7 @@
 */
 EXPORT_C void DUsbClientController::SendEp0StatusPacket(const DBase* /* aClientId */)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SendEp0StatusPacket()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SENDEP0STATUSPACKET, "DUsbClientController::SendEp0StatusPacket()" );
 	SendEp0ZeroByteStatusPacket();
 	}
 
@@ -974,7 +986,7 @@
 */
 EXPORT_C TUsbcDeviceState DUsbClientController::GetDeviceStatus() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceStatus()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICESTATUS, "DUsbClientController::GetDeviceStatus()" );
 	return iDeviceState;
 	}
 
@@ -991,7 +1003,7 @@
 */
 EXPORT_C TEndpointState DUsbClientController::GetEndpointStatus(const DBase* aClientId, TInt aEndpointNum) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetEndpointStatus()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETENDPOINTSTATUS, "DUsbClientController::GetEndpointStatus()" );
 	return EndpointStallStatus(aEndpointNum) ?
 		EEndpointStateStalled :
 		EEndpointStateNotStalled;
@@ -1008,23 +1020,23 @@
 */
 EXPORT_C TInt DUsbClientController::SetupReadBuffer(TUsbcRequestCallback& aCallback)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetupReadBuffer()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETUPREADBUFFER, "DUsbClientController::SetupReadBuffer()" );
 	const TInt ep = aCallback.iRealEpNum;
-	__KTRACE_OPT(KUSB, Kern::Printf("  logical ep: #%d", aCallback.iEndpointNum));
-	__KTRACE_OPT(KUSB, Kern::Printf("  real ep:    #%d", ep));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP1, "  logical ep: #%d", aCallback.iEndpointNum);
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP2, "  real ep:    #%d", ep);
 	TInt err = KErrGeneral;
 	if (ep != 0)
 		{
 		if (iRequestCallbacks[ep])
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: RequestCallback already registered for that ep"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP3, "  Warning: RequestCallback already registered for that ep");
 			if (iRequestCallbacks[ep] == &aCallback)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  (this same RequestCallback @ 0x%x)", &aCallback));
+	            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP4, "  (this same RequestCallback @ 0x%x)", &aCallback);
 				}
 			else
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  (a different RequestCallback @ 0x%x)", &aCallback));
+                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP5, "  (a different RequestCallback @ 0x%x)", &aCallback);
 				}
 			return KErrNone;
 			}
@@ -1034,12 +1046,12 @@
 		// an ISR) _before_ the SetupEndpointRead function returns. Since we don't know the
 		// outcome, we have to provide the callback before making the setup call.
 		//
-		__KTRACE_OPT(KUSB, Kern::Printf("  adding RequestCallback[%d] @ 0x%x", ep, &aCallback));
+        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP6, "  adding RequestCallback[%d] @ 0x%x", ep, (TUint)&aCallback);
 		iRequestCallbacks[ep] = &aCallback;
 		if ((err = SetupEndpointRead(ep, aCallback)) != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  removing RequestCallback @ 0x%x (due to error)",
-											  &aCallback));
+	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP7, "  removing RequestCallback @ 0x%x (due to error)",
+                                              &aCallback);
 			iRequestCallbacks[ep] = NULL;
 			}
 		}
@@ -1047,24 +1059,24 @@
 		{
 		if (iEp0ReadRequestCallbacks.Elements() == KUsbcMaxListLength)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
-											  KUsbcMaxListLength));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP8, "  Error: Maximum list length reached: %d",
+                                              KUsbcMaxListLength);
 			return KErrGeneral;
 			}
 		if (IsInTheRequestList(aCallback))
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  RequestCallback @ 0x%x already registered", &aCallback));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP9, "   RequestCallback @ 0x%x already registered", &aCallback);
 			return KErrNone;
 			}
 		// Ep0 reads don't need to be prepared - there's always one pending
-		__KTRACE_OPT(KUSB, Kern::Printf("  adding RequestCallback @ 0x%x (ep0)", &aCallback));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP10, "  adding RequestCallback @ 0x%x (ep0)", &aCallback);
 	    const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 		iEp0ReadRequestCallbacks.AddLast(aCallback);
         __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 		err = KErrNone;
 		if (iEp0_RxExtraData)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  iEp0_RxExtraData: trying again..."));
+	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP11, "  iEp0_RxExtraData: trying again...");
 			const TBool rx_data = iEp0DataReceiving;
 		    const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 			err = ProcessEp0ReceiveDone(iEp0_RxExtraCount);
@@ -1082,11 +1094,11 @@
 					{
 					Ep0ReadSetupPktProceed();
 					}
-				__KTRACE_OPT(KUSB, Kern::Printf("  :-)"));
+	            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP12, "  :-)");
 				}
 			else
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: :-("));
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP13, "  Error: :-(");
 				err = KErrGeneral;
 				}
 			return err;
@@ -1106,22 +1118,23 @@
 */
 EXPORT_C TInt DUsbClientController::SetupWriteBuffer(TUsbcRequestCallback& aCallback)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetupWriteBuffer()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER, "DUsbClientController::SetupWriteBuffer()" );
 	TInt ep = aCallback.iRealEpNum;
-	__KTRACE_OPT(KUSB, Kern::Printf("  logical ep: #%d", aCallback.iEndpointNum));
-	__KTRACE_OPT(KUSB, Kern::Printf("  real ep:	   #%d", ep));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP1, "  logical ep: #%d", aCallback.iEndpointNum);
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP2, "  real ep:    #%d", ep);
+
 	if (iRequestCallbacks[ep])
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: RequestCallback already registered for that ep"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP3, "  Warning: RequestCallback already registered for that ep");
 		if (iRequestCallbacks[ep] == &aCallback)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  (this same RequestCallback @ 0x%x)", &aCallback));
+		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP4, "  (this same RequestCallback @ 0x%x)", &aCallback);
 			return KErrNone;
 			}
 		else
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  (a different RequestCallback @ 0x%x - poss. error)",
-											  &aCallback));
+	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP5, "  (a different RequestCallback @ 0x%x - poss. error)",
+                                              &aCallback);
 			return KErrGeneral;
 			}
 		}
@@ -1131,15 +1144,15 @@
 			{
 			if (iEp0_TxNonStdCount > aCallback.iLength)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep0 is sending less data than requested"));
+				OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP6, "  Warning: Ep0 is sending less data than requested");
 				if ((aCallback.iLength % iEp0MaxPacketSize == 0) && !aCallback.iZlpReqd)
 					{
-					__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Zlp should probably be requested"));
+		            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP7, "  Warning: Zlp should probably be requested");
 					}
 				}
 			else if (iEp0_TxNonStdCount < aCallback.iLength)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep0 is sending more data than requested"));
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP8, "  Warning: Ep0 is sending more data than requested");
 				}
 			iEp0_TxNonStdCount = 0;
 			}
@@ -1151,22 +1164,21 @@
 	// However this is necessary because the transfer request might complete (through
 	// an ISR) _before_ the SetupEndpointWrite function returns. Since we don't know the
 	// outcome, we have to provide the callback before making the setup call.
-	//
-	__KTRACE_OPT(KUSB, Kern::Printf("  adding RequestCallback[%d] @ 0x%x", ep, &aCallback));
+    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP9, "  adding RequestCallback[%d] @ 0x%x", ep, (TUint)&aCallback);
 	iRequestCallbacks[ep] = &aCallback;
 	if (ep == KEp0_Tx)
 		{
 		iEp0ClientDataTransmitting = ETrue;			 // this must be set before calling SetupEndpointZeroWrite
 		if (SetupEndpointZeroWrite(aCallback.iBufferStart, aCallback.iLength, aCallback.iZlpReqd) != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  removing RequestCallback @ 0x%x (due to error)", &aCallback));
+		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP10, "  removing RequestCallback @ 0x%x (due to error)", &aCallback);
 			iRequestCallbacks[ep] = NULL;
 			iEp0ClientDataTransmitting = EFalse;
 			}
 		}
 	else if (SetupEndpointWrite(ep, aCallback) != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  removing RequestCallback @ 0x%x (due to error)", &aCallback));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP11, "  removing RequestCallback @ 0x%x (due to error)", &aCallback);
 		iRequestCallbacks[ep] = NULL;
 		}
 	return KErrNone;
@@ -1183,10 +1195,11 @@
 */
 EXPORT_C void DUsbClientController::CancelReadBuffer(const DBase* aClientId, TInt aRealEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CancelReadBuffer(%d)", aRealEndpoint));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CANCELREADBUFFER, "DUsbClientController::CancelReadBuffer(%d)", aRealEndpoint);
+	
 	if (aRealEndpoint < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ep # < 0: %d", aRealEndpoint));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CANCELREADBUFFER_DUP1, "  Error: ep # < 0: %d", aRealEndpoint);
 		return;
 		}
 	// Note that we here don't cancel Ep0 read requests at the PSL level!
@@ -1209,10 +1222,11 @@
 */
 EXPORT_C void DUsbClientController::CancelWriteBuffer(const DBase* aClientId, TInt aRealEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CancelWriteBuffer(%d)", aRealEndpoint));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER, "DUsbClientController::CancelWriteBuffer(%d)", aRealEndpoint);
+	
 	if (aRealEndpoint < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ep # < 0: %d", aRealEndpoint));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER_DUP1, "  Error: ep # < 0: %d", aRealEndpoint);
 		return;
 		}
 	if (aRealEndpoint == 0)
@@ -1240,7 +1254,8 @@
 */
 EXPORT_C TInt DUsbClientController::HaltEndpoint(const DBase* aClientId, TInt aEndpointNum)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::HaltEndpoint(%d)", aEndpointNum));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_HALTENDPOINT, "DUsbClientController::HaltEndpoint(%d)", aEndpointNum);
+	
 	const TInt r = StallEndpoint(aEndpointNum);
 	if (r == KErrNone)
 		{
@@ -1264,7 +1279,7 @@
 */
 EXPORT_C TInt DUsbClientController::ClearHaltEndpoint(const DBase* aClientId, TInt aEndpointNum)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ClearHaltEndpoint(%d)", aEndpointNum));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CLEARHALTENDPOINT, "DUsbClientController::ClearHaltEndpoint(%d)", aEndpointNum);
 	const TInt r = ClearStallEndpoint(aEndpointNum);
 	if (r == KErrNone)
 		{
@@ -1291,15 +1306,15 @@
 */
 EXPORT_C TInt DUsbClientController::SetDeviceControl(const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetDeviceControl()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETDEVICECONTROL, "DUsbClientController::SetDeviceControl()" );
 	if (iEp0DeviceControl)
 		{
 		if (iEp0DeviceControl == aClientId)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Device Control already owned by this client"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP1, "  Warning: Device Control already owned by this client" );
 			return KErrNone;
 			}
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device Control already claimed by a different client"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP2, "  Error: Device Control already claimed by a different client");
 		return KErrGeneral;
 		}
 	iEp0DeviceControl = aClientId;
@@ -1318,20 +1333,20 @@
 */
 EXPORT_C TInt DUsbClientController::ReleaseDeviceControl(const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReleaseDeviceControl()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL, "DUsbClientController::ReleaseDeviceControl()" );
 	if (iEp0DeviceControl)
 		{
 		if (iEp0DeviceControl == aClientId)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Releasing Device Control"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP1, "  Releasing Device Control" );
 			iEp0DeviceControl = NULL;
 			return KErrNone;
 			}
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device Control owned by a different client"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP2, "  Error: Device Control owned by a different client" );
 		}
 	else
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device Control not owned by any client"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP3, "  Error: Device Control not owned by any client" );
 		}
 	return KErrGeneral;
 	}
@@ -1346,7 +1361,7 @@
 */
 EXPORT_C TUint DUsbClientController::EndpointZeroMaxPacketSizes() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointZeroMaxPacketSizes()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENDPOINTZEROMAXPACKETSIZES, "DUsbClientController::EndpointZeroMaxPacketSizes()" );
 	return iRealEndpoints[0].iCaps.iSizes;
 	}
 
@@ -1362,8 +1377,9 @@
 */
 EXPORT_C TInt DUsbClientController::SetEndpointZeroMaxPacketSize(TInt aMaxPacketSize)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetEndpointZeroMaxPacketSize(%d)",
-									aMaxPacketSize));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE, "DUsbClientController::SetEndpointZeroMaxPacketSize(%d)",
+                                    aMaxPacketSize);
+	
 
 	if (DeviceHighSpeedCaps())
 		{
@@ -1373,12 +1389,12 @@
 
 	if (!(iRealEndpoints[0].iCaps.iSizes & PacketSize2Mask(aMaxPacketSize)))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid size"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP1, "  Error: invalid size");
 		return KErrNotSupported;
 		}
 	if (iRealEndpoints[0].iLEndpoint->iEpSize_Fs == aMaxPacketSize)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  this packet size already set -> returning"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP2, "  this packet size already set -> returning");
 		return KErrNone;
 		}
 	const TUsbcLogicalEndpoint* const ep0_0 = iRealEndpoints[0].iLEndpoint;
@@ -1415,7 +1431,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetDeviceDescriptor(DThread* aThread, TDes8& aDeviceDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTOR, "DUsbClientController::GetDeviceDescriptor()" );
 	return iDescriptors.GetDeviceDescriptorTC(aThread, aDeviceDescriptor);
 	}
 
@@ -1431,7 +1447,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetDeviceDescriptor(DThread* aThread, const TDes8& aDeviceDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetDeviceDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETDEVICEDESCRIPTOR, "DUsbClientController::SetDeviceDescriptor()" );
 	return iDescriptors.SetDeviceDescriptorTC(aThread, aDeviceDescriptor);
 	}
 
@@ -1447,7 +1463,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetDeviceDescriptorSize(DThread* aThread, TDes8& aSize)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceDescriptorSize()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTORSIZE, "DUsbClientController::GetDeviceDescriptorSize()" );
 	// We do not really enquire here....
 	const TPtrC8 size(reinterpret_cast<const TUint8*>(&KUsbDescSize_Device), sizeof(KUsbDescSize_Device));
 	return Kern::ThreadDesWrite(aThread, &aSize, size, 0);
@@ -1465,7 +1481,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetConfigurationDescriptor(DThread* aThread, TDes8& aConfigurationDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetConfigurationDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTOR, "DUsbClientController::GetConfigurationDescriptor()" );
 	return iDescriptors.GetConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -1482,7 +1498,7 @@
 EXPORT_C TInt DUsbClientController::SetConfigurationDescriptor(DThread* aThread,
 															   const TDes8& aConfigurationDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetConfigurationDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETCONFIGURATIONDESCRIPTOR, "DUsbClientController::SetConfigurationDescriptor()" );
 	return iDescriptors.SetConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -1498,7 +1514,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetConfigurationDescriptorSize(DThread* aThread, TDes8& aSize)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetConfigurationDescriptorSize()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTORSIZE, "DUsbClientController::GetConfigurationDescriptorSize()" );
 	// We do not really enquire here....
 	const TPtrC8 size(reinterpret_cast<const TUint8*>(&KUsbDescSize_Config), sizeof(KUsbDescSize_Config));
 	return Kern::ThreadDesWrite(aThread, &aSize, size, 0);
@@ -1516,7 +1532,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetOtgDescriptor(DThread* aThread, TDes8& aOtgDesc) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetOtgDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETOTGDESCRIPTOR, "DUsbClientController::GetOtgDescriptor()" );
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1534,7 +1550,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetOtgDescriptor(DThread* aThread, const TDesC8& aOtgDesc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetOtgDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR, "DUsbClientController::SetOtgDescriptor()" );
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1548,38 +1564,38 @@
 	// Check descriptor validity
 	if (otg[0] != KUsbDescSize_Otg || otg[1] != KUsbDescType_Otg || otg[2] > 3)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid OTG descriptor"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP1, "  Error: Invalid OTG descriptor" );
 		return KErrGeneral;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  iOtgFuncMap before: 0x%x", iOtgFuncMap));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP2, "  iOtgFuncMap before: 0x%x", iOtgFuncMap);
 	// Update value in controller as well
 	const TUint8 hnp = otg[2] & KUsbOtgAttr_HnpSupp;
 	const TUint8 srp = otg[2] & KUsbOtgAttr_SrpSupp;
 	if (hnp && !srp)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Invalid OTG attribute combination (HNP && !SRP"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP3, " Warning: Invalid OTG attribute combination (HNP && !SRP");
 		}
 	if (hnp && !(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Setting attribute KUsbOtgAttr_HnpSupp"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP4, "   Setting attribute KUsbOtgAttr_HnpSupp");
 		iOtgFuncMap |= KUsbOtgAttr_HnpSupp;
 		}
 	else if (!hnp && (iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Removing attribute KUsbOtgAttr_HnpSupp"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP5, "  Removing attribute KUsbOtgAttr_HnpSupp");
 		iOtgFuncMap &= ~KUsbOtgAttr_HnpSupp;
 		}
 	if (srp && !(iOtgFuncMap & KUsbOtgAttr_SrpSupp))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Setting attribute KUsbOtgAttr_SrpSupp"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP6, "  Setting attribute KUsbOtgAttr_SrpSupp");
 		iOtgFuncMap |= KUsbOtgAttr_SrpSupp;
 		}
 	else if (!srp && (iOtgFuncMap & KUsbOtgAttr_SrpSupp))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Removing attribute KUsbOtgAttr_SrpSupp"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP7, "  Removing attribute KUsbOtgAttr_SrpSupp");
 		iOtgFuncMap &= ~KUsbOtgAttr_SrpSupp;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  iOtgFuncMap after:  0x%x", iOtgFuncMap));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP8, "  iOtgFuncMap after:  0x%x", iOtgFuncMap);
 	return iDescriptors.SetOtgDescriptor(otg);
 	}
 
@@ -1593,7 +1609,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetOtgFeatures(DThread* aThread, TDes8& aFeatures) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetOtgFeatures()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETOTGFEATURES, "DUsbClientController::GetOtgFeatures()" );
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1612,7 +1628,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetCurrentOtgFeatures(TUint8& aFeatures) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetCurrentOtgFeatures()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCURRENTOTGFEATURES, "DUsbClientController::GetCurrentOtgFeatures()" );
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1633,16 +1649,16 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterForOtgFeatureChange(TUsbcOtgFeatureCallback& aCallback)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterForOtgFeatureChange()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE, "DUsbClientController::RegisterForOtgFeatureChange()" );
 	if (iOtgCallbacks.Elements() == KUsbcMaxListLength)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
-										  KUsbcMaxListLength));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP1, "  Error: Maximum list length reached: %d",
+                                          KUsbcMaxListLength);
 		return KErrGeneral;
 		}
 	if (IsInTheOtgFeatureList(aCallback))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Error: OtgFeatureCallback @ 0x%x already registered", &aCallback));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP2, "  Error: OtgFeatureCallback @ 0x%x already registered", &aCallback);
 		return KErrAlreadyExists;
 		}
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
@@ -1661,7 +1677,7 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterForOtgFeatureChange(const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterForOtgFeatureChange()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE, "DUsbClientController::DeRegisterForOtgFeatureChange()" );
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcOtgFeatureCallback> iter(iOtgCallbacks);
@@ -1670,13 +1686,13 @@
 		{
 		if (!aClientId || p->Owner() == aClientId)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  removing OtgFeatureCallback @ 0x%x", p));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP1, "  removing OtgFeatureCallback @ 0x%x", p);
 			iOtgCallbacks.Remove(*p);
             __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 			return KErrNone;
 			}
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  client not found"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP2, "  client not found");
     __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 	return KErrNotFound;
 	}
@@ -1696,12 +1712,13 @@
 EXPORT_C TInt DUsbClientController::GetInterfaceDescriptor(DThread* aThread, const DBase* aClientId,
 														   TInt aSettingNum, TDes8& aInterfaceDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetInterfaceDescriptor(x, 0x%08x, %d, y)",
-									aClientId, aSettingNum));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR, "DUsbClientController::GetInterfaceDescriptor(x, 0x%08x, %d, y)",
+                                    (TUint)aClientId, aSettingNum);
+	
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	return iDescriptors.GetInterfaceDescriptorTC(aThread, aInterfaceDescriptor, ifcset, aSettingNum);
@@ -1731,19 +1748,19 @@
 EXPORT_C TInt DUsbClientController::SetInterfaceDescriptor(DThread* aThread, const DBase* aClientId,
 														   TInt aSettingNum, const TDes8& aInterfaceDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetInterfaceDescriptor(x, 0x%08x, %d, y)",
-									aClientId, aSettingNum));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR, "DUsbClientController::SetInterfaceDescriptor(x, 0x%08x, %d, y)",
+                                    (TUint)aClientId, aSettingNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	TBuf8<KUsbDescSize_Interface> new_ifc;
 	TInt r = Kern::ThreadDesRead(aThread, &aInterfaceDescriptor, new_ifc, 0);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Copying interface descriptor buffer failed (%d)", r));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP2, "  Error: Copying interface descriptor buffer failed (%d)", r);
 		return r;
 		}
 	const TInt ifcset_new = new_ifc[2];
@@ -1751,7 +1768,7 @@
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number %d doesn't exist", ifcset));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP3, "  Error: interface number %d doesn't exist", ifcset);
 		return KErrNotFound;
 		}
 	if (ifc_num_changes)
@@ -1760,32 +1777,32 @@
 		if (InterfaceExists(ifcset_new))
 			{
 			// Obviously we cannot accept a number that is already used by another interface.
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number %d already in use", ifcset_new));
+		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP4, "  Error: interface number %d already in use", ifcset_new);
 			return KErrArgument;
 			}
 		if (ifcset_ptr->iInterfaces.Count() > 1)
 			{
 			// We allow the interface number to be changed only when it's the only setting.
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface has more than one alternate setting"));
+	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP5, "  Error: interface has more than one alternate setting");
 			return KErrArgument;
 			}
 		if (aSettingNum != 0)
 			{
 			// We allow the interface number to be changed only when it's the default setting.
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number can only be changed for setting 0"));
+	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP6, " Error: interface number can only be changed for setting 0");
 			return KErrArgument;
 			}
 		}
 	if ((r = iDescriptors.SetInterfaceDescriptor(new_ifc, ifcset, aSettingNum)) != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iDescriptors.SetInterfaceDescriptorfailed"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP7, "  Error: iDescriptors.SetInterfaceDescriptorfailed");
 		return r;
 		}
 	if (ifc_num_changes)
 		{
 		// Alright then, let's do it...
-		__KTRACE_OPT(KUSB, Kern::Printf("  about to change interface number from %d to %d",
-										ifcset, ifcset_new));
+		OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP8, "  about to change interface number from %d to %d",
+                                        ifcset, ifcset_new);
 		ifcset_ptr->iInterfaceNumber = ifcset_new;
 		}
 	return KErrNone;
@@ -1806,11 +1823,11 @@
 EXPORT_C TInt DUsbClientController::GetInterfaceDescriptorSize(DThread* aThread, const DBase* aClientId,
 															   TInt /*aSettingNum*/, TDes8& aSize)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetInterfaceDescriptorSize()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE, "DUsbClientController::GetInterfaceDescriptorSize()" );
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE_DUP1, "  Error: Interface not found from client ID" );
 		return KErrNotFound;
 		}
 	// Actually, we do not really enquire here....
@@ -1837,12 +1854,12 @@
 														  TInt aSettingNum, TInt aEndpointNum,
 														  TDes8& aEndpointDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
-									aClientId, aSettingNum, aEndpointNum));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR, "DUsbClientController::GetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
+                                    (TUint)aClientId, aSettingNum, aEndpointNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	return iDescriptors.GetEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -1868,12 +1885,12 @@
 														  TInt aSettingNum, TInt aEndpointNum,
 														  const TDes8& aEndpointDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
-									aClientId, aSettingNum, aEndpointNum));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR, "DUsbClientController::SetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
+                                    (TUint)aClientId, aSettingNum, aEndpointNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	return iDescriptors.SetEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -1898,12 +1915,12 @@
 															  TInt aSettingNum, TInt aEndpointNum,
 															  TDes8& aSize)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetEndpointDescriptorSize(x, 0x%08x, %d, %d, y)",
-									aClientId, aSettingNum, aEndpointNum));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE, "DUsbClientController::GetEndpointDescriptorSize(x, 0x%08x, %d, %d, y)",
+                                    (TUint)aClientId, aSettingNum, aEndpointNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP1, "D  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	TInt s;
@@ -1916,7 +1933,7 @@
 		}
 	else
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: endpoint descriptor not found"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP2, "  Error: endpoint descriptor not found");
 		}
 	return r;
 	}
@@ -1936,7 +1953,7 @@
 EXPORT_C TInt DUsbClientController::GetDeviceQualifierDescriptor(DThread* aThread,
 																 TDes8& aDeviceQualifierDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceQualifierDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICEQUALIFIERDESCRIPTOR, "DUsbClientController::GetDeviceQualifierDescriptor()" );
 	return iDescriptors.GetDeviceQualifierDescriptorTC(aThread, aDeviceQualifierDescriptor);
 	}
 
@@ -1956,7 +1973,7 @@
 EXPORT_C TInt DUsbClientController::SetDeviceQualifierDescriptor(DThread* aThread,
 																 const TDes8& aDeviceQualifierDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetDeviceQualifierDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETDEVICEQUALIFIERDESCRIPTOR, "DUsbClientController::SetDeviceQualifierDescriptor()" );
 	return iDescriptors.SetDeviceQualifierDescriptorTC(aThread, aDeviceQualifierDescriptor);
 	}
 
@@ -1975,7 +1992,7 @@
 EXPORT_C TInt DUsbClientController::GetOtherSpeedConfigurationDescriptor(DThread* aThread,
 																		 TDes8& aConfigurationDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetOtherSpeedConfigurationDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETOTHERSPEEDCONFIGURATIONDESCRIPTOR, "DUsbClientController::GetOtherSpeedConfigurationDescriptor()" );
 	return iDescriptors.GetOtherSpeedConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -1995,7 +2012,7 @@
 EXPORT_C TInt DUsbClientController::SetOtherSpeedConfigurationDescriptor(DThread* aThread,
 																		 const TDes8& aConfigurationDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetOtherSpeedConfigurationDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETOTHERSPEEDCONFIGURATIONDESCRIPTOR, "DUsbClientController::SetOtherSpeedConfigurationDescriptor()" );
 	return iDescriptors.SetOtherSpeedConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -2016,12 +2033,12 @@
 																  TInt aSettingNum,
 																  TDes8& aInterfaceDescriptor)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y)",
-									aClientId, aSettingNum));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK, "DUsbClientController::GetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y)",
+                                    (TUint)aClientId, aSettingNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK_DUP1, "D  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	return iDescriptors.GetCSInterfaceDescriptorTC(aThread, aInterfaceDescriptor, ifcset, aSettingNum);
@@ -2048,18 +2065,17 @@
 																  TInt aSettingNum,
 																  const TDes8& aInterfaceDescriptor, TInt aSize)
 	{
-	__KTRACE_OPT(KUSB,
-				 Kern::Printf("DUsbClientController::SetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y, %d)",
-							  aClientId, aSettingNum, aSize));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK, "DUsbClientController::SetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y, %d)",
+                              (TUint)aClientId, aSettingNum, aSize);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	if (aSize < 2)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aSize < 2 (%d)", aSize));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP2, "  Error: aSize < 2 (%d)", aSize);
 		return KErrArgument;
 		}
 	return iDescriptors.SetCSInterfaceDescriptorTC(aThread, aInterfaceDescriptor, ifcset, aSettingNum, aSize);
@@ -2081,13 +2097,12 @@
 EXPORT_C TInt DUsbClientController::GetCSInterfaceDescriptorBlockSize(DThread* aThread, const DBase* aClientId,
 																	  TInt aSettingNum, TDes8& aSize)
 	{
-	__KTRACE_OPT(KUSB,
-				 Kern::Printf("DUsbClientController::GetCSInterfaceDescriptorBlockSize(x, 0x%08x, %d, y)",
-							  aClientId, aSettingNum));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE, "DUsbClientController::GetCSInterfaceDescriptorBlockSize(x, 0x%08x, %d, y)",
+                              (TUint)aClientId, aSettingNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	TInt s;
@@ -2099,7 +2114,7 @@
 		}
 	else
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: cs interface descriptor not found"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP2, "  Error: cs interface descriptor not found");
 		}
 	return r;
 	}
@@ -2122,13 +2137,12 @@
 																 TInt aSettingNum, TInt aEndpointNum,
 																 TDes8& aEndpointDescriptor)
 	{
-	__KTRACE_OPT(KUSB,
-				 Kern::Printf("DUsbClientController::GetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
-							  aClientId, aSettingNum, aEndpointNum));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK, "DUsbClientController::GetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
+                              (TUint)aClientId, aSettingNum, aEndpointNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	return iDescriptors.GetCSEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -2157,18 +2171,17 @@
 																 TInt aSettingNum, TInt aEndpointNum,
 																 const TDes8& aEndpointDescriptor, TInt aSize)
 	{
-	__KTRACE_OPT(KUSB,
-				 Kern::Printf("DUsbClientController::SetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
-							  aClientId, aSettingNum, aEndpointNum));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK, "DUsbClientController::SetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
+                              (TUint)aClientId, aSettingNum, aEndpointNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	if (aSize < 2)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aSize < 2 (%d)", aSize));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP2, "  Error: aSize < 2 (%d)", aSize);
 		return KErrArgument;
 		}
 	return iDescriptors.SetCSEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -2193,13 +2206,12 @@
 																	 TInt aSettingNum, TInt aEndpointNum,
 																	 TDes8& aSize)
 	{
-	__KTRACE_OPT(KUSB,
-				 Kern::Printf("DUsbClientController::GetCSEndpointDescriptorBlockSize(x, 0x%08x, %d, %d, y)",
-							  aClientId, aSettingNum, aEndpointNum));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE, "DUsbClientController::GetCSEndpointDescriptorBlockSize(x, 0x%08x, %d, %d, y)",
+                              (TUint)aClientId, aSettingNum, aEndpointNum);
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP1, "  Error: Interface not found from client ID");
 		return KErrNotFound;
 		}
 	TInt s;
@@ -2212,7 +2224,7 @@
 		}
 	else
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: cs endpoint descriptor not found"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP2, "  Error: cs endpoint descriptor not found");
 		}
 	return r;
 	}
@@ -2229,7 +2241,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetStringDescriptorLangId(DThread* aThread, TDes8& aLangId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetStringDescriptorLangId()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTORLANGID, "DUsbClientController::GetStringDescriptorLangId()" );
 	return iDescriptors.GetStringDescriptorLangIdTC(aThread, aLangId);
 	}
 
@@ -2242,7 +2254,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetStringDescriptorLangId(TUint16 aLangId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetStringDescriptorLangId()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTORLANGID, "DUsbClientController::SetStringDescriptorLangId()" );
 	return iDescriptors.SetStringDescriptorLangId(aLangId);
 	}
 
@@ -2262,7 +2274,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetManufacturerStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetManufacturerStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETMANUFACTURERSTRINGDESCRIPTOR, "DUsbClientController::GetManufacturerStringDescriptor()" );
 	return iDescriptors.GetManufacturerStringDescriptorTC(aThread, aString);
 	}
 
@@ -2283,7 +2295,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetManufacturerStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetManufacturerStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETMANUFACTURERSTRINGDESCRIPTOR, "DUsbClientController::SetManufacturerStringDescriptor()" );
 	return iDescriptors.SetManufacturerStringDescriptorTC(aThread, aString);
 	}
 
@@ -2295,7 +2307,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveManufacturerStringDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveManufacturerStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVEMANUFACTURERSTRINGDESCRIPTOR, "DUsbClientController::RemoveManufacturerStringDescriptor()" );
 	return iDescriptors.RemoveManufacturerStringDescriptor();
 	}
 
@@ -2315,7 +2327,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetProductStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetProductStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETPRODUCTSTRINGDESCRIPTOR, "DUsbClientController::GetProductStringDescriptor()" );
 	return iDescriptors.GetProductStringDescriptorTC(aThread, aString);
 	}
 
@@ -2336,7 +2348,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetProductStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetProductStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETPRODUCTSTRINGDESCRIPTOR, "DUsbClientController::SetProductStringDescriptor()" );
 	return iDescriptors.SetProductStringDescriptorTC(aThread, aString);
 	}
 
@@ -2348,7 +2360,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveProductStringDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveProductStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVEPRODUCTSTRINGDESCRIPTOR, "DUsbClientController::RemoveProductStringDescriptor()" );
 	return iDescriptors.RemoveProductStringDescriptor();
 	}
 
@@ -2368,7 +2380,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetSerialNumberStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetSerialNumberStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETSERIALNUMBERSTRINGDESCRIPTOR, "DUsbClientController::GetSerialNumberStringDescriptor()" );
 	return iDescriptors.GetSerialNumberStringDescriptorTC(aThread, aString);
 	}
 
@@ -2389,7 +2401,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetSerialNumberStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetSerialNumberStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETSERIALNUMBERSTRINGDESCRIPTOR, "DUsbClientController::SetSerialNumberStringDescriptor()" );
 	return iDescriptors.SetSerialNumberStringDescriptorTC(aThread, aString);
 	}
 
@@ -2401,7 +2413,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveSerialNumberStringDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveSerialNumberStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVESERIALNUMBERSTRINGDESCRIPTOR, "DUsbClientController::RemoveSerialNumberStringDescriptor()" );
 	return iDescriptors.RemoveSerialNumberStringDescriptor();
 	}
 
@@ -2421,7 +2433,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetConfigurationStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetConfigurationStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCONFIGURATIONSTRINGDESCRIPTOR, "DUsbClientController::GetConfigurationStringDescriptor()" );
 	return iDescriptors.GetConfigurationStringDescriptorTC(aThread, aString);
 	}
 
@@ -2442,7 +2454,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetConfigurationStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetConfigurationStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETCONFIGURATIONSTRINGDESCRIPTOR, "DUsbClientController::SetConfigurationStringDescriptor()" );
 	return iDescriptors.SetConfigurationStringDescriptorTC(aThread, aString);
 	}
 
@@ -2454,7 +2466,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveConfigurationStringDescriptor()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveConfigurationStringDescriptor()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVECONFIGURATIONSTRINGDESCRIPTOR, "DUsbClientController::RemoveConfigurationStringDescriptor()" );
 	return iDescriptors.RemoveConfigurationStringDescriptor();
 	}
 
@@ -2472,7 +2484,8 @@
 */
 EXPORT_C TInt DUsbClientController::GetStringDescriptor(DThread* aThread, TUint8 aIndex, TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetStringDescriptor(%d)", aIndex));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTOR, "DUsbClientController::GetStringDescriptor(%d)", aIndex);
+	
 	return iDescriptors.GetStringDescriptorTC(aThread, aIndex, aString);
 	}
 
@@ -2491,7 +2504,8 @@
 */
 EXPORT_C TInt DUsbClientController::SetStringDescriptor(DThread* aThread, TUint8 aIndex, const TDes8& aString)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetStringDescriptor(%d)", aIndex));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTOR, "DUsbClientController::SetStringDescriptor(%d)", aIndex);
+	
 	return iDescriptors.SetStringDescriptorTC(aThread, aIndex, aString);
 	}
 
@@ -2504,7 +2518,8 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveStringDescriptor(TUint8 aIndex)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveStringDescriptor(%d)", aIndex));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REMOVESTRINGDESCRIPTOR, "DUsbClientController::RemoveStringDescriptor(%d)", aIndex);
+	
 	return iDescriptors.RemoveStringDescriptor(aIndex);
 	}
 
@@ -2525,7 +2540,7 @@
 EXPORT_C TInt DUsbClientController::AllocateEndpointResource(const DBase* /*aClientId*/, TInt aEndpointNum,
 															 TUsbcEndpointResource aResource)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::AllocateEndpointResource()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ALLOCATEENDPOINTRESOURCE, "DUsbClientController::AllocateEndpointResource()" );
 	return AllocateEndpointResource(aEndpointNum, aResource);
 	}
 
@@ -2544,7 +2559,7 @@
 EXPORT_C TInt DUsbClientController::DeAllocateEndpointResource(const DBase* /*aClientId*/, TInt aEndpointNum,
 															   TUsbcEndpointResource aResource)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeAllocateEndpointResource()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEALLOCATEENDPOINTRESOURCE, "DUsbClientController::DeAllocateEndpointResource()" );
 	return DeAllocateEndpointResource(aEndpointNum, aResource);
 	}
 
@@ -2564,20 +2579,19 @@
 EXPORT_C TBool DUsbClientController::QueryEndpointResource(const DBase* /*aClientId*/, TInt aEndpointNum,
 														   TUsbcEndpointResource aResource)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::QueryEndpointResource()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_QUERYENDPOINTRESOURCE, "DUsbClientController::QueryEndpointResource()" );
 	return QueryEndpointResource(aEndpointNum, aResource);
 	}
 
 
 EXPORT_C TInt DUsbClientController::EndpointPacketSize(const DBase* aClientId, TInt aEndpointNum)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointPacketSize(0x%08x, %d)",
-									aClientId, aEndpointNum));
-
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE, "DUsbClientController::EndpointPacketSize(0x%08x, %d)",
+                                    (TUint)aClientId, aEndpointNum);
 	const TUsbcInterfaceSet* const ifcset_ptr = ClientId2InterfacePointer(aClientId);
 	if (!ifcset_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface or clientid not found"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP1, "  Error: interface or clientid not found");
 		return -1;
 		}
 	const TUsbcInterface* const ifc_ptr = ifcset_ptr->iInterfaces[ifcset_ptr->iCurrentInterface];
@@ -2588,14 +2602,14 @@
 		const TUsbcLogicalEndpoint* const ep = ep_array[i];
 		if (EpAddr2Idx(ep->iPEndpoint->iEndpointAddr) == static_cast<TUint>(aEndpointNum))
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Endpoint packet sizes: FS = %d  HS = %d",
-											ep->iEpSize_Fs, ep->iEpSize_Hs));
+		    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP2, "  Endpoint packet sizes: FS = %d  HS = %d",
+                                            ep->iEpSize_Fs, ep->iEpSize_Hs);
 			const TInt size = iHighSpeed ? ep->iEpSize_Hs : ep->iEpSize_Fs;
-			__KTRACE_OPT(KUSB, Kern::Printf("  Returning %d", size));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP3, "  Returning %d", size);
 			return size;
 			}
 		}
-	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: endpoint not found"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP4, "  Error: endpoint not found");
 	return -1;
 	}
 
@@ -2606,7 +2620,7 @@
 
 EXPORT_C TBool DUsbClientController::CurrentlyUsingHighSpeed()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CurrentlyUsingHighSpeed()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CURRENTLYUSINGHIGHSPEED, "DUsbClientController::CurrentlyUsingHighSpeed()" );
 	return EFalse;
 	}
 
@@ -2626,10 +2640,10 @@
 */
 DUsbClientController* DUsbClientController::RegisterUdc(TInt aUdc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterUdc()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERUDC, "DUsbClientController::RegisterUdc()" );
 	if (aUdc < 0 || aUdc > (KUsbcMaxUdcs - 1))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aUdc out of range (%d)", aUdc));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERUDC_DUP1, "  Error: aUdc out of range (%d)", aUdc);
 		return NULL;
 		}
 	return UsbClientController[aUdc] = this;
@@ -2712,7 +2726,7 @@
 												TUsbcStringDescriptor* aConfig,
                                                 TUsbcOtgDescriptor* aOtgDesc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::InitialiseBaseClass()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS, "DUsbClientController::InitialiseBaseClass()" );
 	// We don't want the host to see us (at least not yet):
 	UsbDisconnect();
 
@@ -2720,7 +2734,7 @@
 	if (iDescriptors.Init(aDeviceDesc, aConfigDesc, aLangId, aManufacturer, aProduct,
 						  aSerialNum, aConfig, aOtgDesc) !=	KErrNone)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Error: Descriptor initialization failed"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP1, "  Error: Descriptor initialization failed");
 		return EFalse;
 		}
 
@@ -2761,27 +2775,27 @@
 
 	// Initialise the array of physical endpoints
 	iDeviceTotalEndpoints = DeviceTotalEndpoints();
-	__KTRACE_OPT(KUSB, Kern::Printf("  DeviceTotalEndpoints: %d", iDeviceTotalEndpoints));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP2, "  DeviceTotalEndpoints: %d", iDeviceTotalEndpoints);
 	// KUsbcMaxEndpoints doesn't include ep 0
 	if ((iDeviceTotalEndpoints > (KUsbcMaxEndpoints + 2)) ||
 		((iDeviceTotalEndpoints * sizeof(TUsbcPhysicalEndpoint)) > sizeof(iRealEndpoints)))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: too many endpoints! (change KUsbcMaxEndpoints: %d)",
-										  KUsbcMaxEndpoints));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP3, "  Error: too many endpoints! (change KUsbcMaxEndpoints: %d)",
+                                          KUsbcMaxEndpoints);
 		goto exit_1;
 		}
 	caps = DeviceEndpointCaps();
 	for (TInt i = 0; i < iDeviceTotalEndpoints; ++i)
 		{
 		iRealEndpoints[i].iEndpointAddr = EpIdx2Addr(i);
-		__KTRACE_OPT(KUSB, Kern::Printf("  Caps[%02d] - iTypes: 0x%08x iSizes: 0x%08x",
-										i, caps[i].iTypesAndDir, caps[i].iSizes));
+		OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP4, "  Caps[%02d] - iTypes: 0x%08x iSizes: 0x%08x",
+                                        i, caps[i].iTypesAndDir, caps[i].iSizes);
 		iRealEndpoints[i].iCaps = caps[i];
 		iRealEndpoints[i].iCaps.iReserved[0] = 0;
 		iRealEndpoints[i].iCaps.iReserved[1] = 0;
 		if ((i > 1) && (caps[i].iTypesAndDir != KUsbEpNotAvailable))
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  --> UsableEndpoint: #%d", i));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP5, "  --> UsableEndpoint: #%d", i);
 			iDeviceUsableEndpoints++;
 			}
 		}
@@ -2790,14 +2804,14 @@
 	// and virtual 0 is real 0):
 	// -- Ep0 OUT
 	iEp0MaxPacketSize = caps[0].MaxPacketSize();
-	__KTRACE_OPT(KUSB, Kern::Printf("  using Ep0 maxpacketsize of %d bytes", iEp0MaxPacketSize));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP6, "  using Ep0 maxpacketsize of %d bytes", iEp0MaxPacketSize);
 	info.iSize = iEp0MaxPacketSize;
 	ep = new TUsbcLogicalEndpoint(this, 0, info, NULL, &iRealEndpoints[KEp0_Out]);
 	if (!ep)
 		{
 		goto exit_1;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  creating ep: mapping real ep %d --> logical ep 0", KEp0_Out));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP7, "  creating ep: mapping real ep %d --> logical ep 0", KEp0_Out);
 	iRealEndpoints[KEp0_Out].iLEndpoint = ep;
 	// -- Ep0 IN
 	info.iDir = KUsbEpDirIn;
@@ -2806,7 +2820,7 @@
 		{
 		goto exit_2;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("  creating ep: mapping real ep %d --> logical ep 0", KEp0_In));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP8, "  creating ep: mapping real ep %d --> logical ep 0", KEp0_In);
 	iRealEndpoints[KEp0_In].iLEndpoint = ep;
 
 	// Create the power handler
@@ -2824,7 +2838,7 @@
 		// There shouldn't really be any PSL that doesn't support Device State
 		// tracking, but we cannot simply enforce it as we have to preserve
 		// backwards compatibility.
-		__KTRACE_OPT(KUSB, Kern::Printf("  Warning: USB Device State tracking not supported by PSL"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP9, "  Warning: USB Device State tracking not supported by PSL");
 		}
 
 	return ETrue;
@@ -2901,7 +2915,7 @@
 	  iDisablePullUpOnDPlus(NULL),
 	  iOtgContext(NULL)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DUsbClientController()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_CONS, "DUsbClientController::DUsbClientController()" );
 
 #ifndef SEPARATE_USB_DFC_QUEUE
 	iPowerUpDfc.SetDfcQ(Kern::DfcQue0());
@@ -2927,7 +2941,7 @@
 */
 TInt DUsbClientController::DeviceEventNotification(TUsbcDeviceEvent anEvent)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceEventNotification()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICEEVENTNOTIFICATION, "DUsbClientController::DeviceEventNotification()" );
 
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
@@ -2961,8 +2975,8 @@
 */
 void DUsbClientController::EndpointRequestComplete(TUsbcRequestCallback* aCallback)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointRequestComplete(%p)", aCallback));
-
+	OstTraceDefExt1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTREQUESTCOMPLETE, "DUsbClientController::EndpointRequestComplete(%p)", aCallback);
+	
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
 	// from here).
@@ -2995,16 +3009,17 @@
 // This function is called by the PSL from within an ISR -- so we have to take care what we do here
 // (and also in all functions that get called from here).
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::HandleHnpRequest(%d)", aHnpState));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST, "DUsbClientController::HandleHnpRequest(%d)", aHnpState);
+	
 
 	if (!iOtgSupport)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP1, "  Error: Request only supported on a OTG device");
 		return;
 		}
 	if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP2, "  Error: Request only valid if OTG device supports HNP");
 		return;
 		}
 	//	(case KUsbFeature_B_HnpEnable:)
@@ -3044,8 +3059,8 @@
 */
 TInt DUsbClientController::Ep0RequestComplete(TInt aRealEndpoint, TInt aCount, TInt aError)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Ep0RequestComplete(%d)", aRealEndpoint));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE, "DUsbClientController::Ep0RequestComplete(%d)", aRealEndpoint);
+	
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
 	// from here).
@@ -3053,16 +3068,17 @@
 	__ASSERT_DEBUG((aRealEndpoint < 2), Kern::Fault(KUsbPILPanicCat, __LINE__));
 	if (aError != KErrNone && aError != KErrPrematureEnd)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf(" Error: Ep0 request failed (code %d). "
-										"Setting up new Read request.", aError));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP1, " Error: Ep0 request failed (code %d). "
+                                        "Setting up new Read request.", aError);
+
 		if (aRealEndpoint == KEp0_Rx)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf(" (RX request failed)"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP2, " (RX request failed)");
 			StallEndpoint(KEp0_Out);
 			}
 		else
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf(" (TX request failed)"));
+	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP3, " (TX request failed)");
 			iEp0WritePending = EFalse;
 			StallEndpoint(KEp0_In);
 			}
@@ -3090,7 +3106,7 @@
 		{
 		// we're done & no write request has been set up.
 		// so: setup an Ep0 read again
-		__KTRACE_OPT(KUSB, Kern::Printf(" Setting up new Ep0 read request."));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP4, " Setting up new Ep0 read request.");
 		SetupEndpointZeroRead();
 		}
 	return r;
@@ -3103,7 +3119,7 @@
 */
 void DUsbClientController::MoveToAddressState()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::MoveToAddressState()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_MOVETOADDRESSSTATE, "DUsbClientController::MoveToAddressState()" );
 
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
@@ -3124,8 +3140,8 @@
 */
 void DUsbClientController::SetCurrent(TInt aCurrent)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetCurrent(%d)", aCurrent));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCURRENT, "DUsbClientController::SetCurrent(%d)", aCurrent);
+	
 	// Not much for the moment... (What should we do here?)
 	return;
 	}
@@ -3137,20 +3153,21 @@
 
 TInt DUsbClientController::OpenDmaChannel(TInt aRealEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OpenDmaChannel(%d)", aRealEndpoint));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_OPENDMACHANNEL, "DUsbClientController::OpenDmaChannel(%d)", aRealEndpoint);
+	
 	return KErrNone;
 	}
 
 
 void DUsbClientController::CloseDmaChannel(TInt aRealEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CloseDmaChannel(%d)", aRealEndpoint));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CLOSEDMACHANNEL, "DUsbClientController::CloseDmaChannel(%d)", aRealEndpoint);
 	}
 
 
 TBool DUsbClientController::CableDetectWithoutPowerCaps() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CableDetectWithoutPowerCaps()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CABLEDETECTWITHOUTPOWERCAPS, "DUsbClientController::CableDetectWithoutPowerCaps()" );
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3158,7 +3175,7 @@
 
 TBool DUsbClientController::DeviceHighSpeedCaps() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceHighSpeedCaps()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICEHIGHSPEEDCAPS, "DUsbClientController::DeviceHighSpeedCaps()" );
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3166,7 +3183,7 @@
 
 TBool DUsbClientController::DeviceResourceAllocV2Caps() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceResourceAllocV2Caps()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICERESOURCEALLOCV2CAPS, "DUsbClientController::DeviceResourceAllocV2Caps()" );
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3174,7 +3191,7 @@
 
 TBool DUsbClientController::DeviceHnpHandledByHardwareCaps() const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceHnpHandledByHardwareCaps()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICEHNPHANDLEDBYHARDWARECAPS, "DUsbClientController::DeviceHnpHandledByHardwareCaps()" );
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3182,7 +3199,8 @@
 
 TInt DUsbClientController::EnterTestMode(TInt aTestSelector)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnterTestMode(%d)", aTestSelector));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENTERTESTMODE, "DUsbClientController::EnterTestMode(%d)", aTestSelector);
+	
 	// Should be overridden in PSL if applicable.
 	return KErrNotSupported;
 	}
@@ -3190,35 +3208,35 @@
 
 TBool DUsbClientController::PowerDownWhenActive() const
 	{
- 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerDownWhenActive()"));
+ 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERDOWNWHENACTIVE, "DUsbClientController::PowerDownWhenActive()" );
  	return EFalse;
 	}
 
 
 TInt DUsbClientController::PowerDown()
 	{
- 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerDown()"));
+ 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERDOWN, "DUsbClientController::PowerDown()" );
  	return KErrNone;
 	}
 
 
 TInt DUsbClientController::PowerUp()
 	{
- 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerUp()"));
+ 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERUP, "DUsbClientController::PowerUp()" );
  	return KErrNone;
 	}
 
 
 TInt DUsbClientController::OtgEnableUdc()
 	{
- 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OtgEnableUdc()"));
+ 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_OTGENABLEUDC, "DUsbClientController::OtgEnableUdc()" );
  	return KErrNone;
 	}
 
 
 TInt DUsbClientController::OtgDisableUdc()
    	{
- 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OtgDisableUdc()"));
+ 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_OTGDISABLEUDC, "DUsbClientController::OtgDisableUdc()" );
  	return KErrNone;
 	}
 
@@ -3229,18 +3247,18 @@
 
 TInt DUsbClientController::DeRegisterClientCallback(const DBase* aClientId)
     {
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterClientCallback()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK, "DUsbClientController::DeRegisterClientCallback()" );
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
 	TSglQueIter<TUsbcClientCallback> iter(iClientCallbacks);
 	TUsbcClientCallback* p;
 	while ((p = iter++) != NULL)
 		if (p->Owner() == aClientId)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  removing ClientCallback @ 0x%x", p));
+			 OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP1, "  removing ClientCallback @ 0x%x", p);
 			iClientCallbacks.Remove(*p);
 			return KErrNone;
 			}
-	__KTRACE_OPT(KUSB, Kern::Printf("  Client not found"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP2, "  Client not found");
 	return KErrNotFound;
     }
 
@@ -3249,28 +3267,28 @@
 												const TUsbcEndpointInfoArray& aEndpointData,
 												TInt aIfcNumber) const
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CheckEpAvailability()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY, "DUsbClientController::CheckEpAvailability()" );
 	if (aEndpointsUsed > KMaxEndpointsPerClient)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: too many endpoints claimed (%d)", aEndpointsUsed));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP1, "  Error: too many endpoints claimed (%d)", aEndpointsUsed);
 		return EFalse;
 		}
 	TBool reserve[KUsbcEpArraySize]; // iDeviceTotalEndpoints can be equal to 32
 	memset(reserve, EFalse, sizeof(reserve));				// reset the array
 	for (TInt i = 0; i < aEndpointsUsed; ++i)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  checking for (user) endpoint #%d availability...", i + 1));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP2, "  checking for (user) endpoint #%d availability...", i + 1);
 		TInt j = 2;
 		while (j < iDeviceTotalEndpoints)
 			{
 			if ((iRealEndpoints[j].EndpointSuitable(&aEndpointData[i], aIfcNumber)) &&
 				(reserve[j] == EFalse))
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("  ---> found suitable endpoint: RealEndpoint #%d", j));
+		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP3, "  ---> found suitable endpoint: RealEndpoint #%d", j);
 				reserve[j] = ETrue;							// found one: mark this ep as reserved
 				break;
 				}
-			__KTRACE_OPT(KUSB, Kern::Printf("  -> endpoint not suitable: RealEndpoint #%d", j));
+            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP4, "  -> endpoint not suitable: RealEndpoint #%d", j);
 			j++;
 			}
 		if (j == iDeviceTotalEndpoints)
@@ -3287,7 +3305,8 @@
 // concurrent interfaces supported by the configuration."  But since we permit the user to
 // change interface numbers, we can neither assume nor enforce anything about them here.
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CreateInterface(x, aIfc=%d)", aIfc));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE, "DUsbClientController::CreateInterface(x, aIfc=%d)", aIfc);
+	
 	TUsbcInterfaceSet* ifcset_ptr = NULL;
 	TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	TBool new_ifc;
@@ -3298,7 +3317,7 @@
 		const TInt num_ifcsets = iConfigs[0]->iInterfaceSets.Count();
 		if (num_ifcsets == 255)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Too many interfaces already exist: 255"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP1, "  Error: Too many interfaces already exist: 255");
 			return NULL;
 			}
 		// Find the smallest interface number that has not yet been used.
@@ -3309,7 +3328,7 @@
 				{
 				if ((iConfigs[0]->iInterfaceSets[i]->iInterfaceNumber) == ifcset)
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("  interface number %d already used", ifcset));
+			        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP2, "  interface number %d already used", ifcset);
 					n_used = ETrue;
 					break;
 					}
@@ -3321,20 +3340,19 @@
 			}
 		if (ifcset == 256)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no available interface number found"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP3, "  Error: no available interface number found");
 			return NULL;
 			}
 		// append the ifcset
-		__KTRACE_OPT(KUSB, Kern::Printf("  creating new InterfaceSet %d first", ifcset));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP4, "  creating new InterfaceSet %d first", ifcset);
 		if (aIfc != 0)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface setting number (1): %d", aIfc));
+	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP5, "  Error: invalid interface setting number (1): %d", aIfc);
 			return NULL;
 			}
 		if ((ifcset_ptr = new TUsbcInterfaceSet(aClientId, ifcset)) == NULL)
 			{
-			__KTRACE_OPT(KPANIC,
-						 Kern::Printf("  Error: new TUsbcInterfaceSet(aClientId, ifcset_num) failed"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP6, "  Error: new TUsbcInterfaceSet(aClientId, ifcset_num) failed");
 			return NULL;
 			}
 		iConfigs[0]->iInterfaceSets.Append(ifcset_ptr);
@@ -3343,20 +3361,20 @@
 		{
 		// use an existent ifcset
 		new_ifc = EFalse;
-		__KTRACE_OPT(KUSB, Kern::Printf("  using existing InterfaceSet %d", ifcset));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP7, "  using existing InterfaceSet %d", ifcset);
 		ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 		if (aIfc != ifcset_ptr->iInterfaces.Count())
 			{
 			// 9.2.3: "Alternate settings range from zero to one less than the number of alternate
 			// settings for a specific interface." (Thus we can here only append a setting.)
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface setting number (2): %d", aIfc));
+	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP8, "  Error: invalid interface setting number (2): %d", aIfc);
 			return NULL;
 			}
 		// Check whether the existing interface belongs indeed to this client
 		if (ifcset_ptr->iClientId != aClientId)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iClientId (%p) != aClientId (%p)",
-											  ifcset_ptr->iClientId, aClientId));
+	        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP9, "  Error: iClientId (%p) != aClientId (%p)",
+                                              ifcset_ptr->iClientId, aClientId);
 			return NULL;
 			}
 		}
@@ -3364,7 +3382,7 @@
 	TUsbcInterface* const ifc_ptr = new TUsbcInterface(ifcset_ptr, aIfc, no_ep0_requests);
 	if (!ifc_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: new TUsbcInterface(ifcset, aIfc) failed"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP10, "  Error: new TUsbcInterface(ifcset, aIfc) failed");
 		if (new_ifc)
 			{
 			DeleteInterfaceSet(ifcset);
@@ -3387,7 +3405,7 @@
 										   const TUsbcEndpointInfoArray& aEndpointData,
 										   TInt aRealEpNumbers[])
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CreateEndpoints()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CREATEENDPOINTS, "DUsbClientController::CreateEndpoints()" );
 	const TInt ifc_num = aIfc->iInterfaceSet->iInterfaceNumber;
 	const TInt start_ep = 2;
 	for (TInt i = 0; i < aEndpointsUsed; ++i)
@@ -3401,7 +3419,7 @@
 																		  aIfc, &iRealEndpoints[j]);
 				if (!ep)
 					{
-					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: new TUsbcLogicalEndpoint() failed"));
+					OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP1, "  Error: new TUsbcLogicalEndpoint() failed");
 					aIfc->iEndpoints.ResetAndDestroy();
 					RESET_SETTINGRESERVE;
 					return KErrNoMemory;
@@ -3413,16 +3431,16 @@
 					// For details see last paragraph of 5.7.3 "Interrupt Transfer Packet Size Constraints".
 					if ((ep->iInfo.iType == KUsbEpTypeInterrupt) && (ep->iEpSize_Hs > 64))
 						{
-						__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: INT ep HS size = %d on default ifc setting",
-														  ep->iEpSize_Hs));
-						__KTRACE_OPT(KPANIC, Kern::Printf("           (should be <= 64)"));
+		                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP2, "  Warning: INT ep HS size = %d on default ifc setting",
+                                                          ep->iEpSize_Hs);
+		                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP3, "           (should be <= 64)");
 						}
 					// For details see last paragraph of 5.6.3 "Isochronous Transfer Packet Size Constraints".
 					else if ((ep->iInfo.iType == KUsbEpTypeIsochronous) && (ep->iInfo.iSize > 0))
 						{
-						__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: ISO ep size = %d on default ifc setting",
-														  ep->iInfo.iSize));
-						__KTRACE_OPT(KPANIC, Kern::Printf("           (should be zero or ep non-existent)"));
+						OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP4, " Warning: ISO ep size = %d on default ifc setting",
+                                                          ep->iInfo.iSize);
+						OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP5, "           (should be zero or ep non-existent)");
 						}
 					}
 				// If the endpoint doesn't support DMA (now or never) the next operation
@@ -3430,23 +3448,21 @@
 				const TInt r = OpenDmaChannel(j);
 				if (r != KErrNone)
 					{
-					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Opening of DMA channel failed"));
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP6, "  Error: Opening of DMA channel failed");
 					aIfc->iEndpoints.ResetAndDestroy();
 					RESET_SETTINGRESERVE;
 					return r;
 					}
-				__KTRACE_OPT(KUSB, Kern::Printf("  creating ep: mapping real ep %d -> logical ep %d",
-												j, i + 1));
+				OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP7, "  creating ep: mapping real ep %d -> logical ep %d",
+                                                j, i + 1);
 				iRealEndpoints[j].iIfcNumber = &aIfc->iInterfaceSet->iInterfaceNumber;
 				iRealEndpoints[j].iSettingReserve = ETrue;
-				__KTRACE_OPT(KUSB,
-							 Kern::Printf("  ep->iInfo: iType=0x%x iDir=0x%x iSize=%d iInterval=%d",
-										  ep->iInfo.iType, ep->iInfo.iDir, ep->iInfo.iSize,
-										  ep->iInfo.iInterval));
-				__KTRACE_OPT(KUSB,
-							 Kern::Printf("  ep->iInfo: iInterval_Hs=%d iTransactions=%d iExtra=%d",
-										  ep->iInfo.iInterval_Hs, ep->iInfo.iTransactions,
-										  ep->iInfo.iExtra));
+				OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP8, "  ep->iInfo: iType=0x%x iDir=0x%x iSize=%d iInterval=%d",
+                                          ep->iInfo.iType, ep->iInfo.iDir, ep->iInfo.iSize,
+                                          ep->iInfo.iInterval);
+				OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP9, "  ep->iInfo: iInterval_Hs=%d iTransactions=%d iExtra=%d",
+                                          ep->iInfo.iInterval_Hs, ep->iInfo.iTransactions,
+                                          ep->iInfo.iExtra);
 				// Store real endpoint numbers:
 				// array[x] holds the number for logical ep x.
 				aRealEpNumbers[i + 1] = j;
@@ -3455,12 +3471,12 @@
 			}
 		}
 	aRealEpNumbers[0] = 0;								// ep0: 0.
-	__KTRACE_OPT(KUSB,{
-		Kern::Printf("  Endpoint Mapping for Interface %d / Setting %d:", ifc_num, aIfc->iSettingCode);
-		Kern::Printf("Logical  | Real");
-		Kern::Printf("Endpoint | Endpoint");
-		for (TInt ep = 0; ep <= aEndpointsUsed; ++ep) Kern::Printf("   %2d       %3d",ep, aRealEpNumbers[ep]);
-		});
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP10, "  Endpoint Mapping for Interface %d / Setting %d:", ifc_num, aIfc->iSettingCode); 
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP11, "Logical  | Real");
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP12, "Endpoint | Endpoint");
+    for (TInt ep = 0; ep <= aEndpointsUsed; ++ep)
+        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP13, "   %2d       %3d",ep, aRealEpNumbers[ep]);
+
 	RESET_SETTINGRESERVE;
 	return KErrNone;
 	}
@@ -3469,7 +3485,7 @@
 TInt DUsbClientController::SetupIfcDescriptor(TUsbcInterface* aIfc, TUsbcClassInfo& aClass, DThread* aThread,
 											  TDesC8* aString, const TUsbcEndpointInfoArray& aEndpointData)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetupIfcDescriptor()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR, "DUsbClientController::SetupIfcDescriptor()" );
 
 	// Interface descriptor
 	TUsbcDescriptorBase* d = TUsbcInterfaceDescriptor::New(aIfc->iInterfaceSet->iInterfaceNumber,
@@ -3478,7 +3494,7 @@
 														   aClass);
 	if (!d)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ifc desc failed."));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP1, "  Error: Memory allocation for ifc desc failed." );
 		return KErrNoMemory;
 		}
 	iDescriptors.InsertDescriptor(d);
@@ -3490,13 +3506,13 @@
 		TUint strlen = Kern::ThreadGetDesLength(aThread, aString);
 		if (strlen > KUsbStringDescStringMaxSize)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: $ descriptor too long - string will be truncated"));
+		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP2, "  Warning: $ descriptor too long - string will be truncated" );
 			strlen = KUsbStringDescStringMaxSize;
 			}
 		HBuf8* const stringbuf = HBuf8::New(strlen);
 		if (!stringbuf)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ifc $ desc string failed."));
+	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP3, "  Error: Memory allocation for ifc $ desc string failed." );
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			return KErrNoMemory;
@@ -3506,7 +3522,7 @@
 		TInt r = Kern::ThreadDesRead(aThread, aString, *stringbuf, 0);
 		if (r != KErrNone)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
+	         OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP4, "  Error: Thread read error" );
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			delete stringbuf;
@@ -3515,7 +3531,7 @@
 		TUsbcStringDescriptor* const sd = TUsbcStringDescriptor::New(*stringbuf);
 		if (!sd)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ifc $ desc failed."));
+	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP5, "  Error: Memory allocation for ifc $ desc failed." );
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			delete stringbuf;
@@ -3539,8 +3555,8 @@
 			if (aEndpointData[i].iExtra != 2)
 				{
 				// ...then it must be a Audio Class endpoint descriptor. Else...
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EP desc extension > 2 bytes (%d)",
-												  aEndpointData[i].iExtra));
+				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP6, "  Error: EP desc extension > 2 bytes (%d)",
+                                                  aEndpointData[i].iExtra);
 				iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 												 aIfc->iSettingCode);
 				return KErrArgument;
@@ -3555,7 +3571,7 @@
 			}
 		if (!d)
 			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ep desc #%d failed.", i));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP7, "  Error: Memory allocation for ep desc #%d failed.", i);
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			return KErrNoMemory;
@@ -3621,23 +3637,23 @@
 
 TInt DUsbClientController::ActivateHardwareController()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ActivateHardwareController()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER, "DUsbClientController::ActivateHardwareController()" );
 	if (iHardwareActivated)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  already active -> returning"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP1, "  already active -> returning" );
 		return KErrNone;
 		}
 	// Initialise HW
 	TInt r = StartUdc();
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: StartUdc() failed"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP2, "  Error: StartUdc() failed" );
 		return KErrHardwareNotAvailable;
 		}
 	r = OtgEnableUdc();							   // turn on UDC (OTG flavour)
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: OtgEnableUdc() failed: %d", r));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP3, "  Error: OtgEnableUdc() failed: %d", r);
 		}
 	iHardwareActivated = ETrue;
 
@@ -3658,7 +3674,7 @@
 	ConfigureEndpoint(1, ep0_1->iInfo);
 	iEp0MaxPacketSize = ep0_0->iInfo.iSize;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("  Controller activated."));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP4, "  Controller activated.");
 	if (UsbConnectionStatus())
 		{
 		if (iDeviceState == EUsbcDeviceStateUndefined)
@@ -3673,10 +3689,10 @@
 
 void DUsbClientController::DeActivateHardwareController()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeActivateHardwareController()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER, "DUsbClientController::DeActivateHardwareController()" );
 	if (!iHardwareActivated)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  not active -> returning"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP1, "  not active -> returning" );
 		return;
 		}
 	// Deconfigure & disable endpoint zero
@@ -3686,11 +3702,11 @@
 	TInt r = OtgDisableUdc();					  // turn off UDC (OTG flavour)
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: OtgDisableUdc() failed: %d", r));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP2, "  Error: OtgDisableUdc() failed: %d", r);
 		}
 	StopUdc();
 	iHardwareActivated = EFalse;
-	__KTRACE_OPT(KUSB, Kern::Printf("  Controller deactivated."));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP3, "  Controller deactivated.");
 	if (UsbConnectionStatus())
 		{
 		NextDeviceState(EUsbcDeviceStateAttached);
@@ -3701,17 +3717,18 @@
 
 void DUsbClientController::DeleteInterfaceSet(TInt aIfcSet)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteInterfaceSet(%d)", aIfcSet));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEINTERFACESET, "DUsbClientController::DeleteInterfaceSet(%d)", aIfcSet);
+	
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(aIfcSet);
 	if (!ifcset_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface number: %d", aIfcSet));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP1, "  Error: invalid interface number: %d", aIfcSet);
 		return;
 		}
 	const TInt idx = iConfigs[0]->iInterfaceSets.Find(ifcset_ptr);
 	if (idx == KErrNotFound)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface not found in array"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP2, "  Error: interface not found in array");
 		return;
 		}
 	//Add this mutex to protect the interface set data structure
@@ -3731,16 +3748,17 @@
 
 void DUsbClientController::DeleteInterface(TInt aIfcSet, TInt aIfc)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteInterface(%d, %d)", aIfcSet, aIfc));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE, "DUsbClientController::DeleteInterface(%d, %d)", aIfcSet, aIfc);
+	
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(aIfcSet);
 	if (!ifcset_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface number: %d", aIfcSet));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP1, " Error: invalid interface number: %d", aIfcSet);
 		return;
 		}
 	if (ifcset_ptr->iInterfaces.Count() <= aIfc)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface setting: %d", aIfc));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP2, "  Error: invalid interface setting: %d", aIfc);
 		return;
 		}
 	//Add this mutex to protect the interface set data structure
@@ -3754,7 +3772,7 @@
 
 	if (aIfc == ifcset_ptr->iCurrentInterface)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf(" > Warning: deleting current interface setting"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP3, " > Warning: deleting current interface setting");
 		ifcset_ptr->iCurrentInterface = 0;
 		}
 	if (NKern::CurrentContext() == EThread)
@@ -3767,8 +3785,9 @@
 
 void DUsbClientController::CancelTransferRequests(TInt aRealEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CancelTransferRequests(aRealEndpoint=%d)",
-									aRealEndpoint));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CANCELTRANSFERREQUESTS, "DUsbClientController::CancelTransferRequests(aRealEndpoint=%d)",
+                                    aRealEndpoint);
+	
 	const DBase* const clientId = PEndpoint2ClientId(aRealEndpoint);
 	if (EpIdx2Addr(aRealEndpoint) & KUsbEpAddress_In)
 		{
@@ -3784,7 +3803,7 @@
 void DUsbClientController::DeleteRequestCallback(const DBase* aClientId, TInt aEndpointNum,
 												 TTransferDirection aTransferDir)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteRequestCallback()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK, "DUsbClientController::DeleteRequestCallback()" );
 	// Ep0 OUT
 	if (aEndpointNum == 0)
 		{
@@ -3797,7 +3816,7 @@
 				{
 				__ASSERT_DEBUG((p->iRealEpNum == 0), Kern::Fault(KUsbPILPanicCat, __LINE__));
 				__ASSERT_DEBUG((p->iTransferDir == EControllerRead), Kern::Fault(KUsbPILPanicCat, __LINE__));
-				__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x (ep0)", p));
+			    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP1, "  removing RequestCallback @ 0x%x (ep0)", p);
 				iEp0ReadRequestCallbacks.Remove(*p);
 				}
 			}
@@ -3810,7 +3829,7 @@
 		{
  		__ASSERT_DEBUG((p->Owner() == aClientId), Kern::Fault(KUsbPILPanicCat, __LINE__));
 		__ASSERT_DEBUG((p->iTransferDir == aTransferDir), Kern::Fault(KUsbPILPanicCat, __LINE__));
-		__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x", p));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP2, "  removing RequestCallback @ 0x%x", p);
 		iRequestCallbacks[aEndpointNum] = NULL;
 		}
 	}
@@ -3819,7 +3838,7 @@
 void DUsbClientController::DeleteRequestCallbacks(const DBase* aClientId)
 	{
 	// aClientId being NULL means: delete all requests for *all* clients.
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteRequestCallbacks()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS, "DUsbClientController::DeleteRequestCallbacks()" );
 	// Ep0 OUT
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcRequestCallback> iter(iEp0ReadRequestCallbacks);
@@ -3828,7 +3847,7 @@
 		{
 		if (!aClientId || p->Owner() == aClientId)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x (ep0)", p));
+			 OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP1, "  removing RequestCallback @ 0x%x (ep0)", p);
 			iEp0ReadRequestCallbacks.Remove(*p);
 			}
 		}
@@ -3839,7 +3858,7 @@
 		TUsbcRequestCallback* const p = iRequestCallbacks[i];
 		if (p && (!aClientId || p->Owner() == aClientId))
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x", p));
+	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP2, "  removing RequestCallback @ 0x%x", p);
 			iRequestCallbacks[i] = NULL;
 			}
 		}
@@ -3848,7 +3867,7 @@
 
 void DUsbClientController::StatusNotify(TUsbcDeviceState aState, const DBase* aClientId)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::StatusNotify()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_STATUSNOTIFY, "DUsbClientController::StatusNotify()" );
 
 	// This function may be called by the PSL (via chapter9.cpp) from within an
 	// ISR -- so we have to take care what we do here (and also in all
@@ -3860,7 +3879,7 @@
 		{
 		if (!aClientId || aClientId == p->Owner())
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  notifying LDD @ 0x%x about %d", p->Owner(), aState));
+		    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_STATUSNOTIFY_DUP1, "  notifying LDD @ 0x%x about %d", (TUint)p->Owner(), (TUint)aState);
 			p->SetState(aState);
 			p->DoCallback();
 			}
@@ -3870,7 +3889,7 @@
 
 void DUsbClientController::EpStatusNotify(TInt aRealEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EpStatusNotify()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY, "DUsbClientController::EpStatusNotify()" );
 
 	// This function may be called by the PSL (via chapter9.cpp) from within an
 	// ISR -- so we have to take care what we do here (and also in all
@@ -3879,7 +3898,7 @@
 	const DBase* const client_id = PEndpoint2ClientId(aRealEndpoint);
 	if (!client_id)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Client not found for real ep %d", aRealEndpoint));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP1, "  Error: Client not found for real ep %d", aRealEndpoint);
 		return;
 		}
 	// Check if there is a notification request queued for that client (if not, we can return here).
@@ -3894,25 +3913,25 @@
 		}
 	if (!p)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  No notification request for that client, returning"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP2, "  No notification request for that client, returning");
 		return;
 		}
 	const TInt ifcset = ClientId2InterfaceNumber(client_id);
 	if (ifcset < 0)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ifcset not found for clientid %d", client_id));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP3, "  Error: Ifcset not found for clientid %d", client_id);
 		return;
 		}
 	const TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ifcset pointer not found for ifcset %d", ifcset));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP4, "  Error: Ifcset pointer not found for ifcset %d", ifcset);
 		return;
 		}
 	const TUsbcInterface* const ifc_ptr = ifcset_ptr->CurrentInterface();
 	if (!ifc_ptr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Current ifc pointer not found for ifcset %d", ifcset));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP5, "  Error: Current ifc pointer not found for ifcset %d", ifcset);
 		return;
 		}
 	TUint state = 0;
@@ -3920,20 +3939,20 @@
 	for (TInt i = 0; i < eps; i++)
 		{
 		const TUsbcLogicalEndpoint* const ep_ptr = ifc_ptr->iEndpoints[i];
-		__KTRACE_OPT(KUSB, Kern::Printf("  checking logical ep #%d for stall state...",
-										ep_ptr->iLEndpointNum));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP6, "  checking logical ep #%d for stall state...",
+                                        ep_ptr->iLEndpointNum);
 		if (ep_ptr->iPEndpoint->iHalt)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  -- stalled"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP7, "  -- stalled");
 			// set the bit n to 1, where n is the logical endpoint number minus one
 			state |= (1 << (ep_ptr->iLEndpointNum - 1));
 			}
 		else
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  -- not stalled"));
+	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP8, "  -- not stalled");
 			}
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf(" passing ep state 0x%x on to LDD @ 0x%x", state, client_id));
+    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP9, " passing ep state 0x%x on to LDD @ 0x%x", (TUint)state, (TUint)client_id);
 	p->SetState(state);
 	p->DoCallback();
 	}
@@ -3941,7 +3960,7 @@
 
 void DUsbClientController::OtgFeaturesNotify()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OtgFeaturesNotify()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_OTGFEATURESNOTIFY, "DUsbClientController::OtgFeaturesNotify()" );
 
 	// This function may be called from the PSL (via PIL's chapter9.cpp) from
 	// within an ISR -- so we have to take care what we do here (and also in
@@ -3959,12 +3978,12 @@
 
 void DUsbClientController::RunClientCallbacks()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RunClientCallbacks()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS, "DUsbClientController::RunClientCallbacks()" );
 	TSglQueIter<TUsbcClientCallback> iter(iClientCallbacks);
 	TUsbcClientCallback* p;
 	while ((p = iter++) != NULL)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Callback 0x%x", p));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS_DUP1, "Callback 0x%x", p);
 		p->DoCallback();
 		}
 	}
@@ -3972,7 +3991,7 @@
 
 void DUsbClientController::ProcessDataTransferDone(TUsbcRequestCallback& aRcb)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessDataTransferDone()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE, "DUsbClientController::ProcessDataTransferDone()" );
 	// This piece can only be called in thread context from ProcessEp0DataReceived() /
 	// ProcessEp0SetupReceived() via the call to ProcessEp0ReceiveDone() in
 	// SetupReadBuffer(), which is guarded by an interrupt lock.
@@ -3993,7 +4012,7 @@
 	if (ep > 0)												// not 'else'!
 		{
 		__ASSERT_DEBUG((iRequestCallbacks[ep] == &aRcb), Kern::Fault(KUsbPILPanicCat, __LINE__));
-		__KTRACE_OPT(KUSB, Kern::Printf(" > removing RequestCallback[%d] @ 0x%x", ep, &aRcb));
+		OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE_DUP1, " > removing RequestCallback[%d] @ 0x%x", ep, (TUint)&aRcb);
 		iRequestCallbacks[ep] = NULL;
 		}
 	aRcb.DoCallback();
@@ -4002,18 +4021,21 @@
 
 void DUsbClientController::NextDeviceState(TUsbcDeviceState aNextState)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::NextDeviceState()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE, "DUsbClientController::NextDeviceState()" );
+    
 #ifdef _DEBUG
+#ifdef OST_TRACE_COMPILER_IN_USE
 	const char* const states[] = {"Undefined", "Attached", "Powered", "Default",
 								  "Address", "Configured", "Suspended"};
+#endif
 	if ((aNextState >= EUsbcDeviceStateUndefined) &&
 		(aNextState <= EUsbcDeviceStateSuspended))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  next device state: %s", states[aNextState]));
+	    OstTraceDefExt1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP1, "  next device state: %s", states[aNextState]);
 		}
 	else
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown next device state: %d", aNextState));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP2, "  Error: Unknown next device state: %d", aNextState);
 		}
 	// Print a warning when an invalid state transition is detected
 	// 'Undefined' is not a state that is mentioned in the USB spec, but
@@ -4076,12 +4098,12 @@
 			break;
 		goto OK;
 	default:
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown current device state: %d", iDeviceState));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP3, "  Error: Unknown current device state: %d", iDeviceState);
 		goto OK;
 		}
 	// KUSB only (instead of KPANIC) so as not to worry people too much where
 	// a particular h/w regularly enforces invalid (but harmless) transitions
-	__KTRACE_OPT(KUSB, Kern::Printf("  Warning: Invalid next state from %s", states[iDeviceState]));
+    OstTraceDefExt1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP4, "  Warning: Invalid next state from %s", states[iDeviceState]);
 OK:
 #endif // _DEBUG
 
@@ -4092,7 +4114,7 @@
 
 TInt DUsbClientController::ProcessSuspendEvent()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSuspendEvent()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENT, "DUsbClientController::ProcessSuspendEvent()" );
 	// A suspend interrupt has been received and needs attention.
 	iDeviceStateB4Suspend = iDeviceState;
 	// We have to move to the Suspend state immediately (in case it's a genuine Suspend)
@@ -4116,11 +4138,11 @@
 //
 TInt DUsbClientController::ProcessSuspendEventProceed()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSuspendEventProceed()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED, "DUsbClientController::ProcessSuspendEventProceed()" );
 	if (!UsbConnectionStatus())
 		{
 		// If we are no longer connected to the bus, we go into Undefined state (from Suspend).
-		__KTRACE_OPT(KUSB, Kern::Printf(" > USB cable detached"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED_DUP1, " > USB cable detached" );
 		NextDeviceState(EUsbcDeviceStateUndefined);
 		}
 	return KErrNone;
@@ -4129,7 +4151,7 @@
 
 TInt DUsbClientController::ProcessResumeEvent()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessResumeEvent()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSRESUMEEVENT, "DUsbClientController::ProcessResumeEvent()" );
 	iCableStatusTimer.Cancel();
 	if (iDeviceState == EUsbcDeviceStateSuspended)
 		{
@@ -4142,7 +4164,7 @@
 
 TInt DUsbClientController::ProcessResetEvent(TBool aPslUpcall)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessResetEvent()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT, "DUsbClientController::ProcessResetEvent()" );
 
 	if (aPslUpcall)
 		{
@@ -4150,17 +4172,16 @@
 		// Also, do it always, even when PIL processing will be deferred.
 		Reset();
 		}
-
 #ifdef USB_OTG_CLIENT
 	if (iUsbResetDeferred) // implies (iOtgHnpHandledByHw == ETrue)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  User-side (still) not ready -> returning"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP1, "  User-side (still) not ready -> returning" );
 		return KErrNone;
 		}
 	else if (iOtgHnpHandledByHw && !iClientSupportReady)
 		{
 		// Wait with the PIL Reset processing until user-side is ready
-		__KTRACE_OPT(KUSB, Kern::Printf("  User-side not ready -> deferring"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP2, "  User-side not ready -> deferring" );
 		iUsbResetDeferred = ETrue;
 		return KErrNone;
 		}
@@ -4195,19 +4216,19 @@
 	iHighSpeed = CurrentlyUsingHighSpeed();
 	if (!was_hs && iHighSpeed)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Moving to High-speed"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP3, "  Moving to High-speed" );
 		EnterHighSpeed();
 		}
 	else if (was_hs && !iHighSpeed)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Moving to Full-speed"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP4, "  Moving to Full-speed" );
 		EnterFullSpeed();
 		}
 
 	// Setup initial Ep0 read (SetupEndpointZeroRead never called from thread)
 	if (SetupEndpointZeroRead() != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: while setting up Ep0 read"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP5, "  Error: while setting up Ep0 read" );
 		return KErrGeneral;
 		}
 
@@ -4217,9 +4238,10 @@
 
 TInt DUsbClientController::ProcessCableInsertEvent()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessCableInsertEvent()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT, "DUsbClientController::ProcessCableInsertEvent()" );
+    
 #ifdef USB_OTG_CLIENT
-	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EUsbEventCableInsert shouldn't be sent by an OTG Client PSL"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT_DUP1, "  Error: EUsbEventCableInsert shouldn't be sent by an OTG Client PSL" );
 	return KErrArgument;
 #else
 	NextDeviceState(EUsbcDeviceStateAttached);
@@ -4234,9 +4256,9 @@
 
 TInt DUsbClientController::ProcessCableRemoveEvent()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessCableRemoveEvent()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT, "DUsbClientController::ProcessCableRemoveEvent()" );
 #ifdef USB_OTG_CLIENT
-	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EUsbEventCableRemoved shouldn't be sent by an OTG Client PSL"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT_DUP1, "  Error: EUsbEventCableRemoved shouldn't be sent by an OTG Client PSL" );
 	return KErrArgument;
 #else
 	// Tear down the current configuration (if any)
@@ -4249,14 +4271,14 @@
 
 void DUsbClientController::EnterFullSpeed()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnterFullSpeed()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENTERFULLSPEED, "DUsbClientController::EnterFullSpeed()" );
 	iDescriptors.UpdateDescriptorsFs();
 	}
 
 
 void DUsbClientController::EnterHighSpeed()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnterHighSpeed()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENTERHIGHSPEED, "DUsbClientController::EnterHighSpeed()" );
 	iDescriptors.UpdateDescriptorsHs();
 	}
 
@@ -4266,7 +4288,7 @@
 //
 TInt DUsbClientController::EvaluateOtgConnectFlags()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EvaluateOtgConnectFlags()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS, "DUsbClientController::EvaluateOtgConnectFlags()" );
 
 	TInt r = KErrNone;
 
@@ -4281,7 +4303,7 @@
 	else
 		{
 		// certain h/w: handles HNP connect/disconnect automatically
-		__KTRACE_OPT(KUSB, Kern::Printf("  HNP-handling h/w: only considering user-side readiness"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP1, "  HNP-handling h/w: only considering user-side readiness" );
 		enableDPlus = iClientSupportReady;
 		}
 
@@ -4293,7 +4315,7 @@
 	// There has been a changed requirement that must be serviced...
 	if (enableDPlus)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  calling (*iEnablePullUpOnDPlus)()"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP2, "  calling (*iEnablePullUpOnDPlus)()" );
 		if (iEnablePullUpOnDPlus != NULL)
 			{
 			iDPlusEnabled = enableDPlus;
@@ -4321,12 +4343,12 @@
 			r = (*iEnablePullUpOnDPlus)(iOtgContext);
 			if (r != KErrNone)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iEnablePullUpOnDPlus() = %d", r));
+		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP3, "  Error: iEnablePullUpOnDPlus() = %d", r);
 				}
 			}
 		else
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: iEnablePullUpOnDPlus pointer not ready"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP4, "  Warning: iEnablePullUpOnDPlus pointer not ready");
 			// We cannot enforce the presence of the pointer (via an ASSERT)
 			// since it might only be available at a later point.
 			// We shouldn't return an error at this point either, since the
@@ -4335,19 +4357,19 @@
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  calling (*iDisablePullUpOnDPlus)()"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP5, "  calling (*iDisablePullUpOnDPlus)()");
 		if (iDisablePullUpOnDPlus != NULL)
 			{
 			iDPlusEnabled = enableDPlus;
 			r = (*iDisablePullUpOnDPlus)(iOtgContext);
 			if (r != KErrNone)
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iDisablePullUpOnDPlus() = %d", r));
+		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP6, "  Error: iDisablePullUpOnDPlus() = %d", r);
 				}
 			}
 		else
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: iDisablePullUpOnDPlus pointer not ready"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP7, "  Warning: iDisablePullUpOnDPlus pointer not ready");
 			// We cannot enforce the presence of the pointer (via an ASSERT)
 			// since it might only be available at a later point.
 			// We shouldn't return an error at this point either, since the
@@ -4363,10 +4385,10 @@
 //
 void DUsbClientController::ReconnectTimerCallback(TAny *aPtr)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReconnectTimerCallback()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK, "DUsbClientController::ReconnectTimerCallback()" );
 	if (!aPtr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: !aPtr"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK_DUP1, "  Error: !aPtr");
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4379,10 +4401,10 @@
 //
 void DUsbClientController::CableStatusTimerCallback(TAny *aPtr)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CableStatusTimerCallback()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK, "DUsbClientController::CableStatusTimerCallback()" );
 	if (!aPtr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: !aPtr"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK_DUP1, "  Error: !aPtr" );
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4395,10 +4417,10 @@
 //
 void DUsbClientController::PowerUpDfc(TAny* aPtr)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerUpDfc"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERUPDFC, "DUsbClientController::PowerUpDfc" );
 	if (!aPtr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("	 Error: !aPtr"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_POWERUPDFC_DUP1, "   Error: !aPtr" );
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4414,10 +4436,10 @@
 //
 void DUsbClientController::PowerDownDfc(TAny* aPtr)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerDownDfc"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERDOWNDFC, "DUsbClientController::PowerDownDfc" );
 	if (!aPtr)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("	 Error: !aPtr"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP1, "    Error: !aPtr" );
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4427,13 +4449,13 @@
 	if (!ptr->iHardwareActivated || ptr->PowerDownWhenActive())
 		{
 		(void) ptr->PowerDown();
-		__KTRACE_OPT(KUSB, Kern::Printf("Calling PowerHandler->PowerDownDone()"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP2, "Calling PowerHandler->PowerDownDone()" );
 		ptr->iPowerHandler->PowerDownDone();
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Not calling PowerHandler->PowerDownDone()"));
-		__KTRACE_OPT(KUSB, Kern::Printf("  because UDC is active."));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP3, "Not calling PowerHandler->PowerDownDone()" );
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP4, "  because UDC is active." );
 		}
 	}
 
--- a/kernel/eka/drivers/usbcc/queue.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcc/queue.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-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"
@@ -23,6 +23,11 @@
 */
 
 #include <drivers/usbc.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "queueTraces.h"
+#endif
+
 
 
 void TSglQueLink::Enque(TSglQueLink* aLink)
@@ -86,7 +91,8 @@
 		pN = pP->iNext;
 		}
 	// This doesn't have to indicate an error (but might):
-	__KTRACE_OPT(KPANIC, Kern::Printf("TSglQueBase::DoRemove: ESQueLinkNotQueued"));
+	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TSGLQUEBASE_DOREMOVE, 
+	        "TSglQueBase::DoRemove: ESQueLinkNotQueued" );
 	}
 
 
--- a/kernel/eka/drivers/usbcsc/d_usbcsc.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/d_usbcsc.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -21,9 +21,13 @@
  @file d_usbcsc.cpp
  @internalTechnology
 */
-
 #include <drivers/usbcsc.h>
 #include "platform.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "d_usbcscTraces.h"
+#endif
+
 
 /*****************************************************************************\
 *   DUsbcScLogDevice                                                          *
@@ -67,7 +71,8 @@
 	// Only proceed if we have the Controller underneath us
 	if (!DUsbClientController::UsbcControllerPointer())
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("LDD Install: USB Controller Not Present"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCSCLOGDEVICE_INSTALL, "LDD Install: USB Controller Not Present" );
+		
 		return KErrGeneral;
 		}
 	return SetName(&KUsbScLddName);
@@ -137,13 +142,12 @@
 // Note that nothing may happen immediately, as something else may have the chunk open.
 void TUsbcScChunkInfo::Close()
 {
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::Close %d", iChunk->AccessCount()));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CLOSE, "TUsbcScChunkInfo::Close %d", iChunk->AccessCount());
 	if (Kern::ChunkClose(iChunk))
         {
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::Close1"));
-         ChunkCleanup();    
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::Close2"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CLOSE_DUP1, "TUsbcScChunkInfo::Close1");
+        ChunkCleanup();    
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CLOSE_DUP2, "TUsbcScChunkInfo::Close2");
         }
 }
 
@@ -156,17 +160,18 @@
 	TInt r;
 	TLinAddr physAddr;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("::chunkalloc  AllocPhysicalRam aSize %d", aSize));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC, "::chunkalloc  AllocPhysicalRam aSize %d", aSize);
 
 	r = Epoc::AllocPhysicalRam(aSize, physAddr);
-	__KTRACE_OPT(KUSB, if (r!=KErrNone) Kern::Printf("::chunkalloc AllocPhysicalRam r=%d  (Error!)", r));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP1, "::chunkalloc AllocPhysicalRam r=%d  (Error!)", r);
+	
 	if (r==KErrNone)
 		{	
-		__KTRACE_OPT(KUSB, Kern::Printf("::chunkalloc ChunkCommitPhysical iChunk 0x%x size(%d), aOffset 0x%x, aSize 0x%x phsAddr 0x%x",
-																	 				iChunk, sizeof(DChunk), aOffset, aSize,physAddr ));
-
+		OstTraceDefExt5(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP2, "T::chunkalloc ChunkCommitPhysical iChunk 0x%x size(%d), aOffset 0x%x, aSize 0x%x phsAddr 0x%x", (TUint)iChunk, sizeof(DChunk), aOffset, aSize,(TUint)physAddr);
 		r = Kern::ChunkCommitPhysical(iChunk, aOffset, aSize, physAddr);
-		__KTRACE_OPT(KUSB, if (r!=KErrNone) Kern::Printf("::chunkalloc ChunkCommitPhysical r=%d  (Error!)", r));
+		if (r!=KErrNone)
+		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP3, "::chunkalloc ChunkCommitPhysical r=%d  (Error!)", r);
+		
 
 		if (r!=KErrNone)
 				Epoc::FreePhysicalRam(physAddr, aSize);
@@ -176,8 +181,8 @@
 			TInt i=0;
 			for (rle=(aSize>>iPageNtz); rle>0; rle--, i++,physAddr+=pageSize) 
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("::phys offset 0x%x = 0x%x",
-												(aOffset>>iPageNtz)+i,  (physAddr & pageMask) | ((rle>(TInt)rleMask)?(TInt)rleMask:rle)));
+	            OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP4, "::phys offset 0x%x = 0x%x",
+                                                (TInt32)((aOffset>>iPageNtz)+i), (TUint32)( (physAddr & pageMask) | ((rle>(TInt)rleMask)?(TInt)rleMask:rle)));
 				iPhysicalMap[(aOffset>>iPageNtz)+i] = (physAddr & pageMask) | ((rle>(TInt)rleMask)?(TInt)rleMask:rle);
 				}
 			}
@@ -218,7 +223,8 @@
 
 void TUsbcScChunkInfo::ChunkCleanup()
 {
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::ChunkCleanup()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCCHUNKINFO_CHUNKCLEANUP, "TUsbcScChunkInfo::ChunkCleanup()" );
+	
 	TUint physAddr;
 	TInt length;
 	TInt offset = 0;
@@ -249,8 +255,8 @@
 
 TInt TUsbcScChunkInfo::New(TUsbcScChunkInfo*& aChunk, TInt aSize, DLogicalDevice* aLdd)
 {
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::New totalSize %d", aSize));
-
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_NEW, "TUsbcScChunkInfo::New totalSize %d", aSize);
+    
 	aChunk = new TUsbcScChunkInfo(aLdd);
 	if (aChunk==NULL)
 		{
@@ -265,7 +271,8 @@
 		return r;
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::New Created at 0x%x",  aChunk->iChunkMem  ));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_NEW_DUP1, "TUsbcScChunkInfo::New Created at 0x%x", aChunk->iChunkMem);
+	
 	return KErrNone;
 }
 
@@ -342,8 +349,7 @@
 		iBufferStart->iHead= iHead;
 		iBufferStart->iTail= iHead; // Initially no data!
 		iBufferStart->iBilTail=iHead;
-		__KTRACE_OPT(KUSB, Kern::Printf("Realize:  iHead 0x%x  bufferHeader 0x%x", iHead,iBufferStart ));
-
+		OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_CREATECHUNKBUFFERHEADER, "Realize:  iHead 0x%x  bufferHeader 0x%x", iHead,(TUint)iBufferStart);
 		// Dont need to round here, as we will round it up on endpoint change. (configuration)
 		}
 }
@@ -369,16 +375,18 @@
 */
 void TUsbcScBuffer::StartEndpoint(TUsbcRequestCallback* aRequestInfo, TUint aFlags)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartEndpoint (0x%x) : ep %d(%d)",this,aRequestInfo->iEndpointNum, aRequestInfo->iRealEpNum));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTENDPOINT, "TUsbcScBuffer::StartEndpoint (0x%x) : ep %d(%d)", (TUint)this,aRequestInfo->iEndpointNum, aRequestInfo->iRealEpNum);
 	
 	iCallback=aRequestInfo;
 	iMaxPacketSize =  iLdd->iController->EndpointPacketSize(iLdd, aRequestInfo->iRealEpNum);
 	iAlignMask = ~(((iMaxPacketSize+1) & 0xFFFFFFF8)-1);
 	iMode = aFlags;
-    __KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartEndpoint : max Packets %d, mask 0x%x flags 0x%x", iMaxPacketSize, iAlignMask, iMode));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTENDPOINT_DUP1, "TUsbcScBuffer::StartEndpoint : max Packets %d, mask 0x%x flags 0x%x", iMaxPacketSize, iAlignMask, (TUint)iMode);
+	
 	if ((iDirection&1)==KUsbcScOut)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UsbcScOut\n"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTENDPOINT_DUP2, "TUsbcScBuffer::UsbcScOut\n" );
+		
 		// Add dummy packet (doesnt have to be aligned, which avoids what if it changes issue)
 		// And Start next read.
 		iNeedsPacket=KEpIsStarting;
@@ -389,7 +397,8 @@
 
 void TUsbcScBuffer::Destroy()
 {
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::Destroy()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCBUFFER_DESTROY, "TUsbcScBuffer::Destroy()" );
+    
 	Cancel(KErrCancel);
 	if (iLdd->iController && ((iDirection&1)==KUsbcScOut))  
 		{  // Me must cancel reads to LDD to, an there will be no list for the callbacks to look into.
@@ -404,12 +413,14 @@
 {
 	if (!iMaxPacketSize)
 	{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataRead() - Not Configured"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD, "TUsbcScBuffer::StartDataRead() - Not Configured" );
+	
 		return KErrNone;
 	}
 	if (iStatusList.iState!=ENotRunning) 
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataRead() - Already Stated! (%d)",iStatusList.iState));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP1, "TUsbcScBuffer::StartDataRead() - Already Stated! (%d)", iStatusList.iState );
+	    
 		return KErrNone;
 		}
 
@@ -421,7 +432,8 @@
 	TUsbcScStatusElement* nextJob = iStatusList.Next();
 	if (nextJob == NULL)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("No more jobs"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP2, "No more jobs");
+		
 		if (iMode && KUsbScCoupledRead)
 			return KErrEof;
 		iStatusList.iState=EReadingAhead;
@@ -432,20 +444,20 @@
 	TInt tail = iBufferStart->iTail;
 	TInt headerSize =  sizeof(TUsbcScTransferHeader)-4; // TransferHeader includes 4 bytes of data.
 	maxLength = iChunkInfo->GetPhysical(iHead + headerSize, &physAddr); //returns all the bytes available after iHead + headerSize)
-
 	__ASSERT_DEBUG(maxLength>0,Kern::Fault("TUsbcScBuffer::StartDataRead(", __LINE__)); 
 
 
 	if (tail>iHead)  //  # # # H _ _ _ T # # # #
 		{
-		__KTRACE_OPT(KUSB,Kern::Printf("TUsbcScBuffer::StartDataRead() - tail 0x%x>head 0x%x, maxlength 0x%x", tail, iHead, maxLength));
-
+        OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP3, "TUsbcScBuffer::StartDataRead() - tail 0x%x>head 0x%x, maxlength 0x%x", (TUint)tail, iHead, maxLength);
+        
 		freeSpace = (tail & iAlignMask) - (iHead +headerSize + (~iAlignMask+1) );  // Cant read right up to last buffer, or head/tail will cross.
 
 		if (freeSpace<iMinReadSize)
 			{
 			iStatusList.iState=ENotRunning;
-			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataRead() - Stall!!"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP4, "TUsbcScBuffer::StartDataRead() - Stall!!");
+			
 			return KErrOverflow; 				// Read STALL !! !! !!
 			}
 
@@ -456,7 +468,6 @@
 		maxLength =  iMaxReadSize;
 	// else  tail<iHead (or empty)      _ _ _ T # # # H _ _ _ _
 	// We would not have set iHead here if too small. So must be ok.
-		
 	__ASSERT_DEBUG(maxLength>=iMinReadSize,Kern::Fault("TUsbcScBuffer::StartDataRead(", __LINE__)); 
 
 	TUint8* data = ((TUsbcScTransferHeader *) (iHead + iChunkAddr))->iData.b;
@@ -468,7 +479,7 @@
 	r = iLdd->iController->SetupReadBuffer(*iCallback);
 	if (r!=KErrNone)
 		{
-		__KTRACE_OPT(KUSB,Kern::Printf("SetupReadBuffer Error: %d, RT %d",r, iStatusList.iState));
+	    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP5, "SetupReadBuffer Error: %d, RT %d",r, iStatusList.iState);
 		iStatusList.Complete(r);
 		}
 	// After this, TUsbcScEndpoint::RequestCallback is called in a DFC.
@@ -479,8 +490,8 @@
 
 void TUsbcScBuffer::CompleteRead(TBool aStartNextRead)
 {
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::CompleteRead buff=%x",this));
-
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_COMPLETEREAD, "TUsbcScBuffer::CompleteRead buff=%x",this);
+    
     // The first packet always contains the total #of bytes
 	const TInt byteCount = iCallback->iPacketSize[0];
 	const TInt packetCount = iCallback->iRxPackets;
@@ -499,12 +510,11 @@
 void TUsbcScBuffer::UpdateBufferList(TInt aByteCount,TUint aFlags, TBool aStartNextRead)
 	{
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst aByteCount %d, flags 0x%x iHead 0x%x", aByteCount, aFlags, iHead));
-
+    OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST, "TUsbcScBuffer::UpdateBUfferLIst aByteCount %d, flags 0x%x iHead 0x%x", aByteCount, aFlags, (TUint)iHead);
+    
 	TInt headerSize =  sizeof(TUsbcScTransferHeader)-4; // TransferHeader includes 4 bytes of data.
 	TLinAddr dummy;
-	__KTRACE_OPT(KUSB, Kern::Printf("iHead 0x%x headerSize 0x%x",iHead, headerSize));
-
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP1, "iHead 0x%x headerSize 0x%x",iHead, headerSize);
 	// Find iNext
 
 	TInt next =  iHead +  headerSize + aByteCount; // next unused byte in buffer.
@@ -517,7 +527,8 @@
 		next = (next + headerSize + ~iAlignMask) & iAlignMask;
 		maxLength = iChunkInfo->GetPhysical(next, &dummy);
 
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst  next %x  buffer end %x min-read: %x  maxRun %x", next, iBufferEnd, iMinReadSize, maxLength));
+		OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP2, "TUsbcScBuffer::UpdateBUfferLIst  next %x  buffer end %x min-read: %x  maxRun %x", next, iBufferEnd, (TUint)iMinReadSize, (TUint)maxLength);
+		    
 		// At the end of the buffer - wrap it if needbe.
 		if ((TUint)(next + iMinReadSize) > iBufferEnd)
 			{
@@ -528,14 +539,15 @@
 		if (maxLength<iMinReadSize) 
 			{
 			next+=maxLength;
-			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst Skip exhausted block. next %x max %d", next, maxLength));
+			OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP3, "TUsbcScBuffer::UpdateBUfferLIst Skip exhausted block. next %x max %d", next, maxLength);
+			        
 			continue;
 			}
 		}
 	while (EFalse);
 
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst next (pre deduct): %x, Fill in header at head: 0x%x,  BuffStart: 0x%x.", next, iHead, iBufferStart));
-	
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP4, "TUsbcScBuffer::UpdateBUfferLIst next (pre deduct): %x, Fill in header at head: 0x%x,  BuffStart: 0x%x.", next, (TUint)iHead, (TUint)iBufferStart);
+	              
 	next -=  headerSize;  // Move next back from the data start position, to the header start.
 
 	TUsbcScTransferHeader* header = (TUsbcScTransferHeader*) (iHead + iChunkAddr);
@@ -551,8 +563,8 @@
 	header->iAltSettingSeq=iLdd->iAsSeq;
 	header->iAltSetting=iLdd->iAlternateSetting;
 	header->iFlags=aFlags;
-	__KTRACE_OPT(KUSB, Kern::Printf("We set next to 0x%x", next));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP5, "We set next to 0x%x", next);
+	       
 	iStatusList.iState=ENotRunning;
 	if (next==iBufferStart->iTail) //or (othwise is as good as full)
 		{
@@ -561,7 +573,7 @@
 	else
 		{
 
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst StartRead?? "));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP6, "TUsbcScBuffer::UpdateBUfferLIst StartRead?? ");
 		TInt oldHead=iHead;
 		iHead = next;
 
@@ -583,7 +595,8 @@
 		else
 			{
 			iBufferStart->iHead = next;
-			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst Compleating\n"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP7, "TUsbcScBuffer::UpdateBUfferLIst Compleating\n");
+			        
 			}
 		// Complete userside
 		iStatusList.Complete();
@@ -607,7 +620,8 @@
 
 	if (StartDataRead() == KErrOverflow)
 	{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::PopStall Warning: Transfer was freed, but still no space!\n"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_POPSTALL, "TUsbcScBuffer::PopStall Warning: Transfer was freed, but still no space!\n");
+        
 	}
 
 	iBufferStart->iHead = iHead;
@@ -618,7 +632,8 @@
 void TUsbcScBuffer::StartDataWrite()
 	{
 	
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite()"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCBUFFER_STARTDATAWRITE, "TUsbcScBuffer::StartDataWrite()");
+	
 	TUsbcScStatusElement* nextJob = iStatusList.Next();
 	TBool zlpReqd;
 	TInt length;
@@ -629,16 +644,16 @@
 	TInt r;
 	if (!iMaxPacketSize)
 	{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite() - Not Configured"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP1, "TUsbcScBuffer::StartDataWrite() - Not Configured");
 		return;
 	}
 
 	if (nextJob == NULL)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite() - No more jobs d=%d", iDirection));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP2, "TUsbcScBuffer::StartDataWrite() - No more jobs d=%d", iDirection);
 		if (iDirection==KUsbcScBiIn) // assume this is EP0, if this is true.
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite() Queue Read on EP0."));	
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP3, "TUsbcScBuffer::StartDataWrite() Queue Read on EP0.");
 			// Start other read again.
 			iLdd->iBuffers[iLdd->iEP0OutBuff].StartDataRead();
 			}
@@ -679,7 +694,8 @@
 		r = iLdd->iController->SetupWriteBuffer(*iCallback);
 		if (r!=KErrNone)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("SetupWriteBUffer Error: %d",r));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP4, "SetupWriteBUffer Error: %d",r);
+			            
 			iStatusList.Complete(r);
 			}
 		}
@@ -689,7 +705,7 @@
 void TUsbcScBuffer::CompleteWrite()
 	{
 	TInt error = iCallback->iError;
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::CompleteWrite buff=%x, err=%d",this, error));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_COMPLETEWRITE, "TUsbcScBuffer::CompleteWrite buff=%x, err=%d",(TUint)this, error);
 	iSent+= iCallback->iTxBytes;
 
 	// More to send?
@@ -739,8 +755,8 @@
 
 void TUsbcScBuffer::SendEp0StatusPacket(TInt aState)
 {
-	__KTRACE_OPT(KUSB, Kern::Printf(" TUsbcScBuffer::SendEp0StatusPacket(%d)", aState));
-
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_SENDEP0STATUSPACKET, " TUsbcScBuffer::SendEp0StatusPacket(%d)", aState);
+    
 	// We need to add a packet to the buffer, so we must stop the pending read, and start
 	// another after we have added out packet.  
 	Ep0CancelLddRead();
@@ -809,7 +825,8 @@
 
 TInt TUsbcScStatusList ::Add(TRequestStatus* aStatus, TInt aLength, TUint aStart, TUint aFlags)
 	{
-	__KTRACE_OPT(KUSB,Kern::Printf("Adding request.  iLength %d  iSize %d", iLength, iSize));
+    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_ADD, "Adding request.  iLength %d  iSize %d", iLength, iSize);
+    
 	if (iLength<iSize)
 		{
 		TUsbcScStatusElement& e = iElements[((iHead+iLength) & (iSize-1))];
@@ -818,8 +835,8 @@
 		e.iStart = aStart;
 		e.iFlags = aFlags;
 		iLength++;
-		__KTRACE_OPT(KUSB,Kern::Printf("Adding request.  new iLength %d", iLength));
-
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_ADD_DUP1, "Adding request.  new iLength %d", iLength);
+		    
 		return KErrNone;
 		}
 	else
@@ -866,7 +883,8 @@
 	{
 	if (iState==ENotRunning)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScStatusList::Complete() - iState == ENotRunning!"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_COMPLETE_TINT, "TUsbcScStatusList::Complete() - iState == ENotRunning!" );
+        
 		}
  	else
 		{
@@ -892,21 +910,18 @@
 	{
 	if (iLength==0)
 		return;
-	__KTRACE_OPT(KUSB, Kern::Printf("Completing request.  iLength %d", iLength));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_COMPLETE, "Completing request.  iLength %d", iLength);
+	
 	Kern::RequestComplete(iClient, iElements[iHead].iStatus, KErrNone);
 
 	iLength--;
 	iHead = ((iHead+1) & (iSize-1));
 	}
-
-
 void TUsbcScStatusList::SetClient(DThread& aThread)
 	{
 	iClient = &aThread;
 	}
 
-
 // End TUsbcScStatusList
 
 /*****************************************************************************\
@@ -933,7 +948,8 @@
 	iTotalSize   =0;
 	iTotalBuffers=0;
 	iAltSettings =0;
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: work out max endpoint"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_INIT, "Realize: work out max endpoint" );
+	
 	// Work out max endpoints and number of alternate settings.
 
 	if (iAlternateSettingList)
@@ -950,7 +966,8 @@
 		}
 	
 	// Alloc some temporary working space for temp endpoint metadata 
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Alloc temp.  Maxendpoints %d", iMaxEndpoints));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_INIT_DUP1, "Realize: Alloc temp.  Maxendpoints %d", iMaxEndpoints);
+	    
 	TInt inout;
 	for (inout=KUsbcScIn; inout<KUsbcScDirections; inout++)
 		{
@@ -972,7 +989,7 @@
 
 TInt TRealizeInfo::CopyAndSortEndpoints()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: copy And sort"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TREALIZEINFO_COPYANDSORTENDPOINTS, "Realize: copy And sort");
 
 	TInt altSetting = 0;
 	TInt endpointOffs;
@@ -987,37 +1004,37 @@
 		{
 		for (alt = iAlternateSettingList->iHead;alt!=NULL;alt = alt->iNext )
 			{		
-			__KTRACE_OPT(KUSB, Kern::Printf("Realize:   AlternateSetting %x", alt));
-
+            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP1, "Realize:   AlternateSetting %x", alt);
+            
 			iBufs[KUsbcScIn].iEps =0;
 			iBufs[KUsbcScOut].iEps =0;
 
 			// For alt setting, iterate eps
 			for (altEp=1; altEp <= alt->iNumberOfEndpoints; altEp++)
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("Realize:     Endpoint to add: %d",altEp));
-
+                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP2, "Realize:     Endpoint to add: %d", altEp);
 				TUsbcScEndpoint* nextEp = alt->iEndpoint[altEp];
 
-				__KTRACE_OPT(KUSB, Kern::Printf("Realize:      ep Buffer Size: %d",nextEp->EndpointInfo()->iBufferSize));
-				
+				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP3, "Realize:      ep Buffer Size: %d",nextEp->EndpointInfo()->iBufferSize);
+				                
 				inout = (nextEp->EndpointInfo()->iDir==KUsbEpDirIn)?KUsbcScIn:
 						(nextEp->EndpointInfo()->iDir==KUsbEpDirOut)?KUsbcScOut:KUsbcScUnknown;
 				if (inout==KUsbcScUnknown)
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("Realize:     KUsbcScUnknown %x",nextEp->EndpointInfo()->iDir));
+                    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP4, "Realize:     KUsbcScUnknown %x",nextEp->EndpointInfo()->iDir);
+				                 
 					return KErrArgument;
 					}
 
 				bufsd = &(iBufs[inout]);
-				__KTRACE_OPT(KUSB, Kern::Printf("Realize:      ep direction: %x # endpoints %d", inout, bufsd->iEps));
-
+				OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP5, "Realize:      ep direction: %x # endpoints %d", inout, bufsd->iEps);
 
 				// find and position ep, and insert.
 
 				if (bufsd->iEps==0) // First entry.
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("Realize:       Add first endpoint"));
+				    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP6, "Realize:       Add first endpoint");
+
 					endpointOffs = altSetting*iMaxEndpoints;
 					bufsd->iEp[endpointOffs] = nextEp;
 					}
@@ -1030,14 +1047,12 @@
 						endpointOffs = altSetting*iMaxEndpoints + endpoint;
 						if (bufsd->iEp[endpointOffs]->EndpointInfo()->iBufferSize < nextEp->EndpointInfo()->iBufferSize)
 							{
-							__KTRACE_OPT(KUSB, Kern::Printf("Realize:       Shift Endpoint %d", endpoint));
-		
+                            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP7, "Realize:       Shift Endpoint %d", endpoint);
 							bufsd->iEp[endpointOffs+1] = bufsd->iEp[endpointOffs];
 							}
 						else
 							{
-							__KTRACE_OPT(KUSB, Kern::Printf("Realize:       Insert After Endpoint %d", endpoint));
-
+                            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP8, "Realize:       Insert After Endpoint %d", endpoint);
 							bufsd->iEp[endpointOffs+1] = nextEp;
 							placed = ETrue;
 							break;
@@ -1063,8 +1078,8 @@
 
 void TRealizeInfo::CalcBuffSizes()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Calculate Buffers"));
-
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TREALIZEINFO_CALCBUFFSIZES, "Realize: Calculate Buffers" );
+    
 	TInt endpoint;
 	TInt inout;
 	TInt altSetting;
@@ -1074,28 +1089,27 @@
 
 	for (inout=KUsbcScIn; inout<KUsbcScDirections; inout++)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Realize:   Direction: %d", inout));
-
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP1, "Realize:   Direction: %d", inout);
 
 		bufsd = &(iBufs[inout]);
 		// for each row, ie, buffer, find largest buffer need.
 		for (endpoint=0; endpoint<iMaxEndpoints; endpoint++)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("Realize:     endpoint %d", endpoint));
+            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP2, "Realize:     endpoint %d", endpoint);
 			TInt bufMaxSize=0;
 			for (altSetting=0; altSetting< iAltSettings; altSetting++)
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("Realize:       altSetting %d", altSetting));
+                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP3, "Realize:       altSetting %d", altSetting);
 				nextEp= bufsd->iEp[altSetting* iMaxEndpoints + endpoint];
 				if (nextEp!=NULL)
 					{
 					bufferSize = nextEp->EndpointInfo()->iBufferSize;
-					__KTRACE_OPT(KUSB, Kern::Printf("Realize:       comparing size %d", bufferSize));
+					OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP4, "Realize:       comparing size %d", bufferSize);
 					if (bufferSize> bufMaxSize)
 						 bufMaxSize = bufferSize;
 					}
 				} // for altsetting
-			__KTRACE_OPT(KUSB, Kern::Printf("Realize:     bufMaxSize %d", bufMaxSize));
+			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP5, "Realize:     bufMaxSize %d", bufMaxSize);
 			bufsd->iSizes[endpoint] = bufMaxSize;
 			if (bufMaxSize>0) 
 				{
@@ -1148,10 +1162,8 @@
 
 
 	TInt tableOffset  = (TUint) iAltSettingsTbl->iAltTableOffset - (TUint) aChunkInfo->iChunkMem + iAltSettings*sizeof(TInt);
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: table offset: 0x%x, altTble %x iChnkMem %x altSettings %x",tableOffset, iAltSettingsTbl, aChunkInfo->iChunkMem, iAltSettings ));
-
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: populate chunk - create alt settings table"));
-
+	OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_LAYOUTCHUNKHEADER, "Realize: table offset: 0x%x, altTble %x iChnkMem %x altSettings %x",tableOffset, (TUint)iAltSettingsTbl, (TUint)aChunkInfo->iChunkMem, iAltSettings);
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_LAYOUTCHUNKHEADER_DUP1, "Realize: populate chunk - create alt settings table");
 	// Create alt settings table.  Set each element of altsettings table, to each induivatual alt setting table.
 	// then fill in the number of endpoints for that alt setting, in the table.
 
@@ -1163,8 +1175,7 @@
 		alt = iAlternateSettingList->iHead;
 		for (altSetting=0; altSetting<iAltSettings; altSetting++) 
 			{
-				__KTRACE_OPT(KUSB, Kern::Printf("Realize:   altSetting %d, tableOffset %d", altSetting, tableOffset));
-
+                OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_LAYOUTCHUNKHEADER_DUP2, "Realize:   altSetting %d, tableOffset %d", altSetting, tableOffset);
 				iAltSettingsTbl->iAltTableOffset[altSetting] = tableOffset;
 				noEpForAlt = (TInt*) &aChunkInfo->iChunkMem[tableOffset];
 			 
@@ -1215,7 +1226,8 @@
 	  iBuffers(NULL),
 	  iEp0Endpoint(NULL)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DLddUsbcScChannel()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_CONS, "DLddUsbcScChannel::DLddUsbcScChannel()" );
+    
 	iClient = &Kern::CurrentThread();
 	iClient->Open();
 	for (TInt i = 1; i < KUsbcMaxRequests; i++)
@@ -1231,7 +1243,7 @@
 
 DLddUsbcScChannel::~DLddUsbcScChannel()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::~DLddUsbcScChannel()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES, "DLddUsbcScChannel::~DLddUsbcScChannel()" );
 	if (iController)
 		{
 		iController->DeRegisterClient(this);
@@ -1252,7 +1264,7 @@
 			delete iStatusFifo;
 			}
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("Closing buffers"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP1, "Closing buffers" );
 	if (iBuffers)
 		{
 		TInt i;
@@ -1266,14 +1278,14 @@
 	if (iRealizeCalled)
 		{
 		// Close Chunk
-		__KTRACE_OPT(KUSB, Kern::Printf("iChunkInfo->Close()"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP2, "iChunkInfo->Close()" );
 		iChunkInfo->Close();
 		// ChunkInfo will delete itself with DFC, but the pointer here is no longer needed.		
 		iChunkInfo=NULL;
 		}
-	__KTRACE_OPT(KUSB, Kern::Printf("about to SafeClose"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP3, "about to SafeClose" );
 	Kern::SafeClose((DObject*&)iClient, NULL);
-	__KTRACE_OPT(KUSB, Kern::Printf("about to SafeClose1"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP4, "about to SafeClose1" );
 	}
 
 
@@ -1283,8 +1295,9 @@
 
 TInt DLddUsbcScChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("LDD DoCreateL 1 Ver = %02d %02d %02d",
-									aVer.iMajor, aVer.iMinor, aVer.iBuild));
+	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCREATE, "LDD DoCreateL 1 Ver = %02d %02d %02d",
+                                    aVer.iMajor, aVer.iMinor, aVer.iBuild);
+	
 	if (!Kern::CurrentThreadHasCapability(ECapabilityCommDD,
 										  __PLATSEC_DIAGNOSTIC_STRING("Checked by USBCSC.LDD (USB Driver)")))
 		{
@@ -1344,8 +1357,8 @@
 	{
 	TThreadMessage& m = *(TThreadMessage*)aMsg;
 	TInt id = m.iValue;
-	__KTRACE_OPT(KUSB, Kern::Printf("HandleMsg 0x%x", id));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_HANDLEMSG, "HandleMsg 0x%x", id);
+	
 	if (id == (TInt) ECloseMsg)
 		{
 		iChannelClosing = ETrue;
@@ -1354,13 +1367,11 @@
 		}
 
 	TInt r;
-
 	if (aMsg->Client() != iClient)
 		{
 		m.Complete(KErrAccessDenied, ETrue);
 		return;
 		}
-	
 	if (id < 0)
 		{
 		// DoRequest
@@ -1384,8 +1395,6 @@
 // end HandleMsg.
 
 
-#define BREAK_IF_NULL_ARG(a,r) if (a==NULL) { r = KErrArgument; __KTRACE_OPT(KUSB,Kern::Printf("NULL Argument")); break; }
-
 //
 // DoRequest - Asynchronous requests
 //
@@ -1397,8 +1406,8 @@
 	TInt r = KErrNone;  // return via request notify
 	TBool needsCompletion =EFalse;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("DoRequest 0x%08x", aReqNo));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST, "DoRequest 0x%08x", aReqNo);
+	
 	if ((reqNo>RDevUsbcScClient::ERequestReadDataNotify) &&
 		(reqNo<RDevUsbcScClient::ERequestMaxRequests))
 		{
@@ -1415,8 +1424,13 @@
 	case RDevUsbcScClient::ERequestWriteData:
 		{
 		TInt buffer =  (aReqNo>>RDevUsbcScClient::KFieldBuffPos)&RDevUsbcScClient::KFieldBuffMask;
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestWriteData"));
-		BREAK_IF_NULL_ARG(a2,r);
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP1, "ERequestWriteData");
+		if (a2 == NULL)
+                {
+                r = KErrArgument;
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP2, "NULL Argument");
+                break;
+                }
 
 		r = DoWriteData( aStatus, buffer, (TInt) a1 /*Start*/, (TInt) a2 /* Length */,
 						 aReqNo>>RDevUsbcScClient::KFieldFlagsPos ); // Flags
@@ -1424,14 +1438,19 @@
 		}
 	case RDevUsbcScClient::ERequestReadDataNotify:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestReadDataNotify"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP3, "ERequestReadDataNotify");
 		return DoReadDataNotify(aStatus, (TInt) a1, (TInt) a2); // a1 = aBufferNumber, a2 - aLength;
 		} 
 
 	case RDevUsbcScClient::ERequestAlternateDeviceStatusNotify:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestAlternateDeviceStatusNotify"));
-		BREAK_IF_NULL_ARG(a1,r);
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP4, "ERequestAlternateDeviceStatusNotify");
+		if (a1 == NULL)
+                {
+                r = KErrArgument;
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP5, "NULL Argument");
+                break;
+                }
 		iDeviceStatusNeeded = ETrue;
 		iStatusChangePtr = a1;
 		needsCompletion = AlternateDeviceStateTestComplete();
@@ -1439,24 +1458,32 @@
 		}
 	case RDevUsbcScClient::ERequestReEnumerate:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestReEnumerate"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP6, "ERequestReEnumerate");
 		// If successful, this will complete via the status notification.
 		r = iController->ReEnumerate();
 		break;
 		}
 	case RDevUsbcScClient::ERequestEndpointStatusNotify:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestEndpointStatusNotify"));
-		BREAK_IF_NULL_ARG(a1,r);
-		
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP7, "ERequestEndpointStatusNotify");
+		if (a1 == NULL)
+                {
+                r = KErrArgument;
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP8, "NULL Argument");
+                break;
+                }
 		iEndpointStatusChangePtr = a1;
 		break;
 		}
 	case RDevUsbcScClient::ERequestOtgFeaturesNotify:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("ERequestOtgFeaturesNotify"));
-		BREAK_IF_NULL_ARG(a1,r);
-			
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP9, "ERequestOtgFeaturesNotify");
+		if (a1 == NULL)
+                {
+                r = KErrArgument;
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP10, "NULL Argument");
+                break;
+                }	
 		iOtgFeatureChangePtr = a1;
 		break;
 		}
@@ -1481,14 +1508,16 @@
 //
 TInt DLddUsbcScChannel::DoReadDataNotify(TRequestStatus* aStatus, TInt aBufferNum, TInt aLength)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify(x, %d, 0x%x)", aBufferNum, aLength));
+    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY, " DLddUsbcScChannel::DoReadDataNotify(x, %d, 0x%x)", aBufferNum, aLength);
+    
 	TInt r = KErrNone;
 	// check range
 	if ((aBufferNum<0) ||  (aBufferNum>=iNumBuffers))  // Indirectly checks that we are set up.
 		{
 		if (aBufferNum!=KUsbcScEndpointZero)
 			{
-	        __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Number!"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP1, " DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Number!");
+		    
 			return KErrArgument;
 			}
 		else
@@ -1501,7 +1530,7 @@
 		// check direction
 		if (iBuffers[aBufferNum].iDirection!=KUsbcScOut)
 			{
-   		     __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Direction!"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP2, " DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Direction!");
 			return KErrNotSupported;
 			}
 		if (!Configured())
@@ -1509,8 +1538,7 @@
 		}
 	SUsbcScBufferHeader* scBuffer = (SUsbcScBufferHeader*) iBuffers[aBufferNum].iBufferStart;
 
-	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify  head %x tail %x", iBuffers[aBufferNum].iHead , scBuffer->iTail ));
-
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP3, " DLddUsbcScChannel::DoReadDataNotify  head %x tail %x", iBuffers[aBufferNum].iHead , scBuffer->iTail);
 	if (iBuffers[aBufferNum].iHead != scBuffer->iBilTail)
 		r = KErrCompletion;
 	else
@@ -1528,7 +1556,7 @@
 		}
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Job in Progress!"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP4, "Job in Progress!");
 		}
 	return r;
 	}
@@ -1543,7 +1571,8 @@
 //
 TInt DLddUsbcScChannel::DoWriteData(TRequestStatus* aStatus,TInt aBufferNum, TUint aStart, TUint aLength, TUint aFlags)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData(%d, 0x%x, 0x%x, 0x%x)",  aBufferNum, aStart, aLength, aFlags));
+    OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA, " DLddUsbcScChannel::DoWriteData(%d, 0x%x, 0x%x, 0x%x)",  aBufferNum, aStart, aLength, aFlags);
+    
 	if (!iUserKnowsAltSetting)
 		return KErrEof;
 	// Check Buffer Number
@@ -1551,7 +1580,7 @@
 		{
 		if ((TUint)aBufferNum!=RDevUsbcScClient::KFieldBuffMask)  // KUsbcScEndpointZero & KFieldBuffMas = KFieldBuffMas;
 			{
-	        __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData : Bad Buffer Number!"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP1, " DLddUsbcScChannel::DoWriteData : Bad Buffer Number!"); 
 			return KErrArgument;
 			}
 		else
@@ -1564,7 +1593,7 @@
 		// check direction
 		if (iBuffers[aBufferNum].iDirection!=KUsbcScIn)
 			{
-	    	    __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData Bad endpoint Direction"));
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP2, " DLddUsbcScChannel::DoWriteData Bad endpoint Direction"); 
 				return KErrArgument;
 			}
 		}
@@ -1573,7 +1602,7 @@
 
 	if ((aStart< (((TLinAddr) buf.iBufferStart)-buf.iChunkAddr)) || ((aStart+aLength)>iBuffers[aBufferNum].iBufferEnd))
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData Bad Range aStart or aLength 0x%x > 0x%x + 0x%x < 0x%x", (((TLinAddr) buf.iBufferStart)-buf.iChunkAddr),aStart, aLength, iBuffers[aBufferNum].iBufferEnd ));
+        OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP3, "DLddUsbcScChannel::DoWriteData Bad Range aStart or aLength 0x%x > 0x%x + 0x%x < 0x%x", (TInt)(((TLinAddr) buf.iBufferStart)-buf.iChunkAddr),aStart, aLength, iBuffers[aBufferNum].iBufferEnd);
 		return KErrArgument;
 		}
 
@@ -1582,7 +1611,8 @@
 
 	if (aStart & ~buf.iAlignMask)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::DoDataWrite: address 0x%x unaligned.",aStart));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP4, "TUsbcScBuffer::DoDataWrite: address 0x%x unaligned.",aStart);
+	        
 		return KErrArgument;
 		}
 			
@@ -1594,7 +1624,7 @@
 		}
 	else
 		{	
-		__KTRACE_OPT(KUSB, Kern::Printf("Job in Progress!"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP5, "Job in Progress!");
 		}
 
 
@@ -1611,7 +1641,8 @@
 	TInt r = KErrNone;
 	TInt direction=KUsbcScOut;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: 0x%x aBuff 0x%x", aReqNo, aBuff));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL, "DoCancel: 0x%x aBuff 0x%x", aReqNo, aBuff);
+	
 	switch (aReqNo)
 		{
 	case RDevUsbcScClient::ERequestCancel:
@@ -1628,11 +1659,10 @@
 	case RDevUsbcScClient::ERequestWriteDataCancel:
 		direction = KUsbcScIn;
 	case RDevUsbcScClient::ERequestReadDataNotifyCancel:
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Direction %d endpoints: 0x%x",direction, aReqNo));
-
+	    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP1, "DoCancel Direction %d endpoints: 0x%x", direction, aReqNo);
 		if (((TInt)aBuff)==KUsbcScEndpointZero) // EP0 is bi-directional, so pick correct buffer for call type
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Cancel Endpoint 0/%d",direction));
+            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP2, "DoCancel Cancel Endpoint 0/%d",direction);
 			iEp0Endpoint->AbortTransfer();
 			if (direction==KUsbcScIn)
 				aBuff=iEP0InBuff;
@@ -1641,13 +1671,13 @@
 			} 
 		else if ((TInt)aBuff >= iNumBuffers) // check buff no range.
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Error: Bad buffer number"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP3, "DoCancel Error: Bad buffer number");
 			return KErrArgument;
 			}
 
 		if ((iBuffers[aBuff].iDirection&1)!=direction) // Does direction match call type?
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Error: Bad buffer direction"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP4, "DoCancel Error: Bad buffer direction");
 			return KErrArgument;
 			}	
 		iBuffers[aBuff].iStatusList.CancelQueued();
@@ -1656,7 +1686,7 @@
 		return KErrNone;
 
 	case RDevUsbcScClient::ERequestAlternateDeviceStatusNotifyCancel:
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP5, "DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo);
 		iDeviceStatusNeeded = EFalse;
 		iStatusFifo->FlushQueue();
 		if (iStatusChangePtr)
@@ -1670,21 +1700,21 @@
 	break;
 
 	case RDevUsbcScClient::ERequestReEnumerateCancel:
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestReEnumerate: 0x%x", aReqNo));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP6, "DoCancel ERequestReEnumerate: 0x%x", aReqNo);
 	break;
 
 	case RDevUsbcScClient::ERequestEndpointStatusNotifyCancel:
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo));
+	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP7, "DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo);
 		CancelNotifyEndpointStatus();
 	break;
 
  	case RDevUsbcScClient::ERequestOtgFeaturesNotifyCancel:
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo));
+ 	   OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP8, "DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo);
 		CancelNotifyOtgFeatures();
 	break;
 
 	default:
-		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Unknown! 0x%x", aReqNo));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP9, "DoCancel Unknown! 0x%x", aReqNo);
 		return KErrArgument;
 		}
 
@@ -1734,8 +1764,8 @@
 
 TInt DLddUsbcScChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DoControl: %d", aFunction));
-
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL, "DoControl: %d", aFunction);
+    
 	TInt r = KErrNone;
 	TInt ep, param;
 	TUsbcScEndpoint* pEndpoint;
@@ -1748,7 +1778,7 @@
 	switch (aFunction)
 		{
 	case RDevUsbcScClient::EControlEndpointZeroRequestError:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroRequestError"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP1, "EControlEndpointZeroRequestError");
 		r = KErrNone;
 		if (iOwnsDeviceControl || (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured))
 			{
@@ -1764,7 +1794,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetAlternateSetting:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetAlternateSetting"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP2, "EControlGetAlternateSetting");
 		if (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured)
 			{
 			r = iController->GetInterfaceNumber(this, param);
@@ -1785,7 +1815,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlDeviceStatus:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceStatus"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP3, "EControlDeviceStatus");
 		param = iController->GetDeviceStatus();
 		r = Kern::ThreadRawWrite(iClient, a1, &param, sizeof(param), iClient);
 		if (r != KErrNone)
@@ -1793,7 +1823,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlEndpointStatus:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointStatus"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP4, "EControlEndpointStatus");
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			pEndpoint = iEndpoint[(TInt)a1];
@@ -1817,7 +1847,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlEndpointCaps:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointCaps"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP5, "EControlEndpointCaps");
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1825,7 +1855,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlDeviceCaps:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceCaps"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP6, "EControlDeviceCaps");
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1833,12 +1863,12 @@
 		break;
 
 	case RDevUsbcScClient::EControlSendEp0StatusPacket:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSendEp0StatusPacket"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP7, "EControlSendEp0StatusPacket");
 		iController->SendEp0StatusPacket(this);
 		break;
 
 	case RDevUsbcScClient::EControlHaltEndpoint:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlHaltEndpoint"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP8, "EControlHaltEndpoint");
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->HaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1853,7 +1883,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlClearHaltEndpoint:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlClearHaltEndpoint"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP9, "EControlClearHaltEndpoint");
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->ClearHaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1868,33 +1898,33 @@
 		break;
 
 	case RDevUsbcScClient::EControlDumpRegisters:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDumpRegisters"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP10, "EControlDumpRegisters");
 		iController->DumpRegisters();
 		break;
 
 	case RDevUsbcScClient::EControlReleaseDeviceControl:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseDeviceControl"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP11, "EControlReleaseDeviceControl");
 		iController->ReleaseDeviceControl(this);
 		iOwnsDeviceControl = EFalse;
 		break;
 
 	case RDevUsbcScClient::EControlEndpointZeroMaxPacketSizes:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroMaxPacketSizes"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP12, "EControlEndpointZeroMaxPacketSizes");
 		r = iController->EndpointZeroMaxPacketSizes();
 		break;
 
 	case RDevUsbcScClient::EControlSetEndpointZeroMaxPacketSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointZeroMaxPacketSize"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP13, "EControlSetEndpointZeroMaxPacketSize");
 		r = iController->SetEndpointZeroMaxPacketSize(reinterpret_cast<TInt>(a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetEndpointZeroMaxPacketSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointZeroMaxPacketSize"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP14, "EControlGetEndpointZeroMaxPacketSize");
 		r = iController->Ep0PacketSize();
 		break;
 
 	case RDevUsbcScClient::EControlGetDeviceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP15, "EControlGetDeviceDescriptor");
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1902,19 +1932,29 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetDeviceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceDescriptor"));
-		BREAK_IF_NULL_ARG(a1,r);
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP16, "EControlSetDeviceDescriptor");
+		if (a1 == NULL)
+                {
+                r = KErrArgument;
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP17, "NULL Argument");
+                break;
+                }   
 		r = iController->SetDeviceDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetDeviceDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptorSize"));
-		BREAK_IF_NULL_ARG(a1,r);
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP18, "EControlGetDeviceDescriptorSize");
+		if (a1 == NULL)
+                {
+                r = KErrArgument;
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP19, "NULL Argument");
+                break;
+                }   
 		r = iController->GetDeviceDescriptorSize(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP20, "EControlGetConfigurationDescriptor");
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1922,7 +1962,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetConfigurationDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptorSize"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP21, "EControlGetConfigurationDescriptorSize");
 		if (a1 != NULL)
 			{
 			r = iController->GetConfigurationDescriptorSize(iClient, *((TDes8*) a1));
@@ -1932,27 +1972,27 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP22, "EControlSetConfigurationDescriptor");
 		r = iController->SetConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP23, "EControlGetInterfaceDescriptor");
 		r = iController->GetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlGetInterfaceDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptorSize"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP24, "EControlGetInterfaceDescriptorSize");
 		r = iController->GetInterfaceDescriptorSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcScClient::EControlSetInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterfaceDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP25, "EControlSetInterfaceDescriptor");
 		r = iController->SetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlGetEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP26, "EControlGetEndpointDescriptor");
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1962,7 +2002,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetEndpointDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptorSize"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP27, "EControlGetEndpointDescriptorSize");
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1972,7 +2012,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP28, "EControlSetEndpointDescriptor");
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1982,7 +2022,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetDeviceQualifierDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceQualifierDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP29, "EControlGetDeviceQualifierDescriptor");
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1990,13 +2030,18 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetDeviceQualifierDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceQualifierDescriptor"));
-		BREAK_IF_NULL_ARG(a1,r);
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP30, "EControlSetDeviceQualifierDescriptor");
+		if (a1 == NULL)
+                {
+                r = KErrArgument;
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP31, "NULL Argument");
+                break;
+                }   
 		r = iController->SetDeviceQualifierDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetOtherSpeedConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtherSpeedConfigurationDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP32, "EControlGetOtherSpeedConfigurationDescriptor");
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2004,23 +2049,23 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetOtherSpeedConfigurationDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetOtherSpeedConfigurationDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP33, "EControlSetOtherSpeedConfigurationDescriptor");
 		r = iController->SetOtherSpeedConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 
 	case RDevUsbcScClient::EControlGetCSInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP34, "EControlGetCSInterfaceDescriptor");
 		r = iController->GetCSInterfaceDescriptorBlock(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlGetCSInterfaceDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptorSize"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP35, "EControlGetCSInterfaceDescriptorSize");
 		r = iController->GetCSInterfaceDescriptorBlockSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcScClient::EControlGetCSEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP36, "EControlGetCSEndpointDescriptor");
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2030,7 +2075,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetCSEndpointDescriptorSize:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptorSize"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP37, "EControlGetCSEndpointDescriptorSize");
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2040,38 +2085,38 @@
 		break;
 
 	case RDevUsbcScClient::EControlSignalRemoteWakeup:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSignalRemoteWakeup"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP38, "EControlSignalRemoteWakeup");
 		r = iController->SignalRemoteWakeup();
 		break;
 
 	case RDevUsbcScClient::EControlDeviceDisconnectFromHost:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceDisconnectFromHost"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP39, "EControlDeviceDisconnectFromHost");
 		r = iController->UsbDisconnect();
 		break;
 
 	case RDevUsbcScClient::EControlDeviceConnectToHost:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceConnectToHost"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP40, "EControlDeviceConnectToHost");
 		r = iController->UsbConnect();
 		break;
 
 	case RDevUsbcScClient::EControlDevicePowerUpUdc:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDevicePowerUpUdc"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP41, "EControlDevicePowerUpUdc");
 		r = iController->PowerUpUdc();
 		break;
 
 	case RDevUsbcScClient::EControlSetDeviceControl:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP42, "EControlSetDeviceControl");
 		r = iController->SetDeviceControl(this);
 		if (r == KErrNone)
 			{
 			iOwnsDeviceControl = ETrue;
 			if (iEp0Endpoint == NULL)
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl"));
+			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP43, "EControlSetDeviceControl");
 				r = SetupEp0();
 				if (r != KErrNone)
 					{
-					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetupEp0() failed"));
+				    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP44, "  Error: SetupEp0() failed");
 					iController->ReleaseDeviceControl(this);
 					iOwnsDeviceControl=EFalse;
 					DestroyEp0();
@@ -2083,12 +2128,12 @@
 		break;
 
 	case RDevUsbcScClient::EControlCurrentlyUsingHighSpeed:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlCurrentlyUsingHighSpeed"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP45, "EControlCurrentlyUsingHighSpeed");
 		r = iController->CurrentlyUsingHighSpeed();
 		break;
 
 	case RDevUsbcScClient::EControlSetInterface:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterface"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP46, "EControlSetInterface");
 		r = Kern::ThreadRawRead(iClient, a2, &ifcInfo, sizeof(ifcInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2096,7 +2141,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlReleaseInterface: 
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseInterface"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP47, "EControlReleaseInterface");
 		if (!iRealizeCalled)
 			{
 			r = iController->ReleaseInterface(this, (TInt) a1);
@@ -2106,7 +2151,7 @@
 				}
 			else
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error in PIL: LDD interface won't be released."));
+                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP48, "  Error in PIL: LDD interface won't be released.");
 				}
 			}
 		else
@@ -2114,7 +2159,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetCSInterfaceDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSInterfaceDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP49, "EControlSetCSInterfaceDescriptor");
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2124,7 +2169,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetCSEndpointDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSEndpointDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP50, "EControlSetCSEndpointDescriptor");
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2135,93 +2180,93 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetStringDescriptorLangId:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptorLangId"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP51, "EControlGetStringDescriptorLangId");
 		r = iController->GetStringDescriptorLangId(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetStringDescriptorLangId:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptorLangId"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP52, "EControlSetStringDescriptorLangId");
 		r = iController->SetStringDescriptorLangId(reinterpret_cast<TUint>(a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetManufacturerStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetManufacturerStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP53, "EControlGetManufacturerStringDescriptor");
 		r = iController->GetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetManufacturerStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetManufacturerStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP54, "EControlSetManufacturerStringDescriptor");
 		r = iController->SetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveManufacturerStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveManufacturerStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP55, "EControlRemoveManufacturerStringDescriptor");
 		r = iController->RemoveManufacturerStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetProductStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetProductStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP56, "EControlGetProductStringDescriptor");
 		r = iController->GetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetProductStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetProductStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP57, "EControlSetProductStringDescriptor");
 		r = iController->SetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveProductStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveProductStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP58, "EControlRemoveProductStringDescriptor");
 		r = iController->RemoveProductStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetSerialNumberStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetSerialNumberStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP59, "EControlGetSerialNumberStringDescriptor");
 		r = iController->GetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetSerialNumberStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetSerialNumberStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP60, "EControlSetSerialNumberStringDescriptor");
 		r = iController->SetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveSerialNumberStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveSerialNumberStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP61, "EControlRemoveSerialNumberStringDescriptor");
 		r = iController->RemoveSerialNumberStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetConfigurationStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP62, "EControlGetConfigurationStringDescriptor");
 		r = iController->GetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetConfigurationStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP63, "EControlSetConfigurationStringDescriptor");
 		r = iController->SetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveConfigurationStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveConfigurationStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP64, "EControlRemoveConfigurationStringDescriptor");
 		r = iController->RemoveConfigurationStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP65, "EControlGetStringDescriptor");
 		r = iController->GetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlSetStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP66, "EControlSetStringDescriptor");
 		r = iController->SetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveStringDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveStringDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP67, "EControlRemoveStringDescriptor");
 		r = iController->RemoveStringDescriptor((TUint8) (TInt) a1);
 		break;
 
 	case RDevUsbcScClient::EControlAllocateEndpointResource:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlAllocateEndpointResource"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP68, "EControlAllocateEndpointResource");
 		epRes = (TUsbcEndpointResource)((TInt) a2);
 		TInt realEp=-1;
 		r = GetRealEpForEpResource((TInt)a1, realEp);
@@ -2231,7 +2276,7 @@
 		}
 	case RDevUsbcScClient::EControlDeAllocateEndpointResource:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeAllocateEndpointResource"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP69, "EControlDeAllocateEndpointResource");
 		epRes = (TUsbcEndpointResource)((TInt) a2);
 		TInt realEp=-1;
 		r = GetRealEpForEpResource((TInt)a1, realEp);
@@ -2241,7 +2286,7 @@
 		}
 	case RDevUsbcScClient::EControlQueryEndpointResourceUse:
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlQueryEndpointResourceUse"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP70, "EControlQueryEndpointResourceUse");
 		epRes = (TUsbcEndpointResource)((TInt) a2);
 		TInt realEp=-1;
 		r = GetRealEpForEpResource((TInt)a1, realEp);
@@ -2250,31 +2295,31 @@
 		break;
 		}
 	case RDevUsbcScClient::EControlSetOtgDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetOtgDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP71, "EControlSetOtgDescriptor");
 		r = iController->SetOtgDescriptor(iClient, *((const TDesC8*)a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetOtgDescriptor:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtgDescriptor"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP72, "EControlGetOtgDescriptor");
 		r = iController->GetOtgDescriptor(iClient, *((TDes8*)a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetOtgFeatures:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtgFeatures"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP73, "EControlGetOtgFeatures");
 		r = iController->GetOtgFeatures(iClient, *((TDes8*)a1));
 		break;
 
 	case RDevUsbcScClient::EControlRealizeInterface:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlRealizeInterface"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP74, "EControlRealizeInterface");
 		r = RealizeInterface();
 		break;
 	case RDevUsbcScClient::EControlStartNextInAlternateSetting:
-		__KTRACE_OPT(KUSB, Kern::Printf("EControlStartNextInAlternateSetting"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP75, "EControlStartNextInAlternateSetting");
 		r = StartNextInAlternateSetting();
 		break;
 
     default:
-		__KTRACE_OPT(KUSB, Kern::Printf("Function code not supported"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP76, "Function code not supported");
 		r = KErrNotSupported;
 		}
 
@@ -2289,12 +2334,13 @@
 //
 TInt DLddUsbcScChannel::RequestUserHandle(DThread* aThread, TOwnerType /*aType*/)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::RequestUserHandle"));
-	// The USB client LDD can share across process, but can't use simultanously. 
-	// This mean if transfer the handle to another process, can't access this channel
-	// in the origin process and any call to the channel will return with KErrAccessDenied.
-	// If there is async request scheduled, can't transfer channel handle to another process
-	// and return KErrAccessDenied. 
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE, "DLddUsbcScChannel::RequestUserHandle" );
+    
+	// The USB client LDD is not designed for a channel to be shared between
+	// threads. It saves a pointer to the current thread when it is opened, and
+	// uses this to complete any asynchronous requests.
+	// It is therefore not acceptable for the handle to be duplicated and used
+	// by another thread:
 	if (aThread == iClient)
 		{
 		return KErrNone;
@@ -2332,7 +2378,7 @@
 				iBuffers[i].iStatusList.SetClient(*iClient);
 				}
 			}
-		__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::handle %d", iChunkInfo->iChunk->AccessCount()));
+		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE_DUP1, "DLddUsbcScChannel::handle %d", iChunkInfo->iChunk->AccessCount());
 		return KErrNone;
 		}
 	}
@@ -2402,18 +2448,18 @@
 	TUsbcScInterfaceInfoBuf* const ifc_info_buf_ptr = aInfoBuf->iInterfaceData;
 	const TInt srcLen = Kern::ThreadGetDesLength(iClient, ifc_info_buf_ptr);
 
-	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface srcLen = %d len = %d", srcLen, ifc_info_buf.Length() ));
-
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE, "SetInterface srcLen = %d len = %d", srcLen, ifc_info_buf.Length());
+	
 	if (srcLen < ifc_info_buf.Length())
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface can't copy"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP1, "SetInterface can't copy");
 		PanicClientThread(EDesOverflow);
 		}
 
 	TInt r = Kern::ThreadDesRead(iClient, ifc_info_buf_ptr, ifc_info_buf, 0, KChunkShiftBy0);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Copy failed reason=%d", r));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP2, "SetInterface Copy failed reason=%d", r);
 		PanicClientThread(r);
 		}
 
@@ -2421,7 +2467,7 @@
 	TUsbcScEndpointInfo* pEndpointData = ifc_info_buf().iEndpointData;
 
 	const TInt num_endpoints = ifc_info_buf().iTotalEndpointsUsed;
-	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface num_endpoints=%d", num_endpoints));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP3, "SetInterface num_endpoints=%d", num_endpoints);
 	if (num_endpoints>KMaxEndpointsPerClient)
 		return KErrOverflow;
 
@@ -2434,7 +2480,7 @@
 
 
 	// See if PIL will accept this interface
-	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Calling controller"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP4, "SetInterface Calling controller");
 	TUsbcEndpointInfoArray endpointData = TUsbcEndpointInfoArray(ifc_info_buf().iEndpointData);
 
 	r = iController->SetInterface(this,
@@ -2447,10 +2493,10 @@
 								  &real_ep_numbers[0],
 								  ifc_info_buf().iFeatureWord);
 
-	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface controller returned %d", r));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP5, "SetInterface controller returned %d", r);
 	if (r != KErrNone)
 		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("SetInterface failed reason=%d", r));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP6, "SetInterface failed reason=%d", r);
 		return r;
 		}
 
@@ -2465,8 +2511,7 @@
 	// other endpoints
 	for (TInt i = 1; i <= num_endpoints; i++, pEndpointData++)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d", i));
-
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP7, "SetInterface for ep=%d", i);
 		if ((pEndpointData->iType==KUsbEpTypeControl)
 			|| (pEndpointData->iDir != KUsbEpDirIn && pEndpointData->iDir != KUsbEpDirOut)
 			|| (pEndpointData->iSize > 1024) || (pEndpointData->iSize<=0))
@@ -2497,9 +2542,8 @@
 			goto CleanUp;
 			}
 
-	
-		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d rec=0x%08x ep==0x%08x",
-										i, alternateSettingListRec, ep));
+		OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP8, "SetInterface for ep=%d rec=0x%08x ep==0x%08x",
+                                        i, (TUint)alternateSettingListRec, (TUint)ep);                              
 		}
 
 	if (iAlternateSettingList->iHead)
@@ -2533,8 +2577,12 @@
 
  ReleaseInterface:
 #if _DEBUG
+#ifdef OST_TRACE_COMPILER_IN_USE
 	TInt r1 = iController->ReleaseInterface(this, aInterfaceNumber);
-	__KTRACE_OPT(KUSB, Kern::Printf("Release Interface controller returned %d", r1));
+#else
+	(void)  iController->ReleaseInterface(this, aInterfaceNumber);
+#endif
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP9, "Release Interface controller returned %d", r1);
 #else
 	(void)	iController->ReleaseInterface(this, aInterfaceNumber);
 #endif
@@ -2552,9 +2600,13 @@
 	if (mem!=NULL)
 		{
 		TInt j;
- 		Kern::Printf("Final chunk header State:");
-		for (j=0; j<30; j+=8)
- 			Kern::Printf("%2x: %8x %8x %8x %8x %8x %8x %8x %8x", j, mem[j], mem[j+1], mem[j+2], mem[j+3], mem[j+4], mem[j+5], mem[j+6], mem[j+7] );
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, _REALIZEINTERFACE_DUMP, "Final chunk header State:" );
+		
+		for (j=0; j<30; j+=8) 
+		    {
+		    OstTrace1(TRACE_NORMAL, _REALIZEINTERFACE_DUMP_DUP1, "%2x", j);
+		    OstTraceExt1(TRACE_NORMAL, _REALIZEINTERFACE_DUMP_DUP2, "%{uint32[]}", TOstArray<TUint>(&mem[j], 8));
+		    }
 		};
 	};
 #endif
@@ -2645,7 +2697,8 @@
 		iBuffers = (TUsbcScBuffer *) Kern::AllocZ(sizeof(TUsbcScBuffer) * (bufInfo.iTotalBuffers+2)); // +2 is for ep0.
 	if (!iBuffers)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Realize: Error: Alloc iBufers failed!"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE, "Realize: Error: Alloc iBufers failed!" );
+        
 		errorOrChunk = KErrNoMemory;
 		goto realize_end;
 		}
@@ -2654,19 +2707,18 @@
 	errorOrChunk = SetupEp0();
 	if (errorOrChunk)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Realize: SetupEp0 . ERROR %d",errorOrChunk));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP1, "Realize: SetupEp0 . ERROR %d",errorOrChunk);
 		goto realize_end;
 		}
 
 	ep0Size = iEp0Endpoint->EndpointInfo()->iSize;
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Setup EP0. max packet size %d", ep0Size));
-
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP2, "Realize: Setup EP0. max packet size %d", ep0Size);
 	// Create EP0 buffers
 	iEP0OutBuff=bufInfo.iTotalBuffers;
 	errorOrChunk = iBuffers[iEP0OutBuff].Construct(KUsbcScBiOut,  this,   KUsbScEP0OutBufPos, KUsbScEP0OutBufEnd, ep0Size, ep0Size, ep0Size);
 	if (errorOrChunk)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Realize: Setup EP0 Out. ERROR %d",errorOrChunk));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP3, "Realize: Setup EP0 Out. ERROR %d",errorOrChunk);
 		goto realize_end;
 		}
 
@@ -2681,7 +2733,7 @@
 	errorOrChunk = iBuffers[iEP0InBuff].Construct( KUsbcScBiIn ,  this,   KUsbScEP0InBufPos , KUsbScEP0InBufEnd , ep0Size, ep0Size, ep0Size);	
 	if (errorOrChunk)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Realize: Setup EP0 In. ERROR %d",errorOrChunk));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP4, "Realize: Setup EP0 In. ERROR %d",errorOrChunk);
 		goto realize_end;
 		}
 	
@@ -2695,8 +2747,7 @@
 	} // end ep0Size scope
 
 	// Create resources and tables.  .   .   .   .   .
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Create resources tables"));
-
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP5, "Realize: Create resources tables");
 	{ // scope of bufNum
 	// For each EP buffer
 	TInt buffNum=0;
@@ -2718,8 +2769,7 @@
 				{
 				TInt bufStart = offset;
 
-				__KTRACE_OPT(KUSB, Kern::Printf("Realize:    buf row:%d inout %d, iBufferOffset[%d+2]=%x",endpoint, inout, buffNum, bufStart));
-
+				OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP6, "Realize:    buf row:%d inout %d, iBufferOffset[%d+2]=%x",endpoint, (TUint)inout, (TUint)buffNum, (TUint)bufStart);
 				bufsd =  &(bufInfo.iBufs[inout]);
 				// and then point all endpoints that use it, towards it.
 				TInt altSetting;	
@@ -2749,13 +2799,13 @@
 
 					if (endpointRecord->EndpointInfo()->iReadSize)
 						maxReadSize = (maxReadSize <= endpointRecord->EndpointInfo()->iReadSize) ? maxReadSize : endpointRecord->EndpointInfo()->iReadSize;
-					
-					__KTRACE_OPT(KUSB, Kern::Printf("Realize:      endpointNum %d in altSetting %d, alt table @ %d",
-													 endpointNumber, altSetting,bufInfo.iAltSettingsTbl->iAltTableOffset[altSetting]));
+                        OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP7, "Realize:      endpointNum %d in altSetting %d, alt table @ %d",
+                                                     endpointNumber, (TUint)altSetting,bufInfo.iAltSettingsTbl->iAltTableOffset[altSetting]);
+                                                   
 						}
 					else
 						{
-						__KTRACE_OPT(KUSB, Kern::Printf("Realize:      endpointNum NA in altSetting %d", altSetting));
+                        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP8, "Realize:      endpointNum NA in altSetting %d", altSetting);
 						}
 
 					} // end for
@@ -2827,7 +2877,7 @@
 #endif
 
 realize_end:
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: cleanup.  Err=%d", errorOrChunk));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP9, "Realize: cleanup.  Err=%d", errorOrChunk);
 	// Here we clean up after either success, or after bailing out early.
 
 	bufInfo.Free();
@@ -2870,7 +2920,7 @@
 	if (openedCS)
 		NKern::ThreadLeaveCS();
 
-	__KTRACE_OPT(KUSB, Kern::Printf("Realize: returning %x (%d)", errorOrChunk, errorOrChunk));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP10, "Realize: returning %x (%d)", errorOrChunk, errorOrChunk);
 	return errorOrChunk;
 } // End RealizeInterface
 
@@ -2881,7 +2931,8 @@
 
 void DLddUsbcScChannel::DestroyAllInterfaces()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyAllInterfaces"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES, "DLddUsbcScChannel::DestroyAllInterfaces" );
+    
 	// Removes all interfaces
 	if (iAlternateSettingList)
 		{
@@ -2892,7 +2943,7 @@
 				{
 				iAlternateSettingList->iTail = alternateSettingListRec->iPrevious; 
 				// If this contains NULL now that is only possible if the record to be deleted was at the head
-				__KTRACE_OPT(KUSB, Kern::Printf("Release interface %d \n", alternateSettingListRec->iSetting));
+				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP1, "Release interface %d \n", alternateSettingListRec->iSetting);
 				iController->ReleaseInterface(this, alternateSettingListRec->iSetting);
 				delete alternateSettingListRec;
 				if (iAlternateSettingList->iTail == NULL) //No more interfaces left 
@@ -2911,7 +2962,7 @@
 	iAlternateSettingList = NULL;
 	iValidInterface = EFalse;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyAllInterfaces done"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP2, "DLddUsbcScChannel::DestroyAllInterfaces done");
 	}
 
 
@@ -2924,7 +2975,7 @@
 
 void DLddUsbcScChannel::DestroyInterface(TUint aInterfaceNumber)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyInterface \n"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DESTROYINTERFACE, "DLddUsbcScChannel::DestroyInterface \n" );
 	
 	if (iAlternateSetting == aInterfaceNumber)
 		{
@@ -2954,7 +3005,7 @@
 					}
 				else	//Somewhere in the middle (would not expect this in normal operation, but here for completeness)
 					{
-					__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyInterface Middle interface!\n"));
+                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DESTROYINTERFACE_DUP1, "DLddUsbcScChannel::DestroyInterface Middle interface!\n" );
 					alternateSettingListRec->iPrevious->iNext = alternateSettingListRec->iNext;
 					alternateSettingListRec->iNext->iPrevious = alternateSettingListRec->iPrevious;
 					}	
@@ -3004,7 +3055,8 @@
 
 void DLddUsbcScChannel::DestroyEp0()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DestroyEp0"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DESTROYEP0, "DLddUsbcScChannel::DestroyEp0" );
+    
 	delete iEp0Endpoint;
 	iEp0Endpoint = NULL;
 	}
@@ -3014,11 +3066,12 @@
     {
 	DLddUsbcScChannel* channel = (DLddUsbcScChannel*) aDLddUsbcScChannel;
 
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::RequestCallbackEp0"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0, "DLddUsbcScChannel::RequestCallbackEp0" );
+	
 
 	if (channel->ChannelClosing())
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Channel Closing: Completion not accepted!"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP1, "Channel Closing: Completion not accepted!" );
 		return;
 		}
 
@@ -3031,7 +3084,7 @@
 		channel->iBuffers[channel->iEP0OutBuff].CompleteRead();
 		return;
 	default:
-		Kern::Printf("DLddUsbcScChannel::RequestCallbackEp0 - Unexpected completion direction %d",channel->iEp0Endpoint->iRequestCallbackInfo->iTransferDir);
+	    OstTrace1(TRACE_NORMAL, DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP2, "DLddUsbcScChannel::RequestCallbackEp0 - Unexpected completion direction %d",channel->iEp0Endpoint->iRequestCallbackInfo->iTransferDir);
 		Kern::Fault("DLddUsbcScChannel::RequestCallbackEp0", __LINE__);
 		} 
 	}
@@ -3047,7 +3100,8 @@
 
 void DLddUsbcScChannel::EndpointStatusChangeCallback(TAny* aDLddUsbcScChannel)
     {
-	__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK, "DLddUsbcScChannel::EndpointStatusChangeCallback" );
+    
     DLddUsbcScChannel* dUsbc = (DLddUsbcScChannel*) aDLddUsbcScChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -3055,7 +3109,7 @@
 	const TInt reqNo = (TInt) RDevUsbcScClient::ERequestEndpointStatusNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback Notify status"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1, "EndpointStatusChangeCallback Notify status" );
 		DThread* client = dUsbc->iClient;
 		// set client descriptor length to zero
 		TInt r = Kern::ThreadRawWrite(client, dUsbc->iEndpointStatusChangePtr, &endpointState,
@@ -3084,7 +3138,8 @@
  		 (i < KUsbcDeviceStateRequests) && ((deviceState = dUsbc->iStatusCallbackInfo.State(i)) != EUsbcNoState);
  		 ++i)
 		{
- 		__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallBack status=%d", deviceState));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STATUSCHANGECALLBACK, "StatusChangeCallBack status=%d", deviceState);
+        
 		if (deviceState & KUsbAlternateSetting)
 			{
 			dUsbc->ProcessAlternateSetting(deviceState);
@@ -3114,7 +3169,8 @@
 
 void DLddUsbcScChannel::OtgFeatureChangeCallback(TAny* aDLddUsbcScChannel)
     {
-	__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK, "DLddUsbcScChannel::OtgFeatureChangeCallback" );
+    
     DLddUsbcScChannel* dUsbc = (DLddUsbcScChannel*) aDLddUsbcScChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -3126,7 +3182,7 @@
     const TInt reqNo = (TInt) RDevUsbcScClient::ERequestOtgFeaturesNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback Notify status"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1, "OtgFeatureChangeCallback Notify status" );
 		TInt r = Kern::ThreadRawWrite(dUsbc->iClient, dUsbc->iOtgFeatureChangePtr,
                                       &features, sizeof(TUint8), dUsbc->iClient);
 		if (r != KErrNone)
@@ -3204,14 +3260,15 @@
 				}
 			else
 				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aEndpoint %d wrong for aAlternateSetting %d",
-												  aEndpoint, aAlternateSetting));
+                OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING, "  Error: aEndpoint %d wrong for aAlternateSetting %d",
+                                                  aEndpoint, aAlternateSetting);
+                
 				return KErrNotFound;
 				}
 			}
 		alternateSettingListRec = alternateSettingListRec->iNext;
 		}
-	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no aAlternateSetting %d found", aAlternateSetting));
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING_DUP1, "  Error: no aAlternateSetting %d found", aAlternateSetting);
 	return KErrNotFound;
 	}
 
@@ -3223,7 +3280,8 @@
 	{
 
 	TUint newSetting = aAlternateSetting&(~KUsbAlternateSetting);
-	__KTRACE_OPT(KUSB, Kern::Printf("ProcessAlternateSetting 0x%08x selecting alternate setting 0x%08x", aAlternateSetting, newSetting));
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSALTERNATESETTING, "ProcessAlternateSetting 0x%08x selecting alternate setting 0x%08x", aAlternateSetting, newSetting);
+	
 	iUserKnowsAltSetting=EFalse;
 	iAlternateSetting = newSetting;
 	iAsSeq++; 
@@ -3247,19 +3305,20 @@
 
 TInt DLddUsbcScChannel::ProcessDeviceState(TUsbcDeviceState aDeviceState)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState));
+    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE, "DLddUsbcScChannel::ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState);
+    
 	if (iDeviceState == aDeviceState)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  No state change => nothing to be done."));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP1, "  No state change => nothing to be done.");
 		return KErrNone;
 		}
 	if (iDeviceState == EUsbcDeviceStateSuspended)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Coming out of Suspend: old state = %d", iOldDeviceState));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP2, "  Coming out of Suspend: old state = %d", iOldDeviceState);
 		iDeviceState = iOldDeviceState;
 		if (iDeviceState == aDeviceState)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("  New state same as before Suspend => nothing to be done."));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP3, "  New state same as before Suspend => nothing to be done.");
 			return KErrNone;
 			}
 		}
@@ -3268,7 +3327,7 @@
 	TInt cancellationCode = KErrNone;
 	if (aDeviceState == EUsbcDeviceStateSuspended)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("  Suspending..."));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP4, "  Suspending...");
 		iOldDeviceState = iDeviceState;
 		// Put PSL into low power mode here
 		}
@@ -3300,10 +3359,10 @@
 			}
 		else if (renumerateState)
 			{
- 			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChannel:: Reumerated!"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP5, "TUsbcScChannel:: Reumerated!");
 			// Select main interface & latch in new endpoint set
 			SelectAlternateSetting(0);
-			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChannel:: StartReads!"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP6, "TUsbcScChannel:: StartReads!");
 			StartEpReads();
 			}
 		}
@@ -3331,7 +3390,8 @@
 			{
 			// Device state waiting to be sent userside
 			completeNow = ETrue;
-			__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallback Notify status"));
+			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE, "StatusChangeCallback Notify status" );
+			
 			// set client descriptor length to zero
 			TInt r = Kern::ThreadRawWrite(iClient, iStatusChangePtr, &deviceState,
 										  sizeof(TUint32), iClient);
@@ -3346,7 +3406,8 @@
 
 void DLddUsbcScChannel::DeConfigure(TInt aErrorCode)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DeConfigure()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DECONFIGURE, "DLddUsbcScChannel::DeConfigure()" );
+    
 	// Called after deconfiguration. Cancels transfers on all endpoints.
 	ResetInterface(aErrorCode);
 	// Cancel the endpoint status notify request if it is outstanding.
@@ -3366,29 +3427,27 @@
 	{
 	// Queued after enumeration. Starts reads on all endpoints.
 	// The endpoint itself decides if it can do a read
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 1"));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_STARTEPREADS, "DLddUsbcScChannel::StartEpReads - 1" );
 	
 	TInt i;
 	TInt8 needsPacket;
 
 	for (i=0; i<iNumBuffers; i++)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 2 %d",i));
-
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP1, "DLddUsbcScChannel::StartEpReads - 2 %d", i);
 		needsPacket = iBuffers[i].iNeedsPacket;
 		if (needsPacket)
 			{
-			__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 3"));
+            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP2, "DLddUsbcScChannel::StartEpReads - 3");
 			iBuffers[i].UpdateBufferList(0,0,(needsPacket==TUsbcScBuffer::KEpIsStarting));
 			}
 		}
 
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 4"));
-
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP3, "DLddUsbcScChannel::StartEpReads - 4");
 		// now update ep0
 		iBuffers[iEP0OutBuff].Ep0CancelLddRead();
 		iBuffers[iEP0OutBuff].UpdateBufferList(0,0);
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 5"));
+	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP4, "DLddUsbcScChannel::StartEpReads - 5");
 
 	}
 
@@ -3410,7 +3469,8 @@
 		{
 		// Firstly, cancel ('garbge collect') any stale reads/writes into PIL.
 
-		__KTRACE_OPT(KUSB, Kern::Printf("Cancelling transfer ep=%d", i));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_RESETINTERFACE, "Cancelling transfer ep=%d", i);
+        
 		iEndpoint[i]->AbortTransfer();
 
 		// All OUT endpoints need a packet sent, to indicate the termination of the current ep 'pipe'.
@@ -3439,7 +3499,8 @@
 
 TInt DLddUsbcScChannel::DoEmergencyComplete()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DoEmergencyComplete"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE, "DLddUsbcScChannel::DoEmergencyComplete" );
+    
 	// cancel any pending DFCs
 	// complete all client requests
 
@@ -3462,7 +3523,7 @@
 	// Complete other Eps request
 	for (i = 1; i <= iNumberOfEndpoints; i++)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Cancelling transfer ep=%d", i));
+        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP1, "Cancelling transfer ep=%d", i);
 		buffer=iEndpoint[i]->GetBuffer();
 		buffer->iStatusList.CancelQueued();
 		buffer->iStatusList.Complete(KErrDisconnected);
@@ -3474,7 +3535,7 @@
         {
         if (iRequestStatus[i])
             {
-            __KTRACE_OPT(KUSB, Kern::Printf("Complete request 0x%x", iRequestStatus[i]));
+            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP2, "Complete request 0x%x", iRequestStatus[i]);
             Kern::RequestComplete(iClient, iRequestStatus[i], KErrDisconnected);
             }
         }
@@ -3517,14 +3578,15 @@
 	  iBytesTransferred(0),
 	  iBuffer(NULL)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::TUsbcScEndpoint"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCENDPOINT_TUSBCSCENDPOINT_CONS, "TUsbcScEndpoint::TUsbcScEndpoint" );
+    
 	}
 
 
 TInt TUsbcScEndpoint::Construct()
 	{
-	__KTRACE_OPT(KUSB,Kern::Printf("TUsbcScEndpoint::TUsbcScEndpoint iEndpointNumber %d\n",iEndpointNumber));
-
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_CONSTRUCT, "TUsbcScEndpoint::TUsbcScEndpoint iEndpointNumber %d\n",iEndpointNumber);
+    
 	iRequestCallbackInfo = new TUsbcRequestCallback(iLdd,
 													iEndpointNumber,
 													(iEndpointNumber==0)?DLddUsbcScChannel::RequestCallbackEp0:TUsbcScEndpoint::RequestCallback,
@@ -3538,7 +3600,8 @@
 
 TUsbcScEndpoint::~TUsbcScEndpoint()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::~TUsbcScEndpoint(%d)", iEndpointNumber));
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCENDPOINT_TUSBCSCENDPOINT_DES, "TUsbcScEndpoint::~TUsbcScEndpoint(%d)", iEndpointNumber);
+    
 	AbortTransfer();
 	delete iRequestCallbackInfo;
 	}
@@ -3548,11 +3611,11 @@
 
 void TUsbcScEndpoint::RequestCallback(TAny* aTUsbcScEndpoint)
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::RequestCallback"));
-
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCENDPOINT_REQUESTCALLBACK, "TUsbcScEndpoint::RequestCallback" );
+    
 	if (((TUsbcScEndpoint*)aTUsbcScEndpoint)->iLdd->ChannelClosing())
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("Channel Closing: Completion not accepted!"));
+		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_REQUESTCALLBACK_DUP1, "Channel Closing: Completion not accepted!" );
 		return;
 		}
 
@@ -3565,7 +3628,7 @@
 		((TUsbcScEndpoint*) aTUsbcScEndpoint)->iBuffer->CompleteRead();
 		return;
 	default:
-		Kern::Printf("TUsbcScEndpoint::RequestCallback - Unexpected compleation direction %d",((TUsbcScEndpoint*) aTUsbcScEndpoint)->iRequestCallbackInfo->iTransferDir);
+	    OstTrace1(TRACE_NORMAL, TUSBCSCENDPOINT_REQUESTCALLBACK_DUP2, "TUsbcScEndpoint::RequestCallback - Unexpected compleation direction %d",((TUsbcScEndpoint*) aTUsbcScEndpoint)->iRequestCallbackInfo->iTransferDir);
 		Kern::Fault("TUsbcScEndpoint::RequestCallback", __LINE__);
 	} 
 	}
@@ -3581,12 +3644,13 @@
 	{
 	if (!iLdd->iRealizeCalled)
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d - N.R.",iEndpointNumber, iRealEpNumber));
+        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER, "TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d - N.R.",iEndpointNumber, iRealEpNumber);
+        
 		return;
 		} 
 	else
 		{
-		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d",iEndpointNumber, iRealEpNumber));
+        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP1, "TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d",iEndpointNumber, iRealEpNumber);
 		}
 
 	
@@ -3600,17 +3664,18 @@
 			{
 			if (iEndpointNumber!=0) // endpoint zero starts off not sent in any direction, then keeps changing.
 				{
-				__KTRACE_OPT(KUSB,Kern::Printf("\nTUsbcScEndpoint::AbortTransfer WARNING: Invalid Direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber));
+                OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP2, "\nTUsbcScEndpoint::AbortTransfer WARNING: Invalid Direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber);
 				}
 			else
 				{
-				__KTRACE_OPT(KUSB, Kern::Printf("\nTUsbcScEndpoint::AbortTransfer Can't stop direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber));
+                OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP3, "\nTUsbcScEndpoint::AbortTransfer Can't stop direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber);
 				}
 			}
 		}
 	else if (!iBuffer)
 		{
-		__KTRACE_OPT(KUSB,Kern::Printf("\nTUsbcScEndpoint::AbortTransfer WARNING: iBuffer is NULL on (%d,%d)\n",iEndpointNumber, iRealEpNumber));
+        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP4, "\nTUsbcScEndpoint::AbortTransfer WARNING: iBuffer is NULL on (%d,%d)\n",iEndpointNumber, iRealEpNumber);
+
 		return;
 		}
 	
@@ -3618,10 +3683,11 @@
 		iRequestCallbackInfo->iDfc.Cancel();
 	else
 		{
-		__KTRACE_OPT(KUSB,Kern::Printf("\nTUsbcScEndpoint::AbortTransfer WARNING: iRequestCallbackInfo is NULL\n"));
+        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP5, "\nTUsbcScEndpoint::AbortTransfer WARNING: iRequestCallbackInfo is NULL\n");
+
 		}
 		
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint Done."));
+	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP6, "TUsbcScEndpoint Done.");
 	}
 
 // End TUsbcScEndpoint
@@ -3650,7 +3716,8 @@
 
 TUsbcScAlternateSetting::~TUsbcScAlternateSetting()
 	{
-	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScAlternateSetting::~TUsbcScAlternateSetting()"));
+    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCALTERNATESETTING_TUSBCSCALTERNATESETTING_DES, "TUsbcScAlternateSetting::~TUsbcScAlternateSetting()" );
+    
 	for (TInt i = 0; i <= KMaxEndpointsPerClient; i++)
 		{
 		delete iEndpoint[i];
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/usbcsc/traces/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+// #define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/usbcsc/traces/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,266 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP44=0x2
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP48=0x3
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING=0x6
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING_DUP1=0x7
+[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP6=0x5
+[TRACE]TRACE_FATAL[0x81]_DUSBCSCLOGDEVICE_INSTALL=0x1
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DECONFIGURE=0x9
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES=0x12
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DESTROYEP0=0x14
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DESTROYINTERFACE=0x13
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_CONS=0x6
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES=0x10
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE=0xb
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK=0x7
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK=0x8
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0=0x15
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE=0x11
+[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_STARTEPREADS=0xa
+[TRACE]TRACE_FLOW[0x8A]_TREALIZEINFO_CALCBUFFSIZES=0x5
+[TRACE]TRACE_FLOW[0x8A]_TREALIZEINFO_COPYANDSORTENDPOINTS=0x4
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSCALTERNATESETTING_TUSBCSCALTERNATESETTING_DES=0xf
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSCBUFFER_DESTROY=0x2
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSCBUFFER_STARTDATAWRITE=0x3
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSCCHUNKINFO_CHUNKCLEANUP=0x1
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSCENDPOINT_REQUESTCALLBACK=0xe
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSCENDPOINT_TUSBCSCENDPOINT_CONS=0xc
+[TRACE]TRACE_FLOW[0x8A]_TUSBCSCENDPOINT_TUSBCSCENDPOINT_DES=0xd
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE=0xd8
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP1=0xc5
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP2=0xc6
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYINTERFACE_DUP1=0xc8
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP1=0x3c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP2=0x3d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP3=0x3e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP4=0xea
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL=0x57
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP1=0x58
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP2=0x59
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP3=0x5a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP4=0x5b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP5=0x5c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP6=0x5d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP7=0x5e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP8=0x5f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP9=0x60
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL=0x61
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP1=0x62
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP10=0x6b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP11=0x6c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP12=0x6d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP13=0x6e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP14=0x6f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP15=0x70
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP16=0x71
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP18=0x73
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP2=0x63
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP20=0x75
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP21=0x76
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP22=0x77
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP23=0x78
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP24=0x79
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP25=0x7a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP26=0x7b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP27=0x7c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP28=0x7d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP29=0x7e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP3=0x64
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP30=0x7f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP32=0x81
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP33=0x82
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP34=0x83
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP35=0x84
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP36=0x85
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP37=0x86
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP38=0x87
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP39=0x88
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP4=0x65
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP40=0x89
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP41=0x8a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP42=0x8b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP43=0x8c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP45=0x8d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP46=0x8e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP47=0x8f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP49=0x90
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP5=0x66
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP50=0x91
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP51=0x92
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP52=0x93
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP53=0x94
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP54=0x95
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP55=0x96
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP56=0x97
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP57=0x98
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP58=0x99
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP59=0x9a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP6=0x67
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP60=0x9b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP61=0x9c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP62=0x9d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP63=0x9e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP64=0x9f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP65=0xa0
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP66=0xa1
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP67=0xa2
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP68=0xa3
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP69=0xa4
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP7=0x68
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP70=0xa5
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP71=0xa6
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP72=0xa7
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP73=0xa8
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP74=0xa9
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP75=0xaa
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP76=0xab
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP8=0x69
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP9=0x6a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCREATE=0x3f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP1=0xde
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP2=0xdf
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY=0x4c
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP1=0x4d
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP2=0x4e
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP3=0x4f
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP4=0x50
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST=0x41
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP1=0x42
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP10=0x4b
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP17=0x72
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP19=0x74
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP2=0x43
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP3=0x44
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP31=0x80
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP4=0x45
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP5=0x46
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP6=0x47
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP7=0x48
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP8=0x49
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP9=0x4a
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA=0x51
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP1=0x52
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP2=0x53
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP3=0x54
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP4=0x55
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP5=0x56
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1=0xcd
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_HANDLEMSG=0x40
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1=0xcf
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSALTERNATESETTING=0xd0
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE=0xd1
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP1=0xd2
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP2=0xd3
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP3=0xd4
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP4=0xd5
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP5=0xd6
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP6=0xd7
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE=0xb9
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP1=0xba
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP10=0xc3
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP2=0xbb
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP3=0xbc
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP4=0xbd
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP5=0xbe
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP6=0xbf
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP7=0xc0
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP8=0xc1
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP9=0xc2
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP1=0xcb
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP2=0xcc
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE_DUP1=0xac
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_RESETINTERFACE=0xdd
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE=0xad
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP1=0xae
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP2=0xaf
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP3=0xb0
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP4=0xb1
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP5=0xb2
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP7=0xb3
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP8=0xb4
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP9=0xb5
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP1=0xd9
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP2=0xda
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP3=0xdb
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP4=0xdc
+[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STATUSCHANGECALLBACK=0xce
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP1=0x33
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP2=0x34
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP3=0x35
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP4=0x36
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP5=0x37
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP1=0x2b
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP2=0x2c
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP3=0x2d
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP4=0x2e
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP5=0x2f
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP6=0x30
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP7=0x31
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP8=0x32
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_INIT=0x29
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_INIT_DUP1=0x2a
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_LAYOUTCHUNKHEADER=0x38
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_LAYOUTCHUNKHEADER_DUP1=0x39
+[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_LAYOUTCHUNKHEADER_DUP2=0x3a
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_COMPLETEREAD=0x15
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_COMPLETEWRITE=0x23
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_CREATECHUNKBUFFERHEADER=0xb
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_POPSTALL=0x1e
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_SENDEP0STATUSPACKET=0x24
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD=0xf
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP1=0x10
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP2=0x11
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP3=0x12
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP4=0x13
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP5=0x14
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP1=0x1f
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP2=0x20
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP3=0x21
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP4=0x22
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTENDPOINT=0xc
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTENDPOINT_DUP1=0xd
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTENDPOINT_DUP2=0xe
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST=0x16
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP1=0x17
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP2=0x18
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP3=0x19
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP4=0x1a
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP5=0x1b
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP6=0x1c
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP7=0x1d
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC=0x4
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP1=0x5
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP2=0x6
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP3=0x7
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP4=0x8
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CLOSE=0x1
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CLOSE_DUP1=0x2
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CLOSE_DUP2=0x3
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_NEW=0x9
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_NEW_DUP1=0xa
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER=0xe3
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP1=0xe4
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP2=0xe5
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP3=0xe6
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP4=0xe7
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP5=0xe8
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP6=0xe9
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_CONSTRUCT=0xe0
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_REQUESTCALLBACK_DUP1=0xe1
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_REQUESTCALLBACK_DUP2=0xe2
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_ADD=0x25
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_ADD_DUP1=0x26
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_COMPLETE=0x28
+[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_COMPLETE_TINT=0x27
+[TRACE]TRACE_NORMAL[0x86]__REALIZEINTERFACE_DUMP=0xb6
+[TRACE]TRACE_NORMAL[0x86]__REALIZEINTERFACE_DUMP_DUP1=0xb7
+[TRACE]TRACE_NORMAL[0x86]__REALIZEINTERFACE_DUMP_DUP2=0xb8
+[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE=0x4
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES=0xc4
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYEP0=0xc9
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYINTERFACE=0xc7
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES=0x3b
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0=0xca
--- a/kernel/eka/drivers/usbcsc/usbcsc.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/usbcsc.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -17,7 +17,8 @@
 
 #include "../../kernel/kern_ext.mmh"
 
-USERINCLUDE	../../include/drivers
+USERINCLUDE	../../include/drivers 
+USERINCLUDE     traces
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 target			usbcsc.ldd
--- a/kernel/eka/drivers/usbcsc/usbcsc_bil.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/usbcsc_bil.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -19,7 +19,10 @@
 #include <e32std_private.h>
 #include <d32usbcsc.h>
 #include <e32debug.h>
-
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "usbcsc_bilTraces.h"
+#endif
 /** @file usbcsc_bil.cpp
 
 	Buffer Interface Layer for USB Client Device driver stack, using shared chunks.
@@ -160,7 +163,7 @@
 
 #ifdef _DEBUG
 	aEpB.Dump();
-	RDebug::Printf("iEndpointStatus: %x \n",iEndpointStatus);
+	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, RDEVUSBCSCCLIENT_OPENENDPOINT, "iEndpointStatus: %x \n",iEndpointStatus );
 #endif
 	return KErrNone;
 	}
@@ -699,7 +702,9 @@
 
 EXPORT_C void TEndpointBuffer::Dump()
 	{
-	RDebug::Printf("TEndpointBuffer::Dump iBufferStart: 0x%x, iSize: 0x%x, iEndpointNumber: 0x%x, iBufferNum: %d, iInState: 0x%x iOutState: 0x%x\n",
-							iBufferStartAddr,iSize,iEndpointNumber,iBufferNum,iInState,iOutState);
+	OstTraceDefExt5(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TENDPOINTBUFFER_DUMP, "TEndpointBuffer::Dump iBufferStart: 0x%x, iSize: 0x%x, iEndpointNumber: 0x%x, iBufferNum: %d, iInState: 0x%x",
+            (TUint)iBufferStartAddr,iSize,iEndpointNumber,iBufferNum, (TUint)iInState);
+
+    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TENDPOINTBUFFER_DUMP_DUP1, " iOutState: 0x%x\n", iOutState);
 	}
 
--- a/kernel/eka/drivers/usbcsc/usbcsc_bil.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/usbcsc_bil.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -15,7 +15,8 @@
 // 
 //
 
-USERINCLUDE	../../include
+USERINCLUDE	../../include 
+USERINCLUDE     traces
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 target			usbcsc_bil.dll
@@ -28,3 +29,5 @@
 
 VENDORID 0x70000001
 capability		all
+
+UID 0 0x20031D6E
--- a/kernel/eka/eabi/rm_debug_extu.def	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-EXPORTS
-	_Z19CreateLogicalDevicev @ 1 NONAME
-	_ZN5Debug13StopModeDebug7GetListEPKNS_9TListItemEi @ 2 NONAME
-	_ZN5Debug13StopModeDebug7TestAPIEPKNS_9TListItemE @ 3 NONAME
-	_ZN5Debug13StopModeDebug9ExitPointEi @ 4 NONAME
-	_ZTI11DDebugAgent @ 5 NONAME
-	_ZTI12DRMDStepping @ 6 NONAME
-	_ZTI14DBufferManager @ 7 NONAME
-	_ZTI14DTargetProcess @ 8 NONAME
-	_ZTI15DProcessTracker @ 9 NONAME
-	_ZTI16DRM_DebugChannel @ 10 NONAME
-	_ZTI17D_RMD_Breakpoints @ 11 NONAME
-	_ZTI21DRM_DebugEventHandler @ 12 NONAME
-	_ZTI22DRM_DebugDriverFactory @ 13 NONAME
-	_ZTV11DDebugAgent @ 14 NONAME
-	_ZTV12DRMDStepping @ 15 NONAME
-	_ZTV14DBufferManager @ 16 NONAME
-	_ZTV14DTargetProcess @ 17 NONAME
-	_ZTV15DProcessTracker @ 18 NONAME
-	_ZTV16DRM_DebugChannel @ 19 NONAME
-	_ZTV17D_RMD_Breakpoints @ 20 NONAME
-	_ZTV21DRM_DebugEventHandler @ 21 NONAME
-	_ZTV22DRM_DebugDriverFactory @ 22 NONAME
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/eabi/sm_debugu.def	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,7 @@
+EXPORTS
+	_ZN5Debug13StopModeDebug7GetListEPKNS_9TListItemEi @ 1 NONAME
+	_ZN5Debug13StopModeDebug7TestAPIEPKNS_9TListItemE @ 2 NONAME
+	_ZN5Debug13StopModeDebug9ExitPointEi @ 3 NONAME
+	_ZTI14DBufferManager @ 4 NONAME
+	_ZTV14DBufferManager @ 5 NONAME
+
--- a/kernel/eka/euser/us_exec.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/euser/us_exec.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -2887,13 +2887,18 @@
 after calling this function.
 
 @param aLocaleDllName The name of the locale DLL to be loaded
-@return KErrNone if successful, system wide error if not
+@return KErrNone if successful, KErrNotSupported if the DLL name matches the pattern
+of a new-style locale library, system wide error otherwise
 
 @see TExtendedLocale::SaveSystemSettings 
 */
 EXPORT_C TInt TExtendedLocale::LoadLocale(const TDesC& aLocaleDllName)
 	{
 #ifdef SYMBIAN_DISTINCT_LOCALE_MODEL
+	if (aLocaleDllName.Find(KFindLan) != KErrNotFound || aLocaleDllName.Find(KFindReg) != KErrNotFound || aLocaleDllName.Find(KFindCol) != KErrNotFound)
+		{
+		return KErrNotSupported; // Only try to load old-style locale libraries
+		}
 	TLibraryFunction data[KNumLocaleExports];
 	TInt r = DoLoadLocale(aLocaleDllName, &data[0]);
 	if(r == KErrNone)
@@ -2993,6 +2998,9 @@
 the locale information in the DLL, you can call TExtendedLocale::SaveSystemSettings
 after calling this function.
 
+If the function fails then it will call LoadSystemSettings() to return its members
+to a known, good state.
+
 @param aLanguageLocaleDllName The name of the language locale DLL to be loaded
 @param aRegionLocaleDllName The name of the region locale DLL to be loaded
 @param aCollationLocaleDllName The name of the collation locale DLL to be loaded
@@ -3006,18 +3014,16 @@
 		const TDesC& aRegionLocaleDllName, 
 		const TDesC& aCollationLocaleDllName)
 	{
-
 	TInt err = LoadLocaleAspect(aLanguageLocaleDllName);
+
+	if(err == KErrNone)
+		err = LoadLocaleAspect(aRegionLocaleDllName);
+
+	if(err == KErrNone)
+		err = LoadLocaleAspect(aCollationLocaleDllName);
+
 	if(err != KErrNone)
-		return err;
-	
-	err = LoadLocaleAspect(aRegionLocaleDllName);
-	if(err != KErrNone)
-		return err;
-	
-	err = LoadLocaleAspect(aCollationLocaleDllName);
-	if(err != KErrNone)
-		return err;	
+		LoadSystemSettings();	
 
 	return err;	
 	}
--- a/kernel/eka/include/drivers/gpio.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/gpio.h	Thu Sep 02 21:54:16 2010 +0300
@@ -18,6 +18,14 @@
 #ifndef __GPIO_H__
 #define __GPIO_H__
 
+#include <dfcs.h>
+
+#ifdef __USE_GPIO_STATIC_EXTENSION__
+// test standard extension handler number. *DO NOT USE*
+#define KTestStaticExtension 0x80000000
+#include <staticextension.h>
+#endif
+
 class TGpioCallback;	//forward declaration
 
 /**
@@ -232,7 +240,6 @@
 
     /**
     Reads the pin idle configuration and state.
-    
     @param aId    The pin Id.
     @param aConf  On return contains the idle configuration and state previoulsy
 				  set on the pin.
@@ -274,7 +281,6 @@
             KErrGeneral, if there is no ISR bound to this interrupt.
     */
 	IMPORT_C static TInt UnbindInterrupt(TInt aId);
-
     /**
     Enables the interrupt on specified pin.
     
@@ -286,7 +292,6 @@
             KErrGeneral, if there is no ISR bound to this interrupt.
     */
 	IMPORT_C static TInt EnableInterrupt(TInt aId);
-
     /**
     Disables the interrupt on specified pin.
     
--- a/kernel/eka/include/drivers/mmc.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/mmc.h	Thu Sep 02 21:54:16 2010 +0300
@@ -3014,6 +3014,10 @@
 	inline void EnableDoubleBuffering(TUint32 aNumBlocks);							  /**< @internalTechnology */
 	inline void SetDataTransferCallback(TMMCCallBack& aCallback);					  /**< @internalTechnology */
 	inline void MoreDataAvailable(TUint32 aNumBlocks, TUint8* aMemoryP, TInt aError); /**< @internalTechnology */
+
+	inline void SaveCard();			/**< @internalTechnology */
+	inline void RestoreCard();		/**< @internalTechnology */
+
 public:
 	/**
     The last R1 response.
@@ -3057,7 +3061,9 @@
 	
 	TMMCCallBack iDataTransferCallback;	// A callback function, used to request more data when performing double-buffering
 
-	TUint32 iSpare[22];				// Spare data (stolen from iCommand)
+	TUint32 iSpare[21];				// Spare data (stolen from iCommand)
+
+	TMMCard* iSavedCardP;			// Saved copy of iCardP
 
 	TMMCStateMachine iMachine;		// State Machine context
 #ifdef __EPOC32__
@@ -3091,7 +3097,8 @@
 		KInterfaceSetBusWidth,
 		KInterfaceDemandPagingInfo,
 		KInterfaceCancelSession,
-		KInterfaceDoWakeUpSM
+		KInterfaceDoWakeUpSM,
+		KInterfaceAddressCard,
 		};
 
 	/** generic interface */
@@ -3137,6 +3144,17 @@
 		virtual TMMCErr DoWakeUpSM()=0;
 		};
 
+	/**
+	 * An optional interface implemented by the derived class. Used when the stack supports more than one 
+	 * card and the cards are individually selectable, i.e. iMultiplexedBus is true
+	 * @see KInterfaceAddressCard
+	 */
+	class MAddressCard
+		{
+	public:
+		virtual void AddressCard(TInt aCardNumber)=0;
+		};
+
 
 public:
 	IMPORT_C DMMCStack(TInt aBus, DMMCSocket* aSocket);
@@ -3526,6 +3544,8 @@
 
 	void DetermineBusWidthAndClock(const TMMCard& aCard, TBool aLowVoltage, TUint& aPowerClass, TBusWidthAndClock& aBusWidthAndClock);
 	TUint GetPowerClass(const TMMCard& aCard, TBusWidthAndClock aWidthAndClock, TBool aLowVoltage);
+	
+	void DoAddressCard(TInt aCardNumber);
 
 
     //	----------- Data Members -------------
@@ -3604,6 +3624,8 @@
 protected:
 	/** 
 	Gets an interface from a derived class
+	N.B the derived class should call the base class's default implementation of this function
+	if it does not support the specified interface
 	replaces reserved virtual Dummy4()
 	*/
 	IMPORT_C virtual void GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr);
@@ -4107,6 +4129,7 @@
 		EMMCUnblockingInWrongContext	=18,
 		EMMCInvalidCardNumber			=19,
 		EMMCNotInDfcContext				=20,
+		EMMCAddressCardNotSupported		=21,
 		};
     IMPORT_C static void Panic(TMMCPanic aPanic);
 	friend class DMMCStack;
--- a/kernel/eka/include/drivers/mmc.inl	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/mmc.inl	Thu Sep 02 21:54:16 2010 +0300
@@ -1127,6 +1127,18 @@
 	return(EFalse);
 	}
 
+inline void DMMCSession::SaveCard()
+	{
+	if (iCardP)
+		iSavedCardP = iCardP;
+	}
+
+inline void DMMCSession::RestoreCard()
+	{
+	if (iSavedCardP)
+		iCardP = iSavedCardP;
+	iSavedCardP = NULL;
+	}
 
 //	--------  class DMMCSocket  --------
 
--- a/kernel/eka/include/drivers/resmanus.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/resmanus.h	Thu Sep 02 21:54:16 2010 +0300
@@ -270,7 +270,7 @@
 	TInt ExtractResourceInfo(const TPowerResourceInfoV01* aPwrResInfo, TResourceInfoBuf& aInfo);
 #ifdef _DUMP_TRACKERS
 	TInt DumpResource(const TPowerResourceInfoV01* aResource);
-	TInt DumpTracker(TTrackingControl* aTracker);
+	void DumpTracker(TTrackingControl* aTracker);
 #endif
 #ifdef RESOURCE_MANAGER_SIMULATED_PSL
 	void CheckForCandidateAsyncResource(TPowerResourceInfoV01* aResource);
--- a/kernel/eka/include/drivers/resource.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/resource.h	Thu Sep 02 21:54:16 2010 +0300
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\include\drivers\resource.h
-// 
+//
 // WARNING: This file contains some APIs which are internal and are subject
 //          to change without notice. Such APIs should therefore not be used
 //          outside the Kernel and Hardware Services package.
@@ -26,18 +26,18 @@
 #include <drivers/resource_category.h>
 
 //Definition for resource flag setting. Used by PSL.
-static const TUint KTypeMask= 0x3;
-static const TUint KUsageOffset=0x1F;
-static const TUint KLongLatencySetOffset=0x1E;
-static const TUint KLongLatencyGetOffset=0x1D;
-static const TUint KClassOffset=0x1C;
-static const TUint KSenseOffset=0x1A;
-static const TUint KShared=0x1U<<KUsageOffset;
-static const TUint KLongLatencySet=0x1<<KLongLatencySetOffset;
-static const TUint KLongLatencyGet=0x1<<KLongLatencyGetOffset;
-static const TUint KLogical=0x1<<KClassOffset;
-static const TUint KSenseNegative=0x01<<KSenseOffset;
-static const TUint KSenseCustom=0x2<<KSenseOffset;
+const TUint KTypeMask             = 0x3;
+const TUint KUsageOffset          = 0x1F;
+const TUint KLongLatencySetOffset = 0x1E;
+const TUint KLongLatencyGetOffset = 0x1D;
+const TUint KClassOffset          = 0x1C;
+const TUint KSenseOffset          = 0x1A;
+const TUint KShared               = 0x1u << KUsageOffset;
+const TUint KLongLatencySet       = 0x1u << KLongLatencySetOffset;
+const TUint KLongLatencyGet       = 0x1u << KLongLatencyGetOffset;
+const TUint KLogical              = 0x1u << KClassOffset;
+const TUint KSenseNegative        = 0x1u << KSenseOffset;
+const TUint KSenseCustom          = 0x2u << KSenseOffset;
 
 struct TPowerRequest;
 struct SIdleResourceInfo;
@@ -149,7 +149,7 @@
 /**
 @publishedPartner
 @prototype 9.5
-An object of this type prepresents a customised Dfc
+An object of this type represents a customized Dfc
 used to signal completion of the resource manager's asynchronous APIs
 and completion of notifications
 @see TPowerResourceManager
@@ -191,16 +191,18 @@
 private:
     void Lock()
         {
+		__ASSERT_DEBUG(iMutex, Kern::Fault("TPowerResourceCb::Lock", __LINE__));
         NKern::ThreadEnterCS();
         Kern::MutexWait(*iMutex);
         }
     void UnLock()
         {
+		__ASSERT_DEBUG(iMutex, Kern::Fault("TPowerResourceCb::UnLock", __LINE__));
         Kern::MutexSignal(*iMutex);
         NKern::ThreadLeaveCS();
         }
     TAny* iParam; //Stores the aPtr argument passed in the constructor, to be passed as 5th argument to the callback function
-    TInt iResult; //Used to store the result aswell as binary usage count for the callback
+    TInt iResult; //Used to store the result as well as binary usage count for the callback
     TInt iLevel; // Level of the resource
 	TInt iLevelOwnerId; // Stores owner of the resource for asynchronous get operation
     TUint iResourceId; //Stores the ID of the resource whose state is changed/read asynchronously
--- a/kernel/eka/include/drivers/resourcecontrol.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/resourcecontrol.h	Thu Sep 02 21:54:16 2010 +0300
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\include\drivers\resourcecontrol.h
-// 
+//
 // WARNING: This file contains some APIs which are internal and are subject
 //          to change without notice. Such APIs should therefore not be used
 //          outside the Kernel and Hardware Services package.
@@ -133,16 +133,22 @@
 /* Macro to add dynamic resource to appropriate containers. Used only in extended version */
 #define ADD_TO_RESOURCE_CONTAINER(list, res, resId, resIdCount)				\
 	{																		\
-	TUint16 growBy = (list).GrowBy();										\
+	TInt growBy = (list).GrowBy();										\
 	if(!growBy)																\
-		(list).Initialise((TUint16)PRM_DYNAMIC_RESOURCE_INITIAL_SIZE);		\
-	if((list).Add(res, resId) == KErrNoMemory)								\
+		(list).Initialise(PRM_DYNAMIC_RESOURCE_INITIAL_SIZE);		\
+    TInt r = (list).Add(res, resId);                                        \
+	if(r == KErrNoMemory)								                    \
 		{																	\
-		TInt r = (list).ReSize(growBy);										\
-		if(r != KErrNone)													\
-			return r;														\
-		(list).Add(res, resId);												\
+		r = (list).ReSize(growBy);										    \
+        if(r == KErrNone)                                                   \
+            {                                                               \
+            r = (list).Add(res, resId);										\
+            }                                                               \
 		}																	\
+    if(r != KErrNone)                                                       \
+        {                                                                   \
+        return r;                                                           \
+        }                                                                   \
 	res->iResourceId |= resId;												\
 	resId = res->iResourceId;												\
 	resIdCount++;															\
@@ -154,24 +160,24 @@
 	switch((resId >> RESOURCE_BIT_IN_ID_CHECK) & 0x3)											\
 		{																						\
 		case PRM_STATIC_RESOURCE:																\
-			if(resId > iStaticResourceArrayEntries)												\
+			if((TInt)resId > iStaticResourceArray.Count())										\
 				UNLOCK_RETURN(KErrNotFound);													\
 			res = iStaticResourceArray[resId - 1];												\
 			if(!res)																			\
 				UNLOCK_RETURN(KErrNotFound);													\
 			break;																				\
 		case PRM_STATIC_DEPENDENCY_RESOURCE:													\
-			if((TUint16)(resId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)				\
+			if((TInt)(resId & ID_INDEX_BIT_MASK) > iStaticResDependencyArray.Count())	\
 				UNLOCK_RETURN(KErrNotFound);													\
-			res = iStaticResDependencyArray[(TUint16)(resId & ID_INDEX_BIT_MASK)  - 1];			\
+			res = iStaticResDependencyArray[(resId & ID_INDEX_BIT_MASK)  - 1];			\
 			break;																				\
 		case PRM_DYNAMIC_RESOURCE:																\
-			res = iDynamicResourceList[(TUint16)(resId & ID_INDEX_BIT_MASK)];					\
+			res = iDynamicResourceList[(resId & ID_INDEX_BIT_MASK)];					\
 			if(!res)																			\
 				UNLOCK_RETURN(KErrNotFound);													\
 			break;																				\
 		case PRM_DYNAMIC_DEPENDENCY_RESOURCE:													\
-			res = iDynamicResDependencyList[(TUint16)(resId & ID_INDEX_BIT_MASK)];				\
+			res = iDynamicResDependencyList[(resId & ID_INDEX_BIT_MASK)];				\
 			if(!res)																			\
 				UNLOCK_RETURN(KErrNotFound);													\
 			break;																				\
@@ -185,9 +191,9 @@
    it is called from the same thread. */
 #define VALIDATE_CLIENT(t)																						\
 	if(aClientId & USER_SIDE_CLIENT_BIT_MASK)																	\
-		pC = iUserSideClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];										\
+		pC = iUserSideClientList[(aClientId & ID_INDEX_BIT_MASK)];										\
 	else																										\
-		pC = iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];												\
+		pC = iClientList[(aClientId & ID_INDEX_BIT_MASK)];												\
 	if(!pC)																										\
 		{																										\
 		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));											\
@@ -210,9 +216,9 @@
 /** Macro to get the target client from appropriate client list based on bit 14 of client ID. */
 #define GET_TARGET_CLIENT()																				\
 	if(aTargetClientId & USER_SIDE_CLIENT_BIT_MASK) 													\
-		pC = iUserSideClientList[(TUint16)(aTargetClientId & ID_INDEX_BIT_MASK)];	    				\
+		pC = iUserSideClientList[(aTargetClientId & ID_INDEX_BIT_MASK)];	    				\
 	else																								\
-		pC = iClientList[(TUint16)(aTargetClientId & ID_INDEX_BIT_MASK)];								\
+		pC = iClientList[(aTargetClientId & ID_INDEX_BIT_MASK)];								\
 	if(!pC)																								\
 		{																								\
 		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Target Client ID not found"));							\
@@ -318,16 +324,16 @@
 class DResourceCon : public DBase
 	{
 public:
-    inline TInt Initialise(TUint16 aInitialSize);
+    inline TInt Initialise(TInt aInitialSize);
     inline void Delete();
-    inline T*  operator[](TUint16 aIndex);
-    inline TInt Remove(T* aObj, TUint16 aIndex);
+    inline T*  operator[](TInt aIndex);
+    inline TInt Remove(T* aObj, TInt aIndex);
     inline TInt Add(T* aObj, TUint &aId);
     inline TInt Find(T*& anEntry, TDesC& aName);
-    inline TInt ReSize(TUint16 aGrowBy);
-    inline TUint16 Count() {return iCount;}
-    inline TUint16 Allocd() {return iAllocated;}
-	inline TUint16 GrowBy() {return iGrowBy;}
+    inline TInt ReSize(TInt aGrowBy);
+    inline TInt Count() {return iCount;}
+    inline TInt Allocd() {return iAllocated;}
+	inline TInt GrowBy() {return iGrowBy;}
 private:
     TUint16 iGrowBy; //Size to grow the size of the array.
     TUint16 iAllocated;  //Size of the array
@@ -454,7 +460,6 @@
     virtual TInt RegisterResourcesForIdle(TInt aPowerControllerId, TUint aNumResources, TPtr* aBuf);
     static void Panic(TUint8 aPanic);
     virtual TInt GetInterface(TUint aClientId, TUint aInterfaceId, TAny* aParam1, TAny* aParam2, TAny* aParam3);
-	virtual ~DPowerResourceController();
 	/**@internalComponent*/
 	void CompleteNotifications(TInt aClientId, DStaticPowerResource* aResource, TInt aState, TInt aReturnCode, TInt aLevelOwnerId, TBool aLock = ETrue);
 #ifdef PRM_ENABLE_EXTENDED_VERSION
@@ -481,12 +486,12 @@
 							  NKern::ThreadLeaveCS();}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	//Default implementation, PSL re-implements these if features supported
-	virtual TInt DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, TUint16& aStaticResourceDCount);
+	virtual TInt DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray);
 #endif
 private:
     // pure virtual implemented by PSL - to be called by PIL
     virtual TInt DoInitController()=0;
-    virtual TInt DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount)=0;
+    virtual TInt DoRegisterStaticResources(RPointerArray <DStaticPowerResource> & aStaticResourceArray)=0;
     /**@internalComponent*/
     TInt CheckLevelAndAddClient(SPowerResourceClient* pC, TPowerRequest* Request);
     static void MsgQFunc(TAny* aPtr);
@@ -523,18 +528,16 @@
 	TInt GetDependentsIdForResource(TUint aResourceId, TAny* aInfo, TUint* aNumDepResources);
 	TInt HandleResourceRegistration(TPowerRequest& aReq);
 #endif
-public:
+protected:
 	DMutex* iResourceMutex;
-protected:
-    TDfcQue* iDfcQ;
+	TDfcQue* iDfcQ;
     TMessageQue *iMsgQ;
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	TDfcQue* iDfcQDependency;
 	TMessageQue* iMsgQDependency;
 	TBool iDfcQDependencyLock;
 #endif
-private:
-    DStaticPowerResource** iStaticResourceArray;
+	RPointerArray <DStaticPowerResource> iStaticResourceArray;
     DResourceCon<SPowerResourceClient> iClientList;
     DResourceCon<SPowerResourceClient> iUserSideClientList;
 #ifdef RESOURCE_MANAGER_SIMULATED_PSL
@@ -552,19 +555,18 @@
     TUint16 iClientLevelPoolGrowBy;
     TUint16 iRequestPoolCount;
     TUint16 iRequestPoolGrowBy;
-    TUint16 iStaticResourceArrayEntries; //Number of entries in the array including holes if any.
 	TUint16 iStaticResourceCount;  //Actual number of static resources registered (valid entries).
 	TUint	iReserved2; //Reserved for future use
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	DResourceCon<DDynamicPowerResource> iDynamicResourceList;
-	DResourceCon<DDynamicPowerResourceD> iDynamicResDependencyList;
-	DStaticPowerResourceD** iStaticResDependencyArray;
+	DResourceCon<DDynamicPowerResource>   iDynamicResourceList;
+	DResourceCon<DDynamicPowerResourceD>  iDynamicResDependencyList;
+	RPointerArray <DStaticPowerResourceD> iStaticResDependencyArray;
 	SPowerResourceClientLevel* iResourceLevelPool;
 	TUint16 iResourceLevelPoolCount;
-	TUint16 iStaticResDependencyCount;
 	TUint16 iDynamicResourceCount;
-	TUint8 iDynamicResDependencyCount;
-	TUint8 iSpare2;
+	TUint8  iDynamicResDependencyCount;
+	TUint8  iSpare1;
+	TUint16 iSpare2;
 	TUint  iReserved3; //Reserved for future use.
 #endif
 	};
--- a/kernel/eka/include/drivers/resourcecontrol.inl	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/resourcecontrol.inl	Thu Sep 02 21:54:16 2010 +0300
@@ -30,7 +30,7 @@
 /** Second stage constructor
  Allocates the specified size in kernel heap and creates a virtual link */
 template <class T>
-inline TInt DResourceCon<T>::Initialise(TUint16 aInitialSize)
+inline TInt DResourceCon<T>::Initialise(TInt aInitialSize)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Initialise"));
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("aInitialSize %d", aInitialSize));
@@ -47,8 +47,8 @@
 		for(TInt c = 0; c < aInitialSize; c++)
 			iArray[c] = (T*)(c+1);
 		}
-    iAllocated = aInitialSize;
-    iGrowBy = aInitialSize < 2 ? aInitialSize : TUint16(aInitialSize/2);
+    iAllocated = (TUint16)aInitialSize;
+    iGrowBy = (TUint16) (aInitialSize < 2 ? aInitialSize : aInitialSize/2);
     iCount = 0;
     iInstanceCount = 0;
     iFreeLoc = 0;
@@ -65,7 +65,7 @@
 
 /** Resize the array */
 template <class T>
-inline TInt DResourceCon<T>::ReSize(TUint16 aGrowBy)
+inline TInt DResourceCon<T>::ReSize(TInt aGrowBy)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::ReSize"));
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("aGrowBy %d\n", aGrowBy));
@@ -73,7 +73,7 @@
 	TInt r = Kern::SafeReAlloc((TAny*&)iArray, iAllocated * sizeof(T*), (iAllocated+aGrowBy)*sizeof(T*));
 	if(r != KErrNone)
 		return r;
-    TUint16 c = iAllocated;
+    TInt c = iAllocated;
     //Virtually link the free ones
     while(c<(iAllocated+aGrowBy))
 		{
@@ -94,11 +94,12 @@
 inline void DResourceCon<T>::Delete()
 	{
     delete []iArray;
+    iArray = NULL;
 	}
 
 /** Find the object at the specified location */
 template <class T>
-inline T* DResourceCon<T>::operator[](TUint16 anIndex)
+inline T* DResourceCon<T>::operator[](TInt anIndex)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::operator[], anIndex = %d", anIndex));
 	// Check if passed index is inside allocated range and is not free.
@@ -109,17 +110,17 @@
 
 /** Remove the specified object from the container */
 template <class T>
-inline TInt DResourceCon<T>::Remove(T* /*aObj */, TUint16 aIndex)
+inline TInt DResourceCon<T>::Remove(T* /*aObj */, TInt aIndex)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Remove"));
-    if(aIndex>=iAllocated)
+    if(aIndex>=(TInt)iAllocated)
 		{
 		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Object not found, iAllocated = %d, index = %d", iAllocated, aIndex));
 		DPowerResourceController::Panic(DPowerResourceController::EObjectNotFoundInList);
 		}
 	// Add the entry to the free location
 	iArray[aIndex] = (T*)iFreeLoc;
-	iFreeLoc = aIndex;
+	iFreeLoc = (TUint16)aIndex;
     iCount--; //Decrement valid client count
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Remove"));
     return KErrNone;
@@ -136,9 +137,9 @@
     //Update in the array in the free location
 	aId = ((++iInstanceCount & INSTANCE_COUNT_BIT_MASK) << INSTANCE_COUNT_POS); //Instance count
 	aId |= (iFreeLoc & ID_INDEX_BIT_MASK); //Array index
-    TUint16 nextFreeLoc = (TUint16)(TUint)iArray[iFreeLoc];
+    TUint nextFreeLoc = (TUint)iArray[iFreeLoc];
     iArray[iFreeLoc] = aObj;
-    iFreeLoc = nextFreeLoc;
+    iFreeLoc = (TUint16)nextFreeLoc;
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("iFreeLoc %d", iFreeLoc));
     iCount++;  //Increment the valid client count
     return KErrNone;
@@ -151,7 +152,7 @@
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Find, aName %S", &aName));
     anEntry = NULL;
     T* pC=anEntry;
-    for(TUint count = 0; count<iAllocated; count++)
+    for(TInt count = 0; count < (TInt)iAllocated; count++)
 		{
         /* Check whether the location is free */
         if(((TUint)iArray[count]) <= iAllocated)
--- a/kernel/eka/include/drivers/rm_debug_driver.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-//
-
-
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef __RM_DEBUG_DRIVER_H__
-#define __RM_DEBUG_DRIVER_H__
-
-#include "d_rmd_stepping.h"
-#include "d_rmd_breakpoints.h"
-#include "d_driver_event_info.h"
-
-// From mmboot.h header
-const TLinAddr	KDataSectionEnd			=0x40000000u;
-const TLinAddr	KRomLinearBase			=0xF8000000u;
-
-
-#define ROM_LINEAR_BASE KRomLinearBase
-
-// Result checking
-#define ReturnIfError(x) { TInt y = x; if (KErrNone != y) return y; }
-
-//
-// class DRM_DebugDriverFactory
-//
-class DRM_DebugDriverFactory : public DLogicalDevice
-{
-public:
-
-	DRM_DebugDriverFactory();
-	virtual TInt Install();
-	virtual void GetCaps(TDes8& aDes) const;
-	virtual TInt Create(DLogicalChannelBase*& aChannel);
-};
-
-class DRM_DebugEventHandler;
-//
-// DRM_DebugChannel
-//
-class DRM_DebugChannel : public DLogicalChannel
-{
-public:
-
-	DRM_DebugChannel(DLogicalDevice* aLogicalDevice);
-	~DRM_DebugChannel();
-
-	virtual TInt DoCreate(TInt aUnit, const TDesC* anInfo, const TVersion& aVer);	
-	virtual void HandleMsg(TMessageBase* aMsg);
-	virtual TInt SendMsg(TMessageBase* aMsg);
-	TInt SendRequest(TMessageBase* aMsg);
-	
-	//called from the event handler
-	TBool RemoveProcess(TAny* a1, TAny* a2);
-	TBool StartThread(TAny* a1, TAny* a2);
-	TBool AddLibrary(TAny* a1, TAny* a2);
-	TBool RemoveLibrary(TAny* a1, TAny* a2);
-	TBool HandleEventKillThread(TAny* a1, TAny* a2);
-	TBool HandleSwException(TAny* a1, TAny* a2);
-	TBool HandleHwException(TAny* a1, TAny* a2);
-	TBool HandleUserTrace(TAny* a1, TAny* a2);
-	TBool HandleUnsupportedEvent(TAny* a1, TAny* a2) { return EFalse; }
-	TBool HandleAddProcessEvent(TAny* a1, TAny* a2);
-	TBool HandleRemoveProcessEvent(TAny* a1, TAny* a2);
-	
-	// Used to be able to signal events to the DSS
-	DThread* ClientThread(void) {return iClientThread; };
-	
-protected:
-	virtual void DoCancel(TInt aReqNo);
-	virtual void DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2);
-	virtual TInt DoControl(TInt aFunction, TAny *a1, TAny *a2);
-	
-private:
-	TInt PreAsyncGetValue(Debug::TEventInfo* aValue, TRequestStatus* aStatus);
-	TInt CreateDfcQ();
-	void DestroyDfcQ();
-	TBool HandleInvalidOpCodeException(TDriverEventInfo& aEventInfo, DThread* aCurrentThread);
-
-	TInt SetBreak(TSetBreakInfo* aBreakInfo);
-	TInt StepRange(DThread* aThread, TRM_DebugStepInfo* aStepInfo);
-	TInt ReadMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo);
-	TInt WriteMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo);
-	TInt ReadRegistersLegacy(DThread* aThread, TRM_DebugRegisterInfo* aRegisterInfo);
-	TInt WriteRegistersLegacy(DThread* aThread, const TRM_DebugRegisterInfo* aRegisterInfo);
-	TInt ReadRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const;
-	TInt WriteRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const;
-	TInt GetProcessInfo(TInt aIndex, TRM_DebugTaskInfo* aTaskInfo);
-	TInt GetThreadInfo(TInt aIndex, TRM_DebugTaskInfo* aTaskInfo);
-	TInt GetList(TListInformation* aListInformation) const;
-	
-	TInt Step(const TUint32 aThreadId, const TUint32 aNumSteps);
-	TInt KillProcess(const TUint32 aProcessId, const TInt aReason);
-
-	//Crash Flash	
-	TInt ReadCrashLog(TFlashInfo* aBuffer);
-	TInt WriteCrashLog(TFlashInfo* aBuffer) const;
-	TInt EraseCrashLog();
-
-	// Stop/go
-	TInt DoSuspendThread(DThread *aThread);
-	TInt DoResumeThread(DThread *aThread);
-	TInt DoStepRange(DThread *aThread, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto, TBool aResumeOnceOutOfRange, const TUint32 aNumSteps, TBool aUserRequest = EFalse);
-	TInt DoReadMemory(const DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData) const;
-	TInt DoWriteMemory(DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData);
-	TInt DoReadRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDes8 &aValues);
-	TInt DoReadRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDes8 &aRegisterValues, TDes8 &aRegisterFlags) const;
-	TInt DoWriteRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDesC8 &aValues);
-	TInt DoWriteRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDesC8 &aRegisterValues, TDes8 &aRegisterFlags) const;
-	TInt DoGetProcessInfo(const TInt aIndex, TRM_DebugTaskInfo *aInfo);
-	TInt DoGetThreadInfo(const TInt aIndex, TRM_DebugTaskInfo *aInfo);
-	TBool DoSecurityCheck();
-
-	TInt TryToReadMemory(const DThread *aThread, const TAny *aSrc, TAny *aDest, const TUint32 aLength) const;
-	TInt TryToWriteMemory(const DThread *aThread, TAny *aDest, const TAny *aSrc, const TUint32 aLength);
-	TInt32 ReadRegister(DThread *aThread, TInt aNum);
-	TInt32 ReadDebugRegisterValue(DThread *aThread, const Debug::TRegisterInfo aDebugRegisterId, T4ByteRegisterValue &aValue) const;
-	TInt32 ReadKernelRegisterValue(DThread *aThread, const TArmReg aKernelRegisterId, T4ByteRegisterValue &aValue) const;
-	
-	void NotifyEvent(const TDriverEventInfo& aEventInfo);
-
-	TInt GetTRegisterInfo(const TDesC8 &aRegisterIds, const TUint aIndex, Debug::TRegisterInfo &aValue) const;
-	TInt GetDebugRegisterId(const TArmReg aKernelRegister, Debug::TRegisterInfo& aDebugRegister) const;
-	TInt GetKernelRegisterId(const Debug::TRegisterInfo aDebugRegister, TArmReg& aKernelRegister) const;
-	TBool GetFlagAtOffset(const TUint32 aFlags, const TArmReg aIndex) const;
-
-	TInt AllocAndReadDes(DThread *aThread, const TDesC8& aSrcDes, TPtr8& aDestDes, const TBool aReadFromClient=ETrue, const TUint aOffset=0) const;
-
-	TInt AttachProcess(TAny* a1, TAny* a2);
-	TInt DetachProcess(TAny* a1, TAny* a2);
-	TInt DetachAgent(TAny* a1, TAny* a2);
-	TInt SetEventAction(TAny* a1, TAny* a2);
-	TBool CheckSuspended(const DThread *aThread) const;
-
-	// Needed so moved functions can access iBreakpoint list and related functions
-	friend class D_RMD_Breakpoints;
-	// Needed so moved functions can access stepping functionality
-	friend class DRMDStepping;
-
-	// helper function was previously in rm_debug_kerneldriver.cpp
-	inline TInt Bitcount(TUint32 val)
-		{
-			TInt nbits;
-
-			for (nbits = 0; val != 0; nbits++)
-			{
-				val &= val - 1;		// delete rightmost 1-bit in val
-			}
-			
-			return nbits;
-		}
-
-	// Security critical - this returns whether the specified process is debuggable or not
-	TInt IsDebuggable(const TUint32 aProcessId);
-
-private:
-	DThread* iClientThread;
-	DRM_DebugEventHandler* iEventHandler;
-	
-	TUint32 iExcludedROMAddressStart;
-	TUint32 iExcludedROMAddressEnd;
-	
-	TUint32 iPageSize;
-	
-	RArray<Debug::TProcessInfo> iDebugProcessList; //processes that we are debugging
-
-	D_RMD_Breakpoints* iBreakManager;	// new D_RMD_Breakpoints
-
-	DRMDStepping* iStepper;				// new DRMDStepping
-
-	DSemaphore* iStepLock;				// Synchronisation for stepping code.
-
-	TDynamicDfcQue* iDfcQ;
-
-	TBool	iInitialisedCodeModifier;	// Ensures we control its lifetime
-
-	TClientDataRequest<Debug::TEventInfo>* iAsyncGetValueRequest;
-};
-
-#endif //__RM_DEBUG_DRIVER_H__
--- a/kernel/eka/include/drivers/rm_debug_eventhandler.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-// Copyright (c) 2004-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:
-//
-// Description:
-//
-
-/** Event handler and container for all objects being tracked.  */
-#ifndef __RM_DEBUG_EVENTHANDLER_H__
-#define __RM_DEBUG_EVENTHANDLER_H__
-
-
-class DRM_DebugEventHandler : public DKernelEventHandler
-{
-	public:
-		DRM_DebugEventHandler();
-		TInt Create(DLogicalDevice* aDevice, DLogicalChannel* aChannel, DThread* aClient);
-		~DRM_DebugEventHandler();
-		TInt Start();
-		TInt Stop();
-		
-		inline void LockDataAccess();
-		inline void ReleaseDataAccess();
-		
-	private:
-		static TUint EventHandler(TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis);
-		TUint HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2);
-		TBool HandleSpecificEvent(TKernelEvent aType, TAny* a1, TAny* a2);
-		
-	private:
-		/** Used to serialise access data structures */
-		DSemaphore* iProtectionLock;
-
-		TBool iTracking;
-
-		DLogicalDevice* iDevice;	// open reference to LDD for avoiding lifetime issues
-		DThread* iClientThread;
-		DRM_DebugChannel* iChannel;
-
-		// typdef for functions which handle our specific events
-		typedef TBool (DRM_DebugChannel::*eventHandler)(TAny* a1, TAny* a2);
-		eventHandler iEventHandlers[EEventLimit];
-};
-
-#include <rm_debug_eventhandler.inl>
-
-#endif //__RM_DEBUG_EVENTHANDLER_H__
--- a/kernel/eka/include/drivers/rm_debug_eventhandler.inl	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-// Copyright (c) 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:
-//
-// Description:
-// Event handler and container for all objects being tracked.
-//
-
-	
-inline void DRM_DebugEventHandler::LockDataAccess()
-    {
-    Kern::SemaphoreWait(*iProtectionLock);
-    }
-
-inline void DRM_DebugEventHandler::ReleaseDataAccess()
-    {
-    Kern::SemaphoreSignal(*iProtectionLock);
-    }
-		
--- a/kernel/eka/include/drivers/rm_debug_kerneldriver.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,777 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-//
-
-
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef __RM_DEBUG_KERNELDRIVER_H__
-#define __RM_DEBUG_KERNELDRIVER_H__
-
-#include <rm_debug_api.h>
-
-/**
-Used to store a value read from or written to an ARM register
-*/
-typedef TUint32 T4ByteRegisterValue;
-
-
-/** 
-Provides static methods for accessing the information stored in a TRegisterInfo
-object.
-*/
-class Register
-	{
-public:
-	static TBool IsCoreReg(const Debug::TRegisterInfo aRegister);
-	static TBool IsCoproReg(const Debug::TRegisterInfo aRegister);
-	static TUint32 GetCoreRegId(const Debug::TRegisterInfo aRegister);
-	static TUint32 GetCRm(const Debug::TRegisterInfo aRegister);
-	static TUint32 GetCRn(const Debug::TRegisterInfo aRegister);
-	static TUint32 GetOpcode1(const Debug::TRegisterInfo aRegister);
-	static TUint32 GetOpcode2(const Debug::TRegisterInfo aRegister);
-	static TUint32 GetCoproNum(const Debug::TRegisterInfo aRegister);
-	};
-
-/**
-Identify whether aRegister is a core register
-@param aRegister register ID to analyse
-@return ETrue if core register, EFalse otherwise
-*/
-inline TBool Register::IsCoreReg(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister & 0xff) == 0x0);
-	}
-
-/**
-Identify whether aRegister is a coprocessor register
-@param aRegister register ID to analyse
-@return ETrue if coprocessor register, EFalse otherwise
-*/
-inline TBool Register::IsCoproReg(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister & 0xff) == 0x1);
-	}
-
-/**
-Get the ID of the core register
-@param aRegister register ID to analyse
-@return ID of the core register
-*/
-inline TUint32 Register::GetCoreRegId(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister >> 8) & 0xff);
-	}
-
-/**
-Get the CRm value of a coprocessor register
-@param aRegister register ID to analyse
-@return the CRm value of a coprocessor register
-*/
-inline TUint32 Register::GetCRm(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister >> 16) & 0xf);
-	}
-
-/**
-Get the CRm value of a coprocessor register
-@param aRegister register ID to analyse
-@return the CRm value of a coprocessor register
-*/
-inline TUint32 Register::GetCRn(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister >> 20) & 0xf);
-	}
-
-/**
-Get the Opcode1 value of a coprocessor register
-@param aRegister register ID to analyse
-@return the Opcode1 value of a coprocessor register
-*/
-inline TUint32 Register::GetOpcode1(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister >> 24) & 0x8);
-	}
-	
-/**
-Get the Opcode2 value of a coprocessor register
-@param aRegister register ID to analyse
-@return the Opcode2 value of a coprocessor register
-*/
-inline TUint32 Register::GetOpcode2(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister >> 27) & 0x8);
-	}
-
-/**
-Get the coprocessor number of a coprocessor register
-@param aRegister register ID to analyse
-@return the coprocessor number of a coprocessor register
-*/
-inline TUint32 Register::GetCoproNum(const Debug::TRegisterInfo aRegister)
-	{
-	return ((aRegister >> 8) & 0xff);
-	}
-
-//
-// class TCapsRM_DebugDriver
-//
-class TCapsRM_DebugDriver
-{
-public:
-	TVersion	iVersion;
-};
-
-/**
-Stores listings information for passing between the DSS and the kernel driver
-*/
-class TListInformation
-{
-public:
-	inline TListInformation(const Debug::TListId aType=(Debug::TListId)NULL, const Debug::TListScope aListScope=(Debug::TListScope)NULL, TDes8* aBuffer=NULL, TUint32* aDataSize=NULL, TUint64 aTargetId=0)
-		: iType(aType),
-		  iListScope(aListScope),
-		  iBuffer(aBuffer),
-		  iDataSize(aDataSize),
-		  iTargetId(aTargetId) {};
-public:
-	Debug::TListId iType;
-	Debug::TListScope iListScope;
-	TDes8* iBuffer;
-	TUint32* iDataSize;
-	TUint64 iTargetId;
-};
-
-/**
-Data structure to hold information to the crash flash
-(Possibly: Could be expanded to hold on configuration data too)
-*/
-class TFlashInfo
-{
-public:
-	inline TFlashInfo(TUint32 aPos, TUint32* aSize, TDes8* aData)
-		:iPos(aPos),
-		iSize(aSize),
-		iData(aData){};
-public:
-	TUint32 iPos;
-	TUint32* iSize;	
-	 TDes8* iData;	
-};
-//
-// class TRM_DebugMemoryInfo
-//
-class TRM_DebugMemoryInfo
-{
-public:
-
-	inline TRM_DebugMemoryInfo(const TUint32 aAddress, const TUint32 aLength, TDesC8 *aData)
-				: iAddress(aAddress),
-				  iLength(aLength),
-				  iData(aData) {};
-	
-public:
-
-	TUint32 iAddress;
-	TUint32	iLength;
-	TDesC8*	iData;
-};
-
-
-/**
-@deprecated
-This class is only used by TRK phase 1 functions.
-
-@see TRM_DebugRegisterInformation which offers similar storage suitable for use
-with the TRK pahse 2 API.
-*/
-class TRM_DebugRegisterInfo
-{
-public:
-
-	inline TRM_DebugRegisterInfo(const TInt16 aFirstRegister, const TInt16 aLastRegister, TDesC8 *aValues)
-				: iFirstRegister(aFirstRegister),
-				  iLastRegister(aLastRegister),
-				  iValues(aValues) {};
-	
-public:
-
-	TInt16	iFirstRegister;
-	TInt16	iLastRegister;
-	TDesC8*	iValues;
-};
-
-/**
-Structure used to store information about registers
-*/
-class TRM_DebugRegisterInformation
-{
-public:
-
-	inline TRM_DebugRegisterInformation(const TDes8 *aRegisterIds=NULL, TDes8 *aRegisterValues=NULL, TDes8 *aRegisterFlags=NULL)
-		: iRegisterIds(aRegisterIds),
-		  iRegisterValues(aRegisterValues),
-		  iRegisterFlags(aRegisterFlags) {};
-	
-public:
-
-	const TDes8* iRegisterIds;
-	TDes8* iRegisterValues;
-	TDes8* iRegisterFlags;
-};
-
-//
-// class TRM_DebugTaskInfo
-//
-class TRM_DebugTaskInfo
-{
-public:
-
-	inline TRM_DebugTaskInfo(TUint32 aOtherId)
-				: iId(0),
-				  iOtherId(aOtherId),
-				  iPriority(0) { iName.FillZ(); };
-
-public:
-
-	TUint32 iId;
-	TUint32 iOtherId;
-	TUint32 iPriority;	
-	TBuf8<KMaxName> iName;
-};
-
-//
-// class TRM_DebugStepInfo
-//
-class TRM_DebugStepInfo
-{
-public:
-
-	inline TRM_DebugStepInfo(const TUint32 aStartAddress, const TUint32 aStopAddress, const TBool aStepInto)
-				: iStartAddress(aStartAddress),
-				  iStopAddress(aStopAddress),
-				  iStepInto(aStepInto) {};
-
-public:
-
-	TUint32 iStartAddress;
-	TUint32 iStopAddress;
-	TBool iStepInto;
-};
-
-
-//
-// class TRM_DebugDriverInfo
-//
-class TRM_DebugDriverInfo
-{
-public:
-
-	TUint32 iPanic1Address;
-	TUint32 iPanic2Address;
-	TUint32 iException1Address;
-	TUint32 iException2Address;
-	TUint32 iLibraryLoadedAddress;
-	TUint32 iUserLibraryEnd;
-};
-
-
-//
-// class TRM_DebugProcessInfo
-//
-class TRM_DebugProcessInfo
-{
-public:
-
-	inline TRM_DebugProcessInfo(TUint32 *aCodeAddress, TUint32 *aDataAddress)
-				: iCodeAddress(aCodeAddress),
-				  iDataAddress(aDataAddress) {};
-
-public:
-
-	TUint32* iCodeAddress;
-	TUint32* iDataAddress;
-};
-
-//
-// class TRM_DebugEventActionInfo
-//
-class TRM_DebugEventActionInfo
-{
-public:
-	inline TRM_DebugEventActionInfo(TUint32 aEvent, TUint32 aAction, TUint64 aAgentId)
-		: iEvent(aEvent),
-		iAction(aAction),
-		iAgentId(aAgentId) {};
-public:
-	TUint32 iEvent;
-	TUint32 iAction;
-	TUint64 iAgentId;
-};
-
-//
-// class TRM_DebugEventInfo
-//
-class TRM_DebugEventInfo
-{
-public:
-	inline TRM_DebugEventInfo(TDesC8& aProcessName, TUint32& aBufSize)
-		: iProcessName(aProcessName),
-		iBufSize(aBufSize) {};
-
-public:
-	TDesC8& iProcessName;
-	TUint32& iBufSize;
-};
-
-//
-// class TRMD_DebugAgentId
-//
-class TRM_DebugAgentId
-{
-public:
-	inline TRM_DebugAgentId(TUint64 aAgentId)
-		: iAgentId(aAgentId) {};
-
-public:
-	TUint64 iAgentId;
-};
-
-//
-// Class TRMD_DebugCancelInfo
-//
-class TRMD_DebugCancelInfo
-{
-public:
-	inline TRMD_DebugCancelInfo(TUint32 aCancelRequest,TDesC8& aProcessName, TUint64 aAgentId)
-		: iCancelRequest(aCancelRequest),
-		iProcessName(aProcessName),
-		iAgentId(aAgentId) {};
-
-	inline TRMD_DebugCancelInfo(void)
-		: iCancelRequest(0),
-	iAgentId(0)
-	{
-	};
-
-public:
-	TUint32 iCancelRequest;
-	TBuf8<KMaxName> iProcessName;
-	TUint64 iAgentId;
-};
-
-class TEventMetaData
-	{
-public:
-	TBuf8<KMaxName> iTargetProcessName;
-	TUint64 iDebugAgentProcessId;
-	};
-
-/**
-@internalComponent
-*/
-class TSetBreakInfo
-{
-public:
-
-	inline TSetBreakInfo(Debug::TBreakId* aBreakId,
-		TUint64 aId,\
-		TUint32 aAddress,\
-		Debug::TArchitectureMode aMode,
-		TBool aThreadSpecific)
-				: iBreakId(aBreakId),
-				  iId(aId),
-				  iAddress(aAddress),
-				  iMode(aMode),
-       				  iThreadSpecific(aThreadSpecific) {};
-
-inline TSetBreakInfo(void)
-			: iBreakId((Debug::TBreakId*)0),
-			  iId(0),
-			  iAddress(0),
-			  iMode(Debug::EArmMode),
-       			  iThreadSpecific(ETrue) {};
-
-
-public:
-	Debug::TBreakId* iBreakId;
-	TUint64 iId;
-	TUint32 iAddress;
-	Debug::TArchitectureMode iMode;
-	TBool iThreadSpecific;
-};
-
-/**
-@internalComponent
-*/
-class TModifyBreakInfo
-{
-public:
-
-	inline TModifyBreakInfo(Debug::TBreakId aBreakId,\
-		const TUint64 aThreadId,\
-		const TUint32 aAddress,\
-		const Debug::TArchitectureMode aMode)
-				: iBreakId(aBreakId),
-				  iThreadId(aThreadId),
-				  iAddress(aAddress),
-				  iMode(aMode) {};
-
-public:
-	const Debug::TBreakId iBreakId;
-	const TUint64 iThreadId;
-	const TUint32 iAddress;
-	const Debug::TArchitectureMode iMode;
-};
-
-/**
-@internalComponent
-*/
-class TModifyProcessBreakInfo
-{
-public:
-
-	inline TModifyProcessBreakInfo(Debug::TBreakId aBreakId,\
-		const TUint64 aProcessId,\
-		const TUint32 aAddress,\
-		const Debug::TArchitectureMode aMode)
-				: iBreakId(aBreakId),
-				  iProcessId(aProcessId),
-				  iAddress(aAddress),
-				  iMode(aMode) {};
-
-public:
-	const Debug::TBreakId iBreakId;
-	const TUint64 iProcessId;
-	const TUint32 iAddress;
-	const Debug::TArchitectureMode iMode;
-};
-
-/**
-@internalComponent
-*/
-class TGetBreakInfo
-{
-public:
-
-	inline TGetBreakInfo(Debug::TBreakId aBreakId,\
-		TUint64& aId,\
-		TUint32& aAddress,\
-		Debug::TArchitectureMode& aMode,
-		TBool& aThreadSpecific)
-				: iBreakId(aBreakId),
-				  iId(&aId),
-				  iAddress(&aAddress),
-				  iMode(&aMode),
-       				  iThreadSpecific(&aThreadSpecific) {};
-
-	inline TGetBreakInfo()
-				: iBreakId((Debug::TBreakId)0),
-				  iId((TUint64*)0),
-				  iAddress((TUint32*)0),
-				  iMode((Debug::TArchitectureMode*)0),
-       				  iThreadSpecific((TBool*)0)	{};
-
-public:
-	const Debug::TBreakId iBreakId;
-	TUint64* iId;
-	TUint32* iAddress;
-	Debug::TArchitectureMode* iMode;
-	TBool* iThreadSpecific;
-};
-
-//
-// class RRM_DebugDriver
-//
-class RRM_DebugDriver : public RBusLogicalChannel
-{
-public:
-
-	enum TControl
-	{
-		EControlSetBreak = 0,
-		EControlClearBreak,
-		EControlModifyBreak,
-		EControlBreakInfo,
-		EControlSuspendThread,
-		EControlResumeThread,
-		EControlStepRange,
-		EControlReadMemory,
-		EControlWriteMemory,
-		EControlReadRegisters,
-		EControlWriteRegisters,
-		EControlGetStaticLibraryInfo,
-		EControlGetDebugFunctionalityBufSize,
-		EControlGetDebugFunctionality,
-		EControlReadRegistersLegacy,
-		EControlWriteRegistersLegacy,		
-		EControlGetMemoryOperationMaxBlockSize,		
-		EControlAttachProcess,
-		EControlDetachProcess,
-		EControlDetachAgent,
-		EControlSetEventAction,
-		EControlGetList,
-		EControlStep,
-		EControlIsDebuggable,
-		EControlKillProcess,		
-		EControlModifyProcessBreak,
-	};
-	
-	enum TRequest
-	{
-		ERequestGetEvent=0x0, ERequestGetEventCancel=0x1
-	};	
-		
-public:
-
-	inline TInt Open(const TRM_DebugDriverInfo aDriverInfo);
-
-	inline TInt	SetBreak(Debug::TBreakId &aBreakId,const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aThumbMode );
-	inline TInt	SetProcessBreak(Debug::TBreakId &aBreakId,const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aThumbMode );
-	
-	inline TInt	ClearBreak(const TInt32 aBreakId);
-	
-	inline TInt	ModifyBreak(const Debug::TBreakId aBreakId, const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aArchitectureMode );
-	inline TInt	ModifyProcessBreak(const Debug::TBreakId aBreakId, const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aArchitectureMode );
-	
-	inline TInt BreakInfo(const Debug::TBreakId aBreakId, TUint64& aId, TUint32& aAddress, Debug::TArchitectureMode& aMode, TBool& aThreadSpecific);
-	
-	inline TInt	SuspendThread(const TUint32 aThreadId);
-	inline TInt	ResumeThread(const TUint32 aThreadId);
-	inline TInt	StepRange(const TUint32 aThreadId, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto);
-	inline TInt ReadMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData);
-	inline TInt WriteMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData);
-	inline TInt ReadRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, TDes8 &aRegisterValues, TDes8 &aRegisterFlags);
-	inline TInt WriteRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, const TDes8 &aRegisterValues, TDes8 &aRegisterFlags);
-	inline TInt ReadRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDes8 &aValues);
-	inline TInt WriteRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDesC8 &aValues);
-	inline void GetEvent(TDesC8& aProcessName, TUint64 aAgentId, TRequestStatus &aStatus, Debug::TEventInfo &aEventInfo);
-	inline void CancelGetEvent(TDesC8& aProcessName, TUint64 aAgentId);
-//	inline TInt GetProcessInfo(const TInt aIndex, TRM_DebugTaskInfo &aInfo);
-//	inline TInt GetThreadInfo(const TInt aIndex, TRM_DebugTaskInfo &aInfo);
-	inline TInt GetStaticLibraryInfo(const TInt aIndex, Debug::TEventInfo &aInfo);
-	inline TInt GetDebugFunctionalityBufSize(TUint32 &aBufSize);
-	inline TInt GetDebugFunctionality(TDes8& aDebugFunctionality);
-	inline TInt GetMemoryOperationMaxBlockSize(TUint32 &aMaxSize);
-	inline TInt AttachProcess(TDesC8& aProcessName, TUint64 aAgentId);
-	inline TInt DetachProcess(TDesC8& aProcessName, TUint64 aAgentId);
-	inline TInt DetachAgent(TUint64 aAgentId);
-	inline TInt SetEventAction(TDesC8& aProcessName, Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction, TUint64 aAgentId);
-	inline TInt GetList(const Debug::TListId aType, const Debug::TListScope aListScope, const TUint64 aTargetId, const TUint64 aDebugProcessId, TDes8& aBuffer, TUint32& aDataSize);
-	inline TInt Step(const TUint32 aThreadId, const TUint32 aNumSteps);
-	inline TInt IsDebuggable(const TUint32 aProcessId);
-	inline TInt KillProcess(const TUint32 aProcessId, const TInt32 aReason);
-};
-
-_LIT(KRM_DebugDriverName,"RM Debug Driver");
-
-//priority set equal to that of KDfcThread0Priority defined in e32/kernel/sinit.cpp
-const TInt KRmDebugDriverThreadPriority = 27;
-
-// Version information
-const TInt KMajorVersionNumber=2;
-const TInt KMinorVersionNumber=1;
-const TInt KBuildVersionNumber=0;
-
-
-inline TInt RRM_DebugDriver::Open(const TRM_DebugDriverInfo aDriverInfo)
-{
-	TBuf8<32> buf;
-	buf.Append((TUint8*)&aDriverInfo.iPanic1Address, 4);
-	buf.Append((TUint8*)&aDriverInfo.iPanic2Address, 4);
-	buf.Append((TUint8*)&aDriverInfo.iException1Address, 4);
-	buf.Append((TUint8*)&aDriverInfo.iException2Address, 4);
-	buf.Append((TUint8*)&aDriverInfo.iLibraryLoadedAddress, 4);
-	buf.Append((TUint8*)&aDriverInfo.iUserLibraryEnd, 4);
-	
-	#ifdef EKA2
-	return DoCreate(KRM_DebugDriverName, TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber), KNullUnit, NULL, &buf);
-	#else
-	return DoCreate(KRM_DebugDriverName, TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber), NULL, KNullUnit, NULL, &buf);
-	#endif
-}
-
-inline TInt RRM_DebugDriver::SetBreak(Debug::TBreakId &aBreakId, const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aMode )
-{
-	TSetBreakInfo info(&aBreakId, aThreadId, aAddress, aMode, ETrue);
-	return DoSvControl(EControlSetBreak, reinterpret_cast<TAny*>(&info),0);
-}
-inline TInt RRM_DebugDriver::SetProcessBreak(Debug::TBreakId &aBreakId, const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aMode )
-{
-	TSetBreakInfo info(&aBreakId, aProcessId, aAddress, aMode, EFalse);
-	return DoSvControl(EControlSetBreak, reinterpret_cast<TAny*>(&info),0);
-}
-
-inline TInt RRM_DebugDriver::ClearBreak(const Debug::TBreakId aBreakId)
-{
-	return DoSvControl(EControlClearBreak, reinterpret_cast<TAny*>(aBreakId), 0);
-}
-
-inline TInt RRM_DebugDriver::ModifyBreak(const Debug::TBreakId aBreakId, const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aMode)
-{
-	TModifyBreakInfo info(aBreakId, aThreadId, aAddress, aMode);
-	return DoControl(EControlModifyBreak, reinterpret_cast<TAny*>(&info), 0);
-}
-
-inline TInt RRM_DebugDriver::ModifyProcessBreak(const Debug::TBreakId aBreakId, const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aMode)
-{
-	TModifyProcessBreakInfo info(aBreakId, aProcessId, aAddress, aMode);
-	return DoControl(EControlModifyProcessBreak, reinterpret_cast<TAny*>(&info), 0);
-}
-
-inline TInt RRM_DebugDriver::BreakInfo(const Debug::TBreakId aBreakId, TUint64& aId, TUint32& aAddress, Debug::TArchitectureMode& aMode, TBool& aThreadSpecific)
-{
-	TGetBreakInfo info(aBreakId, aId, aAddress, aMode, aThreadSpecific);
-	return DoControl(EControlBreakInfo, reinterpret_cast<TAny*>(&info), 0);
-}
-
-inline TInt RRM_DebugDriver::SuspendThread(const TUint32 aThreadId)
-{
-	return DoControl(EControlSuspendThread, reinterpret_cast<TAny*>(aThreadId));
-}
-
-inline TInt RRM_DebugDriver::ResumeThread(const TUint32 aThreadId)
-{
-	return DoSvControl(EControlResumeThread, reinterpret_cast<TAny*>(aThreadId));
-}
-
-inline TInt RRM_DebugDriver::StepRange(const TUint32 aThreadId, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto)
-{
-	TRM_DebugStepInfo info(aStartAddress, aStopAddress, aStepInto);
-	return DoSvControl(EControlStepRange, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
-}
-
-inline TInt RRM_DebugDriver::ReadMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData)
-{
-	TRM_DebugMemoryInfo info(aAddress, aLength, &aData);
-	return DoControl(EControlReadMemory, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
-}
-
-inline TInt RRM_DebugDriver::WriteMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData)
-{
-	TRM_DebugMemoryInfo info(aAddress, aLength, (TDesC8*)&aData);
-	return DoControl(EControlWriteMemory, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
-}
-
-inline TInt RRM_DebugDriver::ReadRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, TDes8 &aRegisterValues, TDes8 &aRegisterFlags)
-	{
-	TRM_DebugRegisterInformation info(&aRegisterIds, &aRegisterValues, &aRegisterFlags);
-	return DoControl(EControlReadRegisters, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);	
-	}
-
-inline TInt RRM_DebugDriver::WriteRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, const TDes8 &aRegisterValues, TDes8 &aRegisterFlags)
-	{
-	TRM_DebugRegisterInformation info(&aRegisterIds, (TDes8*)&aRegisterValues, &aRegisterFlags);
-	return DoControl(EControlWriteRegisters, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
-	}
-
-inline TInt RRM_DebugDriver::ReadRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDes8 &aValues)
-{
-	TRM_DebugRegisterInfo info(aFirstRegister, aLastRegister, &aValues);
-	return DoControl(EControlReadRegistersLegacy, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
-}
-
-inline TInt RRM_DebugDriver::WriteRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDesC8 &aValues)
-{
-	TRM_DebugRegisterInfo info(aFirstRegister, aLastRegister, &aValues);
-	return DoControl(EControlWriteRegistersLegacy, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
-}
-
-inline void RRM_DebugDriver::GetEvent(TDesC8& aProcessName, TUint64 aAgentId, TRequestStatus &aStatus, Debug::TEventInfo &aEventInfo)
-{
-	// temporary object not needed beyond the DoRequest call
-	TEventMetaData eventMetaData;
-	eventMetaData.iTargetProcessName.Copy(aProcessName);
-	eventMetaData.iDebugAgentProcessId = aAgentId;
-	DoRequest(ERequestGetEvent, aStatus, (TAny*)&aEventInfo, (TAny*)&eventMetaData);
-}
-
-inline void RRM_DebugDriver::CancelGetEvent(TDesC8& aProcessName, TUint64 aAgentId)
-{
-	TRMD_DebugCancelInfo info(ERequestGetEventCancel,aProcessName,aAgentId);
-	DoCancel(reinterpret_cast<TInt>(&info));
-}
-
-inline TInt RRM_DebugDriver::GetStaticLibraryInfo(const TInt aIndex, Debug::TEventInfo &aInfo)
-{
-	return DoControl(EControlGetStaticLibraryInfo, reinterpret_cast<TAny*>(aIndex), (TAny*)&aInfo);
-}
-
-inline TInt RRM_DebugDriver::GetDebugFunctionalityBufSize(TUint32 &aBufSize)
-{
-	return DoControl(EControlGetDebugFunctionalityBufSize, reinterpret_cast<TAny*>(&aBufSize));
-}
-
-inline TInt RRM_DebugDriver::GetDebugFunctionality(TDes8& aDebugFunctionality)
-{
-	return DoControl(EControlGetDebugFunctionality,reinterpret_cast<TAny*>(&aDebugFunctionality));
-}
-
-inline TInt RRM_DebugDriver::GetMemoryOperationMaxBlockSize(TUint32 &aMaxSize)
-{
-	return DoControl(EControlGetMemoryOperationMaxBlockSize, reinterpret_cast<TAny*>(&aMaxSize));
-}
-
-inline TInt RRM_DebugDriver::AttachProcess(TDesC8& aProcessName, TUint64 aAgentId)
-{
-	TRM_DebugAgentId info(aAgentId);
-	return DoControl(EControlAttachProcess,reinterpret_cast<TAny*>(&aProcessName),reinterpret_cast<TAny*>(&info));
-}
-
-inline TInt RRM_DebugDriver::DetachProcess(TDesC8& aProcessName, TUint64 aAgentId)
-{
-	TRM_DebugAgentId info(aAgentId);
-	return DoControl(EControlDetachProcess,reinterpret_cast<TAny*>(&aProcessName),reinterpret_cast<TAny*>(&info));
-}
-
-inline TInt RRM_DebugDriver::DetachAgent(TUint64 aAgentId)
-{
-	TRM_DebugAgentId info(aAgentId);
-	return DoControl(EControlDetachAgent,reinterpret_cast<TAny*>(&info),0);
-}
-
-inline TInt RRM_DebugDriver::SetEventAction(TDesC8& aProcessName, Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction, TUint64 aAgentId)
-{
-	TRM_DebugEventActionInfo info (aEvent,aEventAction, aAgentId);
-	return DoControl(EControlSetEventAction,reinterpret_cast<TAny*>(&aProcessName),(TAny*)&info);
-}
-
-inline TInt RRM_DebugDriver::GetList(const Debug::TListId aType, const Debug::TListScope aListScope, const TUint64 aTargetId, const TUint64 aDebugProcessId, TDes8& aBuffer, TUint32& aDataSize)
-{
-	TListInformation info(aType, aListScope, &aBuffer, &aDataSize, aTargetId);
-	return DoControl(EControlGetList, (TAny*)&info);
-}
-
-inline TInt RRM_DebugDriver::Step(const TUint32 aThreadId, const TUint32 aNumSteps)
-{
-	return DoControl(EControlStep,reinterpret_cast<TAny*>(aThreadId),reinterpret_cast<TAny*>(aNumSteps));
-}
-
-inline TInt RRM_DebugDriver::IsDebuggable(const TUint32 aProcessId)
-{
-	return DoControl(EControlIsDebuggable,reinterpret_cast<TAny*>(aProcessId),NULL);
-}
-
-inline TInt RRM_DebugDriver::KillProcess(const TUint32 aProcessId, const TInt32 aReason)
-{
-	return DoControl(EControlKillProcess,reinterpret_cast<TAny*>(aProcessId),reinterpret_cast<TAny*>(aReason));
-}
-
-#endif // __RM_DEBUG_KERNELDRIVER_H__
-
--- a/kernel/eka/include/drivers/sdcard.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/drivers/sdcard.h	Thu Sep 02 21:54:16 2010 +0300
@@ -147,6 +147,17 @@
 
 const TInt KSDMaxMBWRetries = 1;
 const TUint32 KSDACMD22BlockLen = 4;
+
+NONSHARABLE_CLASS(DAddressCard) : public DMMCStack::MAddressCard
+	{
+public:
+	DAddressCard(DSDStack& aStack);
+	virtual void AddressCard(TInt aCardNumber);
+private:
+	DSDStack& iStack;
+	};
+
+
 class DSDStack : public DMMCStack
 	{
 public:
@@ -191,15 +202,19 @@
     // Dummy functions to maintain binary compatibility
     IMPORT_C virtual void Dummy1();
     IMPORT_C virtual void Dummy2();
-    IMPORT_C virtual void Dummy3();
+
+protected:
+	IMPORT_C virtual void GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr);
 
 public: 
     IMPORT_C virtual DSDStack::TSDCardType CardType(TInt aSocket, TInt aCardNumber);
 
 private:    
+	DAddressCard* iAddressCard;
     //
     // Reserved members to maintain binary compatibility
-    TInt iReserved[68];
+
+    TInt iReserved[67];
 	};
 
 #include <drivers/sdcard.inl>
--- a/kernel/eka/include/e32ver.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/e32ver.h	Thu Sep 02 21:54:16 2010 +0300
@@ -28,7 +28,7 @@
 
 const TInt KE32MajorVersionNumber=2;
 const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=3110;
+const TInt KE32BuildVersionNumber=3115;
 
 const TInt KMachineConfigurationMajorVersionNumber=1;
 const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/include/kernel/kpower.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/kernel/kpower.h	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -155,6 +155,16 @@
     @see TPowerState
 	*/
 	virtual void PowerDown(TTimeK aWakeupTime) = 0;
+
+	/**
+	Registers resources of interest for Idle with Resource Manager
+
+	Function also provided for power controller to perform other operations if required.
+	*/
+	virtual TInt DoRegisterResourceController()
+		{
+		return KErrNone;
+		}
 	};
 
 #ifndef __X86__
--- a/kernel/eka/include/rm_debug_api.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2558 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Definitions for the run mode debug agent client side sessions.
-// 
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without notice. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-//
-
-#ifndef RM_DEBUG_API_H
-#define RM_DEBUG_API_H
-
-/**
-@file
-@publishedPartner
-@released
-*/
-
-#include <e32cmn.h>
-#include <e32def_private.h>
-
-/**
-  The Debug namespace contains all API definitions used for on-target debugging.
-  */
-namespace Debug {
-
-/** This is the maximum size in bytes a user trace can be */
-const TInt TUserTraceSize = 256;
-
-/**
-  Information in the debug functionality block is represented as a concatenation
-  of pairs of TTagHeader structures and arrays of TTag objects.
-  @see TTagHeader
-  @see RSecuritySvrSession::GetDebugFunctionality
-  */
-struct TTag
-{
-	/** Tag ID, value identifying this tag. */
-	TUint32	iTagId;
-	/**
-	  Values correspond to TTagType enumerators.
-	  @see TTagType
-	  */
-	TUint16	iType;
-	/** Size of external data associated with this tag. */
-	TUint16 iSize;
-	/** Data associated with this tag. */
-	TUint32 iValue;
-};
-
-/**
-  Enumeration defining the supported tag types. These enumerators are used in TTag.iTagId.
-  @see TTag
-  */
-enum TTagType
-{
-	/** Indicates that the iValue field of a TTag structure will contain either ETrue or EFalse. */
-	ETagTypeBoolean = 0,
-	/** Indicates that the iValue field of a TTag structure will contain a value in the TUint32 range. */
-	ETagTypeTUint32 = 1,
-	/** Indicates that the iValue field of a TTag structure will contain values from an enumeration. */
-	ETagTypeEnum = 2,
-	/** Indicates that the iValue field of a TTag structure should be interpreted as a bit field. */
-	ETagTypeBitField = 3,
-	/** Indicates that the type of the iValue field of a TTag structure is unknown. */
-	ETagTypeUnknown = 4,
-	/** Indicates that the iValue field of a TTag structure will contain a pointer. */
-	ETagTypePointer = 5
-};
-
-/**
-  Information in the debug functionality block is represented as a concatenation
-  of pairs of TTagHeader structures and arrays of TTag objects.
-  @see TTag
-  @see RSecuritySvrSession::GetDebugFunctionality
-  */
-struct TTagHeader
-{
-	/** Value identifying the contents of this TTagHeader, should be interpreted as an enumerator from TTagHeaderId.
-	  @see TTagHeaderId
-	  */
-	TUint16	iTagHdrId;
-	/** The number of TTag elements in the array associated with this TTagHeader. */
-	TUint16 iNumTags;
-};
-
-/**
-  Enumeration used to identify TTagHeader structures, TTagHeader::iTagHdrId elements take these enumerators as values.
-  @see TTagHeader
-  */
-enum TTagHeaderId
-{
-	ETagHeaderIdCore = 0,            /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityCore. */
-	ETagHeaderIdMemory = 1,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityMemory. */
-	/**
-	  Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister.
-	  These values are defined as in the document Symbian Core Dump File Format Appendix C
-	  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
-	  The TTag objects in the associated array have an iSize value corresponding to the size of the register's data in bytes.
-	  */
-	ETagHeaderIdRegistersCore = 2,
-	/**
-	  Identifies a TTagHeader with associated TTag elements with iTagId values corresponding to coprocessor register identifiers.
-	  Coprocessor registers are defined as in the document Symbian Core Dump File Format Appendix C as follows
-	  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc):
-
-	  For each 32-bit data word defining a co-pro register, the definition of the meaning of the bits follows
-	  the ARM Architecture Reference manual instruction coding
-
-	  Upper Halfword	Lower Halfword
-	  Opcode 2			CRm
-
-	  For example: The Domain Access Control Register is Register 3 of co-processor 15. The encoding is therefore
-	  CRm = 3
-	  Opcode2 = 0
-
-	  Therefore the functionality tag would be:
-	  TagID:  15			// co-processor number
-	  Type: ETagTypeTUint32
-	  Data: 0x00000003		// Opcode2 = 0, CRm = 3
-	  */
-	ETagHeaderIdCoProRegisters = 3,  /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister. */
-	ETagHeaderIdBreakpoints = 4,     /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityBreakpoint. */
-	ETagHeaderIdStepping = 5,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStep. */
-	ETagHeaderIdExecution = 6,       /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityExec. */
-	ETagHeaderIdEvents = 7,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TEventType. */
-	ETagHeaderIdApiConstants = 8,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityApiConstants.*/
-	ETagHeaderList = 9,              /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TListId. */
-	ETagHeaderIdKillObjects = 10,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityKillObject. */
-	ETagHeaderIdSecurity = 11,		 /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalitySecurity */
-	ETagHeaderIdBuffers = 12,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TBufferType. */
-	ETagHeaderIdStopModeFunctions = 13, /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStopModeFunctions. */	
-};
-
-/**
-  This structure is not used in the run-mode debug API.
-  @deprecated
-  */
-struct TSubBlock
-{
-	/** Header to identify the TSubBlock. */
-	TTagHeader iHeader;
-	/** Pointer to array of TTag values associated with this TSubBlock. */
-	TTag* iTagArray;
-};
-
-/**
-  These tags define what kinds of core functionality are supported by the run-mode debug subsystem.
-  TTag structures associated with the ETagHeaderIdCore sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
-  */
-enum TFunctionalityCore
-{
-	ECoreEvents = 0,        /**< Indicates whether events processing is supported. */
-	ECoreStartStop = 1,     /**< Indicates whether suspending and resuming threads is supported. */
-	ECoreMemory = 2,        /**< Indicates whether reading and writing memory is supported. */
-	ECoreRegister = 3,      /**< Indicates whether reading and writing register values is supported. */
-	ECoreBreakpoint = 4,    /**< Indicates whether breakpoints are supported. */
-	ECoreStepping = 5,      /**< Indicates whether stepping is supported. */
-	ECoreLists = 6,         /**< Indicates whether listings are supported. */
-	ECoreLogging = 7,       /**< Indicates whether logging is supported. */
-	ECoreHardware = 8,      /**< Indicates whether hardware support is supported. */
-	ECoreApiConstants = 9,  /**< Indicates whether the information in the ETagHeaderIdApiConstants sub-block is relevant. */
-	ECoreKillObjects = 10,  /**< Indicates whether killing objects (i.e. threads and processes) is supported. */
-	ECoreSecurity = 11,		/**< Indicates whether OEM Debug token support or other security info is supported. */
-	ECoreStopModeFunctions = 12, /**< Indicates whether Stop Mode function calling is supported. */
-	ECoreStopModeBuffers = 13, /**< Indicates whether Stop Mode buffers are supported. */
-	
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
-	  */
-	ECoreLast
-};
-
-/**
-  These tags define what kind of memory operations can be performed.
-  TTag structures associated with the ETagHeaderIdMemory sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityMemory
-{
-	EMemoryRead = 0,          /**< Indicates whether reading memory is supported. */
-	EMemoryWrite = 1,         /**< Indicates whether writing memory is supported. */
-	EMemoryAccess64 = 2,      /**< Indicates whether 64 bit memory access is supported. */
-	EMemoryAccess32 = 3,      /**< Indicates whether 32 bit memory access is supported. */
-	EMemoryAccess16 = 4,      /**< Indicates whether 16 bit memory access is supported. */
-	EMemoryAccess8 = 5,       /**< Indicates whether 8 bit memory access is supported. */
-	EMemoryBE8 = 6,           /**< Indicates whether reading memory as 8 bit big-endian values is supported. */
-	EMemoryBE32 = 7,          /**< Indicates whether reading memory as 32 bit big-endian values is supported. */
-	EMemoryLE8 = 8,           /**< Indicates whether reading memory as 8 bit little-endian values is supported. */
-	EMemoryMaxBlockSize = 9,  /**< Corresponds to the maximum size of a block of memory which can be requested. */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of memory tags from the DFBlock rather than this enumerator.
-	  */
-	EMemoryLast
-};
-
-/**
-  These tags define which objects can be killed by the device driver.
-  TTag structures associated with the ETagHeaderIdKillObjects sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityKillObject
-{
-	EFunctionalityKillThread = 0,          /**< Indicates whether killing threads is supported. */
-	EFunctionalityKillProcess = 1,         /**< Indicates whether killing processes is supported. */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of kill object tags from the DFBlock rather than this enumerator.
-	  */
-	EFunctionalityKillObjectLast
-};
-
-/**
-  A TTag with an id from the TFunctionalityRegister enum will have a value from this enumeration.
-  The values define how a register can be accessed, if at all.
- */
-enum TFunctionalityAccess
-{
-	EAccessNone = 0,       /**< Indicates that a register cannot be accessed. */
-	EAccessReadOnly = 1,   /**< Indicates that a register can be read, but not written to. */
-	EAccessWriteOnly = 2,  /**< Indicates that a register can be written to, but not read. */
-	EAccessReadWrite = 3,  /**< Indicates that a register can be both read and written to. */
-	EAccessUnknown = 4,    /**< Indicates that it is unspecified whether reading or writing to a register is possible. */
-};
-
-/**
-  These enumerators act as core register identifiers.
-  TTag structures associated with the ETagHeaderIdRegistersCore sub-block will have iTagId values from this enumeration.
-  The numeric value of each enumerator identifies the register according to the definitions in the Symbian Core Dump File Format Appendix B
-  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
-  */
-enum TFunctionalityRegister
-{
-	ERegisterR0 = 0x00000000,      /**< Identifier for user mode register R0. */
-	ERegisterR1 = 0x00000100,      /**< Identifier for user mode register R1. */
-	ERegisterR2 = 0x00000200,      /**< Identifier for user mode register R2. */
-	ERegisterR3 = 0x00000300,      /**< Identifier for user mode register R3. */
-	ERegisterR4 = 0x00000400,      /**< Identifier for user mode register R4. */
-	ERegisterR5 = 0x00000500,      /**< Identifier for user mode register R5. */
-	ERegisterR6 = 0x00000600,      /**< Identifier for user mode register R6. */
-	ERegisterR7 = 0x00000700,      /**< Identifier for user mode register R7. */
-	ERegisterR8 = 0x00000800,      /**< Identifier for user mode register R8. */
-	ERegisterR9 = 0x00000900,      /**< Identifier for user mode register R9. */
-	ERegisterR10 = 0x00000a00,     /**< Identifier for user mode register R10. */
-	ERegisterR11 = 0x00000b00,     /**< Identifier for user mode register R11. */
-	ERegisterR12 = 0x00000c00,     /**< Identifier for user mode register R12. */
-	ERegisterR13 = 0x00000d00,     /**< Identifier for user mode register R13. */
-	ERegisterR14 = 0x00000e00,     /**< Identifier for user mode register R14. */
-	ERegisterR15 = 0x00000f00,     /**< Identifier for user mode register R15. */
-	ERegisterCpsr = 0x00001000,    /**< Identifier for CPSR. */
-	ERegisterR13Svc = 0x00001100,  /**< Identifier for R13 supervisor mode banked register. */
-	ERegisterR14Svc = 0x00001200,  /**< Identifier for R14 supervisor mode banked register. */
-	ERegisterSpsrSvc = 0x00001300, /**< Identifier for SPSR supervisor mode banked register. */
-	ERegisterR13Abt = 0x00001400,  /**< Identifier for R13 Abort mode banked register. */
-	ERegisterR14Abt = 0x00001500,  /**< Identifier for R14 Abort mode banked register. */
-	ERegisterSpsrAbt = 0x00001600, /**< Identifier for SPSR Abort mode banked register. */
-	ERegisterR13Und = 0x00001700,  /**< Identifier for R13 Undefined mode banked register. */
-	ERegisterR14Und = 0x00001800,  /**< Identifier for R14 Undefined mode banked register. */
-	ERegisterSpsrUnd = 0x00001900, /**< Identifier for SPSR Undefined mode banked register. */
-	ERegisterR13Irq = 0x00001a00,  /**< Identifier for R13 Interrupt mode banked register. */
-	ERegisterR14Irq = 0x00001b00,  /**< Identifier for R14 Interrupt mode banked register. */
-	ERegisterSpsrIrq = 0x00001c00, /**< Identifier for SPSR Interrupt mode banked register. */
-	ERegisterR8Fiq = 0x00001d00,   /**< Identifier for R8 Fast Interrupt mode banked register. */
-	ERegisterR9Fiq = 0x00001e00,   /**< Identifier for R9 Fast Interrupt mode banked register. */
-	ERegisterR10Fiq = 0x00001f00,  /**< Identifier for R10 Fast Interrupt mode banked register. */
-	ERegisterR11Fiq = 0x00002000,  /**< Identifier for R11 Fast Interrupt mode banked register. */
-	ERegisterR12Fiq = 0x00002100,  /**< Identifier for R12 Fast Interrupt mode banked register. */
-	ERegisterR13Fiq = 0x00002200,  /**< Identifier for R13 Fast Interrupt mode banked register. */
-	ERegisterR14Fiq = 0x00002300,  /**< Identifier for R14 Fast Interrupt mode banked register. */
-	ERegisterSpsrFiq = 0x00002400, /**< Identifier for SPSR Fast Interrupt mode banked register. */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of core registers from the DFBlock rather than this enumerator.
-	  */
-	ERegisterLast = 37
-};
-
-
-/**
-  These tags define the kind of breakpoints that are supported.
-  TTag structures associated with the ETagHeaderIdBreakpoints sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityBreakpoint
-{
-	EBreakpointThread = 0,         /**< Indicates whether thread specific breakpoints are supported. */
-	EBreakpointProcess = 1,        /**< Indicates whether process specific breakpoints are supported. */
-	EBreakpointSystem = 2,         /**< Indicates whether system wide breakpoints are supported. */
-	EBreakpointArm = 3,            /**< Indicates whether ARM mode breakpoints are supported. */
-	EBreakpointThumb = 4,          /**< Indicates whether Thumb mode breakpoints are supported. */
-	EBreakpointT2EE = 5,           /**< Indicates whether Thumb2 mode breakpoints are supported. */
-	EBreakpointArmInst = 6,        /**< Reserved for future use. */
-	EBreakpointThumbInst = 7,      /**< Reserved for future use. */
-	EBreakpointT2EEInst = 8,       /**< Reserved for future use. */
-	EBreakpointSetArmInst = 9,     /**< Reserved for future use. */
-	EBreakpointSetThumbInst = 10,  /**< Reserved for future use. */
-	EBreakpointSetT2EEInst = 11,   /**< Reserved for future use. */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of breakpoint tags from the DFBlock rather than this enumerator.
-	  */
-	EBreakpointLast
-};
-
-/**
-  These enumerators provide information about the stepping capabilities of the debug sub-system.
-  TTag structures associated with the ETagHeaderIdStepping sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityStep
-{
-	EStep = 0, /**< Indicates whether instruction stepping is supported. */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of stepping tags from the DFBlock rather than this enumerator.
-	  */
-	EStepLast
-};
-
-/**
-  These enumerators provide information about the execution control capabilities of the debug sub-system.
-  TTag structures associated with the ETagHeaderIdExecution sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityExec
-{
-	EExecThreadSuspendResume = 0,  /**< Indicates whether suspending and resuming threads is supported. */
-	EExecProcessSuspendResume = 1, /**< Indicates whether suspending and resuming processes is supported. */
-	EExecSystemSuspendResume = 2,  /**< Indicates whether suspending and resuming the entire system is supported. */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of execution control tags from the DFBlock rather than this enumerator.
-	  */
-	EExecLast
-};
-
-/**
-  This enumeration defines the event types supported by the debug sub-system.
-  TTag structures associated with the ETagHeaderIdEvents sub-block will have
-  iTagId values from this enumeration, and iValue values from the TKernelEventAction enumeration.
-
-  These enumerators are also used by the RSecuritySvrSession API to identify events.
-  @see RSecuritySvrSession
-  @see TKernelEventAction
- */
-enum TEventType
-{
-	EEventsBreakPoint = 0,    /**< Identifies a breakpoint event. */
-	EEventsSwExc = 1,         /**< Identifies a software exception event. */
-	EEventsHwExc = 2,         /**< Identifies a hardware exception event. */
-	EEventsKillThread = 3,    /**< Identifies a kill thread event. */
-	EEventsAddLibrary = 4,    /**< Identifies an add library event. */
-	EEventsRemoveLibrary = 5, /**< Identifies a remove library event. */
-	/**
-	 If an event is generated and there is only a single space remaining in the events queue then
-	 an event of type EEventsBufferFull will be stored in the queue and the generated event will
-	 be discarded. If further events occur while the buffer is full the events will be discarded.
-	 As such an event of type EEventsBufferFull being returned signifies that one or more events
-	 were discarded. An event of this type has no valid data associated with it.
-	 */
-	EEventsBufferFull = 6,
-	EEventsUnknown = 7,       /**< Identifies an event of unknown type. */
-	EEventsUserTrace = 8,     /**< Identifies a user trace. */
-	EEventsProcessBreakPoint = 9, /**< Identifies a process breakpoint event. */
-	EEventsStartThread = 10, /**< Identifies a start thread event. */
-	EEventsUserTracesLost = 11, /**< Identifies user traces being lost. */
-	EEventsAddProcess = 12, /**< Identifies an AddProcess event */
-	EEventsRemoveProcess = 13, /**< Identifies a RemoveProcess event */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of event types from the DFBlock rather than this enumerator.
-	  */
-	EEventsLast
-};
-
-/**
-  These enumerators provide information about constants which are used in the RSecuritySvrSession API.
-  TTag structures associated with the ETagHeaderIdApiConstants sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityApiConstants
-	{
-	/**
-	  Corresponds to the size of a buffer required to store a TEventInfo.
-	  @see TEventInfo
-	  */
-	EApiConstantsTEventInfoSize = 0,
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of API constants tags from the DFBlock rather than this enumerator.
-	  */
-	EApiConstantsLast,
-	};
-
-/**
-  The set of possible actions which could be taken when a kernel event occurs.
-  Not all actions are possible for all events. The debug functionality sub-block with header id ETagHeaderIdEvents
-  indicates which values are permitted for each event. The value given for that event should be
-  considered as the most intrusive action the debugger may set: with the definition that EActionSuspend is more
-  intrusive than EActionContinue, which is more intrusive than EActionIgnore.
-  @see RSecuritySvrSession
-  */
-enum TKernelEventAction
-{
-	/** If an event action is set to this value then events of that type will be
-	  ignored, and not reported to the debugger. */
-	EActionIgnore = 0,
-	/** If an event action is set to this value then events of that type will be
-	  reported to the debugger and the thread which generated the event will be
-	  allowed to continue executing. */
-	EActionContinue = 1,
-	/** If an event action is set to this value then events of that type will be
-	  reported to the debugger and the thread which generated the event will be
-	  suspended. */
-	EActionSuspend = 2,
-	/**
-	  @internalTechnology
-	  Count of event actions.
-	  */
-	EActionLast
-};
-
-/**
-  These enumerators provide information about the ability of the debug subsystem to support OEM Debug tokens.
-  TTag structures associated with the ETagHeaderIdSecurity sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalitySecurity
-{
-	ESecurityOEMDebugToken = 0,  /**< Indicates whether the DSS supports the use of OEM Debug Tokens. */
-
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of tags from the DFBlock rather than this enumerator.
-	  */
-	ESecurityLast
-};
-
-/**
-  Used for storing the contents of a 32 bit register
-  */
-typedef TUint32 TRegisterValue32;
-
-
-/**
- * Processor mode
- */
-enum TArmProcessorModes
-{
-	EUserMode=0x10,    	//!< EUserMode
-    EFiqMode=0x11,  	//!< EFiqMode
-    EIrqMode=0x12,  	//!< EIrqMode
-    ESvcMode=0x13,  	//!< ESvcMode
-    EAbortMode=0x17,	//!< EAbortMode
-    EUndefMode=0x1b,	//!< EUndefMode
-    EMaskMode=0x1f  	//!< EMaskMode
-};
-
-
-
-/**
-  Structure containing information about the state of the registers when a
-  hardware exception occurred
-  */
-class TRmdArmExcInfo
-	{
-public:
-	/** Enumeration detailing the types of exception which may occur. */
-	enum TExceptionType
-		{
-		/** Enumerator signifying that a prefetch abort error has occurred. */
-		EPrefetchAbort = 0,
-		/** Enumerator signifying that a data abort error has occurred. */
-		EDataAbort = 1,
-		/** Enumerator signifying that an undefined instruction error has occurred. */
-		EUndef =2
-		};
-
-	/** Value of CPSR. */
-	TRegisterValue32 iCpsr;
-	/** Type of exception which has occurred. */
-	TExceptionType iExcCode;
-	/** Value of R13 supervisor mode banked register. */
-	TRegisterValue32 iR13Svc;
-	/** Value of user mode register R4. */
-	TRegisterValue32 iR4;
-	/** Value of user mode register R5. */
-	TRegisterValue32 iR5;
-	/** Value of user mode register R6. */
-	TRegisterValue32 iR6;
-	/** Value of user mode register R7. */
-	TRegisterValue32 iR7;
-	/** Value of user mode register R8. */
-	TRegisterValue32 iR8;
-	/** Value of user mode register R9. */
-	TRegisterValue32 iR9;
-	/** Value of user mode register R10. */
-	TRegisterValue32 iR10;
-	/** Value of user mode register R11. */
-	TRegisterValue32 iR11;
-	/** Value of R14 supervisor mode banked register. */
-	TRegisterValue32 iR14Svc;
-	/** Address which caused exception (System Control Coprocessor Fault Address Register) */
-	TRegisterValue32 iFaultAddress;
-	/** Value of System Control Coprocessor Fault Status Register. */
-	TRegisterValue32 iFaultStatus;
-	/** Value of SPSR supervisor mode banked register. */
-	TRegisterValue32 iSpsrSvc;
-	/** Value of user mode register R13. */
-	TRegisterValue32 iR13;
-	/** Value of user mode register R14. */
-	TRegisterValue32 iR14;
-	/** Value of user mode register R0. */
-	TRegisterValue32 iR0;
-	/** Value of user mode register R1. */
-	TRegisterValue32 iR1;
-	/** Value of user mode register R2. */
-	TRegisterValue32 iR2;
-	/** Value of user mode register R3. */
-	TRegisterValue32 iR3;
-	/** Value of user mode register R12. */
-	TRegisterValue32 iR12;
-	/** Value of user mode register R15, points to instruction which caused exception. */
-	TRegisterValue32 iR15;
-	};
-
-/**
-  The maximum size, in bytes, of the panic category string returned as part of a
-  TEventInfo object.
-
-  @see TEventInfo
-  @see TThreadKillInfo
-  */
-const TInt KPanicCategoryMaxName = KMaxName;
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  an agent set breakpoint is hit.
-  */
-class TThreadBreakPointInfo
-	{
-public:
-	/** Identifies the type of exception. */
-	TExcType iExceptionNumber;
-	/** Structure containing information about the ARM register values. */
-	TRmdArmExcInfo iRmdArmExcInfo;
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a software exception occurs.
-  */
-class TThreadSwExceptionInfo
-	{
-public:
-	/** The value of the program counter. */
-	TUint32 iCurrentPC;
-	/** Identifies the type of exception. */
-	TExcType iExceptionNumber;
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a hardware exception occurs.
-  */
-class TThreadHwExceptionInfo
-	{
-public:
-	/** Identifies the type of exception. */
-	TExcType iExceptionNumber;
-	/** Structure containing information about the ARM register values. */
-	TRmdArmExcInfo iRmdArmExcInfo;
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a thread kill event occurs.
-  */
-class TThreadKillInfo
-	{
-public:
-	/** The value of the program counter. */
-	TUint32 iCurrentPC;
-	/** Specifies the reason for the kill thread event, this value is specific to the killed thread and does not correspond to a standard Symbian enumeration. */
-	TInt iExitReason;
-	/** Specifies the type of the thread kill event, values correspond to elements of TExitType. */
-	TUint8 iExitType;
-	/** The panic category of the killed thread. */
-	TUint8 iPanicCategory[KPanicCategoryMaxName];
-	/** Contains the length in bytes of the initialised data in iPanicCategory. */
-	TInt iPanicCategoryLength;
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a library load event occurs.
-  */
-class TLibraryLoadedInfo
-	{
-public:
-	/** The name of the file that the library was loaded from. */
-	TUint8 iFileName[KMaxName];
-	/** Contains the length in bytes of the initialised data in iFileName. */
-	TInt iFileNameLength;
-	/** The code base address (.text). */
-	TUint32 iCodeAddress;
-	/** The base address of the initialised data section (.data). */
-	TUint32 iDataAddress;
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a thread is started
-  */
-class TStartThreadInfo
-	{
-public:
-	/** The name of the file that the process owning the thread was created from. */
-	TUint8 iFileName[KMaxName];
-	/** Contains the length in bytes of the initialised data in iFileName. */
-	TInt iFileNameLength;
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a process is added. Note that the Process may not be fully constructed,
-  e.g. no threads.
-  */
-class TAddProcessInfo
-	{
-public:
-	/** The name of the file that the process was created from. */
-	TUint8 iFileName[KMaxName];
-	/** Contains the length in bytes of the initialised data in iFileName. */
-	TInt iFileNameLength;
-	/** The UID3 of this process */
-	TUint32 iUid3;  
-	/** Contains the CreatorThread ID if available: May be 0 */
-	TUint64 iCreatorThreadId;  
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a process is removed. Note that the Process may not be fully destroyed,
-  so its resources should only be accessed if you already have a handle to it.
-  */
-class TRemoveProcessInfo
-	{
-public:
-	/** The name of the file that the process was created from. */
-	TUint8 iFileName[KMaxName];
-	/** Contains the length in bytes of the initialised data in iFileName. */
-	TInt iFileNameLength;
-	TUint32 iSpare1;	// Unused
-	};
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a library unload event occurs.
-  */
-class TLibraryUnloadedInfo
-	{
-public:
-	/** The name of the file that the library was loaded from. */
-	TUint8 iFileName[KMaxName];
-	/** Contains the length in bytes of the initialised data in iFileName. */
-	TInt iFileNameLength;
-	};
-
-/**
- * Enum to represent the context of a user trace message
- */ 
-enum TUserTraceMessageContext 
-{
-	ESingleMessage = 0x1,   /** Indicates this message is the only one corresponding to a given user trace */ 
-	EMultiStart = 0x2, /** Indicates this message is the start of a user trace which consists of multiple messages */
-	EMultiMid = 0x3, /** Indicates this message is one in a series of user trace messages */
-	EMultiEnd = 0x4, /** Indicates this message is the last in a series of user trace messages */
-	/**
-	  @internalTechnology
-	  A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
-	  */
-	ELast = 0x5	
-};
-	
-/**
- *   Event specific information returned as part of a TEventInfo object 
- *   when a user trace event occurs.
- */
-class TUserTraceInfo
-	{
-public:
-	/** The user trace text */
-	TUint8 iUserTraceText[TUserTraceSize];
-	
-	/** User trace text length */
-	TInt iUserTraceLength;
-	
-	/** The context of the message */
-	TUserTraceMessageContext iMessageStatus;
-	};
-	
-	
-/**
-  Structure used to store information about an event. An object of this type
-  is passed as an argument to the RSecuritySvrSession::GetEvent function,
-  and is filled in by the debug driver, and returned to the agent, when a
-  relevant event occurs.
-
-  The debug functionality block contains the size in bytes of the data that
-  the driver will return when a GetEvent call is issued. A debug agent should
-  ensure that this value equals the size of this TEventInfo object to ensure
-  that a compatible debug driver is being used. The value is stored as
-  EApiConstantsTEventInfoSize in the TFunctionalityApiConstants block.
-
-  @see RSecuritySvrSession::GetDebugFunctionality
-  @see RSecuritySvrSession::GetEvent
-  */
-class TEventInfo
-	{
-public:
-
-	/** Constructor sets all elements to default values. */
-	inline TEventInfo() { Reset(); };
-
-	/** Resets all values to default values. */
-	inline void Reset()
-		{
-		iProcessId = 0;
-		iProcessIdValid = EFalse;
-		iThreadId = 0;
-		iThreadIdValid = EFalse;
-		iEventType = (TEventType)NULL;
-		};
-
-public:
-
-	/** The process ID of the process which the event occurred in. */
-	TUint64 				iProcessId;
-	/** The thread ID of the thread which the event occurred in. */
-	TUint64 				iThreadId;
-	/** Has value ETrue if iProcessId is valid, EFalse otherwise. */
-	TUint8					iProcessIdValid;
-	/** Has value ETrue if iThreadId is valid, EFalse otherwise. */
-	TUint8					iThreadIdValid;
-	/** Indicates the type of the event. This type should be used to determine
-	    the type of the information stored in the union which is part of this class. */
-	TEventType				iEventType;
-	union
-		{
-		/** Information which is specific to the break point event. */
-		TThreadBreakPointInfo iThreadBreakPointInfo;
-		/** Information which is specific to the software exception event. */
-		TThreadSwExceptionInfo iThreadSwExceptionInfo;
-		/** Information which is specific to the hardware exception event. */
-		TThreadHwExceptionInfo iThreadHwExceptionInfo;
-		/** Information which is specific to the thread kill event. */
-		TThreadKillInfo iThreadKillInfo;
-		/** Information which is specific to the library loaded event. */
-		TLibraryLoadedInfo iLibraryLoadedInfo;
-		/** Information which is specific to the library unloaded event. */
-		TLibraryUnloadedInfo iLibraryUnloadedInfo;
-		/** Information which is specific to the user trace event. */
-		TUserTraceInfo iUserTraceInfo;
-		/** Information which is specific to the start thread event. */
-		TStartThreadInfo iStartThreadInfo;
-		/** Information which is specific to the Add Process event. */
-		TAddProcessInfo iAddProcessInfo;
-		/** Information which is specific to the Remove Process event. */
-		TRemoveProcessInfo iRemoveProcessInfo;
-		};
-	};
-
-/**
-  @internalComponent
-  */
-class TProcessInfo
-	{
-	public:
-
-		inline TProcessInfo() { Reset(); }
-
-		inline TProcessInfo(TUint32 aId, TUint32 aCodeAddress, TUint32 aCodeSize, TUint32 aDataAddress)
-				: iId(aId),
-				  iCodeAddress(aCodeAddress),
-				  iCodeSize(aCodeSize),
-				  iDataAddress(aDataAddress) { }
-
-		inline void Reset()
-			{
-			iId = 0;
-			iCodeAddress = 0;
-			iCodeSize = 0;
-			iDataAddress = 0;
-			}
-
-	public:
-
-		TUint32 iId;
-		TUint32 iCodeAddress;
-		TUint32 iCodeSize;
-		TUint32 iDataAddress;
-	};
-
-/* Other functionality may be defined here later */
-
-/**
-Represents a register id value, in the terms of the Symbian ELF format:
- - bits 0-7 define the class
- - bits 8-15 define the rd_id
- - bits 16-31 define the rd_sub_id
-
-Both the core registers (TFunctionalityRegister type) and the coprocessor registers
-follow this identifier scheme.
-*/
-typedef TUint32 TRegisterInfo;
-
-/**
-Enum representing the status flags which could be returned from a register
-access call.
-*/
-enum TRegisterFlag
-	{
-	/**
-	Default value, a register access call will never return this value
-	*/
-	ENotSet = 0,
-	/**
-	Would be returned if the register is supported by the debug driver but the kernel cannot access the register
-	*/
-	EInValid = 1,
-	/**
-	Would be returned if the register could be accessed correctly
-	*/
-	EValid = 2,
-	/**
-	Would be returned if the register is not supported by the debug driver
-	*/
-	ENotSupported = 3,
-	/**
-	Would be returned if a non-4 byte register value was requested
-	*/
-	EBadSize = 4
-	};
-
-/**
-Enum representing the different ARM CPU instruction set architectures.
-*/
-enum TArchitectureMode
-	{
-	/** Represents the ARM CPU architecture. */
-	EArmMode = 1,
-	/** Represents the Thumb CPU architecture. */
-	EThumbMode = 2,
-	/**
-	  Represents the Thumb2 CPU architecture.
-	  @prototype
-	  */
-	EThumb2EEMode = 3
-	};
-
-/**
-  Used as an identifier for breakpoints set by the RSecuritySvrSession::SetBreak function.
-  @see RSecuritySvrSession
-  */
-typedef TInt32 TBreakId;
-
-/**
-  Specifies the type of a code segment.
-  @see TCodeSegListEntry
-  */
-enum TCodeSegType
-	{
-	EUnknownCodeSegType = 0, /**< Signifies an unknown code segment type. */
-	EExeCodeSegType = 1,     /**< Signifies a code segment belonging to an executable. */
-	EDllCodeSegType = 2      /**< Signifies a code segment belonging to a library. */
-	};
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::ECodeSegs
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TCodeSegListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-	{
-	//cast the pointer to be a TCodeSegListEntry object
-	TCodeSegListEntry& entry = *(TCodeSegListEntry*)ptr;
-	//use the TCodeSegListEntry pointer, i.e.
-	TUint16 nameLength = entry.iNameLength;
-	TPtr name(&(entry.iName[0]), nameLength, nameLength);
-	// move ptr on to point to the next TCodeSegListEntry object
-	ptr += Align4(entry.GetSize());
-	}
-@endcode
-*/
-class TCodeSegListEntry
-	{
-public:
-	TInt GetSize() const;
-public:
-	/**
-	  Address of the start of the code segment.
-	  */
-	TUint32 iCodeBase;
-	/**
-	  Size of the code segment.
-	  */
-	TUint32 iCodeSize;
-	/**
-	  Size of the const data segment
-	  */
-	TUint32 iConstDataSize;
-	/**
-	  Address of the initialised data
-	  */
-	TUint32 iInitialisedDataBase;
-	/**
-	  Size of the initialised data
-	  */
-	TUint32 iInitialisedDataSize;
-	/**
-	  Size of the uninitialised data
-	  */
-	TUint32 iUninitialisedDataSize;
-	/**
-	  Boolean indicating whether the code segment is execute in place
-	  */
-	TBool iIsXip;
-	/**
-	  Indicates whether the code segment is from an executable or a dll, or neither
-	  */
-	TCodeSegType iCodeSegType;
-	/** Uid3 of this segment. */
-	TUint32 iUid3;
-	/** Currently unused element. May be used in future to aid maintaining compatibility. */
-	TUint32 iSpare2;
-	/**
-	  Length of the code segment's name
-	  */
-	TUint16 iNameLength;
-	/**
-	  First two bytes of the code segment's name, the name should be considered to
-	  extend past the end of the TCodeSegListEntry structure to a length
-	  corresponding to iNameLength
-	  */
-	TUint16 iName[1];
-	};
-
-/**
-Returns the size of the TCodeSegListEntry, including the file name length
-
-@return the size, in bytes, of the TCodeSegListEntry and the code segment's
-file name
-*/
-inline TInt TCodeSegListEntry::GetSize() const
-	{
-	return sizeof(TCodeSegListEntry) - sizeof(iName) + (2 * iNameLength);
-	}
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EXipLibraries
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TXipLibraryListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-	{
-	//cast the pointer to be a TXipLibraryListEntry object
-	TXipLibraryListEntry& entry = *(TXipLibraryListEntry*)ptr;
-	//use the TXipLibraryListEntry pointer, i.e.
-	TUint16 nameLength = entry.iNameLength;
-	TPtr name(&(entry.iName[0]), nameLength, nameLength);
-	// move ptr on to point to the next TXipLibraryListEntry object
-	ptr += Align4(entry.GetSize());
-	}
-@endcode
-*/
-class TXipLibraryListEntry
-	{
-public:
-	TInt GetSize() const;
-public:
-	/**
-	  Address of the start of the library's code segment.
-	  */
-	TUint32 iCodeBase;
-	/**
-	  Size of the code segment.
-	  */
-	TUint32 iCodeSize;
-	/**
-	  Size of the const data segment
-	  */
-	TUint32 iConstDataSize;
-	/**
-	  Address of the initialised data
-	  */
-	TUint32 iInitialisedDataBase;
-	/**
-	  Size of the initialised data
-	  */
-	TUint32 iInitialisedDataSize;
-	/**
-	  Size of the uninitialised data
-	  */
-	TUint32 iUninitialisedDataSize;
-	/** Currently unused element. May be used in future to aid maintaining compatibility. */
-	TUint32 iSpare1;
-	/** Currently unused element. May be used in future to aid maintaining compatibility. */
-	TUint32 iSpare2;
-	/**
-	  Length of the library's name
-	  */
-	TUint16 iNameLength;
-	/**
-	  First two bytes of the code segment's name, the name should be considered to
-	  extend past the end of the TXipLibraryListEntry structure to a length
-	  corresponding to iNameLength
-	  */
-	TUint16 iName[1];
-	};
-
-/**
-Returns the size of the TXipLibraryListEntry, including the file name length
-
-@return the size, in bytes, of the TXipLibraryListEntry and the library's
-file name
-*/
-inline TInt TXipLibraryListEntry::GetSize() const
-	{
-	return sizeof(TXipLibraryListEntry) - sizeof(iName) + (2 * iNameLength);
-	}
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EExecutables
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TExecutablesListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-	{
-	//cast the pointer to be a TExecutablesListEntry object
-	TExecutablesListEntry& entry = *(TExecutablesListEntry*)ptr;
-	//use the TExecutablesListEntry pointer, i.e.
-	TUint16 nameLength = entry.iNameLength;
-	TPtr name(&(entry.iName[0]), nameLength, nameLength);
-	// move ptr on to point to the next TExecutablesListEntry object
-	ptr += Align4(entry.GetSize());
-	}
-@endcode
-*/
-class TExecutablesListEntry
-	{
-public:
-	TInt GetSize() const;
-public:
-	/**
-	  Indicates whether an agent has registered to actively debug the executable,
-	  a non-zero value indicates that an agent has attached.
-	  */
-	TUint8 iIsActivelyDebugged;
-	/**
-	  Indicates whether any agents have registered to passively debug the executable,
-	  a non-zero value indicates that at least one agent is attached passively
-	  */
-	TUint8 iIsPassivelyDebugged;
-	/** Currently unused element. May be used in future to aid maintaining compatibility. */
-	TUint32 iSpare1;
-	/** Currently unused element. May be used in future to aid maintaining compatibility. */
-	TUint32 iSpare2;
-	/**
-	  Length of the executable's name
-	  */
-	TUint16 iNameLength;
-	/**
-	  First two bytes of the executable's name, the name should be considered to
-	  extend past the end of the TExecutablesListEntry structure to a length
-	  corresponding to iNameLength
-	  */
-	TUint16 iName[1];
-	};
-
-/**
-Returns the size of the TExecutablesListEntry, including the file name length
-
-@return the size, in bytes, of the TExecutablesListEntry and the executable's
-file name
-*/
-inline TInt TExecutablesListEntry::GetSize() const
-	{
-	return sizeof(TExecutablesListEntry) - sizeof(iName) + (2*iNameLength);
-	}
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EProcesses
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TProcessListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-	{
-	//cast the pointer to be a TProcessListEntry object
-	TProcessListEntry& entry = *(TProcessListEntry*)ptr;
-	//use the TProcessListEntry pointer, i.e.
-	TUint16 fileNameLength = entry.iFileNameLength;
-	TPtr name(&(entry.iNames[0]), fileNameLength, fileNameLength);
-	// move ptr on to point to the next TProcessListEntry object
-	ptr += Align4(entry.GetSize());
-	}
-@endcode
-*/
-class TProcessListEntry
-	{
-	public:
-		TInt GetSize() const;
-
-	public:
-		/** Process ID */
-		TUint64 iProcessId;
-
-		/** The Uid3 of the process */
-		TUint32 iUid3;
-
-		/** 
-		 * Process Attributes
-		 * @see DProcess::TProcessAttributes
-		 */
-		TInt iAttributes;
-
-		/**
-		 * Length of fully qualified file name of the process in bytes. Note that this
-		 * entry may be 0 if the process is in the process of shutting down.
-		 */
-		TUint16 iFileNameLength;
-
-		/**
-		 * Length of current dynamic name of the process in bytes
-		 */
-		TUint16 iDynamicNameLength;
-
-		/**
-		 * First two bytes of the process' file name, the name should be considered to
-		 * extend past the end of the TProcessListEntry structure to a length
-		 * corresponding to iFileNameLength. Directly after the data corresponding to the
-		 * file name, the dynamic name is stored with a length of iDynamicNameLength characters.
-		 * Note that these names are not null terminated and are concatenated directly after each other.
-		 * 
-		 * @code
-		 * TProcessListEntry& entry; // entry is a reference to a TProcessListEntry
-		 *
-		 * //get the file name..
-		 * TPtr fileName(&(entry.iNames[0]), iFileNameLength, iFileNameLength);
-		 *
-		 * //get the dynamic name length..
-		 * TPtr dynamicName(&(entry.iNames[0]) + iFileNameLength, iDynamicNameLength, iDynamicNameLength);
-		 * @endcode
-		 */
-		TUint16 iNames[1];
-	};
-
-/**
-Returns the size of the TProcessListEntry, including the file name length and the
-dynamic name length
-
-@return the size, in bytes, of the TProcessListEntry and the executable's
-file name file name and dynamic name
-*/
-inline TInt TProcessListEntry::GetSize() const
-	{
-	return sizeof(TProcessListEntry) - sizeof(iNames) + (2 * (iFileNameLength + iDynamicNameLength));
-	}
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EThreads
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TThreadListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-	{
-	//cast the pointer to be a TThreadListEntry object
-	TThreadListEntry& entry = *(TThreadListEntry*)ptr;
-	//use the TThreadListEntry pointer, i.e.
-	TUint16 nameLength = entry.iNameLength;
-	TPtr name(&(entry.iName[0]), nameLength, nameLength);
-	// move ptr on to point to the next TThreadListEntry object
-	ptr += Align4(entry.GetSize());
-	}
-@endcode
-*/
-class TThreadListEntry
-	{
-public:
-	TInt GetSize() const;
-public:
-	/**
-	  Thread ID
-	  */
-	TUint64 iThreadId;
-	/**
-	  Process ID
-	  */
-	TUint64 iProcessId;
-	/**
-	  Address of the base of the supervisor stack
-	  */
-	TUint32 iSupervisorStackBase;
-	/**
-	  Size of the supervisor stack
-	  */
-	TUint32 iSupervisorStackSize;
-	/**
-	  Non-zero if iSupervisorStackBase has been set correctly
-	  */
-	TUint8 iSupervisorStackBaseValid;
-	/**
-	  Non-zero if iSupervisorStackSize has been set correctly
-	  */
-	TUint8 iSupervisorStackSizeValid;
-	/**
-	  Address of the thread's supervisor stack pointer
-	  */
-	TUint32 iSupervisorStackPtr;
-	/**
-	  Indicator of whether the value returned as iSupervisorStackPtr is valid.
-	  It is necessary, but not necessarily sufficient, that the thread be suspended
-	  for a valid value to be returned. This may be removed from the final API and
-	  the value would be extracted instead via the ReadRegisters type calls.
-	  */
-	TRegisterFlag iSupervisorStackPtrValid;
-	/** Currently unused element. May be used in future to aid maintaining compatibility. */
-	TUint32 iSpare1;
-	/** Currently unused element. May be used in future to aid maintaining compatibility. */
-	TUint32 iSpare2;
-	/**
-	  The length of the thread's name
-	  */
-	TUint16 iNameLength;
-	/**
-	  First two bytes of the thread's name, the name should be considered to
-	  extend past the end of the TThreadListEntry structure to a length
-	  corresponding to iNameLength
-	  */
-	TUint16 iName[1];
-	};
-
-/**
-Returns the size of the TThreadListEntry, including the name length
-
-@return the size, in bytes, of the TExecutablesListEntry and the thread's name
-*/
-inline TInt TThreadListEntry::GetSize() const
-	{
-	return sizeof(TThreadListEntry) - sizeof(iName) + (2 * iNameLength);
-	}
-
-/**
-Denotes which list type to return from a RSecuritySvrSession::GetList() call
-
-@see RSecuritySvrSession::GetList()
-*/
-enum TListId
-	{
-	/**
-	Indicates that the GetList() call should return a list of the processes in
-	the system. The returned buffer will contain an array of 4-byte aligned
-	TProcessListEntry objects.
-
-	@see TProcessListEntry
-	*/
-	EProcesses = 0,
-	/**
-	Indicates that the GetList() call should return a list of the threads in
-	the system. The returned buffer will contain an array of 4-byte aligned
-	TThreadListEntry objects.
-
-	@see TThreadListEntry
-	*/
-	EThreads = 1,
-	/**
-	Indicates that the GetList() call should return a list of the code segments in
-	the system. The returned buffer will contain an array of 4-byte aligned
-	TCodeSegListEntry objects.
-
-	@see TCodeSegListEntry
-	*/
-	ECodeSegs = 2,
-	/**
-	Indicates that the GetList() call should return a list of the XIP libraries in
-	the system. The returned buffer will contain an array of 4-byte aligned
-	EXipLibraries objects.
-
-	@see EXipLibraries
-	*/
-	EXipLibraries = 3,
-	/**
-	Indicates that the GetList() call should return a list of the executables in
-	the system. The returned buffer will contain an array of 4-byte aligned
-	EExecutables objects.
-
-	@see EExecutables
-	*/
-	EExecutables = 4,
-	/**
-	Indicates that the GetList() call should return a list of the logical devices in the system.
-	*/
-	ELogicalDevices = 5,
-	/**
-	Indicates that the GetList() call should return a list of the mutexes in the system.
-	*/
-	EMutexes = 6,
-	/**
-	Indicates that the GetList() call should return a list of the servers in the system.
-	*/
-	EServers = 7,
-	/**
-	Indicates that the GetList() call should return a list of the sessions in the system.
-	*/
-	ESessions = 8,
-	/**
-	Indicates that the GetList() call should return a list of the semaphores in the system.
-	*/
-	ESemaphores = 9,
-	/**
-	Indicates that the GetList() call should return a list of the chunks in the system.
-	*/
-	EChunks = 10,
-
-	/**
-	Provides a complete list of all the breakpoints in the system and their
-	current state.
-
-	@see EBreakpoints
-	*/
-	EBreakpoints = 11,
-
-	/** 
-	The following are for the possible use of kernel-side debug and SMP breakpoint
-	manipulation.
-	*/
-	ESetBreak = 12,
-	ERemoveBreak = 13,
-	EModifyBreak = 14,
-	
-	/**
-	 * Provides static information of the system
-	 */
-	EStaticInfo = 15,
-
-	/** Last listing enum. */
-	EListLast
-	};
-
-/**
-  Bit field values denoting the scope of a listing.
-
-  In the debug functionality block, the TTag::iValue element which is returned for a listing tag
-  should be considered as a union of the supported values from this enumeration for that listing.
-  */
-enum TListScope
-	{
-	EScopeNone = 0x0,             /**< Corresponds to no scope for a listing. equivalent to not supported */
-	EScopeGlobal= 0x1,            /**< Corresponds to a global scope for a listing. */
-	EScopeProcessSpecific = 0x2,  /**< Corresponds to a process specific scope for a listing. */
-	EScopeThreadSpecific = 0x4    /**< Corresponds to a thread specific scope for a listing. */
-	};
-
-/**
-@internalComponent
-
-Interface constructor for passing IPC data for the GetList call.
-*/
-class TListDetails
-	{
-public:
-	TListDetails(const TListId aListId, const TListScope aListScope, TUint64 aTargetId=0)
-		: iListId(aListId),
-		  iListScope(aListScope),
-		  iTargetId(aTargetId) {}
-public:
-	TListId iListId;
-	TListScope iListScope;
-	TUint64 iTargetId;
-	};
-
-/** Debug Security Server Secure ID */
-const TUid KUidDebugSecurityServer = { 0x102834E2 };
-
-} // end of Debug namespace declaration
-
-// the remaining functionality in this file is intended for use on user side only
-#ifndef __KERNEL_MODE__
-
-#include <e32std.h>
-
-// API definition for Debug namespace appears elsewhere in this file.
-namespace Debug {
-
-/** The name of the Debug Security Server. */
-_LIT(KSecurityServerName,"DebugSecurityServer");
-
-// A version must be specified when creating a session with the server
-/** The Debug Security Server's major version number. */
-const TUint KDebugServMajorVersionNumber=2;
-/** The Debug Security Server's minor version number. */
-const TUint KDebugServMinorVersionNumber=4;
-/** The Debug Security Server's patch version number. */
-const TUint KDebugServPatchVersionNumber=0;
-
-/**
-Denotes how memory should be accessed
-*/
-enum TAccess
-	{
-	EAccess8 = 1,	/**< Currently unsupported, signifies 8 bit access. */
-	EAccess16 = 2,	/**< Currently unsupported, signifies 16 bit access. */
-	EAccess32 = 4	/**< Signifies 32 bit access. */
-	};
-
-/**
-Denotes how data should be interpreted
-*/
-enum TEndianess
-	{
-	EEndLE8 = 0,	/**< Signifies 8 bit little-endian. */
-	EEndBE8 = 1,	/**< Currently unsupported, signifies 8 bit big-endian. */
-	EEndBE32 = 2	/**< Currently unsupported, signifies 32 bit big-endian. */
-	};
-
-/**
-Structure used to store information about a memory operation
-
-@internalComponent
-*/
-class TMemoryInfo
-	{
-public:
-
-	TMemoryInfo(TUint32 aAddress=0, TUint32 aLength=0, TAccess aAccess=EAccess32, TEndianess aEndianess=EEndLE8)
-		: iAddress(aAddress),
-		  iSize(aLength),
-		  iAccess(aAccess),
-		  iEndianess(aEndianess)
-		{}
-
-public:
-
-	/**
-	Address to start reading/writing memory
-	*/
-	TUint32 iAddress;
-	/**
-	Number of bytes of memory to read/write
-	*/
-	TUint32	iSize;
-	/**
-	Access size for read/write
-	@see TAccess
-	*/
-	TAccess iAccess;
-	/**
-	Endianess to interpret data as
-	@see TEndianess
-	*/
-	TEndianess iEndianess;
-	};
-
-/**
-@internalComponent
-*/
-class TBreakInfo
-	{
-public:
-	TUint32 iAddress;
-	TArchitectureMode iArchitectureMode;
-	};
-
-/**
-@internalComponent
-
-Function codes (opcodes) used in message passing between client and server
-in this header file and what arguments should be passed with each of these
-*/
-enum TDebugServRqst
-	{
-	EDebugServOpen = 1,
-	EDebugServClose = 2,
-	EDebugServSuspendThread = 3,
-	EDebugServResumeThread = 4,
-	EDebugServReadMemory = 5,
-	EDebugServWriteMemory = 6,
-	EDebugServSetBreak = 7,
-	EDebugServClearBreak = 8,
-	EDebugServModifyBreak = 9,
-	EDebugServGetEvent = 10,
-	EDebugServCancelGetEvent = 11,
-	EDebugServAttachExecutable = 12,
-	EDebugServDetachExecutable = 13,
-	EDebugServGetDebugFunctionalityBufSize = 14,
-	EDebugServGetDebugFunctionality = 15,
-	EDebugServReadRegisters = 16,
-	EDebugServWriteRegisters = 17,
-	EDebugServSetEventAction = 18,
-	EDebugServBreakInfo = 19,
-	EDebugServGetList = 20,
-	EDebugServStep = 21,
-	EDebugServSetProcessBreak = 22,
-	EDebugServProcessBreakInfo = 23,
-	EDebugServKillProcess = 24,
-	EDebugServModifyProcessBreak = 25,
-	EDebugServReadCrashFlash = 26,
-	EDebugServWriteCrashFlash = 27,
-	EDebugServEraseCrashFlash = 28,
-	EDebugServEraseEntireCrashFlash = 29,
-	};
-
-/**
-Client side API to debug security server (DSS). Interaction with the DSS should
-be conducted through this class only.
-*/
-class RSecuritySvrSession : public RSessionBase
-	{
-public:
-	RSecuritySvrSession();
-	TVersion Version() const;
-
-	TInt Close();
-
-	TInt AttachExecutable(const TDesC& aProcessName, TBool aPassive);
-	TInt DetachExecutable(const TDesC& aProcessName);
-
-	TInt GetDebugFunctionalityBufSize(TUint32* aBufSize);
-	TInt GetDebugFunctionality(TDes8& aBuffer);
-
-	TInt SuspendThread(const TThreadId aThreadId);
-	TInt ResumeThread(const TThreadId aThreadId);
-
-	TInt ReadMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData, const TAccess aAccessSize, const TEndianess aEndianess);
-	TInt WriteMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData, const TAccess aAccessSize, const TEndianess aEndianess);
-
-	TInt ReadRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, TDes8& aRegisterValues, TDes8& aRegisterFlags);
-	TInt WriteRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, const TDesC8& aRegisterValues, TDes8& aRegisterFlags);
-
-	void GetEvent(const TDesC& aExecutableName, TRequestStatus &aStatus, TDes8& aEventInfo);
-	TInt CancelGetEvent(const TDesC& aExecutableName);
-
-	TInt SetEventAction(const TDesC& aExecutableName, TEventType aEvent, TKernelEventAction aEventAction);
-
-	TInt SetBreak( TBreakId &aId, const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
-	TInt ClearBreak(const TBreakId aBreakId);
-	TInt ModifyBreak(const TBreakId aBreakId, const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
-	TInt BreakInfo(const TBreakId aBreakId, TThreadId& aThreadId, TUint32& aAddress, TArchitectureMode& aMode);
-	TInt SetProcessBreak( TBreakId &aId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
-	TInt ProcessBreakInfo(const TBreakId aBreakId, TProcessId& aProcessId, TUint32& aAddress, TArchitectureMode& aMode);
-	TInt ModifyProcessBreak(const TBreakId aBreakId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
-			
-	TInt GetList(const TListId aListId, TDes8& aListData, TUint32& aDataSize);
-	TInt GetList(const TThreadId aThreadId, const TListId aListId, TDes8& aListData, TUint32& aDataSize);
-	TInt GetList(const TProcessId aProcessId, const TListId aListId, TDes8& aListData, TUint32& aDataSize);
-	TInt Step(const TThreadId aThreadId, TUint32 aNumSteps);
-	TInt KillProcess(const TProcessId aProcessId, const TInt aReason);
-	TInt ReadCrashLog(const TUint32 aPos, TDes8& aData, const TUint32 aDataSize);	
-	TInt WriteCrashConfig(const TUint32 aPos, const TDesC8& aBuffer, TUint32& aSize);
-	TInt EraseCrashLog(const TUint32 aPos, const TUint32 aBlockNumber);
-	TInt EraseCrashFlashPartition();
-	
-	TInt Connect(const TVersion aVersion);
-private:
-	TInt StartServer(void);
-	};
-/**
-Server session constructor
-*/
-inline RSecuritySvrSession::RSecuritySvrSession()
-	{
-
-	}
-
-/**
-Called by a client to create a session with the DSS. This method starts the
-DSS if it is not running, or connects to it if it already exists.
-
-@param aVersion version of the DSS to connect to
-
-@return KErrNone if a connection was successfully created, or one of the other
-system wide error codes
-*/
-inline TInt RSecuritySvrSession::Connect(const TVersion aVersion)
-	{
-	// default message slots for the server
-	const TUint KDefaultMessageSlots = 32;
-	TInt retry=2;
-	for (;;)
-		{
-		TInt r=CreateSession(KSecurityServerName, aVersion, KDefaultMessageSlots);
-		if (r!=KErrNotFound && r!=KErrServerTerminated)
-			{
-			return r;
-			}
-		if (--retry==0)
-			{
-			return r;
-			}
-		r=StartServer();
-		if (r!=KErrNone && r!=KErrAlreadyExists)
-			{
-			return r;
-			}
-		}
-	}
-
-/**
-  Start the server
-
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-inline TInt RSecuritySvrSession::StartServer()
-	{
-	// constants for the server
-	_LIT(KSecurityServerProcessName, "rm_debug_svr");
-	const TUidType serverUid(KNullUid, KNullUid, KUidDebugSecurityServer);
-
-	RProcess server;
-	TInt err = server.Create(KSecurityServerProcessName, KNullDesC, serverUid);
-
-	if(KErrNone != err)
-		{
-		return err;
-		}
-
-	// Synchronise with the process to make sure it hasn't died straight away
-	TRequestStatus stat;
-	server.Rendezvous(stat);
-	if (stat != KRequestPending)
-		{
-		// logon failed - server is not yet running, so cannot have terminated
-		server.Kill(0);             // Abort startup
-		}
-	else
-		{
-		// logon OK - start the server
-		server.Resume();
-		}
-
-	// Wait to synchronise with server - if it dies in the meantime, it
-	// also gets completed
-	User::WaitForRequest(stat);
-
-	// We can't use the 'exit reason' if the server panicked as this
-	// is the panic 'reason' and may be '0' which cannot be distinguished
-	// from KErrNone
-	err = (server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
-	server.Close();
-	return err;
-	}
-
-/**
-Get version of RSecuritySvrSession
-
-@return a TVersion object specifying the version
-*/
-inline TVersion RSecuritySvrSession::Version(void) const
-	{
-	return (TVersion(KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServPatchVersionNumber));
-	}
-
-/**
-Suspends execution of the specified thread.
-
-@param aThreadId thread ID of the thread to suspend
-
-@return KErrNone if there were no problems, KErrPermissionDenied if security 
-        check fails or KErrArgument if the thread does not exist
-*/
-inline TInt RSecuritySvrSession::SuspendThread(const TThreadId aThreadId)
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	TIpcArgs args(&threadIdPckg);
-
-	return SendReceive(EDebugServSuspendThread, args);
-	}
-
-/**
-Resumes execution of the specified thread.
-
-@param aThreadId thread ID of the thread to resume
-
-@return KErrNone if there were no problems, KErrPermissionDenied if security 
-        check fails or KErrArgument if the thread does not exist
-*/
-inline TInt RSecuritySvrSession::ResumeThread(const TThreadId aThreadId)
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	TIpcArgs args(&threadIdPckg);
-
-	return SendReceive(EDebugServResumeThread, args);
-	}
-
-/**
-Purpose:
-Set a thread-specific breakpoint in an attached process. 
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-
-@param aThreadId The thread id to which the breakpoint will apply.
-@param aAddress The virtual memory address at which to place the breakpoint.
-@param aArchitectureMode The kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
-@param aBreakId The address to which the assigned breakpoint ID will be written by this function
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::SetBreak( TBreakId &aBreakId,const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
-	{
-	TPtr8 breakIdPtr((TUint8*)&aBreakId, sizeof(aBreakId));
-
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-
-	TBreakInfo breakInfo;
-	breakInfo.iAddress = aAddress;
-	breakInfo.iArchitectureMode = aArchitectureMode;
-	TPckgBuf<TBreakInfo> breakInfoPckg(breakInfo);
-
-	//call driver to attempt to set break
-	TIpcArgs args(&threadIdPckg, &breakInfoPckg, &breakIdPtr);
-	return SendReceive(EDebugServSetBreak, args);
-	}
-
-/**
-Purpose:
-Clears a previously set thread-specific or process-specific breakpoint.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-
-@param aBreakId The TBreakId returned by a prior SetBreak call. Must have been set by the same Debug Agent.
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::ClearBreak(const TBreakId aBreakId)
-	{
-	TIpcArgs args(aBreakId);
-	return SendReceive(EDebugServClearBreak, args);
-	}
-
-/**
-Purpose:
-Modifies the properties of a previously set breakpoint.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-
-@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
-@param aThreadId the thread id of the thread to move the breakpoint to
-@param aAddress the virtual memory address at which to place the breakpoint.
-@param aArchitectureMode the kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::ModifyBreak(const TBreakId aBreakId, const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
-
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	TIpcArgs args(aBreakId,&threadIdPckg,aAddress,aArchitectureMode);
-	return SendReceive(EDebugServModifyBreak, args);
-	}
-
-/**
-Purpose:
-Modifies the properties of a previously set process breakpoint.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-
-@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
-@param aProcessId the process id of the process to move the breakpoint to
-@param aAddress the virtual memory address at which to place the breakpoint.
-@param aArchitectureMode the kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::ModifyProcessBreak(const TBreakId aBreakId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
-
-	{
-	TPckgBuf<TProcessId> processIdPckg(aProcessId);
-	TIpcArgs args(aBreakId,&processIdPckg,aAddress,aArchitectureMode);
-	return SendReceive(EDebugServModifyProcessBreak, args);
-	}
-
-/**
-Purpose:
-Returns the properties associated with a given TBreakId. The supplied break id must previously have been allocated
-to the debug agent by a SetBreak() call.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-@pre The aBreakId must have been previously returned by a SetBreak() call and not subsequently cleared by ClearBreak().
-
-@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
-@param aAddress on return contains the virtual memory address of the breakpoint
-@param aThreadId on return contains the thread id of the thread that the breakpoint is set in
-@param aMode on return contains the type of this breakpoint (e.g. ARM/Thumb/Thumb2EE)
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::BreakInfo(const TBreakId aBreakId, TThreadId& aThreadId, TUint32& aAddress, TArchitectureMode& aMode)
-	{
-	// temporary descriptors
-	TPtr8 threadId((TUint8*)&aThreadId,0,sizeof(TThreadId));
-	TPtr8 address((TUint8*)&aAddress,0,sizeof(TUint32));
-	TPtr8 mode((TUint8*)&aMode,0,sizeof(TArchitectureMode));
-
-	TIpcArgs args(aBreakId,&threadId,&address,&mode);
-	return SendReceive(EDebugServBreakInfo, args);
-	}
-
-/**
-Purpose:
-Set a process-specific breakpoint in an attached process. 
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-
-@param aProcessId The process id to which the breakpoint will apply.
-@param aAddress The virtual memory address at which to place the breakpoint.
-@param aArchitectureMode The kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
-@param aBreakId The address to which the assigned breakpoint ID will be written by this function
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::SetProcessBreak( TBreakId &aBreakId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
-	{
-	TPtr8 breakIdPtr((TUint8*)&aBreakId, sizeof(aBreakId));
-
-	TPckgBuf<TProcessId> threadIdPckg(aProcessId);
-
-	TBreakInfo breakInfo;
-	breakInfo.iAddress = aAddress;
-	breakInfo.iArchitectureMode = aArchitectureMode;
-	TPckgBuf<TBreakInfo> breakInfoPckg(breakInfo);
-
-	//call driver to attempt to set break
-	TIpcArgs args(&threadIdPckg, &breakInfoPckg, &breakIdPtr);
-	return SendReceive(EDebugServSetProcessBreak, args);
-	}
-
-/**
-Purpose:
-Returns the properties associated with a given TBreakId. The supplied break id must previously have been allocated
-to the debug agent by a SetProcessBreak() call.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-@pre The aBreakId must have been previously returned by a SetProcessBreak() call and not subsequently cleared by ClearBreak().
-
-@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
-@param aAddress on return contains the virtual memory address of the breakpoint
-@param aThreadId on return contains the thread id of the thread that the breakpoint is set in
-@param aMode on return contains the type of this breakpoint (e.g. ARM/Thumb/Thumb2EE)
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::ProcessBreakInfo(const TBreakId aBreakId, TProcessId& aProcessId, TUint32& aAddress, TArchitectureMode& aMode)
-	{
-	// temporary descriptors
-	TPtr8 processId((TUint8*)&aProcessId,0,sizeof(TProcessId));
-	TPtr8 address((TUint8*)&aAddress,0,sizeof(TUint32));
-	TPtr8 mode((TUint8*)&aMode,0,sizeof(TArchitectureMode));
-
-	TIpcArgs args(aBreakId,&processId,&address,&mode);
-	return SendReceive(EDebugServProcessBreakInfo, args);
-	}
-
-/**
-Purpose:
-Wait for an event to occur to the target executable being debugged. When an event
-occurs, the TRequestStatus is changed from KRequestPending.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-
-Note 1: Events are reported on a per-executable basis, not per-thread.
-
-Note 2: All the parameters must remain in scope until either CancelGetEvent is called, or
-until TRequestStatus is changed from KRequestPending. In practice, this generally
-means these parameters should not be based on the stack, as they may go out of
-scope before the call completes.
-
-Note 3: TIpcArgs args is allocated on the stack within this function, however,
-all the data containing in args is transferred in the SendReceive() so it can safely
-go out of scope after the call has been made.
-
-@param aExecutableName The name of any executable to which the Debug Agent is attached.
-@param aStatus Debug Agent request status variable.
-@param aEventInfo Descriptor containing a buffer sufficient for Event information.
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline void RSecuritySvrSession::GetEvent(const TDesC& aExecutableName, TRequestStatus &aStatus, TDes8& aEventInfo)
-	{
-	TIpcArgs args(&aExecutableName, &aEventInfo);
-
-	SendReceive(EDebugServGetEvent, args, aStatus );
-
-	}
- 
-/**
-Purpose:
-Cancel a previously issued asynchronous RSecuritySvrSession::GetEvent call. The previously
-issued call will immediately complete with the TRequestStatus = KErrCancel
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to the process specified by aProcessName
-@pre Debug Agent must have previously issued an RSecuritySvrSession::GetEvent() call.
-
-@param aExecutableName The name of the executable being debugged.
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::CancelGetEvent(const TDesC& aExecutableName)
-{
-	TIpcArgs args(&aExecutableName);
-
-	return SendReceive(EDebugServCancelGetEvent,args);
-}
-
-/**
-Called by a debug agent to request debug privileges for the executable with
-file name aExecutableName.
-
-@param aExecutableName a fully qualified file name of the executable to attach to
-@param aPassive if true then the agent has reduced debug rights.
-
-@return KErrNone if attached successfully, one of the other system wide error
-	codes otherwise
-*/
-inline TInt RSecuritySvrSession::AttachExecutable(const TDesC& aExecutableName, TBool aPassive)
-	{
-	TIpcArgs args((TInt)aPassive, &aExecutableName);
-	return SendReceive(EDebugServAttachExecutable, args);
-	}
-
-/**
-Called by a debug agent to detach from the executable with file
-name aExecutableName.
-
-@param aExecutableName the fully qualified file name of the executable to detach from
-
-@return KErrNone if detached successfully, one of the other system wide error
-	codes otherwise
-*/
-inline TInt RSecuritySvrSession::DetachExecutable(const TDesC& aExecutableName)
-	{
-	TIpcArgs args(&aExecutableName);
-	return SendReceive(EDebugServDetachExecutable, args);
-	}
-
-/**
-Close the session and thread
-
-@return KErrNone if the session is closed successfully, otherwise one of the system wide errors.
-*/
-inline TInt RSecuritySvrSession::Close()
-	{
-	RSessionBase::Close();
-	return KErrNone;
-	}
-
-/**
-Get buffer size required to contain Functionality text block.
-
-@see in-source documentation in rm_debug_api.h
-
-@param aBufSize function will fill this with the required buffer size
-
-@return KErrNone if the call succeeded, or one of the other system wide error
-        codes if the call failed
-*/
-inline TInt RSecuritySvrSession::GetDebugFunctionalityBufSize(TUint32 *aBufSize)
-	{	
-	TInt res = KErrNone;
-
-	TPtr8 stuff((TUint8*)aBufSize,4, 4);
-
-	TIpcArgs args(&stuff);
-
-	res = SendReceive(EDebugServGetDebugFunctionalityBufSize, args);
-	
-	return res;
-	}
-
-/**
-Get debug functionality text block and place it into aBuffer.
-
-The debug functionality block (DFBlock) is used to provide information about the functionality
-(i.e. features) which are supported by the rm_debug.ldd device driver.
-
-Calling this function with a suitably sized buffer aBuffer will result in the debug
-functionality information being stored in aBuffer. The necessary size of aBuffer can
-be determined by calling DebugFunctionalityBufSize().
-
-The format of the DFBlock is:
-
-@code
-Sub-block 0
-Sub-block 1
-...
-Sub-block N-1
-@endcode
-
-The data which will be returned by a call to GetDebugFunctionality() is constant so is
-guaranteed to fit exactly into the aBuffer allocated, assuming that the size of aBuffer
-corresponds to the value returned from GetDebugFunctionalityBufSize().
-
-Each sub-block is composed of a TTagHeader object followed by a C-style array of TTag objects.
-The sub-block contains information about a particular aspect of the debug sub-system, for example
-information about the manner in which memory can be accessed.
-The TTagHeader is comprised of an identifier which determines the type of data
-it contains, together with the number of TTag elements in the array following the TTagHeader.
-Each TTag in a sub-block has a unique ID, stored in the TTag::iTagId member variable.
-
-The only sub-block that is guaranteed to exist has TTagHeader::iTagHdrId = ETagHeaderIdCore, all other
-sub-blocks are optional. The ETagHeaderIdCore sub-block is the first sub-block within the DFBlock.
-Other sub-blocks may appear in any order after the ETagHeaderIdCore sub-block.
-
-The following is a diagrammatic representation of a sub-block the DFBlock:
-
-@code
-The HHHH represents the tag header ID of a sub-block (TTagHeader::iTagHdrId)
-The NNNN represents the number of TTag elements in the sub-block (TTagHeader::iNumTags)
-The IIIIIIII represents the ID of the TTag (TTag::iTagId)
-The TTTT represents the type of the TTag (TTag::iType)
-The SSSS represents the size of the TTag's associated data (TTag::iSize)
-The VVVVVVVV represents the TTag's value (TTag::iValue)
-
-0xNNNNHHHH	TTagHeader element for first sub-block (has N1 TTag elements)
-0xIIIIIIII	\
-0xSSSSTTTT	-- TTag 0
-0xVVVVVVVV	/
-0xIIIIIIII	\
-0xSSSSTTTT	-- TTag 1
-0xVVVVVVVV	/
-...
-0xIIIIIIII	\
-0xSSSSTTTT	-- TTag N1 - 1
-0xVVVVVVVV	/
-0xNNNNHHHH	TTagHeader element for second sub-block (has N2 TTag elements)
-0xIIIIIIII	\
-0xSSSSTTTT	-- TTag 0
-0xVVVVVVVV	/
-...
-0xIIIIIIII	\
-0xSSSSTTTT	-- TTag N2 - 1
-0xVVVVVVVV	/
-...
-0xNNNNHHHH	TTagHeader element for last sub-block (has NX TTag elements)
-0xIIIIIIII	\
-0xSSSSTTTT	-- TTag 0
-0xVVVVVVVV	/
-...
-0xIIIIIIII	\
-0xSSSSTTTT	-- TTag NX - 1
-0xVVVVVVVV	/
-@endcode
-
-The following example DFBlock contains two sub-blocks (values taken from enums below):
-- ETagHeaderIdCore
-- ETagHeaderIdMemory
-
-@code
-Binary		Meaning					Value
-
-0x000A0000	iTagHdrId, iNumTags		ETagHeaderIdCore, ECoreLast
-0x00000000	iTagId					ECoreEvents
-0x00000000	iType, iSize			ETagTypeBoolean, 0
-0x00000001	iValue					ETrue
-0x00000001	iTagId					ECoreStartStop
-0x00000000	iType, iSize			ETagTypeBoolean, 0
-0x00000001	iValue					ETrue
-...
-0x00000008	iTagId					ECoreHardware
-0x00000000	iType, iSize			ETagTypeBoolean, 0
-0x00000000	iValue					EFalse
-0x00000009	iTagId					ECoreApiConstants
-0x00000000	iType, iSize			ETagTypeBoolean, 0
-0x00000001	iValue					ETrue
-
-0x000A0001	iTagHdrId, iNumTags		ETagHeaderIdMemory, EMemoryLast
-0x00000000	iTagId					EMemoryRead
-0x00000000	iType, iSize			ETagTypeBoolean, 0
-0x00000001	iValue					ETrue
-0x00000001	iTagId					EMemoryWrite
-0x00000000	iType, iSize			ETagTypeBoolean, 0
-0x00000001	iValue					ETrue
-...
-0x00000008	iTagId					EMemoryLE8
-0x00000000	iType, iSize			ETagTypeBoolean, 0
-0x00000001	iValue					ETrue
-0x00000009	iTagId					EMemoryMaxBlockSize
-0x00000001	iType, iSize			ETagTypeTUint32, 0
-0x00004000	iValue					0x4000
-@endcode
-
-- Debug Agent DFBlock Processing:
-
-Debug Agents MUST understand and process the ETagHeaderIdCore block. The other
-blocks may be ignored if not recognised. Tags within each block may be ignored if
-not recognised.
-
-@pre aBuffer.MaxLength() >= *aBufSize where aBufSize is set by a call to: 
-     RSecuritySvrSession::GetDebugFunctionalityBufSize(TUint32 *aBufSize)
-
-@param aBuffer buffer to store functionality block in
-
-@return KErrNone if call succeeded, 
-        KErrNoMemory if temporary memory could not be allocated, 
-        KErrGeneral if debug functionality block could not be accessed
-*/
-inline TInt RSecuritySvrSession::GetDebugFunctionality(TDes8& aBuffer)
-	{
-	TIpcArgs args(&aBuffer);
-
-	TInt res = KErrNone;
-
-	res = SendReceive(EDebugServGetDebugFunctionality, args);
-
-	return res;
-	}
-
-/**
-Read a block of memory from the target debug thread defined by aThreadId.
-
-@pre the client should attach to the process containing the target thread
-@pre aData.MaxLength() >= aLength
-
-@param aThreadId thread ID of the thread to read memory from
-@param aAddress address to start reading memory from
-@param aLength number of bytes of memory to read
-@param aData descriptor to read memory into
-@param aAccessSize access size for memory reads, default is TAccess::EAccess32
-@param aEndianess interpretation of endianess of target data, default is
-       TEndianess::EEndLE8
-
-@return KErrNone if memory read successfully, or one of the other system wide error codes
-*/
-inline TInt RSecuritySvrSession::ReadMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData, const TAccess aAccessSize, const TEndianess aEndianess)
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	//set up memory info object
-	TMemoryInfo memoryInfo;
-	memoryInfo.iAddress = aAddress;
-	memoryInfo.iSize = aLength;
-	memoryInfo.iAccess = aAccessSize;
-	memoryInfo.iEndianess = aEndianess;
-
-	TPckgBuf<TMemoryInfo> pckg(memoryInfo);
-
-	TIpcArgs args(&threadIdPckg, &pckg, &aData);
-
-	return SendReceive(EDebugServReadMemory, args);
-	}
-
-/**
-Write a block of memory to the target debug thread defined by aThreadId.
-
-@pre the client should attach non-passively to the process containing the
-     target thread
-
-@param aThreadId thread ID of the thread to write memory to
-@param aAddress address to start writing memory at
-@param aLength number of bytes of memory to write
-@param aData descriptor to read memory from
-@param aAccessSize access size for memory writes, default is TAccess::EAccess32
-@param aEndianess interpretation of endianess of target data, default is
-       TEndianess::EEndLE8
-
-@return KErrNone if memory written successfully, or one of the other system wide error codes
-*/
-inline TInt RSecuritySvrSession::WriteMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData, const TAccess aAccessSize, const TEndianess aEndianess)
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	//create memory info object
-	TMemoryInfo memoryInfo;
-	memoryInfo.iAddress = aAddress;
-	memoryInfo.iSize = aLength;
-	memoryInfo.iAccess = aAccessSize;
-	memoryInfo.iEndianess = aEndianess;
-
-	TPckgBuf<TMemoryInfo> pckg(memoryInfo);
-
-	TIpcArgs args(&threadIdPckg, &pckg, &aData);
-
-	return SendReceive(EDebugServWriteMemory, args);
-	}
-
-/**
-Read register values from the thread with thread ID aThreadId. The IDs of the
-registers to read are stored as an array of TRegisterInfo objects in 
-aRegisterIds. If the nth register requested could be read then the value of the 
-register will be appended to aRegisterValues and EValid stored at 
-offset n in aRegisterFlags. If the register is supported but could not be read 
-then EInValid will be stored at offset n in aRegisterFlags and arbitrary data 
-appended in aRegisterValues. If reading the specified register is not
-supported by the kernel then ENotSupported will be stored at offset n in 
-aRegisterFlags and arbitrary data appended to aRegisterValues. If an unknown
-register is specified then EUnknown will be put in aRegisterFlags and 
-arbitrary data placed in aRegisterValues.
-
-@pre the client should attach to the process containing the target thread
-
-@see the register ID format is defined in: 
-     SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc
-
-@param aThreadId thread ID of the thread to read register values from
-@param aRegisterIds descriptor containing array of TFunctionalityRegister defined 
-       register IDs
-@param aRegisterValues descriptor to contain register values
-@param aRegisterFlags descriptor containing array of TUint8 flags, with values 
-       taken from TRegisterFlag
-
-@return KErrNone if registers were read successfully, or one of the other system wide error codes
-*/
-inline TInt RSecuritySvrSession::ReadRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, TDes8& aRegisterValues, TDes8& aRegisterFlags)
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	TIpcArgs args(&threadIdPckg, &aRegisterIds, &aRegisterValues, &aRegisterFlags);
-
-	return SendReceive(EDebugServReadRegisters, args);
-	}
-
-/**
-Write register values to the thread with thread ID aThreadId. The IDs of the 
-registers to write are stored as an array of TRegisterInfo objects in 
-aRegisterIds. The values to put in the registers are stored as an array of 
-objects in aRegisterValues. If the nth register to write could be 
-written then EValid stored at offset n in aRegisterFlags. If the register is 
-supported but could not be written then EInValid will be stored at offset n in 
-aRegisterFlags. If writing to the specified register is not supported by the 
-kernel then ENotSupported will be stored at offset n in aRegisterFlags. If an 
-unknown register is specified then EUnknown will be put in aRegisterFlags.
-
-@pre the client should attach non-passively to the process containing the 
-     target thread
-
-@see the register ID format is defined in: 
-     SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc
-
-@param aThreadId thread ID of the thread to write register values to
-@param aRegisterIds descriptor containing array of TFunctionalityRegister defined 
-       register IDs
-@param aRegisterValues descriptor containing array of register values
-@param aRegisterFlags descriptor containing array of TUint8 flags, with values 
-       taken from TRegisterFlag
-
-@return KErrNone if registers were written successfully, or one of the other system wide error codes
-*/
-inline TInt RSecuritySvrSession::WriteRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, const TDesC8& aRegisterValues, TDes8& aRegisterFlags)
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	TIpcArgs args(&threadIdPckg, &aRegisterIds, &aRegisterValues, &aRegisterFlags);
-
-	return SendReceive(EDebugServWriteRegisters, args);
-	}
-
-/**
-Purpose:
-Set the requisite actions to be taken when a particular event occurs.
-The events are defined in Debug::TEventType and the
-actions are defined in Debug::TKernelEventAction.
-
-The default action for all events is EActionIgnore.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to the executable specified by aExecutableName.
-
-Note: Event actions are on a per-executable basis. This is
-to ensure that events such as EEventStartThread are notified to the Debug
-Agent, even though the debug agent cannot be aware of the existence
-of a new thread at the time the event occurs.
-
-@param aExecutableName The name of the executable to which the Debug Agent is attached.
-@param aEvent A TEventType enum defined in rm_debug_api.h:Debug::TEventType
-@param aEventAction Any TKernelEventAction permitted by the DFBlock.
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::SetEventAction(const TDesC& aExecutableName, TEventType aEvent, TKernelEventAction aEventAction)
-{
-	TInt res = KErrNone;
-
-	TIpcArgs args(&aExecutableName,aEvent,aEventAction);
-
-	res = SendReceive(EDebugServSetEventAction, args);
-	
-	return res;
-}
-
-/**
-Returns a global listing corresponding to the type specified as aListId. The structure
-of the returned data depends on the value of aListId, see TListId for details.
-If aListData is not large enough to contain the listings data then
-the necessary buffer size is stored in aDataSize and the function returns
-KErrTooBig. In this case the contents of aListData will not contain useful data.
-
-Note that if the aListData buffer was too small to hold the data then the value
-returned as aDataSize corresponds to the size of the data at that particular
-instance. The size of the data will vary over time, for example the thread list
-will increase and decrease in size as threads are created and destroyed, so
-re-requesting data with a buffer with max length aDataSize will not necessarily
-succeed if a list has increased in size between the two calls.
-
-@see TListId
-
-@param aListId enum from TListId signifying which type of listing to return
-@param aListData buffer provided by the debug agent in which data can be returned by the debug system
-@param aDataSize if aListData was not large enough to contain the requested
-       data then the necessary buffer size is stored in aDataSize. If aListData
-       was large enough then the value of aDataSize is the length of aListData
-
-@return KErrNone if data was returned successfully,
-        KErrTooBig if aListData is too small to hold the data,
-	one of the other system-wide error codes
-*/
-inline TInt RSecuritySvrSession::GetList(const TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	//second argument of ETrue implies a global listing
-	TListDetails info(aListId, EScopeGlobal);
-	TPtr8 infoBuf((TUint8*)&info, sizeof(TListDetails), sizeof(TListDetails));
-	TPtr8 dataSizeBuf((TUint8*)&aDataSize, sizeof(TUint32), sizeof(TUint32));
-	TIpcArgs args(&infoBuf, &aListData, &dataSizeBuf);
-	return SendReceive(EDebugServGetList, args);
-	}
-
-/**
-Returns a thread-specific listing corresponding to the type specified as aListId. The structure
-of the returned data depends on the value of aListId, see TListId for details.
-If aListData is not large enough to contain the listings data then
-the necessary buffer size is stored in aDataSize and the function returns
-KErrTooBig. In this case the contents of aListData will not contain useful data.
-
-Note that if the aListData buffer is too small to hold the data then the value
-returned as aDataSize corresponds to the size of the data at that particular
-instant. The size of the data will vary over time, for example the thread list
-will increase and decrease in size as threads are created and destroyed, so
-re-requesting data with a buffer with max length aDataSize will not necessarily
-succeed if a list has increased in size between the two calls.
-
-@see TListId
-
-@param aThreadId thread to return the listing for
-@param aListId member of TListId signifying which type of listing to return
-@param aListData buffer provided by the debug agent in which data can be returned by the debug system.
-@param aDataSize if aListData was not large enough to contain the requested
-       data then the necessary buffer size is stored in aDataSize. If aListData
-       was large enough then the value of aDataSize is the length of aListData
-
-@return KErrNone if data was returned successfully,
-        KErrTooBig if aListData is too small to hold the data,
-	one of the other system-wide error codes
-*/
-inline TInt RSecuritySvrSession::GetList(const TThreadId aThreadId, const TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TListDetails info(aListId, EScopeThreadSpecific, aThreadId.Id());
-	TPtr8 infoBuf((TUint8*)&info, sizeof(TListDetails), sizeof(TListDetails));
-	TPtr8 dataSizeBuf((TUint8*)&aDataSize, sizeof(TUint32), sizeof(TUint32));
-	TIpcArgs args(&infoBuf, &aListData, &dataSizeBuf);
-	return SendReceive(EDebugServGetList, args);
-	}
-
-/**
-Returns a process-specific listing corresponding to the type specified as aListId. The structure
-of the returned data depends on the value of aListId, see TListId for details.
-If aListData is not large enough to contain the listings data then
-the necessary buffer size is stored in aDataSize and the function returns
-KErrTooBig. In this case the contents of aListData will not contain useful data.
-
-Note that if the aListData buffer is too small to hold the data then the value
-returned as aDataSize corresponds to the size of the data at that particular
-instant. The size of the data will vary over time, for example the thread list
-will increase and decrease in size as threads are created and destroyed, so
-re-requesting data with a buffer with max length aDataSize will not necessarily
-succeed if a list has increased in size between the two calls.
-
-@see TListId
-
-@param aProcessId process to return the listing for
-@param aListId member of TListId signifying which type of listing to return
-@param aListData buffer provided by the debug agent in which data can be returned by the debug system.
-@param aDataSize if aListData was not large enough to contain the requested
-       data then the necessary buffer size is stored in aDataSize. If aListData
-       was large enough then the value of aDataSize is the length of aListData
-
-@return KErrNone if data was returned successfully,
-        KErrTooBig if aListData is too small to hold the data,
-	one of the other system-wide error codes
-*/
-inline TInt RSecuritySvrSession::GetList(const TProcessId aProcessId, const TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TListDetails info(aListId, EScopeProcessSpecific, aProcessId.Id());
-	TPtr8 infoBuf((TUint8*)&info, sizeof(TListDetails), sizeof(TListDetails));
-	TPtr8 dataSizeBuf((TUint8*)&aDataSize, sizeof(TUint32), sizeof(TUint32));
-	TIpcArgs args(&infoBuf, &aListData, &dataSizeBuf);
-	return SendReceive(EDebugServGetList, args);
-	}
-
-/**
-Purpose:
-Step one or more CPU instructions in the specified thread from the current PC.
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-@pre The thread being stepped must be suspended by the Debug Agent.
-
-@param aThreadId the id of the thread which is to be stepped
-@param aNumSteps how many machine-level instructions are to be stepped.
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::Step(const TThreadId aThreadId, const TUint32 aNumSteps)
-	{
-	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
-	TInt res = KErrNone;
-
-	TIpcArgs args(&threadIdPckg,aNumSteps);
-
-	res = SendReceive(EDebugServStep,args);
-
-	return res;
-	}
-
-/**
-Purpose:
-Kill the specified process with the supplied reason. Reason codes are equivalent
-to those in RProcess.Kill().
-
-@pre Debug Agent must be connected to the debug security server
-@pre Debug Agent must be attached to a process.
-
-@param aProcessId the id of the process which is to be killed
-@param aReason The reason to be associated with the ending of this process
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::KillProcess(const TProcessId aProcessId, const TInt aReason)
-	{
-	TPckgBuf<TProcessId> processIdPckg(aProcessId);
-	TInt res = KErrNone;
-
-	TIpcArgs args(&processIdPckg,aReason);
-
-	res = SendReceive(EDebugServKillProcess,args);
-
-	return res;
-	}
-
-/**
-Purpose
-Method to read data from the crash flash
-
-@pre aData buffer to retrieve the data from the crash flash
-@pre aDataSize Size of the data
-
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::ReadCrashLog(const TUint32 aPos, TDes8& aData, const TUint32 aDataSize)
-	{		
-		TIpcArgs args(aPos, &aData, aDataSize);		
-		TInt res = SendReceive(EDebugServReadCrashFlash,args);
-		return res;
-	}
-
-/**
- * @internalTechnology
- * @prototype
- * 
-Purpose:
-Method to write the crash flash config
-
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::WriteCrashConfig(const TUint32 aPos, const TDesC8& aBuffer, TUint32& aSize)
-	{
-		TPtr8 sizePtr((TUint8*)&aSize,4, 4);
-		TIpcArgs args(aPos, &aBuffer, &sizePtr);
-		TInt res = SendReceive(EDebugServWriteCrashFlash, args);
-		return res;
-	}
-/**
-Purpose:
-Method to erase a block in the crash flash
-
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::EraseCrashLog(const TUint32 aPos, const TUint32 aBlockNumber)
-	{	
-		TIpcArgs args(aPos, aBlockNumber);
-		TInt res = SendReceive(EDebugServEraseCrashFlash, args);
-		return res;
-	}
-
-/**
-Purpose:
-Method to erase entire flash partition
-
-@return Any error which may be returned by RSessionBase::SendReceive()
-*/
-inline TInt RSecuritySvrSession::EraseCrashFlashPartition()
-	{
-	TInt res = SendReceive(EDebugServEraseEntireCrashFlash);
-	return res;
-	}
-
-} // end of Debug namespace declaration
-
-#endif // #ifndef __KERNEL_MODE__
-
-#endif // RM_DEBUG_API_H
-
-
-
--- a/kernel/eka/include/sm_debug_api.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/sm_debug_api.h	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-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"
@@ -23,11 +23,1454 @@
 #ifndef D_STOP_MODE_API_H
 #define D_STOP_MODE_API_H
 
-#include <rm_debug_api.h>
 #include <plat_priv.h>
+#include <e32cmn.h>
+#include <e32def_private.h>
+
 
 namespace Debug
-	{
+    {
+
+
+/** This is the maximum size in bytes a user trace can be */
+const TInt TUserTraceSize = 256;
+
+/**
+  Information in the debug functionality block is represented as a concatenation
+  of pairs of TTagHeader structures and arrays of TTag objects.
+  @see TTagHeader
+  @see RSecuritySvrSession::GetDebugFunctionality
+  */
+struct TTag
+{
+    /** Tag ID, value identifying this tag. */
+    TUint32 iTagId;
+    /**
+      Values correspond to TTagType enumerators.
+      @see TTagType
+      */
+    TUint16 iType;
+    /** Size of external data associated with this tag. */
+    TUint16 iSize;
+    /** Data associated with this tag. */
+    TUint32 iValue;
+};
+
+/**
+  Enumeration defining the supported tag types. These enumerators are used in TTag.iTagId.
+  @see TTag
+  */
+enum TTagType
+{
+    /** Indicates that the iValue field of a TTag structure will contain either ETrue or EFalse. */
+    ETagTypeBoolean = 0,
+    /** Indicates that the iValue field of a TTag structure will contain a value in the TUint32 range. */
+    ETagTypeTUint32 = 1,
+    /** Indicates that the iValue field of a TTag structure will contain values from an enumeration. */
+    ETagTypeEnum = 2,
+    /** Indicates that the iValue field of a TTag structure should be interpreted as a bit field. */
+    ETagTypeBitField = 3,
+    /** Indicates that the type of the iValue field of a TTag structure is unknown. */
+    ETagTypeUnknown = 4,
+    /** Indicates that the iValue field of a TTag structure will contain a pointer. */
+    ETagTypePointer = 5
+};
+
+/**
+  Information in the debug functionality block is represented as a concatenation
+  of pairs of TTagHeader structures and arrays of TTag objects.
+  @see TTag
+  @see RSecuritySvrSession::GetDebugFunctionality
+  */
+struct TTagHeader
+{
+    /** Value identifying the contents of this TTagHeader, should be interpreted as an enumerator from TTagHeaderId.
+      @see TTagHeaderId
+      */
+    TUint16 iTagHdrId;
+    /** The number of TTag elements in the array associated with this TTagHeader. */
+    TUint16 iNumTags;
+};
+
+/**
+  Enumeration used to identify TTagHeader structures, TTagHeader::iTagHdrId elements take these enumerators as values.
+  @see TTagHeader
+  */
+enum TTagHeaderId
+{
+    ETagHeaderIdCore = 0,            /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityCore. */
+    ETagHeaderIdMemory = 1,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityMemory. */
+    /**
+      Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister.
+      These values are defined as in the document Symbian Core Dump File Format Appendix C
+      (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
+      The TTag objects in the associated array have an iSize value corresponding to the size of the register's data in bytes.
+      */
+    ETagHeaderIdRegistersCore = 2,
+    /**
+      Identifies a TTagHeader with associated TTag elements with iTagId values corresponding to coprocessor register identifiers.
+      Coprocessor registers are defined as in the document Symbian Core Dump File Format Appendix C as follows
+      (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc):
+
+      For each 32-bit data word defining a co-pro register, the definition of the meaning of the bits follows
+      the ARM Architecture Reference manual instruction coding
+
+      Upper Halfword    Lower Halfword
+      Opcode 2          CRm
+
+      For example: The Domain Access Control Register is Register 3 of co-processor 15. The encoding is therefore
+      CRm = 3
+      Opcode2 = 0
+
+      Therefore the functionality tag would be:
+      TagID:  15            // co-processor number
+      Type: ETagTypeTUint32
+      Data: 0x00000003      // Opcode2 = 0, CRm = 3
+      */
+    ETagHeaderIdCoProRegisters = 3,  /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister. */
+    ETagHeaderIdBreakpoints = 4,     /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityBreakpoint. */
+    ETagHeaderIdStepping = 5,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStep. */
+    ETagHeaderIdExecution = 6,       /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityExec. */
+    ETagHeaderIdEvents = 7,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TEventType. */
+    ETagHeaderIdApiConstants = 8,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityApiConstants.*/
+    ETagHeaderList = 9,              /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TListId. */
+    ETagHeaderIdKillObjects = 10,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityKillObject. */
+    ETagHeaderIdSecurity = 11,       /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalitySecurity */
+    ETagHeaderIdBuffers = 12,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TBufferType. */
+    ETagHeaderIdStopModeFunctions = 13, /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStopModeFunctions. */  
+};
+
+/**
+  This structure is not used in the run-mode debug API.
+  @deprecated
+  */
+struct TSubBlock
+{
+    /** Header to identify the TSubBlock. */
+    TTagHeader iHeader;
+    /** Pointer to array of TTag values associated with this TSubBlock. */
+    TTag* iTagArray;
+};
+
+/**
+  These tags define what kinds of core functionality are supported by the run-mode debug subsystem.
+  TTag structures associated with the ETagHeaderIdCore sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+  */
+enum TFunctionalityCore
+{
+    ECoreEvents = 0,        /**< Indicates whether events processing is supported. */
+    ECoreStartStop = 1,     /**< Indicates whether suspending and resuming threads is supported. */
+    ECoreMemory = 2,        /**< Indicates whether reading and writing memory is supported. */
+    ECoreRegister = 3,      /**< Indicates whether reading and writing register values is supported. */
+    ECoreBreakpoint = 4,    /**< Indicates whether breakpoints are supported. */
+    ECoreStepping = 5,      /**< Indicates whether stepping is supported. */
+    ECoreLists = 6,         /**< Indicates whether listings are supported. */
+    ECoreLogging = 7,       /**< Indicates whether logging is supported. */
+    ECoreHardware = 8,      /**< Indicates whether hardware support is supported. */
+    ECoreApiConstants = 9,  /**< Indicates whether the information in the ETagHeaderIdApiConstants sub-block is relevant. */
+    ECoreKillObjects = 10,  /**< Indicates whether killing objects (i.e. threads and processes) is supported. */
+    ECoreSecurity = 11,     /**< Indicates whether OEM Debug token support or other security info is supported. */
+    ECoreStopModeFunctions = 12, /**< Indicates whether Stop Mode function calling is supported. */
+    ECoreStopModeBuffers = 13, /**< Indicates whether Stop Mode buffers are supported. */
+    
+    /**
+      @internalTechnology
+      A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
+      */
+    ECoreLast
+};
+
+/**
+  These tags define what kind of memory operations can be performed.
+  TTag structures associated with the ETagHeaderIdMemory sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityMemory
+{
+    EMemoryRead = 0,          /**< Indicates whether reading memory is supported. */
+    EMemoryWrite = 1,         /**< Indicates whether writing memory is supported. */
+    EMemoryAccess64 = 2,      /**< Indicates whether 64 bit memory access is supported. */
+    EMemoryAccess32 = 3,      /**< Indicates whether 32 bit memory access is supported. */
+    EMemoryAccess16 = 4,      /**< Indicates whether 16 bit memory access is supported. */
+    EMemoryAccess8 = 5,       /**< Indicates whether 8 bit memory access is supported. */
+    EMemoryBE8 = 6,           /**< Indicates whether reading memory as 8 bit big-endian values is supported. */
+    EMemoryBE32 = 7,          /**< Indicates whether reading memory as 32 bit big-endian values is supported. */
+    EMemoryLE8 = 8,           /**< Indicates whether reading memory as 8 bit little-endian values is supported. */
+    EMemoryMaxBlockSize = 9,  /**< Corresponds to the maximum size of a block of memory which can be requested. */
+    /**
+      @internalTechnology
+      A debug agent should find the number of memory tags from the DFBlock rather than this enumerator.
+      */
+    EMemoryLast
+};
+
+/**
+  These tags define which objects can be killed by the device driver.
+  TTag structures associated with the ETagHeaderIdKillObjects sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityKillObject
+{
+    EFunctionalityKillThread = 0,          /**< Indicates whether killing threads is supported. */
+    EFunctionalityKillProcess = 1,         /**< Indicates whether killing processes is supported. */
+    /**
+      @internalTechnology
+      A debug agent should find the number of kill object tags from the DFBlock rather than this enumerator.
+      */
+    EFunctionalityKillObjectLast
+};
+
+/**
+  A TTag with an id from the TFunctionalityRegister enum will have a value from this enumeration.
+  The values define how a register can be accessed, if at all.
+ */
+enum TFunctionalityAccess
+{
+    EAccessNone = 0,       /**< Indicates that a register cannot be accessed. */
+    EAccessReadOnly = 1,   /**< Indicates that a register can be read, but not written to. */
+    EAccessWriteOnly = 2,  /**< Indicates that a register can be written to, but not read. */
+    EAccessReadWrite = 3,  /**< Indicates that a register can be both read and written to. */
+    EAccessUnknown = 4,    /**< Indicates that it is unspecified whether reading or writing to a register is possible. */
+};
+
+/**
+  These enumerators act as core register identifiers.
+  TTag structures associated with the ETagHeaderIdRegistersCore sub-block will have iTagId values from this enumeration.
+  The numeric value of each enumerator identifies the register according to the definitions in the Symbian Core Dump File Format Appendix B
+  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
+  */
+enum TFunctionalityRegister
+{
+    ERegisterR0 = 0x00000000,      /**< Identifier for user mode register R0. */
+    ERegisterR1 = 0x00000100,      /**< Identifier for user mode register R1. */
+    ERegisterR2 = 0x00000200,      /**< Identifier for user mode register R2. */
+    ERegisterR3 = 0x00000300,      /**< Identifier for user mode register R3. */
+    ERegisterR4 = 0x00000400,      /**< Identifier for user mode register R4. */
+    ERegisterR5 = 0x00000500,      /**< Identifier for user mode register R5. */
+    ERegisterR6 = 0x00000600,      /**< Identifier for user mode register R6. */
+    ERegisterR7 = 0x00000700,      /**< Identifier for user mode register R7. */
+    ERegisterR8 = 0x00000800,      /**< Identifier for user mode register R8. */
+    ERegisterR9 = 0x00000900,      /**< Identifier for user mode register R9. */
+    ERegisterR10 = 0x00000a00,     /**< Identifier for user mode register R10. */
+    ERegisterR11 = 0x00000b00,     /**< Identifier for user mode register R11. */
+    ERegisterR12 = 0x00000c00,     /**< Identifier for user mode register R12. */
+    ERegisterR13 = 0x00000d00,     /**< Identifier for user mode register R13. */
+    ERegisterR14 = 0x00000e00,     /**< Identifier for user mode register R14. */
+    ERegisterR15 = 0x00000f00,     /**< Identifier for user mode register R15. */
+    ERegisterCpsr = 0x00001000,    /**< Identifier for CPSR. */
+    ERegisterR13Svc = 0x00001100,  /**< Identifier for R13 supervisor mode banked register. */
+    ERegisterR14Svc = 0x00001200,  /**< Identifier for R14 supervisor mode banked register. */
+    ERegisterSpsrSvc = 0x00001300, /**< Identifier for SPSR supervisor mode banked register. */
+    ERegisterR13Abt = 0x00001400,  /**< Identifier for R13 Abort mode banked register. */
+    ERegisterR14Abt = 0x00001500,  /**< Identifier for R14 Abort mode banked register. */
+    ERegisterSpsrAbt = 0x00001600, /**< Identifier for SPSR Abort mode banked register. */
+    ERegisterR13Und = 0x00001700,  /**< Identifier for R13 Undefined mode banked register. */
+    ERegisterR14Und = 0x00001800,  /**< Identifier for R14 Undefined mode banked register. */
+    ERegisterSpsrUnd = 0x00001900, /**< Identifier for SPSR Undefined mode banked register. */
+    ERegisterR13Irq = 0x00001a00,  /**< Identifier for R13 Interrupt mode banked register. */
+    ERegisterR14Irq = 0x00001b00,  /**< Identifier for R14 Interrupt mode banked register. */
+    ERegisterSpsrIrq = 0x00001c00, /**< Identifier for SPSR Interrupt mode banked register. */
+    ERegisterR8Fiq = 0x00001d00,   /**< Identifier for R8 Fast Interrupt mode banked register. */
+    ERegisterR9Fiq = 0x00001e00,   /**< Identifier for R9 Fast Interrupt mode banked register. */
+    ERegisterR10Fiq = 0x00001f00,  /**< Identifier for R10 Fast Interrupt mode banked register. */
+    ERegisterR11Fiq = 0x00002000,  /**< Identifier for R11 Fast Interrupt mode banked register. */
+    ERegisterR12Fiq = 0x00002100,  /**< Identifier for R12 Fast Interrupt mode banked register. */
+    ERegisterR13Fiq = 0x00002200,  /**< Identifier for R13 Fast Interrupt mode banked register. */
+    ERegisterR14Fiq = 0x00002300,  /**< Identifier for R14 Fast Interrupt mode banked register. */
+    ERegisterSpsrFiq = 0x00002400, /**< Identifier for SPSR Fast Interrupt mode banked register. */
+    /**
+      @internalTechnology
+      A debug agent should find the number of core registers from the DFBlock rather than this enumerator.
+      */
+    ERegisterLast = 37
+};
+
+
+/**
+  These tags define the kind of breakpoints that are supported.
+  TTag structures associated with the ETagHeaderIdBreakpoints sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityBreakpoint
+{
+    EBreakpointThread = 0,         /**< Indicates whether thread specific breakpoints are supported. */
+    EBreakpointProcess = 1,        /**< Indicates whether process specific breakpoints are supported. */
+    EBreakpointSystem = 2,         /**< Indicates whether system wide breakpoints are supported. */
+    EBreakpointArm = 3,            /**< Indicates whether ARM mode breakpoints are supported. */
+    EBreakpointThumb = 4,          /**< Indicates whether Thumb mode breakpoints are supported. */
+    EBreakpointT2EE = 5,           /**< Indicates whether Thumb2 mode breakpoints are supported. */
+    EBreakpointArmInst = 6,        /**< Reserved for future use. */
+    EBreakpointThumbInst = 7,      /**< Reserved for future use. */
+    EBreakpointT2EEInst = 8,       /**< Reserved for future use. */
+    EBreakpointSetArmInst = 9,     /**< Reserved for future use. */
+    EBreakpointSetThumbInst = 10,  /**< Reserved for future use. */
+    EBreakpointSetT2EEInst = 11,   /**< Reserved for future use. */
+    /**
+      @internalTechnology
+      A debug agent should find the number of breakpoint tags from the DFBlock rather than this enumerator.
+      */
+    EBreakpointLast
+};
+
+/**
+  These enumerators provide information about the stepping capabilities of the debug sub-system.
+  TTag structures associated with the ETagHeaderIdStepping sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityStep
+{
+    EStep = 0, /**< Indicates whether instruction stepping is supported. */
+    /**
+      @internalTechnology
+      A debug agent should find the number of stepping tags from the DFBlock rather than this enumerator.
+      */
+    EStepLast
+};
+
+/**
+  These enumerators provide information about the execution control capabilities of the debug sub-system.
+  TTag structures associated with the ETagHeaderIdExecution sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityExec
+{
+    EExecThreadSuspendResume = 0,  /**< Indicates whether suspending and resuming threads is supported. */
+    EExecProcessSuspendResume = 1, /**< Indicates whether suspending and resuming processes is supported. */
+    EExecSystemSuspendResume = 2,  /**< Indicates whether suspending and resuming the entire system is supported. */
+    /**
+      @internalTechnology
+      A debug agent should find the number of execution control tags from the DFBlock rather than this enumerator.
+      */
+    EExecLast
+};
+
+/**
+  This enumeration defines the event types supported by the debug sub-system.
+  TTag structures associated with the ETagHeaderIdEvents sub-block will have
+  iTagId values from this enumeration, and iValue values from the TKernelEventAction enumeration.
+
+  These enumerators are also used by the RSecuritySvrSession API to identify events.
+  @see RSecuritySvrSession
+  @see TKernelEventAction
+ */
+enum TEventType
+{
+    EEventsBreakPoint = 0,    /**< Identifies a breakpoint event. */
+    EEventsSwExc = 1,         /**< Identifies a software exception event. */
+    EEventsHwExc = 2,         /**< Identifies a hardware exception event. */
+    EEventsKillThread = 3,    /**< Identifies a kill thread event. */
+    EEventsAddLibrary = 4,    /**< Identifies an add library event. */
+    EEventsRemoveLibrary = 5, /**< Identifies a remove library event. */
+    /**
+     If an event is generated and there is only a single space remaining in the events queue then
+     an event of type EEventsBufferFull will be stored in the queue and the generated event will
+     be discarded. If further events occur while the buffer is full the events will be discarded.
+     As such an event of type EEventsBufferFull being returned signifies that one or more events
+     were discarded. An event of this type has no valid data associated with it.
+     */
+    EEventsBufferFull = 6,
+    EEventsUnknown = 7,       /**< Identifies an event of unknown type. */
+    EEventsUserTrace = 8,     /**< Identifies a user trace. */
+    EEventsProcessBreakPoint = 9, /**< Identifies a process breakpoint event. */
+    EEventsStartThread = 10, /**< Identifies a start thread event. */
+    EEventsUserTracesLost = 11, /**< Identifies user traces being lost. */
+    EEventsAddProcess = 12, /**< Identifies an AddProcess event */
+    EEventsRemoveProcess = 13, /**< Identifies a RemoveProcess event */
+    /**
+      @internalTechnology
+      A debug agent should find the number of event types from the DFBlock rather than this enumerator.
+      */
+    EEventsLast
+};
+
+/**
+  These enumerators provide information about constants which are used in the RSecuritySvrSession API.
+  TTag structures associated with the ETagHeaderIdApiConstants sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityApiConstants
+    {
+    /**
+      Corresponds to the size of a buffer required to store a TEventInfo.
+      @see TEventInfo
+      */
+    EApiConstantsTEventInfoSize = 0,
+    /**
+      @internalTechnology
+      A debug agent should find the number of API constants tags from the DFBlock rather than this enumerator.
+      */
+    EApiConstantsLast,
+    };
+
+/**
+  The set of possible actions which could be taken when a kernel event occurs.
+  Not all actions are possible for all events. The debug functionality sub-block with header id ETagHeaderIdEvents
+  indicates which values are permitted for each event. The value given for that event should be
+  considered as the most intrusive action the debugger may set: with the definition that EActionSuspend is more
+  intrusive than EActionContinue, which is more intrusive than EActionIgnore.
+  @see RSecuritySvrSession
+  */
+enum TKernelEventAction
+{
+    /** If an event action is set to this value then events of that type will be
+      ignored, and not reported to the debugger. */
+    EActionIgnore = 0,
+    /** If an event action is set to this value then events of that type will be
+      reported to the debugger and the thread which generated the event will be
+      allowed to continue executing. */
+    EActionContinue = 1,
+    /** If an event action is set to this value then events of that type will be
+      reported to the debugger and the thread which generated the event will be
+      suspended. */
+    EActionSuspend = 2,
+    /**
+      @internalTechnology
+      Count of event actions.
+      */
+    EActionLast
+};
+
+/**
+  These enumerators provide information about the ability of the debug subsystem to support OEM Debug tokens.
+  TTag structures associated with the ETagHeaderIdSecurity sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalitySecurity
+{
+    ESecurityOEMDebugToken = 0,  /**< Indicates whether the DSS supports the use of OEM Debug Tokens. */
+
+    /**
+      @internalTechnology
+      A debug agent should find the number of tags from the DFBlock rather than this enumerator.
+      */
+    ESecurityLast
+};
+
+/**
+  Used for storing the contents of a 32 bit register
+  */
+typedef TUint32 TRegisterValue32;
+
+
+/**
+ * Processor mode
+ */
+enum TArmProcessorModes
+{
+    EUserMode=0x10,     //!< EUserMode
+    EFiqMode=0x11,      //!< EFiqMode
+    EIrqMode=0x12,      //!< EIrqMode
+    ESvcMode=0x13,      //!< ESvcMode
+    EAbortMode=0x17,    //!< EAbortMode
+    EUndefMode=0x1b,    //!< EUndefMode
+    EMaskMode=0x1f      //!< EMaskMode
+};
+
+
+
+/**
+  Structure containing information about the state of the registers when a
+  hardware exception occurred
+  */
+class TRmdArmExcInfo
+    {
+public:
+    /** Enumeration detailing the types of exception which may occur. */
+    enum TExceptionType
+        {
+        /** Enumerator signifying that a prefetch abort error has occurred. */
+        EPrefetchAbort = 0,
+        /** Enumerator signifying that a data abort error has occurred. */
+        EDataAbort = 1,
+        /** Enumerator signifying that an undefined instruction error has occurred. */
+        EUndef =2
+        };
+
+    /** Value of CPSR. */
+    TRegisterValue32 iCpsr;
+    /** Type of exception which has occurred. */
+    TExceptionType iExcCode;
+    /** Value of R13 supervisor mode banked register. */
+    TRegisterValue32 iR13Svc;
+    /** Value of user mode register R4. */
+    TRegisterValue32 iR4;
+    /** Value of user mode register R5. */
+    TRegisterValue32 iR5;
+    /** Value of user mode register R6. */
+    TRegisterValue32 iR6;
+    /** Value of user mode register R7. */
+    TRegisterValue32 iR7;
+    /** Value of user mode register R8. */
+    TRegisterValue32 iR8;
+    /** Value of user mode register R9. */
+    TRegisterValue32 iR9;
+    /** Value of user mode register R10. */
+    TRegisterValue32 iR10;
+    /** Value of user mode register R11. */
+    TRegisterValue32 iR11;
+    /** Value of R14 supervisor mode banked register. */
+    TRegisterValue32 iR14Svc;
+    /** Address which caused exception (System Control Coprocessor Fault Address Register) */
+    TRegisterValue32 iFaultAddress;
+    /** Value of System Control Coprocessor Fault Status Register. */
+    TRegisterValue32 iFaultStatus;
+    /** Value of SPSR supervisor mode banked register. */
+    TRegisterValue32 iSpsrSvc;
+    /** Value of user mode register R13. */
+    TRegisterValue32 iR13;
+    /** Value of user mode register R14. */
+    TRegisterValue32 iR14;
+    /** Value of user mode register R0. */
+    TRegisterValue32 iR0;
+    /** Value of user mode register R1. */
+    TRegisterValue32 iR1;
+    /** Value of user mode register R2. */
+    TRegisterValue32 iR2;
+    /** Value of user mode register R3. */
+    TRegisterValue32 iR3;
+    /** Value of user mode register R12. */
+    TRegisterValue32 iR12;
+    /** Value of user mode register R15, points to instruction which caused exception. */
+    TRegisterValue32 iR15;
+    };
+
+/**
+  The maximum size, in bytes, of the panic category string returned as part of a
+  TEventInfo object.
+
+  @see TEventInfo
+  @see TThreadKillInfo
+  */
+const TInt KPanicCategoryMaxName = KMaxName;
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  an agent set breakpoint is hit.
+  */
+class TThreadBreakPointInfo
+    {
+public:
+    /** Identifies the type of exception. */
+    TExcType iExceptionNumber;
+    /** Structure containing information about the ARM register values. */
+    TRmdArmExcInfo iRmdArmExcInfo;
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a software exception occurs.
+  */
+class TThreadSwExceptionInfo
+    {
+public:
+    /** The value of the program counter. */
+    TUint32 iCurrentPC;
+    /** Identifies the type of exception. */
+    TExcType iExceptionNumber;
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a hardware exception occurs.
+  */
+class TThreadHwExceptionInfo
+    {
+public:
+    /** Identifies the type of exception. */
+    TExcType iExceptionNumber;
+    /** Structure containing information about the ARM register values. */
+    TRmdArmExcInfo iRmdArmExcInfo;
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a thread kill event occurs.
+  */
+class TThreadKillInfo
+    {
+public:
+    /** The value of the program counter. */
+    TUint32 iCurrentPC;
+    /** Specifies the reason for the kill thread event, this value is specific to the killed thread and does not correspond to a standard Symbian enumeration. */
+    TInt iExitReason;
+    /** Specifies the type of the thread kill event, values correspond to elements of TExitType. */
+    TUint8 iExitType;
+    /** The panic category of the killed thread. */
+    TUint8 iPanicCategory[KPanicCategoryMaxName];
+    /** Contains the length in bytes of the initialised data in iPanicCategory. */
+    TInt iPanicCategoryLength;
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a library load event occurs.
+  */
+class TLibraryLoadedInfo
+    {
+public:
+    /** The name of the file that the library was loaded from. */
+    TUint8 iFileName[KMaxName];
+    /** Contains the length in bytes of the initialised data in iFileName. */
+    TInt iFileNameLength;
+    /** The code base address (.text). */
+    TUint32 iCodeAddress;
+    /** The base address of the initialised data section (.data). */
+    TUint32 iDataAddress;
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a thread is started
+  */
+class TStartThreadInfo
+    {
+public:
+    /** The name of the file that the process owning the thread was created from. */
+    TUint8 iFileName[KMaxName];
+    /** Contains the length in bytes of the initialised data in iFileName. */
+    TInt iFileNameLength;
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a process is added. Note that the Process may not be fully constructed,
+  e.g. no threads.
+  */
+class TAddProcessInfo
+    {
+public:
+    /** The name of the file that the process was created from. */
+    TUint8 iFileName[KMaxName];
+    /** Contains the length in bytes of the initialised data in iFileName. */
+    TInt iFileNameLength;
+    /** The UID3 of this process */
+    TUint32 iUid3;  
+    /** Contains the CreatorThread ID if available: May be 0 */
+    TUint64 iCreatorThreadId;  
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a process is removed. Note that the Process may not be fully destroyed,
+  so its resources should only be accessed if you already have a handle to it.
+  */
+class TRemoveProcessInfo
+    {
+public:
+    /** The name of the file that the process was created from. */
+    TUint8 iFileName[KMaxName];
+    /** Contains the length in bytes of the initialised data in iFileName. */
+    TInt iFileNameLength;
+    TUint32 iSpare1;    // Unused
+    };
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a library unload event occurs.
+  */
+class TLibraryUnloadedInfo
+    {
+public:
+    /** The name of the file that the library was loaded from. */
+    TUint8 iFileName[KMaxName];
+    /** Contains the length in bytes of the initialised data in iFileName. */
+    TInt iFileNameLength;
+    };
+
+/**
+ * Enum to represent the context of a user trace message
+ */ 
+enum TUserTraceMessageContext 
+{
+    ESingleMessage = 0x1,   /** Indicates this message is the only one corresponding to a given user trace */ 
+    EMultiStart = 0x2, /** Indicates this message is the start of a user trace which consists of multiple messages */
+    EMultiMid = 0x3, /** Indicates this message is one in a series of user trace messages */
+    EMultiEnd = 0x4, /** Indicates this message is the last in a series of user trace messages */
+    /**
+      @internalTechnology
+      A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
+      */
+    ELast = 0x5 
+};
+    
+/**
+ *   Event specific information returned as part of a TEventInfo object 
+ *   when a user trace event occurs.
+ */
+class TUserTraceInfo
+    {
+public:
+    /** The user trace text */
+    TUint8 iUserTraceText[TUserTraceSize];
+    
+    /** User trace text length */
+    TInt iUserTraceLength;
+    
+    /** The context of the message */
+    TUserTraceMessageContext iMessageStatus;
+    };
+    
+    
+/**
+  Structure used to store information about an event. An object of this type
+  is passed as an argument to the RSecuritySvrSession::GetEvent function,
+  and is filled in by the debug driver, and returned to the agent, when a
+  relevant event occurs.
+
+  The debug functionality block contains the size in bytes of the data that
+  the driver will return when a GetEvent call is issued. A debug agent should
+  ensure that this value equals the size of this TEventInfo object to ensure
+  that a compatible debug driver is being used. The value is stored as
+  EApiConstantsTEventInfoSize in the TFunctionalityApiConstants block.
+
+  @see RSecuritySvrSession::GetDebugFunctionality
+  @see RSecuritySvrSession::GetEvent
+  */
+class TEventInfo
+    {
+public:
+
+    /** Constructor sets all elements to default values. */
+    inline TEventInfo() { Reset(); };
+
+    /** Resets all values to default values. */
+    inline void Reset()
+        {
+        iProcessId = 0;
+        iProcessIdValid = EFalse;
+        iThreadId = 0;
+        iThreadIdValid = EFalse;
+        iEventType = (TEventType)NULL;
+        };
+
+public:
+
+    /** The process ID of the process which the event occurred in. */
+    TUint64                 iProcessId;
+    /** The thread ID of the thread which the event occurred in. */
+    TUint64                 iThreadId;
+    /** Has value ETrue if iProcessId is valid, EFalse otherwise. */
+    TUint8                  iProcessIdValid;
+    /** Has value ETrue if iThreadId is valid, EFalse otherwise. */
+    TUint8                  iThreadIdValid;
+    /** Indicates the type of the event. This type should be used to determine
+        the type of the information stored in the union which is part of this class. */
+    TEventType              iEventType;
+    union
+        {
+        /** Information which is specific to the break point event. */
+        TThreadBreakPointInfo iThreadBreakPointInfo;
+        /** Information which is specific to the software exception event. */
+        TThreadSwExceptionInfo iThreadSwExceptionInfo;
+        /** Information which is specific to the hardware exception event. */
+        TThreadHwExceptionInfo iThreadHwExceptionInfo;
+        /** Information which is specific to the thread kill event. */
+        TThreadKillInfo iThreadKillInfo;
+        /** Information which is specific to the library loaded event. */
+        TLibraryLoadedInfo iLibraryLoadedInfo;
+        /** Information which is specific to the library unloaded event. */
+        TLibraryUnloadedInfo iLibraryUnloadedInfo;
+        /** Information which is specific to the user trace event. */
+        TUserTraceInfo iUserTraceInfo;
+        /** Information which is specific to the start thread event. */
+        TStartThreadInfo iStartThreadInfo;
+        /** Information which is specific to the Add Process event. */
+        TAddProcessInfo iAddProcessInfo;
+        /** Information which is specific to the Remove Process event. */
+        TRemoveProcessInfo iRemoveProcessInfo;
+        };
+    };
+
+/**
+  @internalComponent
+  */
+class TProcessInfo
+    {
+    public:
+
+        inline TProcessInfo() { Reset(); }
+
+        inline TProcessInfo(TUint32 aId, TUint32 aCodeAddress, TUint32 aCodeSize, TUint32 aDataAddress)
+                : iId(aId),
+                  iCodeAddress(aCodeAddress),
+                  iCodeSize(aCodeSize),
+                  iDataAddress(aDataAddress) { }
+
+        inline void Reset()
+            {
+            iId = 0;
+            iCodeAddress = 0;
+            iCodeSize = 0;
+            iDataAddress = 0;
+            }
+
+    public:
+
+        TUint32 iId;
+        TUint32 iCodeAddress;
+        TUint32 iCodeSize;
+        TUint32 iDataAddress;
+    };
+
+/* Other functionality may be defined here later */
+
+/**
+Represents a register id value, in the terms of the Symbian ELF format:
+ - bits 0-7 define the class
+ - bits 8-15 define the rd_id
+ - bits 16-31 define the rd_sub_id
+
+Both the core registers (TFunctionalityRegister type) and the coprocessor registers
+follow this identifier scheme.
+*/
+typedef TUint32 TRegisterInfo;
+
+/**
+Enum representing the status flags which could be returned from a register
+access call.
+*/
+enum TRegisterFlag
+    {
+    /**
+    Default value, a register access call will never return this value
+    */
+    ENotSet = 0,
+    /**
+    Would be returned if the register is supported by the debug driver but the kernel cannot access the register
+    */
+    EInValid = 1,
+    /**
+    Would be returned if the register could be accessed correctly
+    */
+    EValid = 2,
+    /**
+    Would be returned if the register is not supported by the debug driver
+    */
+    ENotSupported = 3,
+    /**
+    Would be returned if a non-4 byte register value was requested
+    */
+    EBadSize = 4
+    };
+
+/**
+Enum representing the different ARM CPU instruction set architectures.
+*/
+enum TArchitectureMode
+    {
+    /** Represents the ARM CPU architecture. */
+    EArmMode = 1,
+    /** Represents the Thumb CPU architecture. */
+    EThumbMode = 2,
+    /**
+      Represents the Thumb2 CPU architecture.
+      @prototype
+      */
+    EThumb2EEMode = 3
+    };
+
+/**
+  Used as an identifier for breakpoints set by the RSecuritySvrSession::SetBreak function.
+  @see RSecuritySvrSession
+  */
+typedef TInt32 TBreakId;
+
+/**
+  Specifies the type of a code segment.
+  @see TCodeSegListEntry
+  */
+enum TCodeSegType
+    {
+    EUnknownCodeSegType = 0, /**< Signifies an unknown code segment type. */
+    EExeCodeSegType = 1,     /**< Signifies a code segment belonging to an executable. */
+    EDllCodeSegType = 2      /**< Signifies a code segment belonging to a library. */
+    };
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::ECodeSegs
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TCodeSegListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+    {
+    //cast the pointer to be a TCodeSegListEntry object
+    TCodeSegListEntry& entry = *(TCodeSegListEntry*)ptr;
+    //use the TCodeSegListEntry pointer, i.e.
+    TUint16 nameLength = entry.iNameLength;
+    TPtr name(&(entry.iName[0]), nameLength, nameLength);
+    // move ptr on to point to the next TCodeSegListEntry object
+    ptr += Align4(entry.GetSize());
+    }
+@endcode
+*/
+class TCodeSegListEntry
+    {
+public:
+    TInt GetSize() const;
+public:
+    /**
+      Address of the start of the code segment.
+      */
+    TUint32 iCodeBase;
+    /**
+      Size of the code segment.
+      */
+    TUint32 iCodeSize;
+    /**
+      Size of the const data segment
+      */
+    TUint32 iConstDataSize;
+    /**
+      Address of the initialised data
+      */
+    TUint32 iInitialisedDataBase;
+    /**
+      Size of the initialised data
+      */
+    TUint32 iInitialisedDataSize;
+    /**
+      Size of the uninitialised data
+      */
+    TUint32 iUninitialisedDataSize;
+    /**
+      Boolean indicating whether the code segment is execute in place
+      */
+    TBool iIsXip;
+    /**
+      Indicates whether the code segment is from an executable or a dll, or neither
+      */
+    TCodeSegType iCodeSegType;
+    /** Uid3 of this segment. */
+    TUint32 iUid3;
+    /** Currently unused element. May be used in future to aid maintaining compatibility. */
+    TUint32 iSpare2;
+    /**
+      Length of the code segment's name
+      */
+    TUint16 iNameLength;
+    /**
+      First two bytes of the code segment's name, the name should be considered to
+      extend past the end of the TCodeSegListEntry structure to a length
+      corresponding to iNameLength
+      */
+    TUint16 iName[1];
+    };
+
+/**
+Returns the size of the TCodeSegListEntry, including the file name length
+
+@return the size, in bytes, of the TCodeSegListEntry and the code segment's
+file name
+*/
+inline TInt TCodeSegListEntry::GetSize() const
+    {
+    return sizeof(TCodeSegListEntry) - sizeof(iName) + (2 * iNameLength);
+    }
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EXipLibraries
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TXipLibraryListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+    {
+    //cast the pointer to be a TXipLibraryListEntry object
+    TXipLibraryListEntry& entry = *(TXipLibraryListEntry*)ptr;
+    //use the TXipLibraryListEntry pointer, i.e.
+    TUint16 nameLength = entry.iNameLength;
+    TPtr name(&(entry.iName[0]), nameLength, nameLength);
+    // move ptr on to point to the next TXipLibraryListEntry object
+    ptr += Align4(entry.GetSize());
+    }
+@endcode
+*/
+class TXipLibraryListEntry
+    {
+public:
+    TInt GetSize() const;
+public:
+    /**
+      Address of the start of the library's code segment.
+      */
+    TUint32 iCodeBase;
+    /**
+      Size of the code segment.
+      */
+    TUint32 iCodeSize;
+    /**
+      Size of the const data segment
+      */
+    TUint32 iConstDataSize;
+    /**
+      Address of the initialised data
+      */
+    TUint32 iInitialisedDataBase;
+    /**
+      Size of the initialised data
+      */
+    TUint32 iInitialisedDataSize;
+    /**
+      Size of the uninitialised data
+      */
+    TUint32 iUninitialisedDataSize;
+    /** Currently unused element. May be used in future to aid maintaining compatibility. */
+    TUint32 iSpare1;
+    /** Currently unused element. May be used in future to aid maintaining compatibility. */
+    TUint32 iSpare2;
+    /**
+      Length of the library's name
+      */
+    TUint16 iNameLength;
+    /**
+      First two bytes of the code segment's name, the name should be considered to
+      extend past the end of the TXipLibraryListEntry structure to a length
+      corresponding to iNameLength
+      */
+    TUint16 iName[1];
+    };
+
+/**
+Returns the size of the TXipLibraryListEntry, including the file name length
+
+@return the size, in bytes, of the TXipLibraryListEntry and the library's
+file name
+*/
+inline TInt TXipLibraryListEntry::GetSize() const
+    {
+    return sizeof(TXipLibraryListEntry) - sizeof(iName) + (2 * iNameLength);
+    }
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EExecutables
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TExecutablesListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+    {
+    //cast the pointer to be a TExecutablesListEntry object
+    TExecutablesListEntry& entry = *(TExecutablesListEntry*)ptr;
+    //use the TExecutablesListEntry pointer, i.e.
+    TUint16 nameLength = entry.iNameLength;
+    TPtr name(&(entry.iName[0]), nameLength, nameLength);
+    // move ptr on to point to the next TExecutablesListEntry object
+    ptr += Align4(entry.GetSize());
+    }
+@endcode
+*/
+class TExecutablesListEntry
+    {
+public:
+    TInt GetSize() const;
+public:
+    /**
+      Indicates whether an agent has registered to actively debug the executable,
+      a non-zero value indicates that an agent has attached.
+      */
+    TUint8 iIsActivelyDebugged;
+    /**
+      Indicates whether any agents have registered to passively debug the executable,
+      a non-zero value indicates that at least one agent is attached passively
+      */
+    TUint8 iIsPassivelyDebugged;
+    /** Currently unused element. May be used in future to aid maintaining compatibility. */
+    TUint32 iSpare1;
+    /** Currently unused element. May be used in future to aid maintaining compatibility. */
+    TUint32 iSpare2;
+    /**
+      Length of the executable's name
+      */
+    TUint16 iNameLength;
+    /**
+      First two bytes of the executable's name, the name should be considered to
+      extend past the end of the TExecutablesListEntry structure to a length
+      corresponding to iNameLength
+      */
+    TUint16 iName[1];
+    };
+
+/**
+Returns the size of the TExecutablesListEntry, including the file name length
+
+@return the size, in bytes, of the TExecutablesListEntry and the executable's
+file name
+*/
+inline TInt TExecutablesListEntry::GetSize() const
+    {
+    return sizeof(TExecutablesListEntry) - sizeof(iName) + (2*iNameLength);
+    }
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EProcesses
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TProcessListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+    {
+    //cast the pointer to be a TProcessListEntry object
+    TProcessListEntry& entry = *(TProcessListEntry*)ptr;
+    //use the TProcessListEntry pointer, i.e.
+    TUint16 fileNameLength = entry.iFileNameLength;
+    TPtr name(&(entry.iNames[0]), fileNameLength, fileNameLength);
+    // move ptr on to point to the next TProcessListEntry object
+    ptr += Align4(entry.GetSize());
+    }
+@endcode
+*/
+class TProcessListEntry
+    {
+    public:
+        TInt GetSize() const;
+
+    public:
+        /** Process ID */
+        TUint64 iProcessId;
+
+        /** The Uid3 of the process */
+        TUint32 iUid3;
+
+        /** 
+         * Process Attributes
+         * @see DProcess::TProcessAttributes
+         */
+        TInt iAttributes;
+
+        /**
+         * Length of fully qualified file name of the process in bytes. Note that this
+         * entry may be 0 if the process is in the process of shutting down.
+         */
+        TUint16 iFileNameLength;
+
+        /**
+         * Length of current dynamic name of the process in bytes
+         */
+        TUint16 iDynamicNameLength;
+
+        /**
+         * First two bytes of the process' file name, the name should be considered to
+         * extend past the end of the TProcessListEntry structure to a length
+         * corresponding to iFileNameLength. Directly after the data corresponding to the
+         * file name, the dynamic name is stored with a length of iDynamicNameLength characters.
+         * Note that these names are not null terminated and are concatenated directly after each other.
+         * 
+         * @code
+         * TProcessListEntry& entry; // entry is a reference to a TProcessListEntry
+         *
+         * //get the file name..
+         * TPtr fileName(&(entry.iNames[0]), iFileNameLength, iFileNameLength);
+         *
+         * //get the dynamic name length..
+         * TPtr dynamicName(&(entry.iNames[0]) + iFileNameLength, iDynamicNameLength, iDynamicNameLength);
+         * @endcode
+         */
+        TUint16 iNames[1];
+    };
+
+/**
+Returns the size of the TProcessListEntry, including the file name length and the
+dynamic name length
+
+@return the size, in bytes, of the TProcessListEntry and the executable's
+file name file name and dynamic name
+*/
+inline TInt TProcessListEntry::GetSize() const
+    {
+    return sizeof(TProcessListEntry) - sizeof(iNames) + (2 * (iFileNameLength + iDynamicNameLength));
+    }
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EThreads
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TThreadListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+    {
+    //cast the pointer to be a TThreadListEntry object
+    TThreadListEntry& entry = *(TThreadListEntry*)ptr;
+    //use the TThreadListEntry pointer, i.e.
+    TUint16 nameLength = entry.iNameLength;
+    TPtr name(&(entry.iName[0]), nameLength, nameLength);
+    // move ptr on to point to the next TThreadListEntry object
+    ptr += Align4(entry.GetSize());
+    }
+@endcode
+*/
+class TThreadListEntry
+    {
+public:
+    TInt GetSize() const;
+public:
+    /**
+      Thread ID
+      */
+    TUint64 iThreadId;
+    /**
+      Process ID
+      */
+    TUint64 iProcessId;
+    /**
+      Address of the base of the supervisor stack
+      */
+    TUint32 iSupervisorStackBase;
+    /**
+      Size of the supervisor stack
+      */
+    TUint32 iSupervisorStackSize;
+    /**
+      Non-zero if iSupervisorStackBase has been set correctly
+      */
+    TUint8 iSupervisorStackBaseValid;
+    /**
+      Non-zero if iSupervisorStackSize has been set correctly
+      */
+    TUint8 iSupervisorStackSizeValid;
+    /**
+      Address of the thread's supervisor stack pointer
+      */
+    TUint32 iSupervisorStackPtr;
+    /**
+      Indicator of whether the value returned as iSupervisorStackPtr is valid.
+      It is necessary, but not necessarily sufficient, that the thread be suspended
+      for a valid value to be returned. This may be removed from the final API and
+      the value would be extracted instead via the ReadRegisters type calls.
+      */
+    TRegisterFlag iSupervisorStackPtrValid;
+    /** Currently unused element. May be used in future to aid maintaining compatibility. */
+    TUint32 iSpare1;
+    /** Currently unused element. May be used in future to aid maintaining compatibility. */
+    TUint32 iSpare2;
+    /**
+      The length of the thread's name
+      */
+    TUint16 iNameLength;
+    /**
+      First two bytes of the thread's name, the name should be considered to
+      extend past the end of the TThreadListEntry structure to a length
+      corresponding to iNameLength
+      */
+    TUint16 iName[1];
+    };
+
+/**
+Returns the size of the TThreadListEntry, including the name length
+
+@return the size, in bytes, of the TExecutablesListEntry and the thread's name
+*/
+inline TInt TThreadListEntry::GetSize() const
+    {
+    return sizeof(TThreadListEntry) - sizeof(iName) + (2 * iNameLength);
+    }
+
+/**
+Denotes which list type to return from a RSecuritySvrSession::GetList() call
+
+@see RSecuritySvrSession::GetList()
+*/
+enum TListId
+    {
+    /**
+    Indicates that the GetList() call should return a list of the processes in
+    the system. The returned buffer will contain an array of 4-byte aligned
+    TProcessListEntry objects.
+
+    @see TProcessListEntry
+    */
+    EProcesses = 0,
+    /**
+    Indicates that the GetList() call should return a list of the threads in
+    the system. The returned buffer will contain an array of 4-byte aligned
+    TThreadListEntry objects.
+
+    @see TThreadListEntry
+    */
+    EThreads = 1,
+    /**
+    Indicates that the GetList() call should return a list of the code segments in
+    the system. The returned buffer will contain an array of 4-byte aligned
+    TCodeSegListEntry objects.
+
+    @see TCodeSegListEntry
+    */
+    ECodeSegs = 2,
+    /**
+    Indicates that the GetList() call should return a list of the XIP libraries in
+    the system. The returned buffer will contain an array of 4-byte aligned
+    EXipLibraries objects.
+
+    @see EXipLibraries
+    */
+    EXipLibraries = 3,
+    /**
+    Indicates that the GetList() call should return a list of the executables in
+    the system. The returned buffer will contain an array of 4-byte aligned
+    EExecutables objects.
+
+    @see EExecutables
+    */
+    EExecutables = 4,
+    /**
+    Indicates that the GetList() call should return a list of the logical devices in the system.
+    */
+    ELogicalDevices = 5,
+    /**
+    Indicates that the GetList() call should return a list of the mutexes in the system.
+    */
+    EMutexes = 6,
+    /**
+    Indicates that the GetList() call should return a list of the servers in the system.
+    */
+    EServers = 7,
+    /**
+    Indicates that the GetList() call should return a list of the sessions in the system.
+    */
+    ESessions = 8,
+    /**
+    Indicates that the GetList() call should return a list of the semaphores in the system.
+    */
+    ESemaphores = 9,
+    /**
+    Indicates that the GetList() call should return a list of the chunks in the system.
+    */
+    EChunks = 10,
+
+    /**
+    Provides a complete list of all the breakpoints in the system and their
+    current state.
+
+    @see EBreakpoints
+    */
+    EBreakpoints = 11,
+
+    /** 
+    The following are for the possible use of kernel-side debug and SMP breakpoint
+    manipulation.
+    */
+    ESetBreak = 12,
+    ERemoveBreak = 13,
+    EModifyBreak = 14,
+    
+    /**
+     * Provides static information of the system
+     */
+    EStaticInfo = 15,
+
+    /** Last listing enum. */
+    EListLast
+    };
+
+/**
+  Bit field values denoting the scope of a listing.
+
+  In the debug functionality block, the TTag::iValue element which is returned for a listing tag
+  should be considered as a union of the supported values from this enumeration for that listing.
+  */
+enum TListScope
+    {
+    EScopeNone = 0x0,             /**< Corresponds to no scope for a listing. equivalent to not supported */
+    EScopeGlobal= 0x1,            /**< Corresponds to a global scope for a listing. */
+    EScopeProcessSpecific = 0x2,  /**< Corresponds to a process specific scope for a listing. */
+    EScopeThreadSpecific = 0x4    /**< Corresponds to a thread specific scope for a listing. */
+    };
+
+/**
+@internalComponent
+
+Interface constructor for passing IPC data for the GetList call.
+*/
+class TListDetails
+    {
+public:
+    TListDetails(const TListId aListId, const TListScope aListScope, TUint64 aTargetId=0)
+        : iListId(aListId),
+          iListScope(aListScope),
+          iTargetId(aTargetId) {}
+public:
+    TListId iListId;
+    TListScope iListScope;
+    TUint64 iTargetId;
+    };
+
+
+    };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace Debug
+    {
+
 	/**
 	 * The stop-mode debug interface is a stateless interface which may be called at any point
 	 * except user mode, provided the rest of the OS is not going to run or pre-empt it.
@@ -263,6 +1706,105 @@
 				static TInt CopyAndExpandDes(const TDesC& aSrc, TDes& aDest);
 				
 			};
+	
+	
+	/** 
+	Provides static methods for accessing the information stored in a TRegisterInfo
+	object.
+	*/
+	class Register
+	    {
+	public:
+	    static TBool IsCoreReg(const Debug::TRegisterInfo aRegister);
+	    static TBool IsCoproReg(const Debug::TRegisterInfo aRegister);
+	    static TUint32 GetCoreRegId(const Debug::TRegisterInfo aRegister);
+	    static TUint32 GetCRm(const Debug::TRegisterInfo aRegister);
+	    static TUint32 GetCRn(const Debug::TRegisterInfo aRegister);
+	    static TUint32 GetOpcode1(const Debug::TRegisterInfo aRegister);
+	    static TUint32 GetOpcode2(const Debug::TRegisterInfo aRegister);
+	    static TUint32 GetCoproNum(const Debug::TRegisterInfo aRegister);
+	    };
+
+	/**
+	Identify whether aRegister is a core register
+	@param aRegister register ID to analyse
+	@return ETrue if core register, EFalse otherwise
+	*/
+	inline TBool Register::IsCoreReg(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister & 0xff) == 0x0);
+	    }
+
+	/**
+	Identify whether aRegister is a coprocessor register
+	@param aRegister register ID to analyse
+	@return ETrue if coprocessor register, EFalse otherwise
+	*/
+	inline TBool Register::IsCoproReg(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister & 0xff) == 0x1);
+	    }
+
+	/**
+	Get the ID of the core register
+	@param aRegister register ID to analyse
+	@return ID of the core register
+	*/
+	inline TUint32 Register::GetCoreRegId(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister >> 8) & 0xff);
+	    }
+
+	/**
+	Get the CRm value of a coprocessor register
+	@param aRegister register ID to analyse
+	@return the CRm value of a coprocessor register
+	*/
+	inline TUint32 Register::GetCRm(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister >> 16) & 0xf);
+	    }
+
+	/**
+	Get the CRm value of a coprocessor register
+	@param aRegister register ID to analyse
+	@return the CRm value of a coprocessor register
+	*/
+	inline TUint32 Register::GetCRn(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister >> 20) & 0xf);
+	    }
+
+	/**
+	Get the Opcode1 value of a coprocessor register
+	@param aRegister register ID to analyse
+	@return the Opcode1 value of a coprocessor register
+	*/
+	inline TUint32 Register::GetOpcode1(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister >> 24) & 0x8);
+	    }
+	    
+	/**
+	Get the Opcode2 value of a coprocessor register
+	@param aRegister register ID to analyse
+	@return the Opcode2 value of a coprocessor register
+	*/
+	inline TUint32 Register::GetOpcode2(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister >> 27) & 0x8);
+	    }
+
+	/**
+	Get the coprocessor number of a coprocessor register
+	@param aRegister register ID to analyse
+	@return the coprocessor number of a coprocessor register
+	*/
+	inline TUint32 Register::GetCoproNum(const Debug::TRegisterInfo aRegister)
+	    {
+	    return ((aRegister >> 8) & 0xff);
+	    }
+
 
 	};
 #endif // D_STOP_MODE_API_H
--- a/kernel/eka/include/u32hal.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/include/u32hal.h	Thu Sep 02 21:54:16 2010 +0300
@@ -2843,6 +2843,22 @@
 	enabled.
 	*/
 	EVMHalSetDataWriteSize,
+
+	/**
+	@internalTechnology
+	@test
+
+	Simulates a paging error in a specified context.
+	
+	For testing purposes, this causes the paging system to report an error the next time an
+	operation occurs that could generate an error with the specified context.
+
+	The first argument (a1) contains one of the contexts described by TPagingErrorContext.
+
+	@return KErrArgument if the value is out of range, or KErrNotSupported on memory models that do
+	not support this.
+	*/
+	EVMHalDebugSetFail,
 	};
 
 
@@ -3273,6 +3289,25 @@
 	};
 
 
+/**
+@internalComponent
+@test
+
+Error context information for use by #DPager::EmbedErrorContext and #DPager::ExtractErrorContext.
+*/
+enum TPagingErrorContext
+	{
+	EPagingErrorContextNone = 0,
+	EPagingErrorContextRomRead,
+	EPagingErrorContextRomDecompress,
+	EPagingErrorContextCodeRead,
+	EPagingErrorContextCodeDecompress,
+	EPagingErrorContextDataRead,
+	EPagingErrorContextDataWrite,
+
+	EMaxPagingErrorContext
+	};
+
 
 /**
 @internalComponent
--- a/kernel/eka/kernel/power.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/kernel/power.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -666,7 +666,9 @@
     iResourceControllerData.iResourceController = aController;
     //Store the client Id generated by Resource controller for Power controller to use.
     iResourceControllerData.iClientId = aClientId;
-    return KErrNone;
+	
+	// Perform variant specific operations e.g. trigger registration of resources for idle with Resource Manager
+    return DoRegisterResourceController();
 	}
 
 /**
--- a/kernel/eka/kernel/sexec.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/kernel/sexec.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -2223,10 +2223,10 @@
 	__KTRACE_OPT(KBOOT,Kern::Printf("File server thread registered"));
 	DThread* pT = TheCurrentThread;
 	DProcess* pP = pT->iOwningProcess;
+	if (K::TheFileServerProcess && K::TheFileServerProcess!=pP)
+		K::PanicCurrentThread(EAccessDenied);
 	pP->iFlags |= (KThreadFlagProcessCritical | KProcessFlagSystemPermanent);
 	pT->iFlags |= KThreadFlagSystemPermanent;
-	if (K::TheFileServerProcess && K::TheFileServerProcess!=pP)
-		K::PanicCurrentThread(EAccessDenied);
 	K::TheFileServerProcess=pP;
 	K::ThreadEnterCS();
 	pP->SetPriority(EPriorityFileServer);
--- a/kernel/eka/kernel/sprocess.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/kernel/sprocess.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -589,6 +589,16 @@
 		pLink=pLink->iNext;
 		if (pT!=pC)
 			{
+			// If killing pT will cause a system crash then force that to happen in the context of the
+			// current thread
+			if(pT->iFlags & KThreadFlagSystemPermanent)
+				{
+				K::Fault(K::EPermanentThreadExit);
+				}
+			if (aType != EExitKill && (pT->iFlags & KThreadFlagSystemCritical))
+				{
+				K::Fault(K::ESystemThreadPanic);
+				}
 			// Need to stop the current thread being killed as a consequence of killing pT
 			pT->iFlags &= ~(KThreadFlagProcessPermanent|KThreadFlagProcessCritical);
 			pT->Die(aType, aReason, aCategory);
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -298,31 +298,17 @@
 												(TAny*)info.iCodeLocalDrive,
 												(TAny*)&message);
 
-		if(bufferStart<0)
-			{
-			r = bufferStart; // return error
-			__NK_ASSERT_DEBUG(0);
+		r = ThePager.EmbedErrorContext(EPagingErrorContextCodeRead, bufferStart); 
+		if(r<0)
 			break;
-			}
 
 		TLinAddr data = aRequest->Buffer() + bufferStart;
 		r = Decompress(info.iCompressionType, linAddr, decompressedSize, data, dataSize);
-		if(r>=0)
-			{
-			if(r!=decompressedSize)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("DCodePagedMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
-				__NK_ASSERT_DEBUG(0);
-				r = KErrCorrupt;
-				}
-			else
-				r = KErrNone;
-			}
-		else
-			{
-			__NK_ASSERT_DEBUG(0);
-			}
-
+		if (r >= 0)
+			r = (r == decompressedSize) ? KErrNone : KErrCorrupt;
+		if(r != KErrNone)
+			__KTRACE_OPT(KPANIC, Kern::Printf("DCodePagedMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
+		r = ThePager.EmbedErrorContext(EPagingErrorContextCodeDecompress, r); 			
 		if(r!=KErrNone)
 			break;
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -67,7 +67,7 @@
 	enum TSwapState
 		{
 		EStateUnreserved = 0,	///< swap space not yet reserved, or page is being decommitted
-		EStateBlank      = 1,	///< swap page has never been written
+		EStateBlank      = 1,	///< swap page has never been written or the last write failed
 		EStateWritten    = 2,	///< swap page has been written out at least once
 		EStateWriting    = 3	///< swap page is in the process of being written out
 		};
@@ -231,7 +231,7 @@
 inline DSwapManager::TSwapState DSwapManager::SwapState(TUint aSwapData)
 	{
 	TSwapState state = (TSwapState)(aSwapData & ESwapStateMask);
-	__NK_ASSERT_DEBUG(state >= EStateWritten || (aSwapData & ~ESwapStateMask) == 0);
+	__NK_ASSERT_DEBUG(state >= EStateBlank || aSwapData == 0);
 	return state;
 	}
 
@@ -244,6 +244,7 @@
 
 inline TUint DSwapManager::SwapData(TSwapState aSwapState, TInt aSwapIndex)
 	{
+	__NK_ASSERT_DEBUG(aSwapIndex < (1 << (32 - ESwapIndexShift)));
 	return (aSwapIndex << ESwapIndexShift) | aSwapState;
 	}
 
@@ -464,7 +465,6 @@
 	{
 	__ASSERT_CRITICAL;
 	
-	TInt r = KErrNone;
 	const TUint readUnitShift = iDevice->iReadUnitShift;
 	TUint readSize = KPageSize >> readUnitShift;
 	TThreadMessage message;
@@ -477,24 +477,36 @@
 		MmuLock::Lock();	// MmuLock required for atomic access to manager data.
 		TUint swapData = aMemory->PagingManagerData(index);
 		TSwapState state = SwapState(swapData);
+		TUint swapPage = SwapIndex(swapData);
 
 		if (state == EStateUnreserved)
-			{// This page is not committed to the memory object
+			{
+			// This page is not committed to the memory object
 			MmuLock::Unlock();
 			return KErrNotFound;			
 			}
 		else if (state == EStateBlank)
-			{// This page has not been written to yet so don't read from swap 
-			// just wipe it if required.
-			TUint allocFlags = aMemory->RamAllocFlags();
-			MmuLock::Unlock();
-			TBool wipePages = !(allocFlags & Mmu::EAllocNoWipe);
-			if (wipePages)
+			{
+			if (swapPage != 0)
+				{
+				// An error occured while writing the page out, so report it now
+				MmuLock::Unlock();
+				return -swapPage; 
+				}
+			else
 				{
-				TUint8 wipeByte = (allocFlags & Mmu::EAllocUseCustomWipeByte) ?
-					(allocFlags >> Mmu::EAllocWipeByteShift) & 0xff :
-					0x03;
-				memset((TAny*)aLinAddr, wipeByte, KPageSize);
+				// This page has not been written to yet so don't read from swap 
+				// just wipe it if required.
+				TUint allocFlags = aMemory->RamAllocFlags();
+				MmuLock::Unlock();
+				TBool wipePages = !(allocFlags & Mmu::EAllocNoWipe);
+				if (wipePages)
+					{
+					TUint8 wipeByte = (allocFlags & Mmu::EAllocUseCustomWipeByte) ?
+						(allocFlags >> Mmu::EAllocWipeByteShift) & 0xff :
+						0x03;
+					memset((TAny*)aLinAddr, wipeByte, KPageSize);
+					}
 				}
 			}
 		else
@@ -506,19 +518,21 @@
 			// OK to release as if the object's data is decommitted the pager 
 			// will check that data is still valid before mapping it.
 			MmuLock::Unlock();
-			TUint readStart = (SwapIndex(swapData) << KPageShift) >> readUnitShift;
+			TUint readStart = (swapPage << KPageShift) >> readUnitShift;
 			START_PAGING_BENCHMARK;
-			r = iDevice->Read(&message, aLinAddr, readStart, readSize, DPagingDevice::EDriveDataPaging);
+			TInt r = iDevice->Read(&message, aLinAddr, readStart, readSize, DPagingDevice::EDriveDataPaging);
+			END_PAGING_BENCHMARK(EPagingBmReadDataMedia);
+			__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocate memory, therefore shouldn't fail with KErrNoMemory
 			if (r != KErrNone)
-				__KTRACE_OPT(KPANIC, Kern::Printf("DSwapManager::ReadSwapPages: error reading media at %08x + %x: %d", readStart << readUnitShift, readSize << readUnitShift, r));				
-			__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocate memory, therefore can't fail with KErrNoMemory
-			END_PAGING_BENCHMARK(EPagingBmReadDataMedia);
-			__NK_ASSERT_ALWAYS(r == KErrNone);
+				__KTRACE_OPT(KPANIC, Kern::Printf("DSwapManager::ReadSwapPages: error reading media at %08x + %x: %d", readStart << readUnitShift, readSize << readUnitShift, r));
+			r = ThePager.EmbedErrorContext(EPagingErrorContextDataRead, r);
+			if (r != KErrNone)
+				return r;
 			}
 		END_PAGING_BENCHMARK(EPagingBmReadDataPage);
 		}
-
-	return r;
+	
+	return KErrNone;
 	}
 
 
@@ -626,14 +640,16 @@
 		r = iDevice->WritePhysical(&msg, aPhysAddrs, aCount, writeOffset, aBackground);
 	else
 		r = iDevice->Write(&msg, aLinAddr + (aPageIndex << KPageShift), writeOffset, writeSize, aBackground);
+	END_PAGING_BENCHMARK(EPagingBmWriteDataMedia);
 		
 	if (r != KErrNone)
 		{
 		__KTRACE_OPT(KPANIC, Kern::Printf("DSwapManager::WriteSwapPages: error writing media from %08x to %08x + %x: %d", aLinAddr, writeOffset << readUnitShift, writeSize << readUnitShift, r));
+		if (r > 0)
+			r = KErrGeneral;
 		}
 	__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocate memory, therefore can't fail with KErrNoMemory
-	__NK_ASSERT_ALWAYS(r == KErrNone);
-	END_PAGING_BENCHMARK(EPagingBmWriteDataMedia);
+	r = ThePager.EmbedErrorContext(EPagingErrorContextDataWrite, r); 
 
 	TUint i;
 	TUint swapData[KMaxPagesToClean];
@@ -647,8 +663,12 @@
 		__NK_ASSERT_DEBUG(s == EStateUnreserved || s == EStateWriting);
 		if (s == EStateWriting)
 			{
-			// Store the new swap location and mark the page as saved.
-			aMemory[i]->SetPagingManagerData(aIndex[i], SwapData(EStateWritten, aSwapIndex + i));
+			// Store the new swap location and mark the page as saved, or if an error occured then
+			// record the error code instead
+			TUint swapData = (r == KErrNone) 
+				? SwapData(EStateWritten, aSwapIndex + i)
+				: SwapData(EStateBlank, -r);
+			aMemory[i]->SetPagingManagerData(aIndex[i], swapData);
 			}
 		}
 	MmuLock::Unlock();
@@ -656,15 +676,17 @@
 	for (i = 0 ; i < aCount ; ++i)
 		{
 		TSwapState s = SwapState(swapData[i]);
-		if (s == EStateUnreserved)
+		if (s == EStateUnreserved || s == EStateBlank)
 			{
-			// The page was decommitted while we were cleaning it, so free the swap page we
-			// allocated and continue, leaving this page in the unreserved state.
+			// The page was either decommitted while we were cleaning it, or an error occured while
+			// writing.  Free the swap page and don't modify the state.
 			FreeSwapIndex(aSwapIndex + i);
 			}
 		}
 
-	return KErrNone;
+	// write errors are not reported at this point as this will just kill a thread unrelated to the
+	// one whose data has been lost
+	return KErrNone;  
 	}
 	
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -2044,9 +2044,8 @@
 	}
 
 
-TInt DPager::CheckRealtimeThreadFault(DThread* aThread, TAny* aExceptionInfo)
+DThread* DPager::ResponsibleThread(DThread* aThread, TAny* aExceptionInfo)
 	{
-	// realtime threads shouldn't take paging faults...
 	DThread* client = aThread->iIpcClient;
 
 	// If iIpcClient is set then we are accessing the address space of a remote thread.  If we are
@@ -2055,29 +2054,81 @@
 	TIpcExcTrap* ipcTrap = (TIpcExcTrap*)aThread->iExcTrap;
 	if (ipcTrap && !ipcTrap->IsTIpcExcTrap())
 		ipcTrap = 0;
-	if (client && (!ipcTrap || ipcTrap->ExcLocation(aThread, aExceptionInfo) == TIpcExcTrap::EExcRemote))
+	if (client &&
+		(!ipcTrap || ipcTrap->ExcLocation(aThread, aExceptionInfo) == TIpcExcTrap::EExcRemote))
+		return client;
+	else
+		return NULL;
+	}
+
+
+TInt DPager::CheckRealtimeThreadFault(DThread* aThread, TAny* aExceptionInfo)
+	{
+	// realtime threads shouldn't take paging faults...
+	DThread* thread = ResponsibleThread(aThread, aExceptionInfo);
+
+	const char* message = thread ?
+		"Access to Paged Memory (by other thread)" : "Access to Paged Memory";
+
+	// kill respsonsible thread...
+	if(K::IllegalFunctionForRealtimeThread(thread, message))
 		{
-		// kill client thread...
-		if(K::IllegalFunctionForRealtimeThread(client,"Access to Paged Memory (by other thread)"))
-			{
-			// treat memory access as bad...
-			return KErrAbort;
-			}
-		// else thread is in 'warning only' state so allow paging...
+		// if we are killing the current thread and we are in a critical section, then the above
+		// kill will be deferred and we will continue executing. We will handle this by returning an
+		// error which means that the thread will take an exception (which hopefully is XTRAPed!)
+
+		// treat memory access as bad...
+		return KErrAbort;
 		}
 	else
 		{
-		// kill current thread...
-		if(K::IllegalFunctionForRealtimeThread(NULL,"Access to Paged Memory"))
-			{
-			// if current thread is in critical section, then the above kill will be deferred
-			// and we will continue executing. We will handle this by returning an error
-			// which means that the thread will take an exception (which hopefully is XTRAPed!)
-			return KErrAbort;
-			}
-		// else thread is in 'warning only' state so allow paging...
+		// thread is in 'warning only' state so allow paging...
+		return KErrNone;
 		}
-	return KErrNone;
+	}
+
+
+void DPager::KillResponsibleThread(TPagingErrorContext aContext, TInt aErrorCode,
+								   TAny* aExceptionInfo)
+	{
+	const char* message = NULL;
+	switch (aContext)
+		{
+		case EPagingErrorContextRomRead:
+			message = "PAGED-ROM-READ";
+			break;
+		case EPagingErrorContextRomDecompress:
+			message = "PAGED-ROM-COMP";
+			break;
+		case EPagingErrorContextCodeRead:
+			message = "PAGED-CODE-READ";
+			break;
+		case EPagingErrorContextCodeDecompress:
+			message = "PAGED-CODE-COMP";
+			break;
+		case EPagingErrorContextDataRead:
+			message = "PAGED-DATA-READ";
+			break;
+		case EPagingErrorContextDataWrite:
+			message = "PAGED-DATA-WRITE";
+			break;
+		default:
+			message = "PAGED-UNKNOWN";
+			break;
+		}
+
+	TPtrC8 category((const unsigned char*)message);
+	DThread* thread = ResponsibleThread(TheCurrentThread, aExceptionInfo);
+	if (thread)
+		{
+		NKern::LockSystem();
+		thread->Die(EExitPanic, aErrorCode,  category);
+		}
+	else
+		{
+		TheCurrentThread->SetExitInfo(EExitPanic, aErrorCode, category);
+		NKern::DeferredExit();
+		}
 	}
 
 
@@ -2103,6 +2154,16 @@
 		r = manager->HandleFault(aMemory, aFaultIndex, aMapping, aMapInstanceCount, aAccessPermissions);
 
 		TheThrashMonitor.NotifyEndPaging();
+
+		// If the paging system encountered an error paging in the memory (as opposed to a thread
+		// accessing non-existent memory), then panic the appropriate thread.  Unfortunately this
+		// situation does occur as media such as eMMC wears out towards the end of its life. 
+		if (r != KErrNone)
+			{
+			TPagingErrorContext context = ExtractErrorContext(r);
+			if (context != EPagingErrorContextNone)
+				KillResponsibleThread(context, ExtractErrorCode(r), aExceptionInfo);
+			}
 		}
 	return r;
 	}
@@ -2644,7 +2705,18 @@
 		if ((K::MemModelAttributes & EMemModelAttrDataPaging) == 0)
 			return KErrNotSupported;
 		return SetDataWriteSize((TUint)a1);
-	
+
+#ifdef _DEBUG
+	case EVMHalDebugSetFail:
+		{
+		TUint context = (TUint)a1;
+		if (context >= EMaxPagingErrorContext)
+			return KErrArgument;
+		__e32_atomic_store_ord32(&(ThePager.iDebugFailContext), context);
+		return KErrNone;
+		}
+#endif
+
 	default:
 		return KErrNotSupported;
 		}
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Thu Sep 02 21:54:16 2010 +0300
@@ -418,6 +418,23 @@
 	*/
 	void SetCleanInSequence(TBool aCleanInSequence);
 
+	/**
+	Generate a new error code that includes both the original error code and some extra context
+	information.  This is used to communicate context information from where it occurs to where it
+	is handled.
+	*/
+	TInt EmbedErrorContext(TPagingErrorContext aContext, TInt aError);
+
+	/**
+	Extract the context information from a error code generated by #EmbedErrorContext.
+	*/
+	static TPagingErrorContext ExtractErrorContext(TInt aContextError);
+
+	/**
+	Extract the original error code from a error code generated by #EmbedErrorContext.
+	*/
+	static TInt ExtractErrorCode(TInt aContextError);
+
 private:
 	/**
 	Add a page to the head of the live page list. I.e. make it the 'youngest' page.
@@ -640,6 +657,12 @@
 	TBool ReservePage();
 
 	/**
+	Determine the thread responsible for this page fault.  This returns either NULL to indicate
+	the current thread, or a remote thread if the fault is caused by an IPC operation.
+	*/
+	DThread* ResponsibleThread(DThread* aThread, TAny* aExceptionInfo);
+
+	/**
 	Called when a realtime thread takes a paging fault.
 	Checks whether it's OK for the thread to take to fault.
 	@return KErrNone if the paging fault should be further processed
@@ -647,6 +670,20 @@
 	TInt CheckRealtimeThreadFault(DThread* aThread, TAny* aExceptionInfo);
 	
 	/**
+	Kills the thread responsible for causing a page fault.
+
+	This is called when a fatal error is encountered when handling a page fault, for example, if a
+	media access fails.
+
+	Originally the paging system reacted by faulting the system in such cases.  However the current
+	approach was thought to be preferable as this kind of error can happen in practice (even though
+	in theory it should not) and it means that the error code is reported and can be captured by
+	MobileCrash.
+	*/
+	void KillResponsibleThread(TPagingErrorContext aErrorCategory, TInt aErrorCode,
+							   TAny* aExceptionInfo);
+	
+	/**
 	Attempt to find the page table entry and page info for a page in the specified mapping.
 
 	@param aOsAsid				The OsAsid of the process that owns the mapping.
@@ -708,11 +745,53 @@
 	TSpinLock iBenchmarkLock;
 	SPagingBenchmarkInfo iBenchmarkInfo[EMaxPagingBm];
 #endif //__DEMAND_PAGING_BENCHMARKS__
+
+#ifdef _DEBUG
+	TPagingErrorContext iDebugFailContext;
+#endif
 	};
 
 extern DPager ThePager;
 
 
+// Functions to embed context information into error codes, using the following scheme:
+//
+// bits 0-16   taken from original error code
+// bits 16-31  bitwise NOT of a TPagingErrorContext value
+//
+// Since the context informtion is a small positive integer, the resulting error code is still a
+// negative integer.  The value EPagingErrorContextNone is zero, yeilding the original error code
+// unchanged if embedded.
+
+inline TInt DPager::EmbedErrorContext(TPagingErrorContext aContext, TInt aError)
+	{
+	__NK_ASSERT_DEBUG(aContext > 0 && aContext <= 0x7fff);
+#ifdef _DEBUG
+	if (aError >= KErrNone)
+		{
+		TUint32 match = aContext;
+		if (__e32_atomic_cas_ord32(&iDebugFailContext, &match, 0))
+			aError = KErrAbort;
+		}
+#endif
+	if (aError >= KErrNone)
+		return aError;
+	if (aError < (TInt)0xffff0000)
+		aError = KErrGeneral;  // lose error code, but doesn't happen in practice
+	return (aError & 0x0000ffff) | ((~aContext) << 16);
+	}
+
+inline TPagingErrorContext DPager::ExtractErrorContext(TInt aContextError)
+	{
+	return (TPagingErrorContext)((~aContextError) >> 16);
+	}
+
+inline TInt DPager::ExtractErrorCode(TInt aContextError)
+	{
+	return aContextError | 0x7fff000;
+	}
+
+
 #ifdef __DEMAND_PAGING_BENCHMARKS__
 
 #define START_PAGING_BENCHMARK TUint32 _bmStart = NKern::FastCounter()
@@ -1013,5 +1092,4 @@
 	static void Init();	
 	};
 
-
 #endif
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -558,6 +558,11 @@
 								KPageSize >> readUnitShift, DPagingDevice::EDriveRomPaging);
 			__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocated memory, therefore can't fail with KErrNoMemory
 			END_PAGING_BENCHMARK(EPagingBmReadMedia);
+			if (r != KErrNone)
+				{
+				__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, KPageSize, r));
+				}
+			r = ThePager.EmbedErrorContext(EPagingErrorContextRomRead, r);
 			}
 		else
 			{
@@ -584,6 +589,9 @@
 				r = iDevice->Read(&message, buffer, readStart, readSize, DPagingDevice::EDriveRomPaging);
 				__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocated memory, therefore can't fail with KErrNoMemory
 				END_PAGING_BENCHMARK(EPagingBmReadMedia);
+				if(r!=KErrNone)
+					__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, dataSize, r));
+				r = ThePager.EmbedErrorContext(EPagingErrorContextRomRead, r);
 				if(r==KErrNone)
 					{
 					// Decompress data, remembering that the data to decompress may be offset from 
@@ -592,16 +600,13 @@
 					const TLinAddr data = buffer + dataOffset - (readStart << readUnitShift);
 					__ASSERT_COMPILE(SRomPageInfo::ENoCompression==0); // decompress assumes this
 					r = Decompress(romPageInfo->iCompressionType, linAddr, KPageSize, data, dataSize);
-					if(r >= 0)
-						{
-						if (r != KPageSize)
-							__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
-						__NK_ASSERT_ALWAYS(r == KPageSize);
-						r = KErrNone;
-						}
+					if (r >= 0)
+						r = (r == KPageSize) ? KErrNone : KErrCorrupt;
+					if (r != KErrNone)
+						__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
+					__NK_ASSERT_DEBUG(r == KErrNone);
+					r = ThePager.EmbedErrorContext(EPagingErrorContextRomDecompress, r);
 					}
-				else
-					__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, dataSize, r));
 				}
 			}
 		END_PAGING_BENCHMARK(EPagingBmReadRomPage);
@@ -611,7 +616,7 @@
 		}
 
 	aRequest->UnmapPages(true);
-
+	
 	return r;
 	}
 
--- a/kernel/eka/release.txt	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/release.txt	Thu Sep 02 21:54:16 2010 +0300
@@ -1,3 +1,110 @@
+Version 2.00.3115
+=================
+(Made by fadhliM 16/08/2010)
+
+1.	daniezho
+	1.	RP527391
+		REQ		417-56902 Instrumentation of USB
+		SUB/SCO	417-72923 Instrumentation of USB - USB package
+
+
+Version 2.00.3114
+=================
+(Made by fadhliM 06/08/2010)
+
+1.	vfebvre
+	1.	ou1cimx1#502965 ENV : E32Test T_HEAPDL Fails TestRHeap::Test3()
+
+2.	jimhofe
+	1.	MINOR_CHANGE Adding f32test\rofs and f32test\loader to package_definition.xml
+	2.	MINOR_CHANGE Adding rofs_tests.mrp
+	3.	MINOR_CHANGE Removing author names from documentation
+
+3.	lanerobe
+	1.	ou1cimx1#506647 T_SMPSOAK debug output is not standard
+
+4.	cnotton
+	1.	ou1cimx1#500725 Coverity defects - Resource Manager and ResManUS
+
+5.	jukwak
+	1.	ou1cimx1#413512 DEV - GPIO SHAI is missing the inclusion of static extension function handlers
+	2.	ou1cimx1#468979 t_pci has dependency on naviengine
+
+
+Version 2.00.3113
+=================
+(Made by fadhliM 02/08/2010)
+
+
+1.	sakhghos
+	1.	ou1cimx1#504256 MCL removal of Run-Mode Debug Driver components from KHS package
+
+2.	h14jiang
+	1.	ou1cimx1#504400 [MCL] Disk full notification pops up
+
+3.	lanerobe
+	1.	ou1cimx1#499080 TExtended::LoadLocale() failed, but may affect the OS locale setting.
+	2.	ou1cimx1#499031 TExtendedLocale::Locale(const TDesC& aLocaleDllName) fail.
+
+4.	martai
+	1.	ou1cimx1#508646 ENV : E32TEST T_SHADOW Fails during testMultipleReadFile()
+
+
+Version 2.00.3112
+=================
+(Made by fadhliM 27/07/2010)
+
+1.	vfebvre
+	1.	ou1cimx1#492020 System-critical thread being reported in MC when another permanent thread in same process faults
+
+2.	josezhou
+	1.	ou1cimx1#482087 If the usb device doesn't support HNP, the call to usbd_set_otg_support returns USBD_STALLED 
+
+3.	gcochran
+	1.	ou1cimx1#498830 [mcl] ENV t_svrpinning, _P,_UP test fails with unexpected thread exit type on Vasco/TB9.2  
+
+4.	stmansfi
+	1.	ou1cimx1#496968 Fix domain manager test structure
+
+5.	jcoppear
+	1.	ou1cimx1#500393 Demand paging loses error information when a fatal error occurs
+
+6.	x120li
+	1.	ou1cimx1#493275 TdesC16::LocateReverseF2() function can't stop running.
+
+7.	erifung
+	1.	ou1cimx1#460764 Improve code coverage for kernel power component
+
+8.	davegord
+	1.	ou1cimx1#497240 [mcl] Problem with ExecHandler::FsRegisterThread()
+
+
+Version 2.00.3111
+=================
+(Made by fadhliM 26/07/2010)
+
+1.	lforynsk
+	1.	ou1cimx1#500491 Resource Manager PIL reallocates an array that it doesn't create or delete (kernelhwsrv)
+	2.	ou1cimx1#500836 Resource manager does not response to an asynchronous request if the resource level owner send a request with the same level
+
+2.	gayarama
+	1.	ou1cimx1#473162 DEV Registration of resources for idle is not complete
+	2.	ou1cimx1#493520 DEV Allow simulated resource controller to register with power controller
+
+3.	cnotton
+	1.	ou1cimx1#493455 Test bld.inf files are exporting headers without proper macro
+	2.	MINOR_CHANGE Moved T_TIMESTAMP up above T_LAT2.
+
+4.	erifung
+	1.	ou1cimx1#493519 t_rescontrolcli.exe crash
+
+5.	vfebvre
+	1.	ou1cimx1#483102 H6 baseport bld.inf changes
+
+6.	jcoppear
+	1.	ou1cimx1#428875 MCL NaviEngine baseport bld.inf changes
+
+
 Version 2.00.3110
 =================
 (Made by fadhliM 22/07/2010)
--- a/kernel/eka/rombuild/base.iby	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/rombuild/base.iby	Thu Sep 02 21:54:16 2010 +0300
@@ -62,8 +62,8 @@
 file=ABI_DIR\DEBUG_DIR\eka1_entry_stub.dll              \sys\bin\Eka1_Entry_Stub.dll
 #endif
 
-// Run-mode debug sub-system
-#include <rm_debug_svr.iby>
+// Stop-mode debug sub-system
+#include <sm_debug.iby>
 
 #if !defined(EUSER_DLL)
 #error EUSER_DLL not defined
--- a/kernel/eka/rombuild/rm_debug_svr.iby	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2009 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:
-*
-* Description:
-*
-*/
-#ifndef __RM_DEBUG_SVR_IBY__
-#define __RM_DEBUG_SVR_IBY__
-
-#ifndef NO_RUN_MODE_DEBUGGING
-#ifndef INST_ARM4
-
-
-
-#ifdef KMAIN
-
-// Debug Device Driver
-extension[VARID]=  \Epoc32\Release\##KMAIN##\##BUILD##\rm_debug.ldd		\sys\bin\rm_debug.ldd
-
-// Debug Security Server
-file=			\Epoc32\Release\##MAIN##\##BUILD##\rm_debug_svr.exe		\sys\bin\rm_debug_svr.exe
-
-#endif
-
-#ifndef KMAIN
-
-// Debug Device Driver
-#ifdef STOP_MODE_DEBUGGING_V2
-extension[VARID]=KERNEL_DIR\DEBUG_DIR\rm_debug_ext.ldd		\sys\bin\rm_debug.ldd
-#else
-extension[VARID]=KERNEL_DIR\DEBUG_DIR\rm_debug.ldd		\sys\bin\rm_debug.ldd
-#endif
-
-// Debug Security Server
-file=KERNEL_DIR\DEBUG_DIR\rm_debug_svr.exe		\sys\bin\rm_debug_svr.exe
-
-#endif
-
-
-#endif	// INST_ARM4
-#endif	// NO_RUN_MODE_DEBUGGING
-
-#endif	// __RM_DEBUG_SVR_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/rombuild/sm_debug.iby	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 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:
+*
+* Description:
+*
+*/
+#ifndef __SM_DEBUG_IBY__
+#define __SM_DEBUG_IBY__
+
+
+#ifndef KMAIN
+
+// Stop Mode Debugger
+#ifdef STOP_MODE_DEBUGGING_V2
+extension[VARID]=KERNEL_DIR\DEBUG_DIR\sm_debug.dll		\sys\bin\sm_debug.dll
+#endif
+
+
+#endif
+
+
+#endif	// __SM_DEBUG_IBY__
--- a/kernel/eka/rombuild/user.iby	Wed Aug 18 11:08:29 2010 +0300
+++ b/kernel/eka/rombuild/user.iby	Thu Sep 02 21:54:16 2010 +0300
@@ -71,8 +71,8 @@
 extension[VARID]=\Epoc32\Release\##KMAIN##\##BUILD##\EMMCPTN.DLL                   \Sys\Bin\EMMCPTN.DLL
 #endif
 
-// Run-mode debug subsystem
-#include "rm_debug_svr.iby"
+// Stop-mode debug subsystem
+#include "sm_debug.iby"
 
 // Load Platform Security settings
 #ifndef __DONT_LOAD_PLATSEC_SETTINGS__
Binary file kernelhwsrv_info/doc_pub/base_how_to_use_t_fatcharsetconv_framework.doc has changed
Binary file kernelhwsrv_info/doc_pub/base_migrating_device_drivers_dfc_q.doc has changed
--- a/kerneltest/e32test/buffer/t_des.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/buffer/t_des.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1399,6 +1399,30 @@
 	_LIT(KCorruptString1,		"ab\xD840\xDDAD e\xDDAD\xD840");
 	TBuf16<128> s04(KCorruptString1);
 	test(s04.FindCorruptSurrogate() == 6);
+	
+	// string 5: fill
+	_LIT(KOddString5,           "0123456");
+	TBuf16<128> s05(KOddString5);
+	s05.Fill2(0x21000);
+    test(s05 == _L("\xD844\xDC00\xD844\xDC00\xD844\xDC00\xD844"));
+    s05.Fill2(' ');
+    test(s05 == _L("       "));
+	s05.AppendFill2(0x22222, 2);
+	s05.AppendFill2(0x22222, 3);
+	test(s05 == _L("       \xD848\xDE22\xD848\xDE22\xD848"));
+	
+	// string 6: locate
+	// from Unicode 5.0, CaseFolding.txt
+	// 10400; C; 10428; # DESERET CAPITAL LETTER LONG I
+	// 0x10400's fold is 0x10428
+	TCharF f06(0x10400);
+	test(f06 == 0x10428);  // just to ensure the property is correct
+	// 0x10400: D801, DC00
+	// 0x10428: D801, DC28
+	_LIT(KMixedString6,         "ab\xD801\xDC00 e\xD801\xDC27");
+	TBuf16<128> s06(KMixedString6);
+	TInt pos6 = s06.LocateReverseF2(0x10428);
+	test(pos6 == 2);
 	}
 
 
--- a/kerneltest/e32test/demandpaging/t_svrpinning.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/demandpaging/t_svrpinning.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -72,15 +72,13 @@
 	enum TTestMode
 		{
 		EStop,
-		ETestPinAll,
-		ETestPinEven,
-		ETestPinOdd,
-		ETestPin3,
-		ETestPin2,
-		ETestPin1,
-		ETestPin0,
-		ETestPinWritable,
-		ETestUnpinWritable,
+		ETestRdPinAll,
+		ETestRdUnpin3,
+		ETestRdUnpin2,
+		ETestRdUnpin1,
+		ETestRdUnpin0,
+		ETestWrPinAll,
+		ETestWrPinNone,
 		ETestPinOOM,
 		ETestPinDefault,
 		ETestDeadServer,
@@ -156,11 +154,22 @@
 
 TInt CTestSession::CheckDesPresent(const RMessage2& aMessage, TUint aArgIndex, TBool aExpected, TBool aWrite)
 	{
+	TRequestStatus clientStat;
+	
 	if (aExpected)
+		{
 		RDebug::Printf("  Checking message argument at %d is present", aArgIndex);
+		}
 	else
+		{
 		RDebug::Printf("  Checking message argument at %d is not present", aArgIndex);
-
+		// Start watching for client thread death
+		RThread clientThread;
+		aMessage.Client(clientThread);
+		clientThread.Logon(clientStat);
+		clientThread.Close();
+		}
+		
 	// Get the length of the descriptor and verify it is as expected.
 	TInt length = aMessage.GetDesLength(aArgIndex);
 	if (length < KErrNone)
@@ -177,14 +186,9 @@
 		{// Now read the descriptor and verify that it is present or not.
 		TBuf8<5> des;
 		TInt r = aMessage.Read(aArgIndex, des);
-		TBool pass;
-		if (iClientDied)
-			pass = r == KErrDied || r == KErrBadDescriptor;
-		else
-			pass = r == (aExpected ? KErrNone : KErrBadDescriptor);
-		if (!pass)
+		if (r != (aExpected ? KErrNone : KErrBadDescriptor))
 			{
-			RDebug::Printf("  Error reading descriptor data r %d", r);
+			RDebug::Printf("  Unexpected value returned from aMessage.Read:%d", r);
 			return KErrGeneral;
 			}
 		if (r==KErrNone && (des[0] != 'a' || des[1] != 'r' || des[2] != 'g'))
@@ -207,23 +211,19 @@
 		for (TInt i = 0; i < max; i++)
 			argPtr[i] = (TUint8)aArgIndex;
 		TInt r = aMessage.Write(aArgIndex, argPtr);
-		TBool pass;
-		if (iClientDied)
-			pass = r == KErrDied || r == KErrBadDescriptor;
-		else
-			pass = r == (aExpected ? KErrNone : KErrBadDescriptor);
-		if (!pass)
+		if (r != (aExpected ? KErrNone : KErrBadDescriptor))
 			{
-			RDebug::Printf("  Error writing to the descriptor data r %d", r);
+			RDebug::Printf("  Unexpected value returned from aMessage.Write:%d", r);
 			return KErrGeneral;
 			}
 		}
 
 	if (!aExpected)
 		{// The client should have been killed as the data wasn't present.
-		if(!iClientDied)
-			User::After(500000); // allow time for client to die before next test
+		RDebug::Printf("  CheckDesPresent: Waiting for client to die");
+		User::WaitForRequest(clientStat);
 		iClientDied = ETrue;
+		RDebug::Printf("  CheckDesPresent: Client dead");
 		}
 	return KErrNone;
 	}
@@ -243,16 +243,16 @@
 	TInt r = User::SetRealtimeState(User::ERealtimeStateOn);
 	if (r != KErrNone)
 		{
-		RDebug::Printf("Error setting realtime state r = %d", r);
+		RDebug::Printf("CheckArgsPresent: Error setting realtime state r = %d", r);
 		return r;
 		}
 
 	r = CheckDesPresent(aMessage, 0, arg0Present, aWrite);
-	if (r == KErrNone)
+	if ((r == KErrNone) && !iClientDied)
 		r = CheckDesPresent(aMessage, 1, arg1Present, aWrite);
-	if (r == KErrNone)
+	if ((r == KErrNone) && !iClientDied)
 		r = CheckDesPresent(aMessage, 2, arg2Present, aWrite);
-	if (r == KErrNone)
+	if ((r == KErrNone) && !iClientDied)
 		r = CheckDesPresent(aMessage, 3, arg3Present, aWrite);
 
 	User::SetRealtimeState(User::ERealtimeStateOff);
@@ -272,35 +272,32 @@
 		case EStop:
 			CActiveScheduler::Stop();
 			break;
-		case ETestPinAll:
+		case ETestRdPinAll:
 			r = CheckArgsPresent(aMessage, ETrue, ETrue, ETrue, ETrue);
 			break;
-		case ETestPinOdd:
-			r = CheckArgsPresent(aMessage, EFalse, ETrue, EFalse, ETrue);
-			break;
-		case ETestPinEven:
-			r = CheckArgsPresent(aMessage, ETrue, EFalse, ETrue, EFalse);
-			break;
-		case ETestPin3:
+		case ETestRdUnpin3:
 			r = CheckArgsPresent(aMessage, ETrue, ETrue, ETrue, EFalse);
 			break;
-		case ETestPin2:
-			r = CheckArgsPresent(aMessage, ETrue, ETrue, EFalse, EFalse);
+		case ETestRdUnpin2:
+			r = CheckArgsPresent(aMessage, ETrue, ETrue, EFalse, ETrue);
 			break;
-		case ETestPin1:
-			r = CheckArgsPresent(aMessage, ETrue, EFalse, EFalse, EFalse);
+		case ETestRdUnpin1:
+			r = CheckArgsPresent(aMessage, ETrue,  EFalse,  ETrue, ETrue);
 			break;
-		case ETestPin0:
+		case ETestRdUnpin0:
+			r = CheckArgsPresent(aMessage, EFalse, ETrue, ETrue, ETrue);
+			break;
 		case ETestPinDefault:
 			r = CheckArgsPresent(aMessage, EFalse, EFalse, EFalse, EFalse);
 			break;
-		case ETestPinWritable:
+		case ETestWrPinAll:
 			r = CheckArgsPresent(aMessage, ETrue, ETrue, ETrue, ETrue, ETrue);
 			break;
-		case ETestUnpinWritable:
+		case ETestWrPinNone:
 			r = CheckArgsPresent(aMessage, EFalse, EFalse, EFalse, EFalse, ETrue);
 			break;
 		default:
+			RDebug::Printf("CTestSession::ServiceL Unsupported Function: %d", aMessage.Function());
 			r = KErrNotSupported;
 
 		}
@@ -447,39 +444,29 @@
 
 	switch((TInt)aTestMode)
 		{
-		case CTestSession::ETestPinAll:
+		case CTestSession::ETestRdPinAll:
 			test.Printf(_L("Test pinning all args\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPinAll, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs());
+			r = session.PublicSendReceive(CTestSession::ETestRdPinAll, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs());
 			break;
 
-		case CTestSession::ETestPinOdd:
-			test.Printf(_L("Test pinning odd args\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPinOdd, TIpcArgs(&arg0, &argTmpBuf, &arg2, &arg3).PinArgs(EFalse, ETrue, EFalse, ETrue));
-			break;
-
-		case CTestSession::ETestPinEven:
-			test.Printf(_L("Test pinning even args\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPinEven, TIpcArgs(&arg0, &arg1, argTmp, &arg3).PinArgs(ETrue, EFalse, ETrue, EFalse));
+		case CTestSession::ETestRdUnpin3:
+			test.Printf(_L("Read Arg3 unpinned\n"));
+			r = session.PublicSendReceive(CTestSession::ETestRdUnpin3, TIpcArgs(&arg0, argTmp, &argTmpBuf, &arg3).PinArgs(ETrue, ETrue, ETrue, EFalse));
 			break;
 
-		case CTestSession::ETestPin3:
-			test.Printf(_L("Test pinning 3 args\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPin3, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs(ETrue, ETrue, ETrue, EFalse));
+		case CTestSession::ETestRdUnpin2:
+			test.Printf(_L("Read Arg2 unpinned\n"));
+			r = session.PublicSendReceive(CTestSession::ETestRdUnpin2, TIpcArgs(argTmp, &arg1, &arg2, &arg3).PinArgs(ETrue, ETrue, EFalse,  ETrue));
 			break;
 
-		case CTestSession::ETestPin2:
-			test.Printf(_L("Test pinning 2 args\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPin2, TIpcArgs(argTmp, &arg1, &arg2, &arg3).PinArgs(ETrue, ETrue, EFalse, EFalse));
+		case CTestSession::ETestRdUnpin1:
+			test.Printf(_L("Read Arg1 unpinned\n"));
+			r = session.PublicSendReceive(CTestSession::ETestRdUnpin1, TIpcArgs(&argTmpBuf, &arg1, &arg2, &arg3).PinArgs(ETrue, EFalse,  ETrue,  ETrue));
 			break;
 
-		case CTestSession::ETestPin1:
-			test.Printf(_L("Test pinning 1 args\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPin1, TIpcArgs(&argTmpBuf, &arg1, &arg2, &arg3).PinArgs(ETrue, EFalse, EFalse, EFalse));
-			break;
-
-		case CTestSession::ETestPin0:
-			test.Printf(_L("Test pinning 0 args\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPin0, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs(EFalse, EFalse, EFalse, EFalse));
+		case CTestSession::ETestRdUnpin0:
+			test.Printf(_L("Read Arg0 unpinned\n"));
+			r = session.PublicSendReceive(CTestSession::ETestRdUnpin0, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs(EFalse, ETrue, ETrue, ETrue));
 			break;
 
 		case CTestSession::ETestPinDefault:
@@ -487,9 +474,9 @@
 			r = session.PublicSendReceive(CTestSession::ETestPinDefault, TIpcArgs(&arg0, &arg1, &arg2, argTmp));
 			break;
 
-		case CTestSession::ETestPinWritable:
+		case CTestSession::ETestWrPinAll:
 			test.Printf(_L("Test writing to pinned descriptors\n"));
-			r = session.PublicSendReceive(CTestSession::ETestPinWritable, TIpcArgs(&arg0, &arg3, &arg4, &arg5).PinArgs(ETrue, ETrue, ETrue, ETrue));
+			r = session.PublicSendReceive(CTestSession::ETestWrPinAll, TIpcArgs(&arg0, &arg3, &arg4, &arg5).PinArgs(ETrue, ETrue, ETrue, ETrue));
 			// Verify the index of each argument has been written to each descriptor.
 			{
 			TUint maxLength = arg0.MaxLength();
@@ -512,9 +499,9 @@
 			}
 			break;
 
-		case CTestSession::ETestUnpinWritable:
+		case CTestSession::ETestWrPinNone:
 			test.Printf(_L("Test writing to unpinned descriptors\n"));
-			r = session.PublicSendReceive(CTestSession::ETestUnpinWritable, TIpcArgs(&arg0, &arg3, &arg4, &arg5).PinArgs(EFalse, EFalse, EFalse, EFalse));
+			r = session.PublicSendReceive(CTestSession::ETestWrPinNone, TIpcArgs(&arg0, &arg3, &arg4, &arg5).PinArgs(EFalse, EFalse, EFalse, EFalse));
 			// Verify the index of each argument has been written to each descriptor.
 			// Unless this is a pinnning server than the thread will be panicked before we reach there.
 			{
@@ -542,7 +529,7 @@
 			test.Printf(_L("Test pinning to dead server\n"));
 			gSem.Signal();
 			gSem1.Wait();
-			r = session.PublicSendReceive(CTestSession::ETestPinAll, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs());
+			r = session.PublicSendReceive(CTestSession::ETestRdPinAll, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs());
 			break;
 
 		case CTestSession::ETestPinOOM:
@@ -554,7 +541,7 @@
 			for (i = 0; i < KMaxKernelAllocations && r == KErrNoMemory; i++)
 				{
 				__KHEAP_FAILNEXT(i);
-				r = session.PublicSendReceive(CTestSession::ETestPinAll, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs());
+				r = session.PublicSendReceive(CTestSession::ETestRdPinAll, TIpcArgs(&arg0, &arg1, &arg2, &arg3).PinArgs());
 				__KHEAP_RESET;
 				}
 			test.Printf(_L("SendReceive took %d tries\n"),i);
@@ -634,7 +621,7 @@
 		RSession session;
 		test_KErrNone(session.PublicCreateSession(_L("CTestServer"),5));
 		
-		for (	TUint clientTest = CTestSession::ETestPinAll; 
+		for (	TUint clientTest = CTestSession::ETestRdPinAll; 
 				clientTest <= CTestSession::ETestPinDefault && !exitFailure;
 				clientTest++)
 			{
@@ -654,8 +641,8 @@
 
 			// If all the descriptor arguments were not pinned then the client 
 			// thread should have been panicked.
-			TBool expectPanic = (clientTest == CTestSession::ETestPinAll || 
-								clientTest == CTestSession::ETestPinWritable ||
+			TBool expectPanic = (clientTest == CTestSession::ETestRdPinAll || 
+								clientTest == CTestSession::ETestWrPinAll ||
 								clientTest == CTestSession::ETestPinOOM )? 0 : 1;
 			expectPanic = !UpdateExpected(!expectPanic);
 
@@ -666,17 +653,20 @@
 				if (exitType != EExitPanic || 
 					exitReason != EIllegalFunctionForRealtimeThread ||
 					clientThread.ExitCategory() != _L("KERN-EXEC"))
-					{// Thread didn't panic as expected.
+					{
+					test.Printf(_L("Thread didn't panic as expected\n"));
 					exitFailure = ETrue;
 					}
 				}
 			else
 				{
 				if (exitType != EExitKill || exitReason != KErrNone)
-					{// Thread didn't exit gracefully as expected.
+					{
+					test.Printf(_L("Thread didn't exit gracefully as expected\n"));
 					exitFailure = ETrue;
 					}
 				}
+			test(!exitFailure);
 			CLOSE_AND_WAIT(clientThread);
 			}
 
@@ -697,7 +687,7 @@
 		User::WaitForRequest(serverStat);
 		if (serverThread.ExitType() != EExitKill)
 			{
-			test.Printf(_L("!!Server thread did something bizarre %d"), serverThread.ExitReason());
+			test.Printf(_L("!!Server thread did something bizarre %d\n"), serverThread.ExitReason());
 			}
 
 		gSem1.Signal();
@@ -710,7 +700,6 @@
 		CLOSE_AND_WAIT(gSem);
 		CLOSE_AND_WAIT(gSem1);
 		}
-	test(!exitFailure);
 
 	test.Next(_L("Test server setting pinning policy after server started"));
 	RThread serverThread;
--- a/kerneltest/e32test/device/t_usb.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/device/t_usb.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-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"
@@ -18,11 +18,15 @@
 //
 
 #include "t_usb.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_usbTraces.h"
+#endif
 
 
 void RunAppL(TBool aVerboseOutput)
 	{
-	RDebug::Print(_L("RunAppL()"));
+	OstTrace0(TRACE_NORMAL, RUNAPPL_RUNAPPL, "RunAppL()");
 	// Construct the active scheduler
 	CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();
 
@@ -56,7 +60,7 @@
 
 TInt E32Main()
 	{
-	RDebug::Print(_L("E32Main()"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "E32Main()");
 
 	CTrapCleanup* cleanup = CTrapCleanup::New();			// get clean-up stack
 
@@ -68,7 +72,7 @@
 	TBool verbose = EFalse;
 	if (c.CompareF(KArg) == 0)
 		{
-		RDebug::Print(_L("(Verbose output enabled.)\n"));
+		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "(Verbose output enabled.)\n");
 		verbose = ETrue;
 		}
 
@@ -80,7 +84,7 @@
 
 	delete cleanup;											// destroy clean-up stack
 
-	RDebug::Print(_L("Program exit: done.\n"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP02, "Program exit: done.\n");
 
 	return 0;												// and return
 	}
--- a/kerneltest/e32test/device/t_usb.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/device/t_usb.h	Thu Sep 02 21:54:16 2010 +0300
@@ -230,42 +230,36 @@
 		do { \
 		iConsole->Printf(_L(string)); \
 		iConsole->Printf(_L("\n")); \
-		RDebug::Print(_L(string)); \
 		} while (0)
 
 #define TUSB_PRINT1(string, a) \
 		do { \
 		iConsole->Printf(_L(string), (a)); \
 		iConsole->Printf(_L("\n")); \
-		RDebug::Print(_L(string), (a)); \
 		} while (0)
 
 #define TUSB_PRINT2(string, a, b) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b)); \
 		iConsole->Printf(_L("\n")); \
-		RDebug::Print(_L(string), (a), (b)); \
 		} while (0)
 
 #define TUSB_PRINT3(string, a, b, c) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b), (c)); \
 		iConsole->Printf(_L("\n")); \
-		RDebug::Print(_L(string), (a), (b), (c)); \
 		} while (0)
 
 #define TUSB_PRINT5(string, a, b, c, d, e) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b), (c), (d), (e)); \
 		iConsole->Printf(_L("\n")); \
-		RDebug::Print(_L(string), (a), (b), (c), (d), (e)); \
 		} while (0)
 
 #define TUSB_PRINT6(string, a, b, c, d, e, f) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b), (c), (d), (e), (f)); \
 		iConsole->Printf(_L("\n")); \
-		RDebug::Print(_L(string), (a), (b), (c), (d), (e), (f)); \
 		} while (0)
 
 #define TUSB_VERBOSE_PRINT(string) \
--- a/kerneltest/e32test/device/t_usbapi.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/device/t_usbapi.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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"
@@ -51,6 +51,10 @@
 #include <d32otgdi.h>
 
 #include "t_usblib.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_usbapiTraces.h"
+#endif
 
 
 // --- Local Top Level Variables
@@ -110,6 +114,10 @@
 				(ep_state == EEndpointStateNotStalled) ? _S("Not stalled") :
 				((ep_state == EEndpointStateStalled) ? _S("Stalled") :
 				 _S("Unknown...")));
+	OstTraceExt2(TRACE_NORMAL, QUERYENDPOINTSTATE_QUERYENDPOINTSTATE, "Endpoint %d state: %s\n", aEndpoint,
+				(ep_state == EEndpointStateNotStalled) ? _L("Not stalled") :
+				((ep_state == EEndpointStateStalled) ? _L("Stalled") :
+				 _L("Unknown...")));
 	return ep_state;
 	}
 
@@ -242,6 +250,7 @@
 	if (gSupportsOtg)
 		{
 		test.Printf(_L("Running on OTG device: loading OTG driver\n"));
+		OstTrace0(TRACE_NORMAL, OPENCHANNEL_OPENCHANNEL, "Running on OTG device: loading OTG driver\n");
 		test.Next(_L("Load OTG LDD"));
 		r = User::LoadLogicalDevice(KOtgdiLddFilename);
 		test((r == KErrNone) || (r == KErrAlreadyExists));
@@ -292,6 +301,8 @@
 	TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA);
 	test.Printf(_L("DMA on endpoint 1 %s\n"),
 				res ? _S("now allocated") : _S("not allocated"));
+	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1, "DMA on endpoint 1 %s\n",
+				res ? _L("now allocated") : _L("not allocated"));
 	if (dma == KErrNone)
 		// Only if DMA resource was successfully allocated should we expect truth here:
 		test(res);
@@ -303,6 +314,8 @@
 	res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering);
 	test.Printf(_L("Double Buffering on endpoint 1 %s\n"),
 				res ? _S("now allocated") : _S("not allocated"));
+	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP01, "Double Buffering on endpoint 1 %s\n",
+				res ? _L("now allocated") : _L("not allocated"));
 	if (db == KErrNone)
 		// Only if DB resource was successfully allocated should we expect truth here:
 		test(res);
@@ -319,6 +332,8 @@
 	res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering);
 	test.Printf(_L("Double Buffering on endpoint 1 %s\n"),
 				res ? _S("still allocated") : _S("not (longer) allocated"));
+	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP02, "Double Buffering on endpoint 1 %s\n",
+				res ? _L("still allocated") : _L("not (longer) allocated"));
 
 	test.Next(_L("Deallocate DMA resource"));
 	r = gPort.DeAllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDMA);
@@ -330,6 +345,8 @@
 	res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA);
 	test.Printf(_L("DMA on endpoint 1 %s\n"),
 				res ? _S("still allocated") : _S("not (longer) allocated"));
+	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP03, "DMA on endpoint 1 %s\n",
+				res ? _L("still allocated") : _L("not (longer) allocated"));
 
 	test.End();
 	}
@@ -351,25 +368,43 @@
 	gSupportResouceAllocationV2 = (d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2);
 	
 	test.Printf(_L("### USB device capabilities:\n"));
+	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE, "### USB device capabilities:\n");
 	test.Printf(_L("Number of endpoints:                        %d\n"), n);
+	OstTrace1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP01, "Number of endpoints:                        %d\n", n);
 	test.Printf(_L("Supports Software-Connect:                  %s\n"),
 				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP02, "Supports Software-Connect:                  %s\n",
+				d_caps().iConnect ? _L("yes") : _L("no"));
 	test.Printf(_L("Device is Self-Powered:                     %s\n"),
 				d_caps().iSelfPowered ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP03, "Device is Self-Powered:                     %s\n",
+				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports Remote-Wakeup:                     %s\n"),
 				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP04, "Supports Remote-Wakeup:                     %s\n",
+				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports High-speed:                        %s\n"),
 				gSupportsHighSpeed ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP05, "Supports High-speed:                        %s\n",
+				gSupportsHighSpeed ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports OTG:                               %s\n"),
 				gSupportsOtg ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP06, "Supports OTG:                               %s\n",
+				gSupportsOtg ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports unpowered cable detection:         %s\n"),
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
 				_S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP07, "Supports unpowered cable detection:         %s\n",
+				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
+				_L("yes") : _L("no"));
 	test.Printf(_L("Supports endpoint resource alloc scheme V2: %s\n"),
 				gSupportResouceAllocationV2 ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP08, "Supports endpoint resource alloc scheme V2: %s\n",
+				gSupportResouceAllocationV2 ? _L("yes") : _L("no"));
 
 	test(n >= 2);
 	test.Printf(_L("(Device has sufficient endpoints.)\n"));
+	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP09, "(Device has sufficient endpoints.)\n");
 
 	// Endpoint caps
 	test.Next(_L("Query USB endpoint caps"));
@@ -379,14 +414,18 @@
 	test(r == KErrNone);
 
 	test.Printf(_L("### USB device endpoint capabilities:\n"));
+	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP10, "### USB device endpoint capabilities:\n");
 	for (TInt i = 0; i < n; i++)
 		{
 		const TUsbcEndpointCaps* caps = &data[i].iCaps;
 		test.Printf(_L("Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x\n"),
 					caps->iSizes, caps->iTypesAndDir);
+		OstTraceExt2(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP11, "Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x\n",
+					caps->iSizes, caps->iTypesAndDir);
 		if (caps->iHighBandwidth)
 			{
 			test.Printf(_L("  (high-speed, high bandwidth endpoint)\n"));
+			OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP12, "  (high-speed, high bandwidth endpoint)\n");
 			// Must be HS Int or Iso ep
 			test(gSupportsHighSpeed);
 			test(caps->iTypesAndDir & (KUsbEpTypeIsochronous | KUsbEpTypeInterrupt));
@@ -470,6 +509,7 @@
 	if (gSupportsOtg && (r == KErrNotReady))
 		{
 		test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n"));
+		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP13, "OTG device but not connected to Host, stopping subtest here.\n");
 		test.End();
 		return;
 		}
@@ -482,8 +522,10 @@
 	test(r == KErrNone);
  	// Suspend thread to let things get stable on the bus.
 	test.Printf(_L("Waiting a short moment..."));
+	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP14, "Waiting a short moment...");
 	User::After(2000000);
 	test.Printf(_L(" done.\n"));
+	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP15, " done.\n");
 
 	// Check the speed of the physical connection (if any).
 	gUsingHighSpeed = gPort.CurrentlyUsingHighSpeed();
@@ -491,10 +533,12 @@
 		{
 		test(gSupportsHighSpeed);							// sane?
 		test.Printf(_L("---> USB High-speed Testing\n"));
+		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP16, "---> USB High-speed Testing\n");
 		}
 	else
 		{
 		test.Printf(_L("---> USB Full-speed Testing\n"));
+		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP17, "---> USB Full-speed Testing\n");
 		}
 
 	// By pulling down the interface/connection and bringing them up again we
@@ -521,8 +565,10 @@
 
  	// Suspend thread before connecting again.
 	test.Printf(_L("Waiting a short moment..."));
+	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP18, "Waiting a short moment...");
 	User::After(1000000);
 	test.Printf(_L(" done.\n"));
+	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP19, " done.\n");
 
 	test.Next(_L("Powering up UDC (2)"));
 	r = gPort.PowerUpUdc();
@@ -537,6 +583,7 @@
 	if (gSupportsOtg && (r == KErrNotReady))
 		{
 		test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n"));
+		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP20, "OTG device but not connected to Host, stopping subtest here.\n");
 		test.End();
 		return;
 		}
@@ -553,10 +600,14 @@
 			TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering);
 			test.Printf(_L("Double Buffering on endpoint 1 %s\n"),
 						res ? _S("now allocated") : _S("not allocated"));
+			OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP21, "Double Buffering on endpoint 1 %s\n",
+						res ? _L("now allocated") : _L("not allocated"));
 
 			res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA);
 			test.Printf(_L("DMA on endpoint 1 %s\n"),
 						res ? _S("still allocated") : _S("not allocated"));										
+			OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP22, "DMA on endpoint 1 %s\n",
+						res ? _L("still allocated") : _L("not allocated"));										
 		}
 		
 	test.End();
@@ -619,6 +670,7 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Device_Qualifier descriptor tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR, "*** Not supported - skipping Device_Qualifier descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -700,6 +752,7 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Other_Speed_Configuration desc tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR, "*** Not supported - skipping Other_Speed_Configuration desc tests\n");
 		test.End();
 		return;
 		}
@@ -837,6 +890,7 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping alternate interface settings tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION, "*** Not supported - skipping alternate interface settings tests\n");
 		test.End();
 		return;
 		}
@@ -882,6 +936,7 @@
 			ifc().iEndpointData[ep_found].iInterval = 0x01;	// 2^(bInterval-1)ms, bInterval must be [1..16]
 			ifc().iEndpointData[ep_found].iInterval_Hs = 0x01; // same as for FS
 			test.Printf(_L("ISO  IN  size = %4d (ep %d)\n"), mps, ep_found + 1);
+			OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP01, "ISO  IN  size = %4d (ep %d)\n", mps, ep_found + 1);
 			foundIsoIN = ETrue;
 			if (++ep_found == 3)
 				break;
@@ -896,6 +951,7 @@
 			ifc().iEndpointData[ep_found].iSize = mps;
 			ifc().iEndpointData[ep_found].iInterval = 0x01;	// 2^(bInterval-1)ms, bInterval must be [1..16]
 			test.Printf(_L("ISO  OUT size = %4d (ep %d)\n"), mps, ep_found + 1);
+			OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP02, "ISO  OUT size = %4d (ep %d)\n", mps, ep_found + 1);
 			foundIsoOUT = ETrue;
 			if (++ep_found == 3)
 				break;
@@ -912,6 +968,7 @@
 			ifc().iEndpointData[ep_found].iInterval_Hs = 4;	// interval = 2^(bInterval-1)ms = 8ms
 			ifc().iEndpointData[ep_found].iExtra    = 2;	// 2 extra bytes for Audio Class EP descriptor
 			test.Printf(_L("INT  IN  size = %4d (ep %d)\n"), mps, ep_found + 1);
+			OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP03, "INT  IN  size = %4d (ep %d)\n", mps, ep_found + 1);
 			foundIntIN = ETrue;
 			INT_IN_ep = ep_found + 1;
 			if (++ep_found == 3)
@@ -932,6 +989,7 @@
 			if (gUsingHighSpeed)
 				{
 				test.Printf(_L("Checking if correct Bulk packet size is reported in HS case\n"));
+				OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP04, "Checking if correct Bulk packet size is reported in HS case\n");
 				test(mps == KUsbEpSize512);					// sane?
 				}
 			// The PSL should in any case also offer the 'legacy' FS size:
@@ -939,15 +997,19 @@
 			ifc().iEndpointData[ep_found].iSize = mps;
 			test.Printf(_L("BULK %s size = %4d (ep %d)\n"),
 						dir == KUsbEpDirIn ? _S("IN ") : _S("OUT"), mps, ep_found + 1);
+			OstTraceExt3(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP05, "BULK %S size = %4d (ep %d)\n",
+						dir == KUsbEpDirIn ? _L("IN ") : _L("OUT"), mps, ep_found + 1);
 			if (++ep_found == 5)
 				break;
 			}
 		}
 
 	test.Printf(_L("Total: %d endpoints found for the alt. ifc setting\n"), ep_found);
+	OstTrace1(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP06, "Total: %d endpoints found for the alt. ifc setting\n", ep_found);
 	if (ep_found < 3)
 		{
 		test.Printf(_L("(3 endpoints are at least required. Skipping test...)\n"));
+		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP07, "(3 endpoints are at least required. Skipping test...)\n");
 		test.End();
 		return;
 		}
@@ -955,12 +1017,15 @@
 	if (!foundIsoIN && !foundIsoOUT)
 		{
 		test.Printf(_L("(No Isochronous endpoints found)\n"));
+		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP08, "(No Isochronous endpoints found)\n");
 		}
 
 	if (!foundIntIN)
 		{
 		test.Printf(_L("(No Interrupt endpoint found)\n"));
+		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP09, "(No Interrupt endpoint found)\n");
 		test.Printf(_L("Adjusting endpoint size for later test\n"));
+		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP10, "Adjusting endpoint size for later test\n");
 		// We want to make sure that at least one descriptor has the 2 extra bytes.
 		// It doesn't matter that this ep could be a Bulk one, or that the 2 Iso ep's might be missing -
 		// we just want to test some functionality and we're not going to use this interface in earnest.
@@ -1064,6 +1129,7 @@
 	const TUint16 ep_size = EpSize(descriptor[KEpDesc_PacketSizeOffset],
 								   descriptor[KEpDesc_PacketSizeOffset+1]);
 	test.Printf(_L(" Size: %d\n"), ep_size);
+	OstTrace1(TRACE_NORMAL, TESTENDPOINTDESCRIPTOR_TESTENDPOINTDESCRIPTOR, " Size: %d\n", ep_size);
 	if (gUsingHighSpeed)
 		{
 		// HS Bulk ep can only have one possible packet size.
@@ -1086,6 +1152,7 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping Extended Endpoint descriptor tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR, "*** Not supported - skipping Extended Endpoint descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -1153,6 +1220,7 @@
 	TInt r = gPort.GetStringDescriptorLangId(rd_langid_orig);
 	test(r == KErrNone);
 	test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig);
+	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS, "Original LANGID code: 0x%04X\n", rd_langid_orig);
 
 	test.Next(_L("SetStringDescriptorLangId()"));
 	TUint16 wr_langid = 0x0809;								// English (UK) Language ID
@@ -1166,6 +1234,7 @@
 	r = gPort.GetStringDescriptorLangId(rd_langid);
 	test(r == KErrNone);
 	test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid);
+	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01, "New LANGID code: 0x%04X\n", rd_langid);
 
 	test.Next(_L("Compare LANGID codes"));
 	test(rd_langid == wr_langid);
@@ -1189,11 +1258,13 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02, "Original Manufacturer string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
 		{
 		test.Printf(_L("No Manufacturer string set\n"));
+		OstTrace0(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03, "No Manufacturer string set\n");
 		restore_string = EFalse;
 		}
 
@@ -1208,6 +1279,7 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -1225,6 +1297,7 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -1258,6 +1331,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06, "Old Product string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -1275,6 +1349,7 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -1292,6 +1367,7 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -1325,6 +1401,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09, "Old Serial Number: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -1342,6 +1419,7 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -1359,6 +1437,7 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -1392,6 +1471,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12, "Old Configuration string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -1409,6 +1489,7 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -1426,6 +1507,7 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -1489,6 +1571,7 @@
 	r = gPort.GetStringDescriptor(stridx1, rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx1, &rd_str);
+	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS, "New test string @ idx %d: \"%lS\"\n", stridx1, rd_str);
 
 	test.Next(_L("Compare test strings 1"));
 	r = rd_str.Compare(wr_str);
@@ -1527,6 +1610,7 @@
 	r = gPort.GetStringDescriptor(stridx2, rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx2, &rd_str);
+	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01, "New test string @ idx %d: \"%lS\"\n", stridx2, rd_str);
 
 	test.Next(_L("Compare test strings 2"));
 	r = rd_str.Compare(wr_str);
@@ -1550,6 +1634,7 @@
 	r = gPort.GetStringDescriptor(stridx3, rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str);
+	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02, "New test string @ idx %d: \"%lS\"\n", stridx3, rd_str);
 
 	test.Next(_L("Compare test strings 3"));
 	r = rd_str.Compare(wr_str);
@@ -1668,11 +1753,14 @@
 		TBool a_AltHnpSupport = (features & KUsbOtgAttr_A_AltHnpSupport) ? ETrue : EFalse;
 		test.Printf(_L("### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n"),
 					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
+		OstTraceExt3(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS, "### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n",
+					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
 		}
 	else
 		{
 		test(r == KErrNotSupported);
 		test.Printf(_L("GetOtgFeatures() not supported\n"));
+		OstTrace0(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01, "GetOtgFeatures() not supported\n");
 		}
 
 	test.End();
@@ -1724,10 +1812,12 @@
 			if (good)
 				{
 				test.Printf(_L("Ep0 supports %d bytes MaxPacketSize\n"), mpsize);
+				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES, "Ep0 supports %d bytes MaxPacketSize\n", mpsize);
 				}
 			else
 				{
 				test.Printf(_L("Bad Ep0 size: 0x%08x, failure will occur\n"), bit);
+				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01, "Bad Ep0 size: 0x%08x, failure will occur\n", bit);
 				r = KErrGeneral;
 				}
 			}
@@ -1771,6 +1861,7 @@
 		{
 		TUint setting = (deviceState & ~KUsbAlternateSetting);
 		test.Printf(_L("Alternate setting change to setting %d - unexpected"), setting);
+		OstTrace1(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY, "Alternate setting change to setting %d - unexpected", setting);
 		test(EFalse);
 		}
 	else
@@ -1779,31 +1870,40 @@
 			{
 		case EUsbcDeviceStateUndefined:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Undefined state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01, "TestAlternateDeviceStatusNotify: Undefined state\n");
 			break;
 		case EUsbcDeviceStateAttached:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Attached state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02, "TestAlternateDeviceStatusNotify: Attached state\n");
 			break;
 		case EUsbcDeviceStatePowered:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Powered state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03, "TestAlternateDeviceStatusNotify: Powered state\n");
 			break;
 		case EUsbcDeviceStateDefault:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Default state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04, "TestAlternateDeviceStatusNotify: Default state\n");
 			break;
 		case EUsbcDeviceStateAddress:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Address state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05, "TestAlternateDeviceStatusNotify: Address state\n");
 			break;
 		case EUsbcDeviceStateConfigured:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Configured state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06, "TestAlternateDeviceStatusNotify: Configured state\n");
 			break;
 		case EUsbcDeviceStateSuspended:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Suspended state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07, "TestAlternateDeviceStatusNotify: Suspended state\n");
 			break;
 		case EUsbcNoState:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: State buffering error\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08, "TestAlternateDeviceStatusNotify: State buffering error\n");
 			test(EFalse);
 			break;
 		default:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Unknown state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09, "TestAlternateDeviceStatusNotify: Unknown state\n");
 			test(EFalse);
 			}
 		}
@@ -1834,10 +1934,12 @@
 		if ((epStateBitmap & (1 << i)) == EEndpointStateNotStalled)
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d NOT STALLED\n"), i);
+			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY, "EndpointStatusNotify: Ep %d NOT STALLED\n", i);
 			}
 		else
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d STALLED\n"), i);
+			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01, "EndpointStatusNotify: Ep %d STALLED\n", i);
 			}
 		}
 
@@ -1866,7 +1968,9 @@
 	if( EUsbcDeviceStateUndefined==devstate )
 		{
 		test.Printf( _L("Device not connected, state EUsbcDeviceStateUndefined.\n")  );
+		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS, "Device not connected, state EUsbcDeviceStateUndefined.\n");
 		test.Printf( _L("Skipping endpoint stall status tests.\n") );
+		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP01, "Skipping endpoint stall status tests.\n");
 		test.End();
 		return;
 		}
@@ -1875,6 +1979,7 @@
 	if (!SupportsEndpointStall())
 		{
 		test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP02, "*** Not supported - skipping endpoint stall status tests\n");
 		test.End();
 		return;
 		}
@@ -1960,6 +2065,7 @@
 			{
 			step = KEpilogue;
 			test.Printf(_L("*** Test platform does not support USB - skipping all tests\n"));
+			OstTrace0(TRACE_NORMAL, RUNTESTS_RUNTESTS, "*** Test platform does not support USB - skipping all tests\n");
 			}
 		return ETrue;
 	case KMain:
@@ -1985,6 +2091,7 @@
 		return ETrue;
 	case KEpilogue:
 		test.Printf(_L("USBAPI tests were run %.0f time(s)\n"), loops);
+		OstTraceExt1(TRACE_NORMAL, RUNTESTS_RUNTESTS_DUP01, "USBAPI tests were run %.0f time(s)\n", loops);
 		// outermost test end
 		test.End();
 		CActiveScheduler::Stop();
--- a/kerneltest/e32test/device/t_usbco2.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/device/t_usbco2.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,6 +23,10 @@
 
 #include "t_usb.h"											// CActiveConsole, CActiveRW
 #include "t_usblib.h"										// Helpers
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_usbco2Traces.h"
+#endif
 
 
 _LIT(KUsbLddFilename, "eusbc");								// .ldd assumed - it's a filename
@@ -91,30 +95,36 @@
 	if (r != KErrNone && r != KErrAlreadyExists)
 		{
 		TUSB_PRINT1("Error %d on loading USB LDD", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL, "Error %d on loading USB LDD", r);
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Successfully loaded USB LDD");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP01, "Successfully loaded USB LDD");
 
 	// Open USB channel
 	r = iPort.Open(0);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on opening USB port", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP02, "Error %d on opening USB port", r);
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Successfully opened USB port");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP03, "Successfully opened USB port");
 
 	// Create Reader/Writer active object
 	iRW = CActiveRW::NewL(iConsole, &iPort, iVerbose);
 	if (!iRW)
 		{
 		TUSB_PRINT("Failed to create reader/writer");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP04, "Failed to create reader/writer");
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Created reader/writer");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP05, "Created reader/writer");
 	
 	// check for endpoint resource allocation v2 support
 	TUsbDeviceCaps d_caps;
@@ -122,6 +132,7 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device capabilities", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP06, "Error %d on querying device capabilities", r);
 		User::Leave(-1);
 		return;
 		}
@@ -133,6 +144,7 @@
 	if (!(r == KErrNotSupported || r == KErrNone))
 		{
 		TUSB_PRINT1("Error %d while fetching OTG descriptor", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP07, "Error %d while fetching OTG descriptor", r);
 		User::Leave(-1);
 		return;
 		}
@@ -143,10 +155,12 @@
 	if (iOtg)
 		{
 		TUSB_PRINT("Running on OTG device: loading OTG driver");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP08, "Running on OTG device: loading OTG driver");
 		r = User::LoadLogicalDevice(KOtgdiLddFilename);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on loading OTG LDD", r);
+			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP09, "Error %d on loading OTG LDD", r);
 			User::Leave(-1);
 			return;
 			}
@@ -154,6 +168,7 @@
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on opening OTG port", r);
+			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP10, "Error %d on opening OTG port", r);
 			User::Leave(-1);
 			return;
 			}
@@ -161,6 +176,7 @@
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on starting USB stack", r);
+			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP11, "Error %d on starting USB stack", r);
 			User::Leave(-1);
 			return;
 			}
@@ -175,15 +191,18 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Interface setup failed", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE, "Interface setup failed:%d", r);
 		return r;
 		}
 	TUSB_PRINT("Interface successfully set up");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP01, "Interface successfully set up");
 
 	// Change some descriptors to contain suitable values
 	r = SetupDescriptors();
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Descriptor setup failed", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP02, "Descriptor setup failed:%d ", r);
 		return r;
 		}
 
@@ -192,6 +211,7 @@
 	if (!iDeviceStateNotifier)
 		{
 		TUSB_PRINT("Failed to create device state notifier");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP03, "Failed to create device state notifier");
 		return r;
 		}
 	iDeviceStateNotifier->Activate();
@@ -201,6 +221,7 @@
 	if (!iStallNotifier)
 		{
 		TUSB_PRINT("Failed to create stall notifier");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP04, "Failed to create stall notifier");
 		return r;
 		}
 	iStallNotifier->Activate();
@@ -212,6 +233,10 @@
 CActiveConsole::~CActiveConsole()
 	{
 	TUSB_VERBOSE_PRINT("CActiveConsole::~CActiveConsole()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_DCACTIVECONSOLE, "CActiveConsole::~CActiveConsole()");
+	    }
 	Cancel();												// base class cancel -> calls our DoCancel
 	delete iRW;												// destroy the reader/writer
 	delete iDeviceStateNotifier;
@@ -220,21 +245,25 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on string removal", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP01, "Error %d on string removal", r);
 		}
 	r = iPort.RemoveStringDescriptor(stridx2);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on string removal", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP02, "Error %d on string removal", r);
 		}
 	if (iOtg)
 		{
 		TUSB_PRINT("Running on OTG device: unloading OTG driver");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP03, "Running on OTG device: unloading OTG driver");
 		iOtgPort.StopStacks();
 		iOtgPort.Close();
 		r = User::FreeLogicalDevice(RUsbOtgDriver::Name());
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on freeing OTG LDD", r);
+			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP04, "Error %d on freeing OTG LDD", r);
 			}
 		}
 	iPort.Close();											// close USB channel
@@ -242,16 +271,22 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d during unloading USB LDD", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP05, "Error %d during unloading USB LDD", r);
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Successfully unloaded USB LDD");	
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP06, "Successfully unloaded USB LDD");	
 	}
 
 
 void CActiveConsole::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveConsole::DoCancel()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_DOCANCEL, "CActiveConsole::DoCancel()");
+	    }
 	iConsole->ReadCancel();
 	}
 
@@ -259,6 +294,10 @@
 void CActiveConsole::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveConsole::RunL()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_RUNL, "CActiveConsole::RunL()");
+	    }
 	ProcessKeyPressL(static_cast<TChar>(iConsole->KeyCode()));
 	}
 
@@ -270,53 +309,87 @@
 	if (!iBufferSizeChosen)
 		{
 		iConsole->Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER, "\n");
 		iConsole->Printf(_L("++++ Choose max. Transfer Size ++++\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP01, "++++ Choose max. Transfer Size ++++\n");
 		iConsole->Printf(_L("  '0' - Set up USB device for USBCV\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP02, "  '0' - Set up USB device for USBCV\n");
 		iConsole->Printf(_L("  '1' -   32 bytes\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP03, "  '1' -   32 bytes\n");
 		iConsole->Printf(_L("  '2' - 1024 bytes\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP04, "  '2' - 1024 bytes\n");
 		iConsole->Printf(_L("  '3' -   64 kbytes\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP05, "  '3' -   64 kbytes\n");
 		iConsole->Printf(_L("  '4' -    1 Mbyte\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP06, "  '4' -    1 Mbyte\n");
 		}
 	else if (!iBandwidthPriorityChosen)
 		{
 		iConsole->Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP07, "\n");
 		iConsole->Printf(_L("++++ Choose Bandwidth Priority ++++\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP08, "++++ Choose Bandwidth Priority ++++\n");
 		iConsole->Printf(_L("  '1' - Economical buffering - default\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP09, "  '1' - Economical buffering - default\n");
 		iConsole->Printf(_L("  '2' - More memory than default buffering - Plus1\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP10, "  '2' - More memory than default buffering - Plus1\n");
 		iConsole->Printf(_L("  '3' - More memory than Plus1 buffering - Plus2\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP11, "  '3' - More memory than Plus1 buffering - Plus2\n");
 		iConsole->Printf(_L("  '4' - Maximum buffering\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP12, "  '4' - Maximum buffering\n");
 		}
 	else if (!iDMAChosen)
 		{
 		iConsole->Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP13, "\n");
 		iConsole->Printf(_L("++++ Choose Endpoint I/O Transfer Mode ++++\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP14, "++++ Choose Endpoint I/O Transfer Mode ++++\n");
 		iConsole->Printf(_L("  '1' - Interrupt Mode\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP15, "  '1' - Interrupt Mode\n");
 		iConsole->Printf(_L("  '2' - DMA Mode (recommended)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP16, "  '2' - DMA Mode (recommended\n");
 		}
 	else if (!iDoubleBufferingChosen)
 		{
 		iConsole->Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP17, "\n");
 		iConsole->Printf(_L("++++ Choose Endpoint FIFO Mode ++++\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP18, "++++ Choose Endpoint FIFO Mode ++++\n");
 		iConsole->Printf(_L("  '1' - Normal Buffering Mode\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP19, "  '1' - Normal Buffering Mode\n");
 		iConsole->Printf(_L("  '2' - Double Buffering Mode (recommended)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP20, "  '2' - Double Buffering Mode (recommended\n");
 		}
 	else
 		{
 		iConsole->Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP21, "\n");
 		iConsole->Printf(_L("++++ Select Program Option ++++\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP22, "++++ Select Program Option ++++\n");
 		iConsole->Printf(_L("  'L'oop test\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP23, "  'L'oop test\n");
 		iConsole->Printf(_L("   Loop test with data 'C'ompare\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP24, "   Loop test with data 'C'ompare\n");
 		iConsole->Printf(_L("  'R'eceive-only test (we receive, host transmits)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP25, "  'R'eceive-only test (we receive, host transmits\n");
 		iConsole->Printf(_L("  'T'ransmit-only test\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP26, "  'T'ransmit-only test\n");
 		iConsole->Printf(_L("   Receive and 'P'ut (write) to File\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP27, "   Receive and 'P'ut (writeto File\n");
 		iConsole->Printf(_L("   Transmit and 'G'et (read) from File\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP28, "   Transmit and 'G'et (readfrom File\n");
 		iConsole->Printf(_L("   Signal Remote-'W'akeup to the host\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP29, "   Signal Remote-'W'akeup to the host\n");
 		iConsole->Printf(_L("  'S'top current transfer\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP30, "  'S'top current transfer\n");
 #ifdef WITH_DUMP_OPTION
 		iConsole->Printf(_L("  'D'ump USB regs to debugout\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP31, "  'D'ump USB regs to debugout\n");
 #endif
 		iConsole->Printf(_L("   Re'E'numerate device\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP32, "   Re'E'numerate device\n");
 		iConsole->Printf(_L("  'Q'uit this app\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP33, "  'Q'uit this app\n");
 		}
 	iConsole->Read(iStatus);
 	SetActive();
@@ -327,7 +400,7 @@
 	{
 	if (aChar == EKeyEscape)
 		{
-		RDebug::Print(_L("CActiveConsole: ESC key pressed -> stopping active scheduler..."));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL, "CActiveConsole: ESC key pressed -> stopping active scheduler...");
 		CActiveScheduler::Stop();
 		return;
 		}
@@ -355,9 +428,11 @@
 			break;
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
+			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP01, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		TUSB_PRINT1("Maximum buffer size set to %d bytes", iRW->MaxBufSize());
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP02, "Maximum buffer size set to %d bytes", iRW->MaxBufSize());
 		iBufferSizeChosen = ETrue;
 		}
 	else if (!iBandwidthPriorityChosen)
@@ -368,33 +443,41 @@
 		case '1':
 			iBandwidthPriority = EUsbcBandwidthOUTDefault | EUsbcBandwidthINDefault;
 			TUSB_PRINT("Bandwith priority set to default");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP03, "Bandwith priority set to default");
 			break;
 		case '2':
 			iBandwidthPriority = EUsbcBandwidthOUTPlus1 | EUsbcBandwidthINPlus1;
 			TUSB_PRINT("Bandwith priority set to Plus1");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP04, "Bandwith priority set to Plus1");
 			break;
 		case '3':
 			iBandwidthPriority = EUsbcBandwidthOUTPlus2 | EUsbcBandwidthINPlus2;
 			TUSB_PRINT("Bandwith priority set to Plus2");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP05, "Bandwith priority set to Plus2");
 			break;
 		case '4':
 			iBandwidthPriority = EUsbcBandwidthINMaximum | EUsbcBandwidthOUTMaximum;
 			TUSB_PRINT("Bandwith priority set to maximum");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP06, "Bandwith priority set to maximum");
 			break;
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
+			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP07, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		TUSB_PRINT1("(Set to 0x%08X)", iBandwidthPriority);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP08, "(Set to 0x%08X)", iBandwidthPriority);
 		iBandwidthPriorityChosen = ETrue;
 		
 		if (!iResourceAllocationV2)
 			{
 			TUSB_PRINT("Configuring interface...");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP09, "Configuring interface...");
 			TInt r = SetupInterface();
 			if (r != KErrNone)
 				{
 				TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
+				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP10, "Error: %d. Stopping active scheduler...", r);
 				CActiveScheduler::Stop();
 				return;
 				}
@@ -408,6 +491,7 @@
 		case '1':
 			{
 			TUSB_PRINT("- Trying to deallocate endpoint DMA:\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP11, "- Trying to deallocate endpoint DMA:\n");
 			if (!iResourceAllocationV2)
 				{
 				DeAllocateEndpointDMA(EEndpoint1);
@@ -419,6 +503,7 @@
 		case '2':
 			{
 			TUSB_PRINT("- Trying to allocate endpoint DMA:\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP12, "- Trying to allocate endpoint DMA:\n");
 			if (!iResourceAllocationV2)
 				{
 				AllocateEndpointDMA(EEndpoint1);
@@ -429,6 +514,7 @@
 			}
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
+			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP13, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		iDMAChosen = ETrue;
@@ -441,6 +527,7 @@
 		case '1':
 			{
 			TUSB_PRINT("- Trying to deallocate Double Buffering:\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP14, "- Trying to deallocate Double Buffering:\n");
 			if (!iResourceAllocationV2)
 				{
 				DeAllocateDoubleBuffering(EEndpoint1);
@@ -452,6 +539,7 @@
 		case '2':
 			{
 			TUSB_PRINT("- Trying to allocate Double Buffering:\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP15, "- Trying to allocate Double Buffering:\n");
 			if (!iResourceAllocationV2)
 				{
 				AllocateDoubleBuffering(EEndpoint1);
@@ -462,6 +550,7 @@
 			}
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
+			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP16, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		iDoubleBufferingChosen = ETrue;
@@ -469,10 +558,12 @@
 		if (iResourceAllocationV2)
 		{
 		TUSB_PRINT("Configuring interface...");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP17, "Configuring interface...");
 		TInt r = SetupInterface();
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
+			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP18, "Error: %d. Stopping active scheduler...", r);
 			CActiveScheduler::Stop();
 			return;
 			}
@@ -480,14 +571,17 @@
 
 		// Everything chosen, so let's re-enumerate...
 		TUSB_PRINT("Enumeration...");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP19, "Enumeration...");
 		TInt r = ReEnumerate();
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
+			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP20, "Error: %d. Stopping active scheduler...", r);
 			CActiveScheduler::Stop();
 			return;
 			}
 		TUSB_PRINT("Device successfully re-enumerated\n");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP21, "Device successfully re-enumerated\n");
 
 		// Make sure program versions match if testing against USBRFLCT
 		if (iRW->MaxBufSize() != 0)
@@ -496,6 +590,7 @@
 			if (r != KErrNone)
 				{
 				TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
+				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP22, "Error: %d. Stopping active scheduler...", r);
 				CActiveScheduler::Stop();
 				return;
 				}
@@ -509,30 +604,35 @@
 		case 'l':					// start loop test
 		case 'L':
 			TUSB_PRINT("-> Loop test selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP23, "-> Loop test selected\n");
 			iRW->SetTransferMode(ELoop);
 			iRW->SendPreamble();
 			break;
 		case 'c':					// start loop/compare test
 		case 'C':
 			TUSB_PRINT("-> Loop test with compare selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP24, "-> Loop test with compare selected\n");
 			iRW->SetTransferMode(ELoopComp);
 			iRW->SendPreamble();
 			break;
 		case 'r':					// start receive-only test
 		case 'R':
 			TUSB_PRINT("-> Receive-only test selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP25, "-> Receive-only test selected\n");
 			iRW->SetTransferMode(EReceiveOnly);
 			iRW->SendPreamble();
 			break;
 		case 't':					// start transmit-only test
 		case 'T':
 			TUSB_PRINT("-> Transmit-only test selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP26, "-> Transmit-only test selected\n");
 			iRW->SetTransferMode(ETransmitOnly);
 			iRW->SendPreamble();
 			break;
 		case 'g':					// start transmit & get-from-file test
 		case 'G':
 			TUSB_PRINT("-> Transmit from file test selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP27, "-> Transmit from file test selected\n");
 			iRW->SetTransferMode(ETransmitOnly);
 			iRW->ReadFromDisk(ETrue);
 			iRW->SendPreamble();
@@ -540,6 +640,7 @@
 		case 'p':					// start receive & put-to-file test
 		case 'P':
 			TUSB_PRINT("-> Receive to file test selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP28, "-> Receive to file test selected\n");
 			iRW->SetTransferMode(EReceiveOnly);
 			iRW->WriteToDisk(ETrue);
 			iRW->SendPreamble();
@@ -547,17 +648,20 @@
 		case 'w':					// remote-wakeup
 		case 'W':
 			TUSB_PRINT("-> Signal Remote-wakeup selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP29, "-> Signal Remote-wakeup selected\n");
 			iPort.SignalRemoteWakeup();
 			break;
 		case 's':					// stop either
 		case 'S':
 			TUSB_PRINT("-> Stop transfer selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP30, "-> Stop transfer selected\n");
 			iRW->Stop();
 			break;
 #ifdef WITH_DUMP_OPTION
 		case 'd':					// dump controller registers
 		case 'D':
 			TUSB_PRINT("-> Dump option selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP31, "-> Dump option selected\n");
 			iPort.DumpRegisters();
 			QueryRxBuffer();
 			break;
@@ -565,16 +669,23 @@
 		case 'e':					// ReEnumerate()
 		case 'E':
 			TUSB_PRINT("-> Re-enumerate device selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP32, "-> Re-enumerate device selected\n");
 			ReEnumerate();
 			break;
 		case 'q':					// quit
 		case 'Q':
 			TUSB_PRINT("-> Quit program selected\n");
+			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP33, "-> Quit program selected\n");
 			TUSB_VERBOSE_PRINT("CActiveConsole: stopping active scheduler...");
+			if(iVerbose)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP34, "CActiveConsole: stopping active scheduler...");
+			    }
 			CActiveScheduler::Stop();
 			return;
 		default:
 			TUSB_PRINT1("-> Not a valid input character: %c", aChar.operator TUint());
+			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP35, "-> Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		}
@@ -592,11 +703,11 @@
 	TInt r = iPort.QueryReceiveBuffer(EEndpoint2, bytes);
 	if (r != KErrNone)
 		{
-		RDebug::Print(_L(" Error %d on querying read buffer\n"), r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYRXBUFFER, " Error %d on querying read buffer\n", r);
 		}
 	else
 		{
-		RDebug::Print(_L(" %d bytes in RX buffer\n"), bytes);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYRXBUFFER_DUP01, " %d bytes in RX buffer\n", bytes);
 		}
 	}
 #endif
@@ -637,35 +748,56 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device capabilities", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL, "Error %d on querying device capabilities", r);
 		return KErrGeneral;
 		}
 	const TInt n = d_caps().iTotalEndpoints;
 
 	TUSB_PRINT("###  USB device capabilities:");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP01, "###  USB device capabilities:");
 	TUSB_PRINT1("Number of endpoints:                        %d", n);
+	OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP02, "Number of endpoints:                        %d", n);
 	TUSB_PRINT1("Supports Software-Connect:                  %s",
 				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP03, "Supports Software-Connect:                  %s",
+				d_caps().iConnect ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Device is Self-Powered:                     %s",
 				d_caps().iSelfPowered ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP04, "Device is Self-Powered:                     %s",
+				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports Remote-Wakeup:                     %s",
 				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP05, "Supports Remote-Wakeup:                     %s",
+				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports High-speed:                        %s",
 				d_caps().iHighSpeed ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP06, "Supports High-speed:                        %s",
+				d_caps().iHighSpeed ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports OTG:                               %s",
 				iOtg ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP07, "Supports OTG:                               %s",
+				iOtg ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports unpowered cable detection:         %s",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
 				_S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP08, "Supports unpowered cable detection:         %s",
+				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
+				_L("yes") : _L("no"));
 	TUSB_PRINT1("Supports endpoint resource alloc scheme V2: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
 				_S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP09, "Supports endpoint resource alloc scheme V2: %s\n",
+				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
+				_L("yes") : _L("no"));
 	TUSB_PRINT("");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP10, "");
 
 	iSoftwareConnect = d_caps().iConnect;					// we need to remember this
 
 	if (n < 2)
 		{
 		TUSB_PRINT1("Error: only %d endpoints available on device", n);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP11, "Error: only %d endpoints available on device", n);
 		return KErrGeneral;
 		}
 
@@ -676,16 +808,21 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying endpoint capabilities", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP12, "Error %d on querying endpoint capabilities", r);
 		return KErrGeneral;
 		}
 	TUSB_PRINT("### USB device endpoint capabilities:");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP13, "### USB device endpoint capabilities:");
 	for (TInt i = 0; i < n; i++)
 		{
 		const TUsbcEndpointCaps* caps = &data[i].iCaps;
 		TUSB_PRINT2("Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x",
 					caps->iSizes, caps->iTypesAndDir);
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP14, "Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x",
+					caps->iSizes, caps->iTypesAndDir);
 		}
 	TUSB_PRINT("");
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP15, "");
 
 	// Set up the active interface
 	TUsbcInterfaceInfoBuf ifc;
@@ -703,6 +840,7 @@
 			if (!(mps == 64 || mps == 512))
 				{
 				TUSB_PRINT1("Funny Bulk IN MaxPacketSize: %d - T_USB will probably fail...", mps);
+				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP16, "Funny Bulk IN MaxPacketSize: %d - T_USB will probably fail...", mps);
 				}
 			// EEndpoint1 is going to be our Tx (IN) endpoint
 			ifc().iEndpointData[0].iType = KUsbEpTypeBulk;
@@ -719,6 +857,7 @@
 			if (!(mps == 64 || mps == 512))
 				{
 				TUSB_PRINT1("Funny Bulk OUT MaxPacketSize: %d - T_USB will probably fail...", mps);
+				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP17, "Funny Bulk OUT MaxPacketSize: %d - T_USB will probably fail...", mps);
 				}
 			// EEndpoint2 is going to be our Rx (OUT) endpoint
 			ifc().iEndpointData[1].iType = KUsbEpTypeBulk;
@@ -732,6 +871,7 @@
 	if (ep_found != 2)
 		{
 		TUSB_PRINT1("No suitable endpoints found", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP18, "No suitable endpoints found:%d", r);
 		return KErrGeneral;
 		}
 
@@ -759,6 +899,7 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on setting active interface", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP19, "Error %d on setting active interface", r);
 		}
 
 	// Find ep's for an alternate ifc setting.
@@ -766,6 +907,7 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		TUSB_PRINT("Alternate Interfaces not supported - skipping alternate setting setup\n");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP20, "Alternate Interfaces not supported - skipping alternate setting setup\n");
 		return KErrNone;
 		}
 	ep_found = 0;
@@ -834,6 +976,7 @@
 	if (ep_found == 0)
 		{
 		TUSB_PRINT("Not enough suitable endpoints found for alt ifc");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP21, "Not enough suitable endpoints found for alt ifc");
 		// not a disaster though
 		return KErrNone;
 		}
@@ -850,6 +993,7 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on setting alternate interface", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP22, "Error %d on setting alternate interface", r);
 		}
 
 	return r;
@@ -860,22 +1004,24 @@
 	{
 	TInt r = iPort.AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
 	if (r == KErrNone)
-		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNone"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA, "DMA allocation on endpoint %d: KErrNone", aEndpoint);
 	else if (r == KErrInUse)
-		RDebug::Print(_L("DMA allocation on endpoint %d: KErrInUse"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP01, "DMA allocation on endpoint %d: KErrInUse", aEndpoint);
 	else if (r == KErrNotSupported)
-		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNotSupported"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP02, "DMA allocation on endpoint %d: KErrNotSupported", aEndpoint);
 	else
-		RDebug::Print(_L("DMA allocation on endpoint %d: unexpected return value %d"),
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP03, "DMA allocation on endpoint %d: unexpected return value %d",
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	TUSB_PRINT2("DMA on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP04, "DMA on endpoint %d %s\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 
 	if ((r == KErrNone) && !res)
-		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP05, "(Allocation success but negative query result: contradiction!)\n");
 	else if ((r != KErrNone) && res)
-		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP06, "(Allocation failure but positive query result: contradiction!)\n");
 	}
 
 
@@ -883,15 +1029,17 @@
 	{
 	TInt r = iPort.DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
 	if (r == KErrNone)
-		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNone"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA, "DMA deallocation on endpoint %d: KErrNone", aEndpoint);
 	else if (r == KErrNotSupported)
-		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP01, "DMA deallocation on endpoint %d: KErrNotSupported", aEndpoint);
 	else
-		RDebug::Print(_L("DMA deallocation on endpoint %d: unexpected return value %d"),
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP02, "DMA deallocation on endpoint %d: unexpected return value %d",
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	TUSB_PRINT2("DMA on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP03, "DMA on endpoint %d %s\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 	}
 
 
@@ -899,22 +1047,24 @@
 	{
 	TInt r = iPort.AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNone"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING, "Double Buffering allocation on endpoint %d: KErrNone", aEndpoint);
 	else if (r == KErrInUse)
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrInUse"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering allocation on endpoint %d: KErrInUse", aEndpoint);
 	else if (r == KErrNotSupported)
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNotSupported"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering allocation on endpoint %d: KErrNotSupported", aEndpoint);
 	else
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: unexpected return value %d"),
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering allocation on endpoint %d: unexpected return value %d",
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP04, "Double Buffering on endpoint %d %s\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 
 	if ((r == KErrNone) && !res)
-		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP05, "(Allocation success but negative query result: contradiction!)\n");
 	else if ((r != KErrNone) && res)
-		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP06, "(Allocation failure but positive query result: contradiction!)\n");
 	}
 
 
@@ -922,15 +1072,17 @@
 	{
 	TInt r = iPort.DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNone"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING, "Double Buffering deallocation on endpoint %d: KErrNone", aEndpoint);
 	else if (r == KErrNotSupported)
-		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering deallocation on endpoint %d: KErrNotSupported", aEndpoint);
 	else
-		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: unexpected return value %d"),
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering deallocation on endpoint %d: unexpected return value %d",
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering on endpoint %d %s\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 	}
 
 
@@ -941,15 +1093,21 @@
 	if (!iSoftwareConnect)
 		{
 		iConsole->Printf(_L("This device does not support software\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE, "This device does not support software\n");
 		iConsole->Printf(_L("disconnect/reconnect\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP01, "disconnect/reconnect\n");
 		iConsole->Printf(_L("Please physically unplug and replug\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP02, "Please physically unplug and replug\n");
 		iConsole->Printf(_L("the USB cable NOW... "));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP03, "the USB cable NOW... ");
 		}
 	iConsole->Printf(_L("\n>>> START THE USBRFLCT PROGRAM ON THE HOST SIDE NOW <<<\n"));
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP04, "\n>>> START THE USBRFLCT PROGRAM ON THE HOST SIDE NOW <<<\n");
 	User::WaitForRequest(enum_status);
 	if (enum_status != KErrNone)
 		{
 		TUSB_PRINT1("Error: Re-enumeration status = %d", enum_status.Int());
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP05, "Error: Re-enumeration status = %d", enum_status.Int());
 		return KErrGeneral;
 		}
 	TUsbcDeviceState device_state =	EUsbcDeviceStateUndefined;
@@ -957,6 +1115,7 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device state", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP06, "Error %d on querying device state", r);
 		}
 	else
 		{
@@ -969,6 +1128,15 @@
 						((device_state == EUsbcDeviceStateConfigured) ? _S("Configured") :
 						 ((device_state == EUsbcDeviceStateSuspended) ? _S("Suspended") :
 						  _S("Unknown"))))))));
+		OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP07, "Current device state: %s",
+					(device_state == EUsbcDeviceStateUndefined) ? _L("Undefined") :
+					((device_state == EUsbcDeviceStateAttached) ? _L("Attached") :
+					 ((device_state == EUsbcDeviceStatePowered) ? _L("Powered") :
+					  ((device_state == EUsbcDeviceStateDefault) ? _L("Default") :
+					   ((device_state == EUsbcDeviceStateAddress) ? _L("Address") :
+						((device_state == EUsbcDeviceStateConfigured) ? _L("Configured") :
+						 ((device_state == EUsbcDeviceStateSuspended) ? _L("Suspended") :
+						  _L("Unknown"))))))));
 		}
 
 	// Check the speed of the established physical USB connection
@@ -976,12 +1144,14 @@
 	if (iHighSpeed)
 		{
 		TUSB_PRINT("---> USB High-speed Testing\n");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP08, "---> USB High-speed Testing\n");
 		// It can only be 512 bytes when using high-speed.
 		iRW->SetMaxPacketSize(512);							// iRW already exists at this point
 		}
 	else
 		{
 		TUSB_PRINT("---> USB Full-speed Testing\n");
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP09, "---> USB Full-speed Testing\n");
 		// We only support 64 bytes when using full-speed.
 		iRW->SetMaxPacketSize(64);							// iRW already exists at this point
 		}
@@ -1044,6 +1214,12 @@
 				(deviceDescriptor[KUsbDevReleaseOffset + 1] & 0x0f),
 				((deviceDescriptor[KUsbDevReleaseOffset] >> 4) & 0x0f),
 				(deviceDescriptor[KUsbDevReleaseOffset] & 0x0f));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_SETUPDESCRIPTORS, "\nVID = 0x%04X / PID = 0x%04X / ", Vid, Pid);
+	OstTraceExt4(TRACE_NORMAL, CACTIVECONSOLE_SETUPDESCRIPTORS_DUP01, "DevRel = %d%d.%d%d\n", 
+				((deviceDescriptor[KUsbDevReleaseOffset + 1] >> 4) & 0x0f),
+				(deviceDescriptor[KUsbDevReleaseOffset + 1] & 0x0f),
+				((deviceDescriptor[KUsbDevReleaseOffset] >> 4) & 0x0f),
+				(deviceDescriptor[KUsbDevReleaseOffset] & 0x0f));
 
 	// === Configuration Descriptor
 
@@ -1101,6 +1277,10 @@
 	  iVerbose(aVerboseOutput)
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::CActiveRW()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CACTIVERW, "CActiveRW::CActiveRW()");
+	    }
 	}
 
 
@@ -1118,6 +1298,10 @@
 void CActiveRW::ConstructL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ConstructL()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CONSTRUCTL, "CActiveRW::ConstructL()");
+	    }
 
 	User::LeaveIfError(iFs.Connect());
 
@@ -1140,6 +1324,7 @@
 	if (!iTimeoutTimer)
 		{
 		TUSB_PRINT("Failed to create timeout timer");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_CONSTRUCTL_DUP01, "Failed to create timeout timer");
 		}
 	}
 
@@ -1147,6 +1332,10 @@
 CActiveRW::~CActiveRW()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::~CActiveRW()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DCACTIVERW, "CActiveRW::~CActiveRW()");
+	    }
 	Cancel();												// base class
 	delete iTimeoutTimer;
 	iFile.Close();
@@ -1159,6 +1348,7 @@
 	if (aBufSz > KMaxBufSize)
 		{
 		TUSB_PRINT2("SetMaxBufSize(): too large: %d! (using %d)", aBufSz, KMaxBufSize);
+		OstTraceExt2(TRACE_NORMAL, CACTIVERW_SETMAXBUFSIZE, "SetMaxBufSize(): too large: %d! (using %d)", aBufSz, KMaxBufSize);
 		aBufSz = KMaxBufSize;
 		}
 	iMaxBufSz = aBufSz;
@@ -1191,13 +1381,19 @@
 void CActiveRW::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::RunL()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RUNL, "CActiveRW::RunL()");
+	    }
 	if (iStatus != KErrNone)
 		{
 		TUSB_PRINT1("Error %d in RunL", iStatus.Int());
+		OstTrace1(TRACE_NORMAL, CACTIVERW_RUNL_DUP01, "Error %d in RunL", iStatus.Int());
 		}
 	if (iDoStop)
 		{
 		TUSB_PRINT("Stopped");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP02, "Stopped");
 		iDoStop = EFalse;
 		return;
 		}
@@ -1222,6 +1418,7 @@
 			if (num != ++iPktNum)
 				{
 				TUSB_PRINT2("*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
+				OstTraceExt2(TRACE_NORMAL, CACTIVERW_RUNL_DUP03, "*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
 				// Update the packet number with the received number, so that
 				// if a single packet is duplicated or lost then a single error occurs
 				iPktNum = num;
@@ -1231,6 +1428,11 @@
 				// Write out to disk previous completed Read
 				TUSB_VERBOSE_PRINT2("iMaxBufSz = %d (iReadBuf.Size(): %d)",
 									iMaxBufSz, iReadBuf.Size());
+				if(iVerbose)
+				    {
+				    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_RUNL_DUP04, "iMaxBufSz = %d (iReadBuf.Size(): %d)",
+									iMaxBufSz, iReadBuf.Size());
+				    }
 				WriteBufferToDisk(iReadBuf, iMaxBufSz);
 				}
 			ReadData();										// next we read data
@@ -1241,6 +1443,7 @@
 			if (!CompareBuffers(iBufSz))
 				{
 				TUSB_PRINT1("Error while comparing tx & rx buffers for packet 0x%x", iPktNum);
+				OstTrace1(TRACE_NORMAL, CACTIVERW_RUNL_DUP05, "Error while comparing tx & rx buffers for packet 0x%x", iPktNum);
 				}
 			}
 		else if (iBufSz > 3)
@@ -1249,6 +1452,7 @@
 			if (num != iPktNum)
 				{
 				TUSB_PRINT2("*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
+				OstTraceExt2(TRACE_NORMAL, CACTIVERW_RUNL_DUP06, "*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
 				}
 			}
 		if (iBufSz == iMaxBufSz)
@@ -1263,6 +1467,7 @@
 		break;
 	default:
 		TUSB_PRINT("Oops. (Shouldn't end up here...)");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP07, "Oops. (Shouldn't end up here...)");
 		break;
 		}
 	return;
@@ -1272,15 +1477,21 @@
 TInt CActiveRW::SendVersion()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::SendVersion()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDVERSION, "CActiveRW::SendVersion()");
+	    }
 	if (iXferMode != ::ENone)
 		{
 		TUSB_PRINT1("Error : wrong state: %d", iXferMode);
+		OstTrace1(TRACE_NORMAL, CACTIVERW_SENDVERSION_DUP01, "Error : wrong state: %d", iXferMode);
 		return KErrGeneral;
 		}
 	// Here we send our version packet to the host.
 	// (We can use the preamble buffer because we only need it
 	//  once and that's also before the preamble uses.)
 	TUSB_PRINT1("Sending T_USB version: %d\n", KTusbVersion);
+	OstTrace1(TRACE_NORMAL, CACTIVERW_SENDVERSION_DUP02, "Sending T_USB version: %d\n", KTusbVersion);
 	iPreambleBuf.FillZ();
 	*reinterpret_cast<TUint32*>(&iPreambleBuf[0]) = SWAP_BYTES_32(KTusbVersion);
 	// A 'magic' string so that USBRFLCT doesn't interpret the first 4 bytes
@@ -1292,8 +1503,16 @@
 	TRequestStatus send_status;
 	iPort->Write(send_status, EEndpoint1, iPreambleBuf, KPreambleLength);
 	TUSB_VERBOSE_PRINT("Waiting for write request to complete...");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDVERSION_DUP03, "Waiting for write request to complete...");
+	    }
 	User::WaitForRequest(send_status);
 	TUSB_VERBOSE_PRINT("...done.\n");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDVERSION_DUP04, "...done.\n");
+	    }
 	return send_status.Int();
 	}
 
@@ -1301,50 +1520,87 @@
 TInt CActiveRW::ReceiveVersion()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ReceiveVersion()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION, "CActiveRW::ReceiveVersion()");
+	    }
 	if (iXferMode != ::ENone)
 		{
 		TUSB_PRINT1("Error : wrong state: %d", iXferMode);
+		OstTrace1(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP01, "Error : wrong state: %d", iXferMode);
 		return KErrGeneral;
 		}
 	// Here we try to receive a version packet from the host.
 	// (We can use the preamble buffer because we only need it
 	//  once and that's also before the preamble uses.)
 	TUSB_PRINT("Getting host program versions...");
+	OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP02, "Getting host program versions...");
 	iPreambleBuf.FillZ();
 	TRequestStatus receive_status;
 	iPort->Read(receive_status, EEndpoint2, iPreambleBuf, KPreambleLength);
 	TUSB_VERBOSE_PRINT("Waiting for read request to complete...");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION_DUP03, "Waiting for read request to complete...");
+	    }
 	iTimeoutTimer->Activate(5000000);						// Host gets 5s
 	User::WaitForRequest(receive_status, iTimeoutTimer->iStatus);
 	if (receive_status == KRequestPending)
 		{
 		// Read() still pending...
 		TUSB_PRINT("Cancelling USB Read(): no response from host.\n");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP04, "Cancelling USB Read(): no response from host.\n");
 		iPort->ReadCancel(EEndpoint2);
 		TUSB_PRINT("THIS COULD BE DUE TO AN OLD VERSION OF USBRFLCT ON THE PC:");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP05, "THIS COULD BE DUE TO AN OLD VERSION OF USBRFLCT ON THE PC:");
 		TUSB_PRINT3("PLEASE CHECK THE VERSION THERE - WE NEED AT LEAST V%d.%d.%d!\n",
 					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
+		OstTraceExt3(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP06, "PLEASE CHECK THE VERSION THERE - WE NEED AT LEAST V%d.%d.%d!\n",
+					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
 		TUSB_PRINT("When updating an existing USBRFLCT installation <= v1.3.1,\n" \
 				   L"the following three things will need to be done:\n");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP07, "When updating an existing USBRFLCT installation <= v1.3.1,\n" \
+				   L"the following three things will need to be done:\n");
 		TUSB_PRINT("1. Connect the device to the PC & start T_USB (just as now),\n" \
 				   L"then find the USB device in the Windows Device Manager\n" \
 				   L"('Control Panel'->'System'->'Hardware'->'Device Manager').\n" \
 				   L"Right click on the device name and choose 'Uninstall...'.\n");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP08, "1. Connect the device to the PC & start T_USB (just as now),\n" \
+				   L"then find the USB device in the Windows Device Manager\n" \
+				   L"('Control Panel'->'System'->'Hardware'->'Device Manager').\n" \
+				   L"Right click on the device name and choose 'Uninstall...'.\n");
 		TUSB_PRINT("2. In c:\\winnt\\inf\\, find (by searching for \"Symbian\") and\n" \
 				   L"delete the *.INF file that was used to install the existing\n" \
 				   L"version of USBRFLCT.SYS. Make sure to also delete the\n" \
 				   L"precompiled version of that file (<samename>.PNF).\n");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP09, "2. In c:\\winnt\\inf\\, find (by searching for \"Symbian\") and\n" \
+				   L"delete the *.INF file that was used to install the existing\n" \
+				   L"version of USBRFLCT.SYS. Make sure to also delete the\n" \
+				   L"precompiled version of that file (<samename>.PNF).\n");
 		TUSB_PRINT("3. In c:\\winnt\\system32\\drivers\\, delete the file USBRFLCT.SYS.\n");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP10, "3. In c:\\winnt\\system32\\drivers\\, delete the file USBRFLCT.SYS.\n");
 		TUSB_PRINT("Then unplug & reconnect the USB device and, when prompted, install\n" \
 				   L"the new USBRFLCT.SYS driver using the .INF file from this distribution.\n" \
 				   L"(All files can be found under e32test\\win32\\usbrflct_distribution\\.)\n");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP11, "Then unplug & reconnect the USB device and, when prompted, install\n" \
+				   L"the new USBRFLCT.SYS driver using the .INF file from this distribution.\n" \
+				   L"(All files can be found under e32test\\win32\\usbrflct_distribution\\.)\n");
 		TUSB_PRINT("Use the new USBRFLCT.EXE from this distribution.\n");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP12, "Use the new USBRFLCT.EXE from this distribution.\n");
 		}
 	else
 		{
 		TUSB_VERBOSE_PRINT("...done.");
+		if(iVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION_DUP13, "...done.");
+		    }
 		// Timeout not needed any longer
 		TUSB_VERBOSE_PRINT("Cancelling timeout timer: USB Read() completed.\n");
+		if(iVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION_DUP14, "Cancelling timeout timer: USB Read() completed.\n");
+		    }
 		iTimeoutTimer->Cancel();
 		}
 	return receive_status.Int();
@@ -1354,6 +1610,10 @@
 TInt CActiveRW::ExchangeVersions()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ExchangeVersions()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_EXCHANGEVERSIONS, "CActiveRW::ExchangeVersions()");
+	    }
 	// First check the version of USBRFLCT that's running on the host
 	TInt r = ReceiveVersion();
 	if (r != KErrNone)
@@ -1368,10 +1628,15 @@
 	TUSB_PRINT5("Host-side: USBRFLCT v%d.%d.%d  USBIO v%d.%d\n",
 				usbrflct_ver_major, usbrflct_ver_minor, usbrflct_ver_micro,
 				usbio_ver_major, usbio_ver_minor);
+	OstTraceExt5(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP01, "Host-side: USBRFLCT v%d.%d.%d  USBIO v%d.%d\n",
+				usbrflct_ver_major, usbrflct_ver_minor, usbrflct_ver_micro,
+				usbio_ver_major, usbio_ver_minor);
 	if (usbrflct_ver_major < KUsbrflctVersionMajor)
 		{
 		TUSB_PRINT1("USBRFLCT version not sufficient (need at least v%d.x.x)\n",
 					KUsbrflctVersionMajor);
+		OstTrace1(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP02, "USBRFLCT version not sufficient (need at least v%d.x.x)\n",
+					KUsbrflctVersionMajor);
 		return KErrGeneral;
 		}
 	// Just using '<' instead of the seemingly absurd '<= && !==' doesn't work without
@@ -1381,6 +1646,8 @@
 		{
 		TUSB_PRINT2("USBRFLCT version not sufficient (need at least v%d.%d.x)\n",
 					KUsbrflctVersionMajor, KUsbrflctVersionMinor);
+		OstTraceExt2(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP03, "USBRFLCT version not sufficient (need at least v%d.%d.x)\n",
+					KUsbrflctVersionMajor, KUsbrflctVersionMinor);
 		return KErrGeneral;
 		}
 	// Just using '<' instead of the seemingly absurd '<= && !==' doesn't work without
@@ -1390,6 +1657,8 @@
 		{
 		TUSB_PRINT3("USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
 					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
+		OstTraceExt3(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP04, "USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
+					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
 		return KErrGeneral;
 		}
 	// Now we send T_USB's version to the host
@@ -1405,8 +1674,16 @@
 void CActiveRW::SendPreamble()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::SendPreamble()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDPREAMBLE, "CActiveRW::SendPreamble()");
+	    }
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
 	TUSB_VERBOSE_PRINT1("Sending data length: %d bytes", iBufSz);
+	if(iVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_SENDPREAMBLE_DUP01, "Sending data length: %d bytes", iBufSz);
+	    }
 	*reinterpret_cast<TUint32*>(&iPreambleBuf[0]) = SWAP_BYTES_32(iBufSz);
 	iPort->Write(iStatus, EEndpoint1, iPreambleBuf, KPreambleLength);
 	iCurrentXfer = EPreamble;
@@ -1417,6 +1694,10 @@
 void CActiveRW::SendData()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::SendData()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDDATA, "CActiveRW::SendData()");
+	    }
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
 	if (iDiskAccessEnabled)
 		{
@@ -1435,6 +1716,10 @@
 			}
 		}
 	TUSB_VERBOSE_PRINT1("Sending data: %d bytes", iBufSz);
+	if(iVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_SENDDATA_DUP01, "Sending data: %d bytes", iBufSz);
+	    }
 	iPort->Write(iStatus, EEndpoint1, iWriteBuf, iBufSz);
 	iCurrentXfer = EWriteXfer;
 	SetActive();
@@ -1448,9 +1733,11 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFs::DriveList() returned %d", r);
+		OstTrace1(TRACE_NORMAL, CACTIVERW_SELECTDRIVE, "RFs::DriveList() returned %d", r);
 		return r;
 		}
 	TUSB_PRINT("Available drives:");
+	OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP01, "Available drives:");
 	for (TInt n = 0; n < KMaxDrives; n++)
 		{
 		if (driveList[n] != 0)
@@ -1461,13 +1748,17 @@
 				{
 				TPtr name(volumeInfo.iName.Des());
 				TUSB_PRINT2("Drive %c: %- 16S", 'A' + n, &name);
+				OstTraceExt2(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP02, "Drive %c: %S", 'A' + n, name);
 				if (volumeInfo.iDrive.iMediaAtt & KMediaAttWriteProtected)
 					TUSB_PRINT("  (read-only)");
+					OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP03, "  (read-only)");
 				TUSB_PRINT("");
+				OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP04, "");
 				}
 			}
 		}
 	iConsole->Printf(_L("Please select a drive letter (or 'Q' to quit)..."));
+	OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP05, "Please select a drive letter (or 'Q' to quit...");
 	TChar driveLetter;
 	TInt driveNumber;
 	TVolumeInfo volumeInfo;
@@ -1491,7 +1782,9 @@
 	iFileName.Format(_L("%c:"), driveLetter.operator TUint());
 	iFileName.Append(KFileName);
 	TUSB_PRINT1("\nFilename = %S", &iFileName);
+	OstTraceExt1(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP06, "\nFilename = %S", iFileName);
 	TUSB_PRINT1("File size: %d", KMaxFileSize);
+	OstTrace1(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP07, "File size: %d", KMaxFileSize);
 	return r;
 	}
 
@@ -1535,6 +1828,7 @@
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("RFile::Replace() returned %d", r);
+			OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK, "RFile::Replace() returned %d", r);
 			iDiskAccessEnabled = EFalse;
 			return r;
 			}
@@ -1546,24 +1840,28 @@
 			buffer[n] = static_cast<TUint8>(n & 0x000000ff);
 			}
 		TUSB_PRINT("Writing data to file (this may take some minutes...)");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP01, "Writing data to file (this may take some minutes...)");
 		for (TInt n = 0; n < KMaxFileSize; n += KBufferSize)
 			{
 			r = iFile.Write(buffer, KBufferSize);
 			if (r != KErrNone)
 				{
 				TUSB_PRINT1("RFile::Write() returned %d (disk full?)", r);
+				OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP02, "RFile::Write() returned %d (disk full?)", r);
 				iFile.Close();
 				iDiskAccessEnabled = EFalse;
 				return r;
 				}
 			}
 		TUSB_PRINT("Done.");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP03, "Done.");
 		iFile.Close();
 		// Now open the file for reading
 		r = iFile.Open(iFs, iFileName, EFileRead);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("RFile::Open() returned %d", r);
+			OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP04, "RFile::Open() returned %d", r);
 			iDiskAccessEnabled = EFalse;
 			return r;
 			}
@@ -1576,10 +1874,15 @@
 void CActiveRW::WriteBufferToDisk(TDes8& aBuffer, TInt aLen)
 	{
 	TUSB_VERBOSE_PRINT1("CActiveRW::WriteBufferToDisk(), len = %d", aLen);
+	if(iVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_WRITEBUFFERTODISK, "CActiveRW::WriteBufferToDisk(), len = %d", aLen);
+	    }
 	TInt r = iFile.Write(aBuffer, aLen);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error writing to %S (%d)", &iFileName, r);
+		OstTraceExt2(TRACE_NORMAL, CACTIVERW_WRITEBUFFERTODISK_DUP01, "Error writing to %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -1603,15 +1906,22 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error reading from %S (%d)", &iFileName, r);
+		OstTraceExt2(TRACE_NORMAL, CACTIVERW_READBUFFERFROMDISK, "Error reading from %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
 	TInt readLen = aBuffer.Length();
 	TUSB_VERBOSE_PRINT1("CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
+	if(iVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_READBUFFERFROMDISK_DUP01, "CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
+	    }
 	if (readLen < aLen)
 		{
 		TUSB_PRINT3("Only %d bytes of %d read from file %S)",
 					readLen, aLen, &iFileName);
+		OstTraceExt3(TRACE_NORMAL, CACTIVERW_READBUFFERFROMDISK_DUP02, "Only %d bytes of %d read from file %S)",
+					readLen, aLen, iFileName);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -1622,29 +1932,53 @@
 void CActiveRW::ReadData()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ReadData()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA, "CActiveRW::ReadData()");
+	    }
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
 	TUSB_VERBOSE_PRINT1("Reading data: %d bytes", iBufSz);
+	if(iVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_READDATA_DUP01, "Reading data: %d bytes", iBufSz);
+	    }
 	if (iXferMode == EReceiveOnly)
 		{
 		TUSB_VERBOSE_PRINT("  (rx only)");
+		if(iVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP02, "  (rx only)");
+		    }
 		iPort->Read(iStatus, EEndpoint2, iReadBuf, iBufSz);
 		}
 	else if (iBufSz == iMaxPktSz)
 		{
 		// we also want to test the packet version of Read()
 		TUSB_VERBOSE_PRINT("  (a single packet)");
+		if(iVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP03, "  (a single packet)");
+		    }
 		iPort->ReadPacket(iStatus, EEndpoint2, iReadBuf, iBufSz);
 		}
 	else if (iBufSz == iReadBuf.MaxSize())
 		{
 		// or we could perhaps test the three-parameter version
 		TUSB_VERBOSE_PRINT("  (w/o length)");
+		if(iVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP04, "  (w/o length)");
+		    }
 		iPort->Read(iStatus, EEndpoint2, iReadBuf);
 		}
 	else
 		{
 		// otherwise, we use the universal default version
 		TUSB_VERBOSE_PRINT("  (normal)");
+		if(iVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP05, "  (normal)");
+		    }
 		iPort->Read(iStatus, EEndpoint2, iReadBuf, iBufSz);
 		}
 	iCurrentXfer = EReadXfer;
@@ -1657,9 +1991,11 @@
 	if (!IsActive())
 		{
 		TUSB_PRINT("CActiveRW::Stop(): Not active");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_STOP, "CActiveRW::Stop(): Not active");
 		return;
 		}
 	TUSB_PRINT("Cancelling outstanding transfer requests\n");
+	OstTrace0(TRACE_NORMAL, CACTIVERW_STOP_DUP01, "Cancelling outstanding transfer requests\n");
 	iBufSz = KInitialBufSz;
 	iPktNum = ~0;
 	iDoStop = ETrue;
@@ -1671,6 +2007,10 @@
 void CActiveRW::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::DoCancel()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DOCANCEL, "CActiveRW::DoCancel()");
+	    }
 	// Canceling the transfer requests can be done explicitly
 	// for every transfer...
 	iPort->WriteCancel(EEndpoint1);
@@ -1683,13 +2023,26 @@
 TBool CActiveRW::CompareBuffers(TInt aLen)
 	{
 	TUSB_VERBOSE_PRINT1("CActiveRW::CompareBuffers(%d)", aLen);
+	if(iVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS, "CActiveRW::CompareBuffers(%d)", aLen);
+	    }
 	for (TInt i = 0; i < aLen; i++)
 		{
 		if (iReadBuf[i] != iWriteBuf[i])
 			{
 			TUSB_VERBOSE_PRINT1("Error: for i = %d:", i);
+			if(iVerbose)
+			    {
+			    OstTrace1(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS_DUP01, "Error: for i = %d:", i);
+			    }
 			TUSB_VERBOSE_PRINT2("iReadBuf: %d != iWriteBuf: %d",
 								iReadBuf[i], iWriteBuf[i]);
+			if(iVerbose)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS_DUP02, "iReadBuf: %d != iWriteBuf: %d",
+								iReadBuf[i], iWriteBuf[i]);
+			    }
 			return EFalse;
 			}
 		}
@@ -1730,6 +2083,10 @@
 CActiveStallNotifier::~CActiveStallNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::~CActiveStallNotifier()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER, "CActiveStallNotifier::~CActiveStallNotifier()");
+	    }
 	Cancel();												// base class
 	}
 
@@ -1737,6 +2094,10 @@
 void CActiveStallNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::DoCancel()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DOCANCEL, "CActiveStallNotifier::DoCancel()");
+	    }
 	iPort->EndpointStatusNotifyCancel();
 	}
 
@@ -1747,6 +2108,10 @@
 	// In a real world program, the user could take here appropriate action (cancel a
 	// transfer request or whatever).
 	TUSB_VERBOSE_PRINT1("StallNotifier: Endpointstate 0x%x\n", iEndpointState);
+	if(iVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_RUNL, "StallNotifier: Endpointstate 0x%x\n", iEndpointState);
+	    }
 	Activate();
 	}
 
@@ -1792,6 +2157,10 @@
 CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
+	    }
 	Cancel();												// base class
 	}
 
@@ -1799,6 +2168,10 @@
 void CActiveDeviceStateNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::DoCancel()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DOCANCEL, "CActiveDeviceStateNotifier::DoCancel()");
+	    }
 	iPort->AlternateDeviceStatusNotifyCancel();
 	}
 
@@ -1814,33 +2187,43 @@
 			{
 		case EUsbcDeviceStateUndefined:
 			TUSB_PRINT("Device State notifier: Undefined");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL, "Device State notifier: Undefined");
 			break;
 		case EUsbcDeviceStateAttached:
 			TUSB_PRINT("Device State notifier: Attached");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01, "Device State notifier: Attached");
 			break;
 		case EUsbcDeviceStatePowered:
 			TUSB_PRINT("Device State notifier: Powered");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02, "Device State notifier: Powered");
 			break;
 		case EUsbcDeviceStateDefault:
 			TUSB_PRINT("Device State notifier: Default");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03, "Device State notifier: Default");
 			break;
 		case EUsbcDeviceStateAddress:
 			TUSB_PRINT("Device State notifier: Address");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04, "Device State notifier: Address");
 			break;
 		case EUsbcDeviceStateConfigured:
 			TUSB_PRINT("Device State notifier: Configured");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05, "Device State notifier: Configured");
 			break;
 		case EUsbcDeviceStateSuspended:
 			TUSB_PRINT("Device State notifier: Suspended");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06, "Device State notifier: Suspended");
 			break;
 		default:
 			TUSB_PRINT("Device State notifier: ***BAD***");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07, "Device State notifier: ***BAD***");
 			}
 		}
 	else if (iDeviceState & KUsbAlternateSetting)
 		{
 		TUSB_PRINT1("Device State notifier: Alternate interface setting has changed: now %d",
 					iDeviceState & ~KUsbAlternateSetting);
+		OstTrace1(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08, "Device State notifier: Alternate interface setting has changed: now %d",
+					iDeviceState & ~KUsbAlternateSetting);
 		}
 
 	Activate();
@@ -1890,6 +2273,10 @@
 CActiveTimer::~CActiveTimer()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::~CActiveTimer()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DCACTIVETIMER, "CActiveTimer::~CActiveTimer()");
+	    }
 	Cancel();												// base class
 	iTimer.Close();
 	}
@@ -1898,6 +2285,10 @@
 void CActiveTimer::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::DoCancel()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DOCANCEL, "CActiveTimer::DoCancel()");
+	    }
 	iTimer.Cancel();
 	}
 
@@ -1905,6 +2296,10 @@
 void CActiveTimer::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::RunL()");
+	if(iVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_RUNL, "CActiveTimer::RunL()");
+	    }
 	// Nothing to do here, as we call ReadCancel() after a manual WaitForRequest()
 	// (in CActiveRW::ReceiveVersion()).
 	}
--- a/kerneltest/e32test/device/t_usbcsc.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/device/t_usbcsc.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "t_usblib.h"
 #include <e32svr.h>
 #include "u32std.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_usbcscTraces.h"
+#endif
 
 //#define DEBUGVERSION
 
@@ -309,14 +313,19 @@
 	TUsbcScChunkHeader chunkHeader(gChunk);
 
 	DEBUGPRINT(test.Printf(_L("iBuffers at 0x%x, iAltSettings at 0x%x\n"),chunkHeader.iBuffers, chunkHeader.iAltSettings));
+	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION, "iBuffers at 0x%x, iAltSettings at 0x%x\n",chunkHeader.iBuffers, chunkHeader.iAltSettings));
 
 	test_Equal(gChunk.Base()+ sizeof(TUint)*2, chunkHeader.iBuffers);
 
 	DEBUGPRINT(test.Printf(_L("iBuffers: EP0Out: 0x%x EP0In: 0x%x\n"), chunkHeader.iBuffers->Ep0Out()->Offset(),  
 																	chunkHeader.iBuffers->Ep0In()->Offset()));
+	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP01, "iBuffers: EP0Out: 0x%x EP0In: 0x%x\n", chunkHeader.iBuffers->Ep0Out()->Offset(),  
+																	chunkHeader.iBuffers->Ep0In()->Offset()));
  													
 	DEBUGPRINT(test.Printf(_L("iAltSettings: Number of: %d First offset: 0x%x \n"), chunkHeader.iAltSettings->iNumOfAltSettings,  
 																	chunkHeader.iAltSettings->iAltTableOffset[0]));
+	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP02, "iAltSettings: Number of: %d First offset: 0x%x \n", chunkHeader.iAltSettings->iNumOfAltSettings,  
+																	chunkHeader.iAltSettings->iAltTableOffset[0]));
 	
 	test_Compare(aAltSetConfig->iNumOfAltSet, ==, chunkHeader.iAltSettings->iNumOfAltSettings);
 
@@ -325,6 +334,7 @@
 		{
 		TInt inEps = 0, outEps = 0;
 		DEBUGPRINT(test.Printf(_L("Alternate Setting %d offset: 0x%x \n"), i, chunkHeader.iAltSettings->iAltTableOffset[i]));
+		DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP03, "Alternate Setting %d offset: 0x%x \n", i, chunkHeader.iAltSettings->iAltTableOffset[i]));
 
 		TInt8* endpoint = (TInt8*) (chunkHeader.iAltSettings->iAltTableOffset[i] + (TInt) gChunk.Base());
 		for (int j = 1; j <= chunkHeader.GetNumberOfEndpoints(i); j++)
@@ -332,6 +342,8 @@
 			TUsbcScHdrEndpointRecord* endpointInf = (TUsbcScHdrEndpointRecord*) &(endpoint[j * chunkHeader.iAltSettings->iEpRecordSize]);
 			DEBUGPRINT(test.Printf(_L("Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n"), j, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
 						endpointInf->Direction(), endpointInf->Type()));
+			DEBUGPRINT(OstTraceExt5(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP04, "Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n", j, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
+						endpointInf->Direction(), endpointInf->Type()));
 			if (endpointInf->Direction() == KUsbScHdrEpDirectionOut)
 				{
 				outEps++;
@@ -344,6 +356,8 @@
 
 		DEBUGPRINT(test.Printf(_L("Test if Alternate Setting %d  has %d endpoints (%d Out Endpoint(s) and %d In Endpoint(s)) \n"), i, aAltSetConfig->iEpsDesc[i].iNumOfEp,
 				aAltSetConfig->iEpsDesc[i].iNumOfOutEp, aAltSetConfig->iEpsDesc[i].iNumOfInEp));
+		DEBUGPRINT(OstTraceExt4(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP05, "Test if Alternate Setting %d  has %d endpoints (%d Out Endpoint(s) and %d In Endpoint(s)) \n", i, aAltSetConfig->iEpsDesc[i].iNumOfEp,
+				aAltSetConfig->iEpsDesc[i].iNumOfOutEp, aAltSetConfig->iEpsDesc[i].iNumOfInEp));
 
 		test_Compare(chunkHeader.GetNumberOfEndpoints(i), ==, aAltSetConfig->iEpsDesc[i].iNumOfEp);
 		test_Compare(outEps, ==, aAltSetConfig->iEpsDesc[i].iNumOfOutEp);
@@ -384,6 +398,7 @@
 void CActiveConsole::GetCharacter()
 	{
 	test.Printf(_L("\n \n ***** Press Escape to exit ***** \n \n"));
+	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_GETCHARACTER, "\n \n ***** Press Escape to exit ***** \n \n");
 
 	test.Console()->Read(iStatus);
 	SetActive();
@@ -392,15 +407,18 @@
 void CActiveConsole::DoCancel()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveConsole::DoCancel\n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_DOCANCEL, "CActiveConsole::DoCancel\n"));
 	test.Console()->ReadCancel();
 	}
 
 void CActiveConsole::RunL()
 	{
 	DEBUGPRINT(test.Printf(_L("\n CActiveConsole::RunL\n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_RUNL, "\n CActiveConsole::RunL\n"));
 	if (test.Console()->KeyCode() == EKeyEscape)
 		{
 		test.Printf(_L("CActiveConsole: ESC key pressed -> stopping active scheduler...\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_RUNL_DUP01, "CActiveConsole: ESC key pressed -> stopping active scheduler...\n");
 		CActiveScheduler::Stop();
 		return;
 		}
@@ -412,18 +430,21 @@
 	: CActive(EPriorityHigh)
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::CActiveDeviceStateNotifier() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_CACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::CActiveDeviceStateNotifier() \n"));
 	CActiveScheduler::Add(this);
 	}
 
 CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier() \n"));
 	Cancel();
 	}
 
 void CActiveDeviceStateNotifier::DoCancel()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::DoCancel\n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_DOCANCEL, "CActiveDeviceStateNotifier::DoCancel\n"));
 	gPort.AlternateDeviceStatusNotifyCancel();
 	}
 
@@ -436,39 +457,50 @@
 void CActiveDeviceStateNotifier::RunL()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::RunL() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL, "CActiveDeviceStateNotifier::RunL() \n"));
 	if (!(iDeviceState & KUsbAlternateSetting))
 		{
 		switch (iDeviceState)
 			{
 		case EUsbcDeviceStateUndefined:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Undefined \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01, "Device State notifier: Undefined \n"));
 			break;
 		case EUsbcDeviceStateAttached:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Attached \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02, "Device State notifier: Attached \n"));
 			break;
 		case EUsbcDeviceStatePowered:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Powered \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03, "Device State notifier: Powered \n"));
 			break;
 		case EUsbcDeviceStateDefault:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Default \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04, "Device State notifier: Default \n"));
 			break;
 		case EUsbcDeviceStateAddress:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Address \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05, "Device State notifier: Address \n"));
 			break;
 		case EUsbcDeviceStateConfigured:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Configured \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06, "Device State notifier: Configured \n"));
 			break;
 		case EUsbcDeviceStateSuspended:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Suspended \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07, "Device State notifier: Suspended \n"));
 			break;
 		default:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: !!!! NOT RECOGNISED !!!! \n")));
+			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08, "Device State notifier: !!!! NOT RECOGNISED !!!! \n"));
 			}
 		}
 	else if (iDeviceState & KUsbAlternateSetting)
 		{
 		test.Printf(_L("Device State notifier: Alternate interface setting has changed: now %d \n"),
 					iDeviceState & ~KUsbAlternateSetting);
+		OstTrace1(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09, "Device State notifier: Alternate interface setting has changed: now %d \n",
+					iDeviceState & ~KUsbAlternateSetting);
 		}
 	Activate();
 	}
@@ -480,25 +512,30 @@
 	  iEndpointState(0)
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::CActiveStallNotifier() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_CACTIVESTALLNOTIFIER, "CActiveStallNotifier::CActiveStallNotifier() \n"));
 	CActiveScheduler::Add(this);
 	}
 
 CActiveStallNotifier::~CActiveStallNotifier()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::~CActiveStallNotifier() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER, "CActiveStallNotifier::~CActiveStallNotifier() \n"));
 	Cancel();
 	}
 
 void CActiveStallNotifier::DoCancel()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::DoCancel() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_DOCANCEL, "CActiveStallNotifier::DoCancel() \n"));
 	gPort.EndpointStatusNotifyCancel();
 	}
 
 void CActiveStallNotifier::RunL()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::RunL() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_RUNL, "CActiveStallNotifier::RunL() \n"));
 	test.Printf(_L("StallNotifier Endpointstate 0x%x\n"), iEndpointState);
+	OstTrace1(TRACE_NORMAL, CACTIVESTALLNOTIFIER_RUNL_DUP01, "StallNotifier Endpointstate 0x%x\n", iEndpointState);
 	Activate();
 	}
 
@@ -523,6 +560,7 @@
 TInterface::~TInterface()
 	{
 	DEBUGPRINT(test.Printf(_L("TInterface::~TInterface()\n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, TINTERFACE_DTINTERFACE, "TInterface::~TInterface()\n"));
 	iAlternateSetting.Reset();
 	}
 
@@ -538,6 +576,7 @@
 		{
 		IncrementAltSettingChangeSequenceNum();
 		test.Printf(_L("ALTERNATE SETTING CHANGE! Calling StartNextInAlternateSetting() \n"));
+		OstTrace0(TRACE_NORMAL, TINTERFACE_SETACTIVEALTERNATESETTING, "ALTERNATE SETTING CHANGE! Calling StartNextInAlternateSetting() \n");
 		TInt r = gPort.StartNextInAlternateSetting();
 		test_Compare((r&0xFFFF), ==, aSettingNum);
 		}
@@ -563,6 +602,7 @@
 TAlternateSetting::~TAlternateSetting()
 	{
 	DEBUGPRINT(test.Printf(_L("TAlternateSetting::~TAlternateSetting() \n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, TALTERNATESETTING_DTALTERNATESETTING, "TAlternateSetting::~TAlternateSetting() \n"));
 	iEndpoints.Reset();
 	}
 
@@ -609,8 +649,10 @@
 		}
 
 	if (gSpecTest == EAltSet)
+	    {
 		test.Printf(_L("On host side, on the Interface Tab, Change to a differnt Alternate Setting and read or write from an endpoint in the new alternate setting \n\n"));
-
+		OstTrace0(TRACE_NORMAL, TALTERNATESETTING_ACTIVATE, "On host side, on the Interface Tab, Change to a differnt Alternate Setting and read or write from an endpoint in the new alternate setting \n\n");
+        }
 	if (aStartNextInAltSet)
 		{
 		iEndpoints[0].iSettingChangeReceived = EFalse;
@@ -651,6 +693,8 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::QueueRequests() for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n"),
 												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
+	DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, CACTIVERW_QUEUEREQUESTS, "CActiveRW::QueueRequests() for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n",
+												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
 	if (!IsActive())
 		{
 		if (iDirection != KUsbScHdrEpDirectionIn)
@@ -669,6 +713,7 @@
 void TAlternateSetting::SetChangeRequestFlag(CActiveRW *aEp)
 	{
 	DEBUGPRINT(test.Printf(_L("Set ChangeRequestFlag to True for Buffer Number = %d \n"), aEp->iBuffer->iBufNum));
+	DEBUGPRINT(OstTrace1(TRACE_NORMAL, TALTERNATESETTING_SETCHANGEREQUESTFLAG, "Set ChangeRequestFlag to True for Buffer Number = %d \n", aEp->iBuffer->iBufNum));
 
 	TInt countOfEndpoints = iEndpoints.Count();
 
@@ -717,6 +762,7 @@
 CActiveRW::~CActiveRW()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::~CActiveRW\n")));
+	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVERW_DCACTIVERW, "CActiveRW::~CActiveRW\n"));
 	Cancel();
 	}
 
@@ -724,6 +770,8 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::DoCancel for Buffer number iBufNum %d AlternateSetting %d\n"),
 												iBuffer->iBufNum, iAltSetting->GetAlternateSetting()));
+	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, CACTIVERW_DOCANCEL, "CActiveRW::DoCancel for Buffer number iBufNum %d AlternateSetting %d\n",
+												iBuffer->iBufNum, iAltSetting->GetAlternateSetting()));
 	if (IsActive())
 		{
 		if (iDirection == KUsbScHdrEpDirectionOut)
@@ -829,6 +877,7 @@
 		TUsbcScChunkHeader chunkHeader(gChunk);
 		
 		test.Printf(_L("\n \n Trying hardware\nPlease start the Host side application...\n"));
+		OstTrace0(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING, "\n \n Trying hardware\nPlease start the Host side application...\n");
 
 		TRequestStatus status;
 		gPort.ReEnumerate(status);
@@ -839,6 +888,7 @@
 		if (r != KErrNone)
 			{
 			test.Printf(_L("Error %d on querying device state"), r);
+			OstTrace1(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP01, "Error %d on querying device state", r);
 			}
 		else
 			{
@@ -851,6 +901,15 @@
 							((device_state == EUsbcDeviceStateConfigured) ? _S("Configured") :
 							 ((device_state == EUsbcDeviceStateSuspended) ? _S("Suspended") :
 							  _S("Unknown")))))))));
+			DEBUGPRINT(OstTraceExt1(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP02, "Current device state: %s \n",
+						(device_state == EUsbcDeviceStateUndefined) ? _L("Undefined") :
+						((device_state == EUsbcDeviceStateAttached) ? _L("Attached") :
+						 ((device_state == EUsbcDeviceStatePowered) ? _L("Powered") :
+						  ((device_state == EUsbcDeviceStateDefault) ? _L("Default") :
+						   ((device_state == EUsbcDeviceStateAddress) ? _L("Address") :
+							((device_state == EUsbcDeviceStateConfigured) ? _L("Configured") :
+							 ((device_state == EUsbcDeviceStateSuspended) ? _L("Suspended") :
+							  _L("Unknown")))))))));
 			}
 
 		CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();
@@ -906,6 +965,8 @@
 				TUsbcScHdrEndpointRecord* endpointInf = (TUsbcScHdrEndpointRecord*) &(iEp[epNum * chunkHeader.iAltSettings->iEpRecordSize]);
 				DEBUGPRINT(test.Printf(_L("Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n"), epNum, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
 							endpointInf->Direction(), endpointInf->Type()));
+				DEBUGPRINT(OstTraceExt5(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP03, "Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n", epNum, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
+							endpointInf->Direction(), endpointInf->Type()));
 				CActiveRW *EndpointRW = new CActiveRW(epNum, endpointInf->Direction(), bufferArray[endpointInf->iBufferNo]);
 				alternateSetting->AddEndpoint(*EndpointRW);
 				array[count++] = EndpointRW;
@@ -919,8 +980,10 @@
 //		User::After(2000000);
 		
 		test.Printf(_L("Cleaning Up \n"));
+		OstTrace0(TRACE_NORMAL, USER_AFTER, "Cleaning Up \n");
 	
 		test.Printf(_L("Delete endpoint array \n"));
+		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP01, "Delete endpoint array \n");
 		for(TInt i = 0;  i < count; i++)
 			{
 			delete array[i];
@@ -928,6 +991,7 @@
 		delete [] array;
 
 		test.Printf(_L("Delete altset array \n"));
+		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP02, "Delete altset array \n");
 		for (TInt i = 0; i < number; i++)
 			{
 			delete altSetArray[i];
@@ -937,11 +1001,13 @@
 		delete interface1;
 	
 		test.Printf(_L("Delete buffer array \n"));
+		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP03, "Delete buffer array \n");
 		for(TInt i = 0; i < chunkHeader.iBuffers->NumberOfBuffers(); i++)
 			{
 			delete bufferArray[i];
 			}
 		test.Printf(_L("Delete buffer ep0 \n"));
+		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP04, "Delete buffer ep0 \n");
 		delete bufferEp0;
 	
 		delete myEndpointStateNotifier;
@@ -951,6 +1017,7 @@
 	__UHEAP_MARKEND;
 
 		test.Printf(_L("Uninstalling scheduler \n"));
+		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP05, "Uninstalling scheduler \n");
 
 		CActiveScheduler::Install(NULL); // Uninstalling the scheduler
 		delete myScheduler;			
@@ -1007,11 +1074,13 @@
 		data[i]=testString[strPos];
 		}
 	test.Printf(_L("Sending data....."));
+	OstTrace0(TRACE_NORMAL, TBUFFER_SENDEP0PACKET, "Sending data.....");
 	// copy data into buffer TO DO
 	gPort.WriteData(KUsbcScEndpointZero,  iBufferOffset, aLength, 0, iEndpoint->iStatus);
 	User::WaitForRequest(iEndpoint->iStatus);
 	test_KErrNone(iEndpoint->iStatus.Int());
 	test.Printf(_L("Sent!\n"));
+	OstTrace0(TRACE_NORMAL, TBUFFER_SENDEP0PACKET_DUP01, "Sent!\n");
 	}
 
 _LIT(KUndefined,"Undefined"); _LIT(KAttached,"KAttached"); _LIT(KPowered,"KPowered"); _LIT(KDefault,"Default");
@@ -1022,6 +1091,8 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::SetUpHeader() for Buffer %d belonging to Endpoint %d in Alternate Setting %d \n"), 
 								iBufNum, iEndpoint->GetEndpointNumber(), iEndpoint->GetAlternateSettingOfEndpoint()));
+	DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, TBUFFER_SETUPHEADER, "CActiveRW::SetUpHeader() for Buffer %d belonging to Endpoint %d in Alternate Setting %d \n", 
+								iBufNum, iEndpoint->GetEndpointNumber(), iEndpoint->GetAlternateSettingOfEndpoint()));
 	TUsbcScChunkHeader chunkHeader(gChunk);
 	TUsbcScHdrEndpointRecord* epInfo;
 
@@ -1042,9 +1113,11 @@
 
 			iMaxBufferSize = chunkHeader.iBuffers->Ep0Out()->Size();
 			DEBUGPRINT(test.Printf(_L("MaxBufferSize %d \n"), iMaxBufferSize));
+			DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP01, "MaxBufferSize %d \n", iMaxBufferSize));
 
 			TUint ep0MaxPacketSize = gPort.EndpointZeroMaxPacketSizes();
 			DEBUGPRINT(test.Printf(_L("ep0 Max Packet Size = %d\n"), ep0MaxPacketSize));
+			DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP02, "ep0 Max Packet Size = %d\n", ep0MaxPacketSize));
 
 			iMaxPacketSize = (ep0MaxPacketSize == KUsbEpSize64) ? 64 :
 				((ep0MaxPacketSize == KUsbEpSize32) ? 32 :
@@ -1053,7 +1126,10 @@
 				
 			test_Compare(iMaxPacketSize,>,0);
 			if (gSpecTest == EEp0)
+				{
 				test.Printf(_L("Writing from buffer %d \n On host side, on the Class or Vendor Request Tab, send a Vendor request from an Interface on Device-to-Host or Host-to-Device(to an Interface) \n\n"), iBufNum);
+				OstTrace1(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP03, "Writing from buffer %d \n On host side, on the Class or Vendor Request Tab, send a Vendor request from an Interface on Device-to-Host or Host-to-Device(to an Interface) \n\n", iBufNum);
+				}
 			iEndpoint->QueueRequests();
 			}
 		}
@@ -1067,6 +1143,7 @@
 		iMaxPacketSize = EpSize(endpointSizeDescriptor[KEpDesc_PacketSizeOffset], endpointSizeDescriptor[KEpDesc_PacketSizeOffset+1]);
 		test_Compare(iMaxPacketSize,>,0);
 		DEBUGPRINT(test.Printf(_L("Endpoint %d Max Packet Size = %d\n"), iEndpoint->GetEndpointNumber(), iMaxPacketSize));
+		DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP04, "Endpoint %d Max Packet Size = %d\n", iEndpoint->GetEndpointNumber(), iMaxPacketSize));
 	
 		if (iEndpoint->GetDirection() == KUsbScHdrEpDirectionOut)
 			{
@@ -1080,7 +1157,10 @@
  				iMaxBufferSize = buff->Size();
 
 				if (gSpecTest == EBufRead)
+					{
 					test.Printf(_L("Reading from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from a file and send to pipe\n"), iBufNum, iEndpoint->GetEndpointNumber());
+					OstTraceExt2(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP05, "Reading from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from a file and send to pipe\n", iBufNum, iEndpoint->GetEndpointNumber());
+					}
 				iEndpoint->QueueRequests();
 				}
 			}
@@ -1107,7 +1187,10 @@
 					}
 				buffer[iLength-1] = '$'; 
 				if (gSpecTest == EBufWrite)
+					{
 					test.Printf(_L("Writing from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from pipe and write to file \n"), iBufNum, iEndpoint->GetEndpointNumber());
+					OstTraceExt2(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP06, "Writing from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from pipe and write to file \n", iBufNum, iEndpoint->GetEndpointNumber());
+					}
 				iEndpoint->QueueRequests();
 				}
 			}
@@ -1133,6 +1216,8 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::RunL for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n"),
 												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
+	DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, CACTIVERW_RUNL, "CActiveRW::RunL for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n",
+												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
 	test_Compare(IsActive(), ==, EFalse);
 	if ((iLogicalEndpointNum == 0) || (iDirection == KUsbScHdrEpDirectionOut))	//RunL for ReadData
 		{
@@ -1168,6 +1253,7 @@
 		if (iStatus.Int() != KErrCancel)
 			{
 			test.Printf(_L("%c"), sym[iBuffer->iBufNum]);
+			OstTraceExt1(TRACE_NORMAL, CACTIVERW_RUNL_DUP01, "%c", sym[iBuffer->iBufNum]);
 			StartWrite();
 			}
 		}
@@ -1179,9 +1265,11 @@
 	iOldTail = iHeader->iTail;
 
 	DEBUGPRINT(test.Printf(_L("iHeader->iTail 0x%x, iHeader->iHead 0x%x \n"), iHeader->iTail, iHeader->iHead));
+	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA, "iHeader->iTail 0x%x, iHeader->iHead 0x%x \n", iHeader->iTail, iHeader->iHead));
 	if (iHeader->iTail == iHeader->iHead)
 		{
 			test.Printf(_L("No data after available, but returned.  iHead 0x%x \n"),iHeader->iHead);
+			OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP01, "No data after available, but returned.  iHead 0x%x \n",iHeader->iHead);
 			test(0);
 		}
 	
@@ -1197,9 +1285,14 @@
 				iEp0Phase=EReady;
 				gPort.SendEp0StatusPacket();
 				if (iTransfer->iBytes) {test.Printf(_L("EP0 Data: "));}
+				if (iTransfer->iBytes) {OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP02, "EP0 Data: ");}
 				for (TUint ii=0; ii<iTransfer->iBytes; ii++)
+					{
 					test.Printf(_L(" 0x%2x "),iTransfer->iData.b[ii]);
+					OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP03, " 0x%2x ",iTransfer->iData.b[ii]);
+					}
 				test.Printf(_L("\n\n"));
+				OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP04, "\n\n");
 				}
 			else
 				{
@@ -1207,19 +1300,23 @@
 					{
 					TInt s = *iTransfer->iData.i;
 					test.Printf(_L("STATE CHANGE! %d : %S \n"),s,((s<0) || (s>7))?KStates[8]:KStates[s]);
+					OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP05, "STATE CHANGE! %d : %S \n",s,((s<0) || (s>7))?(*KStates[8]):(*KStates[s]));
 					}
 				else
 					{
 					iSetup = (Sep0SetupPacket* ) iTransfer->iData.b;
 					test.Printf(_L("EP0 Command: t %x r %x v %x i %x l %x :"), iSetup->iRequestType, iSetup->iRequest, iSetup->iwValue, iSetup->iwIndex, iSetup->iWlength);
+					OstTraceExt5(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP06, "EP0 Command: t %x r %x v %x i %x l %x :", iSetup->iRequestType, iSetup->iRequest, iSetup->iwValue, iSetup->iwIndex, iSetup->iWlength);
 					if ((iSetup->iRequestType&KDeviceToHost))// && (iSetup->iWlength>0)) //Temp To do remove
 						{
 						test.Printf(_L("EP0 Command: Device to Host\n"));
+						OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP07, "EP0 Command: Device to Host\n");
 						SendEP0Packet(iSetup->iWlength);
 						}
 					else
 						{
 						test.Printf(_L("EP0 Command: Host to Device.  0x%x bytes\n"), iSetup->iWlength);
+						OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP08, "EP0 Command: Host to Device.  0x%x bytes\n", iSetup->iWlength);
 						iEp0Phase=EDataIn;
 						}
 					}
@@ -1230,6 +1327,7 @@
 			if ((++iTickCount)>100)
 				{
 				test.Printf(_L("%c"), sym[iBufNum]);
+				OstTraceExt1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP09, "%c", sym[iBufNum]);
 				iTickCount=0;
 				}
 			}
@@ -1237,9 +1335,11 @@
 	else
 		{
 		test.Printf(_L("Empty Transfer received for buffer Num = %d  as = %d\n"), iBufNum, iTransfer->iAltSetting);
+		OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP10, "Empty Transfer received for buffer Num = %d  as = %d\n", iBufNum, iTransfer->iAltSetting);
 		if (iPrevAltSeq  >= iTransfer->iAltSettingSeq)
 			{
 			test.Printf(_L("Empty Transfer *WAS NOT* an alt setting change!\n"));
+			OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP11, "Empty Transfer *WAS NOT* an alt setting change!\n");
 			iPrevAltSeq = iTransfer->iAltSettingSeq;
 			}
 		}
@@ -1250,7 +1350,10 @@
 			{
 			DEBUGPRINT(test.Printf(_L("Current Alternate Setting of Endpoint = %d iTransfer->iAltSetting = %d iTransfer->iAltSettingSeq = %d \n"), 
 								iEndpoint->GetAlternateSettingOfEndpoint(), iTransfer->iAltSetting, iTransfer->iAltSettingSeq));
+			DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP12, "Current Alternate Setting of Endpoint = %d iTransfer->iAltSetting = %d iTransfer->iAltSettingSeq = %d \n", 
+								iEndpoint->GetAlternateSettingOfEndpoint(), iTransfer->iAltSetting, iTransfer->iAltSettingSeq));
 			test.Printf(_L("Empty Transfer received for buffer Num = %d \n"), iBufNum);
+			OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP13, "Empty Transfer received for buffer Num = %d \n", iBufNum);
 			test_Compare(iEndpoint->GetInterfaceAltSettingChangeSequenceNum(), +1== , iTransfer->iAltSettingSeq);
 
 
@@ -1276,10 +1379,12 @@
 			//Function checks if alternate setting change request flag for all endpoints of this Alternate Setting is set to true
 			TBool settingRequestReceivedForAllEps = iEndpoint->CheckFlagForAllOutEndpoints();
 			DEBUGPRINT(test.Printf(_L("SettingRequestReceivedForAllEps = %d \n"),settingRequestReceivedForAllEps));
+			DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP14, "SettingRequestReceivedForAllEps = %d \n",settingRequestReceivedForAllEps));
 			if(settingRequestReceivedForAllEps)
 				{
 				// change alternative setting
 				test.Printf(_L("AS!\n"));
+				OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP15, "AS!\n");
 				iEndpoint->CallChangeAlternateSetting(iTransfer->iAltSetting);
 				}
 			}
@@ -1296,6 +1401,7 @@
 				{
 				test_Compare((TInt) (iTransfer->iNext), >=,   startOfBuf );
 				DEBUGPRINT(test.Printf(_L("Endpoint Buffer of size %d is filled. Next transfer from Start of Buffer \n"), iMaxBufferSize));
+				DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP16, "Endpoint Buffer of size %d is filled. Next transfer from Start of Buffer \n", iMaxBufferSize));
 				}	
 
 			//Checking that no data or information goes beyond the end address of the buffer
@@ -1317,6 +1423,7 @@
 				test_Compare(iHeader->iTail, >=,  startOfBuf);
 				}
 			DEBUGPRINT(test.Printf(_L("Previous Sequence Number 0x%x Current Sequence Number 0x%x \n"), iPrevSequence, iTransfer->iSequence));
+			DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP17, "Previous Sequence Number 0x%x Current Sequence Number 0x%x \n", iPrevSequence, iTransfer->iSequence));
 			test_Compare((iTransfer->iSequence - iPrevSequence), ==, 1);
 			iPrevSequence = iTransfer->iSequence;
 #endif
@@ -1328,18 +1435,27 @@
 				test.Printf(_L("Recieved packet Hash ID 0x%x Sequence Number 0x%x Bytes 0x%x Flags 0x%x Next 0x%x Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n"), 
 				iTransfer->iHashId,iTransfer->iSequence, iTransfer->iBytes, iTransfer->iFlags, iTransfer->iNext, 
 				iTransfer->iAltSettingSeq, iTransfer->iAltSetting);
+				OstTraceExt5(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP18, "Recieved packet Hash ID 0x%x Sequence Number 0x%x Bytes 0x%x Flags 0x%x Next 0x%x ", 
+				iTransfer->iHashId,iTransfer->iSequence, iTransfer->iBytes, iTransfer->iFlags, iTransfer->iNext);
+				OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP22, "Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n", 
+				iTransfer->iAltSettingSeq, iTransfer->iAltSetting);
 #else
 				test.Printf(_L("Recieved packet Bytes 0x%x Flags 0x%x Next 0x%x Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n"), 
 				iTransfer->iBytes, iTransfer->iFlags,
 				iTransfer->iNext, iTransfer->iAltSettingSeq, iTransfer->iAltSetting );
+				OstTraceExt5(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP19, "Recieved packet Bytes 0x%x Flags 0x%x Next 0x%x Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n", 
+				iTransfer->iBytes, iTransfer->iFlags,
+				iTransfer->iNext, (TUint)iTransfer->iAltSettingSeq, (TUint)iTransfer->iAltSetting );
 #endif
 				if (gVerbose>1)
 					{
 					for (TUint ii=0; ii<iTransfer->iBytes; ii++)
 						{
 						test.Printf(_L(" %c "),iTransfer->iData.b[ii]);
+						OstTraceExt1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP20, " %c ",iTransfer->iData.b[ii]);
 						}
 					test.Printf(_L("\n"));
+					OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP21, "\n");
 					}
 				} // if verbose
 
@@ -1392,17 +1508,20 @@
 	if (gRealHardware)
 		{		
 		test.Printf(_L("\n\n Trying hardware\nPlease start the Host side application...\n"));
+		OstTrace0(TRACE_NORMAL, TESTCANCEL_TESTCANCEL, "\n\n Trying hardware\nPlease start the Host side application...\n");
 
 
 		gPort.ReEnumerate(status);
 		User::WaitForRequest(status);
 		test.Printf(_L("Enumerated status = %d\n"), status.Int());
+		OstTrace1(TRACE_NORMAL, TESTCANCEL_TESTCANCEL_DUP01, "Enumerated status = %d\n", status.Int());
 	
 		test.Next(_L("ReadCancel Test after enumeration\n"));
 		do  // Drain out all data in buffer first, then queue cancel
 			{
 			r = gPort.ReadDataNotify(outBuffNum,status);
 			DEBUGPRINT(test.Printf(_L("header->iTail 0x%x header->iHead 0x%x\n"), header->iTail, header->iHead));
+			DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTCANCEL_TESTCANCEL_DUP02, "header->iTail 0x%x header->iHead 0x%x\n", header->iTail, header->iHead));
 			transfer = (TUsbcScTransferHeader*) (header->iTail + base);
 			header->iTail = transfer->iNext;
 			}
@@ -1416,6 +1535,7 @@
 		test.Next(_L("WriteCancel Test after enumeration\n"));
 
 		test.Printf(_L("Generating test data %x %d\n"), buffer, inBuffNum);
+		OstTraceExt2(TRACE_NORMAL, TESTCANCEL_TESTCANCEL_DUP03, "Generating test data %x %d\n", (TUint)buffer, inBuffNum);
 		for (TUint i=0; i<length; i++)
 			{
 			buffer[i]=i;
@@ -1494,6 +1614,7 @@
 
 	// Testing with invalid buffer values
 	test.Printf(_L("Test Buffer Writing with invalid buffer values\n"));
+	OstTrace0(TRACE_NORMAL, TESTINVALIDAPI_TESTINVALIDAPI, "Test Buffer Writing with invalid buffer values\n");
 	gPort.WriteData(out_buf,  bufferOffset, length, 0, status);
 	User::WaitForRequest(status);
 	test_Compare(status.Int(), ==, KErrArgument);
@@ -1508,6 +1629,7 @@
 /*
 	// Unaligned argument 
 	test.Printf(_L("Test Buffer Writing with invalid buffer offsets\n"));
+	OstTrace0(TRACE_NORMAL, TESTINVALIDAPI_TESTINVALIDAPI_DUP01, "Test Buffer Writing with invalid buffer offsets\n");
 	gPort.WriteData(in_buf,  bufferOffset + sizeof(TUint), length, 0,status);
 	User::WaitForRequest(status);
 	test_Compare(status.Int(), ==, KErrArgument);
@@ -1548,10 +1670,12 @@
 	test_KErrNone(r);		
 	
 	test.Printf(_L("Release Interface %d\n"), --altSetNo);
+	OstTrace1(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE, "Release Interface %d\n", --altSetNo);
 	r = gPort.ReleaseInterface(altSetNo);
 	test_Compare(r, !=, KErrNone);				
 
 	test.Printf(_L("Release Interface %d\n"), ++altSetNo);
+	OstTrace1(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP01, "Release Interface %d\n", ++altSetNo);
 	r = gPort.ReleaseInterface(altSetNo);					
 	test_KErrNone(r);
 	
@@ -1567,6 +1691,7 @@
 
 	// Should not be allowed to release Interface once Chunk Realized
 	test.Printf(_L("Release Interface %d \n"), altSetNo);
+	OstTrace1(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP02, "Release Interface %d \n", altSetNo);
 	r = gPort.ReleaseInterface(altSetNo);
 	test_Compare(r, ==, KErrUsbAlreadyRealized);	
 	CloseChannel();
@@ -1638,6 +1763,7 @@
 	altSetConfig->iEpsDesc[0] = temp; //{2,1,1};
 
 	test.Printf(_L("Check chunk still populated with one interface\n")); 
+	OstTrace0(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP03, "Check chunk still populated with one interface\n"); 
 	TestBufferConstruction(altSetConfig);
 
 	CloseChannel();
@@ -1656,6 +1782,7 @@
 	test_Compare(r, !=, KErrNone);		
 
 	test.Printf(_L("Check chunk still populated with one interface \n")); 
+	OstTrace0(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP04, "Check chunk still populated with one interface \n"); 
 	TestBufferConstruction(altSetConfig);
 
 	CloseChannel();
@@ -1673,6 +1800,7 @@
 	altSetConfig->iEpsDesc[0] = temp2; //{0,0,0};
 	
 	test.Printf(_L("Check chunk not populated with any valid data as all interfaces would be destroyed \n")); 
+	OstTrace0(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP05, "Check chunk not populated with any valid data as all interfaces would be destroyed \n"); 
 	TestBufferConstruction(altSetConfig);
 
 	CloseChannel();
@@ -1731,21 +1859,35 @@
 	gSupportsHighSpeed = d_caps().iHighSpeed;
 
 	test.Printf(_L("USB device capabilities:\n"));
+	OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES, "USB device capabilities:\n");
 	test.Printf(_L("Number of endpoints:                %d\n"), numOfEndPoints);
+	OstTrace1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP01, "Number of endpoints:                %d\n", numOfEndPoints);
 	test.Printf(_L("Supports Software-Connect:          %s\n"),
 				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP02, "Supports Software-Connect:          %s\n",
+				d_caps().iConnect ? _L("yes") : _L("no"));
 	test.Printf(_L("Device is Self-Powered:             %s\n"),
 				d_caps().iSelfPowered ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP03, "Device is Self-Powered:             %s\n",
+				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports Remote-Wakeup:             %s\n"),
 				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP04, "Supports Remote-Wakeup:             %s\n",
+				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports High-speed:                %s\n"),
 				gSupportsHighSpeed ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP05, "Supports High-speed:                %s\n",
+				gSupportsHighSpeed ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports unpowered cable detection: %s\n"),
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
 				_S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP06, "Supports unpowered cable detection: %s\n",
+				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
+				_L("yes") : _L("no"));
 
 	test_Compare(numOfEndPoints, >=, 2);
 	test.Printf(_L("(Device has sufficient endpoints.)\n"));
+	OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP07, "(Device has sufficient endpoints.)\n");
 		
 	// Endpoint caps
 	test.Next(_L("Query USB endpoint caps"));
@@ -1755,6 +1897,7 @@
 	test_KErrNone(r);
 
 	test.Printf(_L("USB device endpoint capabilities:\n"));
+	OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP08, "USB device endpoint capabilities:\n");
 
 	TInt dir;
 	for (TInt i = 0; i < numOfEndPoints; i++)
@@ -1763,32 +1906,48 @@
 		dir = caps->iTypesAndDir;
 		test.Printf(_L("Endpoint: SizeBf= 0x%08x Type/Dir= 0x%08x"),
 					caps->iSizes, dir);
+		OstTraceExt2(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP09, "Endpoint: SizeBf= 0x%08x Type/Dir= 0x%08x",
+					caps->iSizes, dir);
 		
 		if (dir&KUsbEpDirIn)
+		    {
 			test.Printf(_L(" In "));
+			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP10, " In ");
+			}
 		if (dir&KUsbEpDirOut)
+		    {
 			test.Printf(_L(" Out"));
+			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP11, " Out");
+			}
 		if (dir&KUsbEpDirBidirect)
+			{
 			test.Printf(_L(" Bi "));
+			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP12, " Bi ");
+			}
 
 		if (dir&KUsbEpTypeControl)
 			{
 			test.Printf(_L(" Control"));
+			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP13, " Control");
 			}
 		if (dir&KUsbEpTypeIsochronous)
 			{
 			test.Printf(_L(" Isochronus"));
+			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP14, " Isochronus");
 			}
 		if (dir&KUsbEpTypeBulk)
 			{
 			test.Printf(_L(" Bulk"));		
+			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP15, " Bulk");		
 			}
 		if (dir&KUsbEpTypeInterrupt)
 			{
 			test.Printf(_L(" Interrupt"));
+			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP16, " Interrupt");
 			}
 
 		test.Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP17, "\n");
 
 		if (caps->iHighBandwidth)
 			{
@@ -1806,6 +1965,7 @@
 TInt SettingOne(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S1)\n"));
+	OstTrace0(TRACE_NORMAL, SETTINGONE_SETTINGONE, "RTEST: Interigate Endpoint Capabilities (S1)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	// Endpoint 0
@@ -1818,6 +1978,7 @@
 	ifc().iEndpointData[1].iSize = KUsbEpSize64;
 	
 	test.Printf(_L("RTEST: Setting up interface %d with two endpoints (s1)\n"), aAltSetNo);
+	OstTrace1(TRACE_NORMAL, SETTINGONE_SETTINGONE_DUP01, "RTEST: Setting up interface %d with two endpoints (s1)\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = 2;
@@ -1835,6 +1996,7 @@
 TInt SettingTwo(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S2)\n"));
+	OstTrace0(TRACE_NORMAL, SETTINGTWO_SETTINGTWO, "RTEST: Interigate Endpoint Capabilities (S2)\n");
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
 	if (gInterruptInEpFound)
@@ -1864,6 +2026,7 @@
 		} while (++ep_found < 5);
 	
 	test.Printf(_L("Setting up interface %d with Five Endpoints (s2)\n"), aAltSetNo);
+	OstTrace1(TRACE_NORMAL, SETTINGTWO_SETTINGTWO_DUP01, "Setting up interface %d with Five Endpoints (s2)\n", aAltSetNo);
 	_LIT16(string, "T_USBSC API Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -1878,6 +2041,7 @@
 TInt SettingThreeIn(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S3)\n"));
+	OstTrace0(TRACE_NORMAL, SETTINGTHREEIN_SETTINGTHREEIN, "RTEST: Interigate Endpoint Capabilities (S3)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
@@ -1889,6 +2053,7 @@
 		} while (++ep_found < 3);
 	
 	test.Printf(_L("Setting up interface %d with three Bulk In endpoints(s3)\n"), aAltSetNo);
+	OstTrace1(TRACE_NORMAL, SETTINGTHREEIN_SETTINGTHREEIN_DUP01, "Setting up interface %d with three Bulk In endpoints(s3)\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -1904,6 +2069,7 @@
 TInt SettingFourOut(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S4)\n"));
+	OstTrace0(TRACE_NORMAL, SETTINGFOUROUT_SETTINGFOUROUT, "RTEST: Interigate Endpoint Capabilities (S4)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
@@ -1915,6 +2081,7 @@
 		} while (++ep_found < 3);
 	
 	test.Printf(_L("Setting up interface %d with three Bulk Out endpoints(s4)\n"), aAltSetNo);
+	OstTrace1(TRACE_NORMAL, SETTINGFOUROUT_SETTINGFOUROUT_DUP01, "Setting up interface %d with three Bulk Out endpoints(s4)\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -1930,6 +2097,7 @@
 TInt SettingFive(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S5)\n"));
+	OstTrace0(TRACE_NORMAL, SETTINGFIVE_SETTINGFIVE, "RTEST: Interigate Endpoint Capabilities (S5)\n");
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
 	if (gInterruptInEpFound)
@@ -1965,6 +2133,7 @@
 	ifc().iEndpointData[ep_found].iSize  = KUsbEpSize64;
 	
 	test.Printf(_L("Setting up interface %d with Five Endpoints(s5)\n"), aAltSetNo);
+	OstTrace1(TRACE_NORMAL, SETTINGFIVE_SETTINGFIVE_DUP01, "Setting up interface %d with Five Endpoints(s5)\n", aAltSetNo);
 	_LIT16(string, "T_USBSC API Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -1981,6 +2150,7 @@
 									   // and will however return with an error, not because we are requesting one more than what is available of an interrupt endpoint
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (I1)\n"));
+	OstTrace0(TRACE_NORMAL, INVALIDSETTINGONE_INVALIDSETTINGONE, "RTEST: Interigate Endpoint Capabilities (I1)\n");
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt interruptInEpFound = gInterruptInEpFound + 1;
 
@@ -2012,6 +2182,7 @@
 									   //Only control endpoints are bi-directional. Request any other type which has bidirectional capability.
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (I2)\n"));
+	OstTrace0(TRACE_NORMAL, INVALIDSETTINGTWO_INVALIDSETTINGTWO, "RTEST: Interigate Endpoint Capabilities (I2)\n");
 
 	TUsbcScInterfaceInfoBuf ifc;
 	// Endpoint 0
@@ -2039,6 +2210,7 @@
 TInt InvalidSettingThree(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (I3)\n"));
+	OstTrace0(TRACE_NORMAL, INVALIDSETTINGTHREE_INVALIDSETTINGTHREE, "RTEST: Interigate Endpoint Capabilities (I3)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
@@ -2056,6 +2228,7 @@
 		} while (++ep_found < 5);
 	
 	test.Printf(_L("RTEST: Setting up interface %d, with invalid setting three (I3).\n"), aAltSetNo);
+	OstTrace1(TRACE_NORMAL, INVALIDSETTINGTHREE_INVALIDSETTINGTHREE_DUP01, "RTEST: Setting up interface %d, with invalid setting three (I3).\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found+1;
@@ -2124,6 +2297,7 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Device_Qualifier descriptor tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR, "*** Not supported - skipping Device_Qualifier descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -2199,6 +2373,7 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Other_Speed_Configuration desc tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR, "*** Not supported - skipping Other_Speed_Configuration desc tests\n");
 		test.End();
 		return;
 		}
@@ -2331,6 +2506,7 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping alternate interface settings tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION, "*** Not supported - skipping alternate interface settings tests\n");
 		test.End();
 		return;
 		}
@@ -2428,6 +2604,7 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping Extended Endpoint descriptor tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR, "*** Not supported - skipping Extended Endpoint descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -2477,6 +2654,7 @@
 	TInt r = gPort.GetStringDescriptorLangId(rd_langid_orig);
 	test_KErrNone(r);
 	test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig);
+	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS, "Original LANGID code: 0x%04X\n", rd_langid_orig);
 
 	test.Next(_L("SetStringDescriptorLangId()"));
 	TUint16 wr_langid = 0x0809;								// English (UK) Language ID
@@ -2490,6 +2668,7 @@
 	r = gPort.GetStringDescriptorLangId(rd_langid);
 	test_KErrNone(r);
 	test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid);
+	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01, "New LANGID code: 0x%04X\n", rd_langid);
 
 	test.Next(_L("Compare LANGID codes"));
 	test(rd_langid == wr_langid);
@@ -2510,11 +2689,13 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02, "Original Manufacturer string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
 		{
 		test.Printf(_L("No Manufacturer string set\n"));
+		OstTrace0(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03, "No Manufacturer string set\n");
 		restore_string = EFalse;
 		}
 
@@ -2529,6 +2710,7 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -2546,6 +2728,7 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -2576,6 +2759,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06, "Old Product string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -2593,6 +2777,7 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -2610,6 +2795,7 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -2640,6 +2826,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09, "Old Serial Number: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -2657,6 +2844,7 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -2674,6 +2862,7 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -2704,6 +2893,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12, "Old Configuration string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -2721,6 +2911,7 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -2738,6 +2929,7 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -2788,6 +2980,7 @@
 	r = gPort.GetStringDescriptor(stridx1, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx1, &rd_str);
+	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS, "New test string @ idx %d: \"%lS\"\n", stridx1, rd_str);
 
 	test.Next(_L("Compare test strings 1"));
 	r = rd_str.Compare(wr_str);
@@ -2825,6 +3018,7 @@
 	r = gPort.GetStringDescriptor(stridx2, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx2, &rd_str);
+	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01, "New test string @ idx %d: \"%lS\"\n", stridx2, rd_str);
 
 	test.Next(_L("Compare test strings 2"));
 	r = rd_str.Compare(wr_str);
@@ -2847,6 +3041,7 @@
 	r = gPort.GetStringDescriptor(stridx3, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str);
+	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02, "New test string @ idx %d: \"%lS\"\n", stridx3, rd_str);
 
 	test.Next(_L("Compare test strings 3"));
 	r = rd_str.Compare(wr_str);
@@ -2887,6 +3082,10 @@
 				(ep_state == EEndpointStateNotStalled) ? _S("Not stalled") :
 				((ep_state == EEndpointStateStalled) ? _S("Stalled") :
 				 _S("Unknown...")));
+	OstTraceExt2(TRACE_NORMAL, QUERYENDPOINTSTATE_QUERYENDPOINTSTATE, "Endpoint %d state: %s\n", aEndpoint,
+				(ep_state == EEndpointStateNotStalled) ? _L("Not stalled") :
+				((ep_state == EEndpointStateStalled) ? _L("Stalled") :
+				 _L("Unknown...")));
 	return ep_state;
 	}
 
@@ -2897,6 +3096,7 @@
 	if (!SupportsEndpointStall())
 		{
 		test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n"));
+		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS, "*** Not supported - skipping endpoint stall status tests\n");
 		test.End();
 		return;
 		}
@@ -2951,10 +3151,12 @@
 		if ((epStateBitmap & (1 << i)) == EEndpointStateNotStalled)
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d NOT STALLED\n"), i);
+			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY, "EndpointStatusNotify: Ep %d NOT STALLED\n", i);
 			}
 		else
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d STALLED\n"), i);
+			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01, "EndpointStatusNotify: Ep %d STALLED\n", i);
 			}
 		}
 
@@ -2977,6 +3179,7 @@
 		{
 		TUint setting = (deviceState & ~KUsbAlternateSetting);
 		test.Printf(_L("Alternate setting change to setting %d - unexpected"), setting);
+		OstTrace1(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY, "Alternate setting change to setting %d - unexpected", setting);
 		test(EFalse);
 		}
 	else
@@ -2985,31 +3188,40 @@
 			{
 		case EUsbcDeviceStateUndefined:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Undefined state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01, "TestAlternateDeviceStatusNotify: Undefined state\n");
 			break;
 		case EUsbcDeviceStateAttached:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Attached state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02, "TestAlternateDeviceStatusNotify: Attached state\n");
 			break;
 		case EUsbcDeviceStatePowered:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Powered state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03, "TestAlternateDeviceStatusNotify: Powered state\n");
 			break;
 		case EUsbcDeviceStateDefault:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Default state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04, "TestAlternateDeviceStatusNotify: Default state\n");
 			break;
 		case EUsbcDeviceStateAddress:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Address state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05, "TestAlternateDeviceStatusNotify: Address state\n");
 			break;
 		case EUsbcDeviceStateConfigured:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Configured state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06, "TestAlternateDeviceStatusNotify: Configured state\n");
 			break;
 		case EUsbcDeviceStateSuspended:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Suspended state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07, "TestAlternateDeviceStatusNotify: Suspended state\n");
 			break;
 		case EUsbcNoState:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: State buffering error\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08, "TestAlternateDeviceStatusNotify: State buffering error\n");
 			test(EFalse);
 			break;
 		default:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Unknown state\n"));
+			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09, "TestAlternateDeviceStatusNotify: Unknown state\n");
 			test(EFalse);
 			}
 		}
@@ -3141,6 +3353,7 @@
 void SetupBulkInterfaces(TUint aInterfaceNo,TUint nReadEps, TUint nWriteEps)
 	{
 	test.Printf(_L("SetupBulkInterfaces: %d, %d, %d\n"),aInterfaceNo,nReadEps,nWriteEps);
+	OstTraceExt3(TRACE_NORMAL, SETUPBULKINTERFACES_SETUPBULKINTERFACES, "SetupBulkInterfaces: %u, %u, %u\n",aInterfaceNo,nReadEps,nWriteEps);
 	TUsbcScInterfaceInfoBuf ifc;
 	TUint i;
 	for(i=0; i<nWriteEps;i++)
@@ -3171,20 +3384,31 @@
 void PrintBILTestOptions()
 	{
 	test.Printf(_L("Select an option\n"));
+	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS, "Select an option\n");
 	test.Printf(_L("1.Test BIL API\n"));	//unimplemented
+	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP01, "1.Test BIL API\n");	//unimplemented
 	test.Printf(_L("2.Test BIL Read Write\n"));
+	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP02, "2.Test BIL Read Write\n");
 	test.Printf(_L("3.Test EP0 using BIL API's\n"));
+	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP03, "3.Test EP0 using BIL API's\n");
 	test.Printf(_L("4.Test AlternateSetting Change BIL API's\n"));	//unimplemented	
+	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP04, "4.Test AlternateSetting Change BIL API's\n");	//unimplemented	
 	test.Printf(_L("5.Run All\n"));
+	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP05, "5.Run All\n");
 	test.Printf(_L("6.Quit\n"));
+	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP06, "6.Quit\n");
 	}
 
 void PrintWriteOptions()
 	{
 	test.Printf(_L("Select an option\n"));
+	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS, "Select an option\n");
 	test.Printf(_L("1.Test single buffer write\n"));
+	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP01, "1.Test single buffer write\n");
 	test.Printf(_L("2.Test double buffer write\n"));
+	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP02, "2.Test double buffer write\n");
 	test.Printf(_L("3.Test multiple queing write\n"));
+	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP03, "3.Test multiple queing write\n");
 	}
 
 
@@ -3211,18 +3435,31 @@
 	if(setup != NULL)
 		{
 		test.Printf(_L("EP0 command:\n"));
+		OstTrace0(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT, "EP0 command:\n");
 		test.Printf(_L("Direction: %S, "),KLitDirections[(setup->iRequestType>>KDirBit) & 0x1]);
+		OstTraceExt1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP01, "Direction: %S, ",*KLitDirections[(setup->iRequestType>>KDirBit) & 0x1]);
 		test.Printf(_L("Request type: %S, "), KLitType[((setup->iRequestType>>KReqTypeBit) & 0x3)]);
+		OstTraceExt1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP02, "Request type: %S, ", *KLitType[((setup->iRequestType>>KReqTypeBit) & 0x3)]);
 
 		if (setup->iRequestType & KRecepientReservedMask)
+			{
 			test.Printf(_L("Recepient: Unknown (0x%x), "), setup->iRequestType & KRecepientMask);
+			OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP03, "Recepient: Unknown (0x%x), ", setup->iRequestType & KRecepientMask);
+			}
 		else
+			{
 			test.Printf(_L("Recepient: %S\n"), KLitDest[(setup->iRequestType & KRecepientMask)]);
+			OstTraceExt1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP04, "Recepient: %S\n", *KLitDest[(setup->iRequestType & KRecepientMask)]);
+			}
 
 		test.Printf(_L("bRequest:0x%x, "),setup->iRequest);
+		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP05, "bRequest:0x%x, ",setup->iRequest);
 		test.Printf(_L("wValue:0x%x, "),setup->iwValue);
+		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP06, "wValue:0x%x, ",setup->iwValue);
 		test.Printf(_L("wIndex:0x%x, "),setup->iwIndex);
+		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP07, "wIndex:0x%x, ",setup->iwIndex);
 		test.Printf(_L("wLength:0x%x\n"),setup->iWlength);
+		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP08, "wLength:0x%x\n",setup->iWlength);
 		}
 	}
 
@@ -3236,6 +3473,7 @@
 		aWriteBuf.Append(i);			//data is duplicated here in writebuffer and sc location, cant think of anyth better at the moment;
 		*(scBufferAddr) = i;
 		//test.Printf(_L("Addr:0x%x, data[i]:%d "),scBufferAddr,*(scBufferAddr));
+		//OstTraceExt2(TRACE_NORMAL, WRITEDATATOBUFFER_WRITEDATATOBUFFER, "Addr:0x%x, data[i]:%d ",scBufferAddr,*(scBufferAddr));
 		scBufferAddr += 1;
 		}	
 	}
@@ -3243,6 +3481,7 @@
 	{
 	TInt ret = KErrNone;
 	test.Printf(_L("TestBILWrite\n"));
+	OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE, "TestBILWrite\n");
 	TEndpointBuffer epBuf;
 	const TUint KWriteEp = 1;
 	TRequestStatus status;
@@ -3263,18 +3502,23 @@
 			case '1':
 				//case 1: Write a buffer fulll of data to USBIO demo app: Total data written- 1xBuffersize
 				test.Printf(_L("Length to be written: %d\n"),length);
+				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP01, "Length to be written: %d\n",length);
 				WriteDataToBuffer(buffer,length,aWriteBuf);
 				//need to check allignment
 				test.Printf(_L("Data ready to be written out, Start 'read to file' on an IN endpoint onthe  USBIO demo application then press a key when ready to proceed\n"));
+				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP02, "Data ready to be written out, Start 'read to file' on an IN endpoint onthe  USBIO demo application then press a key when ready to proceed\n");
 				test.Getch();
 				test_KErrNone(epBuf.WriteBuffer(buffer,length,ETrue,status));
 				//Note-Till here is common for all options and can be put in a common place. Repeating the code for the sake of better understanding
 				User::WaitForRequest(status);
 				if(gVerbose)
 					test.Printf(_L("Write status %d\n"),status.Int());
+					OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP03, "Write status %d\n",status.Int());
 				test_KErrNone(status.Int());
 				test.Printf(_L("Total bytes written:%d\n"),aWriteBuf.Length());
+				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP04, "Total bytes written:%d\n",aWriteBuf.Length());
 				test.Printf(_L("Stop writing at the USBIO demo dialog window, Press a key to continue##\n"));
+				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP05, "Stop writing at the USBIO demo dialog window, Press a key to continue##\n");
 				test.Getch();
 				break;
 
@@ -3282,6 +3526,7 @@
 				//case 2: Write a buffer fulll of data to USBIO demo app wait until it is written out, write a second buffer full of data: Total data written- 2xBuffersize
 				WriteDataToBuffer(buffer,length,aWriteBuf);
 				test.Printf(_L("Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n"));
+				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP06, "Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n");
 				test.Getch();
 				ret = epBuf.WriteBuffer(buffer,length,EFalse,status);
 				test_KErrNone(ret);
@@ -3295,7 +3540,9 @@
 				test_KErrNone(status.Int());
 
 				test.Printf(_L("Total bytes written:%d\n"),aWriteBuf.Length());
+				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP07, "Total bytes written:%d\n",aWriteBuf.Length());
 				test.Printf(_L("Stop writing at the USBIO demo dialog window,Press a key to continue\n"));
+				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP08, "Stop writing at the USBIO demo dialog window,Press a key to continue\n");
 				test.Getch();
 				break;
 
@@ -3303,6 +3550,7 @@
 				//case 3: Write maxpacketsize (64 bytes) of data to USBIO demo app, queue remianing data in buffer (full buffer length-maxpacket size), wait for results: Total data written- 1xBuffersize
 				WriteDataToBuffer(buffer,64,aWriteBuf);
 				test.Printf(_L("Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n"));
+				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP09, "Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n");
 				test.Getch();
 
 				ret = epBuf.WriteBuffer(buffer,64,EFalse,status1);
@@ -3318,7 +3566,9 @@
 				test_KErrNone(status2.Int());
 				
 				test.Printf(_L("Total bytes written: %d\n"),aWriteBuf.Length());
+				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP10, "Total bytes written: %d\n",aWriteBuf.Length());
 				test.Printf(_L("Stop writing at the USBIO demo dialog window,Press a key to continue\n"));
+				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP11, "Stop writing at the USBIO demo dialog window,Press a key to continue\n");
 				test.Getch();
 				break;
 				
@@ -3336,6 +3586,7 @@
 void BILRead(TDes8& aReadBuf)
 	{
 	test.Printf(_L("TestBILRead\n"));
+	OstTrace0(TRACE_NORMAL, BILREAD_BILREAD, "TestBILRead\n");
 	TEndpointBuffer epBuf;
 	const TUint KReadEp = 2;
 	TRequestStatus status;
@@ -3343,6 +3594,7 @@
 	//Open endpoint
 	gPort.OpenEndpoint(epBuf,KReadEp);
 	test.Printf(_L("Open endpoint results for read endpoint\n"));
+	OstTrace0(TRACE_NORMAL, BILREAD_BILREAD_DUP01, "Open endpoint results for read endpoint\n");
 
 	//call GetBuffer, loop as long as EoF is not received
 	TAny *readBuf;
@@ -3356,7 +3608,10 @@
 		TInt ret = KErrGeneral;
 		ret = epBuf.GetBuffer(readBuf,aSize,aZlp,status);
 		if(gVerbose)
+			{
 			test.Printf(_L("Getbuffer call returned %d, aSize: %d, aZlp: %d\n"),ret, aSize,aZlp);
+			OstTraceExt3(TRACE_NORMAL, BILREAD_BILREAD_DUP02, "Getbuffer call returned %d, aSize: %u, aZlp: %d\n",ret, aSize,aZlp);
+			}
 		
 		if(ret == KErrCompletion)
 			{
@@ -3368,6 +3623,7 @@
 			{
 			test_KErrNone(ret);
 			test.Printf(_L("Waiting for Data, Data read so far: %d\n"),aReadBuf.Length());
+			OstTrace1(TRACE_NORMAL, BILREAD_BILREAD_DUP03, "Waiting for Data, Data read so far: %d\n",aReadBuf.Length());
 			User::WaitForRequest(status);
 			}
 		}
@@ -3383,6 +3639,7 @@
 	if(wrLength != rdLength)
 		{
 		test.Printf(_L("Error: Disparity between length of data written and read back!"));
+		OstTrace0(TRACE_NORMAL, BILREAD_BILREAD_DUP04, "Error: Disparity between length of data written and read back!");
 		return EFalse;
 		}
 	for(TInt i=0; i < wrLength; i++)
@@ -3390,8 +3647,11 @@
 		if (aReadBuf[i] != aWriteBuf[i])
 			{
 			test.Printf(_L("Error: for i = %d:"), i);
+			OstTrace1(TRACE_NORMAL, BILREAD_BILREAD_DUP05, "Error: for i = %d:", i);
 			test.Printf(_L("aReadBuf: %d != aWriteBuf: %d"),
 								aReadBuf[i], aWriteBuf[i]);
+			OstTraceExt2(TRACE_NORMAL, BILREAD_BILREAD_DUP06, "aReadBuf: %d != aWriteBuf: %d",
+								aReadBuf[i], aWriteBuf[i]);
 			return EFalse;
 			}
 		}
@@ -3413,39 +3673,52 @@
 
 	test.Next(_L("TestBILReadWrite"));
 	test.Printf(_L("Open global USB channel"));
+	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE, "Open global USB channel");
 	TInt r = gPort.Open(0);
 	test_KErrNone(r);
 	//Test for a simple interface with 2 endpoints
 	test.Printf(_L("Set up interface\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP01, "Set up interface\n");
 	SetupBulkInterfaces(0,1,1);
 	RChunk *tChunk = &gChunk;
 	test.Printf(_L("Finalize Interface\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP02, "Finalize Interface\n");
 	gPort.FinalizeInterface(tChunk);
 
 	if(gRealHardware)
 		{
 		test.Printf(_L("Please Start the USBIO demo application on the host side \n"));
+		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP03, "Please Start the USBIO demo application on the host side \n");
 		gPort.ReEnumerate(status);
 		User::WaitForRequest(status);
 		test.Printf(_L("Enumerated. status = %d\n"), status.Int());
+		OstTrace1(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP04, "Enumerated. status = %d\n", status.Int());
 		test.Printf(_L("The following test attempts to write data to the host application. USBIO demo application is used on the PC side.\
 						Using USBIO demo app, user should capture data to a file. When prompted, use USBIO application to send the recorded file back to device.\
 						The device side application will compare the data and show the result\n"));
+		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP05, "The following test attempts to write data to the host application. USBIO demo application is used on the PC side."\
+						L"Using USBIO demo app, user should capture data to a file. When prompted, use USBIO application to send the recorded file back to device."\
+						L"The device side application will compare the data and show the result\n");
 		test.Printf(_L("Test Write using BIL apis\n"));
+		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP06, "Test Write using BIL apis\n");
 		BILWrite(iWriteBuf);
 	
 		test.Printf(_L("Test Read using BIL api's\n"));
+		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP07, "Test Read using BIL api's\n");
 		BILRead(iReadBuf);
 
 		test.Printf(_L("Compare Read and Write buffers\n"));
+		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP08, "Compare Read and Write buffers\n");
 		TBool ret = CompareBuffs(iReadBuf, iWriteBuf);
 		if(!ret)
 			{
 			test.Printf(_L("!!warning- compare buffers found discrepancies!\n"));
+			OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP09, "!!warning- compare buffers found discrepancies!\n");
 			}
 		}
 	gChunk.Close();
 	test.Printf(_L("Close global USB channel\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP10, "Close global USB channel\n");
 	gPort.Close();
 	}
 
@@ -3456,15 +3729,19 @@
 
 	test.Next(_L("BIL Alternate Setting Change"));
 	test.Printf(_L("Open global USB channel"));
+	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE, "Open global USB channel");
 	TInt r = gPort.Open(0);
 	test_KErrNone(r);
 	//Test for a simple interface with 2 endpoints
 	test.Printf(_L("Set up interface 0\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP01, "Set up interface 0\n");
 	SetupBulkInterfaces(0,1,1);
 	test.Printf(_L("Set up interface 1\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP02, "Set up interface 1\n");
 	SetupBulkInterfaces(1,1,1);
 	RChunk *tChunk = &gChunk;
 	test.Printf(_L("Finalize Interface\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP03, "Finalize Interface\n");
 	gPort.FinalizeInterface(tChunk);
 
 	if(gRealHardware)
@@ -3472,9 +3749,11 @@
 		gPort.ReEnumerate(status);
 		User::WaitForRequest(status);
 		test.Printf(_L("Enumerated. status = %d\n"), status.Int());
+		OstTrace1(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP04, "Enumerated. status = %d\n", status.Int());
 		}
 	gChunk.Close();
 	test.Printf(_L("Close global USB channel\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP05, "Close global USB channel\n");
 	gPort.Close();
 	}
 
@@ -3501,6 +3780,7 @@
 	if(gRealHardware)
 		{
 		test.Printf(_L("With USBIO, open and configure the device, then send then and then recieve at lest 4 class/vendor requests to interface 0\n"));
+		OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0, "With USBIO, open and configure the device, then send then and then recieve at lest 4 class/vendor requests to interface 0\n");
 
 		TBool passed=EFalse;
 		TBool error=EFalse;
@@ -3539,8 +3819,10 @@
 				if (test.Console()->KeyCode() == EKeyEscape)
 					break;
 				else
+					{
 					test.Printf(_L("Press escape to end EP0 testing\n"));	
-
+					OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP01, "Press escape to end EP0 testing\n");	
+					}
 				test.Console()->Read(keyStatus);
 				}
 
@@ -3548,7 +3830,10 @@
 				{
 				ret = epBuf.GetBuffer((TAny*&)readBuf,aSize,aZlp,status);
 				if(gVerbose)
+				    {
 					test.Printf(_L("Getbuffer returned %d, aSize: %d, aZlp: %d\n"),ret, aSize,aZlp);
+					OstTraceExt3(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP02, "Getbuffer returned %d, aSize: %d, aZlp: %d\n",ret, aSize,aZlp);
+					}
 				}
 
 			if (ret==KErrNone)
@@ -3563,6 +3848,7 @@
 				{
 				TInt state = *((TInt*) readBuf);
 				test.Printf(_L("Status Change:! %d : %S \n"),state,((state<0) || (state>7))?KStates[8]:KStates[state]);
+				OstTraceExt2(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP03, "Status Change:! %d : %S \n",state,((state<0) || (state>7))?*KStates[8]:*KStates[state]);
 				test_Equal(aSize, 4);
 				goodStateChange++;
 				}
@@ -3575,6 +3861,7 @@
 					if (aSize!=8)
 						{
 						test.Printf(_L("Error: Malformed control packet of size %d.\n"),aSize);
+						OstTrace1(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP04, "Error: Malformed control packet of size %d.\n",aSize);
 						error = ETrue;
 						}
 					else
@@ -3586,6 +3873,7 @@
 							{
 							// Send data
 							test.Printf(_L("Sending %d bytes of data value increasing from 0x0 in 1 step. Verify data is received at the host\n"),setup->iWlength);
+							OstTrace1(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP05, "Sending %d bytes of data value increasing from 0x0 in 1 step. Verify data is received at the host\n",setup->iWlength);
 							TUint8 *ep0Buffer; // = (TUint8 *)epBuf.Ep0In()BufferStart;
 							TUint ep0Length;
 							epBuf.GetInBufferRange(((TAny*&)ep0Buffer),ep0Length);
@@ -3611,6 +3899,7 @@
 								{
 								gPort.SendEp0StatusPacket();
 								test.Printf(_L("No Data.\n"));
+								OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP06, "No Data.\n");
 								}
 							} // end HostToDevice type
 						} //packet Correct length
@@ -3625,6 +3914,7 @@
 					if (aZlp && dataLength)
 						{
 						test.Printf(_L("\nError: ZLP received before enough data is read out!\nFailing Test!\n"));
+						OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP07, "\nError: ZLP received before enough data is read out!\nFailing Test!\n");
 						error=ETrue;
 						phase=0;
 						}
@@ -3634,11 +3924,14 @@
 						gPort.SendEp0StatusPacket();
 						//Print read out values
 						test.Printf(_L("Data Read:"));
+						OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP08, "Data Read:");
 						for(TInt i=0; i < iReadBuf.Length(); i++)
 							{
 							test.Printf(_L("0x%x "),iReadBuf[i]);
+							OstTrace1(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP09, "0x%x ",iReadBuf[i]);
 							}
 						test.Printf(_L("\n"));
+						OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP10, "\n");
 						goodReads++;
 						}
 
@@ -3655,14 +3948,19 @@
 			{
 			if (!error)
 				test.Printf(_L("\nInsifishant reads/writes where seen to work, to pass test.\n"));
+				OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP11, "\nInsifishant reads/writes where seen to work, to pass test.\n");
 								
 			test.Printf(_L("\n ***************\n"));
+			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP12, "\n ***************\n");
 			test.Printf(_L(" * FAILED TEST *\n"));
+			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP13, " * FAILED TEST *\n");
 			test.Printf(_L(" ***************\n\nKey to Continue."));
+			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP14, " ***************\n\nKey to Continue.");
 			}
 		else
 			{
 			test.Printf(_L("\nIf the USBIO demo application responded as expected, then this can be called a passed test.\n\nKey to Continue.\n"));		
+			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP15, "\nIf the USBIO demo application responded as expected, then this can be called a passed test.\n\nKey to Continue.\n");		
 			}
 
 		//Note- A disturbing fact! If host aborts data transmission and send a new setup packet, the userside is clueless as to what it's reading is
@@ -3671,6 +3969,7 @@
 		} // end if-real-hardware
 	gChunk.Close();
 	test.Printf(_L("Close global USB channel\n"));
+	OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP16, "Close global USB channel\n");
 	gPort.Close();
 	} // end funcion
 
@@ -3928,7 +4227,10 @@
 		if (gSpecTest>=EBilRw)
 			TestBIL();
 		else
+			{
 			test.Printf(_L("No such option \n"));
+			OstTrace0(TRACE_NORMAL, STARTTESTS_STARTTESTS, "No such option \n");
+			}
 	}
 
 
@@ -4015,8 +4317,11 @@
 			if ((token==_L("help")) || (token==_L("-h")) || (token==_L("/h")) || (token==_L("-?")) || (token==_L("/?")))
 				{
 				test.Printf(_L("\nThis tests the Shared chunk version of the USBC driver.  It focuses on the elements specific to this driver and should be used in conjuntion with other USBC tests in order to validate the driver.\n\n"));
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE, "\nThis tests the Shared chunk version of the USBC driver.  It focuses on the elements specific to this driver and should be used in conjuntion with other USBC tests in order to validate the driver.\n\n");
 				test.Printf(_L("\n -h : Help.\n -r : test on Real hardware\n -v : Verbose\n -V : Very verbose\n-t <test> : Run a specific test.\n"));   
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01, "\n -h : Help.\n -r : test on Real hardware\n -v : Verbose\n -V : Very verbose\n-t <test> : Run a specific test.\n");   
 				test.Printf(_L("\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt\n"));
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02, "\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt\n");
 				err=KErrCancel;
 				}
 			else
@@ -4101,8 +4406,12 @@
 		if (err!=KErrNone)
 			{
 			if (err==KErrArgument)
+				{
 				test.Printf(_L("\nUnknown argument '%S%s%S'\n"), &token, (subtoken.Length()==0)?"":" ", &subtoken);
+				OstTraceExt3(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03, "\nUnknown argument '%S%S%S'\n", token, (subtoken.Length()==0)?_L(""):_L(" "), subtoken);
+				}
 			test.Printf(_L("\nUsage:  t_usbcsc [-hrvVt]\n\n"));
+			OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04, "\nUsage:  t_usbcsc [-hrvVt]\n\n");
 			test.Getch();
 			return err;
 			}
@@ -4124,6 +4433,7 @@
 	if (r != KErrNone)
 		{
 		test.Printf(_L("Unable to get Platform ID. Skipping tests\n"));
+		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "Unable to get Platform ID. Skipping tests\n");
 		return KErrNone;
 		}
 	if (SupportsUsb() && (muid != HAL::EMachineUid_Lubbock))
@@ -4133,6 +4443,7 @@
 	else
 		{
 		test.Printf(_L("USB is not supported on this platform.  Skipping test\n"));
+		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "USB is not supported on this platform.  Skipping test\n");
 		}
 	
    	test.End();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/dm_autoexec.bat	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,20 @@
+@rem
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+trace 2 2
+z:
+cd \test
+runtests dmtest.auto.bat -t 60 -p -st -c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/dm_tests.iby	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,34 @@
+// Copyright (c) 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:
+//
+// Description:
+// Domain Manager Tests
+//
+
+#ifndef __DM_TEST_IBY__
+#define __DM_TEST_IBY__
+
+
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain.exe				\sys\bin\t_domain.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain_slave.exe			\sys\bin\t_domain_slave.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy99.dll			\sys\bin\domainpolicy99.dll
+
+
+data=\epoc32\rom\include\dmtest.auto.bat				\test\dm.auto.bat
+
+#if defined(DM_AUTO_ROM)
+data=\epoc32\rom\include\dm_autoexec.bat				\autoexec.bat
+#endif
+
+
+
+#endif // __DM_TEST_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/dmtest.auto.bat	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,17 @@
+@rem
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+t_domain
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy99.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,45 @@
+// Copyright (c) 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:
+//
+// Description:
+// e32test/domainmgr/domainpolicy99.mmp
+// domainpolicy99.dll Test Domain manager policy module
+// 
+//
+
+/**
+ @file
+*/
+
+
+TARGET          domainpolicy99.dll
+CAPABILITY PowerMgmt ProtServ DiskAdmin
+TARGETTYPE      dll
+
+userinclude		.
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+sourcepath	.
+source		domainpolicytest.cpp
+
+library		euser.lib
+
+
+START WINS
+END
+
+START MARM
+END
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicytest.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,98 @@
+// Copyright (c) 2004-2009 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:
+//
+// Description:
+//
+
+#include <domainpolicy.h>
+#include "domainpolicytest.h"
+
+const TInt KDomainTimeout = 2000000; /* 2000ms */
+
+static const TDmDomainSpec DomainHierarchy[] = 
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 1		
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// end of array marker
+		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,	0,	0	}
+	};
+static const TDmHierarchyPolicy HierarchyPolicy	= 
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+	
+
+
+/**
+Gets access to the test hierarchy specification.
+
+The domain hierarchy specification is a simple array of TDmDomainSpec items.
+
+The default implementation provided by Symbian OS just returns a pointer to
+the domain hierarchy specification array.
+
+@return A pointer to the domain hierarchy specification array.
+*/
+EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
+	{
+	return (TDmDomainSpec*) DomainHierarchy;
+	}
+
+
+
+
+/**
+Releases access to the specified domain hierarchy specification.
+
+The domain hierarchy specification is a simple array of TDmDomainSpec items.
+
+As the default Symbian OS implementation of GetDomainSpecs() just returns
+a pointer to the domain hierarchy specification array, then the default
+implementation of Release() is empty. The API is provided to permit
+more complex implementations, if required.
+
+@param aDomainSpec A pointer to the domain hierarchy specification array.
+*/
+EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
+	{
+	}
+
+
+/**
+Retrieves the domain hierarchy policy 
+
+@param	aPolicy a client-supplied policy which on exit
+		will contain a copy of the policy for the requested domain hierarchy id.
+
+  
+@return	KErrNone
+*/
+EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
+	{
+	aPolicy = HierarchyPolicy;
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicytest.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,73 @@
+// Copyright (c) 2004-2009 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:
+//
+// Description:
+//
+
+#ifndef __DOMAIN_POLICY_TEST_H__
+#define __DOMAIN_POLICY_TEST_H__
+
+// The test domain hierarchy id 
+
+static const TDmHierarchyId	KDmHierarchyIdTest = 99;
+
+/*
+Domains defined in this hiearchy
+The hierarchy desribed here looks like this:
+		Root
+		A				B				C
+		AA	AB			BA				CA
+			ABA	ABB						CAA
+
+*/
+static const TDmDomainId	KDmIdTestA		= 0x02;
+static const TDmDomainId	KDmIdTestB		= 0x03;
+static const TDmDomainId	KDmIdTestC		= 0x04;
+
+static const TDmDomainId	KDmIdTestAA		= 0x05;
+static const TDmDomainId	KDmIdTestAB		= 0x06;
+static const TDmDomainId	KDmIdTestBA		= 0x07;
+static const TDmDomainId	KDmIdTestCA		= 0x08;
+
+static const TDmDomainId	KDmIdTestABA	= 0x09;
+static const TDmDomainId	KDmIdTestABB	= 0x0A;
+static const TDmDomainId	KDmIdTestCAA	= 0x0B;
+static const TInt KTestDomains = 0x0B;	// number of domains including root
+
+
+/*
+System-wide start-up states
+
+Some of these states may be ommitted depending on the start-up mode.
+E.g. The system-starter might choose to omit EStartupNonCritical in "safe" mode
+*/
+enum TStartupState
+	{
+	/** In this state, all ROM based (static) components or resources that 
+	are critical to the operation of the phone are started */
+	EStartupCriticalStatic,
+
+	/** In this state, all non-ROM based (dynamic) components or resources that 
+	are critical to the operation of the phone are started */
+	EStartupCriticalDynamic,
+
+	/** In this state, all ROM based (static) or non-ROM based (dynamic) 
+	components or resources that are not critical to the operation of the phone 
+	are started */
+	EStartupNonCritical,
+
+	/** An integer that is strictly greater thean any legal start-up state value */
+	EStartupLimit
+	};
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,2266 @@
+// Copyright (c) 2002-2009 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:
+//
+// Description:
+// e32test\power\t_domain.cpp
+// Overview:
+// Domain manager tests
+// API Information:
+// RDmDomain, RDmDomainManager CDmDomain, CDmDomainManager
+// Details:
+// - Test a variety of domain transitions, check the expected number of
+// notifications and the first expected ordinal. Verify results are
+// as expected.
+// - Test system standby, check the expected number of notifications and 
+// the first expected ordinal. Use a timer to request a wakeup event.
+// Verify results are as expected.
+// - Test domain related simple error situations, verify results are
+// as expected.
+// - Perform platform security tests: launch a separate process with no 
+// capabilities, verify that results are as expected.
+// - Test domain transitions by connecting to two domain hierarchies 
+// simultaneously, add some test and power hierarchy members, verify
+// the expected target state, notifications and leaf nodes. Verify results.
+// - Verify that the same hierarchy can not be connected to more than once.
+// - Request a positive transition and request that the test domain use 
+// ETraverseParentsFirst. Verify results are as expected and verify 
+// domains are in the correct state.
+// - Request a negative transition and request that the test domain use 
+// ETraverseChildrenFirst. Verify results are as expected.
+// - Request a positive transition with zero acknowledgements. Verify 
+// results are as expected.
+// - Request a positive transition with error acknowledgements. Verify 
+// results are as expected.
+// - Perform a variety of negative tests and verify results are as expected.
+// - Perform various tests on domain transitions with activated observer.
+// Verify results are as expected.
+// Platforms/Drives/Compatibility:
+// All.
+// Assumptions/Requirement/Pre-requisites:
+// Failures and causes:
+// Base Port information:
+// 
+//
+
+#include <e32test.h>
+#include <domainmember.h>
+#include <domainmanager.h>
+#include <domainobserver.h>
+#include "domainpolicytest.h"
+#include <e32debug.h>
+#include <f32file.h>
+#include <e32ldr.h>
+#include <e32ldr_private.h>
+
+LOCAL_D RTest test(_L(" T_DOMAIN "));
+_LIT(KThreadName, "t_domain_panic_thread");
+
+#ifdef _DEBUG
+#define __PRINT(x) {RDebug::Print x;}
+#else
+#define __PRINT(x) 
+#endif
+
+class CDmTestMember;
+
+// interface for test domain memebers.
+// Any test memeber should derive from this interface 
+class MDmDomainMember
+	{
+public:
+	virtual TDmHierarchyId HierarchyId() = 0;
+	virtual TDmDomainId	DomainId() = 0;
+	virtual TDmDomainState State() = 0;
+	virtual TInt Status() = 0;
+	virtual TUint32 Ordinal() = 0;
+	virtual TInt Notifications() = 0;
+	};
+
+class MDmTest
+	{
+public:
+	virtual void Perform() = 0;
+	virtual void Release() = 0;
+	virtual TInt TransitionNotification(MDmDomainMember& aDomainMember) = 0;
+	virtual void TransitionRequestComplete() = 0;
+	};
+
+// for the test hierarchy, we generate an ordinal for each domain
+// each byte of which describes the exact location of the domain in the hierarchy
+#define ORDINAL_FROM_DOMAINID0(id) (id)
+#define ORDINAL_FROM_DOMAINID1(parent, id) ((parent << 8) | (id))
+#define ORDINAL_FROM_DOMAINID2(grandparent, parent, id) ((grandparent << 16) | (parent << 8) | id)
+#define ORDINAL_FROM_DOMAINID3(greatgrandparent, grandparent, parent, id) ((greatgrandparent << 24) | (grandparent << 16) | (parent << 8) | id)
+#define PARENT_ORDINAL(id) (id >> 8)
+
+#define ORDINAL_LEVEL(ordinal)			\
+	((ordinal & 0xFF00) == 0) ? 1 :			\
+	((ordinal & 0xFF0000) == 0) ? 2 :		\
+	((ordinal & 0xFF000000) == 0) ? 3 : 4;
+
+
+// get the least significant domain id character (for debugging purposes)
+TBool GetDomainChar(TDmDomainId aDomainId, TChar& aChar)
+	{
+	TBool found = ETrue;
+	switch(aDomainId)
+		{
+		
+		case KDmIdTestA:	aChar = 'A'; break;
+		case KDmIdTestB:	aChar = 'B'; break;
+		case KDmIdTestC:	aChar = 'C'; break;
+		case KDmIdTestAA:	aChar = 'A'; break;
+		case KDmIdTestAB:	aChar = 'B'; break;
+		case KDmIdTestBA:	aChar = 'A'; break;
+		case KDmIdTestCA:	aChar = 'A'; break;
+		case KDmIdTestABA:	aChar = 'A'; break;
+		case KDmIdTestABB:	aChar = 'B'; break;
+		case KDmIdTestCAA:	aChar = 'A'; break;
+		// domain char not found 
+		case KDmIdNone:
+		case KDmIdRoot:		
+		default:			
+			found = EFalse;
+		}
+	return found;
+	}
+
+// prints the 4-character domain string into the passed descriptor (for debugging purposes)
+// e.g. "CAA" for KDmIdTestCAA
+void GetDomainDesc(TUint32 aOrdinal, TDes& aDes)
+	{
+	if (aOrdinal == KDmIdRoot)
+		{
+		aDes.Append(_L("root"));
+		return;
+		}
+
+	TUint32 val =  aOrdinal;
+
+	for (TInt n=0; n<4; n++)
+		{
+		TDmDomainId domainId = (TDmDomainId) (val >> 24);
+		TChar ch;
+		TBool found = GetDomainChar(domainId, ch);
+		if (found)
+			aDes.Append(ch);
+		val = val << 8;
+		}
+
+	}
+
+
+class CDmTestMember : public CActive, public MDmDomainMember
+	{
+public:	
+	// from CActive
+	void RunL();
+	// from MDmDomainMember
+	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
+	inline TDmDomainId	DomainId() {return iId;};
+	inline TDmDomainState State() {return iState;};
+	inline TInt Status() {return iStatus.Int();};
+	inline TUint32 Ordinal() {return iOrdinal;};
+	inline TInt Notifications() {return iNotifications;};
+
+	CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+	~CDmTestMember();
+	void Acknowledge();
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+
+public:
+	TDmHierarchyId iHierarchy;
+	TDmDomainId	iId;
+	TDmDomainState iState;
+	TUint32		iOrdinal;
+	MDmTest*	iTest;	
+	TInt		iNotifications;
+	RDmDomain	iDomain;
+	};
+
+
+
+CDmTestMember::CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : CActive(CActive::EPriorityStandard), 
+	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
+	{
+	TInt r;
+
+	if (iHierarchy == KDmHierarchyIdPower)
+		 r = iDomain.Connect(iId);
+	else
+		 r = iDomain.Connect(iHierarchy, iId);
+
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+
+	iDomain.RequestTransitionNotification(CActive::iStatus);
+	CActive::SetActive();
+	}
+
+CDmTestMember::~CDmTestMember()
+	{
+	CActive::Cancel();
+	iDomain.Close();
+	}
+
+void CDmTestMember::Acknowledge()
+	{
+	iDomain.AcknowledgeLastState();
+	}
+
+void CDmTestMember::RunL()
+	{
+
+	iNotifications++;
+
+	iState = iDomain.GetState();
+
+	TInt ackError = iTest->TransitionNotification(*this);
+	if (ackError == KErrNone)
+		iDomain.AcknowledgeLastState();
+	else if (ackError == KErrAbort)	// don't acknowledge
+		;
+	else
+		iDomain.AcknowledgeLastState(ackError);
+
+	
+	// request another notification (even if we didn't acknowledge the last one)
+	iDomain.RequestTransitionNotification(CActive::iStatus);
+	CActive::SetActive();
+	}
+
+void CDmTestMember::DoCancel()
+	{
+	iDomain.CancelTransitionNotification();
+	}
+
+
+// CDomainMemberAo
+class CDomainMemberAo : public CDmDomain, public MDmDomainMember
+	{
+public:	
+	static CDomainMemberAo* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+	~CDomainMemberAo();
+
+	// from CActive
+	void RunL();
+
+	// from MDmDomainMember
+	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
+	inline TDmDomainId	DomainId() {return iId;};
+	inline TDmDomainState State() {return iState;};
+	inline TInt Status() {return iStatus.Int();};
+	inline TUint32 Ordinal() {return iOrdinal;};
+	inline TInt Notifications() {return iNotifications;};
+
+private:
+	CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+
+public:
+	TDmHierarchyId iHierarchy;
+	TDmDomainId	iId;
+	TDmDomainState iState;
+	TUint32		iOrdinal;
+	MDmTest*	iTest;	
+	TInt		iNotifications;
+	};
+
+CDomainMemberAo* CDomainMemberAo::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest)
+	{
+	CDomainMemberAo* self=new (ELeave) CDomainMemberAo(aHierarchy, aId, aOrdinal, aTest);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	self->RequestTransitionNotification();
+
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDomainMemberAo::CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : 
+	CDmDomain(aHierarchy, aId), 
+	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
+	{
+	}
+
+CDomainMemberAo::~CDomainMemberAo()
+	{
+	Cancel();
+	}
+
+void CDomainMemberAo::RunL()
+	{
+	iNotifications++;
+
+	iState = GetState();
+
+	TInt ackError = iTest->TransitionNotification(*this);
+	if (ackError == KErrNone)
+		AcknowledgeLastState(ackError);
+	else if (ackError == KErrAbort)	// don't acknowledge
+		;
+	else
+		AcknowledgeLastState(ackError); 
+	if (ackError != KErrAbort)	
+		AcknowledgeLastState(ackError);
+
+	
+	// request another notification (even if we didn't acknowledge the last one)
+	RequestTransitionNotification();
+	}
+
+
+// CDomainManagerAo
+class CDomainManagerAo : public CDmDomainManager
+	{
+public:	
+	~CDomainManagerAo();
+	static CDomainManagerAo* NewL(TDmHierarchyId aHierarchy, MDmTest& aTest);
+
+	// from CActive
+	void RunL();
+
+private:
+	CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest);
+
+private:
+	MDmTest& iTest;
+	};
+
+
+CDomainManagerAo* CDomainManagerAo::NewL(TDmHierarchyId aHierarchy, MDmTest& aTest)
+	{
+	CDomainManagerAo* self=new (ELeave) CDomainManagerAo(aHierarchy, aTest);
+	CleanupStack::PushL(self);
+
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDomainManagerAo::CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest) : 
+	CDmDomainManager(aHierarchy), iTest(aTest)
+	{
+	}
+
+CDomainManagerAo::~CDomainManagerAo()
+	{
+	}
+
+void CDomainManagerAo::RunL()
+	{
+	iTest.TransitionRequestComplete();
+	}
+
+
+class CDmTest1 : public CActive, public MDmTest
+	{
+public: // from CActive
+	void RunL();
+
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+
+	CDmTest1 (TDmDomainId aId, TDmDomainState aState) : CActive(CActive::EPriorityStandard), iDomainId(aId), iState((TPowerState) aState) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	enum { KMembersMax = 16 };
+	CDmTestMember*		iMembers[KMembersMax]; 
+	RDmDomainManager	iManager;
+	TDmDomainId			iDomainId;
+	TPowerState			iState;
+	TBool				iAcknowledge;
+	TInt				iMembersCount;
+	TInt				iCount;
+	TUint32				iOrdinal;
+	};
+
+void CDmTest1::Perform()
+	{
+	//
+	// Test domain transitions
+	//
+
+	test.Next(_L("Test 1"));
+	test.Printf(_L("Domain id = 0x%x Target State = 0x%x\n"), iDomainId, iState);
+	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[0] != NULL);
+	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[1] != NULL);
+	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[2] != NULL);
+	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[3] != NULL);
+	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[4] != NULL);
+	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[5] != NULL);
+	
+	// expected number of notifications
+	iMembersCount = (iDomainId == KDmIdRoot) ? 6 : 2;
+	// first expected ordinal
+	iOrdinal = (iState == EPwActive) ? 0 : 1;
+
+	TInt r = iManager.Connect();
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+
+	iManager.RequestDomainTransition(iDomainId, iState, CActive::iStatus);
+	CActive::SetActive();
+
+	CActiveScheduler::Start();
+	}
+
+TInt CDmTest1::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	++iCount;
+	if (aDomainMember.State() == EPwActive)
+		{
+		if(aDomainMember.Ordinal() < iOrdinal)
+			{
+			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
+			iCount--;
+			}
+		}
+	else
+		{
+		if(aDomainMember.Ordinal() > iOrdinal)
+			{
+			//Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
+			iCount--;
+			}
+		}
+	iOrdinal = aDomainMember.Ordinal();
+
+	// acknowledge one from two
+	iAcknowledge = !iAcknowledge;
+	return iAcknowledge?KErrNone:KErrGeneral;
+	}
+
+void CDmTest1::RunL()
+	{
+	CActiveScheduler::Stop();
+
+	iManager.Close();
+
+	CDmTestMember** mp;
+	for (mp = iMembers; *mp; ++mp)
+		delete *mp;
+	test(iCount == iMembersCount);
+	}
+
+void CDmTest1::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest1::Release()
+	{
+	delete this;
+	}
+
+class CDmTest2Timer : public CTimer
+	{
+public: // fomr CTimer
+   void RunL();
+public:
+	CDmTest2Timer() : CTimer(0) 
+		{
+		TRAPD(r,
+			ConstructL());
+		test(r == KErrNone);
+		CActiveScheduler::Add(this);
+		}
+	};
+
+void CDmTest2Timer::RunL()
+	{
+	test.Printf(_L("Tick count after CDmTest2Timer::RunL() = %d\n"), User::NTickCount());
+
+	// kick the timer again in case power down hasn't happened yet
+	TTime wakeup;
+	wakeup.HomeTime();
+	wakeup += TTimeIntervalSeconds(3);
+	At(wakeup);
+	}
+
+class CDmTest2 : public CActive, public MDmTest
+	{
+public: // from CActive
+	void RunL();
+
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+	CDmTest2 (TDmDomainState aState) : CActive(CActive::EPriorityStandard), iState((TPowerState) aState) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	enum { KMembersMax = 16 };
+	CDmTestMember*		iMembers[KMembersMax]; 
+	RDmDomainManager	iManager;
+	TPowerState			iState;
+	TBool				iAcknowledge;
+	TInt				iMembersCount;
+	TInt				iCount;
+	TUint32				iOrdinal;
+	CDmTest2Timer*		iTimer;
+	};
+
+
+void CDmTest2::Perform()
+	{
+	//
+	// Test system standby
+	//
+
+	test.Next(_L("Test 2"));
+	test.Printf(_L("Target State = 0x%x\n"), iState);
+	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[0] != NULL);
+	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[1] != NULL);
+	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[2] != NULL);
+	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[3] != NULL);
+	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[4] != NULL);
+	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[5] != NULL);
+	
+	// expected number of notifications
+	iMembersCount = 12;
+	// first expected ordinal
+	iOrdinal = (iState == EPwActive) ? 0 : 1;
+
+	TInt r = iManager.Connect();
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+
+	// Use an absolute timer to request a wakeup event
+	iTimer = new CDmTest2Timer();
+	TTime wakeup;
+	wakeup.HomeTime();
+	wakeup += TTimeIntervalSeconds(5);
+	test.Printf(_L("Tick count before timer = %d\n"), User::NTickCount());
+	iTimer->At(wakeup);
+	
+	iManager.RequestSystemTransition(iState, CActive::iStatus);
+	CActive::SetActive();
+
+	CActiveScheduler::Start();
+	}
+
+TInt CDmTest2::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	++iCount;
+	if (aDomainMember.State() == EPwActive)
+		{
+		if(aDomainMember.Ordinal() < iOrdinal)
+			{
+			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State : %d"), 
+																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
+			iCount--;
+			}
+		}
+	else
+		{
+		if(aDomainMember.Ordinal() > iOrdinal)
+			{
+			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State: %d"), 
+																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
+			iCount--;
+			}
+		}
+	iOrdinal = aDomainMember.Ordinal();
+
+	// acknowledge one from two
+	iAcknowledge = !iAcknowledge;
+	return iAcknowledge?KErrNone:KErrAbort;
+	}
+
+void CDmTest2::RunL()
+	{
+	test.Printf(_L("Tick count after CDmTest2::RunL() = %d\n"), User::NTickCount());
+
+	iTimer->Cancel();	
+	CActiveScheduler::Stop();
+
+	iManager.Close();
+
+	CDmTestMember** mp;
+	for (mp = iMembers; *mp; ++mp)
+		delete *mp;
+	test(CActive::iStatus == KErrTimedOut);
+	test(iCount == iMembersCount);
+	}
+
+void CDmTest2::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest2::Release()
+	{
+	if (iTimer)
+		{
+		iTimer->Cancel();
+		delete iTimer;
+		}
+	delete this;
+	}
+
+class CDmTest3 : public MDmTest
+	{
+public: 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+	};
+
+void CDmTest3::Perform()
+	{
+	//
+	// Test simple error situation
+	//
+	RDmDomainManager manager;
+	TInt r = manager.Connect();
+	test(r == KErrNone);
+
+	RDmDomainManager manager1;
+	r = manager1.Connect();
+	test(r == KErrInUse);
+
+	RDmDomain domain;
+	r = domain.Connect(KDmIdNone);
+	test(r == KDmErrBadDomainId);
+	CDmTestMember*		testMember;
+	testMember = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test (testMember != NULL);
+
+	TRequestStatus status;
+	manager.RequestDomainTransition(KDmIdApps, EPwStandby, status);
+	test(status.Int() == KRequestPending);
+
+	TRequestStatus status1;
+	manager.RequestDomainTransition(KDmIdApps, EPwActive, status1);
+	User::WaitForRequest(status1);
+	test(status1.Int() == KDmErrBadSequence);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrTimedOut);
+
+	// Since this test doesn't start the active scheduler, a domain member's RunL() will 
+	// not get called so we need to re-request a domain transition notification manually
+	User::WaitForRequest(testMember->iStatus);
+	test(testMember->iStatus.Int() == KErrNone);
+	testMember->iDomain.RequestTransitionNotification(testMember->iStatus);
+
+	manager.RequestDomainTransition(KDmIdApps, EPwActive, status);
+	test(status.Int() == KRequestPending);
+	manager.CancelTransition();
+	test(status.Int() == KErrCancel);
+	manager.CancelTransition();
+	User::WaitForRequest(status);
+	test(status.Int() == KErrCancel);
+
+	testMember->iDomain.CancelTransitionNotification();
+
+	delete testMember;
+	
+	domain.Close();
+	manager.Close();
+	}
+
+TInt CDmTest3::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
+	{
+	test(0);
+	return KErrAbort;	// don't acknowledge
+	}
+
+void CDmTest3::Release()
+	{
+	delete this;
+	}
+
+class CDmTest4 : public MDmTest
+	{
+public: 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+private:
+	void ExecSlave(TUint arg);
+	};
+
+_LIT(KSecuritySlavePath, "t_domain_slave.exe");
+
+void CDmTest4::ExecSlave(TUint aArg)
+	{
+	RProcess proc;
+	TInt r = proc.Create(KSecuritySlavePath, TPtrC((TUint16*) &aArg, sizeof(aArg)/sizeof(TUint16)));
+	test(r == KErrNone);
+	TRequestStatus status;
+	proc.Logon(status);
+	proc.Resume();
+	User::WaitForRequest(status);
+
+    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitType %d", aArg, proc.ExitType() );
+    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitReason %d", aArg, proc.ExitReason() );
+	test(proc.ExitType() == EExitKill);
+//	test(proc.ExitReason() == KErrPermissionDenied);
+
+	CLOSE_AND_WAIT(proc);
+	}
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-4
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Dmain manager security tests
+//! @SYMREQ 3722
+//! @SYMTestActions Launches a separate process with no capabilities
+//! @SYMTestExpectedResults  DM APIs should fail with KErrPermissionDenied
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest4::Perform()
+	{
+	//
+	// Security tests
+	//
+
+	ExecSlave(0);
+
+    ExecSlave(1);
+
+	}
+
+TInt CDmTest4::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
+	{
+	test(0);
+	return KErrNone;
+	}
+
+void CDmTest4::Release()
+	{
+	delete this;
+	}
+
+// Test hierarchy tests
+class CDmTestStartupMember : public CDmTestMember
+	{
+public:
+	CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+
+public:
+private:
+	};
+
+CDmTestStartupMember::CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) 
+	: CDmTestMember(aHierarchy, aId, aOrdinal, aTest)
+	{
+	}
+
+// Simultaneously testing of test domain defined in DomainPolicy99.dll
+// and the power domain defined in DomainPolicy.dll
+class CDmTest5 : public CActive, public MDmTest
+	{
+public: 
+	// from CActive
+	void RunL();
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+	CDmTest5(TDmDomainId aPowerId, TDmDomainId aTestId, TDmDomainState aPowerState, TDmDomainState aTestState) : 
+		CActive(CActive::EPriorityStandard), 
+		iPowerDomainId(aPowerId), iTestDomainId(aTestId), iPowerState(aPowerState), iTestState(aTestState) {}
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	enum { KMembersMax = 16 };
+	enum TAckMode{ KAckAlways, KAckNever, KAckError, KAckOddDomainsOnly };
+
+	CDmTestMember*		iTestMembers[KMembersMax]; 
+	CDomainMemberAo*	iPowerMembers[KMembersMax]; 
+
+	RDmDomainManager	iTestDomainManager;
+	
+	TDmDomainId			iPowerDomainId;
+	TDmDomainId			iTestDomainId;
+
+	TDmDomainState		iPowerState;
+	TDmDomainState		iTestState;
+
+	// level number for iTestDomainId. E.g 1 for KDmIdRoot, 2 for KDmIdTestA, etc.
+	TInt				iTestDomainLevel;	
+
+	TDmTraverseDirection iTraverseDirection;
+
+	TAckMode			iAckMode;
+
+public:
+	TInt				iTestNotifications;
+	TInt				iPowerNotifications;
+	TInt				iTestNotificationsExpected;
+	TInt				iPowerNotificationsExpected;
+
+	TInt				iTransitionsCompleted;
+	TInt				iTransitionsExpected;
+	};
+
+
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-5
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Connects to two domain hierarchies simulteneously and perform various tests
+//! @SYMREQ 3704,3705,3706,3707,3708,3709,3710,3711,3720,3721,3724,3725,3726,3727
+//! @SYMTestActions Open two hiearchies simultaneously and perform various actions.
+//! @SYMTestExpectedResults  All tests should pass
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest5::Perform()
+	{
+
+ 	__UHEAP_MARK;
+
+	//
+	// Test domain transitions
+	//
+	CActiveScheduler::Add(this);
+
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
+
+    RDebug::Printf("RDmDomainManager::AddDomainHierarchy returns %d", r );
+
+	test(r == KErrNone);
+
+	CDomainManagerAo* powerDomainManager = NULL;
+	TRAP(r, powerDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdPower, *this));
+	test (powerDomainManager != NULL);
+
+	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdPower);
+	test(r == KErrNone);
+
+	//*************************************************
+	//	Test 5a - connect to two domain hierarchies simultaneously
+	//*************************************************
+	test.Next(_L("Test 5a - connect to two domain hierarchies simultaneously"));
+
+	test.Printf(_L("Domain id = 0x%x, Target State = 0x%x\n"), iTestDomainId, iTestState);
+
+	TInt testMemberCount = 0;
+
+	// Add some test hierarchy members - these use the RDmDomain API
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 1
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row2
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 3
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+
+	// add some power hierarchy members - these use the CDmDomain AO API
+	TInt powerMemberCount = 0;
+	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdRoot, KDmIdRoot, this));
+	test(iTestMembers[powerMemberCount++] != NULL);
+	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdApps, KDmIdApps, this));
+	test(iTestMembers[powerMemberCount++] != NULL);
+	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdUiApps, KDmIdUiApps, this));
+	test(iTestMembers[powerMemberCount++] != NULL);
+
+
+	RArray<const TTransitionFailure> testFailures;
+	TInt testFailureCount;
+	RArray<const TTransitionFailure> powerFailures;
+	TInt powerFailureCount;
+
+
+
+	// calculate the expected number of notifications
+	TInt expectedTestNotifications = 0;
+	TInt leafNodes = 0;
+	
+
+	// work out the domain level, the number of leaf nodes and the expected number of 
+	// notifications for the domain that is being transitioned
+	switch(iTestDomainId)
+		{
+		case KDmIdRoot		:	iTestDomainLevel = 1; leafNodes = 5; expectedTestNotifications = testMemberCount; break;
+		case KDmIdTestA		:	iTestDomainLevel = 2; leafNodes = 3; expectedTestNotifications = 5; break;
+		case KDmIdTestB		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 2; break;
+		case KDmIdTestC		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 3; break;
+
+		case KDmIdTestAA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestAB	:	iTestDomainLevel = 3; leafNodes = 2; expectedTestNotifications = 3; break;
+		case KDmIdTestBA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestCA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 2; break;
+
+		case KDmIdTestABA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestABB	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestCAA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
+		default:
+			test(0);
+		}
+	test.Printf(_L("Test Domain id = 0x%x, Level = %d, Target State = 0x%x, expected notifications = %d, leafNodes = %d\n"), 
+		iTestDomainId, iTestDomainLevel, iTestState, expectedTestNotifications, leafNodes);
+
+	TInt expectedPowerNotifications = 0;
+	switch(iPowerDomainId)
+		{
+		case KDmIdRoot		:	expectedPowerNotifications = powerMemberCount; break;
+		case KDmIdApps		:	expectedPowerNotifications = 1; break;
+		case KDmIdUiApps	:	expectedPowerNotifications = 1; break;
+		default:
+			test(0);
+		}
+
+
+
+	// connect to the test hierarchy
+	r = iTestDomainManager.Connect(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	// verify that we can't connect to the same hierarchy more than once
+	RDmDomainManager	domainManager;
+	r = domainManager.Connect(KDmHierarchyIdTest);
+	test(r == KErrInUse);
+
+
+
+	//*************************************************
+	// Test 5b - request a positive transition
+	// issue a positive  transition (i.e. transition state increases)
+	// and request that the test domain use ETraverseParentsFirst
+	//*************************************************
+	test.Next(_L("Test 5b - request a positive transition"));
+	iAckMode = KAckAlways;
+
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = 0;
+	iTestNotificationsExpected = expectedTestNotifications;
+	iTransitionsExpected = 1;
+
+	// DON'T request any domain transition on the power hierarchy
+	// powerDomainManager->RequestDomainTransition(iPowerDomainId, EPwActive);
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseParentsFirst;
+	if (iTestDomainId == KDmIdRoot)
+		iTestDomainManager.RequestSystemTransition(iTestState, ETraverseDefault, CActive::iStatus);
+	else
+		iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault, CActive::iStatus);
+	CActive::SetActive();
+
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrNone);
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+
+	//*************************************************
+	// Test 5c- verify domains are in correct state
+	//*************************************************
+	test.Next(_L("Test 5c- verify domains are in correct state"));
+	RDmDomain domainMember;
+	r = domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	test (r == KErrNone);
+	TDmDomainState state = domainMember.GetState();
+	domainMember.Close();
+	test (state == iTestState);
+
+	// if the transition request is not on the root, verify that that 
+	// the root domain and the transition domain are in different states
+	if (iTestDomainId != KDmIdRoot && iTestState != EStartupCriticalStatic)
+		{
+		r = domainMember.Connect(KDmHierarchyIdTest, KDmIdRoot);
+		test (r == KErrNone);
+		TDmDomainState state = domainMember.GetState();
+		domainMember.Close();
+		test (state != iTestState);
+		}
+
+
+	//*************************************************
+	// Test 5d- request a negative transition
+	// issue a negative transition (i.e. transition state decreases)
+	// and request that the test domain use ETraverseChildrenFirst
+	//*************************************************
+	test.Next(_L("Test 5d- request a negative transition"));
+	iAckMode = KAckAlways;
+	iTestState--;	// EStartupCriticalStatic;
+	iPowerState--;	// EPwStandby
+
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = expectedPowerNotifications;
+	iTestNotificationsExpected = expectedTestNotifications;
+	iTransitionsExpected = 2;
+
+	// DO request a domain transition on the power hierarchy
+	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
+
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseChildrenFirst;
+	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
+	CActive::SetActive();
+
+	// wait for all test & power transitions to complete
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrNone);
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+	
+
+	//*************************************************
+	// Test 5e- request a positive transition, with zero acknowledgements
+	// issue a positive transition with no members acknowledging the transition
+	//*************************************************
+	test.Next(_L("Test 5e- request a positive transition, with zero acknowledgements"));
+	iAckMode = KAckNever;
+	iTestState++;		// EStartupCriticalDynamic;
+	iPowerState++;		// EPwActive
+
+	// power hierarchy should continue on failure, so we all power domains should transition
+	// test hierarchy should stop on failure, so should get notifications from all leaf nodes
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = expectedPowerNotifications;
+	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
+	iTransitionsExpected = 2;
+
+	// DO request a domain transition on the power hierarchy
+	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
+
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseChildrenFirst;
+	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
+	CActive::SetActive();
+
+	// wait for all test & power transitions to complete
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrTimedOut);
+	test(iStatus == KErrTimedOut);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+	
+	// get the failures on the test hierarchy
+	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
+	test (testFailureCount == 1);
+
+	r = iTestDomainManager.GetTransitionFailures(testFailures);
+	test(r == KErrNone);
+	test(testFailureCount == testFailures.Count());
+
+	test.Printf(_L("Test failures = %d\n"), testFailureCount);
+	TInt i;
+	for (i=0; i<testFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, testFailures[i].iDomainId, testFailures[i].iError);
+		test(testFailures[i].iError == KErrTimedOut);
+		}
+
+	// get the failures on the power hierarchy
+	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
+	test (powerFailureCount == expectedPowerNotifications);
+
+	r = powerDomainManager->GetTransitionFailures(powerFailures);
+	test(r == KErrNone);
+	test(powerFailureCount == powerFailures.Count());
+
+	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
+	for (i=0; i<powerFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, powerFailures[i].iDomainId, powerFailures[i].iError);
+		test(powerFailures[i].iError == KErrTimedOut);
+		}
+
+	
+	//*************************************************
+	// Test 5f- request a positive transition, with error acknowledgements
+	// issue a positive transition with all members nack'ing the transition
+	//*************************************************
+	test.Next(_L("Test 5f- request a positive transition, with error acknowledgements"));
+	iAckMode = KAckError;
+	iTestState++;		
+	iPowerState++;		
+
+	// power hierarchy should continue on failure, so all power domains should transition
+	// test hierarchy should stop on failure, so should get notifications from 
+	// anything from 1 to all the leaf nodes
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = expectedPowerNotifications;
+	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
+	iTransitionsExpected = 2;
+
+	// DO request a domain transition on the power hierarchy
+	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
+
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseChildrenFirst;
+	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
+	CActive::SetActive();
+
+	// wait for all test & power transitions to complete
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrGeneral);
+	test(iStatus == KErrGeneral);
+	test(iTestNotifications <= iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+	
+	// get the failures on the test hierarchy
+	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
+	test (testFailureCount == 1);
+
+	r = iTestDomainManager.GetTransitionFailures(testFailures);
+	test(r == KErrNone);
+	test(testFailureCount == testFailures.Count());
+
+	test.Printf(_L("Test failures = %d\n"), testFailureCount);
+	for (i=0; i<testFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, testFailures[i].iDomainId, testFailures[i].iError);
+		test(testFailures[i].iError == KErrGeneral);
+		}
+
+	// get the failures on the power hierarchy
+	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
+	test (powerFailureCount == expectedPowerNotifications);
+
+	r = powerDomainManager->GetTransitionFailures(powerFailures);
+	test(r == KErrNone);
+	test(powerFailureCount == powerFailures.Count());
+
+	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
+	for (i=0; i<powerFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, powerFailures[i].iDomainId, powerFailures[i].iError);
+		test(powerFailures[i].iError == KErrGeneral);
+		}
+
+	
+	// cleanup
+
+	testFailures.Reset();
+	powerFailures.Reset();
+
+	iTestDomainManager.Close();
+	delete powerDomainManager;
+	powerDomainManager = NULL;
+
+	CDmTestMember** mt;
+	for (mt = iTestMembers; *mt; ++mt)
+		delete *mt;
+
+	CDomainMemberAo** mp;
+	for (mp = iPowerMembers; *mp; ++mp)
+		delete *mp;
+
+
+	// restore the domain hierarchies to their initial state so as not to 
+	// upset any subsequent tests which rely on this
+	{
+	RDmDomainManager manager;
+	TInt r = manager.Connect();
+	test (r == KErrNone);
+	TRequestStatus status;
+	manager.RequestDomainTransition(KDmIdRoot, EPwActive, status);
+	test(status.Int() == KRequestPending);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+	manager.Close();
+	
+	r = manager.Connect(KDmHierarchyIdTest);
+	test (r == KErrNone);
+	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
+	test(status.Int() == KRequestPending);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+	manager.Close();
+	}
+
+ 	__UHEAP_MARKEND;
+	}
+
+// This handles a transition notification from either a power domain member or 
+// a test domain member.
+// Verifies that the domain state is as expected.
+// Updates the number of notifications for each hierarchy and verifies that all parent 
+// domains have transitioned already (for parent-to-child transitions) or that all child 
+// domains have been transitioned already (for child-to-parent transitions).
+
+TInt CDmTest5::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
+		iPowerNotifications++;
+	else
+		iTestNotifications++;
+
+	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
+		{
+		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+			aDomainMember.HierarchyId(), aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
+		test(aDomainMember.State() == iPowerState);
+		}
+	else if (aDomainMember.HierarchyId() == KDmHierarchyIdTest)
+		{
+		TBuf16<4> buf;
+		GetDomainDesc(aDomainMember.Ordinal(), buf);
+
+		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+			aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
+		test(aDomainMember.State() == iTestState);
+		}
+	else
+		{
+		test(0);
+		}
+
+	// if we're going from parent to child, 
+	// check that each parent domain has received a notification already
+	// if not, check that each child domain has received a notification already
+
+	CDmTestMember** mp;
+
+	if (aDomainMember.HierarchyId() == KDmHierarchyIdTest && iAckMode == KAckAlways)
+		{
+
+		if (iTraverseDirection == ETraverseParentsFirst)
+			{
+			TUint ordThis = aDomainMember.Ordinal();
+			TUint ordParent = PARENT_ORDINAL(ordThis);
+
+			TInt levelParent = ORDINAL_LEVEL(ordParent);
+
+			TBuf16<4> buf;
+			GetDomainDesc(ordParent, buf);
+			if (levelParent >= iTestDomainLevel)
+				{
+				__PRINT((_L("Searching for parent domain = %S, ordinal = %08X \n"), &buf, ordParent));
+				for (mp = iTestMembers; *mp; ++mp)
+					{
+					if ((*mp)->Ordinal() == ordParent)
+						{
+						TBuf16<4> buf;
+						GetDomainDesc((*mp)->Ordinal(), buf);
+						__PRINT((_L("Found parent (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
+						test ((*mp)->Notifications() == aDomainMember.Notifications());
+						break;
+						}
+					}
+				}
+			}
+		else
+			{
+			__PRINT((_L("Searching for children\n")));
+			for (mp = iTestMembers; *mp; ++mp)
+				{
+
+				TUint ordParent = PARENT_ORDINAL((*mp)->Ordinal());
+				if (ordParent == aDomainMember.Ordinal())
+					{
+					TBuf16<4> buf;
+					GetDomainDesc((*mp)->Ordinal(), buf);
+					__PRINT((_L("Found child (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
+					test ((*mp)->Notifications() == aDomainMember.Notifications());
+					}
+				}
+			}
+		}
+
+	TInt ackError;
+	switch (iAckMode)
+		{
+		case KAckNever:
+			ackError = KErrAbort;
+			break;
+		case KAckError:		// return an error to the DM
+			ackError = KErrGeneral;
+			break;
+		case KAckOddDomainsOnly:
+			ackError = (aDomainMember.DomainId() & 1)?KErrNone:KErrAbort;
+			break;
+		case KAckAlways:
+		default:
+			ackError = KErrNone;
+			break;
+		}
+	return ackError;
+	}
+
+void CDmTest5::RunL()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest5::RunL(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications , iPowerNotifications));
+
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest5::TransitionRequestComplete()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest5::TransitionRequestComplete(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications , iPowerNotifications));
+	
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest5::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest5::Release()
+	{
+	delete this;
+	}
+
+const TInt KMembersMax = 16;
+
+// Negative testing 
+class CDmTest6 : public CActive, public MDmTest
+	{
+public:
+	enum 
+	{
+	ENegTestTransitionNoConnect,
+	ENegTestGetStateNoConnect,
+	ENegTestTransitionInvalidMode
+	};
+
+	class TData 
+		{
+	public:
+		inline TData(TInt aTest) : iTest(aTest){};
+		TInt iTest;
+		};
+
+public: 
+	// from CActive
+	void RunL();
+ 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+
+
+	CDmTest6() : CActive(CActive::EPriorityStandard) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	static TInt PanicThreadFunc(TAny* aData);
+	void PanicTest(TInt aTestNumber);
+
+
+	CDomainMemberAo*	iTestMembers[KMembersMax]; 
+	CDomainManagerAo*	iTestDomainManager;
+	
+	TDmDomainId			iTestDomainId;
+	TDmDomainState		iTestState;
+
+public:
+	TInt				iTestNotifications;
+	TInt				iTestNotificationsExpected;
+
+	TInt				iTransitionsCompleted;
+	TInt				iTransitionsExpected;
+	};
+
+TInt CDmTest6::PanicThreadFunc(TAny* aData)
+	{
+	const TData* data = (const TData*)aData;
+	switch (data->iTest)
+		{
+		case ENegTestTransitionNoConnect:
+			{
+			// request a transition notification without connecting first (should panic)
+			RDmDomain domainMember;
+			TRequestStatus status;
+			User::SetJustInTime(EFalse);
+			domainMember.RequestTransitionNotification(status);
+			}
+			break;
+		case ENegTestGetStateNoConnect:
+			{
+			// Get the domain state without connecting (should panic)
+			RDmDomain domainMember;
+			User::SetJustInTime(EFalse);
+			domainMember.GetState();
+			}
+			break;
+		case ENegTestTransitionInvalidMode:
+			{
+			RDmDomainManager manager;
+			TRequestStatus status;
+			TInt r = manager.Connect(KDmHierarchyIdTest);
+			test(r == KErrNone);
+
+			User::SetJustInTime(EFalse);
+			manager.RequestDomainTransition(KDmIdRoot, 0, TDmTraverseDirection(-1), status);
+			}
+			break;
+		default:
+			break;
+		}
+	return KErrNone;
+	}
+
+void CDmTest6::PanicTest(TInt aTestNumber)
+	{
+	test.Printf(_L("panic test number %d\n"), aTestNumber);
+
+	TBool jit = User::JustInTime();
+
+	TData data(aTestNumber);
+
+	TInt KHeapSize=0x2000;
+
+	RThread thread;
+	TInt ret = thread.Create(KThreadName, PanicThreadFunc, KDefaultStackSize, KHeapSize, KHeapSize, &data);
+	test(KErrNone == ret);
+	TRequestStatus stat;
+	thread.Logon(stat);
+	thread.Resume();
+	User::WaitForRequest(stat);
+
+	User::SetJustInTime(jit);
+
+	// The thread must panic
+	test(thread.ExitType() == EExitPanic);
+	TInt exitReason = thread.ExitReason();
+	test.Printf(_L("panic test exit reason = %d\n"), exitReason);
+
+	switch(aTestNumber)
+		{
+		case ENegTestTransitionNoConnect:
+			test (exitReason == EBadHandle);
+			break;
+		case ENegTestGetStateNoConnect:
+			test (exitReason == EBadHandle);
+			break;
+		case ENegTestTransitionInvalidMode:
+			break;
+		default:
+			break;
+		}
+
+	CLOSE_AND_WAIT(thread);
+	}
+
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-6
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Negative testing
+//! @SYMPREQ 810
+//! @SYMTestActions Various negative tests
+//! @SYMTestExpectedResults  All tests should pass
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest6::Perform()
+	{
+
+ 	__UHEAP_MARK;
+
+	CActiveScheduler::Add(this);
+
+	CDomainManagerAo* iTestDomainManager = NULL;
+	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	test (iTestDomainManager != NULL);
+
+	TInt r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	//*************************************************
+	// Test 6a - Connect to the same hierarchy twice
+	//*************************************************
+	test.Next(_L("Test 6a - Connect to the same hierarchy twice"));
+
+	// verify that we can't connect to the same hierarchy more than once
+	CDomainManagerAo* testDomainManager = NULL;
+	TRAP(r, testDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	test(r == KErrInUse);
+	test (testDomainManager == NULL);
+
+
+	TInt testMemberCount = 0;
+
+	// Add some test hierarchy members
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 1
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row2
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 3
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+
+
+	//*************************************************
+	// Test 6b change to current state
+	//*************************************************
+	test.Next(_L("Test 6b change to current state"));
+	iTestState =  EStartupCriticalStatic;
+	iTestDomainId = KDmIdRoot;
+
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	// request a domain transition
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	
+
+	// cancel a member notification request 
+	//*************************************************
+	// Test 6c cancel a member notification request
+	//*************************************************
+	test.Next(_L("Test 6c cancel a member notification request"));
+	RDmDomain domainMember;
+	TRequestStatus status;
+	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	domainMember.RequestTransitionNotification(status);
+	domainMember.CancelTransitionNotification();
+	User::WaitForRequest(status);
+	domainMember.Close();
+
+	//*************************************************
+	// Test 6d cancel a member notification request without having first requested a notification
+	//*************************************************
+	test.Next(_L("Test 6d cancel a member notification request without having first requested a notification"));
+	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	domainMember.CancelTransitionNotification();
+	domainMember.Close();
+
+	//*************************************************
+	// Test 6e domain controller adds invalid hierarchy
+	//*************************************************
+	test.Next(_L("Test 6e domain controller connects to invalid hierarchy"));
+	r = RDmDomainManager::AddDomainHierarchy(TDmHierarchyId(-1));
+	test(r == KErrBadHierarchyId);
+
+	//*************************************************
+	// Test 6f domain member connects to invalid hierarchy
+	//*************************************************
+	test.Next(_L("Test 6f domain member connects to invalid hierarchy"));
+	r = domainMember.Connect(TDmHierarchyId(-1), TDmDomainId(KDmIdRoot));
+	test (r == KErrBadHierarchyId);
+
+	//*************************************************
+	// Test 6g domain member connects to valid hierarchy but invalid domain
+	//*************************************************
+	test.Next(_L("Test 6g domain member connects to valid hierarchy but invalid domain"));
+	r = domainMember.Connect(KDmHierarchyIdTest, TDmDomainId(-1));
+	test (r == KDmErrBadDomainId);
+
+	delete iTestDomainManager;
+	iTestDomainManager = NULL;
+
+	// Panic tests
+
+	//*************************************************
+	// Test 6h request a transition notification without connecting first
+	//*************************************************
+	test.Next(_L("Test 6h request a transition notification without connecting first"));
+	PanicTest(ENegTestTransitionNoConnect);
+
+	//*************************************************
+	// Test 6i Get the domain state without connecting
+	//*************************************************
+	test.Next(_L("Test 6i Get the domain state without connecting"));
+	PanicTest(ENegTestGetStateNoConnect);
+
+	//*************************************************
+	// Test 6j request a transition notification with an invalid transition mode
+	//*************************************************
+	test.Next(_L("Test 6j request a transition notification with an invalid transition mode"));
+	PanicTest(ENegTestTransitionInvalidMode);
+
+
+	// cleanup
+
+	CDomainMemberAo** mt;
+	for (mt = iTestMembers; *mt; ++mt)
+		delete *mt;
+
+ 	__UHEAP_MARKEND;
+	}
+
+// This handles a transition notification from a test domain member.
+TInt CDmTest6::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	TInt status = aDomainMember.Status();
+		
+	iTestNotifications++;
+
+	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
+
+	TBuf16<4> buf;
+	GetDomainDesc(aDomainMember.Ordinal(), buf);
+
+	test.Printf(_L("CDmTest6::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), status);
+
+
+	return KErrNone;
+	}
+
+void CDmTest6::RunL()
+	{
+	iTransitionsCompleted++;
+
+	TInt error = iStatus.Int();
+
+	test.Printf(_L("CDmTest6::RunL(), error = %d, iTestNotifications %d\n"), 
+		error, iTestNotifications);
+
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest6::TransitionRequestComplete()
+	{
+	iTransitionsCompleted++;
+
+	TInt error = iStatus.Int();
+	
+	test.Printf(_L("CDmTest6::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
+		error, iTestNotifications);
+	
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest6::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest6::Release()
+	{
+	delete this;
+	}
+
+// Transition progress Observer testing
+class CDmTest7 : public CActive, public MDmTest, public MHierarchyObserver
+	{
+public: 
+	// from CActive
+	void RunL();
+ 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+
+	// from MHierarchyObserver
+	virtual void TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState);
+	virtual void TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError);
+	virtual void TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState);
+
+
+
+	CDmTest7(TDmDomainId aDomainId) : CActive(CActive::EPriorityStandard), iObservedDomainId(aDomainId) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	void TestForCompletion();
+
+
+private:
+
+	enum { KMembersMax = 16 };
+
+	CDomainMemberAo*	iTestMembers[KMembersMax]; 
+	CDomainManagerAo*	iTestDomainManager;
+	
+	TDmDomainId			iTestDomainId;
+	TDmDomainState		iTestState;
+	TDmDomainId			iObservedDomainId;
+
+public:
+	TInt				iTestNotifications;
+	TInt				iTestNotificationsExpected;
+
+	TInt				iTransitionsCompleted;
+	TInt				iTransitionsExpected;
+
+	TInt				iTransProgEvents;
+	TInt				iTransFailEvents;
+	TInt				iTransReqEvents;
+
+	TInt				iTransProgEventsExpected;
+	TInt				iTransFailEventsExpected;
+	TInt				iTransReqEventsExpected;
+	};
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-7
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Transition progress Observer testing
+//! @SYMREQ REQ3723
+//! @SYMTestActions Various negative tests
+//! @SYMTestExpectedResults  All tests should pass
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest7::Perform()
+	{
+
+ 	__UHEAP_MARK;
+
+	//
+	// Test domain transitions with activated observer
+	//
+	CActiveScheduler::Add(this);
+
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	CDomainManagerAo* iTestDomainManager = NULL;
+	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	test (iTestDomainManager != NULL);
+
+	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	//*************************************************
+	// Test 7a - Testing observer notifications
+	//*************************************************
+	
+	test.Next(_L("Test 7a - Testing observer notifications"));
+
+	TInt testMemberCount = 0;
+
+	// Add some test hierarchy members
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 1
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row2
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 3
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+
+	// create an observer
+	CHierarchyObserver* observer = NULL;
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KErrNone);
+	test(observer != NULL);
+	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
+	
+	// request a state change
+	iTestState =  EStartupCriticalDynamic;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransReqEventsExpected = iTransProgEventsExpected = observer->ObserverDomainCount();
+	iTransFailEventsExpected = 0;
+
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+
+	// cleanup
+	delete observer; 
+	observer = NULL;
+
+	//*************************************************
+	// Test 7b - start & stop the observer
+	//*************************************************
+	test.Next(_L("Test 7b - start & stop the observer"));
+
+	// create an observer, start it stop and then start it again
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KErrNone);
+	test(observer != NULL);
+	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
+	observer->StopObserver();
+	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
+
+	// request a state change
+	iTestState++;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransProgEventsExpected = iTransReqEventsExpected = observer->ObserverDomainCount();
+	iTransFailEventsExpected = 0;
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+	// stop the observer & request another state change
+	observer->StopObserver();
+	iTestState++;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransProgEventsExpected = 0;
+	iTransFailEventsExpected = 0;
+	iTransReqEventsExpected = 0;
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+	// Start the observer again on a different domain and only ask for transition requests
+	// Then request another state change
+	observer->StartObserver((iObservedDomainId == KDmIdRoot)?KDmIdTestCA:KDmIdRoot, EDmNotifyTransRequest);
+	iTestState++;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransReqEventsExpected = observer->ObserverDomainCount();
+	iTransProgEventsExpected = 0;
+	iTransFailEventsExpected = 0;
+
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+	delete observer; 
+	observer = NULL;
+
+	//*************************************************
+	// Test 7c - invalid arguments testing for observer
+	//*************************************************
+	test.Next(_L("Test 7c - Invalid arguments testing for observer"));
+	
+	const TDmHierarchyId	KDmHierarchyIdInvalid = 110;
+	
+	test.Printf(_L("Test 7c.1 - create observer with invalid hierarchy Id\n"));
+	
+	// create an observer
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdInvalid));
+	test (r == KErrBadHierarchyId);
+	
+	
+	test.Printf(_L("Test 7c.2 - Starting the observer with wrong domain Id\n"));
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KErrNone);
+	test(observer != NULL);
+
+	//Wrong domain Id
+	const TDmDomainId	KDmIdInvalid	= 0x0f;
+	r= observer->StartObserver(KDmIdInvalid, EDmNotifyAll);
+	test(r==KDmErrBadDomainId);
+
+	test.Printf(_L("Test 7c.3 - Trying to create second observer on the same hierarchy\n"));
+	TRAP(r, CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KDmErrBadSequence);
+
+	
+	
+	//*************************************************
+	// Test 7d - Wrong sequence of API calls for observer
+	//*************************************************
+	test.Next(_L("Test 7d - Observer wrong sequence of calls"));
+	
+	test.Printf(_L("Test 7d.1 - Stopping Observer before starting it\n"));
+	r = observer->StopObserver();
+	test(r==KDmErrBadSequence);
+	
+	test.Printf(_L("Test 7d.2 - Starting Observer twice\n"));
+	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
+	test(r==KErrNone);
+
+	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
+	test(r==KDmErrBadSequence);
+
+	
+	delete observer;
+
+	/***************************************/
+
+	delete iTestDomainManager;
+	iTestDomainManager = NULL;
+
+	CDomainMemberAo** mt;
+	for (mt = iTestMembers; *mt; ++mt)
+		delete *mt;
+
+
+	// restore the domain hierarchies to their initial state so as not to 
+	// upset any subsequent tests which rely on this
+	{
+	RDmDomainManager manager;
+	TRequestStatus status;
+	TInt r = manager.Connect(KDmHierarchyIdTest);
+	test (r == KErrNone);
+	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+	manager.Close();
+	}
+
+ 	__UHEAP_MARKEND;
+	}
+
+// This handles a transition notification from a test domain member.
+TInt CDmTest7::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+		
+	iTestNotifications++;
+
+	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
+
+	TBuf16<4> buf;
+	GetDomainDesc(aDomainMember.Ordinal(), buf);
+
+	__PRINT((_L("CDmTest7::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
+
+	return KErrNone;
+	}
+
+void CDmTest7::RunL()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest7::RunL(), error = %d, iTestNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications));
+
+	TestForCompletion();
+	}
+
+void CDmTest7::TransitionRequestComplete()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest7::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications));
+	
+	TestForCompletion();
+	}
+
+void CDmTest7::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest7::Release()
+	{
+	delete this;
+	}
+
+void CDmTest7::TestForCompletion()
+	{
+
+	if (iTransitionsCompleted == iTransitionsExpected &&
+		iTransProgEvents == iTransProgEventsExpected && 
+		iTransFailEvents == iTransFailEventsExpected &&
+		iTransReqEvents == iTransReqEventsExpected)
+		{
+		CActiveScheduler::Stop();
+		}
+	}
+
+#ifdef _DEBUG
+void CDmTest7::TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState)
+#else
+void CDmTest7::TransProgEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
+#endif
+	{
+	iTransProgEvents++;
+	__PRINT((_L("CDmTest7::TransProgEvent(), aDomainId = %d, aState %d, iTransProgEvents %d\n"), 
+		aDomainId, aState, iTransProgEvents));
+	TestForCompletion();
+	}
+
+#ifdef _DEBUG
+void CDmTest7::TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError)
+#else
+void CDmTest7::TransFailEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/, TInt /*aError*/)
+#endif
+
+	{
+	iTransFailEvents++;
+	__PRINT((_L("CDmTest7::TransFailEvent(), aDomainId = %d, aState %d aError %d, iTransFailEvents %d\n"), 
+		aDomainId, aState, iTransFailEvents, aError));
+	TestForCompletion();
+	}
+
+#ifdef _DEBUG
+void CDmTest7::TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState)
+#else
+void CDmTest7::TransReqEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
+#endif
+	{
+	iTransReqEvents++;
+	__PRINT((_L("CDmTest7::TransReqEvent(), aDomainId = %d, aState %d, iTransReqEvents %d\n"), 
+		aDomainId, aState, iTransReqEvents));
+	TestForCompletion();
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	CTrapCleanup* trapHandler=CTrapCleanup::New();
+	test(trapHandler!=NULL);
+
+	CActiveScheduler* scheduler = new CActiveScheduler();
+	test(scheduler != NULL);
+	CActiveScheduler::Install(scheduler);
+
+	// Turn off evil lazy dll unloading
+	RLoader l;
+	test(l.Connect()==KErrNone);
+	test(l.CancelLazyDllUnload()==KErrNone);
+	l.Close();
+
+	//
+	// Perform the number of iterations specifed by the command line argument.
+	//
+	// If no arguments - perform two iterations
+	//
+//  TInt iter = 2;
+    TInt iter = 1;
+
+	TInt len = User::CommandLineLength();
+	if (len)
+		{
+		// Copy the command line in a buffer
+		HBufC* hb = HBufC::NewMax(len);
+		test(hb != NULL);
+		TPtr cmd((TUint16*) hb->Ptr(), len);
+		User::CommandLine(cmd);
+		// Extract the number of iterations
+		TLex l(cmd);
+		TInt i;
+		TInt r = l.Val(i);
+		if (r == KErrNone)
+			iter = i;
+		else
+			// strange command - silently ignore
+			{} 
+		delete hb;
+		}
+
+	test.Title();
+	test.Start(_L("Testing"));
+
+	test.Printf(_L("Go for %d iterations\n"), iter);
+
+	// Remember the number of open handles. Just for a sanity check ....
+	TInt start_thc, start_phc;
+	RThread().HandleCount(start_phc, start_thc);
+
+	while (iter--)
+		{
+		MDmTest* tests[] = 
+			{
+
+			new CDmTest1(KDmIdRoot, EPwStandby),
+			new CDmTest1(KDmIdRoot, EPwOff),
+			new CDmTest1(KDmIdRoot, EPwActive),
+			new CDmTest1(KDmIdApps, EPwStandby),
+			new CDmTest1(KDmIdApps, EPwOff),
+			new CDmTest1(KDmIdApps, EPwActive),
+			new CDmTest1(KDmIdUiApps, EPwStandby),
+			new CDmTest1(KDmIdUiApps, EPwOff),
+			new CDmTest1(KDmIdUiApps, EPwActive),
+			new CDmTest2(EPwStandby),
+			new CDmTest3(),
+	
+			// platform security tests
+			new CDmTest4(),
+
+			// PREQ810 tests :
+			// note that we use a fictitious power state to prevent any 
+			new CDmTest5(KDmIdRoot, KDmIdRoot, EPwActive+10, EStartupCriticalDynamic),
+			new CDmTest5(KDmIdUiApps, KDmIdTestAB, EPwActive+10, EStartupCriticalDynamic),
+
+        // negative tests
+			new CDmTest6(),
+
+
+			// observer tests
+     		new CDmTest7(KDmIdTestA),
+			new CDmTest7(KDmIdRoot),
+			
+			};
+
+		for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
+			{
+			test(tests[i] != NULL);
+			tests[i]->Perform();
+			tests[i]->Release();
+			}
+
+		}
+
+	test.End();
+
+	// Sanity check for open handles and for pending requests ...
+	TInt end_thc, end_phc;
+	RThread().HandleCount(end_phc, end_thc);
+	test(start_thc == end_thc);
+	test(start_phc == end_phc);
+	test(RThread().RequestCount() >= 0);
+
+	delete scheduler;
+	delete trapHandler;
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,29 @@
+// Copyright (c) 2002-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:
+//
+// Description:
+// e32test/domainmgr/t_domain.mmp
+// 
+//
+
+TARGET			t_domain.exe        
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			t_domain.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+CAPABILITY		WriteDeviceData PowerMgmt
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain_slave.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,140 @@
+// Copyright (c) 2002-2009 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:
+//
+// Description:
+// e32test\power\t_domain_slave.cpp
+// 
+//
+
+#include <e32power.h>
+#include <e32test.h>
+#include <domainmember.h>
+#include <domainmanager.h>
+#include <e32panic.h>
+#include <e32debug.h>
+
+LOCAL_D RTest test(_L(" T_DOMAIN_SLAVE "));
+
+// This will be run in its own thread as part of test #1. It should get killed when trying to connect 
+// to the manager without appropriate caps set
+TInt IncorrectClient(TAny*)
+{
+    	RDmDomain domain;
+		TInt r = domain.Connect(KDmIdRoot);
+
+		RDmDomainManager manager;
+		r = manager.Connect();
+
+        return(r);
+}
+
+GLDEF_C TInt E32Main()
+	{
+	test.Title();
+	test.Start(_L("Testing"));
+
+//	test.Next(_L("test security"));
+
+	// Get arguments from the command line
+	TInt len = User::CommandLineLength();
+	test (len);
+	TInt size = len * sizeof(TUint16);
+	test (size == sizeof(TInt));
+	TInt arg;
+	TPtr cmd((TUint16*) &arg, len);
+	User::CommandLine(cmd);
+
+	TInt expected_result = PlatSec::IsCapabilityEnforced(ECapabilityPowerMgmt) ? KErrPermissionDenied : KErrNone;
+
+	switch(arg)
+		{
+	case 0:
+		{
+        // This is the original t_domain_slave test, minus the panicking parts which now get
+        // tested as case 1.
+
+        test.Next(_L("test security -- 0"));       
+
+		RDmDomain domain;
+		TInt r = domain.Connect(KDmIdRoot);
+		test (r == expected_result);
+
+		break;
+		}
+    case 1:
+        {
+
+        test.Next(_L("test security -- 1")); 
+        
+        TBool jit = User::JustInTime();
+
+        User::SetJustInTime(EFalse);
+
+        _LIT(KPanicThread, "PanicThread");
+
+        RThread testThread;
+
+        TInt tt=testThread.Create(KPanicThread, IncorrectClient, KDefaultStackSize, 
+            NULL, NULL);
+
+        test (KErrNone == tt);
+
+        TRequestStatus tStatus;
+  //      testThread.Logon(tStatus);
+
+        RUndertaker deathChecker;
+        TInt dcOK = deathChecker.Create();
+
+        test (KErrNone == dcOK);
+
+        TInt nextDeadThread;
+
+        deathChecker.Logon(tStatus, nextDeadThread);
+
+        // threads are created in a suspended state. calling resume here starts the thread.
+        testThread.Resume();
+        User::WaitForRequest(tStatus);
+
+        // If thread suicided for the correct reason --> successful test
+        // NB. KErrPermissionDenied means that the server refused the 
+        // connection because of incorrect capabilities
+
+        RThread corpse;
+        corpse.SetHandle(nextDeadThread);
+
+        RDebug::Printf("Subthread exit type: %d", corpse.ExitType() );
+
+        RDebug::Printf("Subthread exit reason: %d",corpse.ExitReason() );
+
+        test (corpse.ExitType() == EExitKill);
+
+        test (corpse.ExitReason() == KErrPermissionDenied);
+
+        corpse.Close();
+  
+        // close the RUndertaker and test thread
+        deathChecker.Close();
+		CLOSE_AND_WAIT(testThread);
+
+        User::SetJustInTime(jit);
+
+		break;
+        }
+	default:
+		User::Panic(_L("USER"), EInvariantFalse);
+		break;
+		}
+
+	test.End();
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain_slave.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,29 @@
+// Copyright (c) 2002-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:
+//
+// Description:
+// e32test/domainmgr/t_domain_slave.mmp
+// 
+//
+
+TARGET			t_domain_slave.exe        
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			t_domain_slave.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+CAPABILITY		None
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/test.inf	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,42 @@
+// Copyright (c) 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:
+//
+// Description:
+// Domain Manager Test Suite
+// Convienence INF file to build just these tests: bldmake -f test.inf bldfiles
+// Test project part of the offical ../group/bld.inf e32test component.
+//
+
+
+PRJ_PLATFORMS
+
+BASEDEFAULT
+
+
+
+PRJ_TESTEXPORTS
+
+dm_tests.iby	/epoc32/rom/include/dm_tests.iby
+
+dmtest.auto.bat	/epoc32/rom/include/dmtest.auto.bat
+dm_autoexec.bat	/epoc32/rom/include/dm_autoexec.bat
+
+
+
+PRJ_TESTMMPFILES
+
+#ifndef SMP
+t_domain
+t_domain_slave		support
+domainpolicy99		support
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/tshell_dmtest.oby	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 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:
+*
+* Description:
+*
+*/
+
+#define BASE_ROM
+#include <rom\##VARIANT##\header.iby>
+
+
+files=
+
+#include <rom\##VARIANT##\kernel.iby>
+#include "user.iby"
+#include <rom\hal\hal.iby>
+#include <rom\f32\f32.iby>
+
+#include <rom\include\dm_tests.iby>
--- a/kerneltest/e32test/group/bld.inf	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/bld.inf	Thu Sep 02 21:54:16 2010 +0300
@@ -31,21 +31,21 @@
 
 PRJ_TESTEXPORTS
 
-../../../kernel/eka/include/kernel/dobject.h						/epoc32/include/kernel/			
+../../../kernel/eka/include/kernel/dobject.h						OS_LAYER_PLATFORM_EXPORT_PATH(kernel/dobject.h)			
 
-../../../userlibandfileserver/domainmgr/inc/domainobserver.h				/epoc32/include/
+../../../userlibandfileserver/domainmgr/inc/domainobserver.h				OS_LAYER_PLATFORM_EXPORT_PATH(domainobserver.h)
 
-../dll/d_ldrtst.h					/epoc32/include/
+../dll/d_ldrtst.h					OS_LAYER_PLATFORM_EXPORT_PATH(d_ldrtst.h)
 
-../nkernsa/interrupts.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/interrupts.h)	//
-../nkernsa/nkutils.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/nkutils.h)	//
-../nkernsa/utils.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/utils.h)	//
-../nkernsa/diag.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/diag.h)	//
+../nkernsa/interrupts.h				OS_LAYER_PLATFORM_EXPORT_PATH(nktest/interrupts.h)	//
+../nkernsa/nkutils.h				OS_LAYER_PLATFORM_EXPORT_PATH(nktest/nkutils.h)	//
+../nkernsa/utils.h					OS_LAYER_PLATFORM_EXPORT_PATH(nktest/utils.h)	//
+../nkernsa/diag.h					OS_LAYER_PLATFORM_EXPORT_PATH(nktest/diag.h)	//
 
-../../../kernel/eka/include/e32huffman.h				/epoc32/include/
+../../../kernel/eka/include/e32huffman.h				OS_LAYER_PLATFORM_EXPORT_PATH(e32huffman.h)
 
 platsec.settings        /epoc32/data/defaulttest.ini
-../mmu/d_memorytest.h   /epoc32/include/e32test/d_memorytest.h
+../mmu/d_memorytest.h   OS_LAYER_PLATFORM_EXPORT_PATH(e32test/d_memorytest.h)
 
 ../buffer/UnicodeData.txt    /epoc32/data/z/test/unicodedata.txt
 ../buffer/UnicodeData.txt    /epoc32/release/wins/udeb/z/test/unicodedata.txt
@@ -68,11 +68,10 @@
 ../dll/oe/eabi/urel/t_oeexport.exe      /epoc32/release/armv5/urel/t_oeexport.exe
 ../dll/oe/eabi/urel/t_oeexport1.exe     /epoc32/release/armv5/urel/t_oeexport1.exe
 
-../demandpaging/d_pagestress.h		/epoc32/include/
-../pci/t_pci.h						/epoc32/include/e32test/t_pci.h
+../demandpaging/d_pagestress.h		OS_LAYER_PLATFORM_EXPORT_PATH(d_pagestress.h)
 
-../iic/iic_psl/i2c.h			/epoc32/include/e32test/
-../iic/iic_psl/spi.h			/epoc32/include/e32test/
+../iic/iic_psl/i2c.h			OS_LAYER_PLATFORM_EXPORT_PATH(e32test/i2c.h)
+../iic/iic_psl/spi.h			OS_LAYER_PLATFORM_EXPORT_PATH(e32test/spi.h)
 
 PRJ_TESTMMPFILES
 
@@ -93,6 +92,9 @@
 d_ldd2_ram					support
 d_lddns						support
 d_lddpowerseqtest			support
+#if !defined(X86) && !defined(WINS)
+../power/d_powermisctest					support
+#endif
 d_ldddigitisertest			support
 d_lddturnaroundtimertest	support
 d_newldd					support
@@ -257,6 +259,9 @@
 t_ramdefrag
 #endif
 
+// /E32TEST/TIMESTAMP test must also come before t_lat2 as it goes into Low Power Mode.
+t_timestamp
+
 #ifdef EPOC32
 // Start the latency measurement
 t_lat2
@@ -311,9 +316,6 @@
 t_userasmbm manual
 #endif
 
-// /E32TEST/TIMESTAMP test
-t_timestamp
-
 // /e32test/benchmark
 #ifndef X86
 bm_suite    MANUAL_ON_WINS
@@ -402,6 +404,9 @@
 t_tldd
 t_newldd
 t_lddpowerseqtest
+#if !defined(X86) && !defined(WINS)
+../power/t_powermisctest 
+#endif
 t_ldddigitisertest
 t_userdigitisertest
 t_userdigitisernocaps
@@ -721,9 +726,6 @@
 // /E32TEST/POWER tests
 t_power
 t_power_slave   support
-t_domain
-t_domain_slave  support
-domainPolicyTest support
 t_switchoff
 t_frqchg
 
@@ -1022,37 +1024,7 @@
 #endif
 
 #if defined(MARM_ARMV5)
-../rm_debug/group/t_rmdebug_dll support
-../rm_debug/group/t_rmdebug_security0 support
-../rm_debug/group/t_rmdebug_security1 support
-../rm_debug/group/t_rmdebug_security2 support
-../rm_debug/group/t_rmdebug_security3 support
-../rm_debug/group/t_rmdebug_app support
-../rm_debug/group/t_rmdebug2
-../rm_debug/group/t_rmdebug2_oem
-../rm_debug/group/t_rmdebug2_oemtoken support
-../rm_debug/group/t_rmdebug2_oem2
-../rm_debug/group/t_rmdebug2_oemtoken2 support
 ../rm_debug/group/t_crashmonitor_lib
-
-../rm_debug/group/t_rmdebug_app1 support
-../rm_debug/group/t_rmdebug_app2 support
-../rm_debug/group/t_rmdebug_app3 support
-../rm_debug/group/t_rmdebug_app4 support
-../rm_debug/group/t_rmdebug_app5 support
-../rm_debug/group/t_rmdebug_app6 support
-../rm_debug/group/t_rmdebug_app7 support
-../rm_debug/group/t_rmdebug_app8 support
-../rm_debug/group/t_rmdebug_app9 support
-../rm_debug/group/t_rmdebug_app10 support
-
-../rm_debug/group/t_rmdebug_target_launcher support
-../rm_debug/group/t_rmdebug_multi_target
-
-../rm_debug/group/t_rmdebug_multi_agent support
-../rm_debug/group/t_multi_agent_launcher
-
-
 #endif
 
 t_stacksize
@@ -1080,6 +1052,5 @@
 
 #include "../hcr/hcr.inf"
 
-//pci tests
-t_pci
+#include "../domainmgr/test.inf"
 
--- a/kerneltest/e32test/group/domainPolicyTest.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-// e32test/group/domainpolicytest.mmp
-// domainpolicy99.dll Test Domain manager policy module
-// 
-//
-
-/**
- @file
-*/
-
-
-TARGET          domainpolicy99.dll
-CAPABILITY PowerMgmt ProtServ DiskAdmin
-TARGETTYPE      dll
-
-userinclude		../power
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-sourcepath	../power
-source		domainpolicytest.cpp
-
-library		euser.lib
-
-
-START WINS
-END
-
-START MARM
-END
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/rescontrol_extended_psl.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/rescontrol_extended_psl.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -24,6 +24,7 @@
 
 macro		BTRACE_RESOURCE_MANAGER
 macro		RESOURCE_MANAGER_SIMULATED_PSL
+macro		_DUMP_TRACKERS
 macro		PRM_INSTRUMENTATION_MACRO
 macro		PRM_ENABLE_EXTENDED_VERSION
 //macro		DEBUG_VERSION //Enable if wanted to check for Lock and critical section count checker
--- a/kerneltest/e32test/group/rescontrol_psl.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/rescontrol_psl.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -24,6 +24,7 @@
 
 macro		BTRACE_RESOURCE_MANAGER
 macro		RESOURCE_MANAGER_SIMULATED_PSL
+macro		_DUMP_TRACKERS
 macro		PRM_INSTRUMENTATION_MACRO
 //macro		DEBUG_VERSION //Enable if wanted to check for Lock and critical section count checker
 
--- a/kerneltest/e32test/group/t_domain.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// Copyright (c) 2002-2009 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:
-//
-// Description:
-// e32test/group/t_domain.mmp
-// 
-//
-
-TARGET			t_domain.exe        
-TARGETTYPE		EXE
-SOURCEPATH		../power
-SOURCE			t_domain.cpp
-LIBRARY			euser.lib domaincli.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-CAPABILITY		WriteDeviceData PowerMgmt
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_domain_slave.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// Copyright (c) 2002-2009 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:
-//
-// Description:
-// e32test/group/t_domain_slave.mmp
-// 
-//
-
-TARGET			t_domain_slave.exe        
-TARGETTYPE		EXE
-SOURCEPATH		../power
-SOURCE			t_domain_slave.cpp
-LIBRARY			euser.lib domaincli.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-CAPABILITY		None
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_pci.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description: 
-// e32test/group/t_pci.mmp
-
-TARGET         t_pci.exe
-TARGETTYPE     EXE
-SOURCEPATH	../pci
-SOURCE         t_pci.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-CAPABILITY	ReadDeviceData WriteDeviceData
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_usb.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/t_usb.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -18,6 +18,8 @@
 TARGET        t_usb.exe
 TARGETTYPE    EXE
 
+USERINCLUDE   ../traces_t_usb
+
 SOURCEPATH	  ../device
 SOURCE        t_usb.cpp
 SOURCE        t_usbco2.cpp
--- a/kerneltest/e32test/group/t_usb_device.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/t_usb_device.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -18,15 +18,17 @@
 TARGET        T_USB_DEVICE.EXE
 TARGETTYPE    EXE
 
+uid   0x0   0x20031630
 // Header file paths
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-USERINCLUDE	  ../USB/T_USB_DEVICE/INCLUDE
+USERINCLUDE	  ../usb/t_usb_device/include
+USERINCLUDE   ../traces_t_usb_device
 
 // Source file paths
 
-SOURCEPATH	  ../USB/T_USB_DEVICE/SRC
+SOURCEPATH	  ../usb/t_usb_device/src
 
 
 SOURCE     	main.cpp
--- a/kerneltest/e32test/group/t_usb_scdevice.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/t_usb_scdevice.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -18,6 +18,9 @@
 TARGET        t_usb_scdevice.exe
 TARGETTYPE    EXE
 
+UID         0x0 0x20031631
+VENDORID    0x70000001
+
 MACRO		USB_SC
 
 // Header file paths
@@ -25,6 +28,7 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 USERINCLUDE	  ../usb/t_usb_device/include
+USERINCLUDE     ../traces_t_usb_scdevice
 
 // Source file paths
 
@@ -50,7 +54,6 @@
 
 CAPABILITY    ALL
 
-VENDORID      0x70000001
 
 // Larger user heap than default: maximum = 16MB
 EPOCHEAPSIZE  0x1000 0x01000000
--- a/kerneltest/e32test/group/t_usb_transfersrv.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/t_usb_transfersrv.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -17,7 +17,8 @@
 
 TARGET        t_usb_transfersrv.exe
 TARGETTYPE    EXE
-uid 0x0 0x101fe1db
+
+uid 0x0    0x20031632
 
 MACRO		USB_SC
 
@@ -26,6 +27,7 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 USERINCLUDE	  ../usb/t_usb_device/include
+USERINCLUDE     ../traces_t_usb_transfersrv
 
 // Source file paths
 
--- a/kerneltest/e32test/group/t_usb_transfersrvclient.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/t_usb_transfersrvclient.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -18,6 +18,9 @@
 TARGET        t_usb_transfersrv.dll
 TARGETTYPE    DLL
 
+UID         0x0 0x20031633
+VENDORID    0x70000001
+
 MACRO		USB_SC
 
 // Header file paths
@@ -25,6 +28,7 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 USERINCLUDE	  ../usb/t_usb_device/include
+USERINCLUDE   ../traces_t_usb_transfersrvclient
 
 // Source file paths
 
@@ -41,7 +45,6 @@
 
 CAPABILITY    ALL
 
-VENDORID      0x70000001
 
 // Larger user heap than default: maximum = 16MB
 EPOCHEAPSIZE  0x1000 0x01000000
--- a/kerneltest/e32test/group/t_usbapi.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/t_usbapi.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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"
@@ -18,6 +18,8 @@
 TARGET        t_usbapi.exe
 TARGETTYPE    exe
 
+USERINCLUDE   ../traces_t_usbapi
+
 SOURCEPATH    ../device
 SOURCE        t_usbapi.cpp
 
--- a/kerneltest/e32test/group/t_usbcsc.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/group/t_usbcsc.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,8 @@
 TARGET        t_usbcsc.exe
 TARGETTYPE    exe
 
+USERINCLUDE   ../traces_t_usbcsc
+
 SOURCEPATH    ../device             
 SOURCE        t_usbcsc.cpp
 
@@ -26,6 +28,7 @@
 
 CAPABILITY    all
 
+UID      0x0 0x20031634
 VENDORID 0x70000001
 
 unpaged
--- a/kerneltest/e32test/heap/t_heapdl.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/heap/t_heapdl.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -28,6 +28,8 @@
 #include "page_alloc.h"
 #include "heap_hybrid.h"
 
+const TUint KTestIterations = 100;
+
 const TInt KHeadSize = (TInt)RHeap::EAllocCellSize;
 
 class TestHybridHeap
@@ -319,7 +321,7 @@
   //
   // Allocation of approximate sized cells from 'small cell' lists (smallbin)
   //
-  TInt ArraySize=32;
+  const TInt ArraySize=32;
   TInt cellSize=0;
   TAny** ArrayOfCells;
   ArrayOfCells= new TAny*[ArraySize];
@@ -328,17 +330,13 @@
     
   // Allocate small approximate sized cells and put
   //them to the array. They are allocated from TOP chunk
-  TUint8 randomSize;
+  TUint8 randomSize[ArraySize];
   for(ArrayIndex=0; ArrayIndex<ArraySize;ArrayIndex++)
     {
     TestHybridHeap::TopSize(topSizeBefore,iHybridHeap);
-    do
-      {
-      randomSize= (TUint8)Math::Random();
-      }
-    while (randomSize>240);
-       
-  	cellSize=randomSize;
+    // Ensure that the size of the cell does not exceed 256 bytes on debug builds
+    randomSize[ArrayIndex] = (TUint8) (Math::Random() % (MAX_SMALL_REQUEST + 1 - RHeap::EDebugHdrSize));
+  	cellSize=randomSize[ArrayIndex];
   	ArrayOfCells[ArrayIndex]=iHeap->Alloc(cellSize);
   	TestHybridHeap::TopSize(topSizeAfter,iHybridHeap);
   	test(topSizeBefore > topSizeAfter);
@@ -358,20 +356,21 @@
   iHeap->Check();
   
   // Allocate approximate sized cells from smallbin
-  TInt ArraySize2=6;
-  TInt cellSize2=0;    
+  const TInt ArraySize2=6;
+  TInt cellSize2=0;
   TAny** ArrayOfCells2;
   ArrayOfCells2= new TAny*[ArraySize2];
   TInt ArrayIndex2;
   TestHybridHeap::SmallMap(smallMap,iHybridHeap);
+  TUint8 randomSize2[ArraySize2];
   for(ArrayIndex2=0; ArrayIndex2<ArraySize2;ArrayIndex2++)
     {
-    TUint8 randomSize2 = (TUint8)Math::Random();
-    cellSize2=(randomSize2);
+    randomSize2[ArrayIndex2]=randomSize[2+ArrayIndex2*5];
+    cellSize2=randomSize2[ArrayIndex2];
     ArrayOfCells2[ArrayIndex2]=iHeap->Alloc(cellSize2);
     }
   TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  test(smallMap>=smallMap2);              
+  test(smallMap>=smallMap2);
   iHeap->Check();
   
   // Freeing of approximate sized cells back to smallbin
@@ -396,7 +395,7 @@
   // Allocation of approximate sized cells from digital trees (treebin) and splitting
   // Freeing of approximate sized cells back to digital trees (treebin)
   //
-  TInt ArraySize=32;
+  const TInt ArraySize=32;
   TInt cellSize=0;
   TAny** ArrayOfCells;
   ArrayOfCells= new TAny*[ArraySize];
@@ -404,15 +403,16 @@
         
   // Allocate approximate sized cells bigger than 256
   // and put them to the array. They are allocated from TOP chunk
+  TUint8 randomSize[ArraySize];
   for(ArrayIndex=0; ArrayIndex<ArraySize;ArrayIndex++)
     {
-    TUint8 randomSize = (TUint8)Math::Random();
-    cellSize=(randomSize+256);
+    randomSize[ArrayIndex] = (TUint8)Math::Random();
+    cellSize=(randomSize[ArrayIndex]+MAX_SMALL_REQUEST+1);
     ArrayOfCells[ArrayIndex]=iHeap->Alloc(cellSize);
     }
   iHeap->Check();
   
-  TUint treeMap,treeMap2;    
+  TUint treeMap,treeMap2;
   // Free some of allocated cells from the array. So they are inserted
   // to the treebin
   for(ArrayIndex=2; ArrayIndex<ArraySize-1; ArrayIndex+=5)
@@ -425,16 +425,17 @@
   iHeap->Check();
   
   // Allocate approximate sized cells from treebin
-  TInt ArraySize2=16;
+  const TInt ArraySize2=16;
   TInt cellSize2=0;    
   TAny** ArrayOfCells2;
   ArrayOfCells2= new TAny*[ArraySize2];
   TInt ArrayIndex2;
+  TUint8 randomSize2[ArraySize2];
   for(ArrayIndex2=0; ArrayIndex2<ArraySize2;ArrayIndex2++)
     {
     TestHybridHeap::TreeMap(treeMap,iHybridHeap);
-    TUint8 randomSize2 = (TUint8)Math::Random();
-    cellSize2=(randomSize2+256);
+    randomSize2[ArrayIndex2] = (TUint8)Math::Random();
+    cellSize2=(randomSize2[ArrayIndex2]+MAX_SMALL_REQUEST+1);
     ArrayOfCells2[ArrayIndex2]=iHeap->Alloc(cellSize2);
     TestHybridHeap::TreeMap(treeMap2,iHybridHeap);
     test(treeMap >= treeMap2);
@@ -474,16 +475,29 @@
   __KHEAP_MARK;
 
   TestRHeap T;
+  TUint i;
   test.Start(_L("Init DL allocator tests"));
   T.InitTests();
   test.Next(_L("Test DL allocator 1"));
-  T.Test1();
+  for(i = 0; i < KTestIterations; i++)
+    {
+    T.Test1();
+    }
   test.Next(_L("Test DL allocator 2"));
-  T.Test2();
+  for(i = 0; i < KTestIterations; i++)
+    {
+    T.Test2();
+    }
   test.Next(_L("Test DL allocator 3"));
-  T.Test3();
+  for(i = 0; i < KTestIterations; i++)
+    {
+    T.Test3();
+    }
   test.Next(_L("Test DL allocator 4"));
-  T.Test4();
+  for(i = 0; i < KTestIterations; i++)
+    {
+    T.Test4();
+    }
   test.Next(_L("Close DL allocator tests"));
   T.CloseTests();
 	
--- a/kerneltest/e32test/mediaext/d_nfe.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/mediaext/d_nfe.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1051,6 +1051,9 @@
 
 //	__KTRACE_PRINT(Kern::Printf("NFE%d: HandleRead pos %lx len %lx status %d", iInstance, currentPos, remainingLength, di->Status()));
 
+	if (di->iEntry.iPartitionLen == 0)
+		return KErrNotReady;
+
 
 	di->iReadRequestCount++;
 
@@ -1212,40 +1215,30 @@
 
 TInt DMediaDriverNFE::HandleFormat(TLocDrvRequest& aReq)
 	{
-	TInt r = KErrNone;
 	TInt64 currentPos =  aReq.Pos();
-	TInt64 remainingLength = aReq.Length();
 	TNfeDriveInfo* di = &iInfo.iDrives[DriveIndex(aReq.Drive()->iDriveNumber)];
 
-//	__KTRACE_PRINT(Kern::Printf("NFE%d: HandleFormat pos %lx len %lx status %d", iInstance, currentPos, remainingLength, di->Status()));
+	__KTRACE_PRINT(Kern::Printf("NFE%d: HandleFormat pos %lx len %lx status %d", iInstance, currentPos, aReq.Length(), di->Status()));
+
+	if (di->Status() == ENfeEncrypting)
+		{
+		di->iEncryptEndPos = di->iEntry.iPartitionBaseAddr + di->iEntry.iPartitionLen;
+		SetStatus(*di,  ENfeEncrypted);
+		__KTRACE_PRINT(Kern::Printf("NFE%d: HandleFormat() , Setting status to %s", iInstance, DriveStatus(di->Status())));
+		}
+
+	if (currentPos >= di->iEntry.iPartitionBaseAddr && 
+		currentPos < di->iEntry.iPartitionBaseAddr + KSectorSize && 
+		di->IsUDADrive() &&
+		di->Status() == ENfeEncrypted)
+		{
+		__KTRACE_PRINT(Kern::Printf("NFE%d: Write to sector #0 detected", iInstance));
+		di->iUniqueID = 0;	// undefined
+		__KTRACE_PRINT(Kern::Printf("NFE%d: Setting Volume ID to %08X", iInstance, di->iUniqueID ));
+		}
 
 
-	// just forward the request if the drive is not encrypted
-	if (di->Status() == ENfeDecrypted)
-		return ForwardRequest(aReq);
-
-	// otherwise create a buffer containing NULLs, encrypt it and write that to the attached drive
-	while(remainingLength && r == KErrNone)
-		{
-		TInt64 currentLength = (remainingLength <= KBufSize ? remainingLength : KBufSize);
-
-		TBool encryptBuffer = AdjustRequest(di, currentPos, currentLength);
-
-		memclr(iBuffer, KBufSize);
-		TPtr8 des(iBuffer,KBufSize,KBufSize);
-
-		if (encryptBuffer)
-			EncryptBuffer(des);
-		
-		r = Write(di->iLocalDriveNum, currentPos, (TLinAddr) iBuffer, I64LOW(currentLength));
-		if(r != KErrNone)
-			break;
-
-		remainingLength-= currentLength;
-		currentPos+= currentLength;
-		}
-
-	return r == KErrNone ? KErrCompletion : r;
+	return ForwardRequest(aReq);
 	}
 
 
@@ -1362,9 +1355,13 @@
 TBool DMediaDriverNFE::ValidBootSector(TUint8* aBuffer)
 	{
 	if (aBuffer[0] == 0xEB || aBuffer[0] == 0xE9)
+		{
 		return ETrue;
+		}
 	else
+		{
 		return EFalse;
+		}
 	}
 
 
@@ -1409,7 +1406,7 @@
 
 	// Find out whether the volume has changed
 	TUint32 uniqueID = VolumeId(iBuffer);   
-	TBool volumeChanged = uniqueID != aDi.iUniqueID;
+	TBool volumeChanged = (aDi.iUniqueID != 0) && (uniqueID != aDi.iUniqueID);
 	__KTRACE_PRINT(Kern::Printf("NFE%d: Old Volume ID %08X", iInstance, aDi.iUniqueID));
 	__KTRACE_PRINT(Kern::Printf("NFE%d: New Volume ID %08X", iInstance, uniqueID));
 	__KTRACE_PRINT(Kern::Printf("NFE%d: volumeChanged %d", iInstance, volumeChanged));
@@ -1537,9 +1534,6 @@
 		return KErrNone;
 		}
 
-//	TInt KBackgroundPriority = 7;						//*test*
-//	Kern::SetThreadPriority(KBackgroundPriority);		//*test*
-
 	TInt r = KErrNone;
 	for (;;)
 		{
@@ -1626,8 +1620,6 @@
 	if (r != KErrCompletion)
 		iIdleTimer.OneShot(NKern::TimerTicks(KNotBusyInterval));
 
-//	Kern::SetThreadPriority(KNfeThreadPriority);	//*test*
-	
 	return r;
 	}
 
--- a/kerneltest/e32test/mediaext/t_nfe.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/mediaext/t_nfe.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -130,9 +130,9 @@
 	return r;
 	}
 
-void DisplayNfeDeviceInfo(TInt aNfeDrive, TNfeDeviceInfo& aDeviceInfo)
+void DisplayNfeDeviceInfo(TInt aNfeDrive, TNfeDeviceInfo& aDeviceInfo, TBool (&aNfeDrives)[KMaxLocalDrives])
 	{
-	test.Printf(_L("Stats: \n"));
+//	test.Printf(_L("Stats: \n"));
 
 	RLocalDrive	d;
 	TBool change = EFalse;
@@ -153,6 +153,13 @@
 		{
 		TNfeDriveInfo& di = aDeviceInfo.iDrives[i];
 
+		TInt localDriveNum = di.iLocalDriveNum;
+		test_Value(localDriveNum, di.iLocalDriveNum < KMaxLocalDrives);
+		
+		if (aNfeDrives[localDriveNum])
+			continue;
+		aNfeDrives[localDriveNum] = 1;
+
 		test.Printf(_L("*** drive index %d ***\n"), i);
 		test.Printf(_L("iLocalDriveNum %x\n"), di.iLocalDriveNum);
 		test.Printf(_L("iDriveLetter %c\n"), di.iDriveLetter >= 0 && di.iDriveLetter <= 25 ? di.iDriveLetter +'A' : '?');
@@ -389,10 +396,13 @@
 		}
 
 
+	TBool nfeDrives[KMaxLocalDrives];
+	memclr(nfeDrives, sizeof(nfeDrives));
+	
 	for(TInt nfeDrive = FindNfeDrive(0); nfeDrive != KErrNotFound; nfeDrive = FindNfeDrive(++nfeDrive))
 		{
 		TNfeDeviceInfo deviceInfo;
-		DisplayNfeDeviceInfo(nfeDrive, deviceInfo);
+		DisplayNfeDeviceInfo(nfeDrive, deviceInfo, nfeDrives);
 		}
 
 	fs.Close();
--- a/kerneltest/e32test/mmu/d_gobble.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/mmu/d_gobble.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -167,7 +167,7 @@
 TUint32 DGobbler::AllocMultiPage(TUint32 aSize)
 	{
 	TUint32 sz = 1u << __e32_find_ms1_32(aSize);	// round size down to power of 2
-	while (sz > iPageSize)
+	while (sz >= iPageSize)
 		{
 		TPhysAddr pa;
 		TInt r = Epoc::AllocPhysicalRam(sz, pa);
--- a/kerneltest/e32test/mmu/t_demandpaging.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/mmu/t_demandpaging.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -75,6 +75,7 @@
 #include <e32kpan.h>
 #include <e32property.h>
 #include <e32rom.h>
+#include <u32hal.h>
 #include "d_memorytest.h"
 #include "d_demandpaging.h"
 #include "d_gobble.h"
@@ -108,6 +109,14 @@
 // A descriptor whose header is in paged memory (actually just a pointer to a zero word)
 TDesC8* PagedHeaderDes = NULL;
 
+// An area of paged rom if rom paging is supported, or zero
+TUint8* RomPagedBuffer = NULL;
+TInt RomPagedBufferSize = 0;
+
+// An area of paged code if code paging is supported, or zero
+TUint8* CodePagedBuffer = NULL;
+TInt CodePagedBufferSize = 0;
+
 // A data paged chunk used as a buffer, if data paging is supported
 _LIT(KChunkName, "t_demandpaging chunk");
 RChunk DataPagedChunk;
@@ -119,7 +128,13 @@
 	return *aPtr;
 	}
 
+TUint8 WriteByte(volatile TUint8* aPtr)
+	{
+	return *aPtr = 1;
+	}
+
 #define READ(a) ReadByte((volatile TUint8*)(a))
+#define WRITE(a) WriteByte((volatile TUint8*)(a))
 
 void ThrashPaging(TUint aBytes)
 	{
@@ -435,12 +450,13 @@
 	EDesContentPaged
 	};
 
-enum TRealtimeOutcome
+enum TThreadOutcome
 	{
 	ENoError,
 	EBadDescriptor,
 	EServerTerminated,
-	ERealtimePanic
+	ERealtimePanic,
+	EAbortPanic
 	};
 
 class RTestSession : public RSessionBase
@@ -626,7 +642,7 @@
 	return r;
 	}
 
-void TestRealtimeOutcome(RThread aThread, TRealtimeOutcome aOutcome)
+void TestThreadOutcome(RThread aThread, TThreadOutcome aOutcome)
 	{
 	switch(aOutcome)
 		{
@@ -651,6 +667,12 @@
 			test_Equal(EIllegalFunctionForRealtimeThread, aThread.ExitReason());
 			break;
 
+		case EAbortPanic:
+			test_Equal(EExitPanic, aThread.ExitType());
+			// category for paging errors tested elsewhere
+			test_Equal(KErrAbort, aThread.ExitReason());
+			break;
+
 		default:
 			test(EFalse);
 		}
@@ -661,8 +683,9 @@
 				  TIpcObjectPaged aServerPaged,
 				  User::TRealtimeState aClientState,
 				  User::TRealtimeState aServerState,
-				  TRealtimeOutcome aClientOutcome,
-				  TRealtimeOutcome aServerOutcome)
+				  TThreadOutcome aClientOutcome,
+				  TThreadOutcome aServerOutcome,
+				  TPagingErrorContext aSimulatedError = EPagingErrorContextNone)
 	{
 	test.Printf(_L("TestPagedIpc %d %d %d %d %d %d %d\n"), aIpcDir, aClientPaged, aServerPaged,
 				aClientState, aServerState, aClientOutcome, aServerOutcome);
@@ -688,6 +711,11 @@
 	name = clientThread.Name();
 	test.Printf(_L("  client: %S\n"), &name);
 	clientThread.Logon(clientStatus);
+
+	// set up simulated failure if specifed
+	if (aSimulatedError != EPagingErrorContextNone)
+		test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)aSimulatedError, 0));
+	
 	clientThread.Resume();
 
 	User::WaitForRequest(serverStatus);
@@ -696,9 +724,13 @@
 
 	User::WaitForRequest(clientStatus);
 	test.Printf(_L("  client exit type is %d %d\n"), clientThread.ExitType(), clientThread.ExitReason());
+	
+	// cancel any simulated failure
+	if (aSimulatedError != EPagingErrorContextNone)
+		test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)EPagingErrorContextNone, 0));
 
-	TestRealtimeOutcome(serverThread, aServerOutcome);
-	TestRealtimeOutcome(clientThread, aClientOutcome);
+	TestThreadOutcome(serverThread, aServerOutcome);
+	TestThreadOutcome(clientThread, aClientOutcome);
 	
 	CLOSE_AND_WAIT(serverThread);
 	CLOSE_AND_WAIT(clientThread);
@@ -717,7 +749,7 @@
 	return KErrNone;
 	}
 
-TInt RunTestThread(User::TRealtimeState aType, TRealtimeOutcome aOutcome)
+TInt RunTestThread(User::TRealtimeState aType, TThreadOutcome aOutcome)
 	{
 	RThread thread;
 	TInt r=thread.Create(KNullDesC, &TestThreadFunction, 0x1000, NULL, (TAny*)aType);
@@ -729,7 +761,7 @@
 		return s.Int();
 	thread.Resume();
 	User::WaitForRequest(s);
-	TestRealtimeOutcome(thread, aOutcome);
+	TestThreadOutcome(thread, aOutcome);
 	CLOSE_AND_WAIT(thread);
 	return KErrNone;
 	}
@@ -811,6 +843,141 @@
 	test(KErrNone==DPTest::SetCacheSize(0,0));
 	}
 
+enum TPageFaultType
+	{
+	EPageFaultRomRead,
+	EPageFaultCodeRead,
+	EPageFaultDataRead,
+	EPageFaultDataWrite,
+	};
+
+
+TInt TestPagingErrorThreadFunction(TAny* aArg)
+	{
+	TUint8* ptr = (TUint8*)((TUint)aArg & ~1);
+	TBool write = ((TUint)aArg & 1) != 0;
+
+	if (write)
+		{
+		WRITE(ptr);
+		return DPTest::FlushCache();
+		}
+	else
+		{
+		READ(ptr);
+		return KErrNone;
+		}
+	}
+
+void TestPagingError(TPageFaultType aPageFaultType,
+					 TPagingErrorContext aSimulatedError,
+					 TExitType aExpectedExitType,
+					 const TDesC& aExpectedExitCategory,
+					 TInt aExpectedExitReason)
+	{
+	test.Printf(_L("TestPagingError %d %d %d \"%S\" %d\n"), aPageFaultType, aSimulatedError,
+				aExpectedExitType, &aExpectedExitCategory, aExpectedExitReason);
+	
+	TUint8* ptr;
+	TBool write;
+
+	switch(aPageFaultType)
+		{
+		case EPageFaultRomRead:   ptr = RomPagedBuffer;  write = EFalse; break;
+		case EPageFaultCodeRead:  ptr = CodePagedBuffer; write = EFalse; break;
+		case EPageFaultDataRead:  ptr = DataPagedBuffer; write = EFalse; break;
+		case EPageFaultDataWrite: ptr = DataPagedBuffer; write = ETrue;  break;
+		default: test(EFalse); return;
+		}
+
+	if (ptr == NULL) return;  // specified type of paging is not enabled
+
+	if (write)
+		READ(ptr);  // ensure data to be written is paged in
+	else
+		test_KErrNone(DPTest::FlushCache());  // ensure data to be read is paged out
+
+	// set up simulated failure
+	test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)aSimulatedError, 0));
+	
+	RThread thread;
+	TAny* arg = (TAny*)((TUint)ptr | (write ? 1 : 0));
+	test_KErrNone(thread.Create(KNullDesC, &TestPagingErrorThreadFunction, 0x1000, NULL, arg));
+	TRequestStatus s;
+	thread.Logon(s);
+	test_Equal(KRequestPending, s.Int());
+	thread.Resume();
+	User::WaitForRequest(s);
+
+	// cancel any simulated failure
+	test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)EPagingErrorContextNone, 0));
+
+	TExitCategoryName exitCategory = thread.ExitCategory();
+	test.Printf(_L("  thread exit type is %d \"%S\" %d\n"),
+				thread.ExitType(), &exitCategory, thread.ExitReason());
+	
+	test_Equal(aExpectedExitType, thread.ExitType());
+	if (aExpectedExitType == EExitPanic)
+		test_Equal(0, aExpectedExitCategory.Compare(exitCategory));	
+	test_Equal(aExpectedExitReason, thread.ExitReason());	
+	
+	CLOSE_AND_WAIT(thread);
+	}
+
+void CreateDataPagedChunk()
+	{
+	TChunkCreateInfo createInfo;
+	createInfo.SetNormal(KMinBufferSize, KMinBufferSize);
+	createInfo.SetPaging(TChunkCreateInfo::EPaged);
+	createInfo.SetOwner(EOwnerProcess);
+	createInfo.SetGlobal(KChunkName);
+	test_KErrNone(DataPagedChunk.Create(createInfo));
+	test(DataPagedChunk.IsPaged()); // this is only ever called if data paging is supported
+	DataPagedBuffer = (TUint8*)DataPagedChunk.Base();
+	}
+
+void TestPagingErrors()
+	{
+	// test what happens when the paging system encounters errors such as failure when accessing
+	// media or decompressing paged data
+
+	//              page fault type:     simulated error:                   exit type:  exit category:          exit reason:
+	TestPagingError(EPageFaultRomRead,   EPagingErrorContextNone,           EExitKill,  KNullDesC,              KErrNone);
+	TestPagingError(EPageFaultRomRead,   EPagingErrorContextRomRead,        EExitPanic, _L("PAGED-ROM-READ"),   KErrAbort);
+	TestPagingError(EPageFaultRomRead,   EPagingErrorContextRomDecompress,  EExitPanic, _L("PAGED-ROM-COMP"),   KErrAbort);
+	
+	TestPagingError(EPageFaultCodeRead,  EPagingErrorContextNone,           EExitKill,  KNullDesC,              KErrNone);
+	TestPagingError(EPageFaultCodeRead,  EPagingErrorContextCodeRead,       EExitPanic, _L("PAGED-CODE-READ"),  KErrAbort);
+	TestPagingError(EPageFaultCodeRead,  EPagingErrorContextCodeDecompress, EExitPanic, _L("PAGED-CODE-COMP"),  KErrAbort);
+
+	if (DataPagedBuffer)
+		{
+		// Note WDP write faults are only reported on the next read
+		WRITE(DataPagedBuffer);  // ensure page is not blank and will be read from swap
+		
+		//              page fault type:     simulated error:               exit type:  exit category:          exit reason:
+		TestPagingError(EPageFaultDataRead,  EPagingErrorContextNone,       EExitKill,  KNullDesC,              KErrNone);
+		TestPagingError(EPageFaultDataRead,  EPagingErrorContextDataRead,   EExitPanic, _L("PAGED-DATA-READ"),  KErrAbort);
+		TestPagingError(EPageFaultDataWrite, EPagingErrorContextDataWrite,  EExitKill,  KNullDesC,              KErrNone);
+		TestPagingError(EPageFaultDataRead,  EPagingErrorContextNone,       EExitPanic, _L("PAGED-DATA-WRITE"), KErrAbort);
+
+		// this will now always panic when we try to access the first page so destroy and re-create it
+		DataPagedChunk.Close();
+		CreateDataPagedChunk();
+		}
+
+	// test attribution of errors during IPC
+	TPagingErrorContext error;
+	if (RomPagedBuffer)
+		error = EPagingErrorContextRomRead;
+	else if (CodePagedBuffer)
+		error = EPagingErrorContextCodeRead;
+	else
+		error = EPagingErrorContextDataRead;
+	//           ipc dir:     client paged:     server paged:  client state:            server state:            client outcome:  server outcome:
+	TestPagedIpc(EServerRead, EDesContentPaged, ENothingPaged, User::ERealtimeStateOff, User::ERealtimeStateOff, EAbortPanic,     EBadDescriptor,  error);
+	}
+
 void TestLock()
 	{
 	// make sure live list is big enough
@@ -1287,50 +1454,45 @@
 	test.Start(_L("Initialisation"));
 	
 	if (DPTest::Attributes() & DPTest::ERomPaging)
+		{
 		test.Printf(_L("Rom paging supported\n"));
+		TRomHeader* romHeader = (TRomHeader*)UserSvr::RomHeaderAddress();
+		test(romHeader->iPageableRomStart);
+		// todo: for some reason the first part of page of paged rom doesn't seem to get paged out
+		// when we flush the paging cache, hence RomPagedBuffer starts some way into this
+		RomPagedBuffer = (TUint8*)romHeader + romHeader->iPageableRomStart + 64 * PageSize; 
+		RomPagedBufferSize = romHeader->iPageableRomSize - 64 * PageSize;
+		test(RomPagedBufferSize > 0);
+		}
+	
 	if (DPTest::Attributes() & DPTest::ECodePaging)
+		{
 		test.Printf(_L("Code paging supported\n"));
+		test_KErrNone(PagedLibrary.Load(KTCodePagingDll4));		
+		TGetAddressOfDataFunction func = (TGetAddressOfDataFunction)PagedLibrary.Lookup(KGetAddressOfDataFunctionOrdinal);
+		CodePagedBuffer = (TUint8*)func(CodePagedBufferSize);
+		test_NotNull(CodePagedBuffer);
+		test(CodePagedBufferSize > KMinBufferSize);
+		}
+	
 	if (DPTest::Attributes() & DPTest::EDataPaging)
 		{
 		test.Printf(_L("Data paging supported\n"));
 		DataPagingSupported = ETrue;
-		TChunkCreateInfo createInfo;
-		createInfo.SetNormal(KMinBufferSize, KMinBufferSize);
-		createInfo.SetPaging(TChunkCreateInfo::EPaged);
-		createInfo.SetOwner(EOwnerProcess);
-		createInfo.SetGlobal(KChunkName);
-		test_KErrNone(DataPagedChunk.Create(createInfo));
-		test(DataPagedChunk.IsPaged()); // this is only ever called if data paging is supported
-		DataPagedBuffer = (TUint8*)DataPagedChunk.Base();
+		CreateDataPagedChunk();
 		}
 
 	if (DPTest::Attributes() & DPTest::ERomPaging)
 		{
 		// Use paged part of rom for testing
-		TRomHeader* romHeader = (TRomHeader*)UserSvr::RomHeaderAddress();
-		test(romHeader->iPageableRomStart);
-		// todo: for some reason the first part of page of paged rom doesn't seem to get paged out
-		// when we flush the paging cache, hence LargeBuffer starts some way into this
-		LargeBuffer = (TUint8*)romHeader + romHeader->iPageableRomStart + 64 * PageSize; 
-		LargeBufferSize = romHeader->iPageableRomSize - 64 * PageSize;
-		test(LargeBufferSize > 0);
-		// Find a zero word in rom to set PagedHeaderDes to
-		TUint* ptr = (TUint*)LargeBuffer;
-		TUint* end = (TUint*)(LargeBuffer + LargeBufferSize);
-		while (*ptr && ptr < end)
-			++ptr;
-		test(*ptr == 0);
-		test.Printf(_L("Found zero word at %08x\n"), ptr);
-		PagedHeaderDes = (TDesC8*)ptr;
+		LargeBuffer = RomPagedBuffer;
+		LargeBufferSize = RomPagedBufferSize;
 		}
 	else if (DPTest::Attributes() & DPTest::ECodePaging)
 		{
 		// Use code paged DLL for testing
-		test_KErrNone(PagedLibrary.Load(KTCodePagingDll4));		
-		TGetAddressOfDataFunction func = (TGetAddressOfDataFunction)PagedLibrary.Lookup(KGetAddressOfDataFunctionOrdinal);
-		LargeBuffer = (TUint8*)func(LargeBufferSize);
-		test_NotNull(LargeBuffer);
-		PagedHeaderDes = (TDesC8*)LargeBuffer + 4;
+		LargeBuffer = CodePagedBuffer;
+		LargeBufferSize = CodePagedBufferSize;
 		}
 	else if (DPTest::Attributes() & DPTest::EDataPaging)
 		{
@@ -1344,7 +1506,16 @@
 		test.End();
 		return 0;
 		}
-		
+	
+	// Find a paged zero word to set PagedHeaderDes to
+	TUint* ptr = (TUint*)LargeBuffer;
+	TUint* end = (TUint*)(LargeBuffer + LargeBufferSize);
+	while (*ptr && ptr < end)
+		++ptr;
+	test(*ptr == 0);
+	test.Printf(_L("Found zero word at %08x\n"), ptr);
+	PagedHeaderDes = (TDesC8*)ptr;
+
 	test.Next(_L("Test HAL interface"));
 	TestHAL();
 	
@@ -1390,6 +1561,15 @@
 
 	test.Next(_L("Test no kernel faults when copying data from unpaged rom with mutex held"));
 	TestReadHoldingMutex();
+	
+#ifdef _DEBUG
+	// test hook in kernel not present in release mode
+	if ((MemModelAttributes() & EMemModelTypeMask) == EMemModelTypeFlexible)
+		{
+		test.Next(_L("Test unrecoverable errors while paging"));
+		TestPagingErrors();
+		}
+#endif
 
 	test.Next(_L("Close test driver"));
 	Ldd.DestroyPlatHwChunk();
@@ -1398,11 +1578,14 @@
 	test.Next(_L("Test setting publish and subscribe properties from paged area"));
 	TestPublishAndSubscribe();
 
+#ifndef _DEBUG
+	// no point benchmarking in debug mode
 	if (DPTest::Attributes() & DPTest::ERomPaging)
 		{
 		test.Next(_L("Rom Paging Benchmark"));
 		RomPagingBenchmark();
 		}
+#endif
 
 	PagedLibrary.Close();
 	gobbler.Close();
--- a/kerneltest/e32test/mmu/t_shadow.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/mmu/t_shadow.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -195,24 +195,27 @@
 	{
 	test.Start(_L("Test allocating a shadow page when all free RAM is in 'chunk caches'"));
 	
+	// Remove limit on max size of live list
+	TUint originalMin = 0;
+	TUint originalMax = 0;
+	TUint currentSize = 0;
+	TInt r = DPTest::CacheSize(originalMin, originalMax, currentSize);
+	test_Value(r, r == KErrNone || r == KErrNotSupported);
+	TBool resizeCache = r == KErrNone;
+	if (resizeCache)
+		test_KErrNone(DPTest::SetCacheSize(originalMin, KMaxTUint));
+
 	test.Next(_L("Load gobbler LDD"));
-	TInt r = User::LoadLogicalDevice(KGobblerLddFileName);
+	r = User::LoadLogicalDevice(KGobblerLddFileName);
 	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
-	RGobbler gobbler;
+	RGobbler gobbler, gobbler2;
 	test_KErrNone(gobbler.Open());
 	TUint32 taken = gobbler.GobbleRAM(496*1024*1024);
 	test.Printf(_L("  Gobbled: %dK\n"), taken/1024);
 	test.Printf(_L("  Free RAM 0x%08X bytes\n"),FreeRam());
+	//  Open 2nd globber here, while we still have some free pages.
+	test_KErrNone(gobbler2.Open());
 
-	// Remove limit on max size of live list
-	TUint originalMin = 0;
-	TUint originalMax = 0;
-	TUint currentSize = 0;
-	r = DPTest::CacheSize(originalMin, originalMax, currentSize);
-	test_Value(r, r == KErrNone || r == KErrNotSupported);
-	TBool resizeCache = r == KErrNone;
-	if (resizeCache)
-		test_KErrNone(DPTest::SetCacheSize(originalMin, KMaxTUint));
 
 	// put all of free RAM in a chunk...
 	TChunkCreateInfo createInfo;
@@ -223,7 +226,14 @@
 	while(KErrNone==(r=testChunk.Commit(commitEnd,PageSize)))
 		commitEnd += PageSize;
 	test_Equal(KErrNoMemory,r);
-	
+
+	// Now we have some memory in a cache chunk ensure definitely no 
+	// other free pages.
+	taken = gobbler2.GobbleRAM(0);
+	test.Printf(_L("  Gobbled: %dK\n"), taken/1024);
+	test_Equal(0, FreeRam());
+
+
 	// no memory to allocate shadow page...
 	test_Equal(KErrNoMemory,Shadow.Alloc(aPageAddr));
 	// unlock all of RAM in chunk...
@@ -239,6 +249,7 @@
 		test_KErrNone(DPTest::SetCacheSize(originalMin, originalMax));
 
 	gobbler.Close();
+	gobbler2.Close();
 	test.End();
 	}
 
@@ -464,6 +475,11 @@
 #ifdef __WINS__
 	test.Printf(_L("Test not valid in WINS\n"));
 #else
+	// Turn off lazy dll unloading
+	RLoader l;
+	test_KErrNone(l.Connect());
+	test_KErrNone(l.CancelLazyDllUnload());
+	l.Close();
 
 	test.Start(_L("Testing ROM shadowing"));
 	Initialise();
--- a/kerneltest/e32test/pci/t_pci.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,865 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description:
-// This is a test for the PCI driver, so far implemented only on the
-// Naviengine platform. It aims to test:
-//	-That known values of data in config and memory space, on a given
-//	device can be read as expected.
-//	-That data can be written and modified in config and memory space
-//	-PCI memory buffers mapped or allocated by the PCI driver work as
-//	expected. These are
-//		-DChunk created by PCI driver and accessible from PCI
-//		-DPlatHwChunk created by PCI driver and accessible from PCI
-//		-DChunk created externally, then mapped in to PCI memory space
-//	There are tests to:
-//		- Create and close each buffer. Heap checking ensures proper
-//		cleanup
-//		- Create and close multiple buffers from multiple threads.
-//		This is an SMP focused test to check that the implementation
-//		of the chunk manager and allocator in the driver are thread
-//		safe. The tests should pass without triggering any assertions in
-//		the driver's invariance checks.
-//		- Write to buffers from software, and read back via the
-//		system to PCI window, and vice-versa -- a loop-back test.
-//		This checks that PCI buffers are indeed accessible to PCI devices.
-//
-// The tests require several pieces of PSL specific information:
-//	- A TPciDevice containing the vendor and device IDs of a PCI device
-//	to use for testing.
-//	- TAddrSpaceTests which identify regions of a device's config and
-//	memory space with known values, or which are known to be writable.
-//
-//	The test driver grants access to the PCI API with the following
-//	constructs: 
-//	- TUserConfigSpace and TUserMemorySpace, derived from TUserPciSpace,
-//	which are user side equivalents of kernel-side objects allowing
-//	accesses of different sizes to a PCI device's config space or
-//	memory space.
-//	- RPciChunk which is derived from and RChunk and corresponds to
-//	a kernel-side DChunk, which in turn corresponds to a PCI chunk or
-//	buffer. The test driver uses these for all PCI chunk types (a
-//	"wrapper" DChunk is used to map the memory of a PCI DPlatHwChunk
-//	to user side).
-//
-//	Known Issues:
-//	The test driver d_pci is intended to be platform independent but
-//	for now still contains some PSL specific information .eg the test
-//	info structure (which should really be passed up from the PSL) and
-//	the address and size of the system to pci window. For now the
-//	test driver code will remain in the Naviengine baseport directory.
-//	If the PCI driver is ever ported to a new platform this can be
-//	rectified.
-//	
-//
-//
-#include "../misc/test_thread.h"
-#include <e32std.h>
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include "t_pci.h"
-#include <assp/naviengine/pci.h>
-
-class RPci;
-/**
-Extends RChunk to hold the PCI address
-associated with a chunk.
-*/
-class RPciChunk: public RChunk
-	{
-public:
-	TUint PciBase()
-		{
-		return iPciBaseAddr;
-		}
-
-	/**
-	Return the PCI accessible size
-	*/
-	TInt Size() const
-		{
-		return iPciSize;
-		}
-
-private:
-	friend class RPci;
-	TUint iPciBaseAddr;
-	TInt iPciSize; //size of the region mapped into PCI
-	};
-
-typedef TInt (RPci::*ChunkOpenFn)(RPciChunk&, TInt, TRequestStatus*);
-
-class RPci : public RBusLogicalChannel
-	{
-public:
-	TInt Open();
-	TInt GetTestInfo(TPciTestInfo& aTestInfo);
-
-	TInt Open(const TPciDevice&);
-
-	TUint AccessConfigSpace(const TUserConfigSpace& aCs);
-	TUint AccessMemorySpace(const TUserMemorySpace& aMs);
-	TInt  OpenPciDChunk(RPciChunk& aPciChunk,TInt aPciChunkSize, TRequestStatus* aStatus=0);
-	TInt  OpenPciPlatHwChunk(RPciChunk& aPciHwChunk,TInt aPciChunkSize, TRequestStatus* aStatus=0);
-	TInt  OpenPciMappedChunk(RPciChunk& aPciMappedChunk,TInt aPciChunkSize, TRequestStatus* aStatus=0);	
-	TInt  OpenPciWindowChunk(RChunk& aPciWindowChunk);
-	TInt  RunUnitTests();
-private:	
-	TInt DoOpenPciChunk(RPciChunk& aPciChunk, TInt aPciChunkSize, TPciTestCmd aCmd, TRequestStatus* aStatus);
-	};
-
-inline TInt RPci::Open()
-	{
-	return DoCreate(KPciLddFactory, TVersion(), KNullUnit, NULL, NULL);
-	}
-
-inline TInt RPci::Open(const TPciDevice& aDevice) 
-	{
-	TPckgC<TPciDevice> devicePkg(aDevice);
-	return DoCreate(KPciLddFactory, TVersion(), KNullUnit, NULL, &devicePkg);
-	}
-
-inline TInt RPci::GetTestInfo(TPciTestInfo& aTestInfo)
-	{
-	TPckg<TPciTestInfo> info(aTestInfo);
-	return DoControl(EGetTestInfo, &info);
-	}
-
-inline TInt RPci::RunUnitTests()
-	{
-	return DoControl(ERunUnitTests);
-	}
-
-TUint RPci::AccessConfigSpace(const TUserConfigSpace& aCs)
-	{
-	TPckgC<TUserConfigSpace> pkg(aCs);
-	return DoControl(EAccessConfigSpace, &pkg);
-	}
-
-TUint RPci::AccessMemorySpace(const TUserMemorySpace& aMs)
-	{
-	TPckgC<TUserMemorySpace> pkg(aMs);
-	return DoControl(EAccessMemorySpace, &pkg);
-	}
-
-TInt RPci::OpenPciDChunk(RPciChunk& aPciChunk,TInt aPciChunkSize, TRequestStatus* aStatus)	
-	{	
-	return DoOpenPciChunk(aPciChunk, aPciChunkSize, EOpenPciDChunk, aStatus);
-	}
-
-TInt RPci::OpenPciPlatHwChunk(RPciChunk& aPciHwChunk,TInt aPciChunkSize, TRequestStatus* aStatus)	
-	{
-	return DoOpenPciChunk(aPciHwChunk, aPciChunkSize, EOpenPciPlatHwChunk, aStatus);
-	}
-
-TInt RPci::OpenPciMappedChunk(RPciChunk& aPciMappedChunk,TInt aPciChunkSize, TRequestStatus* aStatus)	
-	{
-	return DoOpenPciChunk(aPciMappedChunk, aPciChunkSize, EOpenPciMappedChunk, aStatus);
-	}
-
-TInt RPci::OpenPciWindowChunk(RChunk& aPciWindowChunk)
-	{	
-	TUint chunkHandle = DoControl(EOpenPciWindowChunk);			
-	return aPciWindowChunk.SetReturnedHandle(chunkHandle);
-	}
-
-TInt RPci::DoOpenPciChunk(RPciChunk& aPciChunk, TInt aPciChunkSize, TPciTestCmd aCmd, TRequestStatus* aStatus)
-	{
-	const TInt constPciChunkSize = aPciChunkSize;
-	TPciChunkCreateInfo info(constPciChunkSize, aPciChunk.iPciBaseAddr, aStatus);
-	TPckgC<TPciChunkCreateInfo> pkg(info);
-
-	TUint chunkHandle = DoControl(aCmd, &pkg);	
-	
-	const TInt r = aPciChunk.SetReturnedHandle(chunkHandle);
-	if(r == KErrNone)
-		{		
-		aPciChunk.iPciSize = constPciChunkSize;					
-		}
-	return r;
-	}
-
-TUserPciSpace::TUserPciSpace(RPci& aPci)
-	:iPci(&aPci)
-	{}
-
-TUserConfigSpace::TUserConfigSpace(RPci& aPci)
-	:TUserPciSpace(aPci)
-	{}
-
-TUint TUserConfigSpace::Call()
-	{
-	return iPci->AccessConfigSpace(*this);
-	}
-
-TUserPciSpace* TUserConfigSpace::Clone() const
-	{
-	return new TUserConfigSpace(*this);
-	}
-
-TUserMemorySpace::TUserMemorySpace(RPci& aPci, TInt aBarIndex)
-	:TUserPciSpace(aPci), iBarIndex(aBarIndex)
-	{}
-
-TUint TUserMemorySpace::Call()
-	{
-	return iPci->AccessMemorySpace(*this);
-	}
-
-TUserPciSpace* TUserMemorySpace::Clone() const
-	{
-	return new TUserMemorySpace(*this);
-	}
-
-/**
-Test address allocator
-*/
-TInt TestRunPciUnitTest(RPci& pci)
-	{		
-	return pci.RunUnitTests();
-	}
-
-
-/**
-Read from a defined address in memory or config space, compare against expected values.
-8,16, and 32 bit accesses performed.
-
-@param aSpace Object gving access to either the config or memory space of a PCI device
-@param aInfo Contains the address and expected value of a dword
-*/
-void TestReadAddressSpace(TUserPciSpace& aSpace, const TPciTestInfo::TAddrSpaceTest& aInfo, RTest& test, TBool aVerbose=EFalse)
-	{
-	const TUint os = aInfo.iOffset;
-	//Iterate over different widths, and possible
-	//subfields of 32 bit word
-	for(TInt bitWidth=32; bitWidth>=8; bitWidth>>=1)
-		{
-		const TInt numberOfFields = (32/bitWidth);
-		for(TInt i=0; i< numberOfFields; i++)
-			{
-			const TInt extraByteOffset = i * (bitWidth >> 3);
-			const TInt byteOffset = os + extraByteOffset;
-			if(aVerbose)
-				test.Printf(_L("Access bitWidth=%d byte offset=%d\n"), bitWidth, byteOffset);
-
-			const TUint expected = aInfo.Expected(bitWidth, byteOffset);
-			const TUint read = aSpace.Read(bitWidth, byteOffset);
-			if(aVerbose)
-				test.Printf(_L("expect 0x%08x, read 0x%08x\n"), expected, read);
-			test_Equal(expected, read);
-			}
-		}
-	}
-
-/**
-Verify writes and modifications to a defined address in memory or config space. 8,16, and 32 bit
-accesses performed.
-
-@param aSpace Object gving access to either the config or memory space of a PCI device
-@param aInfo Contains the address of a (at least partially) writable dword
-*/
-void TestWriteAddressSpace(TUserPciSpace& aSpace, TPciTestInfo::TAddrSpaceTest& aInfo, RTest& test, TBool aVerbose=EFalse)
-	{
-	const TUint original = aSpace.Read(32, aInfo.iOffset);
-	const TUint os = aInfo.iOffset;
-	TUint mask = ~aInfo.iReadOnlyMask;
-
-	//The pattern will be truncated when used with bit widths
-	//less than 32.
-	const TUint initPattern = 0xFFFFFFFF;
-
-	for(TInt bitWidth=32; bitWidth>=8; bitWidth>>=1)
-		{
-		const TUint pattern = initPattern >> (32-bitWidth);
-		const TInt numberOfFields = (32/bitWidth);
-		for(TInt i=0; i< numberOfFields; i++)
-			{
-			const TInt extraByteOffset = i * (bitWidth >> 3);
-			const TInt byteOffset = os + extraByteOffset;
-			if(aVerbose)
-				test.Printf(_L("Access bitWidth=%d byte offset=%d\n"), bitWidth, byteOffset);
-			//the full dword we expect
-			//currently assume that the unwritable bits will be 0
-			const TUint writeExpect = (pattern << (bitWidth * i) ) & mask; 
-			const TUint clearExpect = 0;
-						
-			//do write followed by clear
-			const TUint expect[] = {writeExpect, clearExpect};
-			const TUint write[] = {pattern, 0};
-			for(TInt n = 0; n < 2; n++)
-				{
-				aSpace.Write(bitWidth, byteOffset, write[n]);
-				TUint result = aSpace.Read(32, os);
-							
-				if(aVerbose)
-					test.Printf(_L("wrote 0x%08x, expect 0x%08x, read 0x%08x\n"),
-						write[n], expect[n], result);
-				test_Equal(expect[n], result);
-				}
-
-			//test Modify calls. Set then clear pattern
-			TUint set[] = {pattern, 0};
-			TUint clear[] = {0, pattern};
-
-			for(TInt m = 0; m < 2; m++)
-				{	
-				aSpace.Modify(bitWidth, byteOffset, clear[m], set[m]);
-				TUint result = aSpace.Read(32, os);
-						
-				if(aVerbose)
-					test.Printf(_L("clear 0x%08x, set 0x%08x,  expect 0x%08x, read 0x%08x\n"), clear[m], set[m], expect[m], result);
-				test_Equal(expect[m], result);
-				}
-			}
-		}
-
-	//restore orginal value or we will not be able to access device
-	aSpace.Write(32, os, original);
-	}
-
-
-/**
-Verify that a PCI DChunk can be opened and closed from user side
-
-@param pci  The RPci object to use
-@param test The RTest object to use
-@param aPciChunkSize The size of the DChunk which would be created
-*/
-void TestOpenAndCloseDChunk(RPci& pci,RTest& test,TInt aPciChunkSize)
-	{
-	RPciChunk testPciDChunk;
-
-	// Create and open Chunk
-	TRequestStatus status;
-	TInt r = pci.OpenPciDChunk(testPciDChunk,aPciChunkSize, &status);	
-	test_KErrNone(r);
-	
-	test(testPciDChunk.IsWritable());
-	test(testPciDChunk.IsReadable());
-
-	test.Printf(_L("PCI Chunk base = 0x%08x\n"), testPciDChunk.Base());
-	test.Printf(_L("PCI Chunk size = %d\n"), testPciDChunk.Size());
-	test.Printf(_L("PCI Address = 0x%08x\n"), testPciDChunk.PciBase());	
-
-	//Close Chunk
-	test.Next(_L("Close PCI Chunk handle"));	
-
-	RTest::CloseHandleAndWaitForDestruction(testPciDChunk);
-	User::WaitForRequest(status);
-	}
-
-/**
-Verify that a PCI PlatHwChunk can be opened and closed from user side
-
-
-@param pci  The RPci object to use
-@param test The RTest object to use
-@param aPciChunkSize The size of the PlatHwChunk which would be created
-*/
-void TestOpenAndClosePciPlatHwChunk(RPci& pci,RTest& test,TInt aPciChunkSize)
-	{
-	RPciChunk testPciPlatHwChunk;
-
-	// Create and open Chunk
-	TRequestStatus status;
-	TInt r = pci.OpenPciPlatHwChunk(testPciPlatHwChunk,aPciChunkSize, &status);	
-	test_KErrNone(r);
-	
-	test(testPciPlatHwChunk.IsWritable());
-	test(testPciPlatHwChunk.IsReadable());
-
-	test.Printf(_L("PCI Chunk base = 0x%08x\n"), testPciPlatHwChunk.Base());
-	test.Printf(_L("PCI Chunk size = %d\n"), testPciPlatHwChunk.Size());
-	test.Printf(_L("PCI Address = 0x%08x\n"), testPciPlatHwChunk.PciBase());	
-
-	//Close Chunk	
-	testPciPlatHwChunk.Close();
-	User::WaitForRequest(status);
-	test.Next(_L("Closed PCI PlatHwChunk handle"));	
-	}
-
-/**
-Verify that pci-mapped DChunk can be opended and closed form user side 
-
-@param pci  The RPci object to use
-@param test The RTest object to use
-@param aPciChunkSize The size of the pci-mapped DChunk which would be created
-*/
-void TestPciMapppedChunk(RPci& pci,RTest& test,TInt aPciChunkSize)
-	{
-	RPciChunk testPciMappedChunk;
-
-	// Create and open Chunk
-	TRequestStatus status;
-	TInt r = pci.OpenPciMappedChunk(testPciMappedChunk,aPciChunkSize, &status);	
-	test_KErrNone(r);
-	
-	test(testPciMappedChunk.IsWritable());
-	test(testPciMappedChunk.IsReadable());
-
-	test.Printf(_L("PCI Chunk base = 0x%08x\n"), testPciMappedChunk.Base());
-	test.Printf(_L("PCI Chunk size = %d\n"), testPciMappedChunk.Size());
-	test.Printf(_L("PCI Address = 0x%08x\n"), testPciMappedChunk.PciBase());	
-
-	//Close Chunk
-	testPciMappedChunk.Close();
-	User::WaitForRequest(status);
-	test.Next(_L("Closed PCI Mapped Chunk handle"));	
-	}
-
-/**
-Verify that an RChunk can be open to grant access to the internal PCI window from the user side
-
-@param pci  The RPci object to use
-@param test The RTest object to use
-*/
-void TestPciWindowChunk(RPci& pci,RTest& test)
-	{
-	RChunk testPciWindowChunk;
-
-	// Create and open DChunk
-	TInt r = pci.OpenPciWindowChunk(testPciWindowChunk);	
-	test_KErrNone(r);
-	
-	test(testPciWindowChunk.IsWritable());
-	test(testPciWindowChunk.IsReadable());
-
-	test.Printf(_L("PCI Window Chunk base = 0x%08x\n"), testPciWindowChunk.Base());
-	test.Printf(_L("PCI Window Chunk size = %d\n"), testPciWindowChunk.Size());
-	
-	//Close Chunk
-	testPciWindowChunk.Close();
-	test.Next(_L("Closed PCI Window Chunk handle"));	
-	}
-
-
-class CPciTest : public CTest
-	{
-protected:
-	CPciTest(const TDesC& aName, TInt aIterations, RPci& aDevice)
-		: CTest(aName, aIterations), iDevice(aDevice)
-		{}
-
-	RPci iDevice;
-	};
-
-/**
-Each instance of test will open a chunk, using the function specified in
-the template argument, FUNC.
-
-The total number of chunks that can be opened by all instances is limited
-by iMaxCount.
-
-All intances of the test will hold their chunk open until iMaxCount has
-been reached.
-*/
-template<ChunkOpenFn FUNC>
-class CPciOpenChunkTest : public CPciTest
-	{
-public:
-	CPciOpenChunkTest(const TDesC& aName, TInt aIterations, RPci& aDevice,
-			RSemaphore aSemOpen, RSemaphore aSemClose, RFastLock aLock, TInt aMaxCount)
-		:CPciTest(aName, aIterations, aDevice),
-			iSemOpen(aSemOpen), iSemClose(aSemClose), iLock(aLock), iMaxCount(aMaxCount)
-		{
-		}
-
-	virtual void RunTest()
-		{
-		RTest test(iName);
-		RPciChunk chunk;
-
-		iSemOpen.Wait();
-		TRequestStatus status;
-		const TInt chunkSize = 0x400;
-		//open chunk by calling FUNC
-		TInt r = ((iDevice).*(FUNC))(chunk, chunkSize, &status);
-		test_KErrNone(r);
-
-		iLock.Wait();
-		iOpenCount++;
-		test.Printf(_L("Opened chunk %d\n"), iOpenCount);
-		if(iOpenCount == iMaxCount)
-			{
-			test.Printf(_L("Opened=%d, max=%d: Allow chunks to close\n"), iOpenCount, iMaxCount);
-			//release all waiting threads
-			//plus 1 preincrement so this
-			//thread also passes
-			iSemClose.Signal(iOpenCount);			
-			iOpenCount = 0;
-			}	
-		iLock.Signal();
-
-
-		iSemClose.Wait();
-		chunk.Close();
-		User::WaitForRequest(status);
-
-		// permit another chunk to be opened  
-		iSemOpen.Signal();
-		test.Close();
-		}
-
-	virtual CTest* Clone() const
-		{
-		//make shallow copy
-		return new CPciOpenChunkTest(*this);
-		}
-
-
-private:
-	RSemaphore& iSemOpen; ///!< Represents the number of available PCI mappings
-	RSemaphore& iSemClose; ///!< Represents the number of threads waiting to close their chunk
-	RFastLock& iLock;
-	static TInt iOpenCount;
-	const TInt iMaxCount;
-	};
-
-template<ChunkOpenFn FUNC>
-TInt CPciOpenChunkTest<FUNC>::iOpenCount = 0;
-
-
-/**
-Test which will perform various reads from a PCI address
-space (config or memory) and confirm that values are read
-as expected
-*/
-class CPciAddressSpaceRead : public CPciTest
-	{
-public:
-	CPciAddressSpaceRead(const TDesC& aName, TInt aIterations, RPci& aDevice,
-		const TUserPciSpace& aSpace, const TPciTestInfo::TAddrSpaceTest& aInfo)
-		:CPciTest(aName, aIterations, aDevice),
-			iAddressSpace(aSpace.Clone()), iSpaceTestInfo(aInfo)
-	{
-	}
-
-	CPciAddressSpaceRead(const CPciAddressSpaceRead& aOther)
-		:CPciTest(aOther)/* TODO-REVIEW have object-sliced aOther - is this ok?*/,
-			iAddressSpace(aOther.iAddressSpace->Clone()), iSpaceTestInfo(aOther.iSpaceTestInfo)
-	{
-	}
-
-	virtual ~CPciAddressSpaceRead()
-		{
-		delete iAddressSpace;
-		}
-
-	virtual void RunTest()
-		{
-		__UHEAP_MARK;
-		RTest test(iName);
-		TestReadAddressSpace(*iAddressSpace, iSpaceTestInfo, test);
-		test.Close();
-		__UHEAP_MARKEND;
-		}
-
-	virtual CTest* Clone() const
-		{
-		//make shallow copy
-		return new CPciAddressSpaceRead(*this);
-		}
-
-private:
-	TUserPciSpace* iAddressSpace;
-	const TPciTestInfo::TAddrSpaceTest& iSpaceTestInfo;
-	};
-
-/**
-For aBuffer, test writing to it then reading back from aWindow
-then write via window and read back from chunk
-
-@param test The RTest object to use
-@param aBuffer RChunk corresponding to a PCI accessible buffer
-@param aWindow RChunk coressponding an appropriate System-to-PCI memory window
-It is presumed to start at PCI address 0
-*/
-void DoLoopBackTest(RTest& test, RPciChunk aBuffer, RChunk aWindow)
-	{
-	test.Start(_L("Test accessing memory via PCI"));
-
-	TUint8* const bufferBase = aBuffer.Base();
-	const TUint bufferSize = aBuffer.Size();
-	const TUint bufferPciBase = aBuffer.PciBase();
-
-	TUint8* const windowBase = aWindow.Base();
-	const TUint windowSize = aWindow.Size();
-
-#define PRINT(N) RDebug::Printf("%s = 0x%08x (%d)", #N, (N), (N)) 
-	PRINT(bufferBase);
-	PRINT(bufferSize);
-	PRINT(bufferPciBase);
-
-	PRINT(windowBase);
-	PRINT(windowSize);
-
-#undef PRINT
-
-	//need to check that the end of the buffer
-	//is within the windowed region
-	test(bufferPciBase + bufferSize <= windowSize);
-	TUint8* const bufferBaseWithinWindow = windowBase + bufferPciBase;
-
-	test.Next(_L("write chunk"));
-	for(TUint i = 0; i < bufferSize; ++i)
-		{
-		//each byte will hold its own offset modulo 256
-		bufferBase[i] = (TUint8)i;
-		}
-
-	test.Next(_L("read back via window"));
-	for(TUint j=0; j < bufferSize; ++j)
-		{
-		const TUint8 result = bufferBaseWithinWindow[j];
-		test_Equal(j%256, result);
-		}
-
-	//clear chunk
-	memclr(bufferBase, bufferSize);
-	test.Next(_L("write via window"));
-	for(TUint k=0; k < bufferSize; ++k)
-		{
-		//each byte will hold its own offset modulo 256
-		bufferBaseWithinWindow[k] = (TUint8)k;
-		}
-
-	test.Next(_L("read back from chunk"));
-	for(TUint l=0; l < bufferSize; ++l)
-		{
-		const TUint8 result = bufferBase[l];
-		test_Equal(l%256, result);
-		}
-
-	test.End();
-	}
-
-/**
-Take care of opening a chunk, running the test and closing
-*/
-template<ChunkOpenFn OPEN_FUNC>
-inline void LoopBackTest(RPci& aPci, RTest& test, RChunk& aWindow)
-	{
-	RPciChunk pciChunk;
-	const TInt chunkSize = 0x400; //1k
-
-	//call the specified chunk opening function
-	TRequestStatus status;
-	TInt r = ((aPci).*(OPEN_FUNC))(pciChunk, chunkSize, &status);	
-	test_KErrNone(r);
-	DoLoopBackTest(test, pciChunk, aWindow);
-	pciChunk.Close();
-	User::WaitForRequest(status);
-	}
-
-/**
-Run the loopback test for the 3 types of buffer supported by the PCI driver.
-DChunk
-DPlatChunk
-Mapped In external memory
-*/
-void TestLoopBack(RPci& aPci, RTest& test)
-	{
-	test.Next(_L("Open PCI window"));
-	RChunk window;
-	
-	TInt r = aPci.OpenPciWindowChunk(window);	
-	test_KErrNone(r);
-
-	test.Next(_L("DChunk"));
-	LoopBackTest<&RPci::OpenPciDChunk>(aPci, test, window);
-
-	test.Next(_L("DPlatHwChunk"));
-	LoopBackTest<&RPci::OpenPciPlatHwChunk>(aPci, test, window);
-
-	test.Next(_L("DChunk (mapped in)"));
-	LoopBackTest<&RPci::OpenPciMappedChunk>(aPci, test, window);
-
-	window.Close();
-	}
-#ifndef __VC32__ //visual studio 6 doesn't approve of pointer to member function template parameters
-/**
-Run the CPciOpenChunkTest for each type of chunk. This function also creates (and destroys) the
-necessary semaphores and locks.
-CPciOpenChunkTest objects are run in multiple threads using MultipleTestRun().
-
-@param aDevice Handle to the test driver
-@param test RTest to use.
-@param aBufferLimit The maximum number of buffers which can be opened simultaneously
-*/
-void TestBufferOpenConcurrency(RPci& aDevice, RTest& test, TInt aBufferLimit)
-	{
-	RSemaphore semaphoreOpen;
-	RSemaphore semaphoreClose;
-	RFastLock lock;
-
-	TInt r = semaphoreOpen.CreateLocal(aBufferLimit);
-	test_KErrNone(r);
-
-	r = semaphoreClose.CreateLocal(0);
-	test_KErrNone(r);
-
-	r = lock.CreateLocal();
-	test_KErrNone(r);
-
-	const TInt iterations = 3;
-	{
-	test.Printf(_L("Opening %d PCI DChunks in %d threads\n"), aBufferLimit, aBufferLimit);
-	CPciOpenChunkTest<&RPci::OpenPciDChunk>
-		dChunkTest(_L("Concurrent-DChunk"), iterations, aDevice, semaphoreOpen, semaphoreClose, lock, aBufferLimit);
-
-	MultipleTestRun(test, dChunkTest, aBufferLimit);
-	}
-
-	{
-	test.Printf(_L("Opening %d PCI DPlatHwChunks in %d threads\n"), aBufferLimit, aBufferLimit);
-	CPciOpenChunkTest<&RPci::OpenPciPlatHwChunk>
-		platChunkTest(_L("Concurrent-DPlatHwChunk"), iterations, aDevice, semaphoreOpen, semaphoreClose, lock, aBufferLimit);
-
-	MultipleTestRun(test, platChunkTest, aBufferLimit);
-	}
-
-	{
-	test.Printf(_L("Opening %d PCI Mapped chunks in %d threads\n"), aBufferLimit, aBufferLimit);
-	CPciOpenChunkTest<&RPci::OpenPciMappedChunk>
-		mappedChunkTest(_L("Concurrent-DChunk(mapped)"), iterations, aDevice, semaphoreOpen, semaphoreClose, lock, aBufferLimit);
-
-	MultipleTestRun(test, mappedChunkTest, aBufferLimit);
-	}
-
-	semaphoreOpen.Close();
-	semaphoreClose.Close();
-	lock.Close();
-	}
-#endif
-
-TInt E32Main()
-	{
-	__UHEAP_MARK;
-
-	_LIT(KPci, "PCI");
-	RTest test(KPci);
-	test.Start(_L("Running PCI tests\n"));
-
-	TInt r = User::LoadLogicalDevice(KPciLdd);
-
-	__KHEAP_MARK;
-	
-	if(r==KErrNotFound)
-		{
-		test.Printf(_L("No PCI system present - skipping test\n"));
-		return KErrNone;
-		}
-	if(r!=KErrNone && r!=KErrAlreadyExists)
-		{
-		test_KErrNone(r);
-		}
-	
-	test.Next(_L("Open non-existant device\n"));
-	RPci device;
-	TPciDevice unavailable;
-	r = device.Open(unavailable);
-	test_Equal(KErrNotFound, r);
-
-	RPci pciInfo;
-	r = pciInfo.Open();
-	test_KErrNone(r);
-
-	test.Next(_L("Get test info from driver\n"));
-	TPciTestInfo info;
-	r = pciInfo.GetTestInfo(info);
-	test_KErrNone(r);
-	pciInfo.Close();
-
-	test.Next(_L("Open test device\n"));
-	r = device.Open(info.iDevice);
-	test_KErrNone(r);
-
-	test.Next(_L("Run Device Unit Test\n"));
-	r=TestRunPciUnitTest(device);	
-	test_KErrNone(r);
-
-	test.Next(_L("Read config space\n"));
-	TUserConfigSpace cs(device);
-	TestReadAddressSpace(cs, info.iCfgSpaceRead, test);
-
-	test.Next(_L("Write config space\n"));
-	TestWriteAddressSpace(cs, info.iCfgSpaceWrite, test);
-	
-	test.Next(_L("Read memory space\n"));
-	TUserMemorySpace ms(device, info.iMemSpaceIndex);
-	TestReadAddressSpace(ms, info.iMemSpaceRead, test);
-
-	test.Next(_L("Modify memory space\n"));
-	TestWriteAddressSpace(ms, info.iMemSpaceWrite, test);
-
-	{
-	const TInt addrSpaceThreadCount = 4;
-	const TInt iterations = 100;
-	test.Next(_L("Concurrent config space reads")); 
-	CPciAddressSpaceRead cfgSpaceRead(_L("Cfg Space Read"), iterations, device, cs, info.iCfgSpaceRead);
-	MultipleTestRun(test, cfgSpaceRead, addrSpaceThreadCount);
-
-	test.Next(_L("Concurrent memory space reads")); 
-	CPciAddressSpaceRead memSpaceRead(_L("Memory Space Read"), iterations, device, ms, info.iMemSpaceRead);
-	MultipleTestRun(test, memSpaceRead, addrSpaceThreadCount);
-	}
-
-	TInt testDChunkSize = 0x4000;
-	test.Next(_L("Open and Close DChunks\n"));	
-	TestOpenAndCloseDChunk(device,test,testDChunkSize);
-	
-	TInt testDPlatChunkSize = 0x2000;
-	test.Next(_L("Open and Close PlatHwChunks\n"));	
-	TestOpenAndClosePciPlatHwChunk(device,test,testDPlatChunkSize);
-
-	//TestPciMapppedChunk() fails for sizes greater than 4K.
-	//The issue is that a block of externally mapped memory must be
-	//naturally alligned in order to be accessible to the PCI bus (ie
-	//an 8k buffer would have to start at an address which is a
-	//multiple of 8k.
-	//
-	//Now we could fix this for sure on the kernel side, by making
-	//sure we only commit correctly aligned memory into the chunk (as
-	//the pci driver itself does),
-	//However, by using a 4k chunk, we know this will be on a page
-	//boundary so the alignment is correct (assuming the page size
-	//isn't changed). 	
-	TInt testMapppedChunkSize = 0x1000; 
-	test.Next(_L("Open and Close Pci Mappped Chunk\n"));	
-	TestPciMapppedChunk(device,test,testMapppedChunkSize);
-
-	test.Next(_L("Open and Close Pci Window Chunk\n"));	
-	TestPciWindowChunk(device,test);
-
-	const TInt numberOfThreads = info.iNumberOfBars;
-	test.Printf(_L("Open buffers concurrently, max supported = %d\n"), numberOfThreads);
-#ifndef __VC32__
-	TestBufferOpenConcurrency(device, test, numberOfThreads);
-#else
-	test.Printf(_L("TestBufferOpenConcurrency not implemented for WINS"), numberOfThreads);
-#endif
-
-	test.Next(_L("Test loop back"));	
-	TestLoopBack(device, test);
-
-	device.Close();
-	__KHEAP_MARKEND;
-
-	r = User::FreeLogicalDevice(KPciLdd);
-	test_KErrNone(r);
-
-	test.End();
-	test.Close();
-
-	__UHEAP_MARKEND;
-	return KErrNone;
-	}	
--- a/kerneltest/e32test/pci/t_pci.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,254 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description: This is the header file for the PCI driver test , so far implemented 
-//				only on the  Naviengine platform
-
-#ifndef __TPCI_TEST_H
-#define __TPCI_TEST_H
-
-#ifndef __KERNEL_MODE__
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
- #include <e32def_private.h>
-#endif // __KERNEL_MODE__
-
-_LIT(KPciLdd, "d_pci.ldd");
-_LIT(KPciLddFactory, "PCI_test_factory");
-_LIT(KPciTest, "PCI Test LDD");
-
-/**
-Test driver op-codes
-*/
-enum TPciTestCmd
-	{
-	EGetTestInfo,
-	EAccessConfigSpace,
-	EAccessMemorySpace,
-	EOpenPciDChunk,
-	EOpenPciPlatHwChunk,
-	EOpenPciMappedChunk,
-	EOpenPciWindowChunk,
-	ERunUnitTests
-	};
-
-/**
-Identifies a PCI Function (device) on the system
-*/
-struct TPciDevice
-	{
-	TPciDevice()
-		:iVendorId(0xFFFFFFFF), iDeviceId(0xFFFFFFFF), iInstance(0) {}
-
-	TPciDevice(TUint aVendorId, TUint aDeviceId, TInt aInstance=0)
-		:iVendorId(aVendorId), iDeviceId(aDeviceId), iInstance(aInstance) {}
-
-	TUint iVendorId;
-	TUint iDeviceId;
-	TInt iInstance; ///< Unit to open (there could be multiple devices on system)
-	};
-
-/**
-Used to send chunk size and recieve
-PCI address
-*/
-struct TPciChunkCreateInfo
-	{
-	TPciChunkCreateInfo()
-		:iSize(0), iPciAddress(NULL)
-		{
-		}
-
-	TPciChunkCreateInfo(TInt aSize, TUint& aPciAddress, TRequestStatus* aStatus=NULL)
-		:iSize(aSize), iPciAddress(&aPciAddress), iStatus(aStatus)
-		{
-		}
-	TInt iSize;
-	TUint* iPciAddress;
-	TRequestStatus* iStatus;
-	};	
-
-/**
-Information about the PSL required by the
-user side test
-*/
-struct TPciTestInfo
-	{
-	TPciDevice iDevice; ///< Probe for this
-
-	/**
-	Supplies the necessary information to test Read, Write, and
-	Modify for a word of PCI memory or configuration space
-	*/
-	struct TAddrSpaceTest
-		{
-		TAddrSpaceTest()
-			:iOffset(0), iExpectedValue(0), iReadOnlyMask(0)
-			{}
-
-		TAddrSpaceTest(TUint aOffset, TUint aExpectedValue, TUint aReadOnlyMask)
-			:iOffset(aOffset), iExpectedValue(aExpectedValue), iReadOnlyMask(aReadOnlyMask)
-			{}
-
-		/**
-		Returns a specified sub byte, or word from the whole dword
-		*/
-		inline TUint Expected(TInt aBitWidth, TInt aExtraOffset) const
-			{
-			//the right shift required to get field to bit 0
-			const TInt shift = 8 *((aExtraOffset + iOffset) % 4);
-			
-			const TUint mask = 0xFFFFFFFF >> (32-aBitWidth);
-			return (iExpectedValue >> shift) & mask;
-			}
-
-		const TUint iOffset;
-		const TUint iExpectedValue; ///< The initial value of word
-		const TUint iReadOnlyMask; ///< Mask of unwritable bits
-		//Future work, memory spaces should state a bar index
-		};
-
-
-	TAddrSpaceTest iCfgSpaceRead;
-	TAddrSpaceTest iCfgSpaceWrite;
-
-	TUint iMemSpaceIndex; ///< Memory space to select
-	TAddrSpaceTest iMemSpaceRead;
-	TAddrSpaceTest iMemSpaceWrite;
-
-	TInt iNumberOfBars; ///< Number of simultaneous mappings into PCI space
-	};
-
-class RPci;
-class TAddrSpace;
-/**
-This class encapsulates all the various read/write/and modify commands
-that can be carried out on a PCI memory space. The command is stored user
-side, and then executed on kernel side when KRun() is called.
-*/
-class TUserPciSpace
-	{
-public:
-	TUserPciSpace()
-		:iPci(NULL), iOperation(EInvalid), iBitWidth(0), iOffset(0),
-		iWriteValue(0), iClearMask(0), iSetMask(0)
-	{}
-	TUserPciSpace(RPci& aPci);
-	
-	/**
-	Perform the encapsulated read/write/or modify
-	@note Only run on kernel side
-	*/
-	TUint KRun(TAddrSpace& aAddrSpace);
-	
-	/**
-	Clone method is required so that multiple threads may
-	have their own copy of a TUserPciSpace (without knowing
-	its runtime type)
-	*/
-	virtual TUserPciSpace* Clone() const = 0;
-
-	TUint Read(TInt aBitWidth, TUint aOffset)
-		{
-		iOffset = aOffset;
-		iOperation = ERead;
-		iBitWidth = aBitWidth;
-
-		return Call();
-		}
-
-	void Write(TInt aBitWidth, TUint aOffset, TUint aValue)
-		{
-		iOffset = aOffset;
-		iOperation = EWrite;
-		iBitWidth = aBitWidth;
-		
-		iWriteValue = aValue;
-		Call();
-		}
-
-	void Modify(TInt aBitWidth, TUint aOffset, TUint aClearMask, TUint aSetMask)
-		{
-		iOffset = aOffset;
-		iOperation = EModify;
-		iBitWidth = aBitWidth;
-
-		iClearMask = aClearMask;
-		iSetMask = aSetMask;
-		Call();
-		}
-
-protected:
-	/**
-	Makes a request to iPci and passes a copy of this object to
-	the kernel side.
-	*/
-	virtual TUint Call() =0;
-
-	enum TOperation {EInvalid, ERead, EWrite, EModify};
-
-	/**
-	Pointer to a PCI device handle
-	*/
-	RPci* iPci;
-
-	TOperation iOperation; //!< Type of access to perform
-	TInt iBitWidth;
-	
-	TUint iOffset;
-	TUint32 iWriteValue;
-	TUint32 iClearMask;
-	TUint32 iSetMask;
-	};
-
-/**
-Grants access to a PCI device's (identified
-by aPci) config space from user side
-*/
-class TUserConfigSpace : public TUserPciSpace
-	{
-public:
-	TUserConfigSpace()
-		:TUserPciSpace()
-		{}
-	TUserConfigSpace(RPci& aPci);
-
-	virtual TUserPciSpace* Clone() const;
-private:
-	TUint Call();
-	};
-
-/**
-Grants access to some region of a PCI
-device's memory space. A PCI device(or function)
-may have up to 8 distinct memory spaces
-*/
-class TUserMemorySpace : public TUserPciSpace
-	{
-public:
-	TUserMemorySpace()
-		:TUserPciSpace(), iBarIndex(-1)
-		{}
-
-	TUserMemorySpace(RPci& aPci, TInt aBarIndex);	
-
-	virtual TUserPciSpace* Clone() const;
-	
-	inline TInt BarIndex() {return iBarIndex;}
-
-private:
-	TUint Call();
-
-	TInt iBarIndex; ///< Each PCI function may have up to 8 memory spaces
-	};
-
-#endif //__TPCI_TEST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/d_powermisctest.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,190 @@
+// Copyright (c) 2006-2009 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:
+//
+// Description:
+// e32test\power\d_powermisctest.cpp
+// 
+//
+
+#include <kernel/kernel.h>
+#include <kernel/kpower.h>
+#include "d_powermisctest.h"
+#include <smppower/idlehelper.h>
+#include "smpidlehandler.h"
+
+#ifdef __SMP__
+NONSHARABLE_CLASS(DTest_SMPIdleHandler) : public DSMPIdleHandler
+    {
+public:
+    DTest_SMPIdleHandler() : DSMPIdleHandler() {};
+    TInt SelfTest()
+    	{
+    	// call unused functions to ensure it is covered in tests
+    	ResetSyncPoints();
+    	return DoEnterIdle(0,0,NULL);
+    	}
+    TBool GetLowPowerMode(TInt aIdleTime, TInt &aLowPowerMode) {return ETrue;}
+    TBool EnterLowPowerMode(TInt aMode, TInt aCpuMask, TBool aLastCpu) {return ETrue;}	
+    };
+#endif
+
+class DTestFactory : public DLogicalDevice
+//
+// Test LDD factory
+//
+	{
+public:
+	DTestFactory();
+	virtual TInt Install(); 
+	virtual void GetCaps(TDes8& aDes) const;
+	virtual TInt Create(DLogicalChannelBase*& aChannel);
+	};
+
+class DTest1 : public DLogicalChannelBase
+//
+// Test logical channel
+//
+	{
+public:
+	virtual ~DTest1();
+protected:
+	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
+
+private:
+	TInt DoTest();
+#ifdef __SMP__
+private:    
+    DTest_SMPIdleHandler* iH;    
+#endif    
+	};
+
+
+
+DECLARE_STANDARD_LDD()
+	{
+	return new DTestFactory;
+	}
+
+//
+// Constructor
+//
+DTestFactory::DTestFactory()
+	{
+
+	}
+
+TInt DTestFactory::Create(DLogicalChannelBase*& aChannel)
+	{
+//
+// Create new channel
+//
+	aChannel=new DTest1;
+	return aChannel?KErrNone:KErrNoMemory;
+	}
+
+TInt DTestFactory::Install()
+//
+// Install the LDD - overriding pure virtual
+//
+	{
+	return SetName(&KLddName);
+	}
+
+void DTestFactory::GetCaps(TDes8& /*aDes*/) const
+//
+// Get capabilities - overriding pure virtual
+//
+	{
+	}
+
+TInt DTest1::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
+//
+// Create channel
+//
+	{
+#ifdef __SMP__
+	iH = new DTest_SMPIdleHandler();
+	TIdleSupport();	
+#endif	
+	return KErrNone;
+	}
+
+DTest1::~DTest1()
+//
+// Destructor
+//
+	{
+#ifdef __SMP__		
+	delete iH;		
+#endif	
+	}
+
+TInt DTest1::Request(TInt aReqNo, TAny* /*a1*/, TAny* /*a2*/)
+	{
+
+	// 'Control' functions...
+	switch(aReqNo)
+		{
+		// DoControl
+		case RLddTest1::ECONTROL_TEST:
+			DoTest();
+			break;
+		}
+
+	return KErrNone;
+	}
+	
+TInt DTest1::DoTest()
+	{
+#ifdef __SMP__	
+	TInt r = KErrNone;
+	
+	// smp idle handler self tests
+	Kern::Printf("smp idle handler self test");
+	iH->SelfTest();
+	
+	// Test GetTimerCount using supplied timer
+	Kern::Printf("test GetTimerCount using supplied timer");
+	TUint32 TimerCount = 10;
+	TIdleSupport::SetupIdleSupport(0, 0, &TimerCount);
+	if(TIdleSupport::GetTimerCount() != 10)
+		{
+		return KErrGeneral;
+		}	
+	// Test GetTimerCount using default timer
+	Kern::Printf("test GetTimerCound using default timer");
+	TIdleSupport::SetupIdleSupport(0, 0, 0);
+	TimerCount = TIdleSupport::GetTimerCount();
+
+	// Test MarkCoreRetired()
+	Kern::Printf("test MarkCoreRetired");
+	TUint32 engagedMask = *(TIdleSupport::EngagedCpusMaskAddr());
+	TIdleSupport::MarkCoreRetired(0x1);
+	if(*(TIdleSupport::EngagedCpusMaskAddr())!= (engagedMask&(~0x1)))
+		{
+		return KErrGeneral;
+		}
+	// Test MarkCoreEngaged()
+	Kern::Printf("test MarkCoreEngaged");
+	TIdleSupport::MarkCoreEngaged(0x1);
+	if(*(TIdleSupport::EngagedCpusMaskAddr())!= (engagedMask|0x1))
+		{
+		return KErrGeneral;
+		}
+	return r;
+#else
+	Kern::Printf("DoTest no supported");
+	return KErrNotSupported;	
+#endif	
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/d_powermisctest.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,46 @@
+// Copyright (c) 2006-2009 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:
+//
+// Description:
+// e32test\power\d_powermisctest.h
+// 
+//
+
+#if !defined(__D_POWERMISCTEST_H__)
+#define __D_POWERMISCTEST_H__
+
+#include <e32cmn.h>
+#ifndef __KERNEL_MODE__
+#include <e32std.h>
+#endif
+
+_LIT(KLddName,"D_POWERMISCTEST.LDD");
+
+class RLddTest1 : public RBusLogicalChannel
+	{
+public:
+	enum TControl
+		{
+		ECONTROL_TEST
+		};
+
+public:
+#ifndef __KERNEL_MODE__
+
+	inline TInt Open()
+		{ return DoCreate(KLddName,TVersion(0,1,1),KNullUnit,NULL,NULL); }
+	inline TInt Test()
+		{ return DoControl(ECONTROL_TEST); }
+
+#endif 
+	};
+#endif   //__D_POWERMISCTEST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/d_powermisctest.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,42 @@
+// Copyright (c) 2006-2009 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:
+//
+// Description:
+// e32test/group/d_lddpowerseqtest.mmp
+// 
+//
+
+#include "kernel/kern_ext.mmh"
+
+TARGET         d_powermisctest.ldd
+TARGETTYPE     LDD
+SOURCEPATH     ../power
+SOURCE         d_powermisctest.cpp
+
+SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
+USERINCLUDE		../../../kernel/eka/include/drivers/smppower/sample_idlehandler
+
+staticlibrary		idlehelper.lib
+staticlibrary		sample_smpidlehandler.lib
+
+EPOCALLOWDLLDATA
+
+UID		0x100000af
+VENDORID 0x70000001
+
+
+capability		all
+
+start wins
+win32_headers
+end
+SMPSAFE
--- a/kerneltest/e32test/power/domainpolicytest.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-//
-
-#include <domainpolicy.h>
-#include "domainpolicytest.h"
-
-const TInt KDomainTimeout = 2000000; /* 2000ms */
-
-static const TDmDomainSpec DomainHierarchy[] = 
-	{
-		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
-
-		// row 1		
-		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-
-		// row 2
-		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		
-		// row 3
-		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-
-		// end of array marker
-		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,	0,	0	}
-	};
-static const TDmHierarchyPolicy HierarchyPolicy	= 
-	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
-	
-
-
-/**
-Gets access to the test hierarchy specification.
-
-The domain hierarchy specification is a simple array of TDmDomainSpec items.
-
-The default implementation provided by Symbian OS just returns a pointer to
-the domain hierarchy specification array.
-
-@return A pointer to the domain hierarchy specification array.
-*/
-EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
-	{
-	return (TDmDomainSpec*) DomainHierarchy;
-	}
-
-
-
-
-/**
-Releases access to the specified domain hierarchy specification.
-
-The domain hierarchy specification is a simple array of TDmDomainSpec items.
-
-As the default Symbian OS implementation of GetDomainSpecs() just returns
-a pointer to the domain hierarchy specification array, then the default
-implementation of Release() is empty. The API is provided to permit
-more complex implementations, if required.
-
-@param aDomainSpec A pointer to the domain hierarchy specification array.
-*/
-EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
-	{
-	}
-
-
-/**
-Retrieves the domain hierarchy policy 
-
-@param	aPolicy a client-supplied policy which on exit
-		will contain a copy of the policy for the requested domain hierarchy id.
-
-  
-@return	KErrNone
-*/
-EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
-	{
-	aPolicy = HierarchyPolicy;
-	return KErrNone;
-	}
-
--- a/kerneltest/e32test/power/domainpolicytest.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2004-2009 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:
-//
-// Description:
-//
-
-#ifndef __DOMAIN_POLICY_TEST_H__
-#define __DOMAIN_POLICY_TEST_H__
-
-// The test domain hierarchy id 
-
-static const TDmHierarchyId	KDmHierarchyIdTest = 99;
-
-/*
-Domains defined in this hiearchy
-The hierarchy desribed here looks like this:
-		Root
-		A				B				C
-		AA	AB			BA				CA
-			ABA	ABB						CAA
-
-*/
-static const TDmDomainId	KDmIdTestA		= 0x02;
-static const TDmDomainId	KDmIdTestB		= 0x03;
-static const TDmDomainId	KDmIdTestC		= 0x04;
-
-static const TDmDomainId	KDmIdTestAA		= 0x05;
-static const TDmDomainId	KDmIdTestAB		= 0x06;
-static const TDmDomainId	KDmIdTestBA		= 0x07;
-static const TDmDomainId	KDmIdTestCA		= 0x08;
-
-static const TDmDomainId	KDmIdTestABA	= 0x09;
-static const TDmDomainId	KDmIdTestABB	= 0x0A;
-static const TDmDomainId	KDmIdTestCAA	= 0x0B;
-static const TInt KTestDomains = 0x0B;	// number of domains including root
-
-
-/*
-System-wide start-up states
-
-Some of these states may be ommitted depending on the start-up mode.
-E.g. The system-starter might choose to omit EStartupNonCritical in "safe" mode
-*/
-enum TStartupState
-	{
-	/** In this state, all ROM based (static) components or resources that 
-	are critical to the operation of the phone are started */
-	EStartupCriticalStatic,
-
-	/** In this state, all non-ROM based (dynamic) components or resources that 
-	are critical to the operation of the phone are started */
-	EStartupCriticalDynamic,
-
-	/** In this state, all ROM based (static) or non-ROM based (dynamic) 
-	components or resources that are not critical to the operation of the phone 
-	are started */
-	EStartupNonCritical,
-
-	/** An integer that is strictly greater thean any legal start-up state value */
-	EStartupLimit
-	};
-
-#endif
-
--- a/kerneltest/e32test/power/t_domain.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2300 +0,0 @@
-// Copyright (c) 2002-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:
-//
-// Description:
-// e32test\power\t_domain.cpp
-// Overview:
-// Domain manager tests
-// API Information:
-// RDmDomain, RDmDomainManager CDmDomain, CDmDomainManager
-// Details:
-// - Test a variety of domain transitions, check the expected number of
-// notifications and the first expected ordinal. Verify results are
-// as expected.
-// - Test system standby, check the expected number of notifications and 
-// the first expected ordinal. Use a timer to request a wakeup event.
-// Verify results are as expected.
-// - Test domain related simple error situations, verify results are
-// as expected.
-// - Perform platform security tests: launch a separate process with no 
-// capabilities, verify that results are as expected.
-// - Test domain transitions by connecting to two domain hierarchies 
-// simultaneously, add some test and power hierarchy members, verify
-// the expected target state, notifications and leaf nodes. Verify results.
-// - Verify that the same hierarchy can not be connected to more than once.
-// - Request a positive transition and request that the test domain use 
-// ETraverseParentsFirst. Verify results are as expected and verify 
-// domains are in the correct state.
-// - Request a negative transition and request that the test domain use 
-// ETraverseChildrenFirst. Verify results are as expected.
-// - Request a positive transition with zero acknowledgements. Verify 
-// results are as expected.
-// - Request a positive transition with error acknowledgements. Verify 
-// results are as expected.
-// - Perform a variety of negative tests and verify results are as expected.
-// - Perform various tests on domain transitions with activated observer.
-// Verify results are as expected.
-// Platforms/Drives/Compatibility:
-// All.
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-
-#include <e32test.h>
-#include <domainmember.h>
-#include <domainmanager.h>
-#include <domainobserver.h>
-#include "domainpolicytest.h"
-#include <e32debug.h>
-#include <f32file.h>
-#include <e32ldr.h>
-#include <e32ldr_private.h>
-
-LOCAL_D RTest test(_L(" T_DOMAIN "));
-_LIT(KThreadName, "t_domain_panic_thread");
-
-#ifdef _DEBUG
-#define __PRINT(x) {RDebug::Print x;}
-#else
-#define __PRINT(x) 
-#endif
-
-class CDmTestMember;
-
-// interface for test domain memebers.
-// Any test memeber should derive from this interface 
-class MDmDomainMember
-	{
-public:
-	virtual TDmHierarchyId HierarchyId() = 0;
-	virtual TDmDomainId	DomainId() = 0;
-	virtual TDmDomainState State() = 0;
-	virtual TInt Status() = 0;
-	virtual TUint32 Ordinal() = 0;
-	virtual TInt Notifications() = 0;
-	};
-
-class MDmTest
-	{
-public:
-	virtual void Perform() = 0;
-	virtual void Release() = 0;
-	virtual TInt TransitionNotification(MDmDomainMember& aDomainMember) = 0;
-	virtual void TransitionRequestComplete() = 0;
-	};
-
-// for the test hierarchy, we generate an ordinal for each domain
-// each byte of which describes the exact location of the domain in the hierarchy
-#define ORDINAL_FROM_DOMAINID0(id) (id)
-#define ORDINAL_FROM_DOMAINID1(parent, id) ((parent << 8) | (id))
-#define ORDINAL_FROM_DOMAINID2(grandparent, parent, id) ((grandparent << 16) | (parent << 8) | id)
-#define ORDINAL_FROM_DOMAINID3(greatgrandparent, grandparent, parent, id) ((greatgrandparent << 24) | (grandparent << 16) | (parent << 8) | id)
-#define PARENT_ORDINAL(id) (id >> 8)
-
-#define ORDINAL_LEVEL(ordinal)			\
-	((ordinal & 0xFF00) == 0) ? 1 :			\
-	((ordinal & 0xFF0000) == 0) ? 2 :		\
-	((ordinal & 0xFF000000) == 0) ? 3 : 4;
-
-
-// get the least significant domain id character (for debugging purposes)
-TBool GetDomainChar(TDmDomainId aDomainId, TChar& aChar)
-	{
-	TBool found = ETrue;
-	switch(aDomainId)
-		{
-		
-		case KDmIdTestA:	aChar = 'A'; break;
-		case KDmIdTestB:	aChar = 'B'; break;
-		case KDmIdTestC:	aChar = 'C'; break;
-		case KDmIdTestAA:	aChar = 'A'; break;
-		case KDmIdTestAB:	aChar = 'B'; break;
-		case KDmIdTestBA:	aChar = 'A'; break;
-		case KDmIdTestCA:	aChar = 'A'; break;
-		case KDmIdTestABA:	aChar = 'A'; break;
-		case KDmIdTestABB:	aChar = 'B'; break;
-		case KDmIdTestCAA:	aChar = 'A'; break;
-		// domain char not found 
-		case KDmIdNone:
-		case KDmIdRoot:		
-		default:			
-			found = EFalse;
-		}
-	return found;
-	}
-
-// prints the 4-character domain string into the passed descriptor (for debugging purposes)
-// e.g. "CAA" for KDmIdTestCAA
-void GetDomainDesc(TUint32 aOrdinal, TDes& aDes)
-	{
-	if (aOrdinal == KDmIdRoot)
-		{
-		aDes.Append(_L("root"));
-		return;
-		}
-
-	TUint32 val =  aOrdinal;
-
-	for (TInt n=0; n<4; n++)
-		{
-		TDmDomainId domainId = (TDmDomainId) (val >> 24);
-		TChar ch;
-		TBool found = GetDomainChar(domainId, ch);
-		if (found)
-			aDes.Append(ch);
-		val = val << 8;
-		}
-
-	}
-
-
-class CDmTestMember : public CActive, public MDmDomainMember
-	{
-public:	
-	// from CActive
-	void RunL();
-	// from MDmDomainMember
-	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
-	inline TDmDomainId	DomainId() {return iId;};
-	inline TDmDomainState State() {return iState;};
-	inline TInt Status() {return iStatus.Int();};
-	inline TUint32 Ordinal() {return iOrdinal;};
-	inline TInt Notifications() {return iNotifications;};
-
-	CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-	~CDmTestMember();
-	void Acknowledge();
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-
-public:
-	TDmHierarchyId iHierarchy;
-	TDmDomainId	iId;
-	TDmDomainState iState;
-	TUint32		iOrdinal;
-	MDmTest*	iTest;	
-	TInt		iNotifications;
-	RDmDomain	iDomain;
-	};
-
-
-
-CDmTestMember::CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : CActive(CActive::EPriorityStandard), 
-	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
-	{
-	TInt r;
-
-	if (iHierarchy == KDmHierarchyIdPower)
-		 r = iDomain.Connect(iId);
-	else
-		 r = iDomain.Connect(iHierarchy, iId);
-
-	test(r == KErrNone);
-
-	CActiveScheduler::Add(this);
-
-	iDomain.RequestTransitionNotification(CActive::iStatus);
-	CActive::SetActive();
-	}
-
-CDmTestMember::~CDmTestMember()
-	{
-	CActive::Cancel();
-	iDomain.Close();
-	}
-
-void CDmTestMember::Acknowledge()
-	{
-	iDomain.AcknowledgeLastState();
-	}
-
-void CDmTestMember::RunL()
-	{
-
-	iNotifications++;
-
-	iState = iDomain.GetState();
-
-	TInt ackError = iTest->TransitionNotification(*this);
-	if (ackError == KErrNone)
-		iDomain.AcknowledgeLastState();
-	else if (ackError == KErrAbort)	// don't acknowledge
-		;
-	else
-		iDomain.AcknowledgeLastState(ackError);
-
-	
-	// request another notification (even if we didn't acknowledge the last one)
-	iDomain.RequestTransitionNotification(CActive::iStatus);
-	CActive::SetActive();
-	}
-
-void CDmTestMember::DoCancel()
-	{
-	iDomain.CancelTransitionNotification();
-	}
-
-
-// CDomainMemberAo
-class CDomainMemberAo : public CDmDomain, public MDmDomainMember
-	{
-public:	
-	static CDomainMemberAo* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-	~CDomainMemberAo();
-
-	// from CActive
-	void RunL();
-
-	// from MDmDomainMember
-	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
-	inline TDmDomainId	DomainId() {return iId;};
-	inline TDmDomainState State() {return iState;};
-	inline TInt Status() {return iStatus.Int();};
-	inline TUint32 Ordinal() {return iOrdinal;};
-	inline TInt Notifications() {return iNotifications;};
-
-private:
-	CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-
-public:
-	TDmHierarchyId iHierarchy;
-	TDmDomainId	iId;
-	TDmDomainState iState;
-	TUint32		iOrdinal;
-	MDmTest*	iTest;	
-	TInt		iNotifications;
-	};
-
-CDomainMemberAo* CDomainMemberAo::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest)
-	{
-	CDomainMemberAo* self=new (ELeave) CDomainMemberAo(aHierarchy, aId, aOrdinal, aTest);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-
-	self->RequestTransitionNotification();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-CDomainMemberAo::CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : 
-	CDmDomain(aHierarchy, aId), 
-	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
-	{
-	}
-
-CDomainMemberAo::~CDomainMemberAo()
-	{
-	Cancel();
-	}
-
-void CDomainMemberAo::RunL()
-	{
-	iNotifications++;
-
-	iState = GetState();
-
-	TInt ackError = iTest->TransitionNotification(*this);
-	if (ackError == KErrNone)
-		AcknowledgeLastState(ackError);
-	else if (ackError == KErrAbort)	// don't acknowledge
-		;
-	else
-		AcknowledgeLastState(ackError); 
-	if (ackError != KErrAbort)	
-		AcknowledgeLastState(ackError);
-
-	
-	// request another notification (even if we didn't acknowledge the last one)
-	RequestTransitionNotification();
-	}
-
-
-// CDomainManagerAo
-class CDomainManagerAo : public CDmDomainManager
-	{
-public:	
-	~CDomainManagerAo();
-	static CDomainManagerAo* NewL(TDmHierarchyId aHierarchy, MDmTest& aTest);
-
-	// from CActive
-	void RunL();
-
-private:
-	CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest);
-
-private:
-	MDmTest& iTest;
-	};
-
-
-CDomainManagerAo* CDomainManagerAo::NewL(TDmHierarchyId aHierarchy, MDmTest& aTest)
-	{
-	CDomainManagerAo* self=new (ELeave) CDomainManagerAo(aHierarchy, aTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-
-CDomainManagerAo::CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest) : 
-	CDmDomainManager(aHierarchy), iTest(aTest)
-	{
-	}
-
-CDomainManagerAo::~CDomainManagerAo()
-	{
-	}
-
-void CDomainManagerAo::RunL()
-	{
-	iTest.TransitionRequestComplete();
-	}
-
-
-class CDmTest1 : public CActive, public MDmTest
-	{
-public: // from CActive
-	void RunL();
-
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-
-	CDmTest1 (TDmDomainId aId, TDmDomainState aState) : CActive(CActive::EPriorityStandard), iDomainId(aId), iState((TPowerState) aState) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	enum { KMembersMax = 16 };
-	CDmTestMember*		iMembers[KMembersMax]; 
-	RDmDomainManager	iManager;
-	TDmDomainId			iDomainId;
-	TPowerState			iState;
-	TBool				iAcknowledge;
-	TInt				iMembersCount;
-	TInt				iCount;
-	TUint32				iOrdinal;
-	};
-
-void CDmTest1::Perform()
-	{
-	//
-	// Test domain transitions
-	//
-
-	test.Next(_L("Test 1"));
-	test.Printf(_L("Domain id = 0x%x Target State = 0x%x\n"), iDomainId, iState);
-	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[0] != NULL);
-	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[1] != NULL);
-	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[2] != NULL);
-	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[3] != NULL);
-	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[4] != NULL);
-	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[5] != NULL);
-	
-	// expected number of notifications
-	iMembersCount = (iDomainId == KDmIdRoot) ? 6 : 2;
-	// first expected ordinal
-	iOrdinal = (iState == EPwActive) ? 0 : 1;
-
-	TInt r = iManager.Connect();
-	test(r == KErrNone);
-
-	CActiveScheduler::Add(this);
-
-	iManager.RequestDomainTransition(iDomainId, iState, CActive::iStatus);
-	CActive::SetActive();
-
-	CActiveScheduler::Start();
-	}
-
-TInt CDmTest1::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	++iCount;
-	if (aDomainMember.State() == EPwActive)
-		{
-		if(aDomainMember.Ordinal() < iOrdinal)
-			{
-			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
-			iCount--;
-			}
-		}
-	else
-		{
-		if(aDomainMember.Ordinal() > iOrdinal)
-			{
-			//Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
-			iCount--;
-			}
-		}
-	iOrdinal = aDomainMember.Ordinal();
-
-	// acknowledge one from two
-	iAcknowledge = !iAcknowledge;
-	return iAcknowledge?KErrNone:KErrGeneral;
-	}
-
-void CDmTest1::RunL()
-	{
-	CActiveScheduler::Stop();
-
-	iManager.Close();
-
-	CDmTestMember** mp;
-	for (mp = iMembers; *mp; ++mp)
-		delete *mp;
-	test(iCount == iMembersCount);
-	}
-
-void CDmTest1::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest1::Release()
-	{
-	delete this;
-	}
-
-class CDmTest2Timer : public CTimer
-	{
-public: // fomr CTimer
-   void RunL();
-public:
-	CDmTest2Timer() : CTimer(0) 
-		{
-		TRAPD(r,
-			ConstructL());
-		test(r == KErrNone);
-		CActiveScheduler::Add(this);
-		}
-	};
-
-void CDmTest2Timer::RunL()
-	{
-	test.Printf(_L("Tick count after CDmTest2Timer::RunL() = %d\n"), User::NTickCount());
-
-	// kick the timer again in case power down hasn't happened yet
-	TTime wakeup;
-	wakeup.HomeTime();
-	wakeup += TTimeIntervalSeconds(3);
-	At(wakeup);
-	}
-
-class CDmTest2 : public CActive, public MDmTest
-	{
-public: // from CActive
-	void RunL();
-
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-	CDmTest2 (TDmDomainState aState) : CActive(CActive::EPriorityStandard), iState((TPowerState) aState) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	enum { KMembersMax = 16 };
-	CDmTestMember*		iMembers[KMembersMax]; 
-	RDmDomainManager	iManager;
-	TPowerState			iState;
-	TBool				iAcknowledge;
-	TInt				iMembersCount;
-	TInt				iCount;
-	TUint32				iOrdinal;
-	CDmTest2Timer*		iTimer;
-	};
-
-
-void CDmTest2::Perform()
-	{
-	//
-	// Test system standby
-	//
-
-	test.Next(_L("Test 2"));
-	test.Printf(_L("Target State = 0x%x\n"), iState);
-	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[0] != NULL);
-	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[1] != NULL);
-	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[2] != NULL);
-	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[3] != NULL);
-	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[4] != NULL);
-	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[5] != NULL);
-	
-	// expected number of notifications
-	iMembersCount = 12;
-	// first expected ordinal
-	iOrdinal = (iState == EPwActive) ? 0 : 1;
-
-	TInt r = iManager.Connect();
-	test(r == KErrNone);
-
-	CActiveScheduler::Add(this);
-
-	// Use an absolute timer to request a wakeup event
-	iTimer = new CDmTest2Timer();
-	TTime wakeup;
-	wakeup.HomeTime();
-	wakeup += TTimeIntervalSeconds(5);
-	test.Printf(_L("Tick count before timer = %d\n"), User::NTickCount());
-	iTimer->At(wakeup);
-	
-	iManager.RequestSystemTransition(iState, CActive::iStatus);
-	CActive::SetActive();
-
-	CActiveScheduler::Start();
-	}
-
-TInt CDmTest2::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	++iCount;
-	if (aDomainMember.State() == EPwActive)
-		{
-		if(aDomainMember.Ordinal() < iOrdinal)
-			{
-			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State : %d"), 
-																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
-			iCount--;
-			}
-		}
-	else
-		{
-		if(aDomainMember.Ordinal() > iOrdinal)
-			{
-			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State: %d"), 
-																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
-			iCount--;
-			}
-		}
-	iOrdinal = aDomainMember.Ordinal();
-
-	// acknowledge one from two
-	iAcknowledge = !iAcknowledge;
-	return iAcknowledge?KErrNone:KErrAbort;
-	}
-
-void CDmTest2::RunL()
-	{
-	test.Printf(_L("Tick count after CDmTest2::RunL() = %d\n"), User::NTickCount());
-
-	iTimer->Cancel();	
-	CActiveScheduler::Stop();
-
-	iManager.Close();
-
-	CDmTestMember** mp;
-	for (mp = iMembers; *mp; ++mp)
-		delete *mp;
-	test(CActive::iStatus == KErrTimedOut);
-	test(iCount == iMembersCount);
-	}
-
-void CDmTest2::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest2::Release()
-	{
-	if (iTimer)
-		{
-		iTimer->Cancel();
-		delete iTimer;
-		}
-	delete this;
-	}
-
-class CDmTest3 : public MDmTest
-	{
-public: 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-	};
-
-void CDmTest3::Perform()
-	{
-	//
-	// Test simple error situation
-	//
-	RDmDomainManager manager;
-	TInt r = manager.Connect();
-	test(r == KErrNone);
-
-	RDmDomainManager manager1;
-	r = manager1.Connect();
-	test(r == KErrInUse);
-
-	RDmDomain domain;
-	r = domain.Connect(KDmIdNone);
-	test(r == KDmErrBadDomainId);
-	CDmTestMember*		testMember;
-	testMember = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test (testMember != NULL);
-
-	TRequestStatus status;
-	manager.RequestDomainTransition(KDmIdApps, EPwStandby, status);
-	test(status.Int() == KRequestPending);
-
-	TRequestStatus status1;
-	manager.RequestDomainTransition(KDmIdApps, EPwActive, status1);
-	User::WaitForRequest(status1);
-	test(status1.Int() == KDmErrBadSequence);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrTimedOut);
-
-	// Since this test doesn't start the active scheduler, a domain member's RunL() will 
-	// not get called so we need to re-request a domain transition notification manually
-	User::WaitForRequest(testMember->iStatus);
-	test(testMember->iStatus.Int() == KErrNone);
-	testMember->iDomain.RequestTransitionNotification(testMember->iStatus);
-
-	manager.RequestDomainTransition(KDmIdApps, EPwActive, status);
-	test(status.Int() == KRequestPending);
-	manager.CancelTransition();
-	test(status.Int() == KErrCancel);
-	manager.CancelTransition();
-	User::WaitForRequest(status);
-	test(status.Int() == KErrCancel);
-
-	testMember->iDomain.CancelTransitionNotification();
-
-	delete testMember;
-	
-	domain.Close();
-	manager.Close();
-	}
-
-TInt CDmTest3::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
-	{
-	test(0);
-	return KErrAbort;	// don't acknowledge
-	}
-
-void CDmTest3::Release()
-	{
-	delete this;
-	}
-
-class CDmTest4 : public MDmTest
-	{
-public: 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-private:
-	void ExecSlave(TUint arg);
-	};
-
-_LIT(KSecuritySlavePath, "t_domain_slave.exe");
-
-void CDmTest4::ExecSlave(TUint aArg)
-	{
-	RProcess proc;
-	TInt r = proc.Create(KSecuritySlavePath, TPtrC((TUint16*) &aArg, sizeof(aArg)/sizeof(TUint16)));
-	test(r == KErrNone);
-	TRequestStatus status;
-	proc.Logon(status);
-	proc.Resume();
-	User::WaitForRequest(status);
-
-    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitType %d", aArg, proc.ExitType() );
-    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitReason %d", aArg, proc.ExitReason() );
-	test(proc.ExitType() == EExitKill);
-//	test(proc.ExitReason() == KErrPermissionDenied);
-
-	CLOSE_AND_WAIT(proc);
-	}
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-4
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Dmain manager security tests
-//! @SYMREQ 3722
-//! @SYMTestActions Launches a separate process with no capabilities
-//! @SYMTestExpectedResults  DM APIs should fail with KErrPermissionDenied
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest4::Perform()
-	{
-	//
-	// Security tests
-	//
-
-	ExecSlave(0);
-
-    ExecSlave(1);
-
-	}
-
-TInt CDmTest4::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
-	{
-	test(0);
-	return KErrNone;
-	}
-
-void CDmTest4::Release()
-	{
-	delete this;
-	}
-
-// Test hierarchy tests
-class CDmTestStartupMember : public CDmTestMember
-	{
-public:
-	CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-
-public:
-private:
-	};
-
-CDmTestStartupMember::CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) 
-	: CDmTestMember(aHierarchy, aId, aOrdinal, aTest)
-	{
-	}
-
-// Simultaneously testing of test domain defined in DomainPolicy99.dll
-// and the power domain defined in DomainPolicy.dll
-class CDmTest5 : public CActive, public MDmTest
-	{
-public: 
-	// from CActive
-	void RunL();
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete();	
-	void RunTestOnGetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailure);
-	
-	CDmTest5(TDmDomainId aPowerId, TDmDomainId aTestId, TDmDomainState aPowerState, TDmDomainState aTestState) : 
-		CActive(CActive::EPriorityStandard), 
-		iPowerDomainId(aPowerId), iTestDomainId(aTestId), iPowerState(aPowerState), iTestState(aTestState) {}
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	enum { KMembersMax = 16 };
-	enum TAckMode{ KAckAlways, KAckNever, KAckError, KAckOddDomainsOnly };
-
-	CDmTestMember*		iTestMembers[KMembersMax]; 
-	CDomainMemberAo*	iPowerMembers[KMembersMax]; 
-
-	RDmDomainManager	iTestDomainManager;
-	
-	TDmDomainId			iPowerDomainId;
-	TDmDomainId			iTestDomainId;
-
-	TDmDomainState		iPowerState;
-	TDmDomainState		iTestState;
-
-	// level number for iTestDomainId. E.g 1 for KDmIdRoot, 2 for KDmIdTestA, etc.
-	TInt				iTestDomainLevel;	
-
-	TDmTraverseDirection iTraverseDirection;
-
-	TAckMode			iAckMode;
-
-public:
-	TInt				iTestNotifications;
-	TInt				iPowerNotifications;
-	TInt				iTestNotificationsExpected;
-	TInt				iPowerNotificationsExpected;
-
-	TInt				iTransitionsCompleted;
-	TInt				iTransitionsExpected;
-	};
-
-void CDmTest5::RunTestOnGetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailure)
-	{
-	//*************************************************
-	// Test - OOM Testing on GetTransitionFailures()
-	// Simulates heap failure in GetTransitionFailures()
-	//*************************************************
-	TInt error = 0;
-	TInt count = 0;	
-	do
-		{		
-		__UHEAP_SETFAIL(RHeap::EFailNext, ++count);
-		error = iTestDomainManager.GetTransitionFailures(aTransitionFailure);						
-		test.Printf( _L( "CDmTest5::RunTestOnGetTransitionFailures, simulating heap failure on GetTransitionFailures(), Error=%d, Run=%d\n" ), error, count );
-		}while(error == KErrNoMemory);		
-		
-	__UHEAP_RESET;
-	
-	//Actual count of heap failure as the final iteration which terminates the loop would not return KErrNoMemory 
-	--count;
-	test(count > 0);
-	test.Printf( _L( "Out of memory tests on GetTransitionFailures() succeeded at heap failure rate of %i\n" ), count );
-	}
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-5
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Connects to two domain hierarchies simulteneously and perform various tests
-//! @SYMREQ 3704,3705,3706,3707,3708,3709,3710,3711,3720,3721,3724,3725,3726,3727
-//! @SYMTestActions Open two hiearchies simultaneously and perform various actions.
-//! @SYMTestExpectedResults  All tests should pass
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest5::Perform()
-	{
-
- 	__UHEAP_MARK;
-
-	//
-	// Test domain transitions
-	//
-	CActiveScheduler::Add(this);
-
-	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
-
-    RDebug::Printf("RDmDomainManager::AddDomainHierarchy returns %d", r );
-
-	test(r == KErrNone);
-
-	CDomainManagerAo* powerDomainManager = NULL;
-	TRAP(r, powerDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdPower, *this));
-	test (powerDomainManager != NULL);
-
-	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdPower);
-	test(r == KErrNone);
-
-	//*************************************************
-	//	Test 5a - connect to two domain hierarchies simultaneously
-	//*************************************************
-	test.Next(_L("Test 5a - connect to two domain hierarchies simultaneously"));
-
-	test.Printf(_L("Domain id = 0x%x, Target State = 0x%x\n"), iTestDomainId, iTestState);
-
-	TInt testMemberCount = 0;
-
-	// Add some test hierarchy members - these use the RDmDomain API
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 1
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row2
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 3
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-
-	// add some power hierarchy members - these use the CDmDomain AO API
-	TInt powerMemberCount = 0;
-	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdRoot, KDmIdRoot, this));
-	test(iTestMembers[powerMemberCount++] != NULL);
-	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdApps, KDmIdApps, this));
-	test(iTestMembers[powerMemberCount++] != NULL);
-	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdUiApps, KDmIdUiApps, this));
-	test(iTestMembers[powerMemberCount++] != NULL);
-
-
-	RArray<const TTransitionFailure> testFailures;
-	TInt testFailureCount;
-	RArray<const TTransitionFailure> powerFailures;
-	TInt powerFailureCount;
-
-
-
-	// calculate the expected number of notifications
-	TInt expectedTestNotifications = 0;
-	TInt leafNodes = 0;
-	
-
-	// work out the domain level, the number of leaf nodes and the expected number of 
-	// notifications for the domain that is being transitioned
-	switch(iTestDomainId)
-		{
-		case KDmIdRoot		:	iTestDomainLevel = 1; leafNodes = 5; expectedTestNotifications = testMemberCount; break;
-		case KDmIdTestA		:	iTestDomainLevel = 2; leafNodes = 3; expectedTestNotifications = 5; break;
-		case KDmIdTestB		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 2; break;
-		case KDmIdTestC		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 3; break;
-
-		case KDmIdTestAA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestAB	:	iTestDomainLevel = 3; leafNodes = 2; expectedTestNotifications = 3; break;
-		case KDmIdTestBA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestCA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 2; break;
-
-		case KDmIdTestABA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestABB	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestCAA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
-		default:
-			test(0);
-		}
-	test.Printf(_L("Test Domain id = 0x%x, Level = %d, Target State = 0x%x, expected notifications = %d, leafNodes = %d\n"), 
-		iTestDomainId, iTestDomainLevel, iTestState, expectedTestNotifications, leafNodes);
-
-	TInt expectedPowerNotifications = 0;
-	switch(iPowerDomainId)
-		{
-		case KDmIdRoot		:	expectedPowerNotifications = powerMemberCount; break;
-		case KDmIdApps		:	expectedPowerNotifications = 1; break;
-		case KDmIdUiApps	:	expectedPowerNotifications = 1; break;
-		default:
-			test(0);
-		}
-
-
-
-	// connect to the test hierarchy
-	r = iTestDomainManager.Connect(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	// verify that we can't connect to the same hierarchy more than once
-	RDmDomainManager	domainManager;
-	r = domainManager.Connect(KDmHierarchyIdTest);
-	test(r == KErrInUse);
-
-
-
-	//*************************************************
-	// Test 5b - request a positive transition
-	// issue a positive  transition (i.e. transition state increases)
-	// and request that the test domain use ETraverseParentsFirst
-	//*************************************************
-	test.Next(_L("Test 5b - request a positive transition"));
-	iAckMode = KAckAlways;
-
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = 0;
-	iTestNotificationsExpected = expectedTestNotifications;
-	iTransitionsExpected = 1;
-
-	// DON'T request any domain transition on the power hierarchy
-	// powerDomainManager->RequestDomainTransition(iPowerDomainId, EPwActive);
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseParentsFirst;
-	if (iTestDomainId == KDmIdRoot)
-		iTestDomainManager.RequestSystemTransition(iTestState, ETraverseDefault, CActive::iStatus);
-	else
-		iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault, CActive::iStatus);
-	CActive::SetActive();
-
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrNone);
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-
-	//*************************************************
-	// Test 5c- verify domains are in correct state
-	//*************************************************
-	test.Next(_L("Test 5c- verify domains are in correct state"));
-	RDmDomain domainMember;
-	r = domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
-	test (r == KErrNone);
-	TDmDomainState state = domainMember.GetState();
-	domainMember.Close();
-	test (state == iTestState);
-
-	// if the transition request is not on the root, verify that that 
-	// the root domain and the transition domain are in different states
-	if (iTestDomainId != KDmIdRoot && iTestState != EStartupCriticalStatic)
-		{
-		r = domainMember.Connect(KDmHierarchyIdTest, KDmIdRoot);
-		test (r == KErrNone);
-		TDmDomainState state = domainMember.GetState();
-		domainMember.Close();
-		test (state != iTestState);
-		}
-
-
-	//*************************************************
-	// Test 5d- request a negative transition
-	// issue a negative transition (i.e. transition state decreases)
-	// and request that the test domain use ETraverseChildrenFirst
-	//*************************************************
-	test.Next(_L("Test 5d- request a negative transition"));
-	iAckMode = KAckAlways;
-	iTestState--;	// EStartupCriticalStatic;
-	iPowerState--;	// EPwStandby
-
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = expectedPowerNotifications;
-	iTestNotificationsExpected = expectedTestNotifications;
-	iTransitionsExpected = 2;
-
-	// DO request a domain transition on the power hierarchy
-	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
-
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseChildrenFirst;
-	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
-	CActive::SetActive();
-
-	// wait for all test & power transitions to complete
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrNone);
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-	
-
-	//*************************************************
-	// Test 5e- request a positive transition, with zero acknowledgements
-	// issue a positive transition with no members acknowledging the transition
-	//*************************************************
-	test.Next(_L("Test 5e- request a positive transition, with zero acknowledgements"));
-	iAckMode = KAckNever;
-	iTestState++;		// EStartupCriticalDynamic;
-	iPowerState++;		// EPwActive
-
-	// power hierarchy should continue on failure, so we all power domains should transition
-	// test hierarchy should stop on failure, so should get notifications from all leaf nodes
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = expectedPowerNotifications;
-	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
-	iTransitionsExpected = 2;
-
-	// DO request a domain transition on the power hierarchy
-	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
-
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseChildrenFirst;
-	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
-	CActive::SetActive();
-
-	// wait for all test & power transitions to complete
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrTimedOut);
-	test(iStatus == KErrTimedOut);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-	
-	// get the failures on the test hierarchy
-	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
-	test (testFailureCount == 1);
-
-#ifdef _DEBUG
-	//***************************************************************
-	// OOM Testing: Simulates heap failure in GetTransitionFailures()
-	//***************************************************************
-	__UHEAP_MARK;
-	RArray<const TTransitionFailure> oomTestFailures;
-	RunTestOnGetTransitionFailures(oomTestFailures);
-	test(oomTestFailures.Count()==1);
-	oomTestFailures.Close();
-	__UHEAP_MARKEND;
-#endif
-	
-	r = iTestDomainManager.GetTransitionFailures(testFailures);
-	test(r == KErrNone);
-	test(testFailureCount == testFailures.Count());
-
-	test.Printf(_L("Test failures = %d\n"), testFailureCount);
-	TInt i;
-	for (i=0; i<testFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, testFailures[i].iDomainId, testFailures[i].iError);
-		test(testFailures[i].iError == KErrTimedOut);
-		}
-
-	// get the failures on the power hierarchy
-	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
-	test (powerFailureCount == expectedPowerNotifications);
-
-	r = powerDomainManager->GetTransitionFailures(powerFailures);
-	test(r == KErrNone);
-	test(powerFailureCount == powerFailures.Count());
-
-	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
-	for (i=0; i<powerFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, powerFailures[i].iDomainId, powerFailures[i].iError);
-		test(powerFailures[i].iError == KErrTimedOut);
-		}
-
-	
-	//*************************************************
-	// Test 5f- request a positive transition, with error acknowledgements
-	// issue a positive transition with all members nack'ing the transition
-	//*************************************************
-	test.Next(_L("Test 5f- request a positive transition, with error acknowledgements"));
-	iAckMode = KAckError;
-	iTestState++;		
-	iPowerState++;		
-
-	// power hierarchy should continue on failure, so all power domains should transition
-	// test hierarchy should stop on failure, so should get notifications from 
-	// anything from 1 to all the leaf nodes
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = expectedPowerNotifications;
-	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
-	iTransitionsExpected = 2;
-
-	// DO request a domain transition on the power hierarchy
-	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
-
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseChildrenFirst;
-	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
-	CActive::SetActive();
-
-	// wait for all test & power transitions to complete
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrGeneral);
-	test(iStatus == KErrGeneral);
-	test(iTestNotifications <= iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-	
-	// get the failures on the test hierarchy
-	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
-	test (testFailureCount == 1);
-
-	r = iTestDomainManager.GetTransitionFailures(testFailures);
-	test(r == KErrNone);
-	test(testFailureCount == testFailures.Count());
-
-	test.Printf(_L("Test failures = %d\n"), testFailureCount);
-	for (i=0; i<testFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, testFailures[i].iDomainId, testFailures[i].iError);
-		test(testFailures[i].iError == KErrGeneral);
-		}
-
-	// get the failures on the power hierarchy
-	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
-	test (powerFailureCount == expectedPowerNotifications);
-
-	r = powerDomainManager->GetTransitionFailures(powerFailures);
-	test(r == KErrNone);
-	test(powerFailureCount == powerFailures.Count());
-
-	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
-	for (i=0; i<powerFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, powerFailures[i].iDomainId, powerFailures[i].iError);
-		test(powerFailures[i].iError == KErrGeneral);
-		}
-
-	
-	// cleanup
-
-	testFailures.Reset();
-	powerFailures.Reset();
-
-	iTestDomainManager.Close();
-	delete powerDomainManager;
-	powerDomainManager = NULL;
-
-	CDmTestMember** mt;
-	for (mt = iTestMembers; *mt; ++mt)
-		delete *mt;
-
-	CDomainMemberAo** mp;
-	for (mp = iPowerMembers; *mp; ++mp)
-		delete *mp;
-
-
-	// restore the domain hierarchies to their initial state so as not to 
-	// upset any subsequent tests which rely on this
-	{
-	RDmDomainManager manager;
-	TInt r = manager.Connect();
-	test (r == KErrNone);
-	TRequestStatus status;
-	manager.RequestDomainTransition(KDmIdRoot, EPwActive, status);
-	test(status.Int() == KRequestPending);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrNone);
-	manager.Close();
-	
-	r = manager.Connect(KDmHierarchyIdTest);
-	test (r == KErrNone);
-	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
-	test(status.Int() == KRequestPending);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrNone);
-	manager.Close();
-	}
-
- 	__UHEAP_MARKEND;
-	}
-
-// This handles a transition notification from either a power domain member or 
-// a test domain member.
-// Verifies that the domain state is as expected.
-// Updates the number of notifications for each hierarchy and verifies that all parent 
-// domains have transitioned already (for parent-to-child transitions) or that all child 
-// domains have been transitioned already (for child-to-parent transitions).
-
-TInt CDmTest5::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
-		iPowerNotifications++;
-	else
-		iTestNotifications++;
-
-	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
-		{
-		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-			aDomainMember.HierarchyId(), aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
-		test(aDomainMember.State() == iPowerState);
-		}
-	else if (aDomainMember.HierarchyId() == KDmHierarchyIdTest)
-		{
-		TBuf16<4> buf;
-		GetDomainDesc(aDomainMember.Ordinal(), buf);
-
-		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-			aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
-		test(aDomainMember.State() == iTestState);
-		}
-	else
-		{
-		test(0);
-		}
-
-	// if we're going from parent to child, 
-	// check that each parent domain has received a notification already
-	// if not, check that each child domain has received a notification already
-
-	CDmTestMember** mp;
-
-	if (aDomainMember.HierarchyId() == KDmHierarchyIdTest && iAckMode == KAckAlways)
-		{
-
-		if (iTraverseDirection == ETraverseParentsFirst)
-			{
-			TUint ordThis = aDomainMember.Ordinal();
-			TUint ordParent = PARENT_ORDINAL(ordThis);
-
-			TInt levelParent = ORDINAL_LEVEL(ordParent);
-
-			TBuf16<4> buf;
-			GetDomainDesc(ordParent, buf);
-			if (levelParent >= iTestDomainLevel)
-				{
-				__PRINT((_L("Searching for parent domain = %S, ordinal = %08X \n"), &buf, ordParent));
-				for (mp = iTestMembers; *mp; ++mp)
-					{
-					if ((*mp)->Ordinal() == ordParent)
-						{
-						TBuf16<4> buf;
-						GetDomainDesc((*mp)->Ordinal(), buf);
-						__PRINT((_L("Found parent (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
-						test ((*mp)->Notifications() == aDomainMember.Notifications());
-						break;
-						}
-					}
-				}
-			}
-		else
-			{
-			__PRINT((_L("Searching for children\n")));
-			for (mp = iTestMembers; *mp; ++mp)
-				{
-
-				TUint ordParent = PARENT_ORDINAL((*mp)->Ordinal());
-				if (ordParent == aDomainMember.Ordinal())
-					{
-					TBuf16<4> buf;
-					GetDomainDesc((*mp)->Ordinal(), buf);
-					__PRINT((_L("Found child (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
-					test ((*mp)->Notifications() == aDomainMember.Notifications());
-					}
-				}
-			}
-		}
-
-	TInt ackError;
-	switch (iAckMode)
-		{
-		case KAckNever:
-			ackError = KErrAbort;
-			break;
-		case KAckError:		// return an error to the DM
-			ackError = KErrGeneral;
-			break;
-		case KAckOddDomainsOnly:
-			ackError = (aDomainMember.DomainId() & 1)?KErrNone:KErrAbort;
-			break;
-		case KAckAlways:
-		default:
-			ackError = KErrNone;
-			break;
-		}
-	return ackError;
-	}
-
-void CDmTest5::RunL()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest5::RunL(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications , iPowerNotifications));
-
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest5::TransitionRequestComplete()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest5::TransitionRequestComplete(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications , iPowerNotifications));
-	
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest5::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest5::Release()
-	{
-	delete this;
-	}
-
-const TInt KMembersMax = 16;
-
-// Negative testing 
-class CDmTest6 : public CActive, public MDmTest
-	{
-public:
-	enum 
-	{
-	ENegTestTransitionNoConnect,
-	ENegTestGetStateNoConnect,
-	ENegTestTransitionInvalidMode
-	};
-
-	class TData 
-		{
-	public:
-		inline TData(TInt aTest) : iTest(aTest){};
-		TInt iTest;
-		};
-
-public: 
-	// from CActive
-	void RunL();
- 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete();
-
-
-	CDmTest6() : CActive(CActive::EPriorityStandard) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	static TInt PanicThreadFunc(TAny* aData);
-	void PanicTest(TInt aTestNumber);
-
-
-	CDomainMemberAo*	iTestMembers[KMembersMax]; 
-	CDomainManagerAo*	iTestDomainManager;
-	
-	TDmDomainId			iTestDomainId;
-	TDmDomainState		iTestState;
-
-public:
-	TInt				iTestNotifications;
-	TInt				iTestNotificationsExpected;
-
-	TInt				iTransitionsCompleted;
-	TInt				iTransitionsExpected;
-	};
-
-TInt CDmTest6::PanicThreadFunc(TAny* aData)
-	{
-	const TData* data = (const TData*)aData;
-	switch (data->iTest)
-		{
-		case ENegTestTransitionNoConnect:
-			{
-			// request a transition notification without connecting first (should panic)
-			RDmDomain domainMember;
-			TRequestStatus status;
-			User::SetJustInTime(EFalse);
-			domainMember.RequestTransitionNotification(status);
-			}
-			break;
-		case ENegTestGetStateNoConnect:
-			{
-			// Get the domain state without connecting (should panic)
-			RDmDomain domainMember;
-			User::SetJustInTime(EFalse);
-			domainMember.GetState();
-			}
-			break;
-		case ENegTestTransitionInvalidMode:
-			{
-			RDmDomainManager manager;
-			TRequestStatus status;
-			TInt r = manager.Connect(KDmHierarchyIdTest);
-			test(r == KErrNone);
-
-			User::SetJustInTime(EFalse);
-			manager.RequestDomainTransition(KDmIdRoot, 0, TDmTraverseDirection(-1), status);
-			}
-			break;
-		default:
-			break;
-		}
-	return KErrNone;
-	}
-
-void CDmTest6::PanicTest(TInt aTestNumber)
-	{
-	test.Printf(_L("panic test number %d\n"), aTestNumber);
-
-	TBool jit = User::JustInTime();
-
-	TData data(aTestNumber);
-
-	TInt KHeapSize=0x2000;
-
-	RThread thread;
-	TInt ret = thread.Create(KThreadName, PanicThreadFunc, KDefaultStackSize, KHeapSize, KHeapSize, &data);
-	test(KErrNone == ret);
-	TRequestStatus stat;
-	thread.Logon(stat);
-	thread.Resume();
-	User::WaitForRequest(stat);
-
-	User::SetJustInTime(jit);
-
-	// The thread must panic
-	test(thread.ExitType() == EExitPanic);
-	TInt exitReason = thread.ExitReason();
-	test.Printf(_L("panic test exit reason = %d\n"), exitReason);
-
-	switch(aTestNumber)
-		{
-		case ENegTestTransitionNoConnect:
-			test (exitReason == EBadHandle);
-			break;
-		case ENegTestGetStateNoConnect:
-			test (exitReason == EBadHandle);
-			break;
-		case ENegTestTransitionInvalidMode:
-			break;
-		default:
-			break;
-		}
-
-	CLOSE_AND_WAIT(thread);
-	}
-
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-6
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Negative testing
-//! @SYMPREQ 810
-//! @SYMTestActions Various negative tests
-//! @SYMTestExpectedResults  All tests should pass
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest6::Perform()
-	{
-
- 	__UHEAP_MARK;
-
-	CActiveScheduler::Add(this);
-
-	CDomainManagerAo* iTestDomainManager = NULL;
-	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
-	test (iTestDomainManager != NULL);
-
-	TInt r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	//*************************************************
-	// Test 6a - Connect to the same hierarchy twice
-	//*************************************************
-	test.Next(_L("Test 6a - Connect to the same hierarchy twice"));
-
-	// verify that we can't connect to the same hierarchy more than once
-	CDomainManagerAo* testDomainManager = NULL;
-	TRAP(r, testDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
-	test(r == KErrInUse);
-	test (testDomainManager == NULL);
-
-
-	TInt testMemberCount = 0;
-
-	// Add some test hierarchy members
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 1
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row2
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 3
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-
-
-	//*************************************************
-	// Test 6b change to current state
-	//*************************************************
-	test.Next(_L("Test 6b change to current state"));
-	iTestState =  EStartupCriticalStatic;
-	iTestDomainId = KDmIdRoot;
-
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	// request a domain transition
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	
-
-	// cancel a member notification request 
-	//*************************************************
-	// Test 6c cancel a member notification request
-	//*************************************************
-	test.Next(_L("Test 6c cancel a member notification request"));
-	RDmDomain domainMember;
-	TRequestStatus status;
-	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
-	domainMember.RequestTransitionNotification(status);
-	domainMember.CancelTransitionNotification();
-	User::WaitForRequest(status);
-	domainMember.Close();
-
-	//*************************************************
-	// Test 6d cancel a member notification request without having first requested a notification
-	//*************************************************
-	test.Next(_L("Test 6d cancel a member notification request without having first requested a notification"));
-	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
-	domainMember.CancelTransitionNotification();
-	domainMember.Close();
-
-	//*************************************************
-	// Test 6e domain controller adds invalid hierarchy
-	//*************************************************
-	test.Next(_L("Test 6e domain controller connects to invalid hierarchy"));
-	r = RDmDomainManager::AddDomainHierarchy(TDmHierarchyId(-1));
-	test(r == KErrBadHierarchyId);
-
-	//*************************************************
-	// Test 6f domain member connects to invalid hierarchy
-	//*************************************************
-	test.Next(_L("Test 6f domain member connects to invalid hierarchy"));
-	r = domainMember.Connect(TDmHierarchyId(-1), TDmDomainId(KDmIdRoot));
-	test (r == KErrBadHierarchyId);
-
-	//*************************************************
-	// Test 6g domain member connects to valid hierarchy but invalid domain
-	//*************************************************
-	test.Next(_L("Test 6g domain member connects to valid hierarchy but invalid domain"));
-	r = domainMember.Connect(KDmHierarchyIdTest, TDmDomainId(-1));
-	test (r == KDmErrBadDomainId);
-
-	delete iTestDomainManager;
-	iTestDomainManager = NULL;
-
-	// Panic tests
-
-	//*************************************************
-	// Test 6h request a transition notification without connecting first
-	//*************************************************
-	test.Next(_L("Test 6h request a transition notification without connecting first"));
-	PanicTest(ENegTestTransitionNoConnect);
-
-	//*************************************************
-	// Test 6i Get the domain state without connecting
-	//*************************************************
-	test.Next(_L("Test 6i Get the domain state without connecting"));
-	PanicTest(ENegTestGetStateNoConnect);
-
-	//*************************************************
-	// Test 6j request a transition notification with an invalid transition mode
-	//*************************************************
-	test.Next(_L("Test 6j request a transition notification with an invalid transition mode"));
-	PanicTest(ENegTestTransitionInvalidMode);
-
-
-	// cleanup
-
-	CDomainMemberAo** mt;
-	for (mt = iTestMembers; *mt; ++mt)
-		delete *mt;
-
- 	__UHEAP_MARKEND;
-	}
-
-// This handles a transition notification from a test domain member.
-TInt CDmTest6::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	TInt status = aDomainMember.Status();
-		
-	iTestNotifications++;
-
-	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
-
-	TBuf16<4> buf;
-	GetDomainDesc(aDomainMember.Ordinal(), buf);
-
-	test.Printf(_L("CDmTest6::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), status);
-
-
-	return KErrNone;
-	}
-
-void CDmTest6::RunL()
-	{
-	iTransitionsCompleted++;
-
-	TInt error = iStatus.Int();
-
-	test.Printf(_L("CDmTest6::RunL(), error = %d, iTestNotifications %d\n"), 
-		error, iTestNotifications);
-
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest6::TransitionRequestComplete()
-	{
-	iTransitionsCompleted++;
-
-	TInt error = iStatus.Int();
-	
-	test.Printf(_L("CDmTest6::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
-		error, iTestNotifications);
-	
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest6::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest6::Release()
-	{
-	delete this;
-	}
-
-// Transition progress Observer testing
-class CDmTest7 : public CActive, public MDmTest, public MHierarchyObserver
-	{
-public: 
-	// from CActive
-	void RunL();
- 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete();
-
-	// from MHierarchyObserver
-	virtual void TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState);
-	virtual void TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError);
-	virtual void TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState);
-
-
-
-	CDmTest7(TDmDomainId aDomainId) : CActive(CActive::EPriorityStandard), iObservedDomainId(aDomainId) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	void TestForCompletion();
-
-
-private:
-
-	enum { KMembersMax = 16 };
-
-	CDomainMemberAo*	iTestMembers[KMembersMax]; 
-	CDomainManagerAo*	iTestDomainManager;
-	
-	TDmDomainId			iTestDomainId;
-	TDmDomainState		iTestState;
-	TDmDomainId			iObservedDomainId;
-
-public:
-	TInt				iTestNotifications;
-	TInt				iTestNotificationsExpected;
-
-	TInt				iTransitionsCompleted;
-	TInt				iTransitionsExpected;
-
-	TInt				iTransProgEvents;
-	TInt				iTransFailEvents;
-	TInt				iTransReqEvents;
-
-	TInt				iTransProgEventsExpected;
-	TInt				iTransFailEventsExpected;
-	TInt				iTransReqEventsExpected;
-	};
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-7
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Transition progress Observer testing
-//! @SYMREQ REQ3723
-//! @SYMTestActions Various negative tests
-//! @SYMTestExpectedResults  All tests should pass
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest7::Perform()
-	{
-
- 	__UHEAP_MARK;
-
-	//
-	// Test domain transitions with activated observer
-	//
-	CActiveScheduler::Add(this);
-
-	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	CDomainManagerAo* iTestDomainManager = NULL;
-	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
-	test (iTestDomainManager != NULL);
-
-	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	//*************************************************
-	// Test 7a - Testing observer notifications
-	//*************************************************
-	
-	test.Next(_L("Test 7a - Testing observer notifications"));
-
-	TInt testMemberCount = 0;
-
-	// Add some test hierarchy members
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 1
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row2
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 3
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-
-	// create an observer
-	CHierarchyObserver* observer = NULL;
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KErrNone);
-	test(observer != NULL);
-	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
-	
-	// request a state change
-	iTestState =  EStartupCriticalDynamic;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransReqEventsExpected = iTransProgEventsExpected = observer->ObserverDomainCount();
-	iTransFailEventsExpected = 0;
-
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-
-	// cleanup
-	delete observer; 
-	observer = NULL;
-
-	//*************************************************
-	// Test 7b - start & stop the observer
-	//*************************************************
-	test.Next(_L("Test 7b - start & stop the observer"));
-
-	// create an observer, start it stop and then start it again
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KErrNone);
-	test(observer != NULL);
-	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
-	observer->StopObserver();
-	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
-
-	// request a state change
-	iTestState++;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransProgEventsExpected = iTransReqEventsExpected = observer->ObserverDomainCount();
-	iTransFailEventsExpected = 0;
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-	// stop the observer & request another state change
-	observer->StopObserver();
-	iTestState++;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransProgEventsExpected = 0;
-	iTransFailEventsExpected = 0;
-	iTransReqEventsExpected = 0;
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-	// Start the observer again on a different domain and only ask for transition requests
-	// Then request another state change
-	observer->StartObserver((iObservedDomainId == KDmIdRoot)?KDmIdTestCA:KDmIdRoot, EDmNotifyTransRequest);
-	iTestState++;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransReqEventsExpected = observer->ObserverDomainCount();
-	iTransProgEventsExpected = 0;
-	iTransFailEventsExpected = 0;
-
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-	delete observer; 
-	observer = NULL;
-
-	//*************************************************
-	// Test 7c - invalid arguments testing for observer
-	//*************************************************
-	test.Next(_L("Test 7c - Invalid arguments testing for observer"));
-	
-	const TDmHierarchyId	KDmHierarchyIdInvalid = 110;
-	
-	test.Printf(_L("Test 7c.1 - create observer with invalid hierarchy Id\n"));
-	
-	// create an observer
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdInvalid));
-	test (r == KErrBadHierarchyId);
-	
-	
-	test.Printf(_L("Test 7c.2 - Starting the observer with wrong domain Id\n"));
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KErrNone);
-	test(observer != NULL);
-
-	//Wrong domain Id
-	const TDmDomainId	KDmIdInvalid	= 0x0f;
-	r= observer->StartObserver(KDmIdInvalid, EDmNotifyAll);
-	test(r==KDmErrBadDomainId);
-
-	test.Printf(_L("Test 7c.3 - Trying to create second observer on the same hierarchy\n"));
-	TRAP(r, CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KDmErrBadSequence);
-
-	
-	
-	//*************************************************
-	// Test 7d - Wrong sequence of API calls for observer
-	//*************************************************
-	test.Next(_L("Test 7d - Observer wrong sequence of calls"));
-	
-	test.Printf(_L("Test 7d.1 - Stopping Observer before starting it\n"));
-	r = observer->StopObserver();
-	test(r==KDmErrBadSequence);
-	
-	test.Printf(_L("Test 7d.2 - Starting Observer twice\n"));
-	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
-	test(r==KErrNone);
-
-	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
-	test(r==KDmErrBadSequence);
-
-	
-	delete observer;
-
-	/***************************************/
-
-	delete iTestDomainManager;
-	iTestDomainManager = NULL;
-
-	CDomainMemberAo** mt;
-	for (mt = iTestMembers; *mt; ++mt)
-		delete *mt;
-
-
-	// restore the domain hierarchies to their initial state so as not to 
-	// upset any subsequent tests which rely on this
-	{
-	RDmDomainManager manager;
-	TRequestStatus status;
-	TInt r = manager.Connect(KDmHierarchyIdTest);
-	test (r == KErrNone);
-	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrNone);
-	manager.Close();
-	}
-
- 	__UHEAP_MARKEND;
-	}
-
-// This handles a transition notification from a test domain member.
-TInt CDmTest7::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-		
-	iTestNotifications++;
-
-	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
-
-	TBuf16<4> buf;
-	GetDomainDesc(aDomainMember.Ordinal(), buf);
-
-	__PRINT((_L("CDmTest7::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
-
-	return KErrNone;
-	}
-
-void CDmTest7::RunL()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest7::RunL(), error = %d, iTestNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications));
-
-	TestForCompletion();
-	}
-
-void CDmTest7::TransitionRequestComplete()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest7::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications));
-	
-	TestForCompletion();
-	}
-
-void CDmTest7::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest7::Release()
-	{
-	delete this;
-	}
-
-void CDmTest7::TestForCompletion()
-	{
-
-	if (iTransitionsCompleted == iTransitionsExpected &&
-		iTransProgEvents == iTransProgEventsExpected && 
-		iTransFailEvents == iTransFailEventsExpected &&
-		iTransReqEvents == iTransReqEventsExpected)
-		{
-		CActiveScheduler::Stop();
-		}
-	}
-
-#ifdef _DEBUG
-void CDmTest7::TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState)
-#else
-void CDmTest7::TransProgEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
-#endif
-	{
-	iTransProgEvents++;
-	__PRINT((_L("CDmTest7::TransProgEvent(), aDomainId = %d, aState %d, iTransProgEvents %d\n"), 
-		aDomainId, aState, iTransProgEvents));
-	TestForCompletion();
-	}
-
-#ifdef _DEBUG
-void CDmTest7::TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError)
-#else
-void CDmTest7::TransFailEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/, TInt /*aError*/)
-#endif
-
-	{
-	iTransFailEvents++;
-	__PRINT((_L("CDmTest7::TransFailEvent(), aDomainId = %d, aState %d aError %d, iTransFailEvents %d\n"), 
-		aDomainId, aState, iTransFailEvents, aError));
-	TestForCompletion();
-	}
-
-#ifdef _DEBUG
-void CDmTest7::TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState)
-#else
-void CDmTest7::TransReqEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
-#endif
-	{
-	iTransReqEvents++;
-	__PRINT((_L("CDmTest7::TransReqEvent(), aDomainId = %d, aState %d, iTransReqEvents %d\n"), 
-		aDomainId, aState, iTransReqEvents));
-	TestForCompletion();
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	CTrapCleanup* trapHandler=CTrapCleanup::New();
-	test(trapHandler!=NULL);
-
-	CActiveScheduler* scheduler = new CActiveScheduler();
-	test(scheduler != NULL);
-	CActiveScheduler::Install(scheduler);
-
-	// Turn off evil lazy dll unloading
-	RLoader l;
-	test(l.Connect()==KErrNone);
-	test(l.CancelLazyDllUnload()==KErrNone);
-	l.Close();
-
-	//
-	// Perform the number of iterations specifed by the command line argument.
-	//
-	// If no arguments - perform two iterations
-	//
-//  TInt iter = 2;
-    TInt iter = 1;
-
-	TInt len = User::CommandLineLength();
-	if (len)
-		{
-		// Copy the command line in a buffer
-		HBufC* hb = HBufC::NewMax(len);
-		test(hb != NULL);
-		TPtr cmd((TUint16*) hb->Ptr(), len);
-		User::CommandLine(cmd);
-		// Extract the number of iterations
-		TLex l(cmd);
-		TInt i;
-		TInt r = l.Val(i);
-		if (r == KErrNone)
-			iter = i;
-		else
-			// strange command - silently ignore
-			{} 
-		delete hb;
-		}
-
-	test.Title();
-	test.Start(_L("Testing"));
-
-	test.Printf(_L("Go for %d iterations\n"), iter);
-
-	// Remember the number of open handles. Just for a sanity check ....
-	TInt start_thc, start_phc;
-	RThread().HandleCount(start_phc, start_thc);
-
-	while (iter--)
-		{
-		MDmTest* tests[] = 
-			{
-			new CDmTest1(KDmIdRoot, EPwStandby),
-			new CDmTest1(KDmIdRoot, EPwOff),
-			new CDmTest1(KDmIdRoot, EPwActive),
-			new CDmTest1(KDmIdApps, EPwStandby),
-			new CDmTest1(KDmIdApps, EPwOff),
-			new CDmTest1(KDmIdApps, EPwActive),
-			new CDmTest1(KDmIdUiApps, EPwStandby),
-			new CDmTest1(KDmIdUiApps, EPwOff),
-			new CDmTest1(KDmIdUiApps, EPwActive),
-			new CDmTest2(EPwStandby),
-			new CDmTest3(),
-	
-			// platform security tests
-			new CDmTest4(),
-
-			// PREQ810 tests :
-			// note that we use a fictitious power state to prevent any 
-			new CDmTest5(KDmIdRoot, KDmIdRoot, EPwActive+10, EStartupCriticalDynamic),
-			new CDmTest5(KDmIdUiApps, KDmIdTestAB, EPwActive+10, EStartupCriticalDynamic),
-
-        // negative tests
-			new CDmTest6(),
-
-
-			// observer tests
-     		new CDmTest7(KDmIdTestA),
-			new CDmTest7(KDmIdRoot),
-			
-			};
-
-		for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
-			{
-			test(tests[i] != NULL);
-			tests[i]->Perform();
-			tests[i]->Release();
-			}
-
-		}
-
-	test.End();
-
-	// Sanity check for open handles and for pending requests ...
-	TInt end_thc, end_phc;
-	RThread().HandleCount(end_phc, end_thc);
-	test(start_thc == end_thc);
-	test(start_phc == end_phc);
-	test(RThread().RequestCount() >= 0);
-
-	delete scheduler;
-	delete trapHandler;
-
-	return KErrNone;
-	}
--- a/kerneltest/e32test/power/t_domain_slave.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-// Copyright (c) 2002-2009 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:
-//
-// Description:
-// e32test\power\t_domain_slave.cpp
-// 
-//
-
-#include <e32power.h>
-#include <e32test.h>
-#include <domainmember.h>
-#include <domainmanager.h>
-#include <e32panic.h>
-#include <e32debug.h>
-
-LOCAL_D RTest test(_L(" T_DOMAIN_SLAVE "));
-
-// This will be run in its own thread as part of test #1. It should get killed when trying to connect 
-// to the manager without appropriate caps set
-TInt IncorrectClient(TAny*)
-{
-    	RDmDomain domain;
-		TInt r = domain.Connect(KDmIdRoot);
-
-		RDmDomainManager manager;
-		r = manager.Connect();
-
-        return(r);
-}
-
-GLDEF_C TInt E32Main()
-	{
-	test.Title();
-	test.Start(_L("Testing"));
-
-//	test.Next(_L("test security"));
-
-	// Get arguments from the command line
-	TInt len = User::CommandLineLength();
-	test (len);
-	TInt size = len * sizeof(TUint16);
-	test (size == sizeof(TInt));
-	TInt arg;
-	TPtr cmd((TUint16*) &arg, len);
-	User::CommandLine(cmd);
-
-	TInt expected_result = PlatSec::IsCapabilityEnforced(ECapabilityPowerMgmt) ? KErrPermissionDenied : KErrNone;
-
-	switch(arg)
-		{
-	case 0:
-		{
-        // This is the original t_domain_slave test, minus the panicking parts which now get
-        // tested as case 1.
-
-        test.Next(_L("test security -- 0"));       
-
-		RDmDomain domain;
-		TInt r = domain.Connect(KDmIdRoot);
-		test (r == expected_result);
-
-		break;
-		}
-    case 1:
-        {
-
-        test.Next(_L("test security -- 1")); 
-        
-        TBool jit = User::JustInTime();
-
-        User::SetJustInTime(EFalse);
-
-        _LIT(KPanicThread, "PanicThread");
-
-        RThread testThread;
-
-        TInt tt=testThread.Create(KPanicThread, IncorrectClient, KDefaultStackSize, 
-            NULL, NULL);
-
-        test (KErrNone == tt);
-
-        TRequestStatus tStatus;
-  //      testThread.Logon(tStatus);
-
-        RUndertaker deathChecker;
-        TInt dcOK = deathChecker.Create();
-
-        test (KErrNone == dcOK);
-
-        TInt nextDeadThread;
-
-        deathChecker.Logon(tStatus, nextDeadThread);
-
-        // threads are created in a suspended state. calling resume here starts the thread.
-        testThread.Resume();
-        User::WaitForRequest(tStatus);
-
-        // If thread suicided for the correct reason --> successful test
-        // NB. KErrPermissionDenied means that the server refused the 
-        // connection because of incorrect capabilities
-
-        RThread corpse;
-        corpse.SetHandle(nextDeadThread);
-
-        RDebug::Printf("Subthread exit type: %d", corpse.ExitType() );
-
-        RDebug::Printf("Subthread exit reason: %d",corpse.ExitReason() );
-
-        test (corpse.ExitType() == EExitKill);
-
-        test (corpse.ExitReason() == KErrPermissionDenied);
-
-        corpse.Close();
-  
-        // close the RUndertaker and test thread
-        deathChecker.Close();
-		CLOSE_AND_WAIT(testThread);
-
-        User::SetJustInTime(jit);
-
-		break;
-        }
-	default:
-		User::Panic(_L("USER"), EInvariantFalse);
-		break;
-		}
-
-	test.End();
-
-	return KErrNone;
-	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/t_powermisctest.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,72 @@
+// Copyright (c) 2006-2009 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:
+//
+// Description:
+// e32test\power\t_powermisctest.cpp
+// 
+//
+
+#include <e32test.h>
+#include <e32hal.h>
+#include "d_powermisctest.h"
+#include <e32power.h>
+#include <e32svr.h>
+#include <hal.h>
+#include <u32hal.h>
+
+_LIT(KLddFileName, "D_POWERMISCTEST.LDD");
+
+RLddTest1 ldd;
+GLDEF_D RTest test(_L("T_POWERMISCTEST"));
+
+void DoTests()
+	{
+	TInt r = KErrNone;
+
+	test.Printf(_L("Loading logical device \n"));
+	r=User::LoadLogicalDevice(KLddFileName);
+	test(r == KErrNone);
+
+	test.Printf(_L("Opening of logical device\n"));
+	r = ldd.Open();
+	test(r == KErrNone);
+
+	test.Printf(_L("Start tests\n"));
+	r = ldd.Test();
+	test(r == KErrNone);
+
+	test.Printf(_L("Closing the channel\n"));
+	ldd.Close();
+
+	test.Printf(_L("Freeing logical device\n"));
+	r = User::FreeLogicalDevice(KLddFileName);;
+	test(r==KErrNone);
+
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	test.Start(_L("Power misc tests"));
+	const TInt numCpus = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
+	if(numCpus > 1)
+		{
+		DoTests();
+		}
+	else
+		{
+		test.Printf(_L("Not supported in unicore.\n"));
+		}
+	test.End();
+	test.Close();	
+
+	return(KErrNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/t_powermisctest.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,31 @@
+// Copyright (c) 2006-2009 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:
+//
+// Description:
+// e32test/group/t_powermisctest.mmp
+// 
+//
+
+TARGET         t_powermisctest.exe
+TARGETTYPE     EXE
+SOURCEPATH     ../power
+SOURCE         t_powermisctest.cpp
+LIBRARY        euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE  ../power
+
+
+capability		all
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/resmanus/resourcecontrol.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resmanus/resourcecontrol.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -30,6 +30,7 @@
 #endif
 
 macro RESOURCE_MANAGER_SIMULATED_PSL
+macro _DUMP_TRACKERS
 macro BTRACE_RESMANUS
 macro PRM_US_INSTRUMENTATION_MACRO
 
--- a/kerneltest/e32test/resmanus/resourcecontrollerextended.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resmanus/resourcecontrollerextended.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -31,6 +31,7 @@
 
 macro RESOURCE_MANAGER_SIMULATED_PSL
 macro BTRACE_RESMANUS
+macro _DUMP_TRACKERS
 macro PRM_US_INSTRUMENTATION_MACRO
 macro PRM_ENABLE_EXTENDED_VERSION
 
--- a/kerneltest/e32test/resmanus/t_resmanus.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanus.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -43,7 +43,6 @@
 
 TBuf<16> gTestName(testName);
 
-GLDEF_D RTest gTest(testName);
 GLDEF_D RBusDevResManUs gChannel;
 
 TUint8 KNoOfGetStateRequests = 5;
@@ -75,6 +74,116 @@
 
 TBool gUseCached = EFalse;
 
+class RTestSafe: public RTest
+	{
+public:
+	RTestSafe(const TDesC &aTitle) :
+		RTest(aTitle), iCleanUpLevelMask (0), iFailHdnFunc(NULL)
+		{
+		}
+	RTestSafe(const TDesC &aTitle, void(*func)(RTestSafe &aTest)) :
+		RTest(aTitle), iFailHdnFunc(func)
+		{
+		}
+
+	// new version of operator(int), which calls our cleanup handler if check has failed
+	void operator()(TInt aResult)
+		{
+		if(!aResult && iFailHdnFunc)
+			iFailHdnFunc(*this);
+		RTest::operator ()(aResult);
+		}
+
+	void operator()(TInt aResult, TInt aLineNum)
+		{
+		if(!aResult && iFailHdnFunc)
+			iFailHdnFunc(*this);
+		RTest::operator ()(aResult, aLineNum);
+		}
+
+	void operator()(TInt aResult, TInt aLineNum, const TText* aFileName)
+		{
+		if(!aResult && iFailHdnFunc)
+			iFailHdnFunc(*this);
+		RTest::operator ()(aResult, aLineNum, aFileName);
+		}
+
+	// new version of End, which calls handler before exit..
+	void End()
+		{
+		if(iFailHdnFunc)
+			iFailHdnFunc(*this);
+		RTest::End();
+		}
+
+	void SetCleanupFlag(TUint aFlag)
+		{
+		iCleanUpLevelMask |= 1 << aFlag;
+		}
+
+	TBool CleanupNeeded(TUint aFlag)
+		{
+		return (iCleanUpLevelMask & (1 << aFlag)) >> aFlag;
+		}
+
+	TUint iCleanUpLevelMask;
+	void (*iFailHdnFunc)(RTestSafe &aTest);
+	};
+
+// cleanup handler
+enum TCleanupLevels
+	{
+	EPddLoaded = 0,
+	ELddLoaded,
+	EChannelOpened
+	};
+
+
+void TestCleanup(RTestSafe &aTest)
+	{
+	// cleanup for all 3 levels..
+	if(aTest.CleanupNeeded(EChannelOpened))
+		{
+		gChannel.Close();
+		}
+
+	if(aTest.CleanupNeeded(ELddLoaded))
+		{
+		User::FreeLogicalDevice(KLddRootName);
+		}
+
+	if(aTest.CleanupNeeded(EPddLoaded))
+		{
+		User::FreePhysicalDevice(PDD_NAME);
+		}
+	}
+
+// global gTest object..
+RTestSafe gTest(testName, &TestCleanup);
+
+LOCAL_C TInt CheckCaps()
+	{
+	TInt r = KErrNone;
+	RDevice d;
+	TPckgBuf<TCapsDevResManUs> caps;
+	r = d.Open(KLddRootName);
+	if(r == KErrNone)
+		{
+		d.GetCaps(caps);
+		d.Close();
+
+		TVersion ver = caps().version;
+		if(ver.iMajor != 1 || ver.iMinor != 0 || ver.iBuild != KE32BuildVersionNumber)
+			{
+			gTest.Printf(_L("Capabilities returned wrong version"));
+			gTest.Printf(_L("Expected(1, 0, %d), got (%d , %d, %d)"),
+			                KE32BuildVersionNumber, ver.iMajor, ver.iMinor, ver.iBuild);
+			r = KErrGeneral;
+			}
+		}
+	return r;
+	}
+
 LOCAL_C TInt OpenChannel(TDesC16& aName, RBusDevResManUs& aChannel)
 	{
 	TInt r = KErrNone;
@@ -1139,7 +1248,7 @@
 		}
 
 
-	// Fourth invocation - examine effect of orignal client requesting a level for 
+	// Fourth invocation - examine effect of oryginal client requesting a level for 
 	// the Shared resource
 	if(gHaveSharedRes)
 		{
@@ -1185,7 +1294,6 @@
 			}
 		}
 
-
 	// Close the temporary channels
 	channelTwo.Close();
 	channelThree.Close();
@@ -1343,8 +1451,10 @@
 	TInt r = KErrNone;
 
 	TRequestStatus status;
+	TRequestStatus status2;
 	TBool cached = gUseCached;
 	TInt readValue = 0;
+	TInt readValue2 = 0;
 	TInt levelOwnerId = 0;
 	TInt testNo = 0;
 
@@ -1524,10 +1634,20 @@
 
 	// 8) Call API to get the state of a long latency resource then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
+	
+	// NOTE: Cancel operation can only remove request which is still inside the resource controller
+	// message queue. If the queue is empty, the resource controller may process the request very quickly
+	// after it is sent. It may cause the test fail. To solve this, two get long latency resource state 
+	// requests are submitted. So that the second one must be inside the resource controller. 
+	// And we will always test the second request
+	
 	gChannel.GetResourceState(status,gLongLatencyResource,cached,&readValue,&levelOwnerId);
+	gChannel.GetResourceState(status2,gLongLatencyResource,cached,&readValue2,&levelOwnerId);
 	gChannel.CancelAsyncOperation(&status);
+	gChannel.CancelAsyncOperation(&status2);
 	User::WaitForRequest(status);
-	if(status.Int() != KErrCancel)
+	User::WaitForRequest(status2);
+	if(status2.Int() != KErrCancel)
 		{
 		gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status = %d\n"),r);
 		return r;
@@ -1535,11 +1655,21 @@
 
 	// 9) Call API to modify the state of the long latency resource then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
+	
+	// NOTE: Cancel operation can only remove request which is still inside the resource controller
+	// message queue. If the queue is empty, the resource controller may process the request very quickly
+	// after it is sent. It may cause the test fail. To solve this, two get long latency resource state 
+	// requests are submitted. So that the second one must be inside the resource controller. 
+	// And we will always test the second request
+		
 	newLevel = (TUint)(readValue + gAsyncResStateDelta);
 	gChannel.ChangeResourceState(status,gLongLatencyResource,newLevel);
+	gChannel.ChangeResourceState(status2,gLongLatencyResource,newLevel);
 	gChannel.CancelAsyncOperation(&status);
+	gChannel.CancelAsyncOperation(&status2);
 	User::WaitForRequest(status);
-	if(status.Int() != KErrCancel)
+	User::WaitForRequest(status2);
+	if(status2.Int() != KErrCancel)
 		{
 		gTest.Printf(_L("TestGetSetResourceStateOps, cancelled change state status = %d\n"),r);
 		return r;
@@ -1597,7 +1727,12 @@
 	for(i=0;i<KLoopVarN;i++)
 		{
 		User::WaitForRequest(getReqStatus[i]);
-		if((r=getReqStatus[i].Int()) != KErrCancel)
+
+	// NOTE: Cancel operation can only remove request which is still inside the resource controller
+	// message queue. If the queue is empty, the resource controller may process the request very quickly
+	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
+			
+		if(i>0 && ((r=getReqStatus[i].Int()) != KErrCancel))
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status[%d] = %d\n"),i,r);
 			return r;
@@ -1615,7 +1750,12 @@
 	for(i=0;i<KLoopVarM;i++)
 		{
 		User::WaitForRequest(setReqStatus[i]);
-		if((r=setReqStatus[i].Int()) != KErrCancel)
+		
+	// NOTE: Cancel operation can only remove request which is still inside the resource controller
+	// message queue. If the queue is empty, the resource controller may process the request very quickly 
+	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
+		
+		if(i>0 && ((r=setReqStatus[i].Int()) != KErrCancel))
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled change state status[%d] = %d\n"),i,r);
 			return r;
@@ -1691,7 +1831,12 @@
 	for(i=0;i<KLoopVarN;i++)
 		{
 		User::WaitForRequest(getReqStatus[i]);
-		if((r=getReqStatus[i].Int()) != KErrCancel)
+
+	// NOTE: Cancel operation can only remove request which is still inside the resource controller
+	// message queue. If the queue is empty, the resource controller may process the request very quickly 
+	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
+		
+		if(i>0 && ((r=getReqStatus[i].Int()) != KErrCancel))
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status[%d] = %d\n"),i,r);
 			return r;
@@ -1844,8 +1989,16 @@
 		r=gChannel.CancelGetResourceState(getReqStatus[i]);
 		if(r!=KErrNone)
 			{
-			gTest.Printf(_L("TestGetSetResourceStateOps, CancelGetResourceState for index %d returned %d\n"),i,r);
-			return r;
+
+	// NOTE: Cancel operation can only remove request which is still inside the resource controller
+	// message queue. If the queue is empty, the resource controller may process the request very quickly 
+	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
+			
+			if(i!=0)
+				{
+				gTest.Printf(_L("TestGetSetResourceStateOps, CancelGetResourceState for index %d returned %d\n"),i,r);
+				return r;
+				}
 			}
 		}
 	for(i=0;i<KLoopVarM;i++)
@@ -1868,7 +2021,12 @@
 	for(i=0;i<KLoopVarN;i++)
 		{
 		User::WaitForRequest(getReqStatus[i]);
-		if((r=getReqStatus[i].Int()) != KErrCancel)
+
+	// NOTE: Cancel operation can only remove request which is still inside the resource controller
+	// message queue. If the queue is empty, the resource controller may process the request very quickly 
+	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
+		
+		if(i>0 && ((r=getReqStatus[i].Int()) != KErrCancel))
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status[%d] = %d\n"),i,r);
 			return r;
@@ -2873,7 +3031,7 @@
 		gTest.Printf(_L("TestThreadExclusiveAccess: Duplicate with EOwnerProcess returned %d\n"),r);
 		if(r==KErrNone)
 			r=KErrGeneral;
-		return r;
+		return r; // return error which is neither KErrNone nor KErrAccessDenied
 		}
 	pirateChannel = gChannel;
 	if((r=pirateChannel.Duplicate(RThread(),EOwnerThread))!=KErrNone)
@@ -2997,7 +3155,7 @@
 		{
 		if(r==KErrNone)
 			r=KErrGeneral;
-		return r;
+		return r; // return error which is neither KErrPermissionDenied nor KErrGeneral
 		}
 	else
 		r=KErrNone; // Ensure misleading result is not propagated
@@ -3077,7 +3235,7 @@
 			{
 			if(r==KErrNone)
 				r=KErrGeneral;
-			return r;
+			return r; // return error which is neither KErrPermissionDenied nor KErrGeneral
 			}
 		else
 			r=KErrNone; // Ensure misleading result is not propagated
@@ -3771,7 +3929,7 @@
 		if((r=gChannel.GetInfoOnClientsUsingResource(gSharedResource, numClients, &infoPtrs, EFalse))!=KErrNotReady)
 			{
 			gTest.Printf(_L("TestTransientHandling: GetInfoOnClientsUsingResource (for gSharedResource) returned %d\n"),r);
-			return r;
+			return KErrGeneral;
 			}
 		infoPtrs.Close();
 		}
@@ -4080,104 +4238,82 @@
 //
 // Main
 //
-    {
+	{
+	gTest.Title();
 	gTest.Start(_L("Test Power Resource Manager user side API\n"));
-  
-	TInt r = KErrNone;
 
 	// Test attempted load of PDD
-    gTest.Next(_L("**Load PDD\n"));
-    r=User::LoadPhysicalDevice(PDD_NAME);
-    if((r!=KErrNone)&&(r!=KErrAlreadyExists))
-		{
-		gTest.Printf(_L("User::LoadPhysicalDevice error %d\n"),r);
-		}
-	else
-		{
-		// Test attempted load of LDD
-		gTest.Next(_L("**Load LDD\n"));
-		r=User::LoadLogicalDevice(LDD_NAME);
-		if((r!=KErrNone)&&(r!=KErrAlreadyExists))
-			gTest.Printf(_L("User::LoadLogicalDevice error - expected %d, got %d\n"),KErrAlreadyExists,r);
-		}
-    if((r==KErrNone)||(r==KErrAlreadyExists))
-		{
-		r = KErrNone; // Re-initialise in case set to KErrAlreadyExists
-		//
-		// Need a channel open for the following tests
-		gTest.Next(_L("**OpenAndRegisterChannel\n"));
-		r=OpenAndRegisterChannel();
-		if (r==KErrNone)
-			{
-			// Get the version of the ResourceController
-			TUint version;
-			if((r=gChannel.GetResourceControllerVersion(version))!=KErrNone)
-				{
-				gTest.Printf(_L("TestTransientHandling: GetResourceControllerVersion returned %d\n"),r);
-				return r;
-				}
-			gTest.Printf(_L("TestTransientHandling: ResourceController version =0x%x\n"),version);
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestThreadExclusiveAccess\n"));
-			r=TestThreadExclusiveAccess();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestGetClientGetResourceInfo - initial state\n"));
-			r=TestGetClientGetResourceInfo();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestGetSetResourceStateOps\n"));
-			r=TestGetSetResourceStateOps();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestGetClientGetResourceInfo - after changing stateof Async resource\n"));
-			r=TestGetClientGetResourceInfo();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestGetSetResourceStateQuota\n"));
-			r=TestGetSetResourceStateQuota();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestNotificationOps\n"));
-			r=TestNotificationOps();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestNotificationQuota\n"));
-			r=TestNotificationQuota();
-			}
-		if (r==KErrNone)
-			{
-			// Should be no change since last invocation (assuming that
-			// no clients other than those in this test)
-			gTest.Next(_L("**TestGetClientGetResourceInfo - last invocation\n"));
-			r=TestGetClientGetResourceInfo();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestAdditionalThread\n"));
-			r=TestAdditionalThread();
-			}
-		if (r==KErrNone)
-			{
-			gTest.Next(_L("**TestTransientHandling\n"));
-			r=TestTransientHandling();
-			}
-		}
-	gChannel.Close();
-
-    User::FreeLogicalDevice(KLddRootName);
-    User::FreePhysicalDevice(PDD_NAME);	
-	User::After(100000);	// Allow idle thread to run for driver unloading
+	gTest.Next(_L("**Load PDD\n"));
+	TInt r = User::LoadPhysicalDevice(PDD_NAME);
+	gTest((r == KErrNone) || (r == KErrAlreadyExists));
+	gTest.SetCleanupFlag(EPddLoaded);
+
+	// Test attempted load of LDD
+	gTest.Next(_L("**Load LDD\n"));
+	r = User::LoadLogicalDevice(LDD_NAME);
+	gTest((r == KErrNone) || (r == KErrAlreadyExists));
+	r = KErrNone; // Re-initialise in case set to KErrAlreadyExists
+	gTest.SetCleanupFlag(ELddLoaded);
+
+	// test caps
+	gTest(CheckCaps() == KErrNone);
+
+	// Need a channel open for the following tests
+	gTest.Next(_L("**OpenAndRegisterChannel\n"));
+	r = OpenAndRegisterChannel();
+	gTest(r == KErrNone);
+	gTest.SetCleanupFlag(EChannelOpened);
+
+	// Get the version of the ResourceController
+	TUint version;
+	r = gChannel.GetResourceControllerVersion(version);
+	gTest.Printf(_L("TestTransientHandling: ResourceController version =0x%x\n"), version);
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestThreadExclusiveAccess\n"));
+	r = TestThreadExclusiveAccess();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestGetClientGetResourceInfo - initial state\n"));
+	r = TestGetClientGetResourceInfo();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestGetSetResourceStateOps\n"));
+	r = TestGetSetResourceStateOps();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestGetClientGetResourceInfo - after changing stateof Async resource\n"));
+	r = TestGetClientGetResourceInfo();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestGetSetResourceStateQuota\n"));
+	r = TestGetSetResourceStateQuota();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestNotificationOps\n"));
+	r = TestNotificationOps();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestNotificationQuota\n"));
+	r = TestNotificationQuota();
+	gTest(r == KErrNone);
+
+	// Should be no change since last invocation (assuming that
+	// no clients other than those in this test)
+	gTest.Next(_L("**TestGetClientGetResourceInfo - last invocation\n"));
+	r = TestGetClientGetResourceInfo();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestAdditionalThread\n"));
+	r = TestAdditionalThread();
+	gTest(r == KErrNone);
+
+	gTest.Next(_L("**TestTransientHandling\n"));
+	r = TestTransientHandling();
+	gTest(r == KErrNone);
 
 	gTest.End();
-	return r;
-    }
-
+	return KErrNone;
+	}
+
+
--- a/kerneltest/e32test/resmanus/t_resmanus.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanus.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -18,6 +18,7 @@
 
 // Need simulated PSL to support this test
 macro RESOURCE_MANAGER_SIMULATED_PSL
+macro _DUMP_TRACKERS
 
 sourcepath      ../resmanus
 source  	t_resmanus.cpp
@@ -26,7 +27,7 @@
 
 library 	euser.lib hal.lib
 
-capability		PowerMgmt
+capability		PowerMgmt 
 
 vendorid 0x70000001
 SMPSAFE
--- a/kerneltest/e32test/resmanus/t_resmanusextended.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanusextended.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -18,6 +18,7 @@
 
 // Need simulated PSL to support this test
 macro RESOURCE_MANAGER_SIMULATED_PSL
+macro _DUMP_TRACKERS
 macro PRM_ENABLE_EXTENDED_VERSION
 
 sourcepath      ../resmanus
@@ -27,7 +28,7 @@
 
 library 	euser.lib hal.lib
 
-capability		PowerMgmt
+capability		PowerMgmt 
 
 vendorid 0x70000001
 SMPSAFE
--- a/kerneltest/e32test/resmanus/t_resmanuskern.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanuskern.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -17,7 +17,8 @@
 targettype      exe
 
 // Need simulated PSL to support this test
-macro RESOURCE_MANAGER_SIMULATED_PSL 
+macro RESOURCE_MANAGER_SIMULATED_PSL
+macro _DUMP_TRACKERS
 macro PRM_ENABLE_EXTENDED_VERSION
 macro RESMANUS_KERN
 
--- a/kerneltest/e32test/resourceman/d_rescontrolcli.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resourceman/d_rescontrolcli.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -283,12 +283,6 @@
 	{
 	if(iDfcQ)
 	  iDfcQ->Destroy();
-	if(iStaticRes)
-		delete iStaticRes;
-	if(iStaticResArray[0])
-		delete iStaticResArray[0];
-	if(iStaticResArray[2])
-		delete iStaticResArray[2];
 	}
 
 /** Entry point for this driver */
@@ -319,7 +313,7 @@
 		return NULL;
 		}
 	//Allocating memory earlier so that during failure conditions can cleanup easily
-	p->iStaticRes = new DLaterRegisterStaticResource();
+	p->iStaticRes = new DLaterRegisterStaticResource(); // it will be registered, and later destroyed by the ResourceManager
 	if(!p->iStaticRes)
 		{
 		delete p->iClient.pName;
@@ -327,7 +321,7 @@
 		p->AsyncDelete();
 		return NULL;
 		}
-	p->iStaticResArray[0] = new DLaterRegisterStaticResource1();
+	p->iStaticResArray[0] = new DLaterRegisterStaticResource1(); // it will be registered, and later destroyed by the ResourceManager
 	if(!p->iStaticResArray[0])
 		{
 		delete p->iStaticRes;
@@ -1337,7 +1331,7 @@
 	TInt r = PowerResourceManager::CancelNotification(iClient.iClientId, aResId, *ptr);
 	if(r == KErrCancel)
 		{
-		delete ptr;
+		ptr->AsyncDelete();
 		if(iPostBootNotiCount == EXPECTED_POST_NOTI_COUNT)
 			{
 			r = PowerResourceManager::DeRegisterClient(DTestResManLddFactory::iClient.iClientId);
--- a/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_extended_psl.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_extended_psl.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -31,56 +31,65 @@
 									|						  |
 								ResourceF				   ResourceG	
 	*/
-TInt DSimulatedPowerResourceController::DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, TUint16& aStaticResourceDCount)
+
+TInt DSimulatedPowerResourceController::DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray)
 	{
 	Kern::Printf(">DSimulatedPowerResourceController::DoRegisterStaticResourcesDependency");
-	aStaticResourceDArray = (DStaticPowerResourceD**)new(DStaticPowerResourceD*[MAX_DEPENDENT_RESOURCE_COUNT]);
-	if(!aStaticResourceDArray)
-		return KErrNoMemory;
+
+	// this is just for testing purposes - try to call base-class implementation, which by default resets the values and returns KErrNone
+	TInt r = DPowerResourceController::DoRegisterStaticResourcesDependency(aStaticResourceDArray);
+	if(r != KErrNone || aStaticResourceDArray.Count())
+		{
+		Kern::Printf("DPowerResourceController::DoRegisterStaticResourcesDependency() default base class implementation has failed?");
+		return KErrGeneral;
+		}
+
 	DStaticPowerResourceD* pR = NULL;
+	TBool error_occured = EFalse;
+
 	pR = new DMLSLGLSPDependResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
-	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
+	if(!SafeAppend(aStaticResourceDArray, pR))
+		error_occured = ETrue;
 
 	pR = new DMLSIGLSNDependResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
-	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
-	
+	if(!SafeAppend(aStaticResourceDArray, pR))
+		error_occured = ETrue;
+
 	pR = new DBSIGLSPDependResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
-	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
-
+	if(!SafeAppend(aStaticResourceDArray, pR))
+		error_occured = ETrue;
+	
 	pR = new DMLSHIGLSPDependResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
-	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
+	if(!SafeAppend(aStaticResourceDArray, pR))
+		error_occured = ETrue;
 
 	pR = new DBSHLGLSNDependResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
-	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
+	if(!SafeAppend(aStaticResourceDArray, pR))
+		error_occured = ETrue;
 
 	pR = new DMLSHLGLSNDependResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
-	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
+	if(!SafeAppend(aStaticResourceDArray, pR))
+		error_occured = ETrue;
 
 	//Establish resource dependencies
-	if(CreateResourceDependency(aStaticResourceDArray))
-		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
+	r = CreateResourceDependency(aStaticResourceDArray);
+	if(r != KErrNone)
+		error_occured = ETrue;
 
-	iDependencyResources = aStaticResourceDArray;
+	// the only error that could occur here is KErrNoMemory (also from calling CreateResourceDependency)
+	// clean-up if the error did occur
+	if(error_occured)
+		{
+		aStaticResourceDArray.ResetAndDestroy();
+		r = KErrNoMemory;
+		}
 
-	aStaticResourceDCount = iStaticResDependencyCount;
-	return KErrNone;
+	return r;
 	}
 
 
 // This function establishes above dependency between static dependent resource
-TInt DSimulatedPowerResourceController::CreateResourceDependency(DStaticPowerResourceD** pResArray)
+TInt DSimulatedPowerResourceController::CreateResourceDependency(RPointerArray <DStaticPowerResourceD> & pResArray)
 	{
 	iNodeArray = new SNode[10];
 	SNode* pN1;
--- a/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -49,7 +49,8 @@
 	}
 
 /** Constructor for simulated resource controller. */
-DSimulatedPowerResourceController::DSimulatedPowerResourceController():DPowerResourceController(),iStaticResourceCount(0), iEventDfc(EventDfcFunc, this)
+DSimulatedPowerResourceController::DSimulatedPowerResourceController()
+	: iEventDfc(EventDfcFunc, this)
 	{
 	Kern::Printf(">DSimulatedPowerResourceController");
 	}
@@ -57,26 +58,51 @@
 /** Destructor for simulated resource controller. */
 DSimulatedPowerResourceController::~DSimulatedPowerResourceController()
 	{
-	Kern::Printf("DSimulatedPowerResourceController::~DSimulatedPowerResourceController()\n");
+	Kern::Printf(">~DSimulatedPowerResourceController()\n");
 	((TDynamicDfcQue*)iDfcQ)->Destroy();
-	DStaticPowerResource *pR;
-	TUint c;
-	for(c = 0; c < iStaticResourceCount; c++)
+	delete iMsgQ;
+
+	SPowerResourceClientLevel *pCL = iClientLevelPool;
+	while(iClientLevelPool) //Find the starting position of array to delete
 		{
-		pR = iResources[c];
-		delete pR;
+		if(iClientLevelPool < pCL)
+			pCL = iClientLevelPool;
+		iClientLevelPool = iClientLevelPool->iNextInList;
+		}
+
+	delete [] pCL;
+	SPowerRequest *pReq = iRequestPool;
+	while(iRequestPool) //Find the starting position of array to delete
+		{
+		if(iRequestPool < pReq)
+			pReq = iRequestPool;
+		iRequestPool = iRequestPool->iNext;
 		}
-	delete []iResources;
+	delete [] pReq;
+
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	DStaticPowerResourceD* pDR;
-	
-	delete []iNodeArray; //Delete dependency nodes
-	for(c = 0; c < iStaticResDependencyCount; c++) 
+	pCL = iResourceLevelPool;
+	while(iResourceLevelPool)
 		{
-		pDR = iDependencyResources[c];
-		delete pDR;
+		if(iResourceLevelPool < pCL)
+			pCL = iResourceLevelPool;
+		iResourceLevelPool = iResourceLevelPool->iNextInList;
 		}
-	delete []iDependencyResources;
+	//delete resource pool
+	delete [] pCL;
+	delete iMsgQDependency;
+#endif
+
+	iClientList.Delete();
+	iUserSideClientList.Delete();
+	iStaticResourceArray.ResetAndDestroy();
+
+#ifdef PRM_ENABLE_EXTENDED_VERSION
+	iCleanList.ResetAndDestroy();
+	iDynamicResourceList.Delete();
+	iDynamicResDependencyList.Delete();
+	delete [] iNodeArray; //Delete dependency nodes
+	iStaticResDependencyArray.ResetAndDestroy();
 #endif
 	}
 
@@ -274,147 +300,133 @@
 	}
 
 //This registers all static resource with resource controller. This function is called by PIL
-TInt DSimulatedPowerResourceController::DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount)
+TInt DSimulatedPowerResourceController::DoRegisterStaticResources(RPointerArray <DStaticPowerResource> & aStaticResourceArray)
 	{
 	Kern::Printf(">DSimulatedPowerResourceController::DoRegisterStaticResources");
-	aStaticResourceArray = (DStaticPowerResource**)new(DStaticPowerResource*[MAX_RESOURCE_COUNT]);
-	if(!aStaticResourceArray)
-		return KErrNoMemory;
-	DStaticPowerResource* pR = NULL;
+
+	TBool error_occured = EFalse;
+	TInt r = KErrNone;
 
 	//Create Binary Single Instantaneous Positive Resource
-	pR = new DBSIGISPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	DStaticPowerResource* pR = new DBSIGISPResource();
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create Multilevel Single Instantaneous Positive Resource
 	pR = new DMLSIGISPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create Binary Single Instantaneous Negative Resource
 	pR = new DBSIGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create Multilevel Single Instantaneous Negative Resource
 	pR = new DMLSIGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Binary Single Longlatency Positive Resource
+	//Create Binary Single Long latency Positive Resource
 	pR = new DBSLGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Multilevel Single Longlatency  Positive Resource
+	//Create Multilevel Single Long latency  Positive Resource
 	pR = new DMLSLGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Binary Single Longlatency Get & Instantaneous Set Negative Resource
+	//Create Binary Single Long latency Get & Instantaneous Set Negative Resource
 	pR = new DBSLGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Multilevel Single Longlatency Get & Instantaneous Set Negative Resource
+	//Create Multilevel Single Long latency Get & Instantaneous Set Negative Resource
 	pR = new DMLSLGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Binary Single Instantaneous Get & Longlatency Set Positive Resource
+	//Create Binary Single Instantaneous Get & Long latency Set Positive Resource
 	pR = new DBSIGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Multilevel Single Instantaneous Get & Longlatency Set Positive Resource
+	//Create Multilevel Single Instantaneous Get & Long latency Set Positive Resource
 	pR = new DMLSIGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create Binary SHared Instantaneous Positive Resource
 	pR = new DBSHIGISPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create Multilevel SHared Instantaneous Positive Resource
 	pR = new DMLSHIGISPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create Binary SHared Instantaneous Negative Resource
 	pR = new DBSHIGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create Multilevel SHared Instantaneous Negative Resource
 	pR = new DMLSHIGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Binary SHared Longlatency Positive Resource
+	//Create Binary SHared Long latency Positive Resource
 	pR = new DBSHLGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Multilevel SHared Longlatency  Positive Resource
+	//Create Multilevel SHared Long latency  Positive Resource
 	pR = new DMLSHLGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Binary SHared Longlatency Get & Instantaneous Set Negative Resource
+	//Create Binary SHared Long latency Get & Instantaneous Set Negative Resource
 	pR = new DBSHLGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Multilevel SHared Longlatency Get & Instantaneous Set Negative Resource
+	//Create Multilevel SHared Long latency Get & Instantaneous Set Negative Resource
 	pR = new DMLSHLGISNResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
 	//Create holes in resource array
-	aStaticResourceArray[iStaticResourceCount++] = NULL;
-	aStaticResourceArray[iStaticResourceCount++] = NULL;
-	//Create Binary SHared Instantaneous Get & Longlatency Set Positive Resource
+	if(aStaticResourceArray.Append(NULL) != KErrNone)
+		error_occured = ETrue;
+
+	if(aStaticResourceArray.Append(NULL) != KErrNone)
+		error_occured = ETrue;
+
+	//Create Binary SHared Instantaneous Get & Long latency Set Positive Resource
 	pR = new DBSHIGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	//Create Multilevel SHared Instantaneous Get & Longlatency Set Positive Resource
+	//Create Multilevel SHared Instantaneous Get & Long latency Set Positive Resource
 	pR = new DMLSHIGLSPResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
-	 
-	//Create Binary shared Longlatency get and set Custom Resource
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
+
+	//Create Binary shared Long latency get and set Custom Resource
 	pR = new DBSHLGLSCResource();
-	if(!pR)
-		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
-	aStaticResourceArray[iStaticResourceCount++] = pR;
+	if(!SafeAppend(aStaticResourceArray, pR))
+		error_occured = ETrue;
 
-	iResources = aStaticResourceArray;
-
-	aStaticResourceCount = iStaticResourceCount;
-	return KErrNone;
+	// the only error that could occur here is KErrNoMemory
+	// clean-up if the error did occur
+	if(error_occured)
+		{
+		aStaticResourceArray.ResetAndDestroy();
+		r = KErrNoMemory;
+		}
+	return r;
 	}
 
 //Constructors of all resources
--- a/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.h	Thu Sep 02 21:54:16 2010 +0300
@@ -32,15 +32,20 @@
 #define MAX_RESOURCE_COUNT 30
 #define MAX_DEPENDENT_RESOURCE_COUNT 10
 
-#define MAX_BLOCK_TIME 200 //Maximum block time
-#define MIN_BLOCK_TIME 50 //Guaranteed minimum block
+#define MAX_BLOCK_TIME 400 //Maximum block time
+#define MIN_BLOCK_TIME 200 //Guaranteed minimum block
 
-#define CLEAN_AND_RETURN(resCount, resArray, error)				\
-	{															\
-	for(TUint count = 0; count < resCount; count++)				\
-		delete resArray[count];									\
-	delete resArray;											\
-	return error;												\
+template <class T>
+inline TBool SafeAppend(RPointerArray <T> & aStaticResourceArray, T* pR)
+	{
+	if(pR)
+		{
+		if(aStaticResourceArray.Append(pR) == KErrNone)
+			return ETrue;
+		else
+			delete pR;
+		}
+	return EFalse;
 	}
 
 const TUint KBinary = 0x0;
@@ -55,10 +60,10 @@
 	~DSimulatedPowerResourceController();
     TInt DoInitController();
     TInt DoInitResources();
-    TInt DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount);
+    TInt DoRegisterStaticResources(RPointerArray <DStaticPowerResource> & aStaticResourceArray);
 	// Function to process instantaneous resources
     TInt ProcessInstantaneousResources(TPowerRequest& req, TInt& aClientLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel);
-	// Function to procces polled resources
+	// Function to process polled resources
     TInt ProcessPolledResources(TPowerRequest& req, TInt& aClientLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel, TInt aBlockTime = 0);
 	// Function to change the state of the resource
     TInt ChangeResource(TPowerRequest& req, TInt& aClientLevel, TInt aMaxLevel, TInt aMinLevel);
@@ -67,19 +72,15 @@
     IMPORT_C static TInt CaptureIdleResourcesInfo(TUint aControllerId, TUint aNumResources, TPtr* aPtr);
 	IMPORT_C static TInt CompleteResourceControllerInitialisation();
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	TInt DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, TUint16& aStaticResourceDCount);
-	TInt CreateResourceDependency(DStaticPowerResourceD** pResArray);
+	TInt DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray);
+	TInt CreateResourceDependency(RPointerArray <DStaticPowerResourceD> & pResArray);
 #endif
 private:
-    static void TimerIsrFunc(TAny* ptr); //ISR Function called when specfied timer expires. This is for even driven resources
-    static void EventDfcFunc(TAny* ptr); //Function to wakeup the fast semphore. This is called from timer ISR.
-    DStaticPowerResource** iResources;
-    TUint16 iStaticResourceCount;
-    NFastSemaphore iEventFastSem; //Semphore to block the PIL of resource controller for event driven resource operations.
+    static void TimerIsrFunc(TAny* ptr); //ISR Function called when specified timer expires. This is for even driven resources
+    static void EventDfcFunc(TAny* ptr); //Function to wake up the fast semaphore. This is called from timer ISR.
+    NFastSemaphore iEventFastSem; //Semaphore to block the PIL of resource controller for event driven resource operations.
     TDfc iEventDfc; //Dfc to run to signal the event semaphore when the timer expires. Queued from timer ISR
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	DStaticPowerResourceD** iDependencyResources;
-	TUint16 iStaticResDependencyCount;
 	SNode* iNodeArray;
 	TUint16 iNodeCount;
 #endif
--- a/kerneltest/e32test/resourceman/t_rescontrolcli.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/resourceman/t_rescontrolcli.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -4321,10 +4321,6 @@
 	test.Start(_L("Testing Resource Manager...\n"));
 	test.Printf(_L("Testing HCR client setting Macro's for Resource Manager \n"));
 	TestClientHCRSettingMacros();
-	//
-	test.Printf(_L("TEST SKIPPED UNTIL FIX FOR DEF145087 IS AVAILABLE TO PREVENT CRASHING\n"));
-	test(0);
-	//
 	test.Next(_L("Load Physical device"));
 #ifndef PRM_ENABLE_EXTENDED_VERSION
 	r = User::LoadPhysicalDevice(KPddFileName);
@@ -4340,8 +4336,22 @@
 	r=User::LoadLogicalDevice(KExtLddFileName);
 	test(r==KErrNone || r==KErrAlreadyExists);
 #endif
+
+	RDevice d;
+	TPckgBuf<RTestResMan::TCaps> caps;
+	r = d.Open(KLddName);
+	test(r == KErrNone);
+	d.GetCaps(caps);
+	d.Close();
+
+	TVersion ver = caps().iVersion;
+	test(ver.iMajor == 1);
+	test(ver.iMinor == 0);
+	test(ver.iBuild == KE32BuildVersionNumber);
+
 	r = lddChan.Open();
 	test(r==KErrNone || r==KErrAlreadyExists);
+
 	//Check whether the notifications recieved as a result of postboot level setting is as expected.
 	r = lddChan.CheckPostBootLevelNotifications();
 	test(r == KErrNone);
--- a/kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Implementation of RKernelLowMemorySecuritySvrSession
-// 
-//
-
-#include "r_kernel_low_memory_security_svr_session.h"
-
-void RKernelLowMemorySecuritySvrSession::FailAlloc(const TInt aCount)
-	{
-	__KHEAP_FAILNEXT(aCount);
-	}
-
-void RKernelLowMemorySecuritySvrSession::HeapReset()
-	{
-	__KHEAP_RESET;
-	}
-
-void RKernelLowMemorySecuritySvrSession::MarkHeap()
-	{
-	__KHEAP_MARK;
-	}
-
-void RKernelLowMemorySecuritySvrSession::MarkHeapEnd()
-	{
-	__KHEAP_MARKEND;
-	}
-
--- a/kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Version of security server session to enable testing of low memory conditions on kernel side
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef R_KERNEL_LOW_MEMORY_SECURITY_SVR_SESSION_H
-#define R_KERNEL_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
-#include "r_low_memory_security_svr_session.h"
-
-class RKernelLowMemorySecuritySvrSession : public RLowMemorySecuritySvrSession
-	{
-protected:
-	void FailAlloc(const TInt aCount);
-	void HeapReset();
-	void MarkHeap();
-	void MarkHeapEnd();
-	};
-
-#endif //R_KERNEL_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
--- a/kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Implementation of RLowMemorySecuritySvrSession
-// 
-//
-
-#include "r_low_memory_security_svr_session.h"
-#include <e32debug.h>
-
-// test the effects of heap failure on global RSecuritySvrSession::GetList() in debug mode,
-// in release mode normal call is made (heap checking not applicable)
-TInt RLowMemorySecuritySvrSession::GetList(const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TInt failAt = 0;
-	TInt err = KErrNoMemory;
-	while(err == KErrNoMemory)
-		{
-		failAt++;
-		FailAlloc(failAt);
-		MarkHeap();
-		err = this->RSecuritySvrSession::GetList(aListId, aListData, aDataSize);
-		if(KErrNoMemory == err)
-			{
-			MarkHeapEnd();
-			}
-		HeapReset();
-		//RDebug::Printf("Debug::RLowMemorySecuritySvrSession::GetList(): failAt: %d, err: %d", failAt, err);
-		}
-	return err;
-	}
-
-// test the effects of heap failure on thread-specific RSecuritySvrSession::GetList() in debug mode,
-// in release mode normal call is made (heap checking not applicable)
-TInt RLowMemorySecuritySvrSession::GetList(const TThreadId aThreadId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TInt failAt = 0;
-	TInt err = KErrNoMemory;
-	while(err == KErrNoMemory)
-		{
-		failAt++;
-		FailAlloc(failAt);
-		MarkHeap();
-		err = this->RSecuritySvrSession::GetList(aThreadId, aListId, aListData, aDataSize);
-		if(KErrNoMemory == err)
-			{
-			MarkHeapEnd();
-			}
-		HeapReset();
-		//RDebug::Printf("Debug::RLowMemorySecuritySvrSession::GetList(TThreadId): failAt: %d, err: %d", failAt, err);
-		}
-	return err;
-	}
-
-// test the effects of heap failure on process-specific RSecuritySvrSession::GetList() in debug mode,
-// in release mode normal call is made (heap checking not applicable)
-TInt RLowMemorySecuritySvrSession::GetList(const TProcessId aProcessId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TInt failAt = 0;
-	TInt err = KErrNoMemory;
-	while(err == KErrNoMemory)
-		{
-		failAt++;
-		FailAlloc(failAt);
-		MarkHeap();
-		err = this->RSecuritySvrSession::GetList(aProcessId, aListId, aListData, aDataSize);
-		if(KErrNoMemory == err)
-			{
-			MarkHeapEnd();
-			}
-		HeapReset();
-		//RDebug::Printf("Debug::RLowMemorySecuritySvrSession::GetList(TProcessId): failAt: %d, err: %d", failAt, err);
-		}
-	return err;
-	}
-
--- a/kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Version of security server session to enable testing of low memory conditions
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef R_LOW_MEMORY_SECURITY_SVR_SESSION_H
-#define R_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
-#include <rm_debug_api.h>
-
-class RLowMemorySecuritySvrSession : public Debug::RSecuritySvrSession
-	{
-public:
-	TInt GetList(const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize);
-	TInt GetList(const TThreadId aThreadId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize);
-	TInt GetList(const TProcessId aProcessId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize);
-protected:
-	virtual void FailAlloc(const TInt aCount) = 0;
-	virtual void HeapReset() = 0;
-	virtual void MarkHeap() = 0;
-	virtual void MarkHeapEnd() = 0;
-	};
-
-#endif //R_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
--- a/kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// r_kernel_low_memory_security_svr_session.cpp
-// Implementation of RUserLowMemorySecuritySvrSession
-// 
-//
-
-#include "r_user_low_memory_security_svr_session.h"
-#include <rm_debug_api.h>
-#ifdef _DEBUG
-#include "low_mem_requests.h"
-#endif
-
-void RUserLowMemorySecuritySvrSession::FailAlloc(const TInt aCount)
-	{
-#ifdef _DEBUG
-	TIpcArgs args(aCount);
-	SendReceive(EDebugServFailAlloc, args);
-#endif
-	}
-
-void RUserLowMemorySecuritySvrSession::HeapReset()
-	{
-#ifdef _DEBUG
-	TIpcArgs args(0);
-	SendReceive(EDebugServFailAlloc, args);
-#endif
-	}
-
-void RUserLowMemorySecuritySvrSession::MarkHeap()
-	{
-#ifdef _DEBUG
-	SendReceive(EDebugServMarkHeap);
-#endif
-	}
-
-void RUserLowMemorySecuritySvrSession::MarkHeapEnd()
-	{
-#ifdef _DEBUG
-	SendReceive(EDebugServMarkEnd);
-#endif
-	}
-
--- a/kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Version of security server session to enable testing of low memory conditions on user side
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef R_USER_LOW_MEMORY_SECURITY_SVR_SESSION_H
-#define R_USER_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
-#include "r_low_memory_security_svr_session.h"
-
-class RUserLowMemorySecuritySvrSession : public RLowMemorySecuritySvrSession
-	{
-protected:
-	void FailAlloc(const TInt aCount);
-	void HeapReset();
-	void MarkHeap();
-	void MarkHeapEnd();
-	};
-
-#endif //R_USER_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
--- a/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4681 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Tests the functionality of the run mode debug device driver.
-//
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <f32dbg.h>
-#include <f32file.h>
-#include <hal.h>
-#include <u32hal.h>
-#include <e32property.h>
-
-#include "t_rmdebug_dll.h"
-
-#include <rm_debug_api.h>
-#include "d_rmdebugthread2.h"
-#include "t_rmdebug2.h"
-#include "t_rmdebug_app.h"
-
-#ifdef __MARM_ARMV4__
-#include "d_rmdebug_step_test_armv4.h"
-#endif
-
-#ifdef __MARM_ARMV5__
-#include "d_rmdebug_step_test.h"
-#include "d_rmdebug_bkpt_test.h"
-#endif
-
-#include "d_demand_paging.h"
-
-#ifdef KERNEL_OOM_TESTING
-	#ifdef USER_OOM_TESTING
-		#error "Cannot define both KERNEL_OOM_TESTING and USER_OOM_TESTING"
-	#endif
-#endif
-
-_LIT8(KCrashDummyData, "This is a sample write");
-
-using namespace Debug;
-
-const TVersion securityServerVersion(0,1,1);
-
-const TVersion testVersion(2,1,0);
-
-IMPORT_C TInt StartDebugThread(RThread& aServerThread, const TDesC& aDebugThreadName);
-IMPORT_D extern TInt TestData;
-IMPORT_D extern TTestFunction FunctionChooser;
-IMPORT_D extern TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-IMPORT_C TInt TestFunction();
-IMPORT_C void TestPagedCode();
-IMPORT_C extern TInt RMDebugDemandPagingTest();
-
-// Device driver name
-_LIT(KDebugDriverFileName,"rm_debug.ldd");
-
-#ifdef SYMBIAN_STANDARDDEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG2"));
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG2_OEM"));
-#endif
-
-#ifdef SYMBIAN_OEM2DEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG2_OEM2"));
-#endif
-
-TBool gUseDelay;
-
-CRunModeAgent::CRunModeAgent()
-//
-// CRunModeAgent constructor
-//
-	{
-	FillArray();
-	RProcess thisProcess;
-	iFileName = thisProcess.FileName();
-	thisProcess.Close();
-	}
-
-CRunModeAgent* CRunModeAgent::NewL()
-//
-// CRunModeAgent::NewL
-//
-	{
-	CRunModeAgent* self = new(ELeave) CRunModeAgent();
-
-  	self->ConstructL();
-
-	return self;
-	}
-
-CRunModeAgent::~CRunModeAgent()
-//
-// CRunModeAgent destructor
-//
-	{
-	User::FreeLogicalDevice(KDebugDriverFileName);
-	iServSession.Close();
-	iDebugThread.Close();
-	}
-
-void CRunModeAgent::ConstructL()
-//
-// CRunModeAgent::ConstructL
-//
-	{
-	// nothing to do here
-	}
-
-void CRunModeAgent::SetupAndAttachToDSS()
-//
-// CRunModeAgent::SetupAndAttachToDSS
-//
-	{
-	TInt err = StartDebugThread(iDebugThread, KDebugThreadName);
-
-	// get the thread id for use in the tests
-	iThreadID = iDebugThread.Id();
-
-	if (err != KErrNone)
-		{
-		User::Panic(_L("Can't start debug thread"), err);
-		}
-
-	err = iServSession.Connect(securityServerVersion);
-	if (err != KErrNone)
-		{
-		User::Panic(_L("Can't open server session"), err);
-		}
-	}
-
-CRunModeAgent *RunModeAgent;
-
-// helper function to check whether the listing of type aListId is supported for a scope of aListScope
-TBool CRunModeAgent::ListingSupported(const TListId aListId, const TListScope aListScope)
-	{
-	TTag tag = GetTag(ETagHeaderList, aListId);
-
-	return (tag.iValue) & aListScope;
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0426
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the list of XIP libraries
-//! @SYMTestActions The XIP library list should be successfully obtained
-//! @SYMTestExpectedResults The specified ldd file should be present in the obtained listing
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetXipLibrariesList()
-	{
-	test.Next(_L("TestGetXipLibrariesList\n"));
-
-	test(ListingSupported(EXipLibraries, EScopeGlobal));
-	test(!ListingSupported(EXipLibraries, EScopeProcessSpecific));
-	test(!ListingSupported(EXipLibraries, EScopeThreadSpecific));
-
-	//allocate a very small buffer so the GetList call initially fails
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	//get the list data
-	DoGetList(EXipLibraries, EScopeGlobal, buffer, size);
-
-	//search the buffer for entry corresponding to the debug kernel driver
-	//which should be in the rom
-	_LIT(KRmDebugLddName, "z:\\sys\\bin\\rm_debug.ldd");
-
-	//iterate through the buffer and set found to ETrue if we find the driver
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TXipLibraryListEntry& xipLibrary = *(TXipLibraryListEntry*)ptr;
-
-		//get the name of the library
-		TPtr name(&xipLibrary.iName[0], xipLibrary.iNameLength, xipLibrary.iNameLength);
-		if(name.CompareF(KRmDebugLddName()) == 0)
-			{
-			//found the library but continue reading the rest of the buffer to
-			//check nothing bad happens towards the end
-			found = ETrue;
-			}
-		//move pointer on to next library
-		ptr += Align4(xipLibrary.GetSize());
-		}
-	test(found);
-
-	//do cleanup
-	buffer.Close();
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0427
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the list of executables
-//! @SYMTestActions The list of debuggable executable files should be obtained
-//! @SYMTestExpectedResults The client exe should appear in the list
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetExecutablesList()
-	{
-	test.Next(_L("TestGetExecutablesList\n"));
-
-	test(ListingSupported(EExecutables, EScopeGlobal));
-	test(!ListingSupported(EExecutables, EScopeProcessSpecific));
-	test(!ListingSupported(EExecutables, EScopeThreadSpecific));
-
-	//allocate a very small buffer so the GetList call initially fails
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//get the list data
-	DoGetList(EExecutables, EScopeGlobal, buffer, size);
-
-	//get this process' name
-	RProcess thisProcess;
-	TFileName thisProcessName = thisProcess.FileName();
-
-	//look through the buffer and check if the target debug thread is there
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TExecutablesListEntry& entry = *(TExecutablesListEntry*)ptr;
-		//get name
-		TPtr name(&entry.iName[0], entry.iNameLength, entry.iNameLength);
-		if( (entry.iIsActivelyDebugged != 0) && (0 == thisProcessName.CompareF(name)) )
-			{
-			//found this process and asserted it is being actively debugged
-			found = ETrue;
-			}
-		//move pointer on to next entry
-		ptr += Align4(entry.GetSize());
-		}
-	test(found);
-
-	//clean up
-	buffer.Close();
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0428
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test error conditions for the GetList calls
-//! @SYMTestActions Multiple calls to test calling GetList with bad arguments
-//! @SYMTestExpectedResults All tests should fail with the appropriate error codes
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetListInvalidData()
-	{
-	test.Next(_L("TestGetListInvalidData\n"));
-
-	//allocate a buffer, the size should not matter as expecting all calls to fail
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	//test what happens if we ask for an unsupported list type globally
-	test(KErrNotSupported == iServSession.GetList((TListId)1234, buffer, size));
-
-	//test what happens if we ask for an unsupported list type
-	test(KErrNotSupported == iServSession.GetList(RThread().Id(), (TListId)1234, buffer, size));
-
-	//test what happens if we try to get a non-global libraries list
-	test(KErrArgument == iServSession.GetList(RThread().Id(), EXipLibraries, buffer, size));
-
-	//test what happens if we try to get a non-global executables list
-	test(KErrArgument == iServSession.GetList(RThread().Id(), EExecutables, buffer, size));
-
-	//test what happens if we try to get a non-global process list
-	test(KErrArgument == iServSession.GetList(RThread().Id(), EProcesses, buffer, size));
-
-	//check that using a process id fails
-	test(KErrArgument == iServSession.GetList(RProcess().Id(), EProcesses, buffer, size));
-
-	//check that specifying a non-existant thread id fails
-	test(KErrArgument == iServSession.GetList((TThreadId)0x12345678, EThreads, buffer, size));
-
-	//check that specifying a non-existant process id fails
-	test(KErrArgument == iServSession.GetList((TProcessId)0x12345678, EThreads, buffer, size));
-
-	//check that specifying a non-existant thread id fails
-	test(KErrArgument == iServSession.GetList((TThreadId)0x12345678, ECodeSegs, buffer, size));
-
-	//check that specifying a non-existant process id fails
-	test(KErrArgument == iServSession.GetList((TProcessId)0x12345678, ECodeSegs, buffer, size));
-
-	//cleanup
-	buffer.Close();
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0429
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the process list
-//! @SYMTestActions Get the process listing
-//! @SYMTestExpectedResults The process listing should be successfully obtained and the current process should be present in the list
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetProcessList()
-	{
-	test.Next(_L("TestGetProcessList\n"));
-
-	test(ListingSupported(EProcesses, EScopeGlobal));
-	test(!ListingSupported(EProcesses, EScopeProcessSpecific));
-	test(!ListingSupported(EProcesses, EScopeThreadSpecific));
-
-	//allocate a very small buffer so the GetList call fails
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	//get the list data
-	DoGetList(EProcesses, EScopeGlobal, buffer, size);
-
-	//initialise data about the target debug thread to compare the kernel's data against
-	RProcess thisProcess;
-	TFileName thisProcessName = thisProcess.FileName();
-	TUint32 processId = thisProcess.Id().Id();
-
-	//look through the buffer and check if the target debug thread is there
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TProcessListEntry& entry = *(TProcessListEntry*)ptr;
-		if( (RProcess().Id().Id() == entry.iProcessId) &&
-			(0 == thisProcessName.CompareF(TPtr(&(entry.iNames[0]), entry.iFileNameLength, entry.iFileNameLength))) &&
-		 	(0 == thisProcess.FullName().CompareF(TPtr(&(entry.iNames[0]) + entry.iFileNameLength, entry.iDynamicNameLength, entry.iDynamicNameLength))) &&
-			0x4321bbbb /* Magic */ == entry.iUid3)
-			{
-			//if all match then we've found it
-			found = ETrue;
-			}
-		ptr += Align4(entry.GetSize());
-		}
-
-	//check whether the expected result happened
-	test(found);
-
-	//clean up
-	buffer.Close();
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0430
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the thread list
-//! @SYMTestActions Get the thread listing globally and for a specified thread or process
-//! @SYMTestExpectedResults The thread listings should all be successfully obtained and the current thread should be present in all listings
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetThreadList()
-	{
-	test.Next(_L("TestGetThreadList\n"));
-
-	test(ListingSupported(EThreads, EScopeGlobal));
-	test(ListingSupported(EThreads, EScopeProcessSpecific));
-	test(ListingSupported(EThreads, EScopeThreadSpecific));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	TBool found = EFalse;
-	
-	/* We need these loops because on some system the kernel run mode debugger does not 
-	 immediately present the thread in the thread list. 
-	 */
-	
-	for(TInt retryCount = 0; retryCount < 10 && !found; retryCount++ )
-		{
-		//test getting this process's thread list, ETrue as should find the target debug thread
-		User::After(50000);
-		found = DoTestGetThreadList(ETrue, EScopeProcessSpecific, RProcess().Id().Id());
-		}
-	test( found );
-	found = EFalse;
-
-	for(TInt retryCount = 0; retryCount < 10 && !found; retryCount++ )
-		{
-		//test getting the global list, ETrue as should find the target debug thread
-		User::After(50000);
-		found = DoTestGetThreadList(ETrue, EScopeGlobal);
-		}
-	test( found );
-
-	found = EFalse;
-	for(TInt retryCount = 0; retryCount < 10 && !found; retryCount++ )
-		{
-		//test getting this thread's thread list, ETrue as should find the target debug thread
-		User::After(50000);
-		found = DoTestGetThreadList(ETrue, EScopeThreadSpecific, RThread().Id().Id());
-		}
-	test( found );
-
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-			
-TBool CRunModeAgent::DoTestGetThreadList(const TBool aShouldPass, const TListScope aListScope, const TUint64 aTargetId)
-	{
-	//create data to pass
-	RBuf8 buffer;
-	TUint32 size = 0;
-
-	//perform the call to get the thread list
-	DoGetList(EThreads, aListScope, buffer, size, aTargetId);
-
-	//initialise data about the target debug thread to compare the kernel's data against
-	TFileName name = iDebugThread.FullName();
-	RProcess thisProcess;
-	TUint64 processId = thisProcess.Id();
-	TUint64 threadId = iDebugThread.Id();
-
-	//look through the buffer and check if the target debug thread is there
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TThreadListEntry* entry = (TThreadListEntry*)ptr;
-		TPtr entryName(&(entry->iName[0]), entry->iNameLength, entry->iNameLength);
-
-		if( (threadId == entry->iThreadId) && (processId == entry->iProcessId) && (0 == name.CompareF(entryName)) )
-			{
-			test(entry->iSupervisorStackBaseValid);
-			test(entry->iSupervisorStackSizeValid);
-			//if all match then we've found it
-			found = ETrue;
-			break;
-			}
-
-		ptr += Align4(entry->GetSize());
-		}
-
-	//clean up
-	buffer.Close();
-	return found;
-
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0431
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the code segment list
-//! @SYMTestActions Get the code segment list global and for a specified thread
-//! @SYMTestExpectedResults The listings should be returned successfully
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetCodeSegsList()
-	{
-	test.Next(_L("TestGetCodeSegsList\n"));
-
-	test(ListingSupported(ECodeSegs, EScopeGlobal));
-	test(ListingSupported(ECodeSegs, EScopeProcessSpecific));
-	test(ListingSupported(ECodeSegs, EScopeThreadSpecific));
-
-	// Cannot perform this test with OEM2 debug token, as the t_rmdebug2 app
-	// needs AllFiles, and the OEM2 debug token does not authorise this.
-	// It seems reasonable to suppose that it would work anyway
-
-#ifndef SYMBIAN_OEM2DEBUG
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
- 	//test getting the global list, ETrue as should find this process' main codeSeg
-	DoTestGetCodeSegsList(ETrue, EScopeGlobal);
-
-	//test getting this process' codeSegs, ETrue as should find this process' main codeSeg
-	DoTestGetCodeSegsList(ETrue, EScopeProcessSpecific, RProcess().Id().Id());
-
-	//test getting this thread's codeSegs, ETrue as should find this process' main codeSeg
-	DoTestGetCodeSegsList(ETrue, EScopeThreadSpecific, RThread().Id().Id());
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-#endif // SYMBIAN_OEM2DEBUG
-
-	}
-
-void CRunModeAgent::DoTestGetCodeSegsList(const TBool aShouldPass, const TListScope aListScope, const TUint64 aTargetId)
-	{
-	//create data to pass
-	RBuf8 buffer;
-	TUint32 size = 0;
-
-	//perform the call to get the Code segs
-	DoGetList(ECodeSegs, aListScope, buffer, size, aTargetId);
-
-	//create memoryInfo to contain info about this process
-	RProcess thisProcess;
-	TModuleMemoryInfo memoryInfo;
-	test(KErrNone == thisProcess.GetMemoryInfo(memoryInfo));
-
-	// check whether this process came from a file in ROM so we know whether to
-	// expect the code seg to be XIP or not.
-	RFs fs;
-	test(KErrNone == fs.Connect());
-	TBool thisFileIsInRom = EFalse;
-	if(fs.IsFileInRom(iFileName))
-		{
-		thisFileIsInRom = ETrue;
-		}
-
-	//look through the buffer to find this process' main code seg
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TCodeSegListEntry* codeSeg = (TCodeSegListEntry*)ptr;
-
-		if( (codeSeg->iIsXip == thisFileIsInRom) && (0 == iFileName.CompareF(TPtr(&(codeSeg->iName[0]), codeSeg->iNameLength, codeSeg->iNameLength))) )
-			{
-			if( (memoryInfo.iCodeBase == codeSeg->iCodeBase) &&
-					(memoryInfo.iCodeSize == codeSeg->iCodeSize) &&
-					(memoryInfo.iConstDataSize == codeSeg->iConstDataSize) &&
-					(memoryInfo.iInitialisedDataBase == codeSeg->iInitialisedDataBase) &&
-					(memoryInfo.iInitialisedDataSize == codeSeg->iInitialisedDataSize) &&
-					(memoryInfo.iUninitialisedDataSize == codeSeg->iUninitialisedDataSize))
-				{
-				//all matched so means we've found the codeSeg we're looking for
-				found = ETrue;
-				}
-			}
-		ptr += Align4(codeSeg->GetSize());
-		}
-
-	//check whether the result was as expected
-	test(found == aShouldPass);
-
-	// only care about rm_debug.ldd if we have global scope (belongs to the system not this process)
-	if (aListScope == EScopeGlobal)
-	{
-		// Search for rm_debug.ldd library and check its UID3 is correct
-		found = EFalse;
-
-_LIT(KRMDebugDriverFileName,"Z:\\sys\bin\\rm_debug.ldd");
-
-		TFileName rmdebugFilename(KRMDebugDriverFileName);
-
-		// reset the Ptr
-		ptr = (TUint8*)buffer.Ptr();
-		ptrEnd = ptr+size;
-		while(ptr < ptrEnd)
-		{
-			TCodeSegListEntry* codeSeg = (TCodeSegListEntry*)ptr;
-
-			if( rmdebugFilename.CompareF(TPtr(&(codeSeg->iName[0]), codeSeg->iNameLength, codeSeg->iNameLength)))
-				{
-				if(codeSeg->iUid3 == 0x101f7157 /* Magic */)
-					{
-					//all matched so means we've found the codeSeg we're looking for
-					found = ETrue;
-					}
-				}
-			ptr += Align4(codeSeg->GetSize());
-		}
-		test((TUint32)found == (TUint32)ETrue);
-	}
-
-	//clean up
-	buffer.Close();
-
-	}
-
-
-/**
- * Get a list from the run mode debug system. Most list calls will initially return KErrTooBig, 
- * since the initial size of the buffer is 0. However it is sometimes valid for a list to be empty
- * given its filtering and scope. These calls should return KErrNone.
- */
-void CRunModeAgent::DoGetList(const TListId aListId, const TListScope aListScope, RBuf8& aBuffer, TUint32& aSize, const TUint64 aTargetId)
-	{
-	//close the buffer in case there's stuff allocated in it
-	aBuffer.Close();
-	//initialise it to be one byte big, which will guarantee data won't fit in it
-	test(KErrNone == aBuffer.Create(1));
-	aSize = 0;
-	
-	TInt ret = KErrNone;
-	//should pass this test (assuming we've passed in sensible arguments above...)
-	if(EScopeGlobal == aListScope)
-		{
-		ret = iServSession.GetList(aListId, aBuffer, aSize);
-		}
-	else if(EScopeThreadSpecific == aListScope)
-		{
-		ret = iServSession.GetList((TThreadId)aTargetId, aListId, aBuffer, aSize);
-		}
-	else if(EScopeProcessSpecific == aListScope)
-		{
-		ret = iServSession.GetList((TProcessId)aTargetId, aListId, aBuffer, aSize);
-		}
-	else
-		{
-		// unknown list scope
-		test(0);
-		}
-
-	if( KErrNone == ret )
-		{
-		/* In the case that there is no data, just return and let the caller check
-		the buffer. It is valid for a caller to not expect any data to be returned.
-		*/
-		return;
-		}
-	
-	// The only other allowed return is KErrTooBig
-	test( ret == KErrTooBig );
-
-	//keep allocating larger buffers, beginning with the aSize returned by the above call,
-	//and hopefully we'll eventually make a large enough one
-	test(KErrNone == aBuffer.ReAlloc(aSize));
-
-	for(;;)
-		{
-		TInt err = KErrNone;
-		if(EScopeGlobal == aListScope)
-			{
-			err = iServSession.GetList(aListId, aBuffer, aSize);
-			}
-		else if(EScopeThreadSpecific == aListScope)
-			{
-			err = iServSession.GetList((TThreadId)aTargetId, aListId, aBuffer, aSize);
-			}
-		else if(EScopeProcessSpecific == aListScope)
-			{
-			err = iServSession.GetList((TProcessId)aTargetId, aListId, aBuffer, aSize);
-			}
-		else
-			{
-			// unknown list scope
-			test(0);
-			}
-		if(err == KErrTooBig)
-			{
-			//wasn't big enough so double it
-			aSize = aSize << 1;
-			err = aBuffer.ReAlloc(aSize);
-			if(err != KErrNone)
-				{
-				//print out a message if couldn't allocate memory and quit
-				test.Printf(_L("Out ot memory when attempting to allocate %d bytes."), aSize);
-				test(KErrNone == err);
-				}
-
-			//fairly arbitrary test, we don't have a max size for these calls.
-			//In reality a list would have to have many thousands of elements
-			//to break this test which shouldn't really happen
-			test(aSize <= 0x4000);
-			}
-		else
-			{
-			test(KErrNone == err);
-			test(aBuffer.Length() == aSize);
-			//break out of the loop if the list has been successfully read in
-			break;
-			}
-		}
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0432
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading and writing memory
-//! @SYMTestActions Multiple calls to read and write memory, with various sizes and at various locations.
-//!	Also test that bad input values cause appropriate errors to be returned.
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestMemoryAccess()
-{
-	TInt err;
-
-	test.Next(_L("TestMemoryAccess - Read Memory\n"));
-
-	//initialise buffer
-	gMemoryAccessBytes.SetLength(0);
-	for (TInt i=0; i<SYMBIAN_RMDBG_MEMORYSIZE; i++)
-		{
-		gMemoryAccessBytes.Append(i);
-		}
-
-	TUint32 address = (TUint32)(&gMemoryAccessBytes[0]);
-	TUint32 dataSize = SYMBIAN_RMDBG_MEMORYSIZE;
-
-	//create size for buffer that is rounded up to nearest 4 bytes if not
-	//already 4 byte aligned
-	TUint32 size = dataSize;
-	if(size % 4 != 0)
-		{
-		size += (4 - (size % 4));
-		}
-
-	RBuf8 dataBlock;
-	err = dataBlock.Create(size);
-	test(err==KErrNone);
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend the thread prior to memory operations
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	err = iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	for (TInt i=0; i<dataSize; i++)
-		{
-		test(dataBlock.Ptr()[i] == gMemoryAccessBytes[i]);
-		}
-
-	test.Next(_L("TestMemoryAccess - Write Memory\n"));
-
-	// Now reset the buffer
-	for (TInt i=0; i<dataSize; i++)
-		{
-		gMemoryAccessBytes[i] = 0;
-		}
-
-	// Write our data into the buffer
-	err = iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	for (TInt i=0; i<dataSize; i++)
-		{
-		test(dataBlock.Ptr()[i] == gMemoryAccessBytes[i]);
-		}
-
-	//final test that everything's not been going wrong
-	test(gMemoryAccessBytes[5] != 0);
-
-	test.Next(_L("TestMemoryAccess - Invalid arguments\n"));
-	test.Printf(_L("This test may emit crash-like information. This is intended.\n"));
-
-	//test address that is not 32 bit aligned
-	err = iServSession.ReadMemory(iThreadID, address + 1, size, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//test size that is not multiple of 4 bytes
-	err = iServSession.WriteMemory(iThreadID, address, size + 2, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//test size > max block size
-	err = iServSession.ReadMemory(iThreadID, address, (1<<15), dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//test access size == 2 bytes
-	err = iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess16, EEndLE8);
-	test(err == KErrNotSupported);
-
-	//test access size == 1 byte
-	err = iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess8, EEndLE8);
-	test(err == KErrNotSupported);
-
-	//test endianess == EEndBE8
-	err = iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess32, EEndBE8);
-	test(err == KErrNotSupported);
-
-	//test endianess == EEndBE32
-	err = iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess32, EEndBE32);
-	test(err == KErrNotSupported);
-
-	//test reading off end of memory
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x00000101, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//The following three tests check that edge conditions in the range check are handled correctly.
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x000000FF, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x000000F0, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrBadDescriptor);
-
-	//Third range check test. Check that range check is handled correctly even when base + size wraps to 0.
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x00000100, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrBadDescriptor);
-	//end of range check tests
-
-	//test size == 0
-	err = iServSession.WriteMemory(iThreadID, address, 0, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//attempt to write to address outside of process data segments,
-	//this address corresponds to the vectors so shouldn't be able to write
-	err = iServSession.WriteMemory(iThreadID, 0xffff0000, size, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrBadDescriptor);
-
-	//attempt to read and write to address in process code segment
-
-	//open a handle to the thread
-	RThread debugThread;
-	test(debugThread.Open(iThreadID) == KErrNone);
-
-	//get a reference to the debug process
-	RProcess debugProcess;
-	test(debugThread.Process(debugProcess) == KErrNone);
-
-	//get the memory info for the process
-	TProcessMemoryInfo info;
-	test(debugProcess.GetMemoryInfo(info) == KErrNone);
-
-	address = info.iCodeBase;
-	if(size <= info.iCodeSize)
-		{
-		test(KErrNone == iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8));
-		test(KErrBadDescriptor == iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8));
-		}
-
-	// Some performance tests now
-	TUint32 bytesRead = 0;
-
-	// Allocate a data buffer
-	TUint32* p = (TUint32*)User::Alloc(size);
-	test(p != 0);
-
-	TInt nanokernel_tick_period;
-	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-	test (nanokernel_tick_period != 0);
-
-	static const TInt KOneMillion = 1000000;
-
-	TInt nkTicksPerSecond = KOneMillion/nanokernel_tick_period;
-
-	TUint32 stopTickCount = User::NTickCount() + nkTicksPerSecond;
-
-	while (User::NTickCount() < stopTickCount)
-		{
-		err = iServSession.ReadMemory(iThreadID, (TUint32)p, size, dataBlock, EAccess32, EEndLE8);
-		test(err==KErrNone);
-
-		// Increase the count of bytes read
-		bytesRead += size;
-		}
-
-	test(bytesRead != 0);
-	iMemoryReadKbytesPerSecond = bytesRead/1024;
-
-	// write memory test
-	TUint32 bytesWritten = 0;
-
-	stopTickCount = User::NTickCount() + nkTicksPerSecond;
-
-	while (User::NTickCount() < stopTickCount)
-		{
-		err = iServSession.WriteMemory(iThreadID, (TUint32)p, size, dataBlock, EAccess32, EEndLE8);
-		test(err==KErrNone);
-
-		// Increase the count of bytes read
-		bytesWritten += size;
-		}
-
-	test (bytesWritten != 0);
-	iMemoryWriteKbytesPerSecond = bytesWritten/1024;
-
-	User::Free(p);
-
-	//resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	debugThread.Close();
-	dataBlock.Close();
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0433
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test suspending and resuming threads
-//! @SYMTestActions Multiple calls to suspend and resume threads with and without attaching to the thread
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestSuspendResume()
-	{
-	TInt err;
-
-	test.Next(_L("TestSuspendResume - Suspend\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	// Suspend the thread
-	err = iServSession.SuspendThread(iThreadID);
-	test(err==KErrNone);
-	TInt localtestdata;
-	localtestdata = TestData;
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check data hasnt changed
-	test(localtestdata==TestData);
-
-	// Resume the thread
-	test.Next(_L("TestSuspendResume - Resume\n"));
-	err = iServSession.ResumeThread(iThreadID);
-	test(err==KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check that the thread being controlled has resumed and is
-	// updating the variable
-	test(localtestdata!=TestData);
-
-	// check that agent can resume thread which it previously detached from
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	// check that agent cannot suspend thread which it previously suspended and then detached from
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrAlreadyExists == iServSession.SuspendThread(iThreadID));
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0434
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the debug functionality from the driver
-//! @SYMTestActions Get the size and contents of the debug functionality block
-//! @SYMTestExpectedResults All tests should pass and the expected data should appear in the functionality block
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestDebugFunctionality()
-	{
-
-	TInt err;
-
-	test.Next(_L("TestDebugFunctionality - GetDebugFunctionalityBufSize\n"));
-
-	TUint32 bufsize = 0;	// Safe default size
-
-	// Get functionality block size
-	err = iServSession.GetDebugFunctionalityBufSize(&bufsize);
-	test(err==KErrNone);
-	test.Next(_L("TestDebugFunctionality - GetDebugFunctionality\n"));
-
-	// Ensure we have a finite buffer size
-	test(bufsize!=0);
-
-	// Allocate space for the functionality data
-	HBufC8* dftext = HBufC8::NewLC(bufsize);
-
-	// create an empty TPtr8 refering to dftext
-	TPtr8 dftextPtr(dftext->Des());
-
-	// Get the functionality block
-	err = iServSession.GetDebugFunctionality(dftextPtr);
-	test(err==KErrNone);
-
-	// Check that the first entry is correct
-	TTagHeader RefHdr =
-	{
-		ETagHeaderIdCore,ECoreLast,
-	};
-
-	// First header passed from rm_debug.ldd
-	TTagHeader* TestHdr = (TTagHeader*)dftextPtr.Ptr();
-
-	// Check
-	test(RefHdr.iTagHdrId==TestHdr->iTagHdrId);
-	// this test might fail if the agent is used with a Debug Security Server different from
-	// the one it was compiled against. So removing it for now.
-	//test(RefHdr.iNumTags==TestHdr->iNumTags);
-
-	// read a value from the data to check it has come through as expected
-	TTagHeader* header = GetTagHdr(dftext->Des(), ETagHeaderIdApiConstants);
-	test(header != NULL);
-	TTag* tag = GetTag(header, EApiConstantsTEventInfoSize);
-	test(tag != NULL);
-	// this test might fail if the agent is used with a Debug Security Server different from
-	// the one it was compiled against. So removing it for now.
-	//test(sizeof(TEventInfo) == tag->iValue);
-
-	// Remove our temporary buffer
-	CleanupStack::PopAndDestroy(dftext);
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0435
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test setting and clearing consecutive breakpoints
-//! @SYMTestActions Set and clear consecutive breakpoints of all combinations of breakpoint types
-//! @SYMTestExpectedResults All breakpoints should be set and cleared without error
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestConsecutiveBreakPoints()
-	{
-	test.Next(_L("TestConsecutiveBreakPoints\n"));
-
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	// just a temporary structure for storing info about a breakpoint
-	struct TBreakPoint
-		{
-	public:
-		TBreakPoint()
-			:iId(0),
-			iMode((TArchitectureMode)0),
-			iAddress(0)
-			{}
-		TBreakId iId;
-		TArchitectureMode iMode;
-		TUint32 iAddress;
-		inline TInt Size() { return (EArmMode == iMode) ? 4 : 2; }
-		};
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	// there are six orders in which three breakpoints can be set, these are looped
-	// through below to check setting and clearing consecutive breakpoints works
-	TUint8 order[6][3] =
-		{
-			{0,1,2},
-			{0,2,1},
-			{1,0,2},
-			{1,2,0},
-			{2,0,1},
-			{2,1,0}
-		};
-
-	// The following code checks that setting and clearing consecutive breakpoints works correctly:
-	// It checks that setting all combinations of three arm and thumb breakpoints succeeds, and check that the
-	// breakpoints can be set in any order, and then cleared in any order
-
-	// the 3 least significant bits of i control whether each of the three breakpoints should be arm or thumb
-	for(TInt i=0; i<8; i++)
-		{
-		// controls the order in which the breakpoints should be set
-		for(TInt j=0; j<6; j++)
-			{
-			// create the three breakpoints and set their modes
-			TBreakPoint bp[3];
-			bp[0].iMode = (i&1) ? EArmMode : EThumbMode;
-			bp[1].iMode = (i&2) ? EArmMode : EThumbMode;
-			bp[2].iMode = (i&4) ? EArmMode : EThumbMode;
-
-			// set the address of each of the breakpoints
-			bp[0].iAddress = address;
-			if(EArmMode == bp[0].iMode)
-				{ // if an arm breakpoint then must be on a four byte boundary
-				bp[0].iAddress = Align4(bp[0].iAddress);
-				}
-			bp[1].iAddress = bp[0].iAddress + bp[0].Size();
-			if(EArmMode == bp[1].iMode)
-				{ // if an arm breakpoint then must be on a four byte boundary
-				bp[1].iAddress = Align4(bp[1].iAddress);
-				}
-			bp[2].iAddress = bp[1].iAddress + bp[1].Size();
-			if(EArmMode == bp[2].iMode)
-				{ // if an arm breakpoint then must be on a four byte boundary
-				bp[2].iAddress = Align4(bp[2].iAddress);
-				}
-			for(TInt k=0; k<6; k++)
-				{
-				// set the three breakpoints in the order defined by j and then clear them in the order defined by k
-				test(KErrNone==iServSession.SetBreak(bp[order[j][0]].iId, iThreadID, bp[order[j][0]].iAddress, bp[order[j][0]].iMode));
-				test(KErrNone==iServSession.SetBreak(bp[order[j][1]].iId, iThreadID, bp[order[j][1]].iAddress, bp[order[j][1]].iMode));
-				test(KErrNone==iServSession.SetBreak(bp[order[j][2]].iId, iThreadID, bp[order[j][2]].iAddress, bp[order[j][2]].iMode));
-				test(KErrNone==iServSession.ClearBreak(bp[order[k][0]].iId));
-				test(KErrNone==iServSession.ClearBreak(bp[order[k][1]].iId));
-				test(KErrNone==iServSession.ClearBreak(bp[order[k][2]].iId));
-				}
-			}
-		}
-
-	// resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0436
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test breakpoint functionality
-//! @SYMTestActions Multiple calls to set and clear breakpoints. Checking bad input produces appropriate errors.
-//! @SYMTestExpectedResults All tests should pass and the target debug thread should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestBreakPoints()
-	{
-	TInt err;
-
-	test.Next(_L("TestBreakPoints - Set\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	TestConsecutiveBreakPoints();
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	/*
-	 * Ensure that breakpoint operations don't
-	 * affect memory read/write by checking that reads/writes
-	 * in locations containing breakpoints don't change behaviour
-	 * because of the breakpoints.
-	 */
-
-	TUint32 size = SYMBIAN_RMDBG_MEMORYSIZE;
-
-	RBuf8 originalDataBlock;
-	err = originalDataBlock.Create(size);
-	test(err==KErrNone);
-
-	//suspend the thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	err = iServSession.ReadMemory(iThreadID, address, size, originalDataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	// Test data block for comparison
-	RBuf8 testDataBlock;
-	err = testDataBlock.Create(size);
-	test(err==KErrNone);
-
-	/*
-	 * set an arm breakpoint
-	 */
-	TBreakId armBreakId = 0;
-	err = iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode);
-	test(err == KErrNone);
-
-	// Ensure that memory read is not corrupted
-	err = iServSession.ReadMemory(iThreadID, address, size, testDataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	test (testDataBlock == originalDataBlock);
-
-	/*
-	 * set a thumb breakpoint
-	 */
-	TBreakId thumbBreakId = 0;
-	err = iServSession.SetBreak(thumbBreakId, iThreadID, address+4, EThumbMode);
-	test(err == KErrNone);
-
-	/*
-	 * set a thumb2EE breakpoint
-	 */
-	TBreakId thumb2EEBreakId = 0;
-	err = iServSession.SetBreak(thumb2EEBreakId, iThreadID, address+8, EThumb2EEMode);
-	test(err == KErrNotSupported);
-
-	/*
-	 * overlapping breakpoint (same address/threadId/mode)
-	 */
-	TBreakId overlapBreakId = 0;
-	err = iServSession.SetBreak(overlapBreakId, iThreadID, address, EArmMode);
-	test(err == KErrAlreadyExists);
-
-	/*
-	 * overlapping breakpoint (different address/same threadId/different mode)
-	 *
-	 * address - EArmBreakpoint
-	 * address+2 - EThumbBreakpoint
-	 */
-	TBreakId overlap2BreakId = 0;
-	err = iServSession.SetBreak(overlap2BreakId, iThreadID, address+2, EThumbMode);
-	test(err == KErrAlreadyExists);
-
-	/*
-	 * Un-aligned address (arm)
-	 */
-	TBreakId armUnalignedBreakId = 0;
-	err = iServSession.SetBreak(armUnalignedBreakId, iThreadID, address+6, EArmMode);
-	test(err == KErrArgument);
-
-	/*
-	 * Un-aligned address (thumb)
-	 */
-	TBreakId thumbUnalignedBreakId = 0;
-	err = iServSession.SetBreak(thumbUnalignedBreakId, iThreadID, address+7, EThumbMode);
-	test(err == KErrArgument);
-
-	/*
-	 * Invalid address (arm)
-	 */
-	TBreakId armBadAddressBreakId = 0;
-	err = iServSession.SetBreak(armBadAddressBreakId, iThreadID, 0 /* address */, EThumbMode);
-	test(err == KErrBadDescriptor);
-
-	/*
-	 * Different thread, same address. Should fail for the same process, but succeed
-	 * for a different process.
-	 */
-
-	/*
-	 * Invalid thread
-	 */
-	TBreakId invalidThreadBreakId = 0;
-	err = iServSession.SetBreak(invalidThreadBreakId, 0xbabababa, address, EThumbMode);
-	test(err == KErrPermissionDenied);
-
-	// Clear the ARM breakpoint
-	err = iServSession.ClearBreak(armBreakId);
-	test(err == KErrNone);
-
-	// Clear the Thumb breakpoint
-	err = iServSession.ClearBreak(thumbBreakId);
-	test(err == KErrNone);
-
-	// to do : two threads at the same address
-	// to do : two processes at the same address
-
-	// Ensure that memory read is not corrupted after clearing the breakpoints
-	err = iServSession.ReadMemory(iThreadID, address, size, testDataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	test (testDataBlock == originalDataBlock);
-
-	/*
-	 * How fast can we set breakpoints?
-	 *
-	 * Measure the time by setting/clearing breakpoints for 1 second.
-     */
-	TInt nanokernel_tick_period;
-	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-	test (nanokernel_tick_period != 0);
-
-	TInt nkTicksPerSecond = HelpTicksPerSecond();
-
-	TInt breaksPerSecond = 0;
-
-	TUint32 stopTickCount = User::NTickCount() + nkTicksPerSecond;
-
-	while (User::NTickCount() < stopTickCount)
-		{
-		// set the breakpoint
-		TBreakId armBreakId = 0;
-		err = iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode);
-		test(err == KErrNone);
-
-		// Clear the breakpoint
-		err = iServSession.ClearBreak(armBreakId);
-		test(err == KErrNone);
-
-		// Update the count of breakpoints
-		breaksPerSecond++;
-
-		// Gone wrong if we wrap to negative breakpoints (cannot set 2billion/second!)
-		test(breaksPerSecond >0);
-		}
-
-	// Store the results for later
-	iBreakpointsPerSecond = breaksPerSecond;
-
-	/*
-	 * How many breakpoints can we set?
-	 */
-
-	TBool done = EFalse;
-
-	// We assume all the breakpoints id's are issued in ascending order
-	TInt maxBreakPoints = 0;
-
-	// Temporary buffer
-	RArray<TBreakId> breakIdList;
-
-	TUint32 testAddress = address;
-
-	while(!done)
-		{
-		TBreakId breakId = 0;
-
-		// set the breakpoint
-		testAddress += 4;	// ensure the addresses don't overlap
-
-		err = iServSession.SetBreak(breakId, iThreadID, testAddress, EArmMode);
-		test (err == KErrNone || err == KErrOverflow);
-		if (err != KErrNone)
-			{
-			// we've reached the limit of the number of breaks we can set
-			done = ETrue;
-			break;
-			}
-
-		// store the id of this breakpoint
-		breakIdList.Append(breakId);
-
-		// Increase the count of breakpoints
-		maxBreakPoints++;
-		test(maxBreakPoints > 0);
-		}
-
-	// How many breakpoints can we set?
-	iMaxBreakpoints = maxBreakPoints;
-
-	// now clear all those breakpoints again
-	while(breakIdList.Count() != 0)
-		{
-		// Place it into a TBreakId
-		TBreakId id = breakIdList[0];
-
-		err = iServSession.ClearBreak(id);
-		test(err == KErrNone);
-
-		// next id
-		breakIdList.Remove(0);
-		}
-
-	breakIdList.Close();
-
-	// close our temporary buffers
-	originalDataBlock.Close();
-	testDataBlock.Close();
-
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0437
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test modifying breakpoints
-//! @SYMTestActions Several calls to modify breakpoints
-//! @SYMTestExpectedResults Valid requests should result in the breakpoints being changed, invalid requests should return errors
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestModifyBreak()
-	{
-	test.Next(_L("TestModifyBreak\n"));
-
-	DoTestModifyBreak(ETrue);
-	DoTestModifyBreak(EFalse);
-	}
-
-void CRunModeAgent::DoTestModifyBreak(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestModifyBreak: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend the thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	//set an arm mode break point
-	TBreakId armBreakId = 0;
-	err = aThreadSpecific
-		? iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode)
-		: iServSession.SetProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	/*
-	 * Invalid thread
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, 0xbabababa, address, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, 0xbabababa, address, EArmMode);
-	test(err == KErrPermissionDenied);
-
-	/*
-	 * Valid address
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address+4, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address+4, EArmMode);
-	test(err == KErrNone);
-
-	/*
-	 * Invalid address
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, 0, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, 0, EArmMode);
-	test(err == KErrBadDescriptor);
-
-	/*
-	 * Thumb mode
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address, EThumbMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, EThumbMode);
-	test(err == KErrNone);
-
-	/*
-	 * Thumb2EE mode
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address, EThumb2EEMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, EThumb2EEMode);
-	test(err == KErrNotSupported);
-
-	/*
-	 * Arm mode
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	// Finally, clear the breakpoint
-	err = iServSession.ClearBreak(armBreakId);
-	test(err == KErrNone);
-
-	//resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0438
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test extracting information about breakpoints
-//! @SYMTestActions Several calls to get information about breakpoints
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestBreakInfo()
-	{
-	test.Next(_L("TestBreakInfo\n"));
-
-	DoTestBreakInfo(ETrue);
-	DoTestBreakInfo(EFalse);
-	}
-
-void CRunModeAgent::DoTestBreakInfo(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestModifyBreak: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	//set an arm mode break point
-	TBreakId armBreakId = 0;
-	err = aThreadSpecific
-		? iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode)
-		: iServSession.SetProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	// Read back the information and check it is correct
-	TThreadId testThreadId = TThreadId(0);
-	TProcessId testProcessId = TProcessId(0);
-	TUint32 testAddress = 0;
-	TArchitectureMode testMode = EArmMode;
-
-	err = aThreadSpecific
-		? iServSession.BreakInfo(armBreakId,testThreadId,testAddress, testMode)
-		: iServSession.ProcessBreakInfo(armBreakId, testProcessId, testAddress, testMode);
-	test (err == KErrNone);
-	test (aThreadSpecific ? (testThreadId == iThreadID) : (testProcessId == processId));
-	test (testAddress == address);
-	test (testMode == EArmMode);
-
-	//change the address
-	TUint32 changeAddress = address + 64;
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, changeAddress,EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, changeAddress, EArmMode);
-	test(err == KErrNone);
-
-	// Check the address has changed
-	err = aThreadSpecific
-		? iServSession.BreakInfo(armBreakId,testThreadId,testAddress, testMode)
-		: iServSession.ProcessBreakInfo(armBreakId, testProcessId, testAddress, testMode);
-	test (err == KErrNone);
-	test (testAddress == changeAddress);
-
-	// change the architecture type
-	TArchitectureMode checkMode = EThumbMode;
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address,checkMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, checkMode);
-	test (err == KErrNone);
-
-	// Check the mode has changed
-	err = aThreadSpecific
-		? iServSession.BreakInfo(armBreakId,testThreadId,testAddress,testMode)
-		: iServSession.ProcessBreakInfo(armBreakId, testProcessId, testAddress, testMode);
-	test (err == KErrNone);
-	test (testMode == checkMode);
-
-	// clear the breakpoint again
-	err = iServSession.ClearBreak(armBreakId);
-	test (err == KErrNone);
-
-	//resume thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-// Needed for the RunToBreak test
-IMPORT_C extern void RMDebug_BranchTst1();
-IMPORT_C extern void RMDebug_BranchTst2();
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0439
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test hitting various types of breakpoints
-//! @SYMTestActions Several calls to register to observe breakpoints and to hit breakpoints of different types
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestRunToBreak()
-	{
-	test.Next(_L("TestRunToBreak\n"));
-
-	DoTestRunToBreak(ETrue);
-	DoTestRunToBreak(EFalse);
-	}
-
-void CRunModeAgent::DoTestRunToBreak(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestRunToBreak: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err = KErrNone;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	// we should suspend the thread first, then set the breakpoint
-	err = iServSession.SuspendThread(iThreadID);
-	test (err == KErrNone);
-
-	// Try to set the breakpoint
-	TBreakId armBreakId;
-	TUint32 address = (TUint32)(&RMDebug_BranchTst1);
-
-	err = aThreadSpecific
-		? iServSession.SetBreak(armBreakId,iThreadID,address,EArmMode)
-		: iServSession.SetProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	err = aThreadSpecific
-		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionContinue)
-		: iServSession.SetEventAction(iFileName,EEventsProcessBreakPoint, EActionContinue);
-	test (err == KErrNone);
-
-	// Continue the thread
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-
-	// wait for the breakpoint to be hit
-	TEventInfo info;
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iEventType == (aThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint));
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	// Not interested in breakpoint events any more
-	err = aThreadSpecific
-		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore)
-		: iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionIgnore);
-	test (err == KErrNone);
-
-	// Clear the breakpoint again
-	err = iServSession.ClearBreak(armBreakId);
-	test(err == KErrNone);
-
-	// continue the thread again
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-rmdebug2-2704
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test breakpoints in a loop
-//! @SYMTestActions Several calls to register to verify breakpoints are stopping at correct address
-//! @SYMTestExpectedResults All tests should pass and the target thread should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestBreakPointsInLoop()
-	{
-	test.Next(_L("TestBreakPointsInLoop\n"));
-
-	DoTestBreakPointsInLoop(ETrue);
-	DoTestBreakPointsInLoop(EFalse);
-	}
-
-void CRunModeAgent::DoTestBreakPointsInLoop(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestBreakPointsInLoop: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err = KErrNone;
-	TProcessId processId = RProcess().Id(); 
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	
-	// We should suspend the thread first, then set the breakpoint
-	err = iServSession.SuspendThread(iThreadID);
-	test (err == KErrNone);
-
-	// 2 breakpoints are sufficient to find issues with hitting breakpoints in a loop
-	const TInt numOfBreakPointsInLoop = 2;
-
-	TBreakId armBreakId[numOfBreakPointsInLoop];
-	TUint32 address[numOfBreakPointsInLoop];
-   	
-	TUint32 entryAddress = (TUint32)(&RMDebug_Bkpt_Test_Entry);
-	TBreakId entryArmBreakId;
-
-	// Copy breakpoint address's in array
-	address[0] = (TUint32)(&RMDebug_Bkpt_Test_Loop_Break_1);
-	address[1] = (TUint32)(&RMDebug_Bkpt_Test_Loop_Break_2);
-
-	err = aThreadSpecific
-		? iServSession.SetBreak(entryArmBreakId,iThreadID,entryAddress,EArmMode)
-		: iServSession.SetProcessBreak(entryArmBreakId, processId, entryAddress, EArmMode);
-	test(err == KErrNone);
-
-	// Try to set the breakpoints inside loop
-	for (TInt i = 0; i < numOfBreakPointsInLoop; i++)
-		{
-		err = aThreadSpecific
-			? iServSession.SetBreak(armBreakId[i],iThreadID,address[i],EArmMode)
-			: iServSession.SetProcessBreak(armBreakId[i], processId, address[i], EArmMode);
-		test(err == KErrNone);
-		}
-
-	err = aThreadSpecific
-		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionContinue)
-		: iServSession.SetEventAction(iFileName,EEventsProcessBreakPoint, EActionContinue);
-	test (err == KErrNone);
-
-	// Continue the thread
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-
-	// Wait for the breakpoint to be hit
-	TEventInfo info;
-	TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Wait for notification of breakpoint event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Info should now be filled with the details
-	test(info.iEventType == (aThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint));
-
-	// Have we stopped at the correct breakpoint?
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == entryAddress);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	// Don't require the entry breakpoint anymore
-	err = iServSession.ClearBreak(entryArmBreakId);
-	test(err == KErrNone);
-	
-	// Stress the system by setting loop count to 100
-	const TUint32 loopCount = 100;
-
-	for (TInt i = 0; i < loopCount; i++)
-		{
-		// Continue the thread
-		err = iServSession.ResumeThread(iThreadID);
-		test (err == KErrNone);
-
-		// Wait for the breakpoint to be hit
-		iServSession.GetEvent(iFileName,status,infoPtr);
-		
-		// Wait for notification of the breakpoint hit event
-		User::WaitForRequest(status);
-		test(status==KErrNone);
-		
-		// Info should now be filled with the details
-		test(info.iEventType == (aThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint));
-		
-		// Have we stopped at the correct breakpoint?
-		test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address[i%numOfBreakPointsInLoop]);
-		
-		// Check process and thread id too
-		test(info.iProcessIdValid);
-		test(info.iThreadIdValid);
-		}
-
-	// Not interested in breakpoint events any more
-	err = aThreadSpecific
-		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore)
-		: iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionIgnore);
-	test (err == KErrNone);
-
-	// Clear breakpoints
-	for (TInt i = 0; i < numOfBreakPointsInLoop; i++)
-		{
-		err = iServSession.ClearBreak(armBreakId[i]);
-		test(err == KErrNone);
-		}
-	
-	// Continue the thread again
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0440
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Test access to target user-side registers.
-//! @SYMTestActions     Suspends a target thread, and reads/writes target thread register contents
-//!
-//! @SYMTestExpectedResults KErrNone. Should access target registers without problems.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestRegisterAccess()
-	{
-	TInt err;
-
-	test.Next(_L("TestRegisterAccess - Read\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend the thread to read registers
-	err = iServSession.SuspendThread(iThreadID);
-	test(err==KErrNone);
-
-	//we'll try to read/write registers ERegisterR0 - ERegisterCPSR and ERegisterR13_IRQ
-	//this way should get valid register values back, invalid ones and not supported ones, and it
-	//means that the register IDs are not completely contiguous
-
-	TInt firstRegister = 0;
-	TInt lastRegister = 17;
-	TInt numberOfRegisters = (lastRegister - firstRegister) + 1;
-
-	RBuf8 ids;
-	err = ids.Create(numberOfRegisters * sizeof(TRegisterInfo));
-	test(err == KErrNone);
-
-	for(TInt i=0; i<numberOfRegisters - 1; i++)
-		{
-		TRegisterInfo reg = (TRegisterInfo)((i + firstRegister)<<8);
-		ids.Append(reinterpret_cast<const TUint8*>(&reg), sizeof(TRegisterInfo));
-		}
-
-	TRegisterInfo reg = ERegisterR13Irq;
-	ids.Append(reinterpret_cast<const TUint8*>(&reg), sizeof(TRegisterInfo));
-
-	//create a buffer to store the register values in
-	RBuf8 originalValues;
-	err = originalValues.Create(numberOfRegisters*sizeof(TUint32));
-	test(err == KErrNone);
-
-	//create a buffer to store the register flags in
-	RBuf8 originalFlags;
-	err = originalFlags.Create(numberOfRegisters*sizeof(TUint8));
-	test(err == KErrNone);
-
-	//read register values
-	err = iServSession.ReadRegisters(iThreadID, ids, originalValues, originalFlags);
-	test(err == KErrNone);
-
-	//create a buffer containing data to write into the registers
-	RBuf8 tempValues;
-	err = tempValues.Create(numberOfRegisters*sizeof(TUint32));
-	test(err == KErrNone);
-
-	TUint cpsrId = 16;
-	for(TUint8 i=0; i<numberOfRegisters*sizeof(TUint32); i++)
-		{
-		if(i/sizeof(TUint32) == cpsrId)
-			{
-			//For the CPSR we wish to write data that makes sense - for USR mode we are
-			//allowed change all except the mode, ie. we must stay in usr mode. We try that here
-			//(allowedCPSRValue[4:0] = 10000) thus not changing the mode.
-			TUint32 allowedCPSRValue = 0x50000010;
-			tempValues.Append((TUint8*)&allowedCPSRValue, 4);
-			i += 3;
-			}
-		else
-			{
-			tempValues.Append(&i, 1);
-			}
-		}
-
-	test.Next(_L("TestRegisterAccess - Write\n"));
-
-	//create a buffer to store the register flags in
-	RBuf8 tempWriteFlags;
-	err = tempWriteFlags.Create(numberOfRegisters*sizeof(TUint8));
-	test(err == KErrNone);
-
-	//write the temp data into the registers
-	err = iServSession.WriteRegisters(iThreadID, ids, tempValues, tempWriteFlags);
-	test(err == KErrNone);
-
-	//create another buffer to store the register flags in
-	RBuf8 tempReadFlags;
-	err = tempReadFlags.Create(numberOfRegisters*sizeof(TUint8));
-	test(err == KErrNone);
-
-	RBuf8 tempReadValues;
-	err = tempReadValues.Create(numberOfRegisters*sizeof(TUint32));
-	test(err == KErrNone);
-
-	//read the temp data out again
-	err = iServSession.ReadRegisters(iThreadID, ids, tempReadValues, tempReadFlags);
-	test(err == KErrNone);
-
-	//check values are correct
-	for(TInt i=0; i<numberOfRegisters; i++)
-		{
-		TRegisterFlag writeFlag;
-		err = GetFlag(tempWriteFlags, i, writeFlag);
-		test(err == KErrNone);
-
-		TRegisterFlag readFlag;
-		err = GetFlag(tempReadFlags, i, readFlag);
-		test(err == KErrNone);
-
-		if((writeFlag == EValid) && (readFlag == EValid))
-			{
-			TUint8 offset = i * sizeof(TUint32);
-			for(TUint j = offset; j< offset + sizeof(TUint32); j++)
-				{
-				test(tempValues.Ptr()[j] == tempReadValues.Ptr()[j]);
-				}
-			}
-		}
-
-	//write the original data into the registers
-	err = iServSession.WriteRegisters(iThreadID, ids, originalValues, originalFlags);
-	test(err == KErrNone);
-
-	//read the data out again
-	err = iServSession.ReadRegisters(iThreadID, ids, tempValues, tempReadFlags);
-	test(err == KErrNone);
-
-	//check values are correct
-	for(TInt i=0; i<numberOfRegisters; i++)
-		{
-		TRegisterFlag writeFlag;
-		err = GetFlag(originalFlags, i, writeFlag);
-		test(err == KErrNone);
-
-		TRegisterFlag readFlag;
-		err = GetFlag(tempReadFlags, i, readFlag);
-		test(err == KErrNone);
-
-		if((writeFlag == EValid) && (readFlag == EValid))
-			{
-			TUint8 offset = i * sizeof(TUint32);
-			for(TUint j = offset; j< offset + sizeof(TUint32); j++)
-				{
-				test(tempValues.Ptr()[j] == originalValues.Ptr()[j]);
-				}
-			}
-		}
-
-	test.Next(_L("TestRegisterAccess - Invalid data\n"));
-
-	//create a buffer of max size 1
-	RBuf8 emptyBuffer;
-	emptyBuffer.Create(1);
-
-	//test register IDs buffer not being a multiple of sizeof(TRegisterInfo)
-	err = iServSession.ReadRegisters(iThreadID, emptyBuffer, tempValues, tempReadFlags);
-	test(err == KErrArgument);
-
-	//test register values buffer not being a multiple of sizeof(TUint32)
-	err = iServSession.ReadRegisters(iThreadID, ids, emptyBuffer, tempReadFlags);
-	test(err == KErrArgument);
-
-	//test flags buffer being representing different number of registers from other two
-	err = iServSession.ReadRegisters(iThreadID, ids, tempValues, emptyBuffer);
-	test(err == KErrArgument);
-
-	//set max length to 0
-	emptyBuffer.ReAlloc(0);
-
-	//test ids buffer being of 0 max length
-	err = iServSession.ReadRegisters(iThreadID, emptyBuffer, tempValues, tempReadFlags);
-	test(err == KErrArgument);
-
-	//do cleanup
-	emptyBuffer.Close();
-	tempValues.Close();
-	tempWriteFlags.Close();
-	tempReadFlags.Close();
-	tempReadValues.Close();
-
-	test.Next(_L("TestRegisterAccess - Setting PC value\n"));
-
-	//create buffer containing PC register ID
-	RBuf8 pcId;
-	err = pcId.Create(sizeof(TRegisterInfo));
-	test(err == KErrNone);
-	TRegisterInfo reg1 = (TRegisterInfo)0x00000f00;
-	pcId.Append(reinterpret_cast<const TUint8*>(&reg1), sizeof(TRegisterInfo));
-
-	//create buffer containing desired PC value
-	RBuf8 pcValue;
-	err = pcValue.Create(sizeof(TUint32));
-	test(err == KErrNone);
-	TUint32 address = (TUint32)(&TestFunction);
-	pcValue.Append(reinterpret_cast<const TUint8*>(&address), sizeof(TUint32));
-
-	//craete buffer for PC flag value
-	RBuf8 pcFlag;
-	err = pcFlag.Create(sizeof(TUint8));
-
-	//write the new PC value
-	err = iServSession.WriteRegisters(iThreadID, pcId, pcValue, pcFlag);
-	test(err==KErrNone);
-
-	//get the flag and check the PC value was written ok
-	TRegisterFlag flag = ENotSupported;
-	err = GetFlag(pcFlag, 0, flag);
-	test(err==KErrNone);
-
-	if(flag == EValid)
-		{
-		/* The PC value was changed to execute the function TestFunction.
-		* TestFunction changes the value of TestData to a given value and 
-		* then calls RMDebug_BranchTst1.
-		* We place a breakpoint on RMDebug_BranchTst1 so that to we are able 
-		* to test the value of TestData.
-		*/
-
-		test(KErrNone == iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionSuspend));
-		TBreakId armBreakId;
-		TUint32 address = (TUint32)(&RMDebug_BranchTst1);
-		test(KErrNone == iServSession.SetBreak(armBreakId,iThreadID,address,EArmMode));
-
-		// Continue the thread
-		test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-		// wait for the breakpoint to be hit
-		TEventInfo info;
-		static TRequestStatus status;
-
-		TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-		iServSession.GetEvent(iFileName,status,infoPtr);
-
-		// Wait for notification of the breakpoint hit event
-		User::WaitForRequest(status);
-		test(status==KErrNone);
-
-		// info should now be filled with the details
-		test(info.iEventType == EEventsBreakPoint);
-		test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-		test(info.iProcessIdValid);
-		test(info.iThreadIdValid);
-
-		test(KErrNone == iServSession.ClearBreak(armBreakId));
-
-		// Finally test the value
-		test(TestData == 0xffeeddcc);
-		}
-
-	//Make sure we cannot change the CPSR
-	test.Next(_L("Verifying we cannot change the CPSR mode from USR Mode"));
-
-	TUint32 disallowedCpsr = 0x50000013;
-
-	RBuf8 cpsrRegId;
-	err = cpsrRegId.Create(sizeof(TUint32));
-	test(err == KErrNone);
-
-	TRegisterInfo cpsr = (TRegisterInfo)((cpsrId + firstRegister)<<8);
-	cpsrRegId.Append(reinterpret_cast<const TUint8*>(&cpsr), sizeof(TRegisterInfo));
-
-	RBuf8 cpsrRegFlags;
-	err = cpsrRegFlags.Create(sizeof(TUint8));
-	test(err == KErrNone);
-
-	RBuf8 cpsrVal;
-	err = cpsrVal.Create(sizeof(TUint32));
-	test(err == KErrNone);
-
-	cpsrVal.Append((TUint8*)&disallowedCpsr, 4);
-
-	//attempt to write disallowed CPSR in
-	err = iServSession.WriteRegisters(iThreadID, cpsrRegId, cpsrVal, cpsrRegFlags);
-	test(err == KErrNone);
-
-	RBuf8 cpsrReadVal;
-	err = cpsrReadVal.Create(sizeof(TUint32));
-	test(err == KErrNone);
-
-	//Read back the CPSR
-	err = iServSession.ReadRegisters(iThreadID, cpsrRegId, cpsrReadVal, cpsrRegFlags);
-	test(err == KErrNone);
-
-	//Make sure we havent switched modes ie. its not what we wrote
-	TUint32* readVal = (TUint32*)cpsrReadVal.Ptr();
-	test(*readVal != disallowedCpsr);
-
-	cpsrRegId.Close();
-	cpsrRegFlags.Close();
-	cpsrVal.Close();
-	cpsrReadVal.Close();
-
-	//write the original values back into here
-	err = iServSession.WriteRegisters(iThreadID, ids, originalValues, originalFlags);
-	test(err == KErrNone);
-
-	// Resume the thread
-	err = iServSession.ResumeThread(iThreadID);
-	test(err==KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	//do cleanup
-	pcId.Close();
-	pcValue.Close();
-	pcFlag.Close();
-	ids.Close();
-	originalValues.Close();
-	originalFlags.Close();
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0441
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Test registration/de-registration of debug interest in target exe with the Debug Security Server
-//! @SYMTestActions     As per description
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestAttachExecutable()
-	{
-
-	test.Next(_L("TestAttachExecutable - Attach\n"));
-
-	//attach to process passively
-	test(KErrNone == iServSession.AttachExecutable(iFileName, ETrue));
-
-	//make a thread id for a non-existent thread
-	TThreadId threadId(0x12345678);
-
-	//get a handle to the target thread
-	RThread targetThread;
-	TInt err = targetThread.Open(threadId);
-	test(err != KErrNone);
-
-	//not registered for this thread's process (as it doesn't exist)
-	//so should fail security check
-	err = iServSession.ResumeThread(threadId);
-	test(err==KErrPermissionDenied);
-
-	//try to attach to the same process (and fail)
-	test(KErrAlreadyExists == iServSession.AttachExecutable(iFileName, EFalse));
-
-	test.Next(_L("TestAttachExecutable - Detach\n"));
-
-	//detach from process
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	//attach non-passively
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//not registered for this thread's process (as it doesn't exist)
-	//so should fail security check
-	err = iServSession.ResumeThread(0x12345678);
-	test(err==KErrPermissionDenied);
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0442
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests single-stepping target threads.
-//! @SYMTestActions     Steps target thread assembly level instructions, mainly branch/change PC
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestStep()
-	{
-	test.Next(_L("TestStep\n"));
-
-	DoTestStep(EFalse);
-	DoTestStep(ETrue);
-	}
-
-void CRunModeAgent::DoTestStep(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestStep: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err = KErrNone;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	//set the target thread to execute the stepping functions
-	test(KErrNone == SwitchTestFunction(EStepFunction));
-
-	err = iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionContinue);
-	test (err == KErrNone);
-
-	if(!aThreadSpecific)
-		{
-		err = iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionContinue);
-		test (err == KErrNone);
-		}
-
-	TUint32	startAddress;
-	TUint32	endAddress;
-
-	/*
-	 * RMDebug_StepTest_Non_PC_Modifying
-	 */
-	test.Next(_L("TestStep - Non-PC modifying\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Non_PC_Modifying);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Non_PC_Modifying_OK);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Branch
-	 */
-	test.Next(_L("TestStep - Branch\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Branch);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Branch_1);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Branch_And_Link
-	 */
-	test.Next(_L("TestStep - Branch_And_Link\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Branch_And_Link_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Branch_And_Link_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_MOV_PC
-	 */
-	test.Next(_L("TestStep - MOV PC,X\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_MOV_PC_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_MOV_PC_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_LDR_PC
-	 */
-	test.Next(_L("TestStep - LDR PC\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_LDR_PC);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_LDR_PC_1);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-// thumb and interworking tests are not supported on armv4
-#ifdef __MARM_ARMV5__
-
-	/*
-	 * RMDebug_StepTest_Thumb_Non_PC_Modifying
-	 */
-	test.Next(_L("TestStep - Thumb Non PC-Modifying\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Non_PC_Modifying_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Non_PC_Modifying_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_Branch
-	 */
-	test.Next(_L("TestStep - Thumb Branch\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_Branch_And_Link
-	 */
-	test.Next(_L("TestStep - Thumb Branch_And_Link\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_And_Link_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_And_Link_3);
-
-	TInt muid=0;
-    test(HAL::Get(HAL::EMachineUid, muid)==KErrNone);
-
-	// check if running on ARMv7 core
-	if(muid==HAL::EMachineUid_OmapH6 || muid==HAL::EMachineUid_OmapZoom || muid==HAL::EMachineUid_EmuBoard)
-        {
-        // Note: ARMv7 treats BL instructions as single 32-bit instructions
-        err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-        }
-    else
-	    {
-        // Note: Due to the fact that the stepper treats BL instructions
-		// as two instructions (as the hardware does), then we must step
-		// the first half instruction first)
-
-		err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1, EFalse, processId);
-		test(err==KErrNone);
-
-	// Now we actually do the BL
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1, EFalse, processId);
-        }
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_Back_Branch_And_Link
-	 */
-	test.Next(_L("TestStep - Thumb Back_Branch_And_Link\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Back_Branch_And_Link_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Back_Branch_And_Link_3);
-
-	// check if running on ARMv7 core
-	if(muid==HAL::EMachineUid_OmapH6 || muid==HAL::EMachineUid_OmapZoom || muid==HAL::EMachineUid_EmuBoard)
-		{
-		// Note: ARMv7 treats BL instructions as single 32-bit instructions
-		err = aThreadSpecific
-			? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-			: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-		}
-	else
-		{
-		// Note: Due to the fact that the stepper treats BL instructions
-		// as two instructions (as the hardware does), then we must step
-		// the first half instruction first)
-
-		err = aThreadSpecific
-	   		? HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1)
-			: HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1, EFalse, processId);
-		test(err==KErrNone);
-
-	   	// Now we actually do the BL
-		err = aThreadSpecific
-   			? HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1)
-			: HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1, EFalse, processId);
-		}
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_AddPC
-	 */
-	test.Next(_L("TestStep - Thumb ADD PC, PC, R0\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_AddPC_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_AddPC_3);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Interwork ARM to Thumb
-	 */
-	test.Next(_L("TestStep - Interworking ARM to Thumb - BLX \n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Interwork_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Interwork_2);
-
-	err = aThreadSpecific // nb initial breakpoint in ARM code
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Interwork Thumb to ARM
-	 */
-	test.Next(_L("TestStep - Interworking Thumb to ARM - BLX\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Interwork_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Interwork_3);
-
-	// check if running on ARMv7 core
-	if(muid==HAL::EMachineUid_OmapH6 || muid==HAL::EMachineUid_OmapZoom || muid==HAL::EMachineUid_EmuBoard)
-        {
-        // ARMv7 treats BLX instructions as single 32-bit instructions
-        err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-        }
-    else
-        {
-    	// Stepper treats this as a two-stage instruction (just like the hardware)
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1, EFalse, processId);
-	test(err == KErrNone);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1, EFalse, processId);
-        }
-	test(err == KErrNone);
-
-#endif // __MARM_ARMV5__
-
-	/*
-	 * Test multiple-step of ARM code
-	 */
-	test.Next(_L("TestStep - ARM Multiple instruction step\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_ARM_Step_Multiple);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_ARM_Step_Multiple_1);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,5)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,5, EFalse, processId);
-	test(err == KErrNone);
-	// stepping performance
-	test.Next(_L("TestStep - Steps per second\n"));
-
-	// run until we reach RMDebug_StepTest_Count_1
-	TBreakId stepBreakId;
-	startAddress = (TUint32)(&RMDebug_StepTest_Count_1);
-	endAddress = (TUint32)(&RMDebug_StepTest_Count_2);
-
-	err = aThreadSpecific
-		? HelpTestStepSetBreak(stepBreakId,iThreadID,startAddress,EArmMode)
-		: HelpTestStepSetBreak(stepBreakId,iThreadID,startAddress,EArmMode,EFalse,processId);
-	test (err == KErrNone);
-
-	// wait until we hit the breakpoint
-	TEventInfo info;
-	err = HelpTestStepWaitForBreak(iFileName,info);
-	test (err == KErrNone);
-
-	// Now clear the breakpoint
-	err = iServSession.ClearBreak(stepBreakId);
-	test(err == KErrNone);
-
-	if(aThreadSpecific)
-		{
-		// now step the code
-		TInt stepsPerSecond = 0;
-
-		TUint32 stopTickCount = User::NTickCount() + HelpTicksPerSecond();
-
-		while (User::NTickCount() < stopTickCount)
-			{
-			err = iServSession.Step(iThreadID,1);
-			test (err == KErrNone);
-
-			// we need to wait now until the step completes before asking for the next step
-				{
-				TEventInfo info;
-				static TRequestStatus status;
-
-				TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-				iServSession.GetEvent(iFileName,status,infoPtr);
-
-				// Wait for notification of the breakpoint hit event
-				User::WaitForRequest(status);
-				test(status==KErrNone);
-				}
-
-			// Update the count of steps
-			stepsPerSecond += 1;
-
-			// Gone wrong if we do too many
-			test(stepsPerSecond < 10000);
-			}
-
-		iStepsPerSecond = stepsPerSecond;
-		test(iStepsPerSecond != 0);
-		}
-
-	// finally resume the thread
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-
-	err = iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore);
-	test (err == KErrNone);
-
-	if(!aThreadSpecific)
-		{
-		err = iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionIgnore);
-		test (err == KErrNone);
-		}
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0443
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests registration and occurrence of target thread event (in this case panic)
-//! @SYMTestActions     Registers for a panic in the target thread, causes it, and catches the panic notification.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestEvents()
-	{
-	TInt err = KErrNone;
-
-	test.Next(_L("TestEvents\n"));
-
-	TInt panicReason = 12345;
-
-	test.Printf(_L("Thread t_rmdebug.exe::DebugThread should panic with reason %d.\n"), panicReason);
-
-	//attach non-passively
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	RThread threadToPanic;
-	test(KErrNone == StartDebugThread(threadToPanic, _L("EventsThread")));
-	TThreadId threadToPanicId = threadToPanic.Id();
-	TEventInfo info;
-
-	// Set things up to wait for a thread kill event
-	err = iServSession.SetEventAction(iFileName, EEventsKillThread, EActionContinue);
-	test(err==KErrNone);
-
-	// Wait for an event to occur in this process - nothing should have happened yet.
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Test Request cancellation
-	err = iServSession.CancelGetEvent(iFileName);
-	test (err==KErrNone);
-
-	// Again wait for an event to occur in our process - we will provoke the
-	// thread kill event by panic'ing the test thread.
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Panic the debug thread to cause a thread kill event
-	threadToPanic.Panic(_L("t_rmdebug panic thread test"), panicReason);
-
-	// Wait for notification of the Thread Kill event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Check we are really recieving information about the panic
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-	test(info.iProcessId==RProcess().Id());
-	test(info.iThreadId==threadToPanicId);
-	test(info.iEventType==EEventsKillThread);
-	test(info.iThreadKillInfo.iExitType==EExitPanic);
-
-	// Ignore other panic events
-	err = iServSession.SetEventAction(iFileName, EEventsKillThread, EActionIgnore);
-	test(err==KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0444
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests registration and occurence of target thread events in separate process.
-//! @SYMTestActions     Registers for a hardware exception and kill thread events, and receives them.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestEventsForExternalProcess()
-	{
-	test.Next(_L("TestEventsForExternalProcess\n"));
-
-	for(TInt main=0; main<3; main++)
-		{
-		for(TInt extra=0; extra<3; extra++)
-			{
-			TestEventsWithExtraThreads((TKernelEventAction)main, (TKernelEventAction)extra, 0);
-			TestEventsWithExtraThreads((TKernelEventAction)main, (TKernelEventAction)extra, 2);
-			}
-		}
-	}
-
-void CRunModeAgent::TestEventsWithExtraThreads(TKernelEventAction aActionMain, TKernelEventAction aActionExtra, TUint32 aExtraThreads)
-	{
-	const TInt KNumberOfTypes = 8;
-	struct TEventStruct
-		{
-		public:
-		TDebugFunctionType iDebugFunctionType;
-		TEventType iEventType;
-		};
-
-	TEventStruct type[KNumberOfTypes] =
-		{
-			{EStackOverflowFunction, EEventsHwExc},
-			{EUserPanicFunction, EEventsKillThread},
-			{EPrefetchAbortFunction, EEventsHwExc},
-			{EDataAbortFunction, EEventsHwExc},
-			{EUndefInstructionFunction, EEventsHwExc},
-			{EDataReadErrorFunction, EEventsHwExc},
-			{EDataWriteErrorFunction, EEventsHwExc},
-			{EUserExceptionFunction, EEventsSwExc},
-		};
-
-	for(TInt j=0; j<KNumberOfTypes; j++)
-		{
-		if( gUseDelay ) User::After(500000);
-
-		RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads type: %d, main action: %d, extra action: %d, extraThreads: %d", 
-			j, (TUint32)aActionMain, (TUint32)aActionExtra, aExtraThreads);
-
-		// do this check as it seems to hard to do these cases with the current set up
-		if(EEventsKillThread == type[j].iEventType)
-			{
-			if(EActionSuspend != aActionMain)
-				{
-				if(aActionMain != aActionExtra)
-					{
-					return;
-					}
-				}
-			}
-		// attach to KRMDebugTestApplication
-		test(KErrNone == iServSession.AttachExecutable(KRMDebugTestApplication, EFalse));
-
-		// Set things up to wait for the expected exception in KRMDebugTestApplication
-		test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, type[j].iEventType, aActionMain));
-
-		if(EActionSuspend != aActionMain)
-			{
-			test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, EEventsKillThread, aActionExtra));
-			}
-
-		// declare a TRequestStatus object for asynchronous calls
-		TRequestStatus status;
-
-		TEventInfo info;
-		TPtr8 infoBuffer = TPtr8((TUint8*)&info,0,sizeof(TEventInfo));
-		if(EActionIgnore != aActionMain)
-			{
-			iServSession.GetEvent(KRMDebugTestApplication(), status, infoBuffer);
-			}
-
-		// launch the target process to trigger the expected exception
-		RProcess targetProcess;
-		test(KErrNone == LaunchProcess(targetProcess, KRMDebugTestApplication(), type[j].iDebugFunctionType, 0, aExtraThreads));
-		TProcessId processId(targetProcess.Id());
-		targetProcess.Close();
-
-		if(EActionIgnore != aActionMain)
-			{
-			// wait for notification of the exception
-			User::WaitForRequest(status);
-			test(KErrNone == status.Int());
-
-			// check that this is the event we were expecting
-			test(info.iProcessIdValid);
-			test(info.iThreadIdValid);
-			test(info.iProcessId==processId);
-			test(info.iEventType==type[j].iEventType);
-			}
-
-		if(EActionSuspend == aActionMain)
-			{
-			//RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads EActionSuspend == aActionMain, j=%d", j);
-			// read the thread list, partly to check the call works, and partly to check the thread still exists
-			test(ThreadExistsForProcess(info.iThreadId, info.iProcessId));
-
-			// register to catch all the thread kills which will occur
-			test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, EEventsKillThread, aActionExtra));
-			// we specified EActionSuspend earlier so need to call resume on this thread
-			test(KErrNone == iServSession.ResumeThread(info.iThreadId));
-			}
-
-		// find out how many threads there are in the process and catch all the thread kill events,
-		// the number of kill thread events should correspond to the number of extra threads launched,
-		// plus one if the main thread panicked with a Sw/Hw exception
-		if(EActionIgnore != aActionExtra)
-			{
-			TInt dyingThreads = aExtraThreads + ( (type[j].iEventType != EEventsKillThread) ? 1 : 0);
-			for(TInt k=0; k<dyingThreads; k++)
-				{
-				//RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads dyingThreads, k=%d, j=%d", k,j);
-				iServSession.GetEvent(KRMDebugTestApplication(), status, infoBuffer);
-
-				// wait for notification of the kill thread
-				User::WaitForRequest(status);
-				test(KErrNone == status.Int());
-
-				// check that this is the event we were expecting
-				test(info.iProcessIdValid);
-				test(info.iThreadIdValid);
-				test(info.iProcessId==processId);
-				test(info.iEventType==EEventsKillThread);
-				if(EActionSuspend == aActionExtra)
-					{
-					// do some calls to check listings work ok at this stage
-					test(ProcessExists(info.iProcessId));
-					test(ThreadExistsForProcess(info.iThreadId, info.iProcessId));
-					// we specified EActionSuspend earlier so need to call resume on this thread
-					test(KErrNone == iServSession.ResumeThread(info.iThreadId));
-					}
-				}
-			}
-
-		if( gUseDelay ) User::After(500000);
-
-		// reset the thread kill event
-		test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication(), EEventsKillThread, EActionIgnore));
-
-		// reset events for KRMDebugTestApplication
-		test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication(), type[j].iEventType, EActionIgnore));
-
-		// finished debugging KRMDebugTestApplication so detach
-		test(KErrNone == iServSession.DetachExecutable(KRMDebugTestApplication()));
-	
-		// want to validate that the process has really exited, i.e. we're not accidentally keeping a handle to it...
-		TInt waitCount = 10;
-		while((waitCount-- > 0) && ProcessExists(processId))
-			{
-			/* Wait a little while and try again, just in case the process is still being removed.
-			This can happen on a very busy system or when a popup for the events is still active
-			*/
-			RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads. ProcessExists(id=%d), waiting count exit=%d", 
-				I64LOW(processId), waitCount);
-			User::After(50000);
-			}
-		test(!ProcessExists(processId));
-		}
-	}
-
-// helper function to check whether a thread with id aThreadId exists in the process with id aProcessId
-TBool CRunModeAgent::ThreadExistsForProcess(const TThreadId aThreadId, const TProcessId aProcessId)
-	{
-	RThread lThread;
-	TInt ret = lThread.Open( aThreadId.Id() );
-
-	if( ret != KErrNone )
-		{
-		RDebug::Printf("ThreadExistsForProcess: thread id=%d opening returned %d",
-			I64LOW( aThreadId.Id() ), ret );
-		lThread.Close();
-		return EFalse;
-		}
-
-	RProcess lProcess;
-	ret = lThread.Process( lProcess );
-
-	lThread.Close();
-
-	if( ret != KErrNone )
-		{
-		RDebug::Printf("ThreadExistsForProcess: proc opening returned %d", ret );
-		ret = KErrNotFound;
-		}
-	else if( lProcess.Id() != aProcessId )
-		{
-		RDebug::Printf("ThreadExistsForProcess: lProcess.Id()(%d)!= aProcessId(%d)",
-				I64LOW(lProcess.Id().Id()), I64LOW(aProcessId.Id()));
-		ret = KErrNotFound;
-		}
-
-	lProcess.Close();
-	
-	return ( ret == KErrNone );
-	}
-
-// helper function to check whether a process with id aProcessId exists
-TBool CRunModeAgent::ProcessExists(const TProcessId aProcessId)
-	{
-	TUint32 size;
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1024));
-	TInt err = iServSession.GetList(EProcesses, buffer, size);
-	while(KErrTooBig == err)
-		{
-		size*=2;
-		test(size<=16*1024);
-		test(KErrNone == buffer.ReAlloc(size));
-		err = iServSession.GetList(EProcesses, buffer, size);
-		}
-	test(KErrNone == err);
-
-	//look through the buffer and check if the target debug thread is there
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TProcessListEntry& entry = *(TProcessListEntry*)ptr;
-		if(aProcessId.Id() == entry.iProcessId)
-			{
-			buffer.Close();
-			return ETrue;
-			}
-		ptr += Align4(entry.GetSize());
-		}
-	buffer.Close();
-	return EFalse;
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0445
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests basic debug functions work on demand-paged target threads
-//! @SYMTestActions     Checks it can r/w memory, set breakpoints etc in a demand paged target.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestDemandPaging(void)
-	{
-	test.Next(_L("TestDemandPaging\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	// get the address of a function in code that will be paged in
-	TUint32 address = (TUint32)(&RMDebugDemandPagingTest);
-	const TUint32 armInstSize = 4;
-
-	// read the memory at &RMDebugDemandPagingTest to check that reading memory in demand paged code works
-	TUint32 demandPagedInst = 0;
-	TPtr8 demandPagedInstBuf((TUint8*)&demandPagedInst, armInstSize);
-	test(KErrNone == iServSession.ReadMemory(iThreadID, address, armInstSize, demandPagedInstBuf, EAccess32, EEndLE8));
-
-	// this is the MOVS instruction that we expect to find in RMDebugDemandPagingTest
-	TUint32 expectedDemandPagedInst = 0xe1b02000;
-
-	// check that the instruction we read is as expected
-	test(demandPagedInst == expectedDemandPagedInst);
-
-	// set event action for break points
-	test(KErrNone == iServSession.SetEventAction(RProcess().FileName(), EEventsBreakPoint, EActionContinue));
-
-	// set an arm breakpoint on RMDebugDemandPagingTest
-	TBreakId armBreakId = 0;
-	test(KErrNone == iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode));
-
-	// Ensure that after setting the breakpoint the memory read returns the correct value
-	TUint32 demandPagedInstWithBreakPoint = 0;
-	TPtr8 spinForeverInstWithBreakPointBuf((TUint8*)&demandPagedInstWithBreakPoint, armInstSize);
-	test(KErrNone == iServSession.ReadMemory(iThreadID, address, armInstSize, spinForeverInstWithBreakPointBuf, EAccess32, EEndLE8));
-	test(demandPagedInst == demandPagedInstWithBreakPoint);
-
-	// switch the target thread to run the demand paging function
-	test(KErrNone == SwitchTestFunction(EDemandPagingFunction));
-
-	// set up event watcher to catch breakpoint being hit in demand paged code
-	TEventInfo info;
-	static TRequestStatus status;
-	TPtr8 infoPtr((TUint8*)&info,sizeof(TEventInfo));
-	iServSession.GetEvent(RProcess().FileName(), status, infoPtr);
-
-	// resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	// wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-	test(info.iEventType == EEventsBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-
-	// remove the break point and resume the thread
-	test(KErrNone == iServSession.ClearBreak(armBreakId));
-
-	// switch the target thread to run the default function
-	test(KErrNone == SwitchTestFunction(EDefaultFunction));
-
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-// Names of some test programs used for testing security
-_LIT(KRMDebugSecurity0FileName,"z:\\sys\\bin\\t_rmdebug_security0.exe"); // Debuggable
-_LIT(KRMDebugSecurity1FileName,"z:\\sys\\bin\\t_rmdebug_security1.exe"); // Not debuggable
-_LIT(KRMDebugSecurity2FileName,"z:\\sys\\bin\\t_rmdebug_security2.exe"); // AllFiles
-_LIT(KRMDebugSecurity3FileName,"z:\\sys\\bin\\t_rmdebug_security3.exe"); // TCB AllFiles
-
-// include the test header file here
-#include "rm_debug_kerneldriver.h"
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0446
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests Debug Device Driver is locked to the SID of the Debug Security Svr.
-//! @SYMTestActions     Loads rm-debug.ldd and tries to open a handle to it. This should fail.
-//!
-//! @SYMTestExpectedResults KErrPermissionDenied.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestDriverSecurity(void)
-	{
-	test.Next(_L("TestDriverSecurity\n"));
-
-	RRM_DebugDriver kernelDriver;
-
-	// Load the debug device driver
-	TInt err = User::LoadLogicalDevice( KDebugDriverFileName );
-	test((KErrNone == err) || (KErrAlreadyExists == err));
-
-	// we were allowed to load the driver, or its already loaded.
-
-	// Try to open a handle to the driver - this should return KErrPermissionDenied as we don't have the DSS SID
-	TRM_DebugDriverInfo driverInfo;
-	driverInfo.iUserLibraryEnd = 0;
-	err = kernelDriver.Open(driverInfo);
-	test((err == KErrInUse) || (err == KErrPermissionDenied));
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0447
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests Debug driver can only be access via the DSS. Also tests DSS cannot
-//!						be subverted. Tests functionality of two representative OEM Debug Tokens.
-//! @SYMTestActions     Tries to open rm_debug.ldd (should fail). Tries to debug various processes
-//!						(only debuggable one should succeed). Checks that DSS behaves correctly
-//!						when different versions are passed in to Connect().
-//!
-//! @SYMTestExpectedResults KErrPermissionDenied.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestSecurity(void)
-	{
-	// Things to test
-	//
-	// try to use debug driver directly ( should have the wrong UID/SID value!)
-	test.Next(_L("TestSecurity - Bypass Debug Security Server to Debug Device Driver - DSS running\n"));
-
-	// Things to test
-	//
-	// Load the debug device driver
-	RRM_DebugDriver kernelDriver;
-	TInt err = User::LoadLogicalDevice( KDebugDriverFileName );
-	test((KErrNone == err) || (KErrAlreadyExists == err));
-
-	// we were allowed to load the driver, or its already loaded.
-
-	// Try to open handle a to the driver - this should return KErrPermission/KErrInUse as we don't have the DSS SID
-	// and we expect the DSS to already be using it.
-	TRM_DebugDriverInfo driverInfo;
-	driverInfo.iUserLibraryEnd = 0;
-	err = kernelDriver.Open(driverInfo);
-	test(err == KErrInUse);
-
-	// Try requesting an unsupported version of DSS
-	test.Next(_L("TestSecurity - requesting unsupported versions of DSS\n"));
-	RSecuritySvrSession dss;
-	err = dss.Connect(TVersion(999999, 0, 0));
-	test(err == KErrNotSupported); // Prior to DEF142018 this would crash, causing a KErrServerTerminated
-	err = dss.Connect(TVersion(KDebugServMajorVersionNumber, 999999, 0));
-	test(err == KErrNotSupported); // Explicitly asking for a minor version should give KErrNotSupported too if it's newer than what's running.
-	err = dss.Connect(TVersion(KDebugServMajorVersionNumber, 0, 0));
-	test(err == KErrNone); // But the correct major version and no explicit minor version should always succeed
-	dss.Close();
-	
-	//
-	// Attach to the Debug Security Server (passive)
-	//
-	test.Next(_L("TestSecurity - Attach to the Debug Security Server (passive)\n"));
-
-	_LIT(KSecurityServerProcessName, "z:\\sys\\bin\\rm_debug_svr.exe");
-
-	test(KErrPermissionDenied == iServSession.AttachExecutable(KSecurityServerProcessName, ETrue));
-
-	//
-	// Attach to the Debug Security Server (active)
-	//
-	test.Next(_L("TestSecurity - Attach to the Debug Security Server (active)\n"));
-
-	test(KErrPermissionDenied == iServSession.AttachExecutable(KSecurityServerProcessName, EFalse));
-
-	//
-	// Attach to Process 0
-	//
-	// Target: Debuggable
-	//
-	test.Next(_L("TestSecurity - Attach to test process 0\n"));
-
-	// Agent can debug the target app as it is marked debuggable - ie capabilities are ignored)
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity0FileName,ETrue);
-
-	//
-	// Attach to Process - 1
-	//
-	// Target: Non-debuggable for ordinary debug agent, debuggable for OEM/OEM2 token authorised agent
-	//
-	// Note: This target app has no PlatSec capabilities
-	//
-	// Agent cannot debug the app unless it has an OEM/OEM2 Debug Token
-	test.Next(_L("TestSecurity - Attach to test process 1\n"));
-
-#ifdef SYMBIAN_STANDARDDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity1FileName,EFalse);
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity1FileName,ETrue);
-#endif
-
-#ifdef SYMBIAN_OEM2DEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity1FileName,ETrue);
-#endif
-
-	//
-	// Attach to Process - 2
-	//
-	// Target: Non-debuggable for ordinary debug agent, non-debuggable for OEM2 authorised agent (insufficient caps)
-	//
-	// Note: This target app has AllFiles capability
-	//
-	// Agent cannot debug the app unless it has an OEM Debug Token
-	test.Next(_L("TestSecurity - Attach to test process 2\n"));
-
-#ifdef SYMBIAN_STANDARDDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity2FileName,EFalse);
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity2FileName,ETrue);
-#endif
-
-#ifdef SYMBIAN_OEM2DEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity2FileName,EFalse);
-#endif
-
-	//
-	// Attach to Process - 3
-	//
-	// Target: Non-debuggable for ordinary debug agent, non-debuggable for OEM authorised agent (insufficient caps)
-	//
-	// Note: This target app has AllFiles and TCB and NetworkControl capabilities
-	//
-	test.Next(_L("TestSecurity - Attach to test process 3\n"));
-
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity3FileName,EFalse);
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0543
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Validates that a dll can be built which #include's the rm_debug_api.h header, i.e. rm_debug_api.h contains no static data.
-//! @SYMTestActions     Calls a dummy function in t_rmdebug_dll.dll which implies the dll has been built correctly.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestDllUsage(void)
-	{
-	test.Next(_L("TestDllUsage\n"));
-	test(KUidDebugSecurityServer == GetDSSUid());
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0812
-//! @SYMTestType
-//! @SYMPREQ            PREQ1700
-//! @SYMTestCaseDesc    Writes a known data to the crash flash and validates the data written
-//!						using the read operation and finally erase the data. In the absence
-//!						of an OEM debug token, access to the crash partition should not be allowed
-//! @SYMTestActions     Invoke the flash write method in DSS and call the read method in DSS
-//!						to validate the data is written correctly and then erase the written area
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestCrashFlash(void)
-	{
-#if  defined (SYMBIAN_STANDARDDEBUG)  || defined (SYMBIAN_OEM2DEBUG)
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-006 Testing We cannot Erase the Crash Flash with insufficient privileges"));
-
-	TUint32 size = 0;
-	TInt err = iServSession.EraseCrashLog(0, 1);
-	test(KErrPermissionDenied == err);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-005 Testing We can't Write to the Crash Flash with insufficient privileges"));
-
-	err = iServSession.WriteCrashConfig(0, KCrashDummyData, size);
-	test(KErrPermissionDenied == err);
-	test(size == 0);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-008 Testing We can't Read from the Crash Flash with insufficient privileges"));
-
-	TUint32 readSize = 0x10;
-	RBuf8 buf;
-	buf.CleanupClosePushL();
-	err = buf.Create(readSize);
-
-	test(err == KErrNone);
-
-	err = iServSession.ReadCrashLog(0, buf, readSize);
-	test(KErrPermissionDenied == err);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-004 Testing Writing To an invalid location"));
-
-	TUint32 writeSize = 0;
-	err = iServSession.WriteCrashConfig(0xFFFFFFFF, KCrashDummyData, writeSize);
-
-	test(err == KErrPermissionDenied);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-003 Testing Reading from an invalid location"));
-
-	buf.FillZ();
-	err = iServSession.ReadCrashLog(0, buf, writeSize);
-
-	test(err == KErrPermissionDenied);
-
-	CleanupStack::PopAndDestroy(&buf);
-
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-
-	TInt err = KErrNone;
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-007 Testing We can Erase the Crash Flash with sufficient privileges"));
-
-	err = iServSession.EraseCrashLog(0, 1);
-
-	// For platforms where NAND flash is not currently supported we get a KErrNotSupported - this is still a pass
-	if (KErrNotSupported == err)
-		{
-		test.Printf(_L("Nand flash not supported - continue"));
-		return;
-		}
-
- 	//For platforms without a flash partition we get KErrNotFound - this is still a pass
- 	if(KErrNotFound == err)
- 		{
- 		test.Printf(_L("Platform has no flash partition - continue"));
- 		return;
- 		}
-
-	test(KErrNone == err);
-
-	//Read back the start of the block to make sure its 0xFFFFFFFF
-	const TUint numBytesToCheck = 0x80;  //We dont know the block size
-	TBuf8<numBytesToCheck> eraseCheck;
-	eraseCheck.SetLength(numBytesToCheck);
-
-	err = iServSession.ReadCrashLog(0, eraseCheck, numBytesToCheck);
-	test(err == KErrNone);
-
-	TBool dataIsOk = ETrue;
-	for(TUint cnt = 0; cnt < numBytesToCheck; cnt++)
-		{
-		if(eraseCheck[cnt] != 0xFF)
-			{
-			dataIsOk = EFalse;
-			}
-		}
-
-	test(dataIsOk);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-002 Testing We can Write to the Crash Flash with sufficient privileges"));
-
-	TUint32 writeSize = 0;
-	err = iServSession.WriteCrashConfig(0, KCrashDummyData, writeSize);
-
-	test(writeSize == KCrashDummyData().Length());
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-001 Testing We can Read from the Crash Flash with sufficient privileges"));
-
-	RBuf8 buf;
-	buf.CleanupClosePushL();
-	err = buf.Create(writeSize);
-
-	test(err == KErrNone);
-
-	buf.FillZ();
-
-	err = iServSession.ReadCrashLog(0, buf, writeSize);
-
-	test(0 == buf.Compare(KCrashDummyData));
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-004 Testing Writing To an invalid location"));
-
-	writeSize = 0;
-	err = iServSession.WriteCrashConfig(0xFFFFFFFF, KCrashDummyData, writeSize);
-
-	test(err == KErrArgument);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-003 Testing Reading from an invalid location"));
-
-	buf.FillZ();
-	err = iServSession.ReadCrashLog(0xFFFFFFFF, buf, writeSize);
-
-	test(err == KErrArgument);
-
-	CleanupStack::PopAndDestroy(&buf);
-
-#endif
-	}
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0735
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests the Kill Process functionality. Only can kill a debuggable process.
-//! @SYMTestActions     Launches a debuggable and non-debuggable process and tries to kill both.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestKillProcess(void)
-	{
-	test.Next(_L("TestKillProcess\n"));
-
-	// Kill a debuggable process
-
-	// check that killing a process is supported
-	TTag tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillProcess);
-	test(tag.iValue);
-	// check that killing a thread is not supported
-	tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillThread);
-	test(!tag.iValue);
-
-	// attach first!
-	TInt err = iServSession.AttachExecutable(KRMDebugTestApplication, EFalse /* Active */);
-	test(err == KErrNone);
-
-	// first launch a debuggable process
-	RProcess process;
-	err = LaunchProcess(process, KRMDebugTestApplication(),ESpinForever, 0, 0);
-	test (err == KErrNone);
-
-	// try to find the process in the list
-_LIT(KRMDebugAppName, "t_rmdebug_app");
-
-	TBool found = ProcessExists(KRMDebugAppName);
-	test (found);
-
-	TInt processId = process.Id();
-	process.Close();
-
-	// program now running, so try to kill it
-	err = iServSession.KillProcess(processId, 0 /* kill reason */);
-	test(err == KErrNone);
-
-	User::After(2000000);	// should die within two seconds.
-
-	// can we still find it? Should be gone
-	found = ProcessExists(KRMDebugAppName);
-	test (!found);
-
-	// release the program again.
-	err = iServSession.DetachExecutable(KRMDebugTestApplication);
-	test(err == KErrNone);
-
-	// Try to kill a non-debuggable process and fail.
-
-	// first launch a non-debuggable process
-	RProcess process2;
-	err = LaunchProcess(process2, KRMDebugSecurity1FileName(),ESpinForever, 0, 0);
-	test (err == KErrNone);
-
-	// try to find the process in the list
-_LIT(KRMDebugAppName2, "t_rmdebug_security1");
-
-	TBool found2 = ProcessExists(KRMDebugAppName2);
-	test (found2);
-
-	TInt process2Id = process2.Id();
-	process2.Close();
-
-	// program now running, so try to kill it
-	err = iServSession.KillProcess(process2Id, 0 /* kill reason */);
-	test(err == KErrPermissionDenied);
-
-	User::After(2000000);	// should die within two seconds if it is going to die.
-
-	// can we still find it? Should be still around!
-	found2 = ProcessExists(KRMDebugAppName2);
-	test (found2);
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-1388
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests the correct operation of the AddProcess and Remove Process
-//! @SYMTestActions     1. Registers for AddProcess and Remove Process events
-//!                     2. Starts a test process z:\sys\bin\t_rmdebug_security0.exe
-//!                     3. Wait for the AddProcess event to be reported
-//!                     4. Kill the newly started test process
-//!                     5. Wait for the RemoveProcess event to be reported
-//!                     6. Tell the DSS it is no longer interested in AddProcess and RemoveProcess events
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestAddRemoveProcessEvents()
-	{
-	test.Next(_L("TestAddRemoveProcessEvents\n"));
-
-	// attach to a process (e.g. one of the simple security test programs)
-	// launch the security program
-	// wait for the add event
-	// continue the program.
-	// wait for the remove event
-	// detach process
-
-	test(KErrNone == iServSession.AttachExecutable(KRMDebugSecurity0FileName, EFalse));
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsAddProcess, EActionContinue));
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsRemoveProcess, EActionContinue));
-
-	// Creator thread ID of the current thread (to be creator of test application)
-	TInt creatorThreadId = RThread().Id();
-
-	RProcess process;
-	TInt err = process.Create(KRMDebugSecurity0FileName, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// Rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// Start the test program
-	process.Resume();
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Wait for the addprocess event
-	TEventInfo info;
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(KRMDebugSecurity0FileName,status,infoPtr);
-
-	// Wait for notification of the addprocess hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Check this was the right kind of event
-	test(info.iEventType == EEventsAddProcess);
-
-	const TInt uid3offset = 2;
-
-	// Get UID3 for current process
-	TUint32 Uid3 = process.Type()[uid3offset].iUid;
-
-	// Check correct UID3 is returned from the driver
-    test(info.iAddProcessInfo.iUid3 == Uid3);
-
-    // Check correct creator ID for test application is returned from the driver
-    test(info.iAddProcessInfo.iCreatorThreadId == creatorThreadId);
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-
-	// Wait for the remove process event
-	iServSession.GetEvent(KRMDebugSecurity0FileName,status,infoPtr);
-
-	// Wait for notification of the remove process hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Check this was the right kind of event
-	test(info.iEventType == EEventsRemoveProcess);
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsRemoveProcess, EActionIgnore));
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsAddProcess, EActionIgnore));
-
-	test(KErrNone == iServSession.DetachExecutable(KRMDebugSecurity0FileName));
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0736
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Checks that process break points can be set, and that they can co-exist alongside thread breakpoints
-//! @SYMTestActions     Checks that process break points can be set, and that they can co-exist alongside thread breakpoints
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestProcessBreakPoints(void)
-	{
-	test.Next(_L("TestProcessBreakPoints\n"));
-
-	// check that process breakpoints are supported
-	TTag tag = GetTag(ETagHeaderIdBreakpoints, EBreakpointProcess);
-	test(tag.iValue);
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	// Try to set the breakpoint
-	TBreakId breakId;
-	TUint32 address = (TUint32)(&RMDebug_BranchTst1);
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.SetProcessBreak(breakId, processId, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetBreak(breakId, iThreadID, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetBreak(breakId, iThreadID, address, EThumbMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EThumbMode));
-	test(KErrNone == iServSession.ClearBreak(breakId));
-
-	test(KErrNone == iServSession.SetBreak(breakId, iThreadID, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EThumbMode));
-	test(KErrNone == iServSession.ClearBreak(breakId));
-
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-1309
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Checks that in the case of multiple low priority events (user traces in this case) we can still receive higher
-//!				priority events should the buffer reach a critical level
-//! @SYMTestActions     Run to first breakpoint in our test code. Then multiple trace events are issued. We should still be able to hit
-//!				the second breakpoint
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestMultipleTraceEvents(void)
-	{
-	test.Next(_L("TestMultipleTraceEvents\n"));
-
-	//attach to target debug process
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//and suspend the thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	//register interest in BP's & trace events and trace ignored events
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionSuspend));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTrace, EActionContinue));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTracesLost, EActionContinue));
-
-	// Try to set the breakpoints
-	TBreakId armBreakId;
-	TBreakId armBreakId2;
-	TUint32 address = (TUint32)(&RMDebug_BranchTst1);
-	TUint32 address2 = (TUint32)(&RMDebug_StepTest_Non_PC_Modifying);
-
-	test(KErrNone == iServSession.SetBreak(armBreakId,iThreadID,address,EArmMode));
-	test(KErrNone == iServSession.SetBreak(armBreakId2,iThreadID,address2,EArmMode));
-
-	//set the target thread to execute the trace test function
-	test(KErrNone == SwitchTestFunction(EMultipleTraceCalls));
-
-	// Continue the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	// wait for the breakpoint to be hit
-	TEventInfo info;
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Wait for notification of the 1st breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iEventType == EEventsBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	// Continue the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	//Now we try to hit the second breakpoint. This will occur after a number of trace calls. If we hit this breakpoint it
-	//means many trace calls are not preventing us hitting breakpoints.
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Wait for notification of the 2nd breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	TBool receivedTracesLost = EFalse;
-
-	while(info.iEventType == EEventsUserTrace || info.iEventType == EEventsUserTracesLost)
-		{
-		//ensure we get told traces are being thrown away - we generate enough to flood the buffer
-		if(info.iEventType == EEventsUserTracesLost)
-			{
-			receivedTracesLost = ETrue;
-
-			// Now stop the target thread from generating trace events
-			test(KErrNone == SwitchTestFunction(EDoNothing));
-			}
-		else
-			{
-			// Its EEventsUserTrace, so delay us in getting the next event so that it will be more 
-			// likely to get a EEventsUserTracesLost next time. 
-			// This is important on SMP since the platform can process lots of events, and thus
-			// withouth the delay it is difficult for this test to reproduce the abnormal situation of 
-			// lost trace packets
-			User::After(200000);
-			}
-
-		iServSession.GetEvent(iFileName,status,infoPtr);
-
-		// Wait for notification of the 2nd breakpoint hit event
-		User::WaitForRequest(status);
-		test(status==KErrNone);
-		}
-
-	//make sure we got told traces were lost
-	test(receivedTracesLost != EFalse);
-
-	// info should now be filled with the details of our breakpoint.
-	test(info.iEventType == EEventsBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address2);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	//dont care for breakpoints or trace events no more
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTrace, EActionIgnore));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTracesLost, EActionIgnore));
-
-	//clear the breaks we set
-	test(KErrNone == iServSession.ClearBreak(armBreakId));
-	test(KErrNone == iServSession.ClearBreak(armBreakId2));
-
-	// Continue the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	//attach to target debug process
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-2441
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test clearing of a process breakpoint once the process has been killed.
-//! @SYMTestActions Creates a new process then tries to set a process breakpoint and then kills the process which should clear the previously set breakpoint. Then repeat the step once again.
-//! @SYMTestExpectedResults KErrNone
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestProcessKillBreakpoint(void)
-	{
-	test.Next(_L("TestProcessKillBreakpoint\n"));
-	//SID retrieved, used in Define/Attach of the property
-	iMySid.iUid = RProcess().SecureId();
-
-	static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-
-	//define a property to pass on the address from the other process we would try to debug
-	test ( KErrNone == RProperty::Define(iMySid, EMyPropertyInteger, RProperty::EInt, KAllowAllPolicy, KAllowAllPolicy));
-	    //define a global semaphore to synchronise with debuggable process publishing the property
-	test ( KErrNone == iAddressGlobSem.CreateGlobal(_L("RMDebugGlobSem"), 0) );
-
-	DoTestProcessKillBreakpoint();
-	// called once again
-	// to check if we can set the breakpoint once again after the process gets killed
-	DoTestProcessKillBreakpoint();
-
-	//delete the property
-	test ( KErrNone == RProperty::Delete(iMySid, EMyPropertyInteger));
-	//close the semaphore
-	iAddressGlobSem.Close();
-	}
-
-void CRunModeAgent::DoTestProcessKillBreakpoint()
-	{
-	test.Printf(_L("\nDoTestProcessKillBreakpoint\n"));
-
-	TInt err = KErrNone;
-
-	// check that killing a process is supported
-	TTag tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillProcess);
-	test(tag.iValue);
-	// check that killing a thread is not supported
-	tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillThread);
-	test(!tag.iValue);
-
-	// attach first!
-	test ( KErrNone == iServSession.AttachExecutable(KRMDebugTestApplication, EFalse/*  Active */));
-
-	// first launch a debuggable process
-	RProcess processDebug;
-	test ( KErrNone == LaunchProcess(processDebug, KRMDebugTestApplication(),ESpinForeverWithBreakPoint, 0, 0));
-
-	// try to find the process in the list
-	_LIT(KRMDebugAppName, "t_rmdebug_app");
-	TBool found = ProcessExists(KRMDebugAppName);
-	test (found);
-
-	//search for the main thread created
-   _LIT(KThreadWildCard, "t_rmdebug_app*");
-	TProcessId processDebugId = processDebug.Id();
-	TThreadId threadDebugId;
-
-   	TFindThread find(KThreadWildCard);
-	TFullName name;
-	found = EFalse;
-	while(find.Next(name)==KErrNone && !found)
-		{
-		RThread thread;
-		err = thread.Open(find);
-       	if (err == KErrNone)
-			{
-			RProcess process;
-			thread.Process(process);
-			if (((TUint32)process.Id() == processDebugId))
-				{
-				TFullName fullname = thread.FullName();
-				test.Printf(_L("Match Found Name %lS Process ID%ld Thread Id %ld"), &fullname, process.Id().Id(), thread.Id().Id());
-				found = ETrue;
-				threadDebugId = thread.Id();
-				}
-			process.Close();
-			}
-			thread.Close();
-   		}
-
-	test (found); //check if we actually found the thread we want to debug
-
-	//get the value(property) for the breakpoint address for the process to debug
-	TInt address;
-	RProperty integerProperty;
-	test ( KErrNone == integerProperty.Attach(iMySid, EMyPropertyInteger, EOwnerThread));
-
-	//waiting on semaphore to be sure that the property is set
-	iAddressGlobSem.Wait();
-
-	test ( KErrNone == integerProperty.Get(address));
-	integerProperty.Close();
-
-	test.Printf(_L("Address retrieved to set breakpoint 0x%8x"), address);
-
-	//suspend the thread before we set a breakpoint
-	test ( KErrNone == iServSession.SuspendThread(threadDebugId));
-
-	//set a process breakpoint
-	TBreakId breakId;
-	test(KErrNone == iServSession.SetProcessBreak(breakId, processDebugId, address, EArmMode));
-
-	test(KErrNone ==iServSession.SetEventAction(KRMDebugTestApplication,EEventsProcessBreakPoint, EActionContinue));
-
-	//resume the thread now
-	test(KErrNone == iServSession.ResumeThread(threadDebugId));
-
-	// wait for the breakpoint to be hit
-	static TRequestStatus status;
-	TEventInfo info;
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-	iServSession.GetEvent(KRMDebugTestApplication,status,infoPtr);
-	// Wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iEventType ==  EEventsProcessBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	// Not interested in breakpoint events any more
-	test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, EEventsProcessBreakPoint, EActionIgnore));
-
-	// program now running, so try to kill it which should clear all the breakpoints
-	test(KErrNone == iServSession.KillProcess(processDebugId, 0  /* kill reason */ ));
-
-	processDebug.Close();
-	User::After(2000000);	// should die within two seconds.
-
-	// can we still find it? Should be gone
-	found = ProcessExists(KRMDebugAppName);
-	test (!found);
-
-	// release the program again
-	test(KErrNone == iServSession.DetachExecutable(KRMDebugTestApplication));
-
-	}
-
-void CRunModeAgent::HelpTestSecurityAttachDetachExecutable(const TDesC& aProcessName, TBool aExpectSuccess)
-	{
-	RProcess process;
-	TInt err = process.Create(aProcessName, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// start the test program
-	process.Resume();
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// attach to the program (passively)
-	err = iServSession.AttachExecutable(aProcessName, EFalse);
-
-	if( gUseDelay ) User::After(500000);
-
-	// Do we expect to successfully attach
-	if (aExpectSuccess)
-	{
-		// Yes
-		test(KErrNone == err);
-
-		// Now detach again
-		test(KErrNone == iServSession.DetachExecutable(aProcessName));
-		if( gUseDelay ) User::After(500000);
-	}
-	else
-	{
-		// No
-		test(KErrPermissionDenied == err);
-
-		// Just to be sure, try active attachment
-		test(KErrPermissionDenied == iServSession.AttachExecutable(aProcessName, ETrue));
-		if( gUseDelay ) User::After(500000);
-	}
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-	if( gUseDelay ) User::After(500000);
-	}
-
-void CRunModeAgent::ReportPerformance(void)
-//
-// Reports performance metrics from all the tests
-//
-	{
-	test.Printf(_L("\nPerformance\n"));
-	test.Printf(_L("========================\n"));
-
-	// Memory
-	test.Printf(_L("Memory read: %d KBytes/sec\n"),iMemoryReadKbytesPerSecond);
-	test.Printf(_L("Memory write: %d KBytes/sec\n"),iMemoryWriteKbytesPerSecond);
-
-	// Registers
-	// to do
-
-	// events
-	// to do
-
-	// Breakpoints
-	test.Printf(_L("Breakpoint set/clear: %d/sec\n"),iBreakpointsPerSecond);
-	test.Printf(_L("Maximum number of breakpoints: %d\n"),iMaxBreakpoints);
-
-	// Stepping
-	test.Printf(_L("Stepping speed: %d/sec\n"),iStepsPerSecond);
-
-	// Runtime
-	TInt ticks = HelpGetTestTicks();
-	test (ticks != 0);
-
-	TInt nkTicksPerSecond = HelpTicksPerSecond();
-	test (nkTicksPerSecond != 0);
-
-	test.Printf(_L("Total test runtime: %d seconds\n"),ticks/nkTicksPerSecond);
-
-	// Final sizes of executables/rom/ram etc
-	// to do
-
-	test.Printf(_L("\n"));
-	}
-
-/**
- * Helper code for the stepping tests. Sets a breakpoint in a running thread.
- * It suspends the thread, sets the breakpoint, and resumes the thread.
- *
- * @param aBreakId - Reference to a TBreakId which will be set when the breakpoint is set
- * @param aThreadId - The thread id for which we should set the breakpoint.
- * @param aBreakAddress - The address to set the breakpoint
- * @param aMode - The architecture of the breakpoint to be set (ARM/Thumb/Thumb2EE)
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepSetBreak(TBreakId& aBreakId, TThreadId aThreadId, const TUint32 aBreakAddress, TArchitectureMode aMode, TBool aThreadSpecific, TProcessId aProcessId)
-	{
-	TInt err = KErrNone;
-
-	// Suspend the thread
-	err = iServSession.SuspendThread(aThreadId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepSetBreak - Failed to suspend thread\n"));
-		return err;
-		}
-
-	// Set the breakpoint
-	err = aThreadSpecific
-		? iServSession.SetBreak(aBreakId,aThreadId,aBreakAddress,aMode)
-		: iServSession.SetProcessBreak(aBreakId, aProcessId, aBreakAddress, aMode);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepSetBreak - Failed to set breakpoint\n"));
-		return err;
-		}
-
-	// Continue the thread
-	err = iServSession.ResumeThread(aThreadId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepSetBreak - Failed to resume thread\n"));
-		return err;
-		}
-
-	return KErrNone;
-	}
-
-/**
- * Helper code for the stepping tests. Clears a breakpoint in a running thread.
- * It suspends the thread, clears the breakpoint, and resumes the thread.
- *
- * @param aBreakId - Reference to a TBreakId which will be set when the breakpoint is set
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepClearBreak(TBreakId aBreakId, const TThreadId aThreadId, TBool aThreadSpecific)
-	{
-	TInt err = KErrNone;
-
-	// Find out what thread id we need to suspend
-	TThreadId threadId;
-	TProcessId processId;
-	TUint32 address;
-	TArchitectureMode mode;
-
-	err = aThreadSpecific
-		? iServSession.BreakInfo(aBreakId, threadId, address, mode)
-		: iServSession.ProcessBreakInfo(aBreakId, processId, address, mode);
-	if (err != KErrNone )
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to obtain information for breakpoint\n"));
-		return err;
-		}
-	if(aThreadSpecific && aThreadId != threadId)
-		{
-		test.Printf(_L("HelpTestStepClearBreak - mismatched thread Ids\n"));
-		return KErrGeneral;
-		}
-
-	// Suspend the thread
-	err = iServSession.SuspendThread(aThreadId);
-	if (!(err == KErrNone || err == KErrAlreadyExists))
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to suspend thread\n"));
-		return err;
-		}
-
-	// Clear the breakpoint
-	err = iServSession.ClearBreak(aBreakId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to clear breakpoint\n"));
-		return err;
-		}
-
-	// Continue the thread
-	err = iServSession.ResumeThread(aThreadId);
-	if (!(err == KErrNone || err == KErrNotFound))
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to resume thread\n"));
-		return err;
-		}
-
-	return KErrNone;
-	}
-
-/**
- * Helper code for the stepping tests. Waits for a previously set breakpoint to be hit.
- *
- * @param aProcessName - The name of the process in which the breakpoint is set. E.g. z:\sys\bin\app.exe
- * @param aEventInfo - The event information block which is filled in when the breakpoint is hit.
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepWaitForBreak(const TDesC& aProcessName, TEventInfo& aEventInfo)
-	{
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&aEventInfo,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(aProcessName,status,infoPtr);
-
-	// Wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	if (status == KErrNone)
-		{
-		return KErrNone;
-		}
-	else
-		{
-		return KErrGeneral;
-		}
-	}
-
-/**
- * Helper code for the stepping tests. Reads the current target PC for a given thread.
- *
- * @param aThreadId - Thread id for which to read the current target PC.
- * @param aPc - Reference to a TUint32 which will be set to the current target PC.
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepReadPC(TThreadId aThreadId, TUint32& aPC)
-	{
-	TInt err = KErrNone;
-
-	//create buffer containing PC register ID
-	RBuf8 pcId;
-	err = pcId.Create(sizeof(TRegisterInfo));
-	if (err != KErrNone)
-		{
-		return err;
-		}
-
-	TRegisterInfo reg1 = (TRegisterInfo)0x00000f00;
-	pcId.Append(reinterpret_cast<const TUint8*>(&reg1), sizeof(TRegisterInfo));
-
-	//create buffer containing desired PC value
-	TPtr8 pcValue((TUint8*)&aPC,4,4);
-
-	//create buffer for PC flag value
-	RBuf8 pcFlag;
-	err = pcFlag.Create(sizeof(TUint8));
-
-	//read the new PC value
-	err = iServSession.ReadRegisters(aThreadId, pcId, pcValue, pcFlag);
-	if (err != KErrNone)
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return err;
-		}
-
-	//get the flag and check the PC value was read ok
-	TRegisterFlag flag = ENotSupported;
-	err = GetFlag(pcFlag, 0, flag);
-	if (err != KErrNone)
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return err;
-		}
-
-	if (flag == EValid)
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return KErrNone;
-		}
-	else
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return err;
-		}
-	}
-
-/**
- * Helper code for the stepping tests. Single steps a given thread from aStartAddress to aEndAddress. Note
- * that it reaches aStartAddress by setting a breakpoint at that address and waiting until it is hit.
- *
- * @param aThreadId - Thread id for which to read the current target PC.
- * @param aStartAddress - The target address at which stepping will start.
- * @param aEndAddress - The target address at which stepping will end.
- * @param aMode - The architecture of the breakpoint which must be set at the start address (ARM/Thumb/Thumb2EE).
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStep(TThreadId aThreadId, TUint32 aStartAddress, TUint32 aEndAddress, TArchitectureMode aMode, TUint aNumSteps, TBool aThreadSpecific, TProcessId aProcessId)
-	{
-	TInt err = KErrNone;
-
-	// Ensure that the supplied addresses are word/half-word aligned as appropriate.
-	if (aMode == EArmMode)
-		{
-		// ARM breakpoints must be word-aligned (2 lsb must be zero)
-		aStartAddress &= 0xFFFFFFFC;
-		aEndAddress &= 0xFFFFFFFC;
-		}
-	else if (aMode == EThumbMode)
-		{
-		// Thumb breakpoints must be half-word aligned (lsb must be zero)
-		aStartAddress &= 0xFFFFFFFE;
-		aEndAddress	 &= 0xFFFFFFFE;
-		}
-	else if (aMode == EThumb2EEMode)
-	{
-		// Thumb2EE breakpoints are not currently supported
-		return KErrNotSupported;
-	}
-
-	// Set breakpoint at the start address
-	TBreakId tempBreakId;
-	TEventInfo info;
-
-	err = HelpTestStepSetBreak(tempBreakId,aThreadId,aStartAddress,aMode,aThreadSpecific,aProcessId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to set breakpoint at aStartAddress 0x%08x\n"),aStartAddress);
-		return err;
-		}
-
-	// wait for the breakpoint to be hit
-	err = HelpTestStepWaitForBreak(iFileName,info);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to hit the breakpoint at aStartAddress 0x%08x\n"),aStartAddress);
-		return err;
-		}
-
-	// Check the PC == aStartAddress
-	TUint32 pc = 0;
-	err = HelpTestStepReadPC(aThreadId,pc);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to read the PC after hitting breakpoint at aStartAddress 0x%08x\n"),aStartAddress);
-		return err;
-		}
-
-	if (pc != aStartAddress)
-		{
-		test.Printf(_L("HelpTestStep - Incorrect PC value after hitting breakpoint (expected 0x%08x actual 0x%08x)\n"),aStartAddress,pc);
-		return KErrGeneral;
-		}
-
-	err = iServSession.Step(aThreadId,aNumSteps);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to do step from 0x%08x to 0x%08x\n"),aStartAddress,aEndAddress,aNumSteps);
-		return err;
-		}
-
-	// only one 'completed step' event in the buffer.
-	err = HelpTestStepWaitForBreak(iFileName,info);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Could not read breakpoint event info after stepping"));
-		return err;
-		}
-	// end
-
-	// Check PC == aEndAddress
-	err = HelpTestStepReadPC(aThreadId,pc);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - failed read the PC after stepping\n"));
-		return err;
-		}
-	if (pc != aEndAddress)
-		{
-		test.Printf(_L("HelpTestStep - Incorrect PC value after stepping (expected 0x%08x actual 0x%08x)\n"),aEndAddress,pc);
-		return KErrGeneral;
-		}
-
-	// Clear the breakpoint
-	err = HelpTestStepClearBreak(tempBreakId, aThreadId, aThreadSpecific);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - failed to clear temporary breakpoint\n"));
-		return err;
-		}
-
-	return KErrNone;
-	}
-
-/**
- * Helper code for the stepping tests. Returns the number of nanokernel ticks in one second.
- *
- * @return Number of nanokernel ticks. 0 if unsuccesful.
- */
-TInt CRunModeAgent::HelpTicksPerSecond(void)
-	{
-	TInt nanokernel_tick_period;
-	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-
-	ASSERT(nanokernel_tick_period != 0);
-
-	static const TInt KOneMillion = 1000000;
-
-	return KOneMillion/nanokernel_tick_period;
-	}
-
-/**
-  Given aTestNumber runs the appropriate test inside heap markers
-
-  @param aTestNumber test to run, corresponds to an entry in iTestArray
-
-  @panic Panic if aTestNumber is not in valid range
-  */
-void CRunModeAgent::RunTest(TInt aTestNumber)
-	{
-	if( (aTestNumber<0) || (aTestNumber>=KMaxTests) )
-		{
-		User::Panic(_L("Test number out of range"), aTestNumber);
-		}
-	__UHEAP_MARK;
-	(this->*(iTestArray[aTestNumber].iFunctionPtr))();
-	__UHEAP_MARKEND;
-	}
-
-void CRunModeAgent::PrintVersion()
-	{
-	test.Printf(_L("\nt_rmdebug2.exe\nVersion: %S\n"), &(testVersion.Name()));
-	test.Printf(_L("Press any key...\n"));
-	test.Getch();
-	}
-
-void CRunModeAgent::PrintUsage()
-	{
-	test.Printf(_L("Invoke with arguments:\n"));
-	test.Printf(_L("-r: run specified tests in reverse order\n"));
-	test.Printf(_L("-h: display usage information\n"));
-	test.Printf(_L("-v: display version\n"));
-	test.Printf(_L("-d: use delays\n"));
-	test.Printf(_L("<number>: test number to run, can specify more than one from the following list:\n"));
-	test.Printf(_L("Press any key for list...\n"));
-	test.Getch();
-	// if there are too many of these they won't fit on the screen! Stick another Getch() in if there get too many
-	for(TInt i=0; i<KMaxTests; i++)
-		{
-		test.Printf(_L("%2d: %S\n"), i, &(iTestArray[i].iFunctionName));
-		}
-	test.Printf(_L("Press any key...\n"));
-	test.Getch();
-	}
-
-/**
-  Parse the command line, see CRunModeAgent::PrintUsage for syntax
-  */
-void CRunModeAgent::ParseCommandLineL(TUint32& aMode, RArray<TInt>& aTests)
-	{
-	// get the length of the command line arguments
-	TInt argc = User::CommandLineLength();
-
-	// allocate a buffer for the command line arguments and extract the data to it
-	HBufC* commandLine = HBufC::NewLC(argc);
-	TPtr commandLineBuffer = commandLine->Des();
-	User::CommandLine(commandLineBuffer);
-
-	// reset mode
-	aMode = (TTestMode)0;
-
-	// create a lexer and read through the command line
-	TLex lex(*commandLine);
-	while (!lex.Eos())
-		{
-		// expecting the first character to be a '-'
-		if (lex.Get() == '-')
-			{
-			TChar arg = lex.Get();
-			switch (arg)
-				{
-				case 'v':
-					//print out the help
-					aMode |= EModeVersion;
-					break;
-				case 'h':
-					//print out the help
-					aMode |= EModeHelp;
-					break;
-				case 'r':
-					//store the fact that we want to run in reverse
-					aMode |= EModeReverse;
-					break;
-				case 'd':
-					//store the fact that we want to run in reverse
-					gUseDelay = EFalse;
-					RDebug::Printf("Not using delays");
-					break;
-				default:
-					// unknown argument so leave
-					User::Leave(KErrArgument);
-				}
-			}
-		else
-			{
-			lex.UnGet();
-			TInt testNumber;
-			User::LeaveIfError(lex.Val(testNumber));
-			if( (testNumber<0) || (testNumber>=KMaxTests) )
-				{
-				User::Leave(KErrArgument);
-				}
-			aTests.AppendL(testNumber);
-			}
-		lex.SkipSpace();
-		}
-	// if no tests specified then run them all
-	if(aTests.Count() == 0)
-		{
-		aMode |= EModeAll;
-		}
-
-	// do clean up
-	CleanupStack::PopAndDestroy(commandLine);
-	}
-
-void CRunModeAgent::ClientAppL()
-//
-// Performs each test in turn
-//
-	{
-	test.Start(_L("ClientAppL"));
-
-	RArray<TInt> testsToRun;
-	TUint32 testMode = 0;
-	ParseCommandLineL(testMode, testsToRun);
-
-	//if help or version mode specified then just print out the relevant stuff and quit
-	if((testMode & EModeHelp) || (testMode & EModeVersion))
-		{
-		if(testMode & EModeHelp)
-			{
-			PrintUsage();
-			}
-		if(testMode & EModeVersion)
-			{
-			PrintVersion();
-			}
-		test.End();
-		return;
-		}
-
-	if(testMode & EModeAll)
-		{
-		for(TInt i=0; i<KMaxTests; i++)
-			{
-			testsToRun.AppendL(i);
-			}
-		}
-
-	// if EModeReverse specified then reverse the array elements
-	TInt numberOfTests = testsToRun.Count();
-	if(testMode & EModeReverse)
-		{
-		for(TInt i=0; i<(numberOfTests>>1); i++)
-			{
-			TInt temp = testsToRun[i];
-			testsToRun[i] = testsToRun[numberOfTests - (i+1)];
-			testsToRun[numberOfTests - (i+1)] = temp;
-			}
-		}
-
-	__UHEAP_MARK;
-	SetupAndAttachToDSS();
-	__UHEAP_MARKEND;
-
-	HelpStartTestTimer();
-	for(TInt i=0; i<numberOfTests; i++)
-		{
-		RunTest(testsToRun[i]);
-		if( gUseDelay ) User::After(500000);
-		}
-	testsToRun.Close();
-
-	HelpStopTestTimer();
-
-	ReportPerformance();
-
-	test.End();
-	}
-
-/**
-  Fill the test array with pointers to each test.
-  */
-void CRunModeAgent::FillArray()
-	{
-	iTestArray[0].iFunctionPtr = &CRunModeAgent::TestDriverSecurity;
-	iTestArray[0].iFunctionName = _L("TestDriverSecurity");
-	iTestArray[1].iFunctionPtr = &CRunModeAgent::TestDllUsage;
-	iTestArray[1].iFunctionName = _L("TestDllUsage");
-	iTestArray[2].iFunctionPtr = &CRunModeAgent::TestSecurity;
-	iTestArray[2].iFunctionName = _L("TestSecurity");
-	iTestArray[3].iFunctionPtr = &CRunModeAgent::TestAttachExecutable;
-	iTestArray[3].iFunctionName = _L("TestAttachExecutable");
-	iTestArray[4].iFunctionPtr = &CRunModeAgent::TestGetExecutablesList;
-	iTestArray[4].iFunctionName = _L("TestGetExecutablesList");
-	iTestArray[5].iFunctionPtr = &CRunModeAgent::TestGetProcessList;
-	iTestArray[5].iFunctionName = _L("TestGetProcessList");
-	iTestArray[6].iFunctionPtr = &CRunModeAgent::TestGetXipLibrariesList;
-	iTestArray[6].iFunctionName = _L("TestGetXipLibrariesList");
-	iTestArray[7].iFunctionPtr = &CRunModeAgent::TestGetThreadList;
-	iTestArray[7].iFunctionName = _L("TestGetThreadList");
-	iTestArray[8].iFunctionPtr = &CRunModeAgent::TestGetCodeSegsList;
-	iTestArray[8].iFunctionName = _L("TestGetCodeSegsList");
-	iTestArray[9].iFunctionPtr = &CRunModeAgent::TestGetListInvalidData;
-	iTestArray[9].iFunctionName = _L("TestGetListInvalidData");
-	iTestArray[10].iFunctionPtr = &CRunModeAgent::TestMemoryAccess;
-	iTestArray[10].iFunctionName = _L("TestMemoryAccess");
-	iTestArray[11].iFunctionPtr = &CRunModeAgent::TestDebugFunctionality;
-	iTestArray[11].iFunctionName = _L("TestDebugFunctionality");
-	iTestArray[12].iFunctionPtr = &CRunModeAgent::TestSuspendResume;
-	iTestArray[12].iFunctionName = _L("TestSuspendResume");
-	iTestArray[13].iFunctionPtr = &CRunModeAgent::TestBreakPoints;
-	iTestArray[13].iFunctionName = _L("TestBreakPoints");
-	iTestArray[14].iFunctionPtr = &CRunModeAgent::TestModifyBreak;
-	iTestArray[14].iFunctionName = _L("TestModifyBreak");
-	iTestArray[15].iFunctionPtr = &CRunModeAgent::TestBreakInfo;
-	iTestArray[15].iFunctionName = _L("TestBreakInfo");
-	iTestArray[16].iFunctionPtr = &CRunModeAgent::TestRunToBreak;
-	iTestArray[16].iFunctionName = _L("TestRunToBreak");
-	iTestArray[17].iFunctionPtr = &CRunModeAgent::TestBreakPointsInLoop;
-	iTestArray[17].iFunctionName = _L("TestBreakPointsInLoop");
-	iTestArray[18].iFunctionPtr = &CRunModeAgent::TestRegisterAccess;
-	iTestArray[18].iFunctionName = _L("TestRegisterAccess");
-	iTestArray[19].iFunctionPtr = &CRunModeAgent::TestStep;
-	iTestArray[19].iFunctionName = _L("TestStep");
-	iTestArray[20].iFunctionPtr = &CRunModeAgent::TestDemandPaging;
-	iTestArray[20].iFunctionName = _L("TestDemandPaging");
-	iTestArray[21].iFunctionPtr = &CRunModeAgent::TestEventsForExternalProcess;
-	iTestArray[21].iFunctionName = _L("TestEventsForExternalProcess");
-	iTestArray[22].iFunctionPtr = &CRunModeAgent::TestEvents;
-	iTestArray[22].iFunctionName = _L("TestEvents");
-	iTestArray[23].iFunctionPtr = &CRunModeAgent::TestKillProcess;
-	iTestArray[23].iFunctionName = _L("TestKillProcess");
-	iTestArray[24].iFunctionPtr = &CRunModeAgent::TestProcessBreakPoints;
-	iTestArray[24].iFunctionName = _L("TestProcessBreakPoints");
-	iTestArray[25].iFunctionPtr = &CRunModeAgent::TestMultipleTraceEvents;
-	iTestArray[25].iFunctionName = _L("TestMultipleTraceEvents");
-	iTestArray[26].iFunctionPtr = &CRunModeAgent::TestAddRemoveProcessEvents;
-	iTestArray[26].iFunctionName = _L("TestAddRemoveProcessEvents");
-	iTestArray[27].iFunctionPtr = &CRunModeAgent::TestCrashFlash;
-	iTestArray[27].iFunctionName = _L("TestCrashFlash");
-	iTestArray[28].iFunctionPtr = &CRunModeAgent::TestProcessKillBreakpoint;
-	iTestArray[28].iFunctionName = _L("TestProcessKillBreakpoint");
-	};
-
-GLDEF_C TInt E32Main()
-//
-// Entry point for run mode debug driver test
-//
-	{
-   TInt ret = KErrNone;
-
-	// client
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-   	test.Title();
-   RunModeAgent = CRunModeAgent::NewL();
-   if (RunModeAgent != NULL)
-       {
-        __UHEAP_MARK;
-	    TRAP(ret,RunModeAgent->ClientAppL());
-	    __UHEAP_MARKEND;
-
-	    delete RunModeAgent;
-       }
-
-	delete trap;
-
-	return ret;
-	}
-
-/**
-Helper function to get the aOffset'th value from aFlags
-
-@param aFlags descriptor containing TRegisterFlag type flags
-@param aOffset index of flag value to extract from aFlags
-@param aFlagValue the flag value if function returned successfully
-
-@return KErrNone if value was read successfully, KErrTooBig if aOffset is
-        greater than aFlags.Length()
-*/
-TInt CRunModeAgent::GetFlag(const TDes8& aFlags, const TUint aOffset, TRegisterFlag &aFlagValue) const
-	{
-	//get pointer to data
-	const TUint8 *ptr = aFlags.Ptr();
-
-	//check aOffset is valid
-	TUint length = aFlags.Length();
-	if(aOffset >= length)
-		return KErrTooBig;
-
-	//get flag value
-	aFlagValue = (TRegisterFlag)ptr[aOffset];
-	return KErrNone;
-	}
-
-/**
-  Helper function to set the value of FunctionChooser in the target debug thread.
-
-  @param aTestFunction TTestFunction enum to set FunctionChooser to
-
-  @return KErrNone if the value was set correctly, or one of the other system wide error codes
-  */
-TInt CRunModeAgent::SwitchTestFunction(TTestFunction aTestFunction)
-	{
-	//suspend the target thread
-	TInt suspendError = iServSession.SuspendThread(iThreadID);
-	if(! ( (suspendError == KErrNone) || (suspendError == KErrAlreadyExists) ) )
-		{
-		//the thread is not suspended so exit
-		return suspendError;
-		}
-
-	//get the address of FunctionChooser
-	TUint32 functionChooserAddress = (TUint32)&FunctionChooser;
-	//put the new value for FunctionChooser into a descriptor
-	TPtr8 functionBuf((TUint8*)&aTestFunction, sizeof(TTestFunction), sizeof(TTestFunction));
-	//write the new value into the target thread
-	TInt writeError = iServSession.WriteMemory(iThreadID, functionChooserAddress, sizeof(TTestFunction), functionBuf, EAccess32, EEndLE8);
-
-	if(KErrNone == suspendError)
-		{
-		//if this function suspended the target thread then we need to resume it
-		TInt resumeError = iServSession.ResumeThread(iThreadID);
-		if(KErrNone != resumeError)
-			{
-			//resuming failed so return the error
-			return resumeError;
-			}
-		}
-
-	//suspending and resuming was successful so return the error code from the WriteMemory call
-	return writeError;
-	}
-
-/**
-  Launch a separate process to debug.
-
-  @param aProcess the RProcess object to use to create the process
-  @param aFileName file name of the executable to create the process from
-  @param aFunctionType function that the target process should call on execution
-  @param aDelay delay before the new process should call the function represented by aFunctionType
-  @param aExtraThreads number of extra threads to create in the child process
-
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-TInt CRunModeAgent::LaunchProcess(RProcess& aProcess, const TDesC& aFileName, TDebugFunctionType aFunctionType, TUint32 aDelay, TUint32 aExtraThreads)
-	{
-	// at the moment we support two arguments, this number might have to be increased to support arguments
-	const TUint KMaxCommandLineLength = 32;
-
-	// create a command line buffer
-	RBuf commandLine;
-	commandLine.Create(KMaxCommandLineLength);
-
-	// append the command line arguments to the buffer
-	_LIT(KFArg, "-f");
-	commandLine.Append(KFArg());
-	commandLine.AppendNum(aFunctionType);
-
-	_LIT(KSpace, " ");
-	commandLine.Append(KSpace());
-
-	_LIT(KDArg, "-d");
-	commandLine.Append(KDArg());
-	commandLine.AppendNum(aDelay);
-
-	commandLine.Append(KSpace());
-
-	_LIT(KEArg, "-e");
-	commandLine.Append(KEArg());
-	commandLine.AppendNum(aExtraThreads);
-
-	// create the new process, matching on file name only, not specifying uid values
-	TInt err = aProcess.Create(aFileName, commandLine);	// owned by the process
-
-	// check that there was no error raised
-	if(err != KErrNone)
-		{
-		commandLine.Close();
-		return err;
-		}
-
-	TRequestStatus status = KRequestPending;
-	aProcess.Rendezvous(status);
-
-	commandLine.Close();	// after target thread starts
-
-	if(KRequestPending != status.Int())
-		{
-		// startup failed so kill the process
-		aProcess.Kill(KErrNone);
-		return status.Int();
-		}
-	else
-		{
-		// start up succeeded so resume the process
-		aProcess.Resume();
-		User::WaitForRequest(status);
-		if(KErrNone != status.Int())
-			{
-			aProcess.Kill(KErrNone);
-			}
-		return status.Int();
-		}
-	}
-
-/**
-  Helper function to read a tag header from a debug functionality block
-
-  @param aDebugFunctionalityBlock block to read header from
-  @param aTagHdrId header type to find
-
-  @return pointer to the header, or NULL if not available
-  */
-TTagHeader* CRunModeAgent::GetTagHdr(const TDesC8& aDebugFunctionalityBlock, const TTagHeaderId aTagHdrId) const
-	{
-	TUint8* ptr = (TUint8*) aDebugFunctionalityBlock.Ptr();
-	TUint8* blockEnd = ptr + aDebugFunctionalityBlock.Size();
-
-	while(ptr < blockEnd)
-		{
-		TTagHeader* header = (TTagHeader*)ptr;
-		if(header->iTagHdrId == aTagHdrId)
-			{
-			return header;
-			}
-		ptr += sizeof(TTagHeader) + (header->iNumTags * sizeof(TTag));
-		}
-	return NULL;
-	}
-
-/**
-  Helper function to read a tag from a debug functionality block
-
-  @param aTagHdr pointer to a tag header in a debug functionality block
-  @param aElement element to return from the header's data
-
-  @return pointer to the tag, or NULL if not available
-  */
-TTag* CRunModeAgent::GetTag(const TTagHeader* aTagHdr, const TInt aElement) const
-	{
-	TUint8* ptr = (TUint8*)aTagHdr + sizeof(TTagHeader);
-	TUint8* blockEnd = ptr + (aTagHdr->iNumTags * sizeof(TTag));
-
-	while(ptr < blockEnd)
-		{
-		TTag* tag = (TTag*)ptr;
-		if(tag->iTagId == aElement)
-			{
-			return tag;
-			}
-		ptr += sizeof(TTag);
-		}
-	return NULL;
-	}
-
-TTag CRunModeAgent::GetTag(const TTagHeaderId aTagHdrId, const TInt aElement)
-	{
-	TUint32 bufsize = 0;	// Safe default size
-
-	// Get functionality block size
-	test(KErrNone == iServSession.GetDebugFunctionalityBufSize(&bufsize));
-
-	// Ensure we have a finite buffer size
-	test(bufsize!=0);
-
-	// Allocate space for the functionality data
-	HBufC8* dftext = HBufC8::NewLC(bufsize);
-
-	// create an empty TPtr8 refering to dftext
-	TPtr8 dftextPtr(dftext->Des());
-
-	// Get the functionality block
-	test(KErrNone == iServSession.GetDebugFunctionality(dftextPtr));
-
-	// read a value from the data to check it has come through as expected
-	TTagHeader* header = GetTagHdr(dftext->Des(), aTagHdrId);
-	test(header != NULL);
-	TTag* tag = GetTag(header, aElement);
-	test(tag != NULL);
-
-	TTag tagToReturn = *tag;
-
-	// Remove our temporary buffer
-	CleanupStack::PopAndDestroy(dftext);
-
-	return tagToReturn;
-	}
-
-/**
-  Helper function which returns a Boolean indicating with a process with the
-  specified name is currently running.
-
-  @param aProcessName - Name of the process to find
-  @return ETrue if found, EFalse otherwise
-  */
-TBool CRunModeAgent::ProcessExists(const TDesC& aProcessName)
-	{
-	TInt    err=KErrNone;
-	TBool	found = FALSE;
-
-_LIT(KWildCard,"*");
-
-	TFindProcess find(KWildCard);
-	TFullName name;
-	while(find.Next(name)==KErrNone)
-		{
-		RProcess process;
-		err = process.Open(find);
-		if (err == KErrNone)
-			{
-			if (name.Find(aProcessName) != KErrNotFound)
-				{
-					found = TRUE;
-				}
-			process.Close();
-			}
-	   }
-
-	return found;
-	}
--- a/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Definitions for the run mode debug tests
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef RMDEBUG_H
-#define RMDEBUG_H
-
-#include "t_rmdebug_app.h"
-#include "r_user_low_memory_security_svr_session.h"
-#include "r_kernel_low_memory_security_svr_session.h"
-
-
-class CRunModeAgent;
-
-// Create a pointer to function type
-typedef void (CRunModeAgent::*testFunction)();
-
-class TFunctionData
-	{
-public:
-	testFunction iFunctionPtr;
-	TBuf<40> iFunctionName;
-	};
-
-//number of test functions that we have
-const TInt KMaxTests = 29; 
-
-//
-// class CRunModeAgent
-//
-// The basic run mode agent.
-//
-class CRunModeAgent : public CBase
-	{
-public:
-	static CRunModeAgent* NewL();
-	~CRunModeAgent();
-	void ClientAppL();
-
-private:
-	CRunModeAgent();
-	void ConstructL();
-	void SetupAndAttachToDSS();
-
-	TInt TestStartup();
-	TInt TestShutdown();
-
-	void TestGetExecutablesList();
-	void TestGetProcessList();
-	void TestGetThreadList();
-	void TestGetCodeSegsList();
-	void TestGetXipLibrariesList();
-	void TestGetListInvalidData();
-
-	TBool DoTestGetThreadList(const TBool aShouldPass, const Debug::TListScope aListScope, const TUint64 aTargetId=0);
-	void DoTestGetCodeSegsList(const TBool aShouldPass, const Debug::TListScope aListScope, const TUint64 aTargetId=0);
-
-	void DoGetList(const Debug::TListId aListId, const Debug::TListScope aListScope, RBuf8& aBuffer, TUint32& aSize, const TUint64 aTargetId=0);
-
-	void TestMemoryAccess();
-	void TestSuspendResume();
-	void TestBreakPoints();
-	void TestConsecutiveBreakPoints();
-	void TestModifyBreak();
-	void DoTestModifyBreak(TBool aThreadSpecific);
-	void TestBreakInfo();
-	void DoTestBreakInfo(TBool aThreadSpecific);
-	void TestRunToBreak();
-	void DoTestRunToBreak(TBool aThreadSpecific);
-	void TestBreakPointsInLoop();
-	void DoTestBreakPointsInLoop(TBool aThreadSpecific);
-	void TestRegisterAccess();
-	void TestAttachExecutable();
-	void TestDebugFunctionality();
-	void TestStep();
-	void DoTestStep(TBool aThreadSpecific);
-	void TestDriverSecurity();
-	void TestSecurity();
-	void TestEvents();
-	void TestEventsForExternalProcess();
-	void TestDemandPaging();
-	void TestTraceSecurity();
-	void TestDllUsage();
-	void TestKillProcess();
-	void TestProcessBreakPoints();
-	void TestMultipleTraceEvents();
-	void TestAddRemoveProcessEvents();
-	void TestProcessKillBreakpoint();
-	void DoTestProcessKillBreakpoint();
-
-	//crash flash test functions
-	void TestCrashFlash();
-		
-	TInt GetFlag(const TDes8 &aFlags, const TUint aOffset, Debug::TRegisterFlag &aFlagValue) const;
-
-	void ReportPerformance(void);
-
-	// helper functions
-	void HelpTestSecurityAttachDetachExecutable(const TDesC& aProcessName, TBool aExpectSuccess);
-
-	TInt HelpTestStepSetBreak(Debug::TBreakId& aBreakId, TThreadId aThreadId, const TUint32 aBreakAddress, Debug::TArchitectureMode aMode, TBool aThreadSpecific=ETrue, TProcessId aProcessId=0);
-	TInt HelpTestStepClearBreak(const Debug::TBreakId aBreakId, const TThreadId aThreadId, TBool aThreadSpecific);
-	TInt HelpTestStepWaitForBreak(const TDesC& aProcessName, Debug::TEventInfo& aEventInfo);
-	TInt HelpTestStepReadPC(TThreadId aThreadId, TUint32& aPC);
-	TInt HelpTestStep(TThreadId aThreadId, TUint32 aStartAddress, TUint32 aEndAddress, Debug::TArchitectureMode aMode, TUint aNumSteps, TBool aThreadSpecific=ETrue, TProcessId=0);
-
-	TInt HelpTicksPerSecond(void);
-
-	// helper functions
-	void HelpStartTestTimer(void) { iStartTick = User::NTickCount(); iStopTick = 0; };
-	void HelpStopTestTimer(void) { iStopTick = User::NTickCount(); };
-	TInt HelpGetTestTicks(void) { return (iStopTick - iStartTick); };
-	TInt SwitchTestFunction(TTestFunction aTestFunction);
-	TInt LaunchProcess(RProcess& aProcess, const TDesC& aFileName, TDebugFunctionType aFunctionType, TUint32 aDelay=0, TUint32 aExtraThreads=0);
-	Debug::TTagHeader* GetTagHdr(const TDesC8& aDebugFunctionalityBlock, const Debug::TTagHeaderId aTagHdrId) const;
-	Debug::TTag* GetTag(const Debug::TTagHeader* aTagHdr, const TInt aElement) const;
-	Debug::TTag GetTag(const Debug::TTagHeaderId aTagHdrId, const TInt aElement);
-	TBool ProcessExists(const TProcessId aProcessId);
-	TBool ThreadExistsForProcess(const TThreadId aThreadId, const TProcessId aProcessId);
-	TBool ListingSupported(const Debug::TListId aListId, const Debug::TListScope aListScope);
-	void TestEventsWithExtraThreads(Debug::TKernelEventAction aActionMain, Debug::TKernelEventAction aActionExtra, TUint32 aExtraThreads);
-	void FillArray();
-	void PrintUsage();
-	void PrintVersion();
-
-	enum TTestMode 
-		{
-		//run all the tests
-		EModeAll = 1<<0,
-		//run the specified tests in reverse order
-		EModeReverse = 1<<1,
-		//print out help
-		EModeHelp = 1<<2,
-		//print out help
-		EModeVersion = 1<<3
-		};
-
-	void RunTest(TInt aTestNumber);
-	void ParseCommandLineL(TUint32& aMode, RArray<TInt>& aTests);
-
-	TBool ProcessExists(const TDesC& aProcessName);
-
-private:
-
-	TFunctionData iTestArray[KMaxTests];
-#if defined(KERNEL_OOM_TESTING)
-	RKernelLowMemorySecuritySvrSession iServSession;
-#elif defined (USER_OOM_TESTING)
-	RUserLowMemorySecuritySvrSession iServSession;
-#else
-	Debug::RSecuritySvrSession iServSession;
-#endif
-	RThread	iDebugThread;
-	RProcess iDSSProcess;
-	RSemaphore iAddressGlobSem;
-	TThreadId iThreadID;
-	TFileName iFileName;
-	TUid iMySid;
-
-	// Performance data
-	TInt iMemoryReadKbytesPerSecond;	
-	TInt iMemoryWriteKbytesPerSecond;	
-	TInt iBreakpointsPerSecond;
-	TInt iMaxBreakpoints;
-	TInt iStepsPerSecond;
-
-	// Timing information
-	TInt iStartTick;
-	TInt iStopTick;
-	};
-
-#endif // RMDEBUG_H
--- a/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2_oemtoken.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#include <e32base.h>
-#include <e32base_private.h>
-
-GLDEF_C TInt E32Main()
-	{
-	// No need to do anything, the only requirement is that
-	// this executable can be loaded and runs to completion
-	return 0;
-	}
-
-// End of file - t_rmdebug2_oemtoken.cpp
--- a/kerneltest/e32test/rm_debug/common/t_target_launcher.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Helper app to launch debug targets. Uses command-line parameters as follows using a + sign:
-//  +n<number of applications to launch>
-//  +m<number of times to launch each application>
-//  +o<order of launch, 1 means launch in reverse order>
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <f32dbg.h>
-#include <f32file.h>
-#include <hal.h>
-#include <u32hal.h>
-#include <e32property.h>
-
-#include "t_target_launcher.h"
-
-
-/**
-  Launch a process
-
-  @param aProcess The RProcess object to use to create the process
-  @param aExeName File name of the executable to create the process from
-  @param aCommandLine The command line to pass to the new process
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-TInt LaunchProcess(RProcess& aProcess, TDesC & aExeName, TPtr & aCommandLine )
-    {
-
-    TPtrC commandLine( aCommandLine );
-
-    TInt err = aProcess.Create( aExeName, commandLine );
-
-    // check that there was no error raised
-    if(err != KErrNone)
-        {
-        return err;
-        }
-
-    TRequestStatus status = KRequestPending;
-    aProcess.Rendezvous(status);
-
-    if(KRequestPending != status.Int())
-        {
-        // startup failed so kill the process
-        RDebug::Printf( "> RProcess Rendezvous() failed with %d. Killing process", status.Int() );
-        aProcess.Kill(KErrNone);
-        return status.Int();
-        }
-    else
-        {
-        // start up succeeded so resume the process
-        aProcess.Resume();
-        User::WaitForRequest(status);
-        if(KErrNone != status.Int())
-            {
-            RDebug::Printf( "> RProcess Resume() failed with %d. Killing process", status.Int() );
-            aProcess.Kill(KErrNone);
-            }
-        return status.Int();
-        }
-    }
-
-/**
- * Read command line parameters and control the launching of targets. 
- * Create global launch semaphore KLaunchMutexName
- */
-void MainL()
-    {
-
-    TInt numApps = KNumApps;
-    TInt numLaunches = KNumLaunches;
-    TInt launchControl = 0;
-
-    TInt argc = User::CommandLineLength();
-    HBufC* commandLine = NULL;
-    RDebug::Printf( ">Launcher Process() argc=%d", argc );
-
-    if( argc )
-        {
-        commandLine = HBufC::NewLC(argc);
-        TPtr commandLineBuffer = commandLine->Des();
-        User::CommandLine(commandLineBuffer);
-
-        RBuf printCommandLine;
-        CleanupClosePushL( printCommandLine );
-        printCommandLine.CreateL( commandLine->Des().Length() );
-        printCommandLine.Copy( commandLine->Des() );
-        printCommandLine.Collapse();
-        RDebug::Printf( ">command line = %S", &printCommandLine );
-        CleanupStack::PopAndDestroy( &printCommandLine );
-
-        // create a lexer and read through the command line
-        TLex lex(*commandLine);
-        while (!lex.Eos())
-            {
-            // only look for options with first character '+', other switches are for the targets
-            if (lex.Get() == '+')
-                {
-                TChar arg = lex.Get();
-                switch (arg)
-                    {
-                    case 'n':
-                        lex.Val( numApps );
-                        RDebug::Printf("parsed numApps as %d", numApps);
-                        break;
-                    case 'm':
-                        lex.Val( numLaunches );
-                        RDebug::Printf("parsed numLaunches as %d", numLaunches );
-                        break;
-                    case 'o':
-                        lex.Val( launchControl );
-                        RDebug::Printf("parsed launchControl as %d", launchControl);
-                        break;
-                    default:
-                        // unknown argument ignore it
-                        break;             
-                    }//switch
-                }// if +
-            }//while
-        }//if argc
-
-   RSemaphore launchMutex;
-   TInt ret = KErrNone;
-   CleanupClosePushL( launchMutex );
-   ret = launchMutex.CreateGlobal( KLaunchMutexName, 0 );
-   RDebug::Printf( ">Target Launcher : RSemaphore.CreateGlobal ret %d", ret);
-   User::LeaveIfError( ret );
-
-   ret = launchMutex.OpenGlobal( KLaunchMutexName );
-   RDebug::Printf( ">Target Launcher : RSemaphore.OpenGlobal ret %d", ret);
-   User::LeaveIfError( ret );
-
-   //Now launch the requested number of apps for the requested number of launches
-   for( ; numLaunches > 0; numLaunches-- )
-       { 
-       for( TInt launchIndex = numApps; launchIndex > 0; launchIndex-- )  
-           {
-           RDebug::Printf( ">Target Launcher:  Mutex wait app %d, launch %d", launchIndex, numLaunches );
-           launchMutex.Wait();
-
-           RBuf targetName;
-           CleanupClosePushL( targetName );
-           RDebug::Printf( ">Target Launcher:  targetName.Create %d, launch %d", launchIndex, numLaunches );
-           targetName.Create( KTargetExe().Length() + 2 );
-
-           if( launchControl == 1 )
-               {
-               // Reverse the order of the apps launched by reversing the index in the name
-               RDebug::Printf( ">Target Launcher:  targetName.Format %d, launch %d", numApps - launchIndex + 1, numLaunches );
-               targetName.Format( KTargetExe(), numApps - launchIndex + 1 );
-               }
-           else
-               {
-               RDebug::Printf( ">Target Launcher:  targetName.Format %d, launch %d", launchIndex, numLaunches );
-               targetName.Format( KTargetExe(), launchIndex );
-               }
-
-           RProcess aProc;
-           CleanupClosePushL( aProc ); 
-    
-           RDebug::Printf( ">Target Launcher: LaunchProcess %d, launch %d", launchIndex, numLaunches );
-           RDebug::Printf( ">LaunchProcess %lS", &targetName );
-           TPtr cmdLinePtr( commandLine->Des() );
-           ret = LaunchProcess( aProc, targetName, cmdLinePtr );
-           CleanupStack::PopAndDestroy( &aProc );
-
-           RDebug::Printf( "<Target Launcher: LaunchProcess returned %d", ret );
-           CleanupStack::PopAndDestroy( &targetName );
-
-           User::LeaveIfError( ret );
-
-           //By now the add proc event should have been delivered to the
-           //test app agent.
-           }
-       }
-
-    launchMutex.Wait( 500000 );
-
-    CleanupStack::PopAndDestroy( &launchMutex );
-
-    if( commandLine )
-       CleanupStack::PopAndDestroy( commandLine );
- 
-    }
-
-
-GLDEF_C TInt E32Main()
-	{
-	RProcess thisProcess;
-	thisProcess.Rendezvous(KErrNone);
-	RDebug::Printf( ">Launcher Process()" );
-
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-
-	TRAPD(err, MainL());
-	RDebug::Printf( "< Target launching returned %d", err);
-	
-	delete trap;
-	
-	return err;
-	}
--- a/kerneltest/e32test/rm_debug/common/t_target_launcher.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description:
-// Definitions for target launcher
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef RMDEBUG_TARGET_LAUNCHER_H
-#define RMDEBUG_TARGET_LAUNCHER_H
-
-// Controls how many times the target applications are launched
-const TInt KNumLaunches = 3;
-
-// Controls how many applications are attached and launched
-// If changing this, need to make sure there are enough apps
-// being built. see KTargetExe and t_rmdebug_app*
-const TInt KNumApps = 4;  
-
-_LIT(KLaunchMutexName, "t_rmdebug_launch_mutex");
-_LIT(KLaunchMutexNameSearchString, "t_rmdebug_launch_mutex*");
-_LIT(KTargetExe,"z:\\sys\\bin\\t_rmdebug_app%d.exe");
-_LIT8(KTargetExeName,"t_rmdebug_app%d.exe");
-_LIT(KProcessFinder,"*t_rmdebug_app%d*");
-_LIT(KTargetOptions,"-f%d");
-
-_LIT(KZSysBin,"z:\\sys\\bin\\");
-_LIT(KLauncherExe,"z:\\sys\\bin\\t_rmdebug_target_launcher.exe");
-
-_LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-
-#endif // RMDEBUG_TARGET_LAUNCHER_H
--- a/kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h	Thu Sep 02 21:54:16 2010 +0300
@@ -28,7 +28,6 @@
 #include <e32cons.h>
 #include <e32test.h>
 #include <e32cmn.h>
-#include <rm_debug_api.h>
 #include <scmdatatypes.h>
 #include <scmbytestreamutil.h>
 #include <hal.h>
--- a/kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.cia	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-// 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:
-//
-// Description:
-// 
-//
-
-
-#include <u32std.h>
-
-// unused function that contains enough padding that the test function
-// RMDebugDemandPagingTest starts in a new page.
-__NAKED__ TInt RMDebugDemandPagingPaddingBefore()
-	{
-	asm("movs       r2,r0");
-	asm("adds       r0,r2,r1");
-	asm("bx         lr");
-	// add padding to make this function 4kb in size.
-	// The 4084 corresponds to 2^12 (=4096) - 12,
-	// the 12 being the total size of the movs, adds and bx instructions.
-	asm(".space     4084");
-	}
-
-// test function which is in a page by itself
-__NAKED__ TInt RMDebugDemandPagingTest()
-	{
-	asm("movs       r2,r0");
-	asm("adds       r0,r2,r1");
-	asm("bx         lr");
-	// add padding to make this function 4kb in size.
-	// The 4084 corresponds to 2^12 (=4096) - 12,
-	// the 12 being the total size of the movs, adds and bx instructions.
-	asm(".space     4084");
-	}
-
-// unused function that contains enough padding to ensure that no used code
-// is in the same page as RMDebugDemandPagingTest
-__NAKED__ TInt RMDebugDemandPagingPaddingAfter()
-	{
-	asm("movs       r2,r0");
-	asm("adds       r0,r2,r1");
-	asm("bx         lr");
-	// add padding to make this function 4kb in size.
-	// The 4084 corresponds to 2^12 (=4096) - 12,
-	// the 12 being the total size of the movs, adds and bx instructions.
-	asm(".space     4084");
-	}
-
--- a/kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-// 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:
-//
-// Description:
-// definitions of functions in d_demand_paging.cia
-//
-
-#ifndef D_DEMAND_PAGING_H
-#define D_DEMAND_PAGING_H
-
-TInt RMDebugDemandPagingTest();
-
-#endif // D_DEMAND_PAGING_H
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-// Copyright (c) 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:
-//
-// Description:
-//
-
-// definitions of functions in d_rmdebug_bkpt_test.s
-
-#ifndef D_RMDEBUG_BKPT_TESTS_H
-#define D_RMDEBUG_BKPT_TESTS_H
-
-extern "C"
-{
-	// Breakpoints in loop test
-	unsigned int RMDebug_Bkpt_Test_Entry(void);
-	unsigned int RMDebug_Bkpt_Test_Loop_Break_1(void);
-	unsigned int RMDebug_Bkpt_Test_Loop_Break_2(void);
-}
-#endif // D_RMDEBUG_BKPT_TESTS_H
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.s	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-; Copyright (c) 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:
-;
-; Description:
-;
-
-        AREA |d-rmdebug-bkpt$$Code|, CODE, READONLY, ALIGN=6
-
-	CODE32
-
-;
-; Breakpoints in loop test
-; 
-; This function initialises some variables and then performs some basic operations 
-; within the for loop. This allows us to set multiple breakpoints within the loop 
-; to test and see whether they are being hit. 
-;
-
-	EXPORT RMDebug_Bkpt_Test_Entry
-	EXPORT RMDebug_Bkpt_Test_Loop_Break_1
-	EXPORT RMDebug_Bkpt_Test_Loop_Break_2
-	
-RMDebug_Bkpt_Test_Entry
-    mov r2,#10
-    mov r0,#20    
-    mov r3,#0
-    mov r1,#1
-    b COMPARE
-LOOP      
-    add r3,r2,r0   
-RMDebug_Bkpt_Test_Loop_Break_1    
-    mov r2,r0
-RMDebug_Bkpt_Test_Loop_Break_2  
-    mov r0,r3 
-    add r1,r1,#1
-COMPARE
-    cmp r1,#30
-    ble LOOP 
-    bx lr
- 
-	END
-
-; End of file - d_rmdebug_bkpt_test.s
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-// 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:
-//
-// Description:
-// 
-// definitions of functions in d_rmdebug_step_tests.s
-//
-
-#ifndef D_RMDEBUG_STEP_TESTS_H
-#define D_RMDEBUG_STEP_TESTS_H
-
-extern "C"
-{
-	// ARM tests
-	unsigned int RMDebug_StepTest_Non_PC_Modifying(void);
-	unsigned int RMDebug_StepTest_Non_PC_Modifying_OK(void);
-	
-	unsigned int RMDebug_StepTest_Branch(void);
-	unsigned int RMDebug_StepTest_Branch_1(void);
-
-	unsigned int RMDebug_StepTest_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_2(void);
-	
-	unsigned int RMDebug_StepTest_MOV_PC(void);
-	unsigned int RMDebug_StepTest_MOV_PC_1(void);
-	unsigned int RMDebug_StepTest_MOV_PC_2(void);
-	
-	unsigned int RMDebug_StepTest_LDR_PC(void);
-	unsigned int RMDebug_StepTest_LDR_PC_1(void);
-
-	// Thumb tests
-	unsigned int RMDebug_StepTest_Thumb_Non_PC_Modifying(void);
-	unsigned int RMDebug_StepTest_Thumb_Non_PC_Modifying_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Non_PC_Modifying_2(void);
-
-	unsigned int RMDebug_StepTest_Thumb_Branch(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_2(void);
-	
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link_2(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link_3(void);
-
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link_2(void);
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link_3(void);
-
-	unsigned int RMDebug_StepTest_Thumb_AddPC(void);
-	unsigned int RMDebug_StepTest_Thumb_AddPC_1(void);
-	unsigned int RMDebug_StepTest_Thumb_AddPC_2(void);
-	unsigned int RMDebug_StepTest_Thumb_AddPC_3(void);
-
-	// ARM<->Thumb interworking tests
-	unsigned int RMDebug_StepTest_Interwork(void);
-	unsigned int RMDebug_StepTest_Interwork_1(void);
-	unsigned int RMDebug_StepTest_Interwork_2(void);
-	unsigned int RMDebug_StepTest_Interwork_3(void);
-
-	// Stepping performance test
-	unsigned int RMDebug_StepTest_Count(void);
-	unsigned int RMDebug_StepTest_Count_1(void);
-	unsigned int RMDebug_StepTest_Count_2(void);
-
-	// Multiple step test
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple(void);
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple_1(void);
-
-}
-#endif // D_RMDEBUG_STEP_TESTS_H
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.s	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +0,0 @@
-; 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:
-;
-; Description:
-; 
-;
-
-        
-		AREA |d-rmdebug-step$$Code|, CODE, READONLY, ALIGN=6
-
-	CODE32
-
-	; ARM tests
-	
-; 
-; Non-PC modifying
-;
-	EXPORT RMDebug_StepTest_Non_PC_Modifying
-	EXPORT RMDebug_StepTest_Non_PC_Modifying_OK
- 
-RMDebug_StepTest_Non_PC_Modifying
-	mov		r0,r0		; nop
-RMDebug_StepTest_Non_PC_Modifying_OK
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; Branch
-;
-	EXPORT RMDebug_StepTest_Branch
-	EXPORT RMDebug_StepTest_Branch_1
-
-RMDebug_StepTest_Branch
-	b		RMDebug_StepTest_Branch_1		
-	mov		r0, #2		; if the pc ends up here, we know its gone wrong
-RMDebug_StepTest_Branch_1
-	bx		lr			; return
-
-;
-; Branch and Link
-;
-	EXPORT RMDebug_StepTest_Branch_And_Link
-	EXPORT RMDebug_StepTest_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Branch_And_Link_2
-
-RMDebug_StepTest_Branch_And_Link		
-	mov		r0, lr		; preserve lr for the moment
-RMDebug_StepTest_Branch_And_Link_1
-	bl		RMDebug_StepTest_Branch_And_Link_2
-	mov		r1, #1		; insert a gap in the instruction stream so we know we branched.
-RMDebug_StepTest_Branch_And_Link_2
-	mov		lr, r0		; restore lr			
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; MOV PC
-;
-	EXPORT RMDebug_StepTest_MOV_PC
-	EXPORT RMDebug_StepTest_MOV_PC_1
-	EXPORT RMDebug_StepTest_MOV_PC_2
-
-RMDebug_StepTest_MOV_PC
-	mov		r0, #4
-RMDebug_StepTest_MOV_PC_1
-	add		pc, pc, r0	; should be a jump (bear in mind reading pc = current inst + 8bytes for arm)
-	mov		r0, #1		; Simple instructions which allow us to test where the PC really is
-	mov		r0, #2		; just by reading r0.
-RMDebug_StepTest_MOV_PC_2
-	mov		r0, #3		; 
-	mov		r0, #4		; 
-	bx		lr			; should return to normal execution of the test thread
-
-; 
-; LDR PC
-;
-	EXPORT RMDebug_StepTest_LDR_PC
-	EXPORT RMDebug_StepTest_LDR_PC_1
-
-RMDebug_StepTest_LDR_PC
-	ldr		pc, =RMDebug_StepTest_LDR_PC_1
-	mov		r0, #1		;  separate the branch target so we can prove it works
-RMDebug_StepTest_LDR_PC_1
-	bx		lr			; should return to normal execution of the test thread
-	
-;
-; ARM -> Thumb -> ARM interworking test
-;
-; Note: We always start and finish this test
-; in ARM mode.
-	EXPORT RMDebug_StepTest_Interwork
-	EXPORT RMDebug_StepTest_Interwork_1
-	EXPORT RMDebug_StepTest_Interwork_2
-	EXPORT RMDebug_StepTest_Interwork_3	
-RMDebug_StepTest_Interwork
-	mov		r0, lr	; preserve lr
-RMDebug_StepTest_Interwork_1
-	blx		RMDebug_StepTest_Interwork_2
-
-	CODE16
-RMDebug_StepTest_Interwork_2
-	blx		RMDebug_StepTest_Interwork_3
-
-	CODE32
-
-RMDebug_StepTest_Interwork_3
-	bx		r0
-
-;
-; Stepping performance tests
-;
-; This counts down from 100000 to 0
-; This means that for all practical purposes
-; we can single-step as much as we like
-; in less than one second and have some likelyhood
-; that we will not step too far from our loop
-
-	EXPORT RMDebug_StepTest_Count
-	EXPORT RMDebug_StepTest_Count_1
-	EXPORT RMDebug_StepTest_Count_2
-
-RMDebug_StepTest_Count
-	ldr		r2, =100000
-RMDebug_StepTest_Count_1
-	subs	r2, r2, #1
-RMDebug_StepTest_Count_2
-	bne		RMDebug_StepTest_Count_1
-	bx		lr
-
-; Thumb tests
-
-; Thumb non-pc modifying
-;
-;
-RMDebug_StepTest_Thumb_Non_PC_Modifying
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Non_PC_Modifying_1
-	bx		r0
-
-;
-; Thumb Branch
-;
-RMDebug_StepTest_Thumb_Branch
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Branch_1
-	bx		r0		
-
-;
-; Thumb Branch and link
-;
-RMDebug_StepTest_Thumb_Branch_And_Link
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Branch_And_Link_1
-	bx		r0 
-
-;
-; Thumb Back Branch and link
-;
-RMDebug_StepTest_Thumb_Back_Branch_And_Link
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Back_Branch_And_Link_1
-	bx		r0 
-
-;
-; Thumb ADD PC,PC, #0
-;
-RMDebug_StepTest_Thumb_AddPC
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_AddPC_1
-	bx		r0 
-
-	CODE16
-
-	; Thumb tests
-	EXPORT RMDebug_StepTest_Thumb_Non_PC_Modifying
-	EXPORT RMDebug_StepTest_Thumb_Non_PC_Modifying_1
-	EXPORT RMDebug_StepTest_Thumb_Non_PC_Modifying_2
-
-	EXPORT RMDebug_StepTest_Thumb_Branch
-	EXPORT RMDebug_StepTest_Thumb_Branch_1
-	EXPORT RMDebug_StepTest_Thumb_Branch_2
-
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link_2
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link_3
-
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link_2
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link_3
-
-RMDebug_StepTest_Thumb_Non_PC_Modifying_1
-	mov		r0, r0	; nop
-RMDebug_StepTest_Thumb_Non_PC_Modifying_2
-	bx		lr	
-
-RMDebug_StepTest_Thumb_Branch_1
-	b		RMDebug_StepTest_Thumb_Branch_2
-	mov		r0, r0
-RMDebug_StepTest_Thumb_Branch_2
-	bx		lr
-
-RMDebug_StepTest_Thumb_Branch_And_Link_1
-	mov		r1, lr
-RMDebug_StepTest_Thumb_Branch_And_Link_2
-	bl		RMDebug_StepTest_Thumb_Branch_And_Link_3
-	mov		r0, r0
-RMDebug_StepTest_Thumb_Branch_And_Link_3
-	bx		r1
-
-RMDebug_StepTest_Thumb_Back_Branch_And_Link_3
-	bx		r1
-
-RMDebug_StepTest_Thumb_Back_Branch_And_Link_1
-	mov		r1, lr
-RMDebug_StepTest_Thumb_Back_Branch_And_Link_2
-	bl		RMDebug_StepTest_Thumb_Back_Branch_And_Link_3
-	bx		r1
-
-;
-; ADD PC
-;
-	EXPORT RMDebug_StepTest_Thumb_AddPC
-	EXPORT RMDebug_StepTest_Thumb_AddPC_1
-	EXPORT RMDebug_StepTest_Thumb_AddPC_2
-	EXPORT RMDebug_StepTest_Thumb_AddPC_3
-
-RMDebug_StepTest_Thumb_AddPC_1
-	mov		r1, lr
-	mov		r2, #4
-RMDebug_StepTest_Thumb_AddPC_2
-	add		pc, pc, r2	; should arrive at RMDebug_StepTest_Thumb_AddPC_3
-	mov		r0, r0
-	mov		r0, r0
-	mov		r0, r0
-RMDebug_StepTest_Thumb_AddPC_3
-	bx		r1
-
-	ALIGN 4
-
-	CODE32
-
-;
-; ARM multiple-step ( 5 steps )
-;
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple_1
-
-RMDebug_StepTest_ARM_Step_Multiple
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-RMDebug_StepTest_ARM_Step_Multiple_1
-	bx		lr
-
-	END
-
-; End of file - d_rmdebug_step_test.s
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// 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:
-//
-// Description:
-// definitions of functions in d_rmdebug_step_tests_armv4.s
-//
-
-#ifndef D_RMDEBUG_STEP_TESTS_H
-#define D_RMDEBUG_STEP_TESTS_H
-
-extern "C"
-{
-	// ARM tests
-	unsigned int RMDebug_StepTest_Non_PC_Modifying(void);
-	unsigned int RMDebug_StepTest_Non_PC_Modifying_OK(void);
-	
-	unsigned int RMDebug_StepTest_Branch(void);
-	unsigned int RMDebug_StepTest_Branch_1(void);
-
-	unsigned int RMDebug_StepTest_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_2(void);
-	
-	unsigned int RMDebug_StepTest_MOV_PC(void);
-	unsigned int RMDebug_StepTest_MOV_PC_1(void);
-	unsigned int RMDebug_StepTest_MOV_PC_2(void);
-	
-	unsigned int RMDebug_StepTest_LDR_PC(void);
-	unsigned int RMDebug_StepTest_LDR_PC_1(void);
-
-	// Stepping performance test
-	unsigned int RMDebug_StepTest_Count(void);
-	unsigned int RMDebug_StepTest_Count_1(void);
-	unsigned int RMDebug_StepTest_Count_2(void);
-
-	// Multiple step test
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple(void);
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple_1(void);
-
-}
-#endif // D_RMDEBUG_STEP_TESTS_H
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.s	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-; 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:
-;
-; Description:
-; 
-;
-
-        AREA |d-rmdebug-bkpt$$Code|, CODE, READONLY, ALIGN=6
-
-	CODE32
-
-	; ARM tests
-	
-; 
-; Non-PC modifying
-;
-	EXPORT RMDebug_StepTest_Non_PC_Modifying
-	EXPORT RMDebug_StepTest_Non_PC_Modifying_OK
- 
-RMDebug_StepTest_Non_PC_Modifying
-	mov		r0,r0		; nop
-RMDebug_StepTest_Non_PC_Modifying_OK
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; Branch
-;
-	EXPORT RMDebug_StepTest_Branch
-	EXPORT RMDebug_StepTest_Branch_1
-
-RMDebug_StepTest_Branch
-	b		RMDebug_StepTest_Branch_1		
-	mov		r0, #2		; if the pc ends up here, we know its gone wrong
-RMDebug_StepTest_Branch_1
-	bx		lr			; return
-
-;
-; Branch and Link
-;
-	EXPORT RMDebug_StepTest_Branch_And_Link
-	EXPORT RMDebug_StepTest_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Branch_And_Link_2
-
-RMDebug_StepTest_Branch_And_Link		
-	mov		r0, lr		; preserve lr for the moment
-RMDebug_StepTest_Branch_And_Link_1
-	bl		RMDebug_StepTest_Branch_And_Link_2
-	mov		r1, #1		; insert a gap in the instruction stream so we know we branched.
-RMDebug_StepTest_Branch_And_Link_2
-	mov		lr, r0		; restore lr			
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; MOV PC
-;
-	EXPORT RMDebug_StepTest_MOV_PC
-	EXPORT RMDebug_StepTest_MOV_PC_1
-	EXPORT RMDebug_StepTest_MOV_PC_2
-
-RMDebug_StepTest_MOV_PC
-	mov		r0, #4
-RMDebug_StepTest_MOV_PC_1
-	add		pc, pc, r0	; should be a jump (bear in mind reading pc = current inst + 8bytes for arm)
-	mov		r0, #1		; Simple instructions which allow us to test where the PC really is
-	mov		r0, #2		; just by reading r0.
-RMDebug_StepTest_MOV_PC_2
-	mov		r0, #3		; 
-	mov		r0, #4		; 
-	bx		lr			; should return to normal execution of the test thread
-
-; 
-; LDR PC
-;
-	EXPORT RMDebug_StepTest_LDR_PC
-	EXPORT RMDebug_StepTest_LDR_PC_1
-
-RMDebug_StepTest_LDR_PC
-	ldr		pc, =RMDebug_StepTest_LDR_PC_1
-	mov		r0, #1		;  separate the branch target so we can prove it works
-RMDebug_StepTest_LDR_PC_1
-	bx		lr			; should return to normal execution of the test thread
-	
-;
-; Stepping performance tests
-;
-; This counts down from 100000 to 0
-; This means that for all practical purposes
-; we can single-step as much as we like
-; in less than one second and have some likelyhood
-; that we will not step too far from our loop
-
-	EXPORT RMDebug_StepTest_Count
-	EXPORT RMDebug_StepTest_Count_1
-	EXPORT RMDebug_StepTest_Count_2
-
-RMDebug_StepTest_Count
-	ldr		r2, =100000
-RMDebug_StepTest_Count_1
-	subs	r2, r2, #1
-RMDebug_StepTest_Count_2
-	bne		RMDebug_StepTest_Count_1
-	bx		lr
-
-;
-; ARM multiple-step ( 5 steps )
-;
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple_1
-
-RMDebug_StepTest_ARM_Step_Multiple
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-RMDebug_StepTest_ARM_Step_Multiple_1
-	bx		lr
-
-	END
-
-; End of file - d_rmdebug_step_test_armv4.s
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Implements a debug thread for testing.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include "d_rmdebugthread.h"
-
-EXPORT_C TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-extern void RMDebug_BranchTst1();
-
-EXPORT_C TInt TestData;
-
-CDebugServThread::CDebugServThread()
-//
-// Empty constructor
-//
-	{
-	}
-
-GLDEF_C TInt CDebugServThread::ThreadFunction(TAny*)
-//
-// Generic thread function for testing
-//
-	{
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	if (cleanup == NULL)
-		{
-		User::Leave(KErrNoMemory);
-		}
-
-	RThread::Rendezvous(KErrNone);
-
-	TestData = 1;
-
-	while(1)
-		{
-		RMDebug_BranchTst1();
-
-		TestData++;                   
-
-		// Wait half a second (suspends this thread)
-		User::After(500000);
-
-		if (TestData == 0xFFFFFFFF)
-			{
-			break;
-			}
-		}
-
-	delete cleanup;
-
-	return (KErrNone);
-	}
-
-EXPORT_C TInt StartDebugThread(RThread& aDebugThread)
-//
-// Starts the test thread
-//
-{
-	TInt res=KErrNone;
-
-	// Create the thread
-	res = aDebugThread.Create(	KDebugThreadName,
-								CDebugServThread::ThreadFunction,
-								KDefaultStackSize,
-								KDebugThreadDefaultHeapSize,
-								KDebugThreadDefaultHeapSize,
-								NULL
-								);
-
-	// Check that the creation worked
-	if (res == KErrNone)
-		{
-		TRequestStatus rendezvousStatus;
-
-		aDebugThread.SetPriority(EPriorityNormal);
-		// Make a request for a rendezvous
-		aDebugThread.Rendezvous(rendezvousStatus);
-		// Set the thread as ready for execution
-		aDebugThread.Resume();
-		// Wait for the resumption
-		User::WaitForRequest(rendezvousStatus);
-		}                                 
-	else
-		{
-		// Close the handle.
-		aDebugThread.Close();
-		}
-
-	return res;
-	}
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// t_rmdebugthread.h
-// Definitions for the run mode debug test thread.
-// 
-//
-
-#ifndef RMDEBUGSVRTHRD_H
-#define RMDEBUGSVRTHRD_H
-
-#define SYMBIAN_RMDBG_MEMORYSIZE    1024*4
-
-// Thread name
-_LIT(KDebugThreadName,"DebugThread");
-
-const TUint KDebugThreadDefaultHeapSize=0x10000;
-
-class CDebugServThread : public CBase
-	{
-	public:
-		CDebugServThread();
-		static TInt ThreadFunction(TAny* aStarted);    
-
-	public:
-	};
-
-#endif // RMDEBUGSVRTHRD_H
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Implements a debug thread for testing.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32debug.h>
-#include "d_rmdebugthread2.h"
-
-#include "d_rmdebug_step_test.h"
-#include "d_rmdebug_bkpt_test.h"
-#include "d_demand_paging.h"
-
-EXPORT_C TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-IMPORT_C extern void RMDebug_BranchTst1();
-IMPORT_C extern TInt RMDebugDemandPagingTest();
-
-EXPORT_C TInt TestData;
-EXPORT_C TTestFunction FunctionChooser;
-
-const TInt 	KNumberOfTraceCalls = 50;
-
-EXPORT_C TInt TestFunction()
-	{
-	// Set TestData to an arbitrary value that can be checked by a tester
-	TestData = 0xffeeddcc;
-	RMDebug_BranchTst1();
-	
-	// Code here may not be executed because tests can change the PC value
-	// at any time, typically once the test passes
-	return 0;
-	}
-
-/**
-  Wrapper around RMDebugDemandPagingTest, need to pause for a short time to
-  allow time in t_rmdebug.cpp to issue a User::WaitForRequest to catch the break point
-  */
-EXPORT_C void TestPagedCode()
-	{
-	User::After(100000);
-
-	// call the function in paged code
-	RMDebugDemandPagingTest();
-	}
-
-EXPORT_C void TestMultipleTraceCalls()
-	{
-	//arbitrary function to set a BP on
-	RMDebug_BranchTst1();
-
-	// The tester will change FunctionChooser once it gets what it needs out of the test
-	for(TInt cnt = KNumberOfTraceCalls; cnt>0 && (FunctionChooser==EMultipleTraceCalls); cnt--)
-		{
-		RDebug::Printf("T");
-		RDebug::Printf("R");
-		RDebug::Printf("A");
-		RDebug::Printf("C");
-		RDebug::Printf("E");
-		}
-	
-	//another arbitrary function to set a BP on
-	RMDebug_StepTest_Non_PC_Modifying();
-	}
-
-CDebugServThread::CDebugServThread()
-//
-// Empty constructor
-//
-	{
-	}
-
-GLDEF_C TInt CDebugServThread::ThreadFunction(TAny*)
-//
-// Generic thread function for testing
-//
-	{
-	// set FunctionChooser to run the default function
-	FunctionChooser = EDefaultFunction;
-
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	if (cleanup == NULL)
-		{
-		User::Leave(KErrNoMemory);
-		}
-
-	RThread::Rendezvous(KErrNone);
-
-	TestData = 1;
-
-	/* Beware of adding printf or other debug-generating events in this loop because
-	* they interfere with the tests
-	*/
-	while(TestData != 0xFFFFFFFF)
-		{
-		switch(FunctionChooser)
-			{
-			case EDemandPagingFunction:
-				TestPagedCode();
-				break;
-			case EDefaultFunction:
-				// the default function is the stepping test functions
-			case EStepFunction:
-				{
-				RMDebug_BranchTst1();
-
-				// Single stepping test support code
-
-				// ARM tests
-				RMDebug_StepTest_Non_PC_Modifying();
-
-				RMDebug_StepTest_Branch();
-
-				RMDebug_StepTest_Branch_And_Link();
-
-				RMDebug_StepTest_MOV_PC();
-
-				RMDebug_StepTest_LDR_PC();
- 
-// thumb/interworking tests not supported on armv4
-#ifdef __MARM_ARMV5__
-
-				// Thumb tests
-				RMDebug_StepTest_Thumb_Non_PC_Modifying();
-
-				RMDebug_StepTest_Thumb_Branch();
-
-				RMDebug_StepTest_Thumb_Branch_And_Link();
-
-				RMDebug_StepTest_Thumb_Back_Branch_And_Link();
-
-				// ARM <-> Thumb interworking tests
-				RMDebug_StepTest_Interwork();
-
-				RMDebug_StepTest_Thumb_AddPC();
-
-#endif	// __MARM_ARMV5__
-				
-				// Single-stepping performance
-				RMDebug_StepTest_Count();
-
-				// multiple step test
-				RMDebug_StepTest_ARM_Step_Multiple();
-
-				// Breakpoints in loop test
-				RMDebug_Bkpt_Test_Entry();
-
-				TestData++;
-
-				// Wait 50mSecs. // (suspends this thread)
-				User::After(50000);
-
-				break;
-				}
-			case EMultipleTraceCalls:
-				TestMultipleTraceCalls();
-				break;
-			default:
-				//do nothing
-				break;
-			}
-		}
-
-	delete cleanup;
-
-	return (KErrNone);
-	}
-
-EXPORT_C TInt StartDebugThread(RThread& aDebugThread, const TDesC& aDebugThreadName)
-//
-// Starts a test thread
-//
-{
-	TInt res=KErrNone;
-
-	// Create the thread
-	res = aDebugThread.Create(	aDebugThreadName,
-								CDebugServThread::ThreadFunction,
-								KDefaultStackSize,
-								KDebugThreadDefaultHeapSize,
-								KDebugThreadDefaultHeapSize,
-								NULL
-								);
-
-	// Check that the creation worked
-	if (res == KErrNone)
-		{
-		TRequestStatus rendezvousStatus;
-
-		aDebugThread.SetPriority(EPriorityNormal);
-		// Make a request for a rendezvous
-		aDebugThread.Rendezvous(rendezvousStatus);
-		// Set the thread as ready for execution
-		aDebugThread.Resume();
-		// Wait for the resumption
-		User::WaitForRequest(rendezvousStatus);
-		}                                 
-	else
-		{
-		// Close the handle.
-		aDebugThread.Close();
-		}
-
-	return res;
-	}
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Definitions for the run mode debug test thread.
-// 
-//
-
-#ifndef RMDEBUGSVRTHRD_H
-#define RMDEBUGSVRTHRD_H
-
-#define SYMBIAN_RMDBG_MEMORYSIZE    1024*4
-
-// Thread name
-_LIT(KDebugThreadName,"DebugThread");
-
-const TUint KDebugThreadDefaultHeapSize=0x10000;
-
-// enumeration of functions which the target debug thread can call, the
-// debugger can choose to switch the thread to a different function by
-// writing the appropriate enumeration value into FunctionChooser, the
-// target thread will finish executing the function it is currently running
-// then execute the chosen function.
-enum TTestFunction
-	{
-	EDefaultFunction = 0,
-	EStepFunction = 1,
-	EDemandPagingFunction = 2,
-	EMultipleTraceCalls = 3,
-	EDoNothing = 4
-	};
-
-class CDebugServThread : public CBase
-	{
-	public:
-		CDebugServThread();
-		static TInt ThreadFunction(TAny* aStarted);    
-
-	public:
-	};
-
-#endif // RMDEBUGSVRTHRD_H
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm.cia	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// d_rmdebugthreadasm.h
-// Assembler file for debug thread testing.
-// 
-//
-
-//#include <e32cia.h>
-//#include <e32base.h>
-//#include <e32cons.h>
-//#include "d_rmdebugthread.h"
-
-EXPORT_C __NAKED__ void RMDebug_BranchTst1( void )
-//
-// 
-//
-{
-	asm("mov r0, #0 ");			// aResult==KErrNone
-	asm("bx  lr ");             // Return
-}
-
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm2.cia	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// d_rmdebugthreadasm2.h
-// Assembler file for debug thread testing.
-// 
-//
-
-EXPORT_C __NAKED__ void RMDebug_BranchTst1( void )
-//
-// 
-//
-{
-	asm("mov r0, #0 ");			// aResult==KErrNone
-	asm("bx  lr ");             // Return
-}
-
-EXPORT_C __NAKED__ void RMDebug_BranchTst2( void )
-//
-// 
-//
-{
-	asm("mov r0, #0 ");			// aResult==KErrNone
-	asm("bx  lr ");             // Return
-}
--- a/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_app.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,382 +0,0 @@
-// 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:
-//
-// Description:
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <e32debug.h>
-#include <e32property.h> 
-#include <u32hal.h>
-#include <f32file.h>
-#include <e32svr.h>
-
-
-#include "t_rmdebug_app.h"
-
-IMPORT_C extern void RMDebug_BranchTst2();
-
-LOCAL_C void ParseCommandLineL(TInt32& aFunctionType, TUint& aDelay, TUint& aExtraThreads, TInt32& aCpuNumber)
-	{
-	// get the length of the command line arguments
-	TInt argc = User::CommandLineLength();
-	RDebug::Printf(" t_rmdebug_app: ParseCommandLineL argc=%d", argc);
-
-	// allocate a buffer for the command line arguments and extract the data to it
-	HBufC* commandLine = HBufC::NewLC(argc);
-	TPtr commandLineBuffer = commandLine->Des();
-	User::CommandLine(commandLineBuffer);
-
-	// create a lexer and read through the command line
-	TLex lex(*commandLine);
-	while (!lex.Eos())
-		{
-		// expecting the first character to be a '-'
-		if (lex.Get() == '-')
-			{
-			TChar arg = lex.Get();
-			switch (arg)
-				{
-				case 'f':
-					// the digits following '-f' give the function type
-					User::LeaveIfError(lex.Val(aFunctionType));
-					RDebug::Printf(" t_rmdebug_app: setting aFunctionType=%d", aFunctionType);
-					break;
-				case 'd':
-					// the digits following '-d' give the delay
-					User::LeaveIfError(lex.Val(aDelay));
-					RDebug::Printf(" t_rmdebug_app: setting aDelay=%d", aDelay);
-					break;
-				case 'e':
-					// the digits following '-e' give the number of extra threads to launch
-					User::LeaveIfError(lex.Val(aExtraThreads));
-					RDebug::Printf(" t_rmdebug_app: setting aExtraThreads=%d", aExtraThreads);
-					break;
-
-				case 'a':
-						// the digits following '-a' gives the cpu on which this thread will execute on
-					User::LeaveIfError(lex.Val(aCpuNumber));
-					RDebug::Printf(" t_rmdebug_app: CPU Number=%d", aCpuNumber);
-					break;
-
-				default:
-					// unknown argument so leave
-					User::Leave(KErrArgument);
-				}
-			lex.SkipSpace();
-			}
-		else
-			{
-			// unknown argument so leave
-			User::Leave(KErrArgument);
-			}
-		}
-
-	// do clean up
-	CleanupStack::PopAndDestroy(commandLine);
-	}
-
-typedef void (*TPfun)();
-
-// test function to call corresponding to EPrefetchAbortFunction
-void PrefetchAbort()
-	{
-	TPfun f = NULL;
-	f();
-	}
-
-// test function to call corresponding to EUserPanicFunction
-void UserPanic()
-	{
-	User::Panic(KUserPanic, KUserPanicCode);
-	}
-
-// calls self repeatedly until stack is used up. Slightly convoluted to prevent UREL optimising this out...
-TUint32 StackOverFlowFunction(TUint32 aInt=0)
-	{
-	TUint32 unusedArray[150];
-	for(TInt i=0; i<150; i++)
-		{
-		unusedArray[i] = StackOverFlowFunction(i);
-		}
-	return unusedArray[0];
-	}
-
-void DataAbort()
-	{
-	TInt* r = (TInt*) 0x1000;
-	*r = 0x42;              
-	}
-
-void UndefInstruction()
-	{
-	TUint32 undef = 0xE6000010;
-	TPfun f = (TPfun) &undef;
-	f();
-	}
-
-TInt DataRead()
-	{
-	TInt* r = (TInt*) 0x1000;
-	TInt rr = (TInt)*r;
-	//include the following line to ensure that rr doesn't get optimised out
-	RDebug::Printf("Shouldn't see this being printed out: %d", rr);
-
-	// Stop compilation warning. Should not get here anyway.
-	rr++;
-	return rr;
-	}
-
-void DataWrite()
-	{
-	TInt* r = (TInt*) 0x1000;
-	*r = 0x42;                
-	}
-
-void UserException()
-	{
-	User::RaiseException(EExcGeneral);
-	}
-
-void SpinForeverWithBreakPoint()
-	{
-
-    // finding the process t_rmdebug2/t_rmdebug2_oem/t_rmdebug2_oem2
-    // we find the process.SID to attach to the property
-	_LIT(KThreadWildCard, "t_rmdebug2*");
-
-	TInt err = KErrNone;
-	TUid propertySid = KNullUid;
-	TFindThread find(KThreadWildCard);
-	TFullName name;
-	TBool found = EFalse;
-	while(find.Next(name)==KErrNone && !found)
-		{
-		RThread thread;
-		err = thread.Open(find);
-		if (err == KErrNone)
-			{
-			RProcess process;
-			thread.Process(process);
-			TFullName fullname = thread.FullName();
-		    //RDebug::Printf("SID Search Match Found Name %lS Process ID%ld Thread Id %ld", &fullname, process.Id().Id(), thread.Id().Id());
-			found = ETrue;
-			//SID saved so that the property can be attached to
-			propertySid = process.SecureId();
-			process.Close();
-			}
-		thread.Close();
-	}
-
-    //attach to the property to publish the address of the RMDebug_BranchTst2 with the correct SID value
-	RProperty integerProperty;
-	err = integerProperty.Attach(propertySid, EMyPropertyInteger, EOwnerThread);
-	if(KErrNone != err)
-		RDebug::Printf("Error Attach to the property %d", err);
-
-	TInt address = (TInt)&RMDebug_BranchTst2;
-	
-	// publish the address where the breakpoint would be set
-	err = integerProperty.Set(address);
-	if(KErrNone != err)
-		RDebug::Printf("Error Set of the property %d", err);
-	integerProperty.Close();
-	
-	//open semaphore to signal the fact we have reached the point where we have to set the property
-	RSemaphore globsem;
-	globsem.OpenGlobal(_L("RMDebugGlobSem"));
-	globsem.Signal();
-	globsem.Close();
-
-	RProcess thisProcess;
-	TFileName thisProcessName = thisProcess.FileName();
-	RDebug::Printf("App Process Name %lS process id %ld thread id %ld", &thisProcessName, thisProcess.Id().Id(), RThread().Id().Id());
-
-	TInt i=0;
-	RThread::Rendezvous(KErrNone);
-	while(i<0xffffffff)
-		{
-		RMDebug_BranchTst2();
-		User::After(10000);
-		}
-	}
-
-void SpinForever()
-	{
-	TInt i=0;
-	RThread::Rendezvous(KErrNone);
-	while(i<0xffffffff)
-		{
-		User::After(10000);
-		}
-	}
-
-void NormalExit()
-    {
-    RDebug::Printf("Target app: NormalExit() function. Returning to MainL" );
-    }
-
-void LaunchThreads(TUint aNumber)
-	{
-	_LIT(KDebugThreadName, "DebugThread");
-	const TUint KDebugThreadDefaultHeapSize=0x10000;
-	for(TInt i=0; i<aNumber; i++)
-		{
-		RThread thread;
-		RBuf threadName;
-		threadName.Create(KDebugThreadName().Length()+10); // the 10 is for appending i to the end of the name
-		threadName.Append(KDebugThreadName());
-		threadName.AppendNum(i);
-		TInt err = thread.Create(threadName, (TThreadFunction)SpinForever, KDefaultStackSize, KDebugThreadDefaultHeapSize, KDebugThreadDefaultHeapSize, NULL);
-		if(err != KErrNone)
-			{
-			RDebug::Printf("Couldn't create thread %d", err);
-			threadName.Close();
-			thread.Close();
-			break;
-			}
-		thread.SetPriority(EPriorityNormal);
-		TRequestStatus status;
-		thread.Rendezvous(status);
-		thread.Resume();
-		User::WaitForRequest(status);
-		thread.Close();
-		threadName.Close();
-		}
-	}
-
-void WaitFiveSecondsThenExit(void)
-	{
-	// wait for 5 seconds
-	User::After(5000000);
-	}
-
-TInt NumberOfCpus()
-	{
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-	return r;
-	}
-
-TInt SetCpuAffinity(TInt aCpuNumber)
-	{
-    TInt TestCpuCount = NumberOfCpus();
-	RDebug::Printf("SetCpuAffinity --> TestCpuCount = %d\n", TestCpuCount);		
-	TUint32 cpu = 0;
-
-	if ((aCpuNumber % TestCpuCount) != 0)
-	cpu = (TUint32)(aCpuNumber % TestCpuCount);
-
-	RDebug::Printf("SetCpuAffinity --> Setting cpu %3d\n", cpu);
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, (TAny *)cpu, 0);
-	return r;
-	}
-
-// call the function corresponding to aFunctionType
-LOCAL_C void CallFunction(TDebugFunctionType aFunctionType, TUint aDelay, TUint aExtraThreads, TInt32 aCpuNumber)
-	{
-	// pause for aDelay microseconds
-	User::After(aDelay);
-
-	// set cpu on which this thread should execute on
-	if (aCpuNumber)
-		SetCpuAffinity(aCpuNumber);
-
-	// launch the extra threads
-	LaunchThreads(aExtraThreads);
-
-	// call appropriate function
-	switch( aFunctionType )
-		{
-		case EPrefetchAbortFunction:
-			PrefetchAbort();
-			break;
-		case EUserPanicFunction:
-			UserPanic();
-			break;
-		case EStackOverflowFunction:
-			StackOverFlowFunction();
-			break;
-		case EDataAbortFunction:
-			DataAbort();
-			break;
-		case EUndefInstructionFunction:
-			UndefInstruction();
-			break;
-		case EDataReadErrorFunction:
-			DataRead();
-			break;
-		case EDataWriteErrorFunction:
-			DataWrite();
-			break;
-		case EUserExceptionFunction:
-			UserException();
-			break;
-		case EWaitFiveSecondsThenExit:
-			WaitFiveSecondsThenExit();
-			break;
-		case ESpinForever:
-			SpinForever();
-			break;
-		case ESpinForeverWithBreakPoint:
-			SpinForeverWithBreakPoint();
-			break;
-        case ENormalExit:
-            NormalExit();
-            break;			
-		case EDefaultDebugFunction:
-		default:
-			break;
-		}
-	}
-
-void PrintHelp()
-	{
-	RDebug::Printf("Invoke with arguments:\n");
-	RDebug::Printf("\t-d<delay>\n\t: delay in microseconds before calling target function\n");
-	RDebug::Printf("\t-f<function-number>\n\t: enumerator from TDebugFunctionType representing function to call\n");
-	RDebug::Printf("\t-e<number>\n\t: number of extra threads to launch, these threads run endlessly\n");
-	}
-
-
-TInt E32Main()
-	{
-		
-	RDebug::Printf("t_rmdebug_app tid=%d,pid=%d", I64LOW(RThread().Id().Id()), I64LOW(RProcess().Id().Id()) ) ;
-	// setup heap checking and clean up trap
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	RThread().SetPriority(EPriorityNormal);
-	RProcess::Rendezvous(KErrNone);
-
-	// read arguments from command line
-	TUint delay = 0;
-	TInt32 functionTypeAsTInt32 = (TInt32)EDefaultDebugFunction;
-	TUint extraThreads = 0;
-	TInt32 aCpuNumber = -1;
-
-	TRAPD(err, ParseCommandLineL(functionTypeAsTInt32, delay, extraThreads, aCpuNumber));
-
-	if(KErrNone == err)
-		{
-		// if the command line arguments were successfully read then call the appropriate function
-		CallFunction((TDebugFunctionType)functionTypeAsTInt32, delay, extraThreads, aCpuNumber);
-		}
-
-	// perform clean up and return any error which was recorded
-	delete cleanup;
-	__UHEAP_MARKEND;
-	return err;
-	}
-
--- a/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_app.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-//
-
-#ifndef T_RMDEBUG_APP_H
-#define T_RMDEBUG_APP_H
-
-_LIT(KRMDebugTestApplication, "z:\\sys\\bin\\t_rmdebug_app.exe");
-_LIT(KUserPanic, "UserPanic");
-const TInt KUserPanicCode = 0x1234ABCD;
-enum TMyPropertyKeys {EMyPropertyInteger};
-
-
-// enumeration of functions to call in test debug application
-enum TDebugFunctionType
-	{
-	EDefaultDebugFunction,
-	EPrefetchAbortFunction,
-	EUserPanicFunction,
-	EStackOverflowFunction,
-	EDataAbortFunction,
-	EUndefInstructionFunction,
-	EDataReadErrorFunction,
-	EDataWriteErrorFunction,
-	EUserExceptionFunction,
-	EWaitFiveSecondsThenExit,
-	ESpinForever,
-	ESpinForeverWithBreakPoint,
-	ENormalExit
-	};
-
-#endif //T_RMDEBUG_APP_H
-
--- a/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-//
-
-#include <e32std.h>
-#include <e32std_private.h>
-#include <rm_debug_api.h>
-#include "t_rmdebug_dll.h"
-
-EXPORT_C TUid GetDSSUid()
-	{
-	return Debug::KUidDebugSecurityServer;
-	}
-
--- a/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-//
-
-#include <e32std.h>
-
-/**
-  This is a simple function that uses an element from rm_debug_api.h.
-  If the e32tests can be built and run then this is 'proof' that the
-  rm_debug_api.h header file can be #include'd into a dll
-  */
-IMPORT_C TUid GetDSSUid();
--- a/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Target application to be debugged by t_rmdebug.exe when testing
-// security restrictions. This application is built with various
-// capabilities by the t_rmdebug_securityX.mmp files. This allows
-// the t_rmdebug2 program to ensure that security restrictions are
-// properly enforced by the DSS/DDD subsystem.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include "t_rmdebug_security.h"
-
-CRunModeApp* CRunModeApp::NewL()
-//
-// CRunModeApp::NewL
-//
-	{
-	CRunModeApp* self = new(ELeave) CRunModeApp();
-
-  	self->ConstructL();
-   
-	return self;
-	}
-
-CRunModeApp::CRunModeApp()
-//
-// CRunModeApp constructor
-//
-	{
-	}
-
-CRunModeApp::~CRunModeApp()
-//
-// CRunModeApp destructor
-//
-	{
-	}
-
-void CRunModeApp::ConstructL()
-//
-// CRunModeApp::ConstructL
-//
-	{
-	}
-
-void CRunModeApp::TestWaitDebug()
-//
-// CRunModeApp::TestWaitDebug
-//
-	{
-	RProcess::Rendezvous(KErrNone);
-
-	// Wait a 3secs then quit (long enough to test, but not hang around forever)
-	User::After(3000000);
-	}
-
-GLDEF_C TInt E32Main()
-//
-// Entry point for run mode debug app test program
-//
-	{
-   TInt ret = KErrNone;
-   
-	// client
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-
-   CRunModeApp* myApp = CRunModeApp::NewL();
-   if (myApp != NULL)
-       {
-        __UHEAP_MARK;
-	    TRAP(ret,myApp->TestWaitDebug());
-	    __UHEAP_MARKEND;
-
-	    delete myApp;
-       }
-       
-	delete trap;
-
-	return ret;
-	}
--- a/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Target application to be debugged by t_rmdebug2.exe when testing
-// security restrictions. This application is built with various
-// capabilities by the t_rmdebug_securityX.mmp files. This allows
-// the t_rmdebug2 program to ensure that security restrictions are
-// properly enforced by the DSS/DDD subsystem.
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef T_RMDEBUG_SECURITY_H
-#define T_RMDEBUG_SECURITY_H
-
-class CRunModeApp : public CBase
-{
-public:
-	static CRunModeApp* NewL();
-	~CRunModeApp();
-
-	void TestWaitDebug();
-
-private:
-	CRunModeApp();
-	void ConstructL();
-};
-
-#endif // T_RMDEBUG_SECURITY_H
--- a/kerneltest/e32test/rm_debug/group/t_multi_agent_launcher.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Application that launches multiple agents which in-turn test the ability of 
-// the run mode debug component to debug several targets
-// 
-//
-
-targettype     exe
-target         t_multi_agent_launcher.exe
-
-library		euser.lib hal.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-userinclude    ../debug_targets
-userinclude    ../common
-userinclude    ../multi_agent_tests
-
-sourcepath	   ../multi_agent_tests
-source         t_multi_agent_launcher.cpp 
-
-UID            0x0 0x4321bbbc
-SECUREID       0x1234aaab
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-macro SYMBIAN_STANDARDDEBUG
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug.exe
-targettype     exe
-
-sourcepath	   	../metro_trk
-source        	d_rmdebugserver.cpp 
-source        	d_rmdebugthread.cpp 
-source        	t_rmdebug.cpp 
-sourcepath	   	../common
-source			d_rmdebugthreadasm.cia
-
-library		euser.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x100039CE 0x101F7159
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-CAPABILITY 	ALL -TCB
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug2.mmh	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-targettype     exe
-
-sourcepath	   	..\debug_targets
-
-source        	d_rmdebugthread2.cpp 
-source			d_rmdebugthreadasm2.cia
-
-#if defined(MARM_ARMV5)
-source			d_rmdebug_step_test.s
-source			d_rmdebug_bkpt_test.s
-#endif
-
-#if defined(MARM_ARMV4)
-source			d_rmdebug_step_test_armv4.s
-#endif
-
-source			d_demand_paging.cia
-
-library		euser.lib
-library         hal.lib
-library         efsrv.lib
-library         t_rmdebug_dll.lib
-
-userinclude    ..\..\..\..\kernel\eka\include\drivers
-userinclude    ..\..\..\..\kernel\eka\debug\securityserver\inc
-userinclude    ..\debug_targets
-
-
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
-SYMBIAN_BASE_SYSTEMINCLUDE(kernel)
-#endif
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-PAGED
-
-// To test heap allocation failure uncomment one or other of the following macros.
-// NOTE: Do not uncomment both, the tests will panic if both are defined!
-
-// To test heap allocation failure in the Debug Device Driver uncomment this macro
-//macro KERNEL_OOM_TESTING
-
-// To test heap allocation failure in the Debug Security Server uncomment this macro
-//macro USER_OOM_TESTING
-
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug2.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// 
-//
-
-#include "t_rmdebug2.mmh"
-
-target         t_rmdebug2.exe
-
-sourcepath	   	../basic_tests
-source        	t_rmdebug2.cpp 
-source		r_low_memory_security_svr_session.cpp
-source		r_kernel_low_memory_security_svr_session.cpp
-source		r_user_low_memory_security_svr_session.cpp
-
-UID            0x0 0x4321bbbb
-SECUREID       0x1234aaaa
-VENDORID       0x70000001
-
-CAPABILITY 	READUSERDATA POWERMGMT ALLFILES
-
-DEBUGGABLE
-
-macro SYMBIAN_STANDARDDEBUG
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug2_oem.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Same tests as t_rmdebug2.mmp but with OEM rights conferred
-// by the OEMDebug_F123ABCD.exe token file.
-// 
-//
-
-#include "t_rmdebug2.mmh"
-
-target         t_rmdebug2_oem.exe
-
-sourcepath	   	../basic_tests
-source        	t_rmdebug2.cpp 
-source		r_low_memory_security_svr_session.cpp
-source		r_kernel_low_memory_security_svr_session.cpp
-source		r_user_low_memory_security_svr_session.cpp
-
-UID            0x0 0x4321bbbb
-SECUREID       0xF123abcd
-VENDORID       0x70000001
-
-CAPABILITY 	READUSERDATA POWERMGMT ALLFILES
-
-// Used when compiling tests to work in the presence of an
-// OEM Debug Token
-macro SYMBIAN_OEMDEBUG
-
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug2_oem2.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Same tests as t_rmdebug2.mmp but with some OEM rights conferred
-// by the OEMDebug_F1234567.exe token file.
-// 
-//
-
-#include "t_rmdebug2.mmh"
-
-target         t_rmdebug2_oem2.exe
-
-sourcepath	   	../basic_tests
-source        	t_rmdebug2.cpp 
-source		r_low_memory_security_svr_session.cpp
-source		r_kernel_low_memory_security_svr_session.cpp
-source		r_user_low_memory_security_svr_session.cpp
-
-UID            0x0 0x4321bbbb
-SECUREID       0xF1234567
-VENDORID       0x70000001
-
-CAPABILITY 	READUSERDATA POWERMGMT
-
-// Used when compiling tests to work in the presence of an
-// OEM Debug Token with AllFiles only capability
-macro SYMBIAN_OEM2DEBUG
-
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         OEMDebug_F123ABCD.exe
-targettype     exe
-
-sourcepath	   	../basic_tests
-
-source        	t_rmdebug2_oemtoken.cpp 
-
-library		euser.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability PowerMgmt AllFiles Tcb ReadUserData WriteUserData
-
-UID            0x0 0x0
-SECUREID       0x0
-VENDORID       0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken2.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         OEMDebug_F1234567.exe
-targettype     exe
-
-sourcepath	   	../basic_tests
-
-source        	t_rmdebug2_oemtoken.cpp 
-
-library		euser.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-// Token requires AllFiles
-capability AllFiles ReadUserData PowerMgmt
-
-UID            0x0 0x0
-SECUREID       0x0
-VENDORID       0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// 
-//
-
-target             t_rmdebug_app.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source			   d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app1.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app1.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app10.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app10.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app2.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app2.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app3.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app3.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app4.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app4.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app5.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app5.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app6.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app6.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app7.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app7.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app8.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app8.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_app9.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Target application to be debugged
-// 
-//
-
-target             t_rmdebug_app9.exe
-targettype         exe
-
-sourcepath         ../debug_targets
-source             t_rmdebug_app.cpp 
-source             d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib hal.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_dll.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_dll.dll
-targettype     dll
-
-DEFFILE        ../../~/t_rmdebug_dll.def
-
-sourcepath	   	../debug_targets
-
-source        	t_rmdebug_dll.cpp 
-
-library		euser.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability PowerMgmt AllFiles ReadUserData
-
-UID            0x0 0x0
-SECUREID       0x0
-VENDORID       0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_multi_agent.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Application that tests the ability of the run mode debug component 
-// to debug multiple targets 
-// 
-//
-
-targettype     exe
-target         t_rmdebug_multi_agent.exe
-
-library		euser.lib hal.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-userinclude    ../debug_targets
-userinclude    ../common
-userinclude    ../multi_agent_tests
-
-sourcepath	   ../multi_agent_tests
-source         t_multi_agent.cpp t_agent_eventhandler.cpp 
-
-UID            0x0 0x4321bbbc
-SECUREID       0x1234aaab
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-macro SYMBIAN_STANDARDDEBUG
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_multi_target.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Application that tests the ability of the run mode debug component 
-// to debug several targets
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-targettype     exe
-target         t_rmdebug_multi_target.exe
-
-library		euser.lib hal.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-userinclude    ../debug_targets
-userinclude    ../common
-userinclude    ../multi_target_tests
-
-sourcepath	   ../multi_target_tests
-source         t_multi_target.cpp 
-
-UID            0x0 0x4321bbbc
-SECUREID       0x1234aaab
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-macro SYMBIAN_STANDARDDEBUG
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_security0.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security0.exe
-targettype     exe
-
-sourcepath	   	../debug_targets
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x100039CE 0xbaaaf00d
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_security1.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security1.exe
-targettype     exe
-
-sourcepath	   	../debug_targets
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x100039CE 0xdeadbaaa
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_security2.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security2.exe
-targettype     exe
-
-sourcepath	   	../debug_targets
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability AllFiles
-
-UID            0x100039CE 0xdeadbaaa
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_security3.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security3.exe
-targettype     exe
-
-sourcepath	   	../debug_targets
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability TCB AllFiles NetworkControl
-
-UID            0x100039CE 0xdeadbaaa
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug_target_launcher.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Application that test the ability of the run mode debug component 
-// to handle several target applications
-// 
-//
-
-target         t_rmdebug_target_launcher.exe
-targettype     exe
-
-library		     euser.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-userinclude    ../common
-sourcepath	   ../common
-source         t_target_launcher.cpp 
-
-UID            0x0 0x4321bbbd
-SECUREID       0x1234aaac
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-macro SYMBIAN_STANDARDDEBUG
-
-SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_trkdummyapp.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/rm_debug/group/t_trkdummyapp.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -27,7 +27,6 @@
 library		euser.lib
 library         hal.lib
 library         efsrv.lib
-library         t_rmdebug_dll.lib
 
 SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/e32test/rm_debug/metro_trk/d_rmdebugclient.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// t_rmdebugclient.h
-// Definitions for the run mode debug agent client side sessions.
-// 
-//
-
-#ifndef RMDEBUGCLIENT_H
-#define RMDEBUGCLIENT_H
-
-class TProcessInfo
-	{
-	public:
-		TUint           iProcessID;
-		TInt            iAttributes;
-		TUint32         iPriority;
-		TBuf<KMaxName> 	iName;    
-	};
-
-class TThreadInfo
-	{
-	public:
-		TUint           iThreadID;
-		TUint8          iPriority;
-		TUint8          iThreadType;
-		TBuf<KMaxName>  iName;
-		TUint           iOwningProcessID;
-
-	// Probably would want a state element here, under debug control, stopped etc
-	// such that additional information could be provided which was only valid for
-	// stopped threads.
-
-	};
-
-class TExecReq
-	{
-	public:
-		TUint32 iRequest;       // Step, Step into, step threads
-		TUint32 iStartAddress;
-		TUint32 iStopAddress;
-
-	};
-
-class TMemoryInfo
-	{
-	public:
-		TUint32 iAddress;
-		TUint32	iSize;
-		TPtr8*	iDataPtr;
-	};
-
-
-// Client Side session
-class RDebugServSession : public RSessionBase
-	{
-	public:
-		RDebugServSession();
-		TVersion Version() const;
-
-		TInt Open();
-		TInt Close();
-
-		TInt ReadMemory(const TUint32 aThreadId, TMemoryInfo* aInfo);
-		TInt WriteMemory(const TUint32 aThreadId, TMemoryInfo* aInfo);
-
-//		TInt ReadThreadInfo(const TInt aIndex, const TInt aOwningProc, TThreadInfo* aInfo);
-//		TInt ReadProcessInfo(const TInt aIndex, TProcessInfo* aInfo);
-		TInt SuspendThread(const TInt ThreadID);
-		TInt ResumeThread(const TInt ThreadID);
-
-	private:
-		RThread iServerThread;       
-	};
-
-// Function codes (opcodes) used in message passing between client and server
-enum TDebugServRqst
-	{
-	EDebugServOpen = 1,
-	EDebugServClose,
-
-	EDebugServSuspendThread,
-	EDebugServResumeThread,
-//	EDebugServReadProcessInfo,
-//	EDebugServReadThreadInfo,
-	EDebugServReadMemory,
-	EDebugServWriteMemory,
-	};
-
-#endif // RMDEBUGCLIENT_H
--- a/kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,453 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Provides the debug agent server implementation.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <trkkerneldriver.h>
-#include "d_rmdebugserver.h"
-#include "d_rmdebugclient.h"
-#include "t_rmdebug.h"
-
-
-CDebugServServer::CDebugServServer(CActive::TPriority aActiveObjectPriority)
-   : CServer2(aActiveObjectPriority)
-//
-// Server constructor
-//
-	{
-	}
-
-CSession2* CDebugServServer::NewSessionL(const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const
-//
-// Session constructor
-//
-	{
-	// make sure the kernel side device driver is not already loaded
-   TInt err;
-	err = User::LoadLogicalDevice(KDebugDriverFileName);
-	if ((KErrNone == err) || (KErrAlreadyExists == err))
-       {
-       return new(ELeave) CDebugServSession();
-       }
-   else
-       {
-       return (NULL);
-       }
-	}   
-
-CDebugServSession::CDebugServSession()
-// Session implementation
-	{
-   TInt err;
-	TMetroTrkDriverInfo info;
-   info.iUserLibraryEnd = 0;
-   err = iKernelDriver.Open(info);
-   if (KErrNone != err)
-		{
- 		User::Leave(err);
-		}          
-	}
-
-CDebugServSession::~CDebugServSession()
-//
-// Session destructor
-//
-	{
-	// stop the kernel side driver
-	iKernelDriver.Close();
-
-	User::FreeLogicalDevice(KDebugDriverName);
-	}
-
-
-void CDebugServSession::ServiceL(const RMessage2& aMessage)
-//
-// Session service handler
-//
-	{
-	TInt res = KErrNone;
-
-	switch(aMessage.Function())
-		{
-		case EDebugServResumeThread:
-			res = ResumeThread(aMessage);
-			break;
-
-		case EDebugServSuspendThread:
-			res = SuspendThread(aMessage);
-			break;          
-
-//		case EDebugServReadProcessInfo:
-//			res = ReadProcessInfo(aMessage);
-//			break;        
-//
-//		case EDebugServReadThreadInfo:
-//			res = ReadThreadInfo(aMessage);
-//			break;
-
-		case EDebugServReadMemory:
-			res = ReadMemory(aMessage);
-			break;        
-
-		case EDebugServWriteMemory:
-			res = WriteMemory(aMessage);
-			break;        
-
-		default:
-			User::Leave(KErrNotSupported);
-			break;
-		}
-
-	aMessage.Complete(res);
-	}
-
-
-
-TInt CDebugServSession::SuspendThread(const RMessage2& aMessage)
-//
-// Session suspend thread
-//
-	{
-	TInt err;
-
-	err = iKernelDriver.SuspendThread(aMessage.Int0());
-
-	return err;
-	}
-
-TInt CDebugServSession::ResumeThread(const RMessage2& aMessage)
-//
-// Server resume thread
-//
-	{
-	TInt err;
-
-	err = iKernelDriver.ResumeThread(aMessage.Int0());
-
-	return err;
-	}
-
-//TInt CDebugServSession::ReadProcessInfo(const RMessage2& aMessage)
-////
-//// Server read process information
-////
-//	{
-//	TInt err;
-//	TProcessInfo procinfo;
-//	TMetroTrkTaskInfo processInfo(0);
-//
-//	err = iKernelDriver.GetProcessInfo(aMessage.Int0(), processInfo);
-//
-//	if (KErrNone == err)
-//		{
-//		procinfo.iProcessID = processInfo.iId;
-//		procinfo.iPriority = processInfo.iPriority;
-//		procinfo.iName.Copy(processInfo.iName);
-//
-//		TPckgBuf<TProcessInfo> p(procinfo);
-//		aMessage.WriteL(1,p);        
-//		}
-//
-//	return err;
-//	}
-//
-//TInt CDebugServSession::ReadThreadInfo(const RMessage2& aMessage)
-////
-//// Server read thread information
-////
-//	{
-//	TInt err;
-//	TThreadInfo thrdinfo;
-//	TMetroTrkTaskInfo threadInfo(aMessage.Int1()); // Sets OtherID to the second input parameter in aMessage
-//
-//	// aMessage.Int0 is the index into the thread list for the process
-//	err = iKernelDriver.GetThreadInfo(aMessage.Int0(), threadInfo);	   
-//
-//	if (KErrNone == err)
-//		{
-//		thrdinfo.iThreadID = threadInfo.iId;
-//		thrdinfo.iPriority = threadInfo.iPriority;
-//		thrdinfo.iName.Copy(threadInfo.iName);
-//		thrdinfo.iOwningProcessID = threadInfo.iOtherId;
-//
-//		TPckgBuf<TThreadInfo> p(thrdinfo);
-//
-//		// Write out the results to the third argument passed in (pointer to the threadinfo structure)
-//		aMessage.WriteL(2,p);           
-//		}
-//
-//	return err;
-//	}
-
-TInt CDebugServSession::ReadMemory(const RMessage2& aMessage)
-//
-// Server read process memory
-//
-	{   
-	TInt err;
-	TUint32 threadId = aMessage.Int0();
-	TPckgBuf<TMemoryInfo> pckg = *(TPckgBuf<TMemoryInfo> *)(aMessage.Ptr1());
-	TMemoryInfo* InputMemoryInfo = &pckg();
-
-	TPtr8 *ptrtst = InputMemoryInfo->iDataPtr;
-
-	err = iKernelDriver.ReadMemory(threadId, InputMemoryInfo->iAddress, InputMemoryInfo->iSize, *ptrtst);
-
-	return err;
-	}
-
-TInt CDebugServSession::WriteMemory(const RMessage2& aMessage)
-//
-// Server write process memory
-//
-	{
-	TInt err;
-	TUint32 threadId = aMessage.Int0();
-	TPckgBuf<TMemoryInfo> pckg = *(TPckgBuf<TMemoryInfo> *)(aMessage.Ptr1());
-	TMemoryInfo* InputMemoryInfo = &pckg();
-
-	TPtr8 *ptrtst = InputMemoryInfo->iDataPtr;
-
-	err = iKernelDriver.WriteMemory(threadId, InputMemoryInfo->iAddress, InputMemoryInfo->iSize, *ptrtst);
-
-	return err;
-	}
-
-
-GLDEF_C TInt CDebugServServer::ThreadFunction(TAny*)
-//
-// Server thread function, continues until active scheduler stops
-//
-	{
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	if (cleanup == NULL)
-		{
-		User::Leave(KErrNoMemory);
-		}
-
-	CActiveScheduler *pA=new CActiveScheduler;
-	CDebugServServer *pS=new CDebugServServer(EPriorityStandard);
-
-	CActiveScheduler::Install(pA);
-
-	TInt err = pS->Start(KDebugServerName);
-	if (err != KErrNone)
-		{
-		User::Leave(KErrNone);
-		}
-
-	RThread::Rendezvous(KErrNone);
-
-	CActiveScheduler::Start();
-
-	delete pS;
-	delete pA;
-	delete cleanup;
-
-	return (KErrNone);
-	}
-
-
-
-EXPORT_C TInt StartThread(RThread& aServerThread)
-//
-// Start the server thread
-//
-	{
-	TInt res=KErrNone;
-
-	TFindServer finddebugserver(KDebugServerName);
-	TFullName name;
-
-	if (finddebugserver.Next(name) != KErrNone)
-		{
-		res = aServerThread.Create( KDebugServerName,
-									CDebugServServer::ThreadFunction,
-									KDefaultStackSize,
-									KDefaultHeapSize,
-									KDefaultHeapSize,
-									NULL
-									);
-
-		if (res == KErrNone)
-			{
-			TRequestStatus rendezvousStatus;
-
-			aServerThread.SetPriority(EPriorityNormal);
-			aServerThread.Rendezvous(rendezvousStatus);
-			aServerThread.Resume();
-			User::WaitForRequest(rendezvousStatus);
-			}                                 
-		else
-			{
-			aServerThread.Close();
-			}
-		}
-
-	return res;
-	}
-
-
-
-RDebugServSession::RDebugServSession()
-//
-// Server session constructor
-//
-	{
-	}
-
-TInt RDebugServSession::Open()
-//
-// Session open
-//
-	{
-	TInt r = StartThread(iServerThread);
-	if (r == KErrNone)
-		{
-		r=CreateSession(KDebugServerName, Version(), KDefaultMessageSlots);
-		}
-
-	return r;
-	}
-
-
-TVersion RDebugServSession::Version(void) const
-//
-// Session version
-//
-	{
-	return (TVersion(KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServBuildVersionNumber));
-	}
-
-TInt RDebugServSession::SuspendThread(const TInt aThreadID)
-//
-// Session suspend thread request
-//
-	{
-	TIpcArgs args(aThreadID);
-	TInt res;
-	res = SendReceive(EDebugServSuspendThread, args);
-
-	return res;
-	}
-
-TInt RDebugServSession::ResumeThread(const TInt aThreadID)
-//
-// Session resume thread request
-//
-	{
-	TIpcArgs args(aThreadID);
-	TInt res;
-	res = SendReceive(EDebugServResumeThread, args);
-
-	return res;
-	}
-
-
-//TInt RDebugServSession::ReadProcessInfo(const TInt aIndex, TProcessInfo* aInfo)
-////
-//// Session read process information request
-////
-//	{
-//	TPckgBuf<TProcessInfo> pckg;
-//	pckg = *aInfo;
-//
-//	TIpcArgs args(aIndex, &pckg);
-//
-//	TInt res;
-//
-//	res = SendReceive(EDebugServReadProcessInfo, args);
-//
-//	*aInfo = pckg();
-//
-//	return res;
-//
-//	}
-//
-//TInt RDebugServSession::ReadThreadInfo(const TInt aIndex, const TInt aProc, TThreadInfo* aInfo)
-////
-//// Session read thread information request
-////
-//	{
-//	TPckgBuf<TThreadInfo> pckg;
-//	pckg = *aInfo;
-//
-//	TIpcArgs args(aIndex, aProc, &pckg);
-//
-//	TInt res;
-//
-//	res = SendReceive(EDebugServReadThreadInfo, args);
-//
-//	*aInfo = pckg();
-//
-//	return res;
-//
-//	}
-
-
-TInt RDebugServSession::ReadMemory(const TUint32 aThreadID, TMemoryInfo* aInfo)
-//
-// Session read thread memory request
-//
-	{
-	TPckgBuf<TMemoryInfo> pckg;
-	pckg = *aInfo;
-
-	TIpcArgs args(aThreadID, &pckg);
-
-	TInt res;
-
-	res = SendReceive(EDebugServReadMemory, args);
-
-	*aInfo = pckg();
-
-	return res;
-
-	}
-
-
-TInt RDebugServSession::WriteMemory(const TUint32 aThreadID, TMemoryInfo* aInfo)
-//
-// Session write thread memory request
-//
-	{
-	TPckgBuf<TMemoryInfo> pckg;
-	pckg = *aInfo;
-
-	TIpcArgs args(aThreadID, &pckg);
-
-	TInt res;
-
-	res = SendReceive(EDebugServWriteMemory, args);
-
-	return res;
-	}
-
-
-
-TInt RDebugServSession::Close()
-//
-// Session close the session and thread
-//
-	{
-	RSessionBase::Close();
-	iServerThread.Close();
-
-	return KErrNone;
-	}
-
--- a/kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// t_rmdebugserver.h
-// Definitions for the run mode debug agent server side session.
-// 
-//
-
-#ifndef RMDEBUGSVR_H
-#define RMDEBUGSVR_H
-
-// Server name
-_LIT(KDebugServerName,"DebugServer");
-_LIT(KDebugDriverName,"MetroTrk Driver");
-_LIT(KDebugDriverFileName,"trkdriver.ldd");
-
-// A version must be specifyed when creating a session with the server
-const TUint KDebugServMajorVersionNumber=0;
-const TUint KDebugServMinorVersionNumber=1;
-const TUint KDebugServBuildVersionNumber=1;
-const TUint KDefaultMessageSlots=4;
-const TUint KDefaultHeapSize=0x10000;
-
-class CDebugServSession;
-
-
-// Server
-class CDebugServServer : public CServer2
-	{
-	public:
-		CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
-	public:
-		static TInt ThreadFunction(TAny* aStarted);
-	protected:
-		CDebugServServer(CActive::TPriority aActiveObjectPriority);
-	};
-
-// Server side session
-class CDebugServSession : public CSession2
-	{
-	public:
-		CDebugServSession();
-		~CDebugServSession();
-		void ConstructL ( void );
-		void ServiceL(const RMessage2& aMessage);
-
-		TInt ReadMemory(const RMessage2& aMessage);
-		TInt WriteMemory(const RMessage2& aMessage);
-
-//		TInt ReadProcessInfo(const RMessage2& aMessage);
-//		TInt ReadThreadInfo(const RMessage2& aMessage);
-
-		TInt ResumeThread(const RMessage2& aMessage);
-		TInt SuspendThread(const RMessage2& aMessage);
-
-	public:
-		RMetroTrkDriver iKernelDriver;	
-
-	private:
-	};
-
-
-#endif // RMDEBUGSVR_H
--- a/kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,347 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Tests the functionality of the run mode debug device driver.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <f32dbg.h>
-#include "d_rmdebugclient.h"
-#include "d_rmdebugthread.h"
-#include "t_rmdebug.h"
-
-IMPORT_C TInt StartDebugThread(RThread& aServerThread);
-IMPORT_D extern TInt TestData;
-IMPORT_D extern TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-
-LOCAL_D RTest test(_L("T_RMDEBUG"));
-
-CRunModeAgent::CRunModeAgent()
-//
-// CRunModeAgent constructor
-//
-	{
-	}
-
-CRunModeAgent* CRunModeAgent::NewL()
-//
-// CRunModeAgent::NewL
-//
-	{
-	CRunModeAgent* self = new(ELeave) CRunModeAgent();
-
-  	self->ConstructL();
-
-   if (self->iState != ERunModeAgentRunning)
-       {
-       delete self;
-       self = NULL;
-       }       
-	return self;
-	}
-
-CRunModeAgent::~CRunModeAgent()
-//
-// CRunModeAgent destructor
-//
-	{
-	iServSession.Close();
-	iDebugThread.Close();
-   iState = ERunModeAgentUnInit;
-	}
-
-void CRunModeAgent::ConstructL()
-//
-// CRunModeAgent::ConstructL
-//
-	{
-	TInt err;
-	err = StartDebugThread(iDebugThread);
-
-	if (err == KErrNone)
-		{
-		if (iServSession.Open() == KErrNone)
-           {
-           iState = ERunModeAgentRunning;
-           }
-       else
-           {
-           iState = ERunModeAgentUnInit;
-           }
-		}
-	else
-		{
-		User::Panic(_L("Can't start debug thread"), err);
-		}
-}
-
-
-
-CRunModeAgent *RunModeAgent;
-
-// Test process names
-_LIT(ProcessName1,"T_RMDEBUG");
-_LIT(ProcessName1a,"t_rmdebug");
-//_LIT(ProcessName2,"ekern");
-//_LIT(ProcessName3,"efile");
-_LIT(KWildCard,"*");
-
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0185
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading process list
-//! @SYMTestActions Several calls to read the process list
-//! @SYMTestExpectedResults KErrNone and the owning process ID set
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestProcessList()
-	{
-	TInt    err=KErrNone;
-	TBool	found = FALSE;
-
-	test.Next(_L("TestProcessList - Read Process List\n"));
-
-	TFindProcess find(KWildCard);
-	TFullName name;
-	while(find.Next(name)==KErrNone)
-		{
-		RProcess process;
-		err = process.Open(find);
-		if (err == KErrNone)
-			{
-			if ((name.Find(ProcessName1) != KErrNotFound) ||
-				(name.Find(ProcessName1a) != KErrNotFound))
-				{				
-					iProcessID = process.Id();
-					found = TRUE;				
-				}
-			process.Close();				
-			}
-	   }   
-	test(found== TRUE);   
-	}
-
-// Test thread name
-_LIT(ThreadName1,"DebugThread");
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0186
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading thread list
-//! @SYMTestActions Several calls to read the thread list
-//! @SYMTestExpectedResults KErrNone and the debug thread ID set
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestThreadList()
-	{
-	TInt        err=KErrNone;
-	TBool       found = FALSE;
-
-	test.Next(_L("TestThreadList - Read Thread List\n"));
-
-   	TFindThread find(KWildCard);
-	TFullName name;
-	while(find.Next(name)==KErrNone)
-		{
-		RThread thread;
-		err = thread.Open(find);
-       	if (err == KErrNone)
-			{
-			RProcess process;
-			thread.Process(process);
-			if (((TUint32)process.Id() == iProcessID) &&
-				(name.Find(ThreadName1) != KErrNotFound))
-				{
-				found = TRUE;           
-				iThreadID = thread.Id();
-				}
-			}
-			thread.Close();
-   		}   
-
-	test(found==TRUE);   
-	}
-
-   
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0187
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading and writing thread memory
-//! @SYMTestActions Several call to read and write blocks of thread memory
-//! @SYMTestExpectedResults KErrNone
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestMemoryAccess()
-{
-	TInt err=KErrNone;
-	TMemoryInfo MemoryInfo;
-	TInt i;
-
-	test.Next(_L("TestMemoryAccess - Read Memory\n"));     
-
-	for (i = 0; i < SYMBIAN_RMDBG_MEMORYSIZE; i++)
-		{
-		gMemoryAccessBytes.Append(i);
-		}
-
-	MemoryInfo.iAddress = (TUint32)(&gMemoryAccessBytes[0]);
-	MemoryInfo.iSize = SYMBIAN_RMDBG_MEMORYSIZE;
-
-	HBufC8 *data = HBufC8::NewLC(SYMBIAN_RMDBG_MEMORYSIZE);
-	TPtr8 ptr_memread(data->Des());   
-	MemoryInfo.iDataPtr = &ptr_memread;
-
-//	test.Printf(_L("Read address = 0x%x Read size = 0x%x\n"),MemoryInfo.iAddress,MemoryInfo.iSize);
-
-	err = iServSession.ReadMemory(iThreadID, &MemoryInfo);
-
-	for (i = 0; i < MemoryInfo.iSize; i++)
-		{
-		if (ptr_memread.Ptr()[i] != gMemoryAccessBytes[i])
-			{
-			err = KErrCorrupt;       		
-			}
-		}
-
-
-	// Test out writing memory.   
-	test.Next(_L("TestMemoryAccess - Write Memory\n"));
-//	test.Printf(_L("Write address = 0x%x Write size = 0x%x\n"),MemoryInfo.iAddress,MemoryInfo.iSize);
-	if (err== KErrNone)
-		{
-		// Now reset the buffer
-		for (i = 0; i < SYMBIAN_RMDBG_MEMORYSIZE; i++)
-			{
-			gMemoryAccessBytes[i] = 0;
-			}      
-
-		// Write our data into the buffer
-		err = iServSession.WriteMemory(iThreadID, &MemoryInfo);
-
-		for (i = 0; i < MemoryInfo.iSize; i++)
-			{
-			if (ptr_memread.Ptr()[i] != gMemoryAccessBytes[i])
-				{
-				err = KErrCorrupt;       		
-				}
-			}
-
-		}
-
-	if (gMemoryAccessBytes[5] == 0)
-		{
-		err = KErrCorrupt;
-		}
-
-	CleanupStack::PopAndDestroy(data);       
-	test(err==KErrNone);   
-	}
-
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0188
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test suspending and resuming a task
-//! @SYMTestActions Suspends a thread checks the contents of a variable then waits and tests it hasnt changed
-//! @SYMTestExpectedResults KErrNone
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestSuspendResume()
-	{
-	TInt err;
-
-	test.Next(_L("TestSuspendResume - Suspend\n"));
-	// Suspend the thread
-	err = iServSession.SuspendThread(iThreadID);
-	test(err==KErrNone);
-	TInt localtestdata;
-	localtestdata = TestData;
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check data hasnt changed
-	test(localtestdata==TestData);
-
-	// Resume the thread
-	test.Next(_L("TestSuspendResume - Resume\n"));
-	err = iServSession.ResumeThread(iThreadID);
-	test(err==KErrNone);
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check that the thread being controlled has resumed and is
-	// updating the variable
-	test(localtestdata!=TestData);
-	}
-   
-void CRunModeAgent::ClientAppL()
-//
-// Performs each test in turn
-//
-	{
-	test.Start(_L("ClientAppL"));
-
-	TestProcessList();
-	TestThreadList();
-	TestMemoryAccess();
-	TestSuspendResume();
-	test.End();   
-	}
-
-GLDEF_C TInt E32Main()
-//
-// Entry point for run mode debug driver test
-//
-	{
-   TInt ret = KErrNone;
-   
-	// client
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-
-   RunModeAgent = CRunModeAgent::NewL();
-   if (RunModeAgent != NULL)
-       {
-   	test.Title();
-
-        __UHEAP_MARK;
-	    TRAPD(r,RunModeAgent->ClientAppL());
-       ret = r;
-	    __UHEAP_MARKEND;
-
-	    delete RunModeAgent;
-       }
-       
-	delete trap;
-
-	return ret;
-	}
--- a/kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Definitions for the run mode debug tests
-// 
-//
-
-#ifndef RMDEBUG_H
-#define RMDEBUG_H
-
-// Function codes (opcodes) used in message passing between client and server
-enum TRunModeAgentState
-	{
-	ERunModeAgentUnInit,
-    ERunModeAgentRunning,
-	};
-
-
-//
-// class CRunModeAgent
-//
-// The basic run mode agent.
-//
-class CRunModeAgent : public CBase
-	{
-	public:
-		static CRunModeAgent* NewL();
-		~CRunModeAgent();
-		void ClientAppL();
-
-	private:
-		CRunModeAgent();
-		void ConstructL();
-
-		TInt TestStartup();
-		TInt TestShutdown();
-
-		void TestProcessList();
-		void TestThreadList();
-		void TestMemoryAccess();
-		void TestSuspendResume();
-
-	private:
-		RDebugServSession	iServSession;
-		RThread				iDebugThread;
-		TInt				iProcessID;
-		TInt				iThreadID;
-        TInt                iState;
-	};
-
-#endif // RMDEBUG_H
--- a/kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-// 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:
-//
-// Description:
-// Implements the handling of run mode events for a particular target executable
-// 
-
-#include <e32base.h>
-#include <e32property.h>
-#include <e32test.h>
-
-#include "t_rmdebug_app.h"
-#include "t_agent_eventhandler.h"
-#include "t_multi_agent.h"
-#include "t_debug_logging.h" 
-
-using namespace Debug;
-
-CAgentAsyncEvent::CAgentAsyncEvent(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig):
-	CActive(EPriorityStandard), iDriver(aDriver)
-	{
-	}
-
-CAgentAsyncEvent* CAgentAsyncEvent::NewLC(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig)
-	{
-	CAgentAsyncEvent* self = new(ELeave) CAgentAsyncEvent(aDriver, aExeName, aExeConfig);
-	CleanupStack::PushL(self);
-	self->ConstructL(aExeName, aExeConfig);
-	return self;
-	}
-
-CAgentAsyncEvent* CAgentAsyncEvent::NewL(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig)
-	{
-	CAgentAsyncEvent* self = CAgentAsyncEvent::NewLC(aDriver, aExeName, aExeConfig);
-	CleanupStack::Pop(); // self
-	return self;
-	}
-
-void CAgentAsyncEvent::ConstructL(const TDesC& aExeName, const TDesC& aExeConfig)
-	{
-	iExeName.CreateL(aExeName);
-	iExeConfig.CreateL(aExeConfig);
-	CActiveScheduler::Add(this);
-	}
-
-CAgentAsyncEvent::~CAgentAsyncEvent()
-	{
-	LOG_MSG2("~CAgentAsyncEvent(), this = 0x%08x", this);
-
-	iSEventInfo.iEventInfoBuf.Delete(0, sizeof(TEventInfo));
-	iExeName.Close();
-	iExeConfig.Close();
-	iProc.Close();
-	Cancel(); // Cancel any request, if outstanding
-	}
-
-/*
- * Issue request to DSS and notify the active scheduler
- */
-void CAgentAsyncEvent::Watch()
-	{
-	LOG_MSG2("ENTER: CAgentAsyncEvent::Watch, this = 0x%08x", this);
-	iDriver.DebugDriver().GetEvent(GetExecutable(), iStatus, iSEventInfo.iEventInfoBuf);
-
-	if (!IsActive())
-		{
-		LOG_MSG("CAgentAsyncEvent::Watch(): SetActive()");
-		SetActive();
-		}
-
-	LOG_MSG("EXIT: CAgentAsyncEvent::Watch");
-	}
-
-void CAgentAsyncEvent::RunL()
-	{
-	LOG_MSG4("ENTER: CAgentAsyncEvent::RunL iDebugType=%d, iStatus.Int() %d, this 0x%x08", 
-			 iSEventInfo.iEventInfo.iEventType, iStatus.Int(), this);
-	
-    LOG_MSG2("%S", &TPtr8((TUint8*)GetExecutable().Ptr(), 2*GetExecutable().Length(), 2*GetExecutable().Length()));	
-	iDriver.HandleEvent(iSEventInfo.iEventInfo);
-
-	LOG_MSG2("iDriver.GetNumApps() %d: ", iDriver.GetNumApps());
-	LOG_MSG2("iDriver.iLaunchCompleted  %d: ", iDriver.GetLaunchCompleted());
-
-	if (iDriver.GetLaunchCompleted() < iDriver.GetNumApps())
-		{
-		// Do not call Watch() if target has run to completion but test is still on going
-		if (iSEventInfo.iEventInfo.iEventType != EEventsRemoveProcess)
-			{
-			LOG_MSG("CAgentAsyncEvent::RunL Setting Watch()");
-			Watch();
-			}
-		}
-	else
-		{
-		// Stop event handling for all targets
-		LOG_MSG("CAgentAsyncEvent::RunL CActiveScheduler::Stop() & Cancel");
-		CActiveScheduler::Stop();
-		}
-
-	LOG_MSG2("EXIT: CAgentAsyncEvent::RunL", KNullDesC);
-	}
-
-void CAgentAsyncEvent::DoCancel()
-	{
-	LOG_MSG("CAgentAsyncEvent::DoCancel");
-	}
-
-TInt CAgentAsyncEvent::RunError(TInt aError)
-	{
-	LOG_MSG3(" RunL() has left with error %d, this 0x%08X", aError, this);
-	return aError; 
-	// Can we handle this error? Not at the moment!
-	}
-
--- a/kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-// 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:
-//
-// Description:
-// Definitions for event handling via the DSS and target specific information
-//
-//
-
-#ifndef RMDEBUG_AGENT_EVENTHANDLER_H
-#define RMDEBUG_AGENT_EVENTHANDLER_H
-
-#include "t_multi_agent.h"
-
-using namespace Debug;
-
-class CMultiAgent;
-
-/**
- Class for gathering event data from the run-mode driver
- */
-class TAgentEventInfo
-{
-public:
-	TAgentEventInfo() : 
-	iEventInfoBuf((TUint8*)&iEventInfo, sizeof(TEventInfo), sizeof(TEventInfo))
-	{ 	
-	}
-
-public:
-	// This is the underlying class for event interaction with the Run Mode debug API 
-	TEventInfo			iEventInfo;
-	
-	// A convenience handle for iEventInfo used across the Debug::GetEvent() method 
-	TPtr8				iEventInfoBuf;
-};
-
-/**
-  Active object class used to trap asynchronous events
-  Also, contains target specific parameters
-  */
-class CAgentAsyncEvent : public CActive
-	{
-public:
-	// Close buffers and Cancel and destroy
-	~CAgentAsyncEvent();	
-
-	// Two-phased constructor
-	static CAgentAsyncEvent* NewLC(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig);
-
-	// Two-phased constructor
-	static CAgentAsyncEvent* NewL(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig);
-
-	// set up ASP and issue another request	
-	void Watch();
-
-	TDesC& GetExecutable() { return iExeName; }
- 	TDesC& GetExeConfig() { return iExeConfig; }
-	RProcess& GetProcHandle() { return iProc; }
-
-protected:
-	// from CActive
-	virtual void RunL();
-	virtual void DoCancel();
-	virtual TInt RunError(TInt aError);
-
-private:
-	CAgentAsyncEvent(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig);
-	void ConstructL(const TDesC& aExeName, const TDesC& aExeConfig);
-
-private:
-	RBuf iExeName;
-	RBuf iExeConfig;
-	RProcess iProc;
-
-	CMultiAgent& iDriver;
-	TAgentEventInfo iSEventInfo;
-	};
-
-#endif // RMDEBUG_AGENT_EVENTHANDLER_H
-
-
--- a/kerneltest/e32test/rm_debug/multi_agent_tests/t_debug_logging.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Logging macros for use in debug subsystem
-// 
-//
-
-#ifndef RMDEBUG_MULTI_AGENT_LOGGING_H
-#define RMDEBUG_MULTI_AGENT_LOGGING_H
-
-/* Debug messages
- * 
- * Debug messages are only generated for debug builds.
- * 
- * As user mode use RDebug::Printf(). 
- * 
- */
-
-// Uncomment if logging of multi agent test required
-// #define MULTI_AGENT_DEBUG_LOGGING 
-
-#ifdef MULTI_AGENT_DEBUG_LOGGING
-
-    #include <e32debug.h>
-
-    #define LOG_MSG( a )              RDebug::Printf( a )
-    #define LOG_MSG2( a, b )          RDebug::Printf( a, b )
-    #define LOG_MSG3( a, b, c )       RDebug::Printf( a, b, c )
-    #define LOG_MSG4( a, b, c, d )    RDebug::Printf( a, b, c, d )
-    #define LOG_MSG5( a, b, c, d, e )    RDebug::Printf( a, b, c, d, e )
-
-#else
-
-  #define LOG_MSG( a )
-  #define LOG_MSG2( a, b )
-  #define LOG_MSG3( a, b, c )
-  #define LOG_MSG4( a, b, c, d )
-  #define LOG_MSG5( a, b, c, d, e )
-
-#endif
-
-#endif //RMDEBUG_MULTI_AGENT_LOGGING_H
--- a/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,433 +0,0 @@
-// 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:
-//
-// Description:
-// Tests the run mode debug device component by launching multiple targets 
-// on different CPUs. On a single core the targets run on the same CPU.  
-//
-
-#include <e32base.h>
-#include <e32property.h>
-#include <hal.h>
-#include <e32test.h>
-#include <e32def.h>
-#include <e32svr.h>
-
-#include "t_rmdebug_app.h"
-#include "t_multi_agent.h"
-#include "t_agent_eventhandler.h"
-#include "t_debug_logging.h"
-
-const TVersion securityServerVersion(0,1,1);
-
-/**
- * First phase constructor
- */
-CMultiAgent* CMultiAgent::NewL()
-	{
-	CMultiAgent* self = new(ELeave) CMultiAgent();
-	self->ConstructL();
-	return self;
-	}
-
-/**
-  * Destructor
-  */
-CMultiAgent::~CMultiAgent()
-	{
-	LOG_MSG("~CMultiTargetAgent\n");
-	iServSession.Close();
-	}
-
-/**
- * Constructor
- */
-CMultiAgent::CMultiAgent() 
-	{
-	}
-
-/**
- * Second phase constructor
- */
-void CMultiAgent::ConstructL()
-	{
-	}
-
-/**
-  Parse the command line, set agent cpu affinity and call main test function
-  */
-void CMultiAgent::ClientAppL()
-	{
-	LOG_MSG("ENTER: CMultiTargetAgent::ClientAppL"); 
-
-	iNumApps = KNumApps;
-	iAgentCpuNo = KAgentCpu;
-	iTargetNameOffset = KTargetOffset;
-
-	TInt argc = User::CommandLineLength();
-	HBufC* commandLine = NULL;
-	LOG_MSG2(">Launcher Process() argc=%d", argc);
-	
-	if(argc)
-		{
-		commandLine = HBufC::NewLC(argc);
-		TPtr commandLineBuffer = commandLine->Des();
-		User::CommandLine(commandLineBuffer);
-
-		RBuf printCommandLine;
-		CleanupClosePushL(printCommandLine);
-		printCommandLine.CreateL(commandLine->Des().Length());
-		printCommandLine.Copy(commandLine->Des());
-		printCommandLine.Collapse();
-		LOG_MSG2(">command line = %S", &printCommandLine );
-		CleanupStack::PopAndDestroy( &printCommandLine );
-
-		// create a lexer and read through the command line
-		TLex lex(*commandLine);
-	
-		while (!lex.Eos())
-		{
-			// only look for options with first character '-'
-			if (lex.Get() == '-')
-			{
-			TChar arg = lex.Get();
-			
-				switch ( arg )
-				{
-				case 'n':
-					lex.Val( iNumApps );
-					LOG_MSG2("parsed numApps as %d", iNumApps); 
-					break;
-		
-				case 'a':
-					lex.Val( iAgentCpuNo );
-					LOG_MSG2("parsed agentCpuNo as %d", iAgentCpuNo);                        
-					break;
-
-				case 'o':
-					lex.Val( iTargetNameOffset );
-					LOG_MSG2("parsed iTargetNameOffset as %d", iTargetNameOffset);        
-					break;
-
-				default:
-					LOG_MSG("Bad argument from user"); 
-					break;                 
-				}
-			}
-		}
-	}
-	// Create active scheduler (to run active objects)
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-	
-	if (iAgentCpuNo)
-		{
-		LOG_MSG2("CMultiAgent::ClientAppL() - setting agent to cpu %d", iAgentCpuNo);
-		UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, (TAny *)iAgentCpuNo, 0);
-		}
-
-	TInt err = iServSession.Connect(securityServerVersion);
-	
-	if (err != KErrNone)
-		{
-		User::Panic(_L("Can't open server session"), err);
-		}
-
-	StartTest();
-
-	// Note: below is a workaround to overcome an issue with RTest server crashing 
-	// when writing to the windows console from different agents (on different CPUs 
-	// at the same time). To overcome this we signal the launcher using a global 
-	// semaphore to indicate a RTest complete instead
-	RSemaphore launchSemaphore;
-	CleanupClosePushL(launchSemaphore);
-            
-	TFindSemaphore launchSemFinder(KLaunchSemaphoreSearchString);
-	TFullName semaphoreResult;
-	TInt ret = launchSemFinder.Next(semaphoreResult);
-	LOG_MSG3( "> Find Launch Semaphote.Next ret=%d, %lS", ret, &semaphoreResult);
-         
-	ret = launchSemaphore.OpenGlobal(semaphoreResult);
-	LOG_MSG2( ">OpenGlobal semaphore ret=%d", ret );         
-    
-	LOG_MSG( ">Signalling semaphore" );
-	launchSemaphore.Signal();
-	CleanupStack::PopAndDestroy(&launchSemaphore); // launchSemaphore
-
-	// Delete active scheduler
-	CleanupStack::PopAndDestroy(scheduler);
-
-	if (commandLine)
-	CleanupStack::PopAndDestroy(commandLine);
-	
-	LOG_MSG( "EXIT: CMultiTargetAgent::ClientAppL"); 
-	}
-
-/**
-  Launch a process
-  @param aProcess the RProcess object used to create the process
-  @param aFileName file name of the executable used to create the process
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-TInt CMultiAgent::LaunchProcess(RProcess& aProcess, const TDesC& aExeName, const TDesC& aCommandLine)    
-	{
-	LOG_MSG( "ENTER: CMultiAgent::LaunchProcess");
-    LOG_MSG2("%S", &TPtr8((TUint8*)aExeName.Ptr(), 2*aExeName.Length(), 2*aExeName.Length()));	
-	
-	// wait for 0.5 seconds due to issue with creating several processes in smp quickly
-	User::After(500000);
-	
-	TInt err = aProcess.Create( aExeName, aCommandLine );
-	LOG_MSG2( "CMultiAgent::LaunchProcess, aProcess.Create err = %d", err); 
-
-	// check that there was no error raised
-	if (err != KErrNone)
-		return err;
-	
-	// rendezvous with process
-	TRequestStatus status = KRequestPending;
-	aProcess.Rendezvous(status);
-
-	if (KRequestPending != status.Int())
-		{
-		// startup failed so kill the process
-		LOG_MSG2( "> RProcess Rendezvous() failed with %d. Killing process", status.Int() );
-		aProcess.Kill(KErrNone);
-		LOG_MSG( "EXIT: CMultiAgent::LaunchProcess");
-		return status.Int();
-		}
-	else
-		{
-		// start the test target
-		aProcess.Resume();
-		User::WaitForRequest(status);
-	
-		LOG_MSG2( "> CMultiAgent::LaunchProcess: RProcess Resume() Rendezvous successful %d: ", status.Int() );
-
-		if(KErrNone != status.Int())
-			{
-			LOG_MSG2( "> RProcess Resume() failed with %d. Killing process", status.Int() );
-			aProcess.Kill(KErrNone);
-			}
-
-		LOG_MSG( "EXIT: CMultiAgent::LaunchProcess");
-		return status.Int();
-		}
-	}
-
-/**
-  Handle Event
-  @param aEventInfo object containing event information from the DSS 
-  */
-void CMultiAgent::HandleEvent(TEventInfo& aEventInfo)
-	{
-	LOG_MSG( "ENTER: CMultiAgent::HandleEvent" ); 
-	TInt ret = KErrNone;
-	const TInt idValid = 1;
-	
-	switch ( aEventInfo.iEventType )
-		{
-		case EEventsAddProcess:
-			{
-			LOG_MSG(">> EEventsAddProcess");                        
-			TPtrC8 exeNamePtr8(aEventInfo.iAddProcessInfo.iFileName, aEventInfo.iAddProcessInfo.iFileNameLength);
-	
-			RBuf8 exeName8;
-			CleanupClosePushL(exeName8);
-			exeName8.CreateL(exeNamePtr8);
-			LOG_MSG2("From event: exeName8=%S", &exeName8);
-			CleanupStack::PopAndDestroy(&exeName8);
-			LOG_MSG("Testing if event process id is valid");
-
-			LOG_MSG2("Got aEventInfo.iProcessId=%d", I64LOW( aEventInfo.iProcessId));
-			__ASSERT_ALWAYS((aEventInfo.iProcessIdValid==idValid), User::Panic(_L("ProcessId Invalid"), aEventInfo.iProcessIdValid));
-	
-			RProcess targetProc;
-			ret = targetProc.Open(TProcessId(aEventInfo.iProcessId));
-			LOG_MSG2("RProcess open ret=%d", ret);
-			targetProc.Close();
-
-			__ASSERT_ALWAYS((ret == KErrNone), User::Panic(_L("ProcessId Invalid"), aEventInfo.iProcessIdValid));
-			break;
-			}
-	
-		case EEventsStartThread:
-			{
-			LOG_MSG(">> EEventsStartThread");                
-			TPtrC8 exeNamePtr8(aEventInfo.iStartThreadInfo.iFileName, aEventInfo.iStartThreadInfo.iFileNameLength);
-			RBuf8 exe8Name;
-			CleanupClosePushL(exe8Name);
-			exe8Name.CreateL(exeNamePtr8);
-			LOG_MSG2("From event: exeName8=%S", &exe8Name);
-			CleanupStack::PopAndDestroy(&exe8Name);
-	
-			LOG_MSG("Testing if event process id is valid" );
-
-			__ASSERT_ALWAYS((aEventInfo.iProcessIdValid==idValid), User::Panic(_L("ProcessId Invalid"), aEventInfo.iProcessIdValid));
-
-			LOG_MSG2("Got aEventInfo.iProcessId=%d", I64LOW(aEventInfo.iProcessId));
-
-			LOG_MSG("Testing if event thread id is valid");
-
-			__ASSERT_ALWAYS((aEventInfo.iThreadIdValid==idValid), User::Panic(_L("ThreadId Invalid"), aEventInfo.iThreadIdValid));
-
-			LOG_MSG2("Got aEventInfo.iThreadId=%d", I64LOW(aEventInfo.iThreadId));
-			break;                    
-			}                       
-
-		case EEventsUserTrace:
-			{
-			LOG_MSG(">> EEventsUserTrace");  
-			break;
-			}
-
-		case EEventsRemoveProcess:
-			{
-			LOG_MSG( ">> EEventsRemoveProcess");                        
-			iLaunchCompleted++; 
-			break;
-			}
-	
-		default:   
-			{
-			LOG_MSG( ">> Unknown event - probably due to DSS busy?");
-			break;
-			}	
-		}
- 	 
-	LOG_MSG("EXIT: CMultiAgent::HandleEvent"); 
-	}
-
-/**
- * Main test function which launches several targets and stresses the DSS 
- */
-TInt CMultiAgent::StartTest()
-	{
-	LOG_MSG("ENTER: CMultiTargetAgent::StartTest");
-
-	for( TInt i = 0; i < iNumApps; i++ )
-		{
-		RBuf targetName;
-		RBuf launcherOptions;
-
-		CleanupClosePushL(targetName); 
-		CleanupClosePushL(launcherOptions); 
-
-		targetName.CreateL( KTargetExe().Length() + 2 );
-		targetName.Format( KTargetExe(), i + iTargetNameOffset + 1 );
-
-		LOG_MSG2("App %d: ", i+1);
-		LOG_MSG2("%S", &TPtr8((TUint8*)targetName.Ptr(), 2*targetName.Length(), 2*targetName.Length()));	
-
-		launcherOptions.CreateL( KTargetOptions().Length() + 2 );
-		launcherOptions.Format( KTargetOptions(), (TUint)ENormalExit, (i+1) );
-
-		LOG_MSG( "AppOptions : ");
-		LOG_MSG2("%S", &TPtr8((TUint8*)launcherOptions.Ptr(), 2*launcherOptions.Length(), 2*launcherOptions.Length()));	
-		
-		// Add each test target to array
-		iTargetList.AppendL(CAgentAsyncEvent::NewL(*this, targetName, launcherOptions));
-		CleanupStack::PopAndDestroy(2, &targetName );
-		}
-	
-	iLaunchCompleted = 0;
-	TInt err = KErrNone;
-		
-	for (TInt i = 0; i < iNumApps; i++)
-		{
-		// Attach to process non-passively
-		LOG_MSG2( ">AttachExecutable app %d ", i + iTargetNameOffset + 1 );
-		LOG_MSG2("%S", &TPtr8((TUint8*)iTargetList[i]->GetExecutable().Ptr(), 2*iTargetList[i]->GetExecutable().Length(), 
-					2*iTargetList[i]->GetExecutable().Length()));
-
-		err = iServSession.AttachExecutable( iTargetList[i]->GetExecutable(), EFalse);
-		__ASSERT_ALWAYS((err == KErrNone), User::Panic(_L("DSS Attach failed"), err));
-
-		// Continue on interested event actions
-		LOG_MSG2( ">SetEventAction app %d,  EEventsStartThread EAcionContinue", i + iTargetNameOffset + 1);
-
-		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsStartThread, EActionContinue);
-		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
-	
-		LOG_MSG2(">SetEventAction app %d,  EEventsAddProcess EActionContinue", i + iTargetNameOffset + 1);
-		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsAddProcess, EActionContinue);
-		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
-
-		LOG_MSG2(">SetEventAction app %d,  EEventsUserTrace EActionContinue", i + iTargetNameOffset + 1);
-		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsUserTrace, EActionContinue);
-		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
-	
-		LOG_MSG2(">SetEventAction app %d,  EEventsRemoveProcess EActionContinue", i + iTargetNameOffset + 1);
-		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsRemoveProcess, EActionContinue);
-		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
-
-		// Add target object to active schedular
-		iTargetList[i]->Watch();
-		}
-
-	for (TInt i= 0; i< iNumApps; i++)
-		{
-		LOG_MSG( ">Calling LaunchProcess function");
-		err = LaunchProcess(iTargetList[i]->GetProcHandle(), iTargetList[i]->GetExecutable(), iTargetList[i]->GetExeConfig());
-		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("LaunchProcess failed"), err));
-		}
-
-	LOG_MSG( ">CActiveScheduler::Start()");
-	CActiveScheduler::Start();
-
-	for (TInt i= 0; i < iNumApps; i++)
-		{
-		// Now detach again
-		LOG_MSG( "Before iServSession.DetachExecutable" );
-		err = iServSession.DetachExecutable(iTargetList[i]->GetExecutable());
-		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("DetachExecutable failed"), err));
-		}
-	
-	// Free all the memory
-	iTargetList.ResetAndDestroy();
-	LOG_MSG( "EXIT: CMultiTargetAgent::StartTest" );
-
-	return KErrNone;
-	}
-
-/**
-  * Entry point for run mode debug driver test
-  */
-GLDEF_C TInt E32Main()
-	{
-	LOG_MSG( "ENTER: Multi_agent E32Main ");
-	__UHEAP_MARK;
-
-	TInt ret = KErrNone;
-	RProcess::Rendezvous(KErrNone);
-	
-	CTrapCleanup* trap = CTrapCleanup::New();
-		
-	if (!trap)
-		return KErrNoMemory;
-	
-	CMultiAgent *runModeAgent = CMultiAgent::NewL();
-
-	if (runModeAgent != NULL)
-		{
-		TRAP(ret,runModeAgent->ClientAppL());
-		LOG_MSG2( "ClientAppL returned %d", ret );
-		delete runModeAgent;
-		}
-
-	delete trap;
-	__UHEAP_MARKEND;
-	LOG_MSG( "EXIT: Multi_agent E32Main ");
-	return ret;
-	}
-
--- a/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-// Copyright (c) 2006-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:
-//
-// Description:
-// Definitions for the run mode debug tests
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef RMDEBUG_MULTI_AGENT_H
-#define RMDEBUG_MULTI_AGENT_H
-
-#include <u32hal.h>
-#include <f32file.h>
-#include <rm_debug_api.h>
-
-using namespace Debug;
-
-_LIT(KLaunchSemaphoreName, "t_rmdebug_launch_semaphore");
-_LIT(KLaunchSemaphoreSearchString, "t_rmdebug_launch_semaphore*");
-
-// Currently the targets are instances of t_rmdebug_app.exe
-_LIT(KTargetExe,"z:\\sys\\bin\\t_rmdebug_app%d.exe");
-
-_LIT(KTargetOptions,"-f%d -a%d");
-
-// If changing this, make sure there are enough apps built/in the rom 
-const TInt KNumApps = 5;
-
-// Default CPU execution for Agent
-const TInt KAgentCpu = 0;
-
-// Workaround to ensure we have the same agent binary when running multiple agents
-const TInt KTargetOffset = 0;
-
-class CAgentAsyncEvent;
-
-/**
-  @Class CRunModeAgent
-  
-  The basic run mode agent
-  */
-class CMultiAgent : public CBase
-	{
-	public:
-	static CMultiAgent* NewL();
-	~CMultiAgent();
-	void ClientAppL();  
-	RSecuritySvrSession&  DebugDriver() { return iServSession; };	
-	void HandleEvent(TEventInfo& aSEventInfo);
-
-	public:
-	TInt GetLaunchCompleted() const { return iLaunchCompleted; }
-	TInt GetNumApps() const { return iNumApps; }
-	TInt GetTargetOffset() const { return iTargetNameOffset; }
-
-	private:
-	CMultiAgent();
-	void ConstructL();
-	TInt StartTest();
-	TInt LaunchProcess(RProcess& aProcess, const TDesC& aExeName, const TDesC& aCommandLine);
-	
-	private:
-
-	/**
-	 * CPU agent executes on; by default this is 0 
-	 */
-	TInt iAgentCpuNo;
-
-	/*
-	 * Offset for running multiple targets using the same agent
-	 */
-	TInt iTargetNameOffset;
-
-	/** 
-	 * Number of applications/targets per agent
-	 */
-	TInt iNumApps;
-
-	/**
-	 * Flag used for terminating the event handling for a target 
-	 */	
-	TInt iLaunchCompleted;
-
-	/*
-	 * Handle to DSS
-	 */
-	RSecuritySvrSession iServSession;
-	
-	/**
-	 * Array to target parameters required by the agent
-	 */	
-	RPointerArray<CAgentAsyncEvent> iTargetList;
-	};
-
-#endif // RMDEBUG_MULTI_AGENT_H
--- a/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-// Copyright (c) 2007-2009 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:
-//
-// Description:
-// Helper app to launch debug targets
-//
-//
-
-#include "t_multi_agent_launcher.h"
-
-#include "t_debug_logging.h"
-
-/**
- * Launch a process
- * @param aProcess the RProcess object used for creating the process
- * @param aExeName the name of the executable to run 
- * @param aCommandLine command line parameters to pass when creating the process 
- * @return KErrNone on success, or one of the other system wide error codes
- */
-TInt LaunchProcess(RProcess& aProcess, TDesC& aExeName, TDesC& aCommandLine )    
-	{
-	LOG_MSG("ENTER: t_multi_agent_launcher: launchProcess"); 
-
-	LOG_MSG2("aExeName %S ", &TPtr8((TUint8*)aExeName.Ptr(), 2*aExeName.Length(), 2*aExeName.Length()));
-	LOG_MSG2("aCommandLine %S", &TPtr8((TUint8*)aCommandLine.Ptr(), 2*aCommandLine.Length(), 2*aCommandLine.Length()));
-
-	TInt err = aProcess.Create( aExeName, aCommandLine );
-	LOG_MSG2("t_multi_agent_launcher launchProcess, aProcess.Create err = %d", err); 
-
-	// check that there was no error raised
-	if(err != KErrNone)
-		{
-		return err;
-		}
-
-	// rendezvous with process
-	TRequestStatus status = KRequestPending;
-	aProcess.Rendezvous(status);
-
-	if(KRequestPending != status.Int())
-		{
-		// startup failed so kill the process
-		LOG_MSG2("t_multi_agent_launcher: launchProcess: RProcess Rendezvous() failed with %d. Killing process", status.Int());
-		aProcess.Kill(KErrNone);
-		return status.Int();
-		}
-	else
-		{
-		aProcess.Resume();
-		User::WaitForRequest(status);
-
-		LOG_MSG2("t_multi_agent_launcher: launchProcess: RProcess Resume() Rendezvous successful %d: ", status.Int());
-
-		if(KErrNone != status.Int())
-			{
-			LOG_MSG2("t_multi_agent_launcher: RProcess Resume() failed with %d. Killing process", status.Int());
-			aProcess.Kill(KErrNone);
-			}
-
-		LOG_MSG("EXIT: t_multi_agent_launcher launchProcess");
-		return status.Int();
-		}
-	}
-
-/**
- * Read command line parameters and control the launching of the agents. 
- */
-void MainL()
-	{	
-	LOG_MSG( "ENTER: t_multi_agent_launcher MainL()");
-
-	TInt ret = KErrNone;
-	TInt numAgents = KNumAgents;
-	TInt numTargets = KNumTargets;
-	TInt numTestRuns = KNumTestRuns;
-
-	TInt argc = User::CommandLineLength();
-	HBufC* commandLine = NULL;
-	LOG_MSG2("t_multi_agent_launcher: MainL(): argc=%d", argc);
-    
-	if(argc)
-		{
-		commandLine = HBufC::NewLC(argc);
-		TPtr commandLineBuffer = commandLine->Des();
-		User::CommandLine(commandLineBuffer);
-
-		RBuf printCommandLine;
-		CleanupClosePushL( printCommandLine );
-		printCommandLine.CreateL( commandLine->Des().Length() );
-		printCommandLine.Copy( commandLine->Des() );
-		printCommandLine.Collapse();
-		LOG_MSG2("t_multi_agent_launcher: command line = %S", &printCommandLine);
-		CleanupStack::PopAndDestroy( &printCommandLine );
- 
-		// create a lexer and read through the command line
-		TLex lex(*commandLine);
-		while (!lex.Eos())
-			{
-			// only look for options with first character '-'
-			if (lex.Get() == '-')
-				{
-					TChar arg = lex.Get();
-					switch ( arg )
-						{
-						case 'n':
-							lex.Val( numAgents );
-							LOG_MSG2("t_multi_agent_launcher: parsed numAgents as %d", numAgents);
-							break;
-						case 'm':
-							lex.Val( numTargets );
-							LOG_MSG2("t_multi_agent_launcher: parsed numTargets as %d", numTargets);                        
-							break;  
-						case 't':
-							lex.Val( numTestRuns );
-							LOG_MSG2("t_multi_agent_launcher: parsed numTestRuns as %d", numTestRuns);                        
-							break;                    
-						default:
-							LOG_MSG("t_multi_agent_launcher: unknown argument ignoring it");
-							break;                 
-						}
-				}
-			}
-		}
-
-	// Note: below is a workaround to overcome an issue with RTest server crashing 
-	// when writing to the windows console from different agents (on different CPUs 
-	// at the same time). To overcome this we get signaled by the agents when they have 
-	// completed their tests so that we can do a RTest complete
-	RSemaphore launchSemaphore;
-	CleanupClosePushL(launchSemaphore);
-	ret = launchSemaphore.CreateGlobal(KLaunchSemaphoreName, 0);
-	LOG_MSG2( ">Target Launcher : RSemaphore.CreateGlobal ret %d", ret);
-	User::LeaveIfError( ret );
-
-	ret = launchSemaphore.OpenGlobal(KLaunchSemaphoreName);
-	LOG_MSG2( ">Target Launcher : RSemaphore.OpenGlobal ret %d", ret);
-	User::LeaveIfError( ret );
-
-	//Now launch the requested number of apps for the requested number of test runs
-	for( TInt j = 0; j < numTestRuns; j++ )
-		{ 
-			for( TInt i = 0; i < numAgents; i++ )  
-				{
-					RBuf targetName;
-					targetName.CleanupClosePushL();
-					targetName.CreateL(KAgentExe());
-
-					RProcess aProc;
-					CleanupClosePushL(aProc); 
-					RBuf launcherOptions;
-					CleanupClosePushL(launcherOptions);
-				    const TInt additionalWords = 2;	
-					launcherOptions.CreateL( KAgentOptions().Length() + additionalWords );
-		
-					// Apply offset: launcherOptions.Format( .., .., i * numTargets, ..)
-					// workaround to ensure we have the same binary for multiple agents. 
-					// e.g. So if offset = 0, agent attaches to app1, app2, app3, app4, app5
-					// if offset = 5, agent attached to app6, app7, app8, app9, app10 etc.
-					// Note: apps need to be in rom otherwise the agent will fail on an assert 
-					// (with KErrNotFound)
-					launcherOptions.Format( KAgentOptions(), (TUint)numTargets, i * numTargets, 0);
-			
-					ret = LaunchProcess( aProc, targetName, launcherOptions );	
-					CleanupStack::PopAndDestroy(3,&targetName);
-					User::LeaveIfError(ret);
-				}
-		}
-
-	// Wait for all agents to do their testing before checking the semaphore
-	User::After(12000000);
-
-	LOG_MSG( ">Target Launcher:  Semaphore wait");
-
-	for (TInt i = 0; i < numAgents; i ++)
-		{
-		//We need this delay just in case an agent crashes and never signals the sem
-		ret = launchSemaphore.Wait(100000);
-		if( ret != KErrNone )
-			{
-			LOG_MSG3("launchSemaphore.Wait ret %d for agent %d", ret, i);
-			break;
-			}
-		}
-
-	LOG_MSG2( "testing for Semaphore ret %d", ret);
-
-	// We only want to have one RTest instance at any one time since otherwise RTest can panic
-	RTest test(_L("T_MULTI_AGENT_LAUNCHER"));
-	test.Start(_L("t_multi_agent_launcher Check for agents finishing correctly"));
-	test(ret == KErrNone);
-	test.End();
-	test.Close();
-
-	CleanupStack::PopAndDestroy(&launchSemaphore); // launchSemaphore
-
-	if( commandLine )
-	CleanupStack::PopAndDestroy(commandLine);
-	
-	LOG_MSG("EXIT: t_multi_agent_launcher MainL()");
-	}
- 
-GLDEF_C TInt E32Main()
-	{
-	LOG_MSG("ENTER: Multi_agent_launcher E32Main()");
-	__UHEAP_MARK;
-
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-
-	TRAPD(err, MainL());
-	LOG_MSG2("Multi_agent_launcher: returning from MainL(), err = %d", err);
-	
-	delete trap;
-	LOG_MSG("EXIT: Multi_agent_launcher E32Main()");
-	__UHEAP_MARKEND;
-
-	return err;
-	}
-
--- a/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 2009 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:
-//
-// Description:
-// Definitions for agent launcher
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef RMDEBUG_MULTI_AGENT_LAUNCHER_H
-#define RMDEBUG_MULTI_AGENT_LAUNCHER_H
-
-#include <e32test.h>
-
-// Default test runs
-const TInt KNumTestRuns = 1; 
-
-// Default number of targets per agent
-const TInt KNumTargets = 5;
-
-// Default number of agents, if changing this make sure there are enough apps being built 
-const TInt KNumAgents = 2; 
-
-_LIT(KAgentExe,"z:\\sys\\bin\\t_rmdebug_multi_agent.exe");
-_LIT(KAgentOptions,"-n%d -o%d -a%d");
-
-_LIT(KLaunchSemaphoreName, "t_rmdebug_launch_semaphore");
-_LIT(KLaunchSemaphoreSearchString, "t_rmdebug_launch_semaphore*");
-
-#endif // RMDEBUG_MULTI_AGENT_LAUNCHER_H
-
--- a/kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,405 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Test the ability of the debug system to handle events from several debug targets
-//
-//
-
-#include <e32base.h>
-#include <e32property.h>
-
-#include <hal.h>
-#include <e32test.h>
-
-#include "t_multi_target.h"
-#include "t_target_launcher.h"
-#include "t_rmdebug_app.h"
-
-#ifdef KERNEL_OOM_TESTING
-  #ifdef USER_OOM_TESTING
-    #error "Cannot define both KERNEL_OOM_TESTING and USER_OOM_TESTING"
-  #endif
-#endif
-
-
-using namespace Debug;
-
-const TVersion securityServerVersion(0,1,1);
-
-const TVersion testVersion(2,1,0);
-
-#ifdef SYMBIAN_STANDARDDEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG_MULTI_TARGET"));
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG_MULTI_TARGET_OEM"));
-#endif
-
-#ifdef SYMBIAN_OEM2DEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG_MULTI_TARGET_OEM2"));
-#endif
-
-
-
-CMultiTargetAgent* CMultiTargetAgent::NewL()
-//
-// CMultiTargetAgent::NewL
-//
-  {
-  CMultiTargetAgent* self = new(ELeave) CMultiTargetAgent();
-
-  self->ConstructL();
-
-  return self;
-  }
-
-
-CMultiTargetAgent::~CMultiTargetAgent()
-//
-// CMultiTargetAgent destructor
-//
-    {
-    RDebug::Printf("~CMultiTargetAgent\n");
-    iServSession.Close();
-    }
-
-
-CMultiTargetAgent::CMultiTargetAgent() : 
-    iEventPtr( (TUint8*)&iEventInfo, sizeof(TEventInfo) )
-    {
-    }
-
-
-void CMultiTargetAgent::ConstructL()
-//
-// CMultiTargetAgent::ConstructL
-//
-  {
-  }
-
-/**
- * Helper code for the stepping tests. Returns the number of nanokernel ticks in one second.
- *
- * @return Number of nanokernel ticks. 0 if unsuccesful.
- */
-TInt CMultiTargetAgent::HelpTicksPerSecond(void)
-  {
-  TInt nanokernel_tick_period;
-  HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-
-  ASSERT(nanokernel_tick_period != 0);
-
-  static const TInt KOneMillion = 1000000;
-
-  return KOneMillion/nanokernel_tick_period;
-  }
-
-void CMultiTargetAgent::ClientAppL()
-//
-// Performs each test in turn
-//
-  {
-  test.Start(_L("ClientAppL"));
-  TInt err = iServSession.Connect(securityServerVersion);
-  if (err != KErrNone)
-      {
-      User::Panic(_L("Can't open server session"), err);
-      }
-  SetupDebugServerL();
-  LaunchTargetsInOrderL();
-  RDebug::Printf( "returning from CMultiTargetAgent::ClientAppL" );
-  test.End();
-  }
-
-/**
-  Launch a process
-
-  @param aProcess The RProcess object to use to create the process
-  @param aExeName File name of the executable to create the process from
-  @param aCommandLine The command line to pass to the new process
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-TInt CMultiTargetAgent::LaunchProcess(RProcess& aProcess, TDesC & aExeName, TDesC & aCommandLine )
-    {    
-    TInt err = aProcess.Create( aExeName, aCommandLine );    
-    if(err != KErrNone)
-        {
-        RDebug::Printf( "aProcess.Create ret %d", err);
-        return err;
-        }
-
-    TRequestStatus status = KRequestPending;
-    aProcess.Rendezvous(status);
-    if(KRequestPending != status.Int())
-        {
-        // startup failed so kill the process
-        aProcess.Kill(KErrNone);
-        return status.Int();
-        }
-    else
-        {
-        // start up succeeded so resume the process
-        aProcess.Resume();
-        // Give the process a chance to run
-        User::After( 500000 );
-        return KErrNone;
-        }
-    }
-
-void CMultiTargetAgent::SetupDebugServerL()
-    {
-    RDebug::Printf( "CMultiTargetAgent::SetupDebugServerL" );
-    test.Next(_L("SetupDebugServerL\n"));
-    iTargets.ReserveL( KNumApps );
-
-    RBuf targetName;
-    CleanupClosePushL( targetName );
-
-    for( TInt numApps = 0; numApps < KNumApps; numApps++ )
-        {
-        iTargets.AppendL( targetName );
-        RDebug::Printf( "Attach to DSS for app %d ", numApps );
-
-        iTargets[numApps].CreateL( KTargetExe().Length() + 2 );
-        iTargets[numApps].Format( KTargetExe(), numApps+1 );
-
-        TInt ret = iServSession.AttachExecutable( iTargets[numApps], EFalse );
-        test( ret == KErrNone );
-
-        RDebug::Printf( ">SetEventAction app %d,  EEventsStartThread EActionSuspend", numApps );
-        ret = iServSession.SetEventAction( iTargets[numApps], EEventsStartThread, EActionSuspend );
-        test( ret == KErrNone );
-
-        RDebug::Printf( ">SetEventAction app %d,  EEventsAddProcess EActionContinue", numApps );
-        ret = iServSession.SetEventAction( iTargets[numApps], EEventsAddProcess, EActionContinue );
-        test( ret == KErrNone );
-
-        RDebug::Printf( ">SetEventAction app %d,  EEventsRemoveProcess EActionContinue", numApps );
-        ret = iServSession.SetEventAction( iTargets[numApps], EEventsRemoveProcess, EActionContinue );
-        test( ret == KErrNone );
-        }
-
-    CleanupStack::PopAndDestroy( &targetName ); // targetName
-
-    }
-
-
-
-TInt CMultiTargetAgent::LaunchTargetsInOrderL()
-    {
-    RDebug::Printf( "CMultiTargetAgent::LaunchTargetsInOrderL" );
-    
-    RBuf launcher;
-    CleanupClosePushL( launcher );
-    launcher.CreateL( KLauncherExe() );
-    
-    RBuf launcherOptions;
-    CleanupClosePushL( launcherOptions ); 
-    launcherOptions.CreateL( KTargetOptions().Length() + 2 );
-    launcherOptions.Format( KTargetOptions(), (TUint)ENormalExit );
-
-    RDebug::Printf( ">LaunchProcess()" );
-    RProcess launcherProc; 
-    CleanupClosePushL( launcherProc );
-    
-    TInt ret = LaunchProcess( launcherProc, launcher, launcherOptions );
-    RDebug::Printf( "<LaunchProcess() ret %d", ret );
-    
-    CleanupStack::PopAndDestroy( &launcherProc ); // launcherProc
-    CleanupStack::PopAndDestroy( &launcherOptions ); // launcherOptions
-    CleanupStack::PopAndDestroy( &launcher ); //launcher 
-
-    test( ret == KErrNone );
-    
-    RSemaphore launchSemaphore;   
-    CleanupClosePushL( launchSemaphore );
-            
-    TFindSemaphore launchSemFinder( KLaunchMutexNameSearchString );
-    TFullName mutexResult;
-    ret = launchSemFinder.Next(mutexResult);
-    RDebug::Printf( ">  Find Launch Semaphote.Next ret=%d, %lS", ret, &mutexResult );
-    test( ret == KErrNone );   
-     
-    ret = launchSemaphore.OpenGlobal( mutexResult );
-    RDebug::Printf( "> OpenGlobal mutex ret=%d", ret );         
-    test( ret == KErrNone );    
-    
-    TBool thisLaunchCompleted; 
-
-    test.Next(_L("LaunchTargetsInOrderL\n"));
-    for( TInt numLaunches = KNumLaunches; numLaunches > 0; numLaunches-- )
-        {
-        for( TInt numApps = KNumApps; numApps > 0; numApps-- )
-            {
-            thisLaunchCompleted = EFalse;
-            // This will trigger the launcher app to launch the next target
-            RDebug::Printf( " >Mutex.Signal app=%d, launch=%d", numApps, numLaunches);
-            launchSemaphore.Signal();
-            
-            RBuf8 tgt8Name; 
-            CleanupClosePushL( tgt8Name );
-           
-            RBuf tgtCollapseName;
-            CleanupClosePushL( tgtCollapseName );
-                    
-            tgtCollapseName.CreateL( iTargets[numApps-1] );
-            tgt8Name.CreateL( tgtCollapseName.Collapse() );
-            
-
-            while( ! thisLaunchCompleted )
-                {
-                RDebug::Printf( ">GetEvent app %d for %S", numApps, &tgt8Name );
-                iServSession.GetEvent( iTargets[numApps-1], iStatus, iEventPtr );
-          
-                // Wait for the target to get started.
-                RDebug::Printf( " >Wait for event from target app=%d, launch=%d\n", numApps, numLaunches);
-                User::WaitForRequest( iStatus );
-                RDebug::Printf( " <Wait for request returned with status %d", iStatus.Int() );
-                test( iStatus==KErrNone );
-    
-                RDebug::Printf( " > Got iEventType =%d, app=%d", iEventInfo.iEventType, numApps );
-                switch( iEventInfo.iEventType )
-                    {
-                    case EEventsAddProcess:
-                        {
-                        RDebug::Printf( "Got EEventsAddProcess" );                        
-                        TPtrC8 exeNamePtr8( iEventInfo.iAddProcessInfo.iFileName, iEventInfo.iAddProcessInfo.iFileNameLength );
-                        
-                        RBuf8 exeName8;
-                        CleanupClosePushL( exeName8 );
-                        exeName8.CreateL( exeNamePtr8 );
-                        RDebug::Printf( " from event: exeName8=%S", &exeName8 );
-                        CleanupStack::PopAndDestroy( &exeName8 );
-                        
-                        RBuf8 compareName8;
-                        CleanupClosePushL( compareName8 );
-                        compareName8.CreateL( KTargetExeName().Length() + 10 );
-                        compareName8.Format( KTargetExeName(), numApps );
-                        RDebug::Printf( " comparing to: compareName8=%S", &compareName8 );
-                        
-                        test( compareName8.CompareC( exeNamePtr8 ) == 0 );
-                        CleanupStack::PopAndDestroy( &compareName8 );
-
-                        RDebug::Printf( "Testing if event process id is valid" );
-                        test( iEventInfo.iProcessIdValid );
-                        RDebug::Printf( "Got iEventInfo.iProcessId=%d", I64LOW( iEventInfo.iProcessId ) );
-                        
-                        RProcess targetProc;
-                        ret = targetProc.Open( TProcessId( iEventInfo.iProcessId ) );
-                        RDebug::Printf( "RProcess open ret=%d",ret );
-                        targetProc.Close();
-                        test( ret == KErrNone );
-                        
-                        break;
-                        }//EEventsAddProcess
-                        
-                    case EEventsStartThread:
-                        {
-                        RDebug::Printf( "Got EEventsStartThread" );
-                         
-                        TPtrC8 exeNamePtr8( iEventInfo.iStartThreadInfo.iFileName, iEventInfo.iStartThreadInfo.iFileNameLength );
-                        RBuf8 exe8Name;
-                        CleanupClosePushL( exe8Name );
-                        exe8Name.CreateL( exeNamePtr8 );
-                        RDebug::Printf( " from event: exeName8=%S", &exe8Name );
-                        CleanupStack::PopAndDestroy( &exe8Name );
-                        
-                        test( tgt8Name.CompareC( exeNamePtr8 ) == 0 );
-                        
-                        RDebug::Printf( "Testing if event process id is valid" );
-                        test( iEventInfo.iProcessIdValid );
-                        RDebug::Printf( "Got iEventInfo.iProcessId=%d", I64LOW( iEventInfo.iProcessId ) );
-                         
-                        RDebug::Printf( "Testing if event thread id is valid" );
-                        test( iEventInfo.iThreadIdValid );
-                        RDebug::Printf( "Got iEventInfo.iThreadId=%d", I64LOW( iEventInfo.iThreadId ) );
-                        
-                        RThread targetThread;
-                        CleanupClosePushL( targetThread );
-                        
-                        ret = targetThread.Open( TThreadId( iEventInfo.iThreadId ) );
-                        RDebug::Printf( "RThread open ret=%d", ret );
-                        test( ret == KErrNone ); 
-                         
-                        test( iEventInfo.iThreadId == targetThread.Id() );  
-
-                        RDebug::Printf( "Resuming thread for app=%d, id=%d", numApps, I64LOW( targetThread.Id() ));
-                        ret = iServSession.ResumeThread( iEventInfo.iThreadId );
-                        CleanupStack::PopAndDestroy( &targetThread );
-                        
-                        test( ret == KErrNone );
-                        
-                        ret = iServSession.ResumeThread( iEventInfo.iThreadId );
-                        break;                    
-                        }//case EEventsStartThread                        
-
-                    case ( EEventsRemoveProcess ):
-                        {
-                        RDebug::Printf( "*** Got EEventsRemoveProcess. app%d has exited. Moving on to next app", numApps );                        
-                        thisLaunchCompleted = ETrue;
-                        break;
-                        }
-                        
-                    default :   
-                        RDebug::Printf( "Got unknown event" );
-                        test( EFalse );
-                        break;
-                    }
-                }//while
-
-            CleanupStack::PopAndDestroy( &tgtCollapseName ); // tgtCollapseName
-            CleanupStack::PopAndDestroy( &tgt8Name ); // tgt8Name 
-            }
-        }    
-
-    launchSemaphore.Signal();
-    
-	CleanupStack::PopAndDestroy( &launchSemaphore ); // launchSemaphore
-  
-	for( TInt i = iTargets.Count()-1; i>=0; i-- )
-		{
-		RDebug::Printf( "Closing target %d", i );
-		iTargets[ i ].Close();
-		}
-
-	iTargets.Close();
-	
-	return KErrNone;
-    }
-
-
-GLDEF_C TInt E32Main()
-    {
-    TInt ret = KErrNone;
-   
-  
-    CTrapCleanup* trap = CTrapCleanup::New();
-    if (!trap)
-      return KErrNoMemory;
-    test.Title();
-   
-    CMultiTargetAgent *runModeAgent = CMultiTargetAgent::NewL();
-    if (runModeAgent != NULL)
-        {
-        __UHEAP_MARK;
-        TRAP(ret,runModeAgent->ClientAppL());
-        __UHEAP_MARKEND;
-        
-        RDebug::Printf( "ClientAppL returned %d", ret );
-        delete runModeAgent;
-        }
-
-    delete trap;
-    return ret;
-    }
--- a/kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.h	Wed Aug 18 11:08:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-// Copyright (c) 2006-2009 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:
-//
-// Description:
-// Definitions for the run mode debug tests
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef RMDEBUG_MULTI_TARGET_H
-#define RMDEBUG_MULTI_TARGET_H
-
-#include "t_rmdebug_app.h"
-
-#include <rm_debug_api.h>
-
-class CMultiTargetAgent;
-
-//
-// class CRunModeAgent
-//
-// The basic run mode agent.
-//
-class CMultiTargetAgent : public CBase
-	{
-public:
-	static CMultiTargetAgent* NewL();
-	~CMultiTargetAgent();
-	void ClientAppL();
-	
-    TInt LaunchProcess(RProcess& aProcess, TDesC & aExeName, TDesC & aCommandLine );
-    
-private:
-	CMultiTargetAgent();
-	void ConstructL();
-
-	void ReportPerformance(void);
-
-	TInt HelpTicksPerSecond(void);
-
-	enum TTestMode 
-		{
-		//run all the tests
-		EModeAll = 1<<0,
-		//run the specified tests in reverse order
-		EModeReverse = 1<<1,
-		//print out help
-		EModeHelp = 1<<2,
-		//print out help
-		EModeVersion = 1<<3
-		};
-	
-	TInt LaunchTargetsInOrderL();
-	void SetupDebugServerL();
-
-private:
-
-#if defined(KERNEL_OOM_TESTING)
-	RKernelLowMemorySecuritySvrSession iServSession;
-#elif defined (USER_OOM_TESTING)
-	RUserLowMemorySecuritySvrSession iServSession;
-#else
-	Debug::RSecuritySvrSession iServSession;
-#endif
-	RSemaphore iAddressGlobSem;
-
-	TUid iMySid;
-
-	// Timing information
-	TInt iStartTick;
-	TInt iStopTick;
-
-	RArray<RBuf> iTargets;
-  TRequestStatus iStatus;
-  Debug::TEventInfo iEventInfo;
-  TPtr8 iEventPtr;
-	};
-
-#endif // RMDEBUG_MULTI_TARGET_H
--- a/kerneltest/e32test/smpsoak/t_smpsoak.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/smpsoak/t_smpsoak.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -120,7 +120,7 @@
 const TDesC* CSMPSoakThread::KDeviceTable[] =
     {
     &KDevices, &KDevLdd1, &KDevLdd1Name, &KDevLdd2, &KDevLdd2Name, &KDevLdd3, &KDevLdd3Name,
-    &KDevLdd4, &KDevLdd4Name, &KDevLdd5, &KDevLdd5Name, NULL
+    &KDevLdd4, &KDevLdd4Name, NULL
     };
 
 //Constructor
@@ -412,6 +412,7 @@
 TInt CSMPSoakThread::DoSMPStressMemoryThread()
 	{
 	RTest test(_L("SMPStressMemoryThread"));
+	test.Start(_L("SMPStressMemoryThread"));
 	
 	TMemory *memoryTablePtr;
 	TChunkInfo chunkTable[KNumChunks];
@@ -477,6 +478,8 @@
 			}
 		User::After(gPeriod);
 		}
+	test.End();
+	test.Close();
 	return 0x00;
 	}
 //Device Thread : will do device associated operation
@@ -491,6 +494,7 @@
 TInt CSMPSoakThread::DoSMPStressDeviceThread()
 	{
 	RTest test(_L("SMPStressDeviceThread"));
+	test.Start(_L("SMPStressDeviceThread"));
 	
 	RTimer timer;
 	RFs session;
@@ -539,7 +543,11 @@
 			RDevice device;
 
 			TInt r = User::LoadLogicalDevice(*ptrDevices[i]);
-			test(r == KErrNone || r == KErrAlreadyExists);
+			if (r != KErrNone && r != KErrAlreadyExists)
+				{
+				test.Printf(_L("LDD %S not present\n"), ptrDevices[i]);
+				continue;
+				}
 
 			test_KErrNone(device.Open(*ptrDevices[i+1]));
 
@@ -562,6 +570,8 @@
 		}
 	timer.Close();
 	PRINT((_L("SMPStressDeviceThread MyTimer.Cancel() called\n")));
+	test.End();
+	test.Close();
 	return 0x00;
 	}
 //Spin Thread : will do thread sync 
@@ -576,6 +586,7 @@
 TInt CSMPSoakThread::DoSMPStressSpinThread()
 	{
 	RTest test(_L("SMPStressSpinThread"));
+	test.Start(_L("SMPStressSpinThread"));
 
 	TTime startTime;
 	TTime endTime;
@@ -596,6 +607,8 @@
 			break;
 		User::After(gPeriod);
 		}
+	test.End();
+	test.Close();
 	return 0x00;
 	}
 //Timer Thread : Timer operation and  thread sync 
@@ -610,6 +623,7 @@
 TInt CSMPSoakThread::DoSMPStressTimerThread()
 	{
 	RTest test(_L("SMPStressTimerThread"));
+	test.Start(_L("SMPStressTimerThread"));
 
 	PRINT (_L("SMPStressTimerThread\n"));
 	RTimer timer;
@@ -630,6 +644,8 @@
 		}
 	timer.Cancel();
 	PRINT((_L("SMPStressTimerThread MyTimer.Cancel() called\n")));
+	test.End();
+	test.Close();
 	return 0x00;
 	}
 // CActive class to monitor KeyStrokes from User
--- a/kerneltest/e32test/smpsoak/t_smpsoak.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/smpsoak/t_smpsoak.h	Thu Sep 02 21:54:16 2010 +0300
@@ -136,8 +136,6 @@
 _LIT(KDevLdd3Name,"Ethernet");
 _LIT(KDevLdd4,"esoundsc.ldd");
 _LIT(KDevLdd4Name,"SoundSc");
-_LIT(KDevLdd5,"eusbc.ldd");
-_LIT(KDevLdd5Name, "Usbc");
 
 //Thread data for each thread
 struct	TThreadData
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,251 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_NORMAL=0x86
+[GROUP]TRACE_VERBOSE=0xde
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING=0x85
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP01=0x86
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP02=0x87
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP03=0x88
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP04=0x89
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP05=0x8a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP06=0x8b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA=0x7a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP01=0x7b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP02=0x7c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP03=0x7d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP04=0x7e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP05=0x7f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP06=0x80
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL=0x5
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP01=0x6
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP02=0x7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP03=0x8
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP04=0x9
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP05=0xa
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP06=0xb
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP07=0xc
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP08=0xd
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP09=0xe
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP10=0xf
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP11=0x10
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP01=0x16
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP02=0x17
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP03=0x18
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP04=0x19
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP05=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP06=0x1b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING=0x8c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP01=0x8d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP02=0x8e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP03=0x8f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA=0x81
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP01=0x82
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP02=0x83
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP03=0x84
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL=0x3e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP01=0x3f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP02=0x40
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP03=0x41
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP04=0x42
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP05=0x43
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP06=0x44
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP07=0x45
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP08=0x46
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP09=0x47
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP10=0x48
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP11=0x49
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP12=0x4a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP13=0x4b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP14=0x4c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP15=0x4d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP16=0x4e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP17=0x4f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP18=0x50
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP19=0x51
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP20=0x52
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP21=0x53
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP22=0x54
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP23=0x55
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP24=0x56
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP25=0x57
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP26=0x58
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP27=0x59
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP28=0x5a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP29=0x5b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP30=0x5c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP31=0x5d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP32=0x5e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP33=0x5f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP35=0x60
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYRXBUFFER=0x61
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYRXBUFFER_DUP01=0x62
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL=0x63
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP01=0x64
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP02=0x65
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP03=0x66
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP04=0x67
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP05=0x68
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP06=0x69
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP07=0x6a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP08=0x6b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP09=0x6c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP10=0x6d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP11=0x6e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP12=0x6f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP13=0x70
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP14=0x71
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP15=0x72
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP16=0x73
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP17=0x74
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP18=0x75
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP19=0x76
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP20=0x77
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP21=0x78
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP22=0x79
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE=0x90
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP01=0x91
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP02=0x92
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP03=0x93
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP04=0x94
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP05=0x95
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP06=0x96
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP07=0x97
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP08=0x98
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP09=0x99
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER=0x1c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP01=0x1d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP02=0x1e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP03=0x1f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP04=0x20
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP05=0x21
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP06=0x22
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP07=0x23
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP08=0x24
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP09=0x25
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP10=0x26
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP11=0x27
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP12=0x28
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP13=0x29
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP14=0x2a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP15=0x2b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP16=0x2c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP17=0x2d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP18=0x2e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP19=0x2f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP20=0x30
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP21=0x31
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP22=0x32
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP23=0x33
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP24=0x34
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP25=0x35
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP26=0x36
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP27=0x37
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP28=0x38
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP29=0x39
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP30=0x3a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP31=0x3b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP32=0x3c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP33=0x3d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPDESCRIPTORS=0x9a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPDESCRIPTORS_DUP01=0x9b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE=0x11
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP01=0x12
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP02=0x13
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP03=0x14
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP04=0x15
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0xc7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0xc8
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0xc9
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0xca
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0xcb
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0xcc
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0xcd
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0xce
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0xcf
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_CONSTRUCTL_DUP01=0x9c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP01=0xb1
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP02=0xb2
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP03=0xb3
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP04=0xb4
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK=0xc3
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK_DUP02=0xc4
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK=0xbd
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP01=0xbe
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP02=0xbf
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP03=0xc0
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP04=0xc1
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP01=0xa6
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP02=0xa7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP04=0xa8
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP05=0xa9
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP06=0xaa
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP07=0xab
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP08=0xac
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP09=0xad
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP10=0xae
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP11=0xaf
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP12=0xb0
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x9e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP02=0x9f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP03=0xa0
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP05=0xa1
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP06=0xa2
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP07=0xa3
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE=0xb5
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP01=0xb6
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP02=0xb7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP03=0xb8
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP04=0xb9
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP05=0xba
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP06=0xbb
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP07=0xbc
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SENDVERSION_DUP01=0xa4
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SENDVERSION_DUP02=0xa5
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SETMAXBUFSIZE=0x9d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP=0xc5
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP_DUP01=0xc6
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_WRITEBUFFERTODISK_DUP01=0xc2
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x2
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x3
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0x4
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL=0x1
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_DCACTIVECONSOLE=0x1
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_DOCANCEL=0x2
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP34=0x4
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_RUNL=0x3
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0x25
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0x26
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CACTIVERW=0x5
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS=0x1f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS_DUP01=0x20
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS_DUP02=0x21
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CONSTRUCTL=0x6
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DCACTIVERW=0x7
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DOCANCEL=0x1e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_EXCHANGEVERSIONS=0x11
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READBUFFERFROMDISK_DUP01=0x17
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA=0x18
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP01=0x19
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP02=0x1a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP03=0x1b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP04=0x1c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP05=0x1d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION=0xd
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION_DUP03=0xe
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION_DUP13=0xf
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION_DUP14=0x10
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL=0x8
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP04=0x9
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA=0x14
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA_DUP01=0x15
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDPREAMBLE=0x12
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDPREAMBLE_DUP01=0x13
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDVERSION=0xa
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDVERSION_DUP03=0xb
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDVERSION_DUP04=0xc
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_WRITEBUFFERTODISK=0x16
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x22
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DOCANCEL=0x23
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_RUNL=0x24
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DCACTIVETIMER=0x27
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DOCANCEL=0x28
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_RUNL=0x29
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_device/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_device/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,321 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_ERROR=0x82
+[GROUP]TRACE_NORMAL=0x86
+[GROUP]TRACE_VERBOSE=0xde
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READBUFFERFROMDISK=0xc
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP02=0x8
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP04=0x9
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP06=0xa
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS=0x1
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP02=0x2
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP04=0x3
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP05=0x4
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP07=0x5
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP09=0x6
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITEBUFFERTODISK_DUP01=0xb
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITETODISK_DUP01=0x7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING=0x41
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP01=0x42
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP02=0x43
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP03=0x44
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP04=0x45
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP05=0x46
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP06=0x47
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA=0x36
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP01=0x37
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP02=0x38
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP03=0x39
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP04=0x3a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP05=0x3b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP06=0x3c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP05=0x58
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTL_DUP04=0x1
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL=0x7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL_DUP01=0x8
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING=0x48
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP01=0x49
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP02=0x4a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP03=0x4b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA=0x3d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP01=0x3e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP02=0x3f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP03=0x40
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP02=0x28
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP04=0x29
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP05=0xd
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP07=0xe
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP08=0xf
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP11=0x10
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP12=0x11
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP13=0x12
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP14=0x13
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP15=0x14
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP17=0x15
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP18=0x16
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP20=0x17
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP22=0x18
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP23=0x19
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP24=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP25=0x1b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP26=0x1c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP27=0x1d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP28=0x1e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP29=0x1f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP30=0x20
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP31=0x21
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP32=0x22
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP33=0x23
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP36=0x24
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP37=0x25
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP38=0x26
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP39=0x27
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL=0x2a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP01=0x2b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP02=0x2c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP03=0x2d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP04=0x2e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP05=0x2f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP06=0x30
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP07=0x31
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP08=0x32
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP09=0x33
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP10=0x34
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP11=0x35
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE=0x4c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP01=0x4d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP02=0x4e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP03=0x4f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP04=0x50
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP05=0x51
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP06=0x52
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP07=0x53
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP08=0x54
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP09=0x55
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP01=0x9
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP02=0xa
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP03=0xb
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP04=0xc
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE=0x2
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP01=0x3
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP02=0x4
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP03=0x5
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP04=0x6
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP01=0x56
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP02=0x57
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0x59
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0x5a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0x5b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0x5c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0x5d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0x5e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0x5f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0x60
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09=0x61
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP10=0x62
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP01=0x72
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP02=0x73
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP03=0x74
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP04=0x75
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP05=0x76
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP06=0x77
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP07=0x78
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_CONSTRUCTL_DUP01=0x63
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER=0x67
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP01=0x68
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP03=0x69
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK_DUP02=0x6f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK=0x6b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP01=0x6c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP03=0x6d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP05=0x6e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x64
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP02=0x65
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP08=0x66
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP=0x70
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP_DUP01=0x71
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_WRITETODISK=0x6a
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL=0xb0
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP01=0xb1
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP02=0xb2
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP03=0xb3
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS=0x8e
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP01=0x8f
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP02=0x90
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP03=0x91
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP04=0x92
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP05=0x93
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP07=0x94
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP08=0x95
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP09=0x96
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP11=0x97
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP12=0x98
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP13=0x99
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP14=0x9a
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP16=0x9b
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP18=0x9c
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP19=0x9d
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP20=0x9e
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP22=0x9f
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP24=0xa0
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL=0xbe
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP01=0xbf
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP02=0xc0
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP03=0xc1
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP04=0xc2
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP05=0xc3
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP06=0xc4
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP07=0xc5
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP08=0xc6
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP09=0xc7
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS=0xb4
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP01=0xb5
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP02=0xb6
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP03=0xb7
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0xac
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0xad
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0xae
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP03=0xaf
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS=0xb8
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP01=0xb9
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP02=0xba
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP03=0xbb
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE=0xa6
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01=0xa7
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02=0xa8
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03=0xa9
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04=0xaa
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP05=0xab
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS=0xca
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP01=0xcb
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP02=0xcc
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP03=0xcd
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP04=0xce
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP05=0xcf
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP06=0xd0
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP07=0xd1
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP08=0xd2
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP09=0xd3
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP10=0xd4
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP11=0xd5
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP14=0xd6
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_MEDIAERROR=0xd7
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED=0xc8
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED_DUP01=0xc9
+[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT=0xbc
+[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT_DUP01=0xbd
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL=0xa1
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP01=0xa2
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP02=0xa3
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP03=0xa4
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP04=0xa5
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x89
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES=0x8c
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01=0x8d
+[TRACE]TRACE_NORMAL[0x86]_TESTINTERFACEDESCRIPTOR_TESTINTERFACEDESCRIPTOR=0x79
+[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS=0x8a
+[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01=0x8b
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x7a
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x7b
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x7c
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x7d
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x7e
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x7f
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x80
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x81
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x82
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x83
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x84
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x85
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x86
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x87
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x88
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL=0x1
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD=0x22
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP01=0x23
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP02=0x24
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP03=0x25
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP04=0x26
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP06=0x27
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP07=0x28
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP08=0x29
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP01=0x2
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP02=0x3
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP03=0x4
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP05=0x5
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP06=0x6
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP07=0x7
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_DOCANCEL=0xd
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG=0x1e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP01=0x1f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP03=0x20
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET=0x11
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP01=0x12
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP02=0x13
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP03=0x14
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP04=0x15
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP06=0x16
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP09=0x17
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP10=0x18
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP16=0x19
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP19=0x1a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP21=0x1b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP34=0x1c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP35=0x1d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT=0x8
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP01=0x9
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP02=0xa
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP03=0xb
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP04=0xc
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET=0xe
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET_DUP01=0xf
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RUNL=0x10
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE=0x21
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0x2a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0x2b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0x2c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP11=0x2d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CACTIVERW=0x2e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS=0x4b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CONSTRUCTL=0x2f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DCACTIVERW=0x30
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DOCANCEL=0x4a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_PROCESSREADXFER_DUP02=0x41
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READBUFFERFROMDISK_DUP01=0x45
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA=0x46
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP01=0x47
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP02=0x48
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP03=0x49
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RESUME=0x37
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL=0x3b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP03=0x3c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP04=0x3d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP05=0x3e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP06=0x3f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP07=0x40
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA=0x42
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA_DUP01=0x43
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP01=0x31
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP03=0x32
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP06=0x33
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP08=0x34
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND=0x39
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND_DUP01=0x3a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND=0x35
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND_DUP01=0x36
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_TESTCOMPLETE=0x4c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_WRITEBUFFERTODISK=0x44
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_YIELD=0x38
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x4d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DOCANCEL=0x4e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_RUNL=0x4f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DCACTIVETIMER=0x50
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DOCANCEL=0x51
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_RUNL=0x52
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP06=0x53
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP10=0x54
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP15=0x55
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP17=0x56
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP21=0x57
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP23=0x58
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP25=0x59
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP26=0x5a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_scdevice/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_scdevice/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,326 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_ERROR=0x82
+[GROUP]TRACE_NORMAL=0x86
+[GROUP]TRACE_VERBOSE=0xde
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READBUFFERFROMDISK=0xc
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP02=0x8
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP04=0x9
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP06=0xa
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS=0x1
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP02=0x2
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP04=0x3
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP05=0x4
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP07=0x5
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP09=0x6
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITEBUFFERTODISK_DUP01=0xb
+[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITETODISK_DUP01=0x7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING=0x41
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP01=0x42
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP02=0x43
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP03=0x44
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP04=0x45
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP05=0x46
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP06=0x47
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA=0x36
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP01=0x37
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP02=0x38
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP03=0x39
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP04=0x3a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP05=0x3b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP06=0x3c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP05=0x58
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTL_DUP04=0x1
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL=0x7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL_DUP01=0x8
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING=0x48
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP01=0x49
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP02=0x4a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP03=0x4b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA=0x3d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP01=0x3e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP02=0x3f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP03=0x40
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP02=0x28
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP04=0x29
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP05=0xd
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP07=0xe
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP08=0xf
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP11=0x10
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP12=0x11
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP13=0x12
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP14=0x13
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP15=0x14
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP17=0x15
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP18=0x16
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP20=0x17
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP22=0x18
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP23=0x19
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP24=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP25=0x1b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP26=0x1c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP27=0x1d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP28=0x1e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP29=0x1f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP30=0x20
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP31=0x21
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP32=0x22
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP33=0x23
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP36=0x24
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP37=0x25
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP38=0x26
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP39=0x27
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL=0x2a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP01=0x2b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP02=0x2c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP03=0x2d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP04=0x2e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP05=0x2f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP06=0x30
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP07=0x31
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP08=0x32
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP09=0x33
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP10=0x34
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP11=0x35
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE=0x4c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP01=0x4d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP02=0x4e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP03=0x4f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP04=0x50
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP05=0x51
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP06=0x52
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP07=0x53
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP08=0x54
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP09=0x55
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP01=0x9
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP02=0xa
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP03=0xb
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP04=0xc
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE=0x2
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP01=0x3
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP02=0x4
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP03=0x5
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP04=0x6
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP01=0x56
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP02=0x57
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0x59
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0x5a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0x5b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0x5c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0x5d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0x5e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0x5f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0x60
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09=0x61
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP10=0x62
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP01=0x72
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP02=0x73
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP03=0x74
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP04=0x75
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP05=0x76
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP06=0x77
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP07=0x78
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_CONSTRUCTL_DUP01=0x63
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER=0x67
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP01=0x68
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP03=0x69
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK_DUP02=0x6f
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK=0x6b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP01=0x6c
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP03=0x6d
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP05=0x6e
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x64
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP02=0x65
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP08=0x66
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP=0x70
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP_DUP01=0x71
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_WRITETODISK=0x6a
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL=0xb5
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP01=0xb6
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP02=0xb7
+[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP03=0xb8
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS=0x8e
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP01=0x8f
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP02=0x90
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP03=0x91
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP04=0x92
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP05=0x93
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP07=0x94
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP08=0x95
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP09=0x96
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP11=0x97
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP12=0x98
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP13=0x99
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP14=0x9a
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP16=0x9b
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP18=0x9c
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP19=0x9d
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP20=0x9e
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP22=0x9f
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP24=0xa0
+[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESERVER_DCTRANHANDLESERVER=0xb1
+[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESERVER_NEWL=0xb0
+[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESERVER_NEWSESSIONL=0xb2
+[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESESSION_DCTRANHANDLESESSION=0xb3
+[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESESSION_SERVICEL=0xb4
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL=0xc3
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP01=0xc4
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP02=0xc5
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP03=0xc6
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP04=0xc7
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP05=0xc8
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP06=0xc9
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP07=0xca
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP08=0xcb
+[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP09=0xcc
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS=0xb9
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP01=0xba
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP02=0xbb
+[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP03=0xbc
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0xac
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0xad
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0xae
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP03=0xaf
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS=0xbd
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP01=0xbe
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP02=0xbf
+[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP03=0xc0
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE=0xa6
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01=0xa7
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02=0xa8
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03=0xa9
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04=0xaa
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP05=0xab
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS=0xcf
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP01=0xd0
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP02=0xd1
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP03=0xd2
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP04=0xd3
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP05=0xd4
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP06=0xd5
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP07=0xd6
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP08=0xd7
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP09=0xd8
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP10=0xd9
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP11=0xda
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP14=0xdb
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_MEDIAERROR=0xdc
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED=0xcd
+[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED_DUP01=0xce
+[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT=0xc1
+[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT_DUP01=0xc2
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL=0xa1
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP01=0xa2
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP02=0xa3
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP03=0xa4
+[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP04=0xa5
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x89
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES=0x8c
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01=0x8d
+[TRACE]TRACE_NORMAL[0x86]_TESTINTERFACEDESCRIPTOR_TESTINTERFACEDESCRIPTOR=0x79
+[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS=0x8a
+[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01=0x8b
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x7a
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x7b
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x7c
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x7d
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x7e
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x7f
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x80
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x81
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x82
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x83
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x84
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x85
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x86
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x87
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x88
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL=0x1
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD=0x22
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP01=0x23
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP02=0x24
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP03=0x25
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP04=0x26
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP06=0x27
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP07=0x28
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP08=0x29
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP01=0x2
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP02=0x3
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP03=0x4
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP05=0x5
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP06=0x6
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP07=0x7
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_DOCANCEL=0xd
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG=0x1e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP01=0x1f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP03=0x20
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET=0x11
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP01=0x12
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP02=0x13
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP03=0x14
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP04=0x15
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP06=0x16
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP09=0x17
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP10=0x18
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP16=0x19
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP19=0x1a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP21=0x1b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP34=0x1c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP35=0x1d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT=0x8
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP01=0x9
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP02=0xa
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP03=0xb
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP04=0xc
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET=0xe
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET_DUP01=0xf
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RUNL=0x10
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE=0x21
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0x2a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0x2b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0x2c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP11=0x2d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CACTIVERW=0x2e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS=0x4b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CONSTRUCTL=0x2f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DCACTIVERW=0x30
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DOCANCEL=0x4a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_PROCESSREADXFER_DUP02=0x41
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READBUFFERFROMDISK_DUP01=0x45
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA=0x46
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP01=0x47
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP02=0x48
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP03=0x49
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RESUME=0x37
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL=0x3b
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP03=0x3c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP04=0x3d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP05=0x3e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP06=0x3f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP07=0x40
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA=0x42
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA_DUP01=0x43
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP01=0x31
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP03=0x32
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP06=0x33
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP08=0x34
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND=0x39
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND_DUP01=0x3a
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND=0x35
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND_DUP01=0x36
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_TESTCOMPLETE=0x4c
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_WRITEBUFFERTODISK=0x44
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_YIELD=0x38
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x4d
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DOCANCEL=0x4e
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_RUNL=0x4f
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DCACTIVETIMER=0x50
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DOCANCEL=0x51
+[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_RUNL=0x52
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP06=0x53
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP10=0x54
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP15=0x55
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP17=0x56
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP21=0x57
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP23=0x58
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP25=0x59
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP26=0x5a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_transfersrv/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_transfersrv/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,74 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_NORMAL=0x86
+[GROUP]TRACE_VERBOSE=0xde
+[TRACE]TRACE_FATAL[0x81]_CTRANSFERHANDLE_RUNL=0x1
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS=0x1
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP01=0x2
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP02=0x3
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP03=0x4
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP04=0x5
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP05=0x6
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP07=0x7
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP08=0x8
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP09=0x9
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP11=0xa
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP12=0xb
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP13=0xc
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP14=0xd
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP16=0xe
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP18=0xf
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP19=0x10
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP20=0x11
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP22=0x12
+[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP24=0x13
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERHANDLE_DCTRANSFERHANDLE=0x14
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERHANDLE_DOCANCEL=0x15
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_CONSTRUCTL=0x19
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DCTRANSFERSERVER=0x17
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DCTRANSFERSERVER_DUP01=0x18
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DECREMENTSESSIONCOUNT=0x1c
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DECREMENTSESSIONCOUNT_DUP01=0x1d
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_ERROR=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_INCREMENTSESSIONCOUNT=0x1b
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS=0x1e
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS_DUP01=0x1f
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_NEWLC=0x16
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL=0x2c
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP01=0x2d
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP02=0x2e
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP03=0x2f
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP04=0x30
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP05=0x31
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP06=0x32
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP07=0x33
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP08=0x34
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP09=0x35
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP10=0x36
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP11=0x37
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPINTERFACE=0x20
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPINTERFACE_DUP01=0x21
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS=0x22
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP01=0x23
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP02=0x24
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP03=0x25
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP04=0x26
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP05=0x27
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP06=0x28
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP07=0x29
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP08=0x2a
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP09=0x2b
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSESSION_DCTRANSFERSESSION=0x38
+[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSESSION_DCTRANSFERSESSION_DUP01=0x39
+[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL=0x3a
+[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL_DUP01=0x3b
+[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL_DUP02=0x3c
+[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL_DUP03=0x3d
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP06=0x1
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP10=0x2
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP15=0x3
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP17=0x4
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP21=0x5
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP23=0x6
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP25=0x7
+[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP26=0x8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_transfersrvclient/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usb_transfersrvclient/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,14 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT=0x7
+[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP01=0x8
+[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP02=0x9
+[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP03=0xa
+[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP04=0xb
+[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_SETCONFIGFILENAME=0xc
+[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER=0x1
+[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP01=0x2
+[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP02=0x3
+[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP03=0x4
+[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP04=0x5
+[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP05=0x6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usbapi/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usbapi/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,85 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_NORMAL[0x86]_OPENCHANNEL_OPENCHANNEL=0x2
+[TRACE]TRACE_NORMAL[0x86]_QUERYENDPOINTSTATE_QUERYENDPOINTSTATE=0x1
+[TRACE]TRACE_NORMAL[0x86]_RUNTESTS_RUNTESTS=0x52
+[TRACE]TRACE_NORMAL[0x86]_RUNTESTS_RUNTESTS_DUP01=0x53
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE=0x7
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP01=0x8
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP02=0x9
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP03=0xa
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP04=0xb
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP05=0xc
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP06=0xd
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP07=0xe
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP08=0xf
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP09=0x10
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP10=0x11
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP11=0x12
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP12=0x13
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP13=0x14
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP14=0x15
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP15=0x16
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP16=0x17
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP17=0x18
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP18=0x19
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP19=0x1a
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP20=0x1b
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP21=0x1c
+[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP22=0x1d
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY=0x43
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01=0x44
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02=0x45
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03=0x46
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04=0x47
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05=0x48
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06=0x49
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07=0x4a
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08=0x4b
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09=0x4c
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION=0x20
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP01=0x21
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP02=0x22
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP03=0x23
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP04=0x24
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP05=0x25
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP06=0x26
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP07=0x27
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP08=0x28
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP09=0x29
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP10=0x2a
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x3c
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01=0x3d
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02=0x3e
+[TRACE]TRACE_NORMAL[0x86]_TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR=0x1e
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES=0x41
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01=0x42
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTDESCRIPTOR_TESTENDPOINTDESCRIPTOR=0x2b
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS=0x4f
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP01=0x50
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP02=0x51
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY=0x4d
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01=0x4e
+[TRACE]TRACE_NORMAL[0x86]_TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR=0x2c
+[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS=0x3f
+[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01=0x40
+[TRACE]TRACE_NORMAL[0x86]_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR=0x1f
+[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1=0x3
+[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP01=0x4
+[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP02=0x5
+[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP03=0x6
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x2d
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x2e
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x2f
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x30
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x31
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x32
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x33
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x34
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x35
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x36
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x37
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x38
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x39
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x3a
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x3b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usbcsc/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/traces_t_usbcsc/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,243 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD=0xc1
+[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP01=0xc2
+[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP02=0xc3
+[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP03=0xc4
+[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP04=0xc5
+[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP05=0xc6
+[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP06=0xc7
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE=0xb5
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP01=0xb6
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP02=0xb7
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP03=0xb8
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP04=0xb9
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP05=0xba
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP06=0xbb
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP07=0xbc
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP08=0xbd
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP09=0xbe
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP10=0xbf
+[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP11=0xc0
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DOCANCEL=0x8
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_GETCHARACTER=0x7
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_RUNL=0x9
+[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_RUNL_DUP01=0xa
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_CACTIVEDEVICESTATENOTIFIER=0xb
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0xc
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0xd
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0xe
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0xf
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0x10
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0x11
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0x12
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0x13
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0x14
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0x15
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0x16
+[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09=0x17
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_DCACTIVERW=0x23
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_DOCANCEL=0x24
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_QUEUEREQUESTS=0x21
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL=0x38
+[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x39
+[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_CACTIVESTALLNOTIFIER=0x18
+[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x19
+[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_DOCANCEL=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_RUNL=0x1b
+[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_RUNL_DUP01=0x1c
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES=0x5c
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP01=0x5d
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP02=0x5e
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP03=0x5f
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP04=0x60
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP05=0x61
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP06=0x62
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP07=0x63
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP08=0x64
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP09=0x65
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP10=0x66
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP11=0x67
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP12=0x68
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP13=0x69
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP14=0x6a
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP15=0x6b
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP16=0x6c
+[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP17=0x6d
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0xf0
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0xf1
+[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGONE_INVALIDSETTINGONE=0x78
+[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGTHREE_INVALIDSETTINGTHREE=0x7a
+[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGTHREE_INVALIDSETTINGTHREE_DUP01=0x7b
+[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGTWO_INVALIDSETTINGTWO=0x79
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE=0xeb
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01=0xec
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02=0xed
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03=0xee
+[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04=0xef
+[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS=0xa1
+[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP01=0xa2
+[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP02=0xa3
+[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP03=0xa4
+[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP04=0xa5
+[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP05=0xa6
+[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP06=0xa7
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT=0xac
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP01=0xad
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP02=0xae
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP03=0xaf
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP04=0xb0
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP05=0xb1
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP06=0xb2
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP07=0xb3
+[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP08=0xb4
+[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS=0xa8
+[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP01=0xa9
+[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP02=0xaa
+[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP03=0xab
+[TRACE]TRACE_NORMAL[0x86]_QUERYENDPOINTSTATE_QUERYENDPOINTSTATE=0x92
+[TRACE]TRACE_NORMAL[0x86]_SETTINGFIVE_SETTINGFIVE=0x76
+[TRACE]TRACE_NORMAL[0x86]_SETTINGFIVE_SETTINGFIVE_DUP01=0x77
+[TRACE]TRACE_NORMAL[0x86]_SETTINGFOUROUT_SETTINGFOUROUT=0x74
+[TRACE]TRACE_NORMAL[0x86]_SETTINGFOUROUT_SETTINGFOUROUT_DUP01=0x75
+[TRACE]TRACE_NORMAL[0x86]_SETTINGONE_SETTINGONE=0x6e
+[TRACE]TRACE_NORMAL[0x86]_SETTINGONE_SETTINGONE_DUP01=0x6f
+[TRACE]TRACE_NORMAL[0x86]_SETTINGTHREEIN_SETTINGTHREEIN=0x72
+[TRACE]TRACE_NORMAL[0x86]_SETTINGTHREEIN_SETTINGTHREEIN_DUP01=0x73
+[TRACE]TRACE_NORMAL[0x86]_SETTINGTWO_SETTINGTWO=0x70
+[TRACE]TRACE_NORMAL[0x86]_SETTINGTWO_SETTINGTWO_DUP01=0x71
+[TRACE]TRACE_NORMAL[0x86]_SETUPBULKINTERFACES_SETUPBULKINTERFACES=0xa0
+[TRACE]TRACE_NORMAL[0x86]_STARTTESTS_STARTTESTS=0xea
+[TRACE]TRACE_NORMAL[0x86]_TALTERNATESETTING_ACTIVATE=0x20
+[TRACE]TRACE_NORMAL[0x86]_TALTERNATESETTING_DTALTERNATESETTING=0x1f
+[TRACE]TRACE_NORMAL[0x86]_TALTERNATESETTING_SETCHANGEREQUESTFLAG=0x22
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA=0x3a
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP01=0x3b
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP02=0x3c
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP03=0x3d
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP04=0x3e
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP05=0x3f
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP06=0x40
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP07=0x41
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP08=0x42
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP09=0x43
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP10=0x44
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP11=0x45
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP12=0x46
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP13=0x47
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP14=0x48
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP15=0x49
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP16=0x4a
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP17=0x4b
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP18=0x4c
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP19=0x4e
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP20=0x4f
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP21=0x50
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP22=0x4d
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SENDEP0PACKET=0x2f
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SENDEP0PACKET_DUP01=0x30
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER=0x31
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP01=0x32
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP02=0x33
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP03=0x34
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP04=0x35
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP05=0x36
+[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP06=0x37
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY=0x96
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01=0x97
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02=0x98
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03=0x99
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04=0x9a
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05=0x9b
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06=0x9c
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07=0x9d
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08=0x9e
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09=0x9f
+[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION=0x7e
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x8f
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01=0x90
+[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02=0x91
+[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE=0xd3
+[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP01=0xd4
+[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP02=0xd5
+[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP03=0xd6
+[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP04=0xd7
+[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP05=0xd8
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0=0xd9
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP01=0xda
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP02=0xdb
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP03=0xdc
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP04=0xdd
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP05=0xde
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP06=0xdf
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP07=0xe0
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP08=0xe1
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP09=0xe2
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP10=0xe3
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP11=0xe4
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP12=0xe5
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP13=0xe6
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP14=0xe7
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP15=0xe8
+[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP16=0xe9
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE=0xc8
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP01=0xc9
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP02=0xca
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP03=0xcb
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP04=0xcc
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP05=0xcd
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP06=0xce
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP07=0xcf
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP08=0xd0
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP09=0xd1
+[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP10=0xd2
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION=0x1
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP01=0x2
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP02=0x3
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP03=0x4
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP04=0x5
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP05=0x6
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING=0x25
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP01=0x26
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP02=0x27
+[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP03=0x28
+[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL=0x51
+[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL_DUP01=0x52
+[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL_DUP02=0x53
+[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL_DUP03=0x54
+[TRACE]TRACE_NORMAL[0x86]_TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR=0x7c
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS=0x93
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY=0x94
+[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01=0x95
+[TRACE]TRACE_NORMAL[0x86]_TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR=0x7f
+[TRACE]TRACE_NORMAL[0x86]_TESTINVALIDAPI_TESTINVALIDAPI=0x55
+[TRACE]TRACE_NORMAL[0x86]_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR=0x7d
+[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE=0x56
+[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP01=0x57
+[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP02=0x58
+[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP03=0x59
+[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP04=0x5a
+[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP05=0x5b
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x80
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x81
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x82
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x83
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x84
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x85
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x86
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x87
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x88
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x89
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x8a
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x8b
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x8c
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x8d
+[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x8e
+[TRACE]TRACE_NORMAL[0x86]_TINTERFACE_DTINTERFACE=0x1d
+[TRACE]TRACE_NORMAL[0x86]_TINTERFACE_SETACTIVEALTERNATESETTING=0x1e
+[TRACE]TRACE_NORMAL[0x86]_USER_AFTER=0x29
+[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP01=0x2a
+[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP02=0x2b
+[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP03=0x2c
+[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP04=0x2d
+[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP05=0x2e
--- a/kerneltest/e32test/usb/t_usb_device/include/general.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/include/general.h	Thu Sep 02 21:54:16 2010 +0300
@@ -148,7 +148,6 @@
 		    iConsole->Printf(_L(string)); \
 		    iConsole->Printf(_L("\n")); \
 			} \
-		RDebug::Print(_L(string)); \
 		} while (0)
 
 #define TUSB_PRINT1(string, a) \
@@ -158,7 +157,6 @@
 			iConsole->Printf(_L(string), (a)); \
 			iConsole->Printf(_L("\n")); \
 			}	\
-		RDebug::Print(_L(string), (a)); \
 		} while (0)
 
 #define TUSB_PRINT2(string, a, b) \
@@ -168,7 +166,6 @@
 			iConsole->Printf(_L(string), (a), (b)); \
 			iConsole->Printf(_L("\n")); \
 			}	\
-		RDebug::Print(_L(string), (a), (b)); \
 		} while (0)
 
 #define TUSB_PRINT3(string, a, b, c) \
@@ -178,7 +175,6 @@
 			iConsole->Printf(_L(string), (a), (b), (c)); \
 			iConsole->Printf(_L("\n")); \
 			}	\
-		RDebug::Print(_L(string), (a), (b), (c)); \
 		} while (0)
 
 #define TUSB_PRINT4(string, a, b, c, d) \
@@ -188,7 +184,6 @@
 			iConsole->Printf(_L(string), (a), (b), (c), (d)); \
 			iConsole->Printf(_L("\n")); \
 			}	\
-		RDebug::Print(_L(string), (a), (b), (c), (d)); \
 		} while (0)
 
 #define TUSB_PRINT5(string, a, b, c, d, e) \
@@ -198,7 +193,6 @@
 			iConsole->Printf(_L(string), (a), (b), (c), (d), (e)); \
 			iConsole->Printf(_L("\n")); \
 			}	\
-		RDebug::Print(_L(string), (a), (b), (c), (d), (e)); \
 		} while (0)
 
 #define TUSB_PRINT6(string, a, b, c, d, e, f) \
@@ -208,7 +202,6 @@
 			iConsole->Printf(_L(string), (a), (b), (c), (d), (e), (f)); \
 			iConsole->Printf(_L("\n")); \
 			}	\
-		RDebug::Print(_L(string), (a), (b), (c), (d), (e), (f)); \
 		} while (0)
 
 #define TUSB_VERBOSE_PRINT(string) \
@@ -268,7 +261,6 @@
 				aConsole->Printf(_L(string)); \
 				aConsole->Printf(_L("\n")); \
 				}	\
-			RDebug::Print(_L(string)); \
 			} \
 		} while (0)
 
@@ -276,8 +268,6 @@
 		do { \
 			TInt totalSize = 0; \
 			TInt numCells = User::AllocSize (totalSize); \
-			RDebug::Print(_L(string)); \
-			RDebug::Print(_L(" Heap Cells %d Size %d\n"),numCells,totalSize); \
 		} while (0)
 	
 #endif	// __GENERAL_H__
--- a/kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -14,11 +14,11 @@
 // e32test/usb/t_usb_device/src/activecontrol.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-// 
+//
 //
 
 
-#include "general.h"									
+#include "general.h"
 #include "usblib.h"											// Helpers
 #include "config.h"
 #include "activecontrol.h"
@@ -28,6 +28,12 @@
 #include "tranhandleserver.h"
 #endif
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "activecontrolTraces.h"
+#endif
+
+
 void StartMassStorage(RDEVCLIENT* aPort);
 void StopMassStorage(RDEVCLIENT* aPort);
 
@@ -45,7 +51,7 @@
 	};
 
 extern RTest test;
-#ifdef USB_SC	
+#ifdef USB_SC
 extern TBool gShareHandle;
 #endif
 extern TBool gVerbose;
@@ -160,9 +166,10 @@
 void CActiveControl::ConstructL()
 	{
 	CActiveScheduler::Add(this);
-#ifdef USB_SC	
+#ifdef USB_SC
 	if (gShareHandle)
 		{
+		// to do add call to server to transfer config file name
 		iTranHandleServer = CTranHandleServer::NewL(*this);
 		RTransferSrv aSrv;
 		test.Next (_L("ConstructL"));
@@ -177,16 +184,16 @@
 		}
 #endif
 	TInt r;
-	
+
 	User::LeaveIfError(iFs.Connect());
 
 	test.Start (_L("Configuration"));
-	
+
 	test_Compare(iConfigFileName->Length(),!=,0);
-		
+
 	iTimer.CreateLocal();
 	iPending = EPendingNone;
-	
+
 	test.Next (_L("Open configuration file"));
 	// set the session path to use the ROM if no drive specified
 	r=iFs.SetSessionPath(_L("Z:\\test\\"));
@@ -195,15 +202,19 @@
 	r = iConfigFile.Open(iFs, * iConfigFileName, EFileShareReadersOnly | EFileStreamText | EFileRead);
 	test_KErrNone(r);
 	TUSB_VERBOSE_PRINT1("Configuration file %s Opened successfully", iConfigFileName->PtrZ());
+	if(gVerbose)
+	    {
+	    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL, "Configuration file %S Opened successfully", *iConfigFileName);
+	    }
 
 	test.Next (_L("Process configuration file"));
 	test(ProcessConfigFile (iConfigFile,iConsole,&iLddPtr));
-	
+
 	iConfigFile.Close();
 
 	test.Next (_L("LDD in configuration file"));
 	test_NotNull(iLddPtr);
-		
+
 	LDDConfigPtr lddPtr = iLddPtr;
 	TInt nextPort = 0;
 	while (lddPtr != NULL)
@@ -213,11 +224,15 @@
 		//  was already loaded at boot time.)
 		test.Next (_L("Loading USB LDD"));
 		TUSB_VERBOSE_PRINT1("Loading USB LDD ",lddPtr->iName.PtrZ());
+		if(gVerbose)
+		    {
+		    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP01, "Loading USB LDD:%S ", lddPtr->iName);
+		    }
 		r = User::LoadLogicalDevice(lddPtr->iName);
 		test(r == KErrNone || r == KErrAlreadyExists);
-	
+
 		IFConfigPtr ifPtr = lddPtr->iIFPtr;
-		
+
 		test.Next (_L("Opening Channels"));
 		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
 			{
@@ -227,6 +242,10 @@
 			r = iPort[portNumber].Open(0);
 			test_KErrNone(r);
 			TUSB_VERBOSE_PRINT("Successfully opened USB port");
+			if(gVerbose)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP02, "Successfully opened USB port");
+			    }
 
 			// Query the USB device/Setup the USB interface
 			if (portNumber == nextPort)
@@ -234,22 +253,22 @@
 				// Change some descriptors to contain suitable values
 				SetupDescriptors(lddPtr, &iPort[portNumber]);
 				}
-				
+
 			if (portNumber == 0)
 				{
 				QueryUsbClientL(lddPtr, &iPort[portNumber]);
 				}
 
 			test_NotNull(ifPtr);
-			
+
 			if (iSupportResourceAllocationV2)
 				{
 				PopulateInterfaceResourceAllocation(ifPtr, portNumber);
 				}
-				
+
 			IFConfigPtr defaultIfPtr = ifPtr;
 			SetupInterface(&ifPtr,portNumber);
-					
+
 			#ifdef USB_SC
 			RChunk *tChunk = &gChunk;
 			test_KErrNone(iPort[portNumber].FinalizeInterface(tChunk));
@@ -264,17 +283,21 @@
 					#ifndef USB_SC
 					defaultIfPtr->iEpDoubleBuff[i-1] ? AllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i) : DeAllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i);
 					#endif
-					}				
+					}
 				}
 			}
-	
+
 		iTotalChannels += lddPtr->iNumChannels;
-		nextPort += lddPtr->iNumChannels;	
-		lddPtr = lddPtr->iPtrNext;	
+		nextPort += lddPtr->iNumChannels;
+		lddPtr = lddPtr->iPtrNext;
 		}
-		
+
 	TUSB_VERBOSE_PRINT("All Interfaces and Alternate Settings successfully set up");
-	
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP03, "All Interfaces and Alternate Settings successfully set up");
+	    }
+
 	test.Next (_L("Start Idle Counter Thread"));
 	r = iIdleCounterThread.Create(_L("IdleCounter"), IdleCounterThread, KDefaultStackSize, KMinHeapSize, KMinHeapSize, NULL);
 	test_KErrNone(r);
@@ -291,20 +314,25 @@
 	User::After(1000000); // 1 second
 	TInt64 val2 = iIdleCounter->iCounter;
 	TUSB_PRINT1("Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_CONSTRUCTL_DUP04, "Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
 
 	test.Next (_L("Enumeration..."));
 	r = ReEnumerate();
 	test_KErrNone(r);
-		
+
 	TUSB_VERBOSE_PRINT("Device successfully re-enumerated\n");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP05, "Device successfully re-enumerated\n");
+	    }
 
 
 	if (iLddPtr->iHighSpeed && !gSkip)
 		{
 		test.Next (_L("High Speed"));
-		test(iHighSpeed);	
+		test(iHighSpeed);
 		}
-			
+
 	test.Next (_L("Create Notifiers"));
 	for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 		{
@@ -314,18 +342,26 @@
 		test_NotNull(iDeviceStateNotifier[portNumber]);
 		iDeviceStateNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created device state notifier");
+		if(gVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP06, "Created device state notifier");
+		    }
 
 		// Create endpoint stall status active object
 		iStallNotifier[portNumber] = CActiveStallNotifier::NewL(iConsole, &iPort[portNumber]);
 		test_NotNull(iStallNotifier[portNumber]);
 		iStallNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created stall notifier");
-			
-		TestInvalidSetInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);			
+		if(gVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP07, "Created stall notifier");
+		    }
+
+		TestInvalidSetInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
 		TestInvalidReleaseInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
-			
+
 		}
-		
+
 	test.Next (_L("Endpoint Zero Max Packet Sizes"));
 	TUint ep0Size = iPort[0].EndpointZeroMaxPacketSizes();
 	switch (ep0Size)
@@ -333,7 +369,7 @@
 		case KUsbEpSize8 :
 			iEp0PacketSize = 8;
 			break;
-					
+
 		case KUsbEpSize16 :
 			iEp0PacketSize = 16;
 			break;
@@ -345,10 +381,10 @@
 		case KUsbEpSize64 :
 			iEp0PacketSize = 64;
 			break;
-					
+
 		default:
 			iEp0PacketSize = 0;
-			break;		
+			break;
 		}
 	test_Compare(iEp0PacketSize,>,0);
 
@@ -360,9 +396,9 @@
 	r = iPort[0].OpenEndpoint(iEp0Buf,0);
 	test_KErrNone(r);
 	#endif
-	
+
 	test.End();
-	
+
 	}
 
 void CActiveControl::ReConnect()
@@ -375,7 +411,7 @@
 	while (lddPtr != NULL)
 		{
 		IFConfigPtr ifPtr = lddPtr->iIFPtr;
-		
+
 		test.Next (_L("Opening Channels"));
 		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
 			{
@@ -383,6 +419,10 @@
 			r = iPort[portNumber].Open(0);
 			test_KErrNone(r);
 			TUSB_VERBOSE_PRINT("Successfully opened USB port");
+			if(gVerbose)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT, "Successfully opened USB port");
+			    }
 
 			// Query the USB device/Setup the USB interface
 			if (portNumber == nextPort)
@@ -390,15 +430,15 @@
 				// Change some descriptors to contain suitable values
 				SetupDescriptors(lddPtr, &iPort[portNumber]);
 				}
-				
+
 			IFConfigPtr defaultIfPtr = ifPtr;
 			SetupInterface(&ifPtr,portNumber);
-					
+
 			#ifdef USB_SC
 			RChunk *tChunk = &gChunk;
 			test_KErrNone(iPort[portNumber].FinalizeInterface(tChunk));
 			#endif
-			
+
 			if (!iSupportResourceAllocationV2)
 				{
 				// 	allocate endpoint DMA and double buffering for all endpoints on default interface with resource allocation v1 api
@@ -409,21 +449,29 @@
 					defaultIfPtr->iEpDoubleBuff[i-1] ? AllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i) : DeAllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i);
 					#endif
 					}
-				}				
+				}
 			}
-	
-		nextPort += lddPtr->iNumChannels;	
-		lddPtr = lddPtr->iPtrNext;	
+
+		nextPort += lddPtr->iNumChannels;
+		lddPtr = lddPtr->iPtrNext;
 		}
-		
+
 	TUSB_VERBOSE_PRINT("All Interfaces and Alternate Settings successfully set up");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP01, "All Interfaces and Alternate Settings successfully set up");
+	    }
 
 	test.Next (_L("Enumeration..."));
 	r = ReEnumerate();
 	test_KErrNone(r);
-		
+
 	TUSB_VERBOSE_PRINT("Device successfully re-enumerated\n");
-	
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP02, "Device successfully re-enumerated\n");
+	    }
+
 	for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 		{
 		// Create device state active object
@@ -431,12 +479,20 @@
 		test_NotNull(iDeviceStateNotifier[portNumber]);
 		iDeviceStateNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created device state notifier");
+		if(gVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP03, "Created device state notifier");
+		    }
 
 		// Create endpoint stall status active object
 		iStallNotifier[portNumber] = CActiveStallNotifier::NewL(iConsole, &iPort[portNumber]);
 		test_NotNull(iStallNotifier[portNumber]);
 		iStallNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created stall notifier");
+		if(gVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP04, "Created stall notifier");
+		    }
 
 		if (portNumber == 0)
 			{
@@ -448,22 +504,22 @@
 			r = iPort[portNumber].OpenEndpoint(iEp0Buf,0);
 			test_KErrNone(r);
 			#endif
-			
+
 			}
 		}
-	
+
 	test.End();
 	}
 
 void CActiveControl::FillEndpointsResourceAllocation(IFConfigPtr aIfCfg)
 	{
-	
+
 	#ifdef USB_SC
 		TUsbcScInterfaceInfo* iInfoPtr = aIfCfg->iInfoPtr;
 	#else
 		TUsbcInterfaceInfo* iInfoPtr = aIfCfg->iInfoPtr;
 	#endif
-	
+
 	// 	fill resource allocation info in the endpoint info with resource allocation v2
 	for (TUint8 i = 1; i <= iInfoPtr->iTotalEndpointsUsed; i++)
 		{
@@ -485,14 +541,14 @@
 			iInfoPtr->iEndpointData[i-1].iFeatureWord1 &= (~KUsbcEndpointInfoFeatureWord1_DoubleBuffering);
 			}
 		#endif
-		}	
+		}
 	}
 
 // all alternative settings of the interface 'aFirstIfCfg' will be populated
 void CActiveControl::PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber)
 	{
 	FillEndpointsResourceAllocation(aFirstIfCfg);
-	
+
 	IFConfigPtr ifCfgPtr = aFirstIfCfg->iPtrNext;
 	while (ifCfgPtr != NULL)
 		{
@@ -507,13 +563,14 @@
 			}
 		}
 	}
-	
+
 void CActiveControl::SetupInterface(IFConfigPtr* aIfPtr, TInt aPortNumber)
 	{
 	test.Start (_L("Setup Interface"));
-	
-	// first of all set the default interface	
+
+	// first of all set the default interface
 	TUSB_PRINT2 ("Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
+	OstTraceExt2 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE, "Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
 	#ifdef USB_SC
 	TUsbcScInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
 	TInt r = iPort[aPortNumber].SetInterface(0, ifc);
@@ -536,34 +593,36 @@
 	if ((*aIfPtr)->iNumber != 0 && ifDescriptor[KIfcDesc_NumberOffset] != (*aIfPtr)->iNumber)
 		{
 		ifDescriptor[KIfcDesc_NumberOffset] = (*aIfPtr)->iNumber;
-		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor);	
+		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor);
 		test_KErrNone(r);
 		}
 	else
 		{
-		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];	
+		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];
 		}
 	TUint8 interfaceNumber = (*aIfPtr)->iNumber;
 	TUSB_PRINT1 ("Interface Number %d",interfaceNumber);
-		
+	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP01, "Interface Number %d",interfaceNumber);
+
 	// Check all endpoint descriptors
 	TBuf8<KUsbDescSize_AudioEndpoint> epDescriptor;
 	for (TUint i = 0; i < (*aIfPtr)->iInfoPtr->iTotalEndpointsUsed; i++)
 		{
 		if (!gSkip)
 			{
-			TestEndpointDescriptor (&iPort[aPortNumber],0,i+1,(*aIfPtr)->iInfoPtr->iEndpointData[i]);	
+			TestEndpointDescriptor (&iPort[aPortNumber],0,i+1,(*aIfPtr)->iInfoPtr->iEndpointData[i]);
 
 			}
 
 		if (firstBulkOutEndpoint < 0 && ((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirOut) &&
 			(*aIfPtr)->iInfoPtr->iEndpointData[i].iType == KUsbEpTypeBulk)
 			{
-			firstBulkOutEndpoint = i+1;	
+			firstBulkOutEndpoint = i+1;
 			}
 		}
 
 	TUSB_PRINT1 ("Interface number is %d",interfaceNumber);
+	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP02, "Interface number is %d",interfaceNumber);
 	(*aIfPtr)->iPortNumber = aPortNumber;
 	gInterfaceConfig [interfaceNumber] [0] = *aIfPtr;
 
@@ -582,13 +641,15 @@
 				ifc = *(ifPtr->iInfoPtr);
 				#ifdef USB_SC
 				TUSB_PRINT2 ("Set Alternate Interface Setting %d with %d endpoints",alternateNumber,ifPtr->iInfoPtr->iTotalEndpointsUsed);
+				OstTraceExt2 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP03, "Set Alternate Interface Setting %d with %d endpoints",alternateNumber,ifPtr->iInfoPtr->iTotalEndpointsUsed);
 				r = iPort[aPortNumber].SetInterface(alternateNumber, ifc);
 				#else
 				TUSB_PRINT3 ("Set Alternate Interface Setting %d with %d endpoints bandwidth 0x%x",alternateNumber,ifPtr->iInfoPtr->iTotalEndpointsUsed,ifPtr->iBandwidthIn | iLddPtr->iIFPtr->iBandwidthOut);
+				OstTraceExt3 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP04, "Set Alternate Interface Setting %d with %u endpoints bandwidth 0x%x",(TInt32)alternateNumber,(TUint32)ifPtr->iInfoPtr->iTotalEndpointsUsed,(TUint32)(ifPtr->iBandwidthIn | iLddPtr->iIFPtr->iBandwidthOut));
 				r = iPort[aPortNumber].SetInterface(alternateNumber, ifc, ifPtr->iBandwidthIn | iLddPtr->iIFPtr->iBandwidthOut);
 				#endif
 				test_KErrNone(r);
-					
+
 				r = iPort[aPortNumber].GetInterfaceDescriptor(alternateNumber, ifDescriptor);
 				test_KErrNone(r);
 
@@ -608,7 +669,7 @@
 
 					r = iPort[aPortNumber].GetEndpointDescriptor(alternateNumber, i+1, epDescriptor);
 					test_KErrNone(r);
-					
+
 					test((((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && (epDescriptor[KEpDesc_AddressOffset] & 0x80) ||
 						!((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && !(epDescriptor[KEpDesc_AddressOffset] & 0x80)) &&
 						EpTypeMask2Value((*aIfPtr)->iInfoPtr->iEndpointData[i].iType) == (TUint)(epDescriptor[KEpDesc_AttributesOffset] & 0x03) &&
@@ -631,11 +692,11 @@
 
 						test.Next(_L("Compare endpoint descriptor with value set"));
 						r = descriptor2.Compare(epDescriptor);
-						test_KErrNone(r);						
+						test_KErrNone(r);
 						}
 					}
-				
-					
+
+
 				// if no error move on to the next interface
 				ifPtr->iPortNumber = aPortNumber;
 				ifPtr->iNumber = interfaceNumber;
@@ -654,14 +715,14 @@
 	iNumInterfaceSettings[aPortNumber] = alternateNumber;
 	if (!gSkip)
 		{
-		TestInvalidSetInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);			
+		TestInvalidSetInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
 		TestInvalidReleaseInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
 
 		TestDescriptorManipulation(iLddPtr->iHighSpeed,&iPort[aPortNumber],alternateNumber);
 		TestOtgExtensions(&iPort[aPortNumber]);
 		TestEndpoint0MaxPacketSizes(&iPort[aPortNumber]);
 		}
-		
+
 	test.End();
 	}
 
@@ -669,12 +730,13 @@
 CActiveControl::~CActiveControl()
 	{
 	TUSB_PRINT("CActiveControl::~CActiveControl()");
+	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_DCACTIVECONTROL, "CActiveControl::~CActiveControl()");
 
 	Cancel();
-	
+
 	iTimer.Close();
-	
-	// delete interfaces		
+
+	// delete interfaces
 	while (iLddPtr->iIFPtr)
 		{
 		IFConfigPtr* ifPtrPtr = & iLddPtr->iIFPtr;
@@ -690,7 +752,7 @@
 
 	while (iLddPtr)
 		{
-		LDDConfigPtr* lddPtrPtr = &iLddPtr;	
+		LDDConfigPtr* lddPtrPtr = &iLddPtr;
 		while ((*lddPtrPtr)->iPtrNext)
 			{
 			lddPtrPtr = &(*lddPtrPtr)->iPtrNext;
@@ -704,6 +766,7 @@
 #ifdef USB_SC
 	delete iTranHandleServer;
 	TUSB_PRINT("CActiveControl::delete iTranHandleServer");
+	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_DCACTIVECONTROL_DUP01, "CActiveControl::delete iTranHandleServer");
 #endif
 	iFs.Close();
 	}
@@ -711,6 +774,10 @@
 void CActiveControl::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveControl::DoCancel()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_DOCANCEL, "CActiveControl::DoCancel()");
+	    }
 	iConsole->ReadCancel();
 	}
 
@@ -725,7 +792,7 @@
 			if (!IsActive())
 				{
 				SetActive();
-				}		
+				}
 			}
 		}
 	else
@@ -737,10 +804,14 @@
 			}
 		}
 	}
-	
+
 void CActiveControl::RequestEp0ControlPacket()
 	{
 	TUSB_VERBOSE_PRINT("CActiveControl::RequestEp0ControlPacket()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_REQUESTEP0CONTROLPACKET, "CActiveControl::RequestEp0ControlPacket()");
+	    }
 	// A request is issued to read a packet for endpoint 0
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 660));
 	#ifdef	USB_SC
@@ -748,8 +819,12 @@
 	do
 		{
 		r = iEp0Buf.GetBuffer (iEp0Packet,iEp0Size,iEp0Zlp,iStatus);
-		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d PacketPtr 0x%x Size %d", r, iStatus.Int(),iEp0Packet,iEp0Size);	
-		test_Value(r, (r == KErrNone) || (r == KErrCompletion) || (r == TEndpointBuffer::KStateChange) || (r == KErrAlternateSettingChanged));  
+		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d PacketPtr 0x%x Size %d", r, iStatus.Int(),(TInt)iEp0Packet,iEp0Size);
+		if(gVerbose)
+		    {
+		    OstTraceExt4(TRACE_VERBOSE, CACTIVECONTROL_REQUESTEP0CONTROLPACKET_DUP01, "Get Buffer Return code %d Status %d PacketPtr 0x%x Size %d", r, iStatus.Int(),(TInt)iEp0Packet,(TInt)iEp0Size);
+		    }
+		test_Value(r, (r == KErrNone) || (r == KErrCompletion) || (r == TEndpointBuffer::KStateChange) || (r == KErrAlternateSettingChanged));
 		if (r == KErrCompletion)
 			{
 			// ignore anything except a setup packet
@@ -779,19 +854,24 @@
 void CActiveControl::RunL()
 	{
 	TInt r = KErrNone;
-	
+
 	TUSB_VERBOSE_PRINT("CActiveControl::RunL()");
-	
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RUNL, "CActiveControl::RunL()");
+	    }
+
 	switch (iPending)
 		{
 		case EPendingNone :
 			break;
-			
+
 		case EPendingEp0Read :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Ep0 Read Packet", iStatus.Int());
+				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP01, "ActiveControl::Error %d in Ep0 Read Packet", iStatus.Int());
 				test(EFalse);
 				}
 			#ifdef USB_SC
@@ -801,29 +881,31 @@
 			#else
 			if (ProcessEp0ControlPacket() == KErrCompletion)
 				RequestEp0ControlPacket();
-			#endif		
-			break;		
+			#endif
+			break;
 
 		case EPendingTimer :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Connection Timer Delay", iStatus.Int());
+				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP02, "ActiveControl::Error %d in Connection Timer Delay", iStatus.Int());
 				test(EFalse);
 				}
 			r = iPort[0].DeviceConnectToHost();
 			test_KErrNone (r);
-		
+
 			test.End();
-		
+
 			RequestEp0ControlPacket();
 			break;
-			
+
 		case EPendingEject :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
+				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP03, "ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
 				test(EFalse);
 				}
 			StopMassStorage(&iPort[0]);
@@ -831,19 +913,20 @@
 				iEp0Buf.Close();
 			#endif
 			ReConnect();
-							
+
 			RequestEp0ControlPacket();
 			break;
-					
+
 		case EPendingCancel :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone && iStatus != KErrCancel)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
+				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP04, "ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
 				test(EFalse);
 				}
 		}
-	
+
 	}
 
 TInt CActiveControl::ProcessEp0ControlPacket()
@@ -852,6 +935,10 @@
 	TUint16 index = *reinterpret_cast<TUint16*>(&iEp0SetUpPacket[KUsb_Ep0wIndexOffset]);
 	TUint16 length= *reinterpret_cast<TUint16*>(&iEp0SetUpPacket[KUsb_Ep0wLengthOffset]);
 	TUSB_VERBOSE_PRINT3("ProcessEp0ControlPacket length 0x%x value 0x%x index 0x%x",length,value,index);
+	if(gVerbose)
+	    {
+	    OstTraceExt3(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET, "ProcessEp0ControlPacket length 0x%x value 0x%x index 0x%x",length,value,index);
+	    }
 	TRequestStatus ep0Status;
 	TUint8 host_ver_major;
 	TUint8 host_ver_minor;
@@ -873,56 +960,77 @@
 		((iEp0SetUpPacket[KUsb_Ep0RequestTypeOffset] & KUsbRequestType_TypeMask) == KUsbRequestType_TypeClass))
 		{
 		TUSB_VERBOSE_PRINT("Received Device Directed setup packet");
+		if(gVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP01, "Received Device Directed setup packet");
+		    }
 		if ((iEp0SetUpPacket[KUsb_Ep0RequestTypeOffset] & KUsbRequestType_DirMask) == KUsbRequestType_DirToDev)
 			{
 			iEp0DataBuffer.SetLength(0);
 			while (iEp0DataBuffer.Length() < length)
 				{
 				TUSB_VERBOSE_PRINT("Reading Ep0 data packet");
+				if(gVerbose)
+				    {
+				    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP02, "Reading Ep0 data packet");
+				    }
 				#ifdef USB_SC
 				r = iEp0Buf.GetBuffer (iEp0Packet,iEp0Size,iEp0Zlp,ep0Status);
 				test_Value(r, r == KErrNone || r == KErrCompletion || (r == KErrAlternateSettingChanged));
-				while (r == KErrNone)  
+				while (r == KErrNone)
 					{
 					TUSB_VERBOSE_PRINT("Waiting for Ep0 data packet");
+					if(gVerbose)
+					    {
+					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP03, "Waiting for Ep0 data packet");
+					    }
 					User::WaitForRequest(ep0Status);
 					test_KErrNone(ep0Status.Int());
 					r = iEp0Buf.GetBuffer (iEp0Packet,iEp0Size,iEp0Zlp,ep0Status);
 					test_Value(r, r == KErrNone || r == KErrCompletion || (r == KErrAlternateSettingChanged));
 					}
 				TUSB_VERBOSE_PRINT1("Ep0 data packet - size %d",iEp0Size);
-				iEp0DataBuffer.Append((TUint8 *)iEp0Packet,iEp0Size);								
+				if(gVerbose)
+				    {
+				    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP04, "Ep0 data packet - size %d",iEp0Size);
+				    }
+				iEp0DataBuffer.Append((TUint8 *)iEp0Packet,iEp0Size);
 				#else
 				TUint16 packetLength = Min(length-iEp0DataBuffer.Length(),iEp0PacketSize);
 				iPort[0].ReadPacket(ep0Status, EEndpoint0, ep0DataPacket, packetLength);
 				User::WaitForRequest(ep0Status);
 				if (ep0Status == KErrNone)
 					{
-					iEp0DataBuffer.Append(ep0DataPacket);				
+					iEp0DataBuffer.Append(ep0DataPacket);
 					}
 				else
 					{
 					TUSB_PRINT1("ActiveControl::Error %d in Ep0 Read Data Packet", ep0Status.Int());
+					OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP05, "ActiveControl::Error %d in Ep0 Read Data Packet", ep0Status.Int());
 					test(EFalse);
-					return KErrNone;						
+					return KErrNone;
 					}
 				#endif
 				}
 			TUSB_VERBOSE_PRINT4("Setup ToDevice Type %d length %d value %d index %d",iEp0SetUpPacket[KUsb_Ep0RequestOffset],length,value,index);
+			if(gVerbose)
+			    {
+			    OstTraceExt4(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP06, "Setup ToDevice Type %d length %d value %d index %d",iEp0SetUpPacket[KUsb_Ep0RequestOffset],length,value,index);
+			    }
 			sendStatus = ETrue;
-			switch (iEp0SetUpPacket[KUsb_Ep0RequestOffset])	
+			switch (iEp0SetUpPacket[KUsb_Ep0RequestOffset])
 				{
 				case EStop :
 					// send this now as the port will be disconnected
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();					
+					r = iPort[0].SendEp0StatusPacket();
 					test_KErrNone(r);
-		
+
 					if (value && firstBulkOutEndpoint > 0)
 						{
 						PrintHostLog();
 						}
-						
+
 					for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 						{
 						// base class cancel -> calls our DoCancel
@@ -934,34 +1042,44 @@
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
+								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP07, "Error %d on string removal", r);
 								}
 							r = iPort[portNumber].RemoveStringDescriptor(stridx2);
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
-								}	
+								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP08, "Error %d on string removal", r);
+								}
 							}
 						TUSB_VERBOSE_PRINT1 ("Closing USB channel number %d",portNumber);
+						if(gVerbose)
+						    {
+						    OstTrace1 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP09, "Closing USB channel number %d",portNumber);
+						    }
 #ifdef USB_SC
 						RChunk* commChunk;
 						User::LeaveIfError(iPort[portNumber].GetDataTransferChunk(commChunk));
 						commChunk->Close(); 
 #endif
-						
 						iPort[portNumber].Close();											// close USB channel
 						}
 					TUSB_VERBOSE_PRINT("Closing Idle Counter Thread");
+					if(gVerbose)
+					    {
+					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP10, "Closing Idle Counter Thread");
+					    }
 					iIdleCounter->iCommand = ETestIdleCounterClose;
 					iIdleCounterChunk.Close();
 					// Allow time for low-priority thread to close
 					User::After(100000);
 					iIdleCounterThread.Close();
-					
+
 					CActiveScheduler::Stop();
 					break;
-					
+
 				case EVersion :
 					TUSB_PRINT("Receiving t_usb_host version");
+					OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP11, "Receiving t_usb_host version");
 					host_ver_major = iEp0DataBuffer[0];
 					host_ver_minor = iEp0DataBuffer[1];
 					host_ver_micro = iEp0DataBuffer[2];
@@ -970,9 +1088,13 @@
 					TUSB_PRINT5("Host-side: t_usb_host v%d.%d.%d  USBIO v%d.%d\n",
 						host_ver_major, host_ver_minor, host_ver_micro,
 						usbio_ver_major, usbio_ver_minor);
+					OstTraceExt5(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP12, "Host-side: t_usb_host v%d.%d.%d  USBIO v%d.%d\n",
+						host_ver_major, host_ver_minor, host_ver_micro,
+						usbio_ver_major, usbio_ver_minor);
 					if (host_ver_major < KHostVersionMajor)
 						{
 						TUSB_PRINT1("t_usb_host version not sufficient (need at least v%d.x.x)\n",KHostVersionMajor);
+						OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP13, "t_usb_host version not sufficient (need at least v%d.x.x)\n",KHostVersionMajor);
 						User::Leave(-1);
 						return KErrNone;
 						}
@@ -983,6 +1105,8 @@
 						{
 						TUSB_PRINT2("t_usb_host version not sufficient (need at least v%d.%d.x)\n",
 							KHostVersionMajor, KHostVersionMinor);
+						OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP14, "t_usb_host version not sufficient (need at least v%d.%d.x)\n",
+							KHostVersionMajor, KHostVersionMinor);
 						test(EFalse);
 						return KErrNone;
 						}
@@ -992,18 +1116,25 @@
 			 				!(host_ver_micro == KHostVersionMicro))
 						{
 						TUSB_PRINT3("USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
+							KHostVersionMajor, KHostVersionMinor, KHostVersionMicro);
+						OstTraceExt3(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP15, "USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
 									KHostVersionMajor, KHostVersionMinor, KHostVersionMicro);
 						test(EFalse);
 						return KErrNone;
 						}
 					break;
-					
+
 				case ETestParam :
 					tpPtr = (TestParamPtr)(&iEp0DataBuffer[0]);
 					TUSB_VERBOSE_PRINT4("Test Params - interface %d repeat %d settingRepeat %d beforeIndex %d",tpPtr->interfaceNumber,tpPtr->repeat,tpPtr->settingRepeat,tpPtr->beforeIndex);
+					if(gVerbose)
+					    {
+					    OstTraceExt4(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP16, "Test Params - interface %d repeat %d settingRepeat %d beforeIndex %d",tpPtr->interfaceNumber,tpPtr->repeat,tpPtr->settingRepeat,tpPtr->beforeIndex);
+					    }
 					if (index >= KMaxConcurrentTests)
 						{
 						TUSB_PRINT2("Test index %d is greater than maximum allowed (%d) concurrent tests",index,KMaxConcurrentTests);
+						OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP17, "Test index %d is greater than maximum allowed (%d) concurrent tests",index,KMaxConcurrentTests);
 						test(EFalse);
 						return KErrNone;
 						}
@@ -1012,127 +1143,137 @@
 					if (!pActiveRW)
 						{
 						TUSB_PRINT("Failed to create reader/writer");
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP18, "Failed to create reader/writer");
 						test(EFalse);
 						return KErrNone;
 						}
 					TUSB_VERBOSE_PRINT("Created reader/writer");
+					if(gVerbose)
+					    {
+					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP19, "Created reader/writer");
+					    }
 					pActiveRW->SetTestParams(tpPtr);
 					switch (value)
 						{
 					case 'X' :
 						test.Start (_L("Xml"));
 						break;
-							
+
 					case 'L' :
 						test.Start (_L("Loop"));
 						pActiveRW->SetTransferMode(ELoop);
 						gAltSettingOnNotify = ETrue;
 						if (tpPtr->settingRepeat && !firstSettingThread)
 							{
-							pActiveRW->Suspend(ESuspend);	
+							pActiveRW->Suspend(ESuspend);
 							}
 						else
 							{
-							pActiveRW->StartOrSuspend();						
+							pActiveRW->StartOrSuspend();
 							}
 						break;
-							
+
 					case 'C' :
 						test.Start (_L("Compare"));
 						pActiveRW->SetTransferMode(ELoopComp);
 						gAltSettingOnNotify = ETrue;
 						if (tpPtr->settingRepeat && !firstSettingThread)
 							{
-							pActiveRW->Suspend(ESuspend);	
+							pActiveRW->Suspend(ESuspend);
 							}
 						else
 							{
-							pActiveRW->StartOrSuspend();						
+							pActiveRW->StartOrSuspend();
 							}
 						break;
-							
+
 					case 'S' :
 						test.Start (_L("Stream"));
 						if (tpPtr->outPipe > KMaxEndpointsPerClient)
 							{
-							pActiveRW->SetTransferMode(ETransmitOnly);						
+							pActiveRW->SetTransferMode(ETransmitOnly);
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);	
+								pActiveRW->Suspend(ESuspend);
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();						
+								pActiveRW->StartOrSuspend();
 								}
 							}
 						else
 							{
-							pActiveRW->SetTransferMode(EReceiveOnly);						
+							pActiveRW->SetTransferMode(EReceiveOnly);
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);	
+								pActiveRW->Suspend(ESuspend);
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();						
+								pActiveRW->StartOrSuspend();
 								}
-							}					
+							}
 						break;
-							
+
 					case 'F' :
 						test.Start (_L("File"));
 						// send this now as the file setup takes a long time
 						sendStatus = EFalse;
-						r = iPort[0].SendEp0StatusPacket();					
+						r = iPort[0].SendEp0StatusPacket();
 						test_KErrNone(r);
 						if (tpPtr->outPipe > KMaxEndpointsPerClient)
 							{
 							pActiveRW->SetTransferMode(ETransmitOnly);
-							TInt maxFileSize = tpPtr->maxSize * tpPtr->repeat;						
+							TInt maxFileSize = tpPtr->maxSize * tpPtr->repeat;
 							pActiveRW->ReadFromDisk((TChar)tpPtr->minSize,maxFileSize);
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);	
+								pActiveRW->Suspend(ESuspend);
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();						
+								pActiveRW->StartOrSuspend();
 								}
 							}
 						else
 							{
-							pActiveRW->SetTransferMode(EReceiveOnly);						
+							pActiveRW->SetTransferMode(EReceiveOnly);
 							pActiveRW->WriteToDisk((TChar)tpPtr->minSize);
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);	
+								pActiveRW->Suspend(ESuspend);
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();						
+								pActiveRW->StartOrSuspend();
 								}
-							}					
+							}
 						break;
-						
+
 					default :
 						TUSB_PRINT1("Invalid test value %X",value);
+						OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP20, "Invalid test value %X",value);
 						test(EFalse);
 						}
-						
+
 					gRW[index] = pActiveRW;
 					break;
-					
+
 				case ETestResult :
 					TUSB_VERBOSE_PRINT2 ("Test index %d complete - value %d",index,value);
-					// if failure, send this first to prevent panic corrupting EP0 
+					if(gVerbose)
+					    {
+					    OstTraceExt2 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP21, "Test index %d complete - value %d",index,value);
+					    }
+					// if failure, send this first to prevent panic corrupting EP0
 					if (!value)
 						{
 						sendStatus = EFalse;
-						r = iPort[0].SendEp0StatusPacket();					
+						r = iPort[0].SendEp0StatusPacket();
 						}
 					if (index < KMaxConcurrentTests)
 						{
@@ -1146,12 +1287,14 @@
 						{
 						if (!value)
 							{
-							TUSB_PRINT("Host Test Fail");							
+							TUSB_PRINT("Host Test Fail");
+							OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP22, "Host Test Fail");
 							}
 						}
 					else
 						{
 						TUSB_PRINT2("Invalid test index %d for result %d",index,value);
+						OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP23, "Invalid test index %d for result %d",index,value);
 						}
 					if (!value)
 						{
@@ -1166,12 +1309,12 @@
 				case ETestConnect :
 					test.Start (_L("Connect"));
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();					
+					r = iPort[0].SendEp0StatusPacket();
 					if (iSoftwareConnect)
 						{
 						r = iPort[0].DeviceDisconnectFromHost();
 						test_KErrNone (r);
-						
+
 						TUint32 waitTime = (TUint32)value * 1000;
 						if (waitTime == 0)
 							{
@@ -1179,24 +1322,28 @@
 							}
 						iTimer.After(iStatus,waitTime);
 						iPending = EPendingTimer;
-						
+
 						SetActive();
 						}
 					else
 						{
 						iConsole->Printf(_L("This device does not support software\n"));
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP24, "This device does not support software\n");
 						iConsole->Printf(_L("disconnect/reconnect\n"));
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP25, "disconnect/reconnect\n");
 						iConsole->Printf(_L("Please physically unplug and replug\n"));
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP26, "Please physically unplug and replug\n");
 						iConsole->Printf(_L("the USB cable NOW... "));
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP27, "the USB cable NOW... ");
 						test.End ();
-						}				
+						}
 					break;
 
 				case ETestDisconnect :
 					test.Start (_L("Disconnect"));
 					// send this now as the port will be disconnected
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();					
+					r = iPort[0].SendEp0StatusPacket();
 					if (iSoftwareConnect)
 						{
 						r = iPort[0].DeviceDisconnectFromHost();
@@ -1205,22 +1352,26 @@
 					else
 						{
 						iConsole->Printf(_L("This device does not support software\n"));
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP28, "This device does not support software\n");
 						iConsole->Printf(_L("disconnect/reconnect\n"));
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP29, "disconnect/reconnect\n");
 						iConsole->Printf(_L("Please physically unplug and replug\n"));
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP30, "Please physically unplug and replug\n");
 						iConsole->Printf(_L("the USB cable NOW... "));
-						}				
+						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP31, "the USB cable NOW... ");
+						}
 
 					test.End ();
 					break;
 
 				case ETestMassStorage :
 					test.Start (_L("Select Mass Storage"));
-				
+
 					// send this now as the port will be disconnected
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();					
+					r = iPort[0].SendEp0StatusPacket();
 					test_KErrNone(r);
-			
+
 					for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 						{
 						delete iDeviceStateNotifier[portNumber];
@@ -1231,32 +1382,41 @@
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
+								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP32, "Error %d on string removal", r);
 								}
 							r = iPort[portNumber].RemoveStringDescriptor(stridx2);
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
-								}	
+								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP33, "Error %d on string removal", r);
+								}
 							}
 						TUSB_VERBOSE_PRINT1 ("Closing USB channel number %d",portNumber);
+						if(gVerbose)
+						    {
+						    OstTrace1 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP34, "Closing USB channel number %d",portNumber);
+						    }
 #ifdef USB_SC
 						RChunk* commChunk;
 						User::LeaveIfError(iPort[portNumber].GetDataTransferChunk(commChunk));
 						commChunk->Close();	
-						TUSB_PRINT("commChunk->Close");
-#endif
+#endif							
 						iPort[portNumber].Close();											// close USB channel
 						}
-		
+
 					r = iPort[0].Open(0);
 					test_KErrNone(r);
 					TUSB_VERBOSE_PRINT("Successfully opened USB port");
+					if(gVerbose)
+					    {
+					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP35, "Successfully opened USB port");
+					    }
 
 					SetupDescriptors(iLddPtr, &iPort[0],value);
 					StartMassStorage(&iPort[0]);
-		
+
 					test.Next (_L("Enumeration..."));
-					r = ReEnumerate();				
+					r = ReEnumerate();
 					test_KErrNone(r);
 
 
@@ -1269,9 +1429,10 @@
 				if (r != KErrNone)
 					{
 					TUSB_PRINT1("ActiveControl::Error %d in Ep0 Send Status Packet", r);
+					OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP36, "ActiveControl::Error %d in Ep0 Send Status Packet", r);
 					test(EFalse);
-					return KErrNone;						
-					}				
+					return KErrNone;
+					}
 				}
 			}
 		else
@@ -1279,12 +1440,13 @@
 			if ((iEp0SetUpPacket[KUsb_Ep0RequestOffset] == EVersion) && length > 0)
 				{
 				TUSB_PRINT4("Sending t_usb_device version: %d.%d.%d length %d \n", KDeviceVersionMajor, KDeviceVersionMinor, KDeviceVersionMicro, length);
+				OstTraceExt4(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP37, "Sending t_usb_device version: %u.%u.%u length %u \n", KDeviceVersionMajor, KDeviceVersionMinor, KDeviceVersionMicro, (TUint32)length);
 				#ifdef	USB_SC
 				TUint8 *ep0Buffer;
 				TUint8 *ep0BufPtr;
 				TUint ep0Length;
 				iEp0Buf.GetInBufferRange(((TAny*&)ep0Buffer),ep0Length);
-				
+
 				ep0BufPtr = ep0Buffer;
 				*(ep0Buffer++) = KDeviceVersionMajor;
 				*(ep0Buffer++) = KDeviceVersionMinor;
@@ -1309,7 +1471,7 @@
 				*(ep0Buffer++) = 0;
 				r = iEp0Buf.WriteBuffer(ep0BufPtr,length,FALSE,ep0Status);
 				test_KErrNone(r);
-				#else				
+				#else
 				iEp0DataBuffer.FillZ(length);
 				iEp0DataBuffer[0] = KDeviceVersionMajor;
 				iEp0DataBuffer[1] = KDeviceVersionMinor;
@@ -1317,7 +1479,7 @@
 				iEp0DataBuffer.SetLength(3);
 				iEp0DataBuffer.Append (*iConfigFileName);
 				iEp0DataBuffer.Append (*iScriptFileName);
-				iEp0DataBuffer.SetLength(length);				
+				iEp0DataBuffer.SetLength(length);
 				iPort[0].Write(ep0Status, EEndpoint0, iEp0DataBuffer, length);
 				#endif
 				User::WaitForRequest(ep0Status);
@@ -1329,17 +1491,18 @@
 				TInt64 val = (value == 0 || gActiveTestCount == 0) ? iIdleCounter->iCounter : 0;
 
 				TUSB_PRINT1("Sending counter value %Ld\n", val);
+				OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP38, "Sending counter value %Ld\n", val);
 				#ifdef	USB_SC
 
 				TUint8 *ep0Buffer;
 				TUint ep0Length;
 				iEp0Buf.GetInBufferRange(((TAny*&)ep0Buffer),ep0Length);
-				
+
 				*((TInt64*) ep0Buffer) = val;
-				
+
 				r = iEp0Buf.WriteBuffer(ep0Buffer,length,FALSE,ep0Status);
 				test_KErrNone(r);
-				#else				
+				#else
 
 				iEp0DataBuffer.FillZ(length);
 				*((TInt64*) iEp0DataBuffer.Ptr()) = val;
@@ -1354,26 +1517,31 @@
 		if (iEp0SetUpPacket[KUsb_Ep0RequestOffset] != EStop && iEp0SetUpPacket[KUsb_Ep0RequestOffset] != ETestConnect &&
 			iEp0SetUpPacket[KUsb_Ep0RequestOffset] != ETestMassStorage)
 			{
-			return KErrCompletion;		
-			}				
+			return KErrCompletion;
+			}
 		}
 	else
 		{
-		TUSB_PRINT1("Error : Incorrect SetUp Packet Request Type %X", iEp0SetUpPacket[0]);			
+		TUSB_PRINT1("Error : Incorrect SetUp Packet Request Type %X", iEp0SetUpPacket[0]);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP39, "Error : Incorrect SetUp Packet Request Type %X", iEp0SetUpPacket[0]);
 		test(EFalse);
 		return KErrNone;
 		}
-	
+
 	return KErrNone;
 	}
-	
+
 void CActiveControl::PrintHostLog()
 	{
 	TRequestStatus status = 0;
 	wchar_t lineBuf[128];
 	TUint j = 0;
-	
+
 	TUSB_VERBOSE_PRINT("Reading Host log file\n");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PRINTHOSTLOG, "Reading Host log file\n");
+	    }
 
 	#ifdef USB_SC
 	TInt r = 0;
@@ -1394,6 +1562,10 @@
 		if (r == KErrCompletion)
 			{
 			TUSB_VERBOSE_PRINT1("Host log file %d bytes read\n",readSize);
+			if(gVerbose)
+			    {
+			    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_PRINTHOSTLOG_DUP01, "Host log file %d bytes read\n",readSize);
+			    }
 			scCharPtr = (TUint8 *)scReadData;
 			// Print the host log file
 			for (TUint i = 0; i < readSize; i++)
@@ -1401,14 +1573,14 @@
 				if (* scCharPtr == '\r')
 					{
 					lineBuf[j++] = '\0';
-					RDebug::Print (_L("%s"),lineBuf);
-					j = 0;	
+					OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_PRINTHOSTLOG_DUP02, "%S",*lineBuf);
+					j = 0;
 					}
 				else
 					{
 					if (* scCharPtr != '\n')
 						{
-						lineBuf[j++] = * scCharPtr;				
+						lineBuf[j++] = * scCharPtr;
 						}
 					}
 				scCharPtr++;
@@ -1417,7 +1589,7 @@
 		if (r == KErrNone)
 			{
 			User::WaitForRequest(status);
-			test_KErrNone(status.Int());	
+			test_KErrNone(status.Int());
 			}
 		}
 	while (r >= KErrNone && !readZlp);
@@ -1427,26 +1599,30 @@
 	User::WaitForRequest(status);
 	test_KErrNone(status.Int());
 	TUSB_VERBOSE_PRINT1("Host log file %d bytes read\n",readBuf.Length());
+	if(gVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_PRINTHOSTLOG_DUP03, "Host log file %d bytes read\n",readBuf.Length());
+	    }
 	for (TUint i = 0; i < readBuf.Length(); i++)
 		{
 		if (readBuf[i] == '\r')
 			{
 			lineBuf[j++] = '\0';
-			RDebug::Print (_L("%s"),lineBuf);
-			j = 0;	
+			OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_PRINTHOSTLOG_DUP04, "%s",*lineBuf);
+			j = 0;
 			}
 		else
 			{
 			if (readBuf[i] != '\n')
 				{
-				lineBuf[j++] = readBuf[i];				
+				lineBuf[j++] = readBuf[i];
 				}
 			}
 		}
 	User::Free ((TAny *)readBuf.Ptr());
 	#endif
 	}
-	
+
 void CActiveControl::QueryUsbClientL(LDDConfigPtr aLddPtr, RDEVCLIENT* aPort)
 	{
 	// Get device/endpoint capabilities
@@ -1474,7 +1650,7 @@
 
 	// Device
 	// === Device Descriptor
-	
+
 	test.Start(_L("Query device and Endpoint Capabilities"));
 
 
@@ -1485,38 +1661,55 @@
 	const TInt n = d_caps().iTotalEndpoints;
 
 	TUSB_PRINT("###  USB device capabilities:");
+	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL, "###  USB device capabilities:");
 	TUSB_PRINT1("Number of endpoints:                %d", n);
+	OstTrace1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP01, "Number of endpoints:                %d", n);
 	TUSB_PRINT1("Supports Software-Connect:          %s",
-				d_caps().iConnect ? _S("yes") : _S("no"));
+		d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP02, "Supports Software-Connect:          %s",
+				d_caps().iConnect ? _L("yes") : _S("no"));
 	TUSB_PRINT1("Device is Self-Powered:             %s",
-				d_caps().iSelfPowered ? _S("yes") : _S("no"));
+		d_caps().iSelfPowered ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP03, "Device is Self-Powered:             %s",
+				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports Remote-Wakeup:             %s",
-				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
+		d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP04, "Supports Remote-Wakeup:             %s",
+				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports High-speed:                %s",
-				d_caps().iHighSpeed ? _S("yes") : _S("no"));
+		d_caps().iHighSpeed ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP05, "Supports High-speed:                %s",
+				d_caps().iHighSpeed ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports unpowered cable detection: %s\n",
+		(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
+		_S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP06, "Supports unpowered cable detection: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-				_S("yes") : _S("no"));
+				_L("yes") : _L("no"));
 	TUSB_PRINT1("Supports endpoint resource allocation v2 scheme: %s\n",
+		(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
+		_S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP07, "Supports endpoint resource allocation v2 scheme: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
-				_S("yes") : _S("no"));					
+				_L("yes") : _L("no"));
 	TUSB_PRINT("");
+	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP08, "");
 
 	iSoftwareConnect = d_caps().iConnect;					// we need to remember this
 	test_Equal(aLddPtr->iSoftConnect,iSoftwareConnect);
 
 	iSupportResourceAllocationV2 = ((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0);
-	
+
 	// only check capabilities if set; therefore allowing them to be disabled
 	if (aLddPtr->iSelfPower)
 		{
-		test(d_caps().iSelfPowered);	
+		test(d_caps().iSelfPowered);
 		}
-	
+
 	// only check capabilities if set; therefore allowing them to be disabled
 	if (aLddPtr->iRemoteWakeup)
 		{
-		test(d_caps().iRemoteWakeup);		
+		test(d_caps().iRemoteWakeup);
 		}
 
 	test_Equal(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower,aLddPtr->iFeatures);
@@ -1524,9 +1717,9 @@
 	// only check capability if set; therefore allowing it to be disabled
 	if (aLddPtr->iHighSpeed)
 		{
-		test(d_caps().iHighSpeed);		
+		test(d_caps().iHighSpeed);
 		}
-	
+
 	test_Equal(aLddPtr->iNumEndpoints,n);
 
 	// Endpoints
@@ -1536,16 +1729,17 @@
 	test_KErrNone(r);
 
 	TUSB_PRINT("### USB device endpoint capabilities:");
+	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP09, "### USB device endpoint capabilities:");
 	for (TInt i = 0; i < n; i++)
 		{
 		const TUsbcEndpointCaps* caps = &data[i].iCaps;
-		
-		
+
+
 		TBuf<40> sizeStr(_S("unknown"));
 		if (caps->iSizes == KUsbEpNotAvailable)
 			{
-			sizeStr = _S("Not Available");	
-			}		
+			sizeStr = _S("Not Available");
+			}
 		else
 			{
 			sizeStr.SetLength(0);
@@ -1584,77 +1778,83 @@
 			if (caps->iTypesAndDir & KUsbEpTypeInterrupt)
 				typeStr.Append(_S("Interrupt "),10);
 			if (caps->iTypesAndDir & KUsbEpTypeIsochronous)
-				typeStr.Append(_S("Isochronous"),11);			
+				typeStr.Append(_S("Isochronous"),11);
 			}
-			
+
 		TBuf<20> directionStr(_S("unknown"));
-		
+
 		if (caps->iTypesAndDir & KUsbEpDirIn)
 			directionStr = _S("In");
 		if (caps->iTypesAndDir & KUsbEpDirOut)
 			directionStr = _S("Out");
 		if (caps->iTypesAndDir & KUsbEpDirBidirect)
 			directionStr = _S("Both");
-				
+
 		TUSB_PRINT4("Endpoint:%d Sizes =%s Type = %s - %s",
 					i+1,sizeStr.PtrZ(), typeStr.PtrZ(), directionStr.PtrZ());
+		OstTraceExt4(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP10, "Endpoint:%d Sizes =%S Type = %S - %S",
+					i+1,sizeStr, typeStr, directionStr);
 		}
 	TUSB_PRINT("");
+	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP11, "");
 
 	test.End();
-			
+
 	}
 
 
 void CActiveControl::AllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint)
 	{
 	TBool res = EFalse;
-	
+
 	TInt r = aPort->AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
 	if (r == KErrNone)
-		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNone"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA, "DMA allocation on endpoint %d: KErrNone", aEndpoint);
 	else if (r == KErrInUse)
-		RDebug::Print(_L("DMA allocation on endpoint %d: KErrInUse"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP01, "DMA allocation on endpoint %d: KErrInUse", aEndpoint);
 	else if (r == KErrNotSupported)
-		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNotSupported"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP02, "DMA allocation on endpoint %d: KErrNotSupported", aEndpoint);
 	else
-		RDebug::Print(_L("DMA allocation on endpoint %d: unexpected return value %d"),
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP03, "DMA allocation on endpoint %d: unexpected return value %d", aEndpoint, r);
+	#ifdef	USB_SC
+	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
+	#else
+	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
+	#endif
+
+	TUSB_PRINT2("DMA on endpoint %d %s\n",
+				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP04, "DMA on endpoint %d %S\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
+
+	if ((r == KErrNone) && !res)
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP05, "(Allocation success but negative query result: contradiction!\n");
+	else if ((r != KErrNone) && res)
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP06, "(Allocation failure but positive query result: contradiction!\n");
+	}
+
+
+void CActiveControl::DeAllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint)
+	{
+	TBool res = FALSE;
+	TInt r = aPort->DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
+	if (r == KErrNone)
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA, "DMA deallocation on endpoint %d: KErrNone", aEndpoint);
+	else if (r == KErrNotSupported)
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP01, "DMA deallocation on endpoint %d: KErrNotSupported", aEndpoint);
+	else
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP02, "DMA deallocation on endpoint %d: unexpected return value %d",
 					  aEndpoint, r);
 	#ifdef	USB_SC
 	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	#else
 	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	#endif
-	
+
 	TUSB_PRINT2("DMA on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-
-	if ((r == KErrNone) && !res)
-		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
-	else if ((r != KErrNone) && res)
-		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
-	}
-
-
-void CActiveControl::DeAllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint)
-	{
-	TBool res = FALSE;	
-	TInt r = aPort->DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
-	if (r == KErrNone)
-		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNone"), aEndpoint);
-	else if (r == KErrNotSupported)
-		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
-	else
-		RDebug::Print(_L("DMA deallocation on endpoint %d: unexpected return value %d"),
-					  aEndpoint, r);
-	#ifdef	USB_SC
-	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
-	#else
-	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
-	#endif
-	
-	TUSB_PRINT2("DMA on endpoint %d %s\n",
-				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP03, "DMA on endpoint %d %s\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 	}
 
 #ifndef USB_SC
@@ -1663,22 +1863,24 @@
 	TBool res = FALSE;
 	TInt r = aPort->AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNone"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING, "Double Buffering allocation on endpoint %d: KErrNone", aEndpoint);
 	else if (r == KErrInUse)
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrInUse"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering allocation on endpoint %d: KErrInUse", aEndpoint);
 	else if (r == KErrNotSupported)
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNotSupported"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering allocation on endpoint %d: KErrNotSupported", aEndpoint);
 	else
-		RDebug::Print(_L("Double Buffering allocation on endpoint %d: unexpected return value %d"),
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering allocation on endpoint %d: unexpected return value %d",
 					  aEndpoint, r);
 	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP04, "Double Buffering on endpoint %d %s\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 
 	if ((r == KErrNone) && !res)
-		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP05, "(Allocation success but negative query result: contradiction!\n");
 	else if ((r != KErrNone) && res)
-		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP06, "(Allocation failure but positive query result: contradiction!\n");
 	}
 
 
@@ -1686,15 +1888,17 @@
 	{
 	TInt r = aPort->DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNone"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING, "Double Buffering deallocation on endpoint %d: KErrNone", aEndpoint);
 	else if (r == KErrNotSupported)
-		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering deallocation on endpoint %d: KErrNotSupported", aEndpoint);
 	else
-		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: unexpected return value %d"),
+		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering deallocation on endpoint %d: unexpected return value %d",
 					  aEndpoint, r);
 	TBool res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
+	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering on endpoint %d %s\n",
+				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 	}
 
 #endif
@@ -1706,15 +1910,21 @@
 	if (!iSoftwareConnect)
 		{
 		iConsole->Printf(_L("This device does not support software\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE, "This device does not support software\n");
 		iConsole->Printf(_L("disconnect/reconnect\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP01, "disconnect/reconnect\n");
 		iConsole->Printf(_L("Please physically unplug and replug\n"));
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP02, "Please physically unplug and replug\n");
 		iConsole->Printf(_L("the USB cable NOW... "));
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP03, "the USB cable NOW... ");
 		}
 	iConsole->Printf(_L("\n>>> Start the t_usb_win program on the host <<<\n"));
+	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP04, "\n>>> Start the t_usb_win program on the host <<<\n");
 	User::WaitForRequest(enum_status);
 	if (enum_status != KErrNone)
 		{
 		TUSB_PRINT1("Error: Re-enumeration status = %d", enum_status.Int());
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP05, "Error: Re-enumeration status = %d", enum_status.Int());
 		return KErrGeneral;
 		}
 	TUsbcDeviceState device_state =	EUsbcDeviceStateUndefined;
@@ -1722,6 +1932,7 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device state", r);
+		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP06, "Error %d on querying device state", r);
 		}
 	else
 		{
@@ -1734,6 +1945,15 @@
 						((device_state == EUsbcDeviceStateConfigured) ? _S("Configured") :
 						 ((device_state == EUsbcDeviceStateSuspended) ? _S("Suspended") :
 						  _S("Unknown"))))))));
+		OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP07, "Current device state: %s",
+					(device_state == EUsbcDeviceStateUndefined) ? _L("Undefined") :
+					((device_state == EUsbcDeviceStateAttached) ? _L("Attached") :
+					 ((device_state == EUsbcDeviceStatePowered) ? _L("Powered") :
+					  ((device_state == EUsbcDeviceStateDefault) ? _L("Default") :
+					   ((device_state == EUsbcDeviceStateAddress) ? _L("Address") :
+						((device_state == EUsbcDeviceStateConfigured) ? _L("Configured") :
+						 ((device_state == EUsbcDeviceStateSuspended) ? _L("Suspended") :
+						  _L("Unknown"))))))));
 		}
 
 	// Check the speed of the established physical USB connection
@@ -1741,22 +1961,28 @@
 	if (iHighSpeed)
 		{
 		TUSB_PRINT("---> USB High-speed Testing\n");
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP08, "---> USB High-speed Testing\n");
 		}
 	else
 		{
 		TUSB_PRINT("---> USB Full-speed Testing\n");
+		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP09, "---> USB Full-speed Testing\n");
 		}
 
 	return KErrNone;
 	}
 
 
-#ifdef USB_SC	
+#ifdef USB_SC
 
 void CActiveControl::SetupTransferedInterface(IFConfigPtr* aIfPtr, TInt aPortNumber)
 	{
 	TInt r;
 	TUSB_VERBOSE_PRINT1("SetupTransferedInterface %d", aPortNumber);
+	if(gVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_SETUPTRANSFEREDINTERFACE, "SetupTransferedInterface %d", aPortNumber);
+	    }
 	test.Start (_L("Setup Transfered Interface "));
 
 	#ifdef USB_SC
@@ -1764,7 +1990,7 @@
 	#else
 	TUsbcInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
 	#endif
-	
+
 	TBuf8<KUsbDescSize_Interface> ifDescriptor;
 	r = iPort[aPortNumber].GetInterfaceDescriptor(0, ifDescriptor);
 	test_KErrNone(r);
@@ -1778,34 +2004,36 @@
 	if ((*aIfPtr)->iNumber != 0 && ifDescriptor[KIfcDesc_NumberOffset] != (*aIfPtr)->iNumber)
 		{
 		ifDescriptor[KIfcDesc_NumberOffset] = (*aIfPtr)->iNumber;
-		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor);	
+		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor);
 		test_KErrNone(r);
 		}
 	else
 		{
-		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];	
+		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];
 		}
 	TUint8 interfaceNumber = (*aIfPtr)->iNumber;
 	TUSB_PRINT1 ("Interface Number %d",interfaceNumber);
-		
+	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP01, "Interface Number %d",interfaceNumber);
+
 	// Check all endpoint descriptors
 	TBuf8<KUsbDescSize_AudioEndpoint> epDescriptor;
 	for (TUint i = 0; i < (*aIfPtr)->iInfoPtr->iTotalEndpointsUsed; i++)
 		{
 		if (!gSkip)
 			{
-			TestEndpointDescriptor (&iPort[aPortNumber],0,i+1,(*aIfPtr)->iInfoPtr->iEndpointData[i]);	
+			TestEndpointDescriptor (&iPort[aPortNumber],0,i+1,(*aIfPtr)->iInfoPtr->iEndpointData[i]);
 
 			}
 
 		if (firstBulkOutEndpoint < 0 && ((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirOut) &&
 			(*aIfPtr)->iInfoPtr->iEndpointData[i].iType == KUsbEpTypeBulk)
 			{
-			firstBulkOutEndpoint = i+1;	
+			firstBulkOutEndpoint = i+1;
 			}
 		}
 
 	TUSB_PRINT1 ("Interface number is %d",interfaceNumber);
+	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP02, "Interface number is %d",interfaceNumber);
 	(*aIfPtr)->iPortNumber = aPortNumber;
 	gInterfaceConfig [interfaceNumber] [0] = *aIfPtr;
 
@@ -1822,7 +2050,7 @@
 			if (ifPtr->iAlternateSetting)
 				{
 				ifc = *(ifPtr->iInfoPtr);
-					
+
 				r = iPort[aPortNumber].GetInterfaceDescriptor(alternateNumber, ifDescriptor);
 				test_KErrNone(r);
 
@@ -1842,7 +2070,7 @@
 
 					r = iPort[aPortNumber].GetEndpointDescriptor(alternateNumber, i+1, epDescriptor);
 					test_KErrNone(r);
-					
+
 					test((((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && (epDescriptor[KEpDesc_AddressOffset] & 0x80) ||
 						!((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && !(epDescriptor[KEpDesc_AddressOffset] & 0x80)) &&
 						EpTypeMask2Value((*aIfPtr)->iInfoPtr->iEndpointData[i].iType) == (TUint)(epDescriptor[KEpDesc_AttributesOffset] & 0x03) &&
@@ -1865,11 +2093,11 @@
 
 						test.Next(_L("Compare endpoint descriptor with value set"));
 						r = descriptor2.Compare(epDescriptor);
-						test_KErrNone(r);						
+						test_KErrNone(r);
 						}
 					}
-				
-					
+
+
 				// if no error move on to the next interface
 				ifPtr->iPortNumber = aPortNumber;
 				ifPtr->iNumber = interfaceNumber;
@@ -1888,21 +2116,21 @@
 	iNumInterfaceSettings[aPortNumber] = alternateNumber;
 	if (!gSkip)
 		{
-		TestInvalidSetInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);			
+		TestInvalidSetInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
 		TestInvalidReleaseInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
 
 		//TestDescriptorManipulation(iLddPtr->iHighSpeed,&iPort[aPortNumber],alternateNumber);
 		TestOtgExtensions(&iPort[aPortNumber]);
 		TestEndpoint0MaxPacketSizes(&iPort[aPortNumber]);
 		}
-		
+
 	test.End();
 	}
 
 
 void CActiveControl::ConstructLOnSharedLdd(const RMessagePtr2& aMsg)
 	{
-// currently only support one interface with one alternate settings	
+// currently only support one interface with one alternate settings
 	test.Start (_L("ConstructLOnSharedLdd Configuration"));
 
 	User::LeaveIfError(iPort[0].Open(aMsg, 0, EOwnerProcess));
@@ -1913,17 +2141,17 @@
 	User::LeaveIfError(iPort[0].GetDataTransferChunk(chunk));
 	User::LeaveIfError(chunk->Open(aMsg, 1, FALSE, EOwnerProcess));
 	CleanupStack::Pop();
-	
+
 
 	TInt r;
 
 	User::LeaveIfError(iFs.Connect());
 
 	test_Compare(iConfigFileName->Length(),!=,0);
-		
+
 	iTimer.CreateLocal();
 	iPending = EPendingNone;
-	
+
 	test.Next (_L("Open configuration file"));
 	// set the session path to use the ROM if no drive specified
 	r=iFs.SetSessionPath(_L("Z:\\test\\"));
@@ -1932,15 +2160,19 @@
 	r = iConfigFile.Open(iFs, * iConfigFileName, EFileShareReadersOnly | EFileStreamText | EFileRead);
 	test_KErrNone(r);
 	TUSB_VERBOSE_PRINT1("Configuration file %s Opened successfully", iConfigFileName->PtrZ());
+	if(gVerbose)
+	    {
+	    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD, "Configuration file %s Opened successfully", *iConfigFileName);
+	    }
 
 	test.Next (_L("Process configuration file"));
 	test(ProcessConfigFile (iConfigFile,iConsole,&iLddPtr));
-	
+
 	iConfigFile.Close();
 
 	test.Next (_L("LDD in configuration file"));
 	test_NotNull(iLddPtr);
-		
+
 	LDDConfigPtr lddPtr = iLddPtr;
 	TInt nextPort = 0;
 	while (lddPtr != NULL)
@@ -1950,20 +2182,32 @@
 		//  was already loaded at boot time.)
 		test.Next (_L("Loading USB LDD"));
 		TUSB_VERBOSE_PRINT1("Loading USB LDD ",lddPtr->iName.PtrZ());
+		if(gVerbose)
+		    {
+		    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP01, "Loading USB LDD:%S ",lddPtr->iName);
+		    }
 		r = User::LoadLogicalDevice(lddPtr->iName);
 		test(r == KErrNone || r == KErrAlreadyExists);
-	
+
 		IFConfigPtr ifPtr = lddPtr->iIFPtr;
-		
+
 		test.Next (_L("Opening Channels"));
 		TUSB_VERBOSE_PRINT1("Successfully opened USB port %d", lddPtr->iNumChannels);
+		if(gVerbose)
+		    {
+		    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP02, "Successfully opened USB port %d", lddPtr->iNumChannels);
+		    }
 		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
 			{
 			test_Compare(lddPtr->iNumChannels,>,0);
 
 			// Open USB channel
-			
+
 			TUSB_VERBOSE_PRINT("Successfully opened USB port");
+			if(gVerbose)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP03, "Successfully opened USB port");
+			    }
 
 			// Query the USB device/Setup the USB interface
 			if (portNumber == nextPort)
@@ -1971,22 +2215,22 @@
 				// Change some descriptors to contain suitable values
 				SetupDescriptors(lddPtr, &iPort[portNumber]);
 				}
-				
+
 			if (portNumber == 0)
 				{
 				QueryUsbClientL(lddPtr, &iPort[portNumber]);
 				}
 
 			test_NotNull(ifPtr);
-			
+
 			if (iSupportResourceAllocationV2)
 				{
 				PopulateInterfaceResourceAllocation(ifPtr, portNumber);
 				}
-				
+
 			IFConfigPtr defaultIfPtr = ifPtr;
 			SetupTransferedInterface(&ifPtr,portNumber);
-					
+
 
 			if (!iSupportResourceAllocationV2)
 				{
@@ -1997,17 +2241,21 @@
 					#ifndef USB_SC
 					defaultIfPtr->iEpDoubleBuff[i-1] ? AllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i) : DeAllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i);
 					#endif
-					}				
+					}
 				}
 			}
-	
+
 		iTotalChannels += lddPtr->iNumChannels;
-		nextPort += lddPtr->iNumChannels;	
-		lddPtr = lddPtr->iPtrNext;	
+		nextPort += lddPtr->iNumChannels;
+		lddPtr = lddPtr->iPtrNext;
 		}
-		
+
 	TUSB_VERBOSE_PRINT("All Interfaces and Alternate Settings successfully set up");
-	
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP04, "All Interfaces and Alternate Settings successfully set up");
+	    }
+
 	test.Next (_L("Start Idle Counter Thread"));
 	r = iIdleCounterThread.Create(_L("IdleCounter"), IdleCounterThread, KDefaultStackSize, KMinHeapSize, KMinHeapSize, NULL);
 	test_KErrNone(r);
@@ -2024,20 +2272,25 @@
 	User::After(1000000); // 1 second
 	TInt64 val2 = iIdleCounter->iCounter;
 	TUSB_PRINT1("Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
+	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP05, "Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
 
 	test.Next (_L("Enumeration..."));
 	r = ReEnumerate();
 	test_KErrNone(r);
-		
+
 	TUSB_VERBOSE_PRINT("Device successfully re-enumerated\n");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP06, "Device successfully re-enumerated\n");
+	    }
 
 
 	if (iLddPtr->iHighSpeed && !gSkip)
 		{
 		test.Next (_L("High Speed"));
-		test(iHighSpeed);	
+		test(iHighSpeed);
 		}
-			
+
 	test.Next (_L("Create Notifiers"));
 	for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 		{
@@ -2047,18 +2300,26 @@
 		test_NotNull(iDeviceStateNotifier[portNumber]);
 		iDeviceStateNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created device state notifier");
+		if(gVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP07, "Created device state notifier");
+		    }
 
 		// Create endpoint stall status active object
 		iStallNotifier[portNumber] = CActiveStallNotifier::NewL(iConsole, &iPort[portNumber]);
 		test_NotNull(iStallNotifier[portNumber]);
 		iStallNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created stall notifier");
-			
-		TestInvalidSetInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);			
+		if(gVerbose)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP08, "Created stall notifier");
+		    }
+
+		TestInvalidSetInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
 		TestInvalidReleaseInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
-			
+
 		}
-		
+
 	test.Next (_L("Endpoint Zero Max Packet Sizes"));
 	TUint ep0Size = iPort[0].EndpointZeroMaxPacketSizes();
 	switch (ep0Size)
@@ -2066,7 +2327,7 @@
 		case KUsbEpSize8 :
 			iEp0PacketSize = 8;
 			break;
-					
+
 		case KUsbEpSize16 :
 			iEp0PacketSize = 16;
 			break;
@@ -2078,10 +2339,10 @@
 		case KUsbEpSize64 :
 			iEp0PacketSize = 64;
 			break;
-					
+
 		default:
 			iEp0PacketSize = 0;
-			break;		
+			break;
 		}
 	test_Compare(iEp0PacketSize,>,0);
 
@@ -2093,9 +2354,8 @@
 	r = iPort[0].OpenEndpoint(iEp0Buf,0);
 	test_KErrNone(r);
 	#endif
-	
+
 	test.End();
-	//iSrv.Close();
 	RequestEp0ControlPacket();
 	}
 
--- a/kerneltest/e32test/usb/t_usb_device/src/activedevicestatenotifier.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activedevicestatenotifier.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -14,13 +14,17 @@
 // e32test/usb/t_usb_device/src/activestatenotifier.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-// 
+//
 //
 
 #include "general.h"
 #include "activerw.h"									// CActiveRW
 #include "config.h"
 #include "activeControl.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "activedevicestatenotifierTraces.h"
+#endif
 #include "activedevicestatenotifier.h"
 
 extern CActiveControl* gActiveControl;
@@ -64,6 +68,10 @@
 CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
+	    }
 	Cancel();												// base class
 	}
 
@@ -71,6 +79,10 @@
 void CActiveDeviceStateNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::DoCancel()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DOCANCEL, "CActiveDeviceStateNotifier::DoCancel()");
+	    }
 	iPort->AlternateDeviceStatusNotifyCancel();
 	}
 
@@ -87,37 +99,50 @@
 		case EUsbcDeviceStateUndefined:
 #ifdef	USB_SC
 			TUSB_PRINT("Device State notifier: Undefined0");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL, "Device State notifier: Undefined0");
 			for (TUint16 i =0; i < KMaxConcurrentTests; i++)
 				{
 				if (gRW[i])
 					{
 					TUSB_VERBOSE_PRINT2("ResetAltSetting index %d, LDD %x",i, gRW[i]->Ldd());
-					gRW[i]->Ldd()->ResetAltSetting();						
+					if(gVerbose)
+					    {
+					    OstTraceExt2(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01, "ResetAltSetting index %u, LDD %x",(TUint32)i, (TUint32)gRW[i]->Ldd());
+					    }
+					gRW[i]->Ldd()->ResetAltSetting();
 					}
 				}
 #endif
 			TUSB_PRINT("Device State notifier: Undefined");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02, "Device State notifier: Undefined");
 			break;
 		case EUsbcDeviceStateAttached:
 			TUSB_PRINT("Device State notifier: Attached");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03, "Device State notifier: Attached");
 			break;
 		case EUsbcDeviceStatePowered:
 			TUSB_PRINT("Device State notifier: Powered");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04, "Device State notifier: Powered");
 			break;
 		case EUsbcDeviceStateDefault:
 			TUSB_PRINT("Device State notifier: Default");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05, "Device State notifier: Default");
 			break;
 		case EUsbcDeviceStateAddress:
 			TUSB_PRINT("Device State notifier: Address");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06, "Device State notifier: Address");
 			break;
 		case EUsbcDeviceStateConfigured:
 			TUSB_PRINT("Device State notifier: Configured");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07, "Device State notifier: Configured");
 			break;
 		case EUsbcDeviceStateSuspended:
 			TUSB_PRINT("Device State notifier: Suspended");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08, "Device State notifier: Suspended");
 			break;
 		default:
 			TUSB_PRINT("Device State notifier: ***BAD***");
+			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09, "Device State notifier: ***BAD***");
 			}
 		}
 	else if (iDeviceState & KUsbAlternateSetting)
@@ -125,7 +150,9 @@
 		TUint8 altSetting = iDeviceState & ~KUsbAlternateSetting;
 		TUSB_PRINT2("Device State notifier: Alternate interface %d setting has changed: now %d",
 					iPortNumber, altSetting);
-					
+		OstTraceExt2(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP10, "Device State notifier: Alternate interface %u setting has changed: now %u",
+					(TUint32)iPortNumber, (TUint32)altSetting);
+
 		TUsbDeviceCaps dCaps;
 		iPort->DeviceCaps(dCaps);
 		TBool isResourceAllocationV2 = ((dCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0);
@@ -148,12 +175,12 @@
 							newIfPtr->iEpDoubleBuff[i-1] ? gActiveControl->AllocateDoubleBuffering(iPort,(TENDPOINTNUMBER)i) : gActiveControl->DeAllocateDoubleBuffering(iPort,(TENDPOINTNUMBER)i);
 							#endif
 							}
-						break;				
+						break;
 						}
 					}
 				}
-			}	
-						
+			}
+
 		if (gAltSettingOnNotify)
 			{
 			for (TUint16 i =0; i < KMaxConcurrentTests; i++)
@@ -161,7 +188,11 @@
 				if (gRW[i])
 					{
 					TUSB_VERBOSE_PRINT1("Resuming alternate Setting - activeRW index %d",i);
-					gRW[i]->ResumeAltSetting(altSetting);						
+					if(gVerbose)
+					    {
+					    OstTrace1(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP11, "Resuming alternate Setting - activeRW index %d",i);
+					    }
+					gRW[i]->ResumeAltSetting(altSetting);
 					}
 				}
 			}
--- a/kerneltest/e32test/usb/t_usb_device/src/activerw.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activerw.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -14,14 +14,19 @@
 // e32test/usb/t_usb_device/src/activerw.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-// 
+//
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
 #include "config.h"
 #include "activerw.h"
-#include "activetimer.h" 
+#include "activetimer.h"
 #include "usblib.h"										// Helpers
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "activerwTraces.h"
+#endif
+
 
 _LIT(KFileName, "\\T_USBFILE.BIN");
 
@@ -47,7 +52,7 @@
 	: CActive(EPriorityNormal),
 		#ifndef USB_SC
 		iWriteBuf((TUint8 *)NULL,0,0),		// temporary initialisation
-		iReadBuf((TUint8 *)NULL,0,0),		// temporary initialisation	
+		iReadBuf((TUint8 *)NULL,0,0),		// temporary initialisation
 	  	#endif
 	  iConsole(aConsole),
 	  iPort(aPort),
@@ -66,11 +71,17 @@
 	{
 	gActiveTestCount++;
 	TUSB_VERBOSE_PRINT("CActiveRW::CActiveRW()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CACTIVERW, "CActiveRW::CActiveRW()");
+	    }
 	}
 
 
 CActiveRW* CActiveRW::NewL(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting)
 	{
+	//TUSB_VERBOSE_APRINT("CActiveRW::NewL()");
+	//OstTrace0(TRACE_NORMAL, CACTIVERW_NEWL, "CActiveRW::NewL()");
 
 	CActiveRW* self = new (ELeave) CActiveRW(aConsole, aPort, aFs, aIndex, aLastSetting);
 	CleanupStack::PushL(self);
@@ -84,12 +95,17 @@
 void CActiveRW::ConstructL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ConstructL()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CONSTRUCTL, "CActiveRW::ConstructL()");
+	    }
 
 	// Create read timeout timer active object (but don't activate it yet)
 	iTimeoutTimer = CActiveTimer::NewL(iConsole, iPort);
 	if (!iTimeoutTimer)
 		{
 		TUSB_PRINT("Failed to create timeout timer");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_CONSTRUCTL_DUP01, "Failed to create timeout timer");
 		}
 	}
 
@@ -97,6 +113,10 @@
 CActiveRW::~CActiveRW()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::~CActiveRW()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DCACTIVERW, "CActiveRW::~CActiveRW()");
+	    }
 	Cancel();												// base class
 	delete iTimeoutTimer;
 	#ifdef USB_SC
@@ -122,7 +142,7 @@
 	{
 	iBufSz = aTpPtr->minSize;
 	iPktNum = aTpPtr->packetNumber;
-	
+
 	iTestParams = *aTpPtr;
 
 	gYieldRepeat = ((iTestParams.settingRepeat != 0) || (iIndex == 0))? 0 : KYieldRepeat;
@@ -134,26 +154,38 @@
 		if (newBuffer == NULL)
 			{
 			TUSB_PRINT ("Failure to allocate heap memory");
+			OstTrace0 (TRACE_ERROR, CACTIVERW_SETTESTPARAMS, "Failure to allocate heap memory");
 			test(EFalse);
 			}
 		iReadBuf.Set((TUint8 *)newBuffer,0,(TInt)aTpPtr->maxSize);
 		#endif
 		TBuf8<KUsbDescSize_Endpoint> descriptor;
 		TUSB_VERBOSE_PRINT2 ("GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.outPipe);
+		if(gVerbose)
+		    {
+		    OstTraceExt2 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP01, "GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.outPipe);
+		    }
 		TInt r = iPort->GetEndpointDescriptor(iTestParams.alternateSetting, (TENDPOINTNUMBER)iTestParams.outPipe, descriptor);
 		if ((TUint)r != iReadSize)
 			{
 			TUSB_PRINT("Failed to get endpoint descriptor");
+			OstTrace0(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP02, "Failed to get endpoint descriptor");
 			test(EFalse);
 			return;
 			}
 
-		iMaxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);		
+		iMaxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);
 		TUSB_VERBOSE_PRINT5 ("Out Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
 			descriptor[KEpDesc_AddressOffset],descriptor[KEpDesc_AttributesOffset],iTestParams.interfaceNumber,iTestParams.alternateSetting,iMaxPktSz);
+		if(gVerbose)
+		    {
+		    OstTraceExt5 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP03, "Out Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
+			(TUint)descriptor[KEpDesc_AddressOffset],(TUint)descriptor[KEpDesc_AttributesOffset],(TUint)iTestParams.interfaceNumber,(TUint)iTestParams.alternateSetting,(TUint)iMaxPktSz);
+		    }
 		if (!gSkip && iMaxPktSz != (TUint)gInterfaceConfig[iTestParams.interfaceNumber][iTestParams.alternateSetting]->iInfoPtr->iEndpointData[iTestParams.outPipe-1].iSize)
 			{
 			TUSB_PRINT4("Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iMaxPktSz);
+			OstTraceExt4(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP04, "Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iMaxPktSz);
 			test(EFalse);
 			return;
 			}
@@ -165,31 +197,43 @@
 		if (newBuffer == NULL)
 			{
 			TUSB_PRINT ("Failure to allocate heap memory");
+			OstTrace0 (TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP05, "Failure to allocate heap memory");
 			test(EFalse);
 			}
 		iWriteBuf.Set((TUint8 *)newBuffer,0,(TInt)aTpPtr->maxSize);
 		#endif
 		TBuf8<KUsbDescSize_Endpoint> descriptor;
 		TUSB_VERBOSE_PRINT2 ("GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.inPipe);
+		if(gVerbose)
+		    {
+		    OstTraceExt2 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP06, "GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.inPipe);
+		    }
 		TInt r = iPort->GetEndpointDescriptor(iTestParams.alternateSetting, (TENDPOINTNUMBER)iTestParams.inPipe, descriptor);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT("Failed to get endpoint descriptor");
+			OstTrace0(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP07, "Failed to get endpoint descriptor");
 			test(EFalse);
 			return;
 			}
 
-		TInt maxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);		
+		TInt maxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);
 		TUSB_VERBOSE_PRINT5 ("In Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
 			descriptor[KEpDesc_AddressOffset],descriptor[KEpDesc_AttributesOffset],iTestParams.interfaceNumber,iTestParams.alternateSetting,maxPktSz);
+		if(gVerbose)
+		    {
+		    OstTraceExt5 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP08, "In Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
+			descriptor[KEpDesc_AddressOffset],descriptor[KEpDesc_AttributesOffset],iTestParams.interfaceNumber,iTestParams.alternateSetting,maxPktSz);
+		    }
 		if (!gSkip && maxPktSz != gInterfaceConfig[iTestParams.interfaceNumber][iTestParams.alternateSetting]->iInfoPtr->iEndpointData[iTestParams.inPipe-1].iSize)
 			{
 			TUSB_PRINT4("Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe,maxPktSz);
+			OstTraceExt4(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP09, "Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe,maxPktSz);
 			test(EFalse);
 			return;
 			}
 		}
-		
+
 	}
 
 
@@ -207,8 +251,16 @@
 	{
 	if (aType == ESuspend)
 		TUSB_VERBOSE_PRINT1("Index %d Suspend",iIndex);
+		if(gVerbose)
+		    {
+		    OstTrace1(TRACE_VERBOSE, CACTIVERW_SUSPEND, "Index %d Suspend",iIndex);
+		    }
 	if (aType == EAltSetting)
-		TUSB_VERBOSE_PRINT3("Index %d Suspend for Alternate Setting - interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);	
+		TUSB_VERBOSE_PRINT3("Index %d Suspend for Alternate Setting - interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
+		if(gVerbose)
+		    {
+		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_SUSPEND_DUP01, "Index %d Suspend for Alternate Setting - interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
+		    }
 	iStatus = KRequestPending;
 	iCurrentXfer = aType;
 	if (!IsActive())
@@ -218,8 +270,12 @@
 	}
 
 void CActiveRW::Resume()
-	{	
+	{
 	TUSB_VERBOSE_PRINT3("Index %d Resume interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
+	if(gVerbose)
+	    {
+	    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_RESUME, "Index %d Resume interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
+	    }
 	TRequestStatus* status = &iStatus;
 	User::RequestComplete(status,KErrNone);
 	if (!IsActive())
@@ -231,8 +287,12 @@
 void CActiveRW::Yield()
 	{
 	TUSB_VERBOSE_PRINT1("Index %d Scheduler Yield",iIndex);
+	if(gVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_YIELD, "Index %d Scheduler Yield",iIndex);
+	    }
 	// removes the active object from the scheduler queue then adds it back in again
-	Deque();	
+	Deque();
 	CActiveScheduler::Add(this);
 	}
 
@@ -247,7 +307,7 @@
 void CActiveRW::StartOrSuspend()
 	{
 	TInt altSetting;
-	
+
 	iPort->GetAlternateSetting (altSetting);
 	if (iTestParams.alternateSetting != altSetting)
 		{
@@ -262,9 +322,17 @@
 			gSettingNumber[iTestParams.interfaceNumber] = iTestParams.alternateSetting;
 			r = iPort->StartNextOutAlternateSetting(ETrue);
 			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
+			if(gVerbose)
+			    {
+			    OstTrace1(TRACE_VERBOSE, CACTIVERW_STARTORSUSPEND, "StartNextOutAlternateSetting retValue %d",r);
+			    }
 			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)   || (r == KErrGeneral));
 			}
 		TUSB_VERBOSE_PRINT4 ("CActiveRW::StartOrSuspend() interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
+		if(gVerbose)
+		    {
+		    OstTraceExt4 (TRACE_VERBOSE, CACTIVERW_STARTORSUSPEND_DUP01, "CActiveRW::StartOrSuspend() interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
+		    }
 		if ((TENDPOINTNUMBER)iTestParams.outPipe <= KMaxEndpointsPerClient)
 			{
 			r = iPort->OpenEndpoint(iSCReadBuf,iTestParams.outPipe);
@@ -290,10 +358,10 @@
 			SendData();										// or we send data
 			if (iXferMode == ETransmitOnly)
 				{
-				iPktNum++;				
-				iRepeat++;		
+				iPktNum++;
+				iRepeat++;
 				}
-			}	
+			}
 		}
 	}
 
@@ -302,18 +370,24 @@
 	#ifdef USB_SC
 	TInt r = 0;
 	#else
-	TInt altSetting;	
+	TInt altSetting;
 	#endif
-	
+
 	TUSB_VERBOSE_PRINT("CActiveRW::RunL()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RUNL, "CActiveRW::RunL()");
+	    }
 
 	if ((iStatus != KErrNone) && (iStatus != KErrEof))
 		{
 		TUSB_PRINT1("Error %d in RunL", iStatus.Int());
+		OstTrace1(TRACE_NORMAL, CACTIVERW_RUNL_DUP01, "Error %d in RunL", iStatus.Int());
 		}
 	if (iDoStop)
 		{
 		TUSB_PRINT("Stopped");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP02, "Stopped");
 		iDoStop = EFalse;
 		return;
 		}
@@ -334,18 +408,26 @@
 		#endif
 		if (iTestParams.settingRepeat  && ((iRepeat < iTestParams.repeat) || !iLastSetting))
 			{
-			gRW[iTestParams.afterIndex]->Resume();			
+			gRW[iTestParams.afterIndex]->Resume();
 			}
-		Suspend(ESuspend);	
+		Suspend(ESuspend);
 		break;
-			
+
 	case ESuspend:
 		#ifdef USB_SC
-		TUSB_VERBOSE_PRINT3("Index %d Resumed interface %d setting test=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);	
+		TUSB_VERBOSE_PRINT3("Index %d Resumed interface %d setting test=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
+		if(gVerbose)
+		    {
+		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_RUNL_DUP03, "Index %d Resumed interface %d setting test=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
+		    }
 		if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
 			{
 			r = iPort->StartNextOutAlternateSetting(ETrue);
 			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
+			if(gVerbose)
+			    {
+			    OstTrace1(TRACE_VERBOSE, CACTIVERW_RUNL_DUP04, "StartNextOutAlternateSetting retValue %d",r);
+			    }
 			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)  || (r == KErrGeneral));
 			if (r != KErrNotReady)
 				{
@@ -359,7 +441,11 @@
 			}
 		#else
 		iPort->GetAlternateSetting (altSetting);
-		TUSB_VERBOSE_PRINT4("Index %d Resumed interface %d setting test=%d actual=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting,altSetting);	
+		TUSB_VERBOSE_PRINT4("Index %d Resumed interface %d setting test=%d actual=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting,altSetting);
+		if(gVerbose)
+		    {
+		    OstTraceExt4(TRACE_VERBOSE, CACTIVERW_RUNL_DUP05, "Index %d Resumed interface %d setting test=%d actual=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting,altSetting);
+		    }
 		if (gAltSettingOnNotify)
 			{
 			if (iTestParams.alternateSetting != altSetting)
@@ -369,16 +455,20 @@
 				}
 			}
 		#endif
-			
+
 		// If alternate setting is ok drops through to EAltSetting to start next read or write
 		iCurrentXfer = EAltSetting;
-			
+
 	case EAltSetting:
 		#ifdef USB_SC
 		if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
 			{
 			r = iPort->StartNextOutAlternateSetting(ETrue);
 			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
+			if(gVerbose)
+			    {
+			    OstTrace1(TRACE_VERBOSE, CACTIVERW_RUNL_DUP06, "StartNextOutAlternateSetting retValue %d",r);
+			    }
 			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)   || (r == KErrGeneral));
 			if (r != KErrNotReady)
 				{
@@ -391,6 +481,10 @@
 				}
 			}
 		TUSB_VERBOSE_PRINT4 ("CActiveRW::Runl() EAltSetting interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
+		if(gVerbose)
+		    {
+		    OstTraceExt4 (TRACE_VERBOSE, CACTIVERW_RUNL_DUP07, "CActiveRW::Runl() EAltSetting interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
+		    }
 		if ((TENDPOINTNUMBER)iTestParams.outPipe <= KMaxEndpointsPerClient)
 			{
 			r = iPort->OpenEndpoint(iSCReadBuf,iTestParams.outPipe);
@@ -409,15 +503,15 @@
 			if (iReadSize != 0)
 				{
 				ProcessReadXfer();
-				}		
+				}
 			}
 		else
 			{
 			SendData();										// or we send data
 			if (iXferMode == ETransmitOnly)
 				{
-				iPktNum++;				
-				iRepeat++;		
+				iPktNum++;
+				iRepeat++;
 				}
 			}
 		break;
@@ -425,7 +519,7 @@
 	case EWriteXfer:
 		ProcessWriteXfer();
 		break;
-		
+
 	case EReadXfer:
 		#ifdef USB_SC
 		iReadSize = ReadData();
@@ -438,9 +532,10 @@
 		ProcessReadXfer();
 		#endif
 		break;
-		
+
 	default:
 		TUSB_PRINT("Oops. (Shouldn't end up here...)");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP08, "Oops. (Shouldn't end up here...)");
 		break;
 		}
 	return;
@@ -451,7 +546,7 @@
 	if (iXferMode == ETransmitOnly)
 		{
 		if (iTestParams.settingRepeat && iRepeat)
-			{	
+			{
 			if (((iRepeat % iTestParams.settingRepeat) == 0) || (iRepeat >= iTestParams.repeat))
 				{
 				if ((iRepeat < iTestParams.repeat) || !iLastSetting)
@@ -462,12 +557,12 @@
 						test_KErrNone(iSCWriteBuf.Close());
 						}
 					#endif
-					gRW[iTestParams.afterIndex]->Resume();			
+					gRW[iTestParams.afterIndex]->Resume();
 					}
 				if (iRepeat < iTestParams.repeat)
 					{
-					Suspend(ESuspend);	
-					return;					
+					Suspend(ESuspend);
+					return;
 					}
 				}
 			}
@@ -482,8 +577,8 @@
 					Yield();
 					}
 				}
-			SendData();							// next we send data			
-			iPktNum++;				
+			SendData();							// next we send data
+			iPktNum++;
 			iRepeat++;
 			}
 		else
@@ -509,6 +604,7 @@
 	if ((iReadOffset + iReadSize) > iBufSz)
 		{
 		TUSB_PRINT2("*** rcv'd too much data: 0x%x (expected: 0x%x)", iReadOffset + iReadSize, iBufSz);
+		OstTraceExt2(TRACE_NORMAL, CACTIVERW_PROCESSREADXFER, "*** rcv'd too much data: 0x%x (expected: 0x%x)", iReadOffset + iReadSize, iBufSz);
 		test(EFalse);
 		}
 
@@ -520,10 +616,11 @@
 			const TUint32 num = *reinterpret_cast<const TUint32*>(iSCReadData);
 			#else
 			const TUint32 num = *reinterpret_cast<const TUint32*>(iReadBuf.Ptr());
-			#endif	
+			#endif
 			if (num != iPktNum)
 				{
 				TUSB_PRINT3("*** Repeat %d rcv'd wrong pkt number: 0x%x (expected: 0x%x)", iRepeat, num, iPktNum);
+				OstTraceExt3(TRACE_NORMAL, CACTIVERW_PROCESSREADXFER_DUP01, "*** Repeat %d rcv'd wrong pkt number: 0x%x (expected: 0x%x)", (TInt32)iRepeat, (TInt32)num, (TInt32)iPktNum);
 				iPktNum = num;
 				test(EFalse);
 				}
@@ -534,15 +631,19 @@
 			#ifdef USB_SC
 			TPtr8 readBuf((TUint8 *)iSCReadData,iReadSize,iReadSize);
 			WriteBufferToDisk(readBuf, iReadSize);
-			#else	
+			#else
 			TUSB_VERBOSE_PRINT2("Max Buffer Size = %d (iReadBuf.Size(): %d)", iTestParams.maxSize, iReadBuf.Size());
+			if(gVerbose)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_PROCESSREADXFER_DUP02, "Max Buffer Size = %u (iReadBuf.Size(): %d)", (TUint32)iTestParams.maxSize, (TUint32)iReadBuf.Size());
+			    }
 			WriteBufferToDisk(iReadBuf, iTestParams.maxSize);
 			#endif
-			}		
+			}
 		iReadOffset += iReadSize;
 		if (iReadOffset >= iBufSz)
 			{
-			iReadOffset = 0;			
+			iReadOffset = 0;
 			}
 		else
 			{
@@ -559,7 +660,7 @@
 		iRepeat++;
 		iReadSize = 0;
 		if (iTestParams.settingRepeat)
-			{	
+			{
 			if (((iRepeat % iTestParams.settingRepeat) == 0) || (iRepeat >= iTestParams.repeat))
 				{
 				#ifdef USB_SC
@@ -570,12 +671,12 @@
 				#endif
 				if ((iRepeat < iTestParams.repeat) || !iLastSetting)
 					{
-					gRW[iTestParams.afterIndex]->Resume();			
+					gRW[iTestParams.afterIndex]->Resume();
 					}
 				if (iRepeat < iTestParams.repeat)
 					{
-					Suspend(ESuspend);	
-					return;					
+					Suspend(ESuspend);
+					return;
 					}
 				}
 			}
@@ -595,9 +696,9 @@
 			if (!IsActive())
 				{
 				SetActive();
-				}	
+				}
 			#else
-			iReadSize = ReadData();			
+			iReadSize = ReadData();
 			#endif
 			}
 		else
@@ -623,13 +724,14 @@
 				if (num != iPktNum)
 					{
 					TUSB_PRINT2("*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
+					OstTraceExt2(TRACE_NORMAL, CACTIVERW_PROCESSREADXFER_DUP03, "*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
 					}
 				}
 			}
 		iReadOffset += iReadSize;
 		if (iReadOffset >= iBufSz)
 			{
-			iReadOffset = 0;			
+			iReadOffset = 0;
 			}
 		else
 			{
@@ -652,13 +754,13 @@
 		iRepeat++;
 		iReadSize = 0;
 		if (iTestParams.settingRepeat)
-			{	
+			{
 			if (((iRepeat % iTestParams.settingRepeat) == 0) || (iRepeat >= iTestParams.repeat))
 				{
 				if (iRepeat < iTestParams.repeat)
 					{
 					SendWaitSetting();
-					return;					
+					return;
 					}
 				else
 					{
@@ -671,15 +773,15 @@
 						{
 						test_KErrNone(iSCWriteBuf.Close());
 						}
-					#endif	
+					#endif
 					if (!iLastSetting)
 						{
-						gRW[iTestParams.afterIndex]->Resume();			
+						gRW[iTestParams.afterIndex]->Resume();
 						}
 					}
 				}
 			}
-			
+
 		if ((iTestParams.repeat == 0) || (iRepeat < iTestParams.repeat))
 			{
 			// Yield the scheduler to ensure other activeObjects can run
@@ -690,12 +792,12 @@
 					Yield();
 					}
 				}
-			SendData();				
+			SendData();
 			}
 		else
 			{
 			TestComplete(ETrue);
-			}	
+			}
 		}
 
 	return;
@@ -720,7 +822,7 @@
 		}
 	}
 
-	
+
 void CActiveRW::SendData()
 	{
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 663));
@@ -735,7 +837,7 @@
 		}
 	if (iBufSz > 3)
 		*reinterpret_cast<TUint32*>(inBuffer) = iPktNum;
-	
+
 	if (iXferMode == ELoopComp)
 		{
 		for (TUint i = 4; i < iBufSz; i++)
@@ -744,6 +846,10 @@
 			}
 		}
 	TUSB_VERBOSE_PRINT3("SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
+	if(gVerbose)
+	    {
+	    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_SENDDATA, "SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
+	    }
 	iCurrentXfer = EWriteXfer;
 	TInt r = iSCWriteBuf.WriteBuffer(inBuffer, iBufSz, FALSE, iStatus);
 	test_KErrNone(r);
@@ -764,6 +870,10 @@
 		}
 
 	TUSB_VERBOSE_PRINT3("SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
+	if(gVerbose)
+	    {
+	    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_SENDDATA_DUP01, "SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
+	    }
 	iCurrentXfer = EWriteXfer;
 	iPort->Write(iStatus, (TENDPOINTNUMBER)iTestParams.inPipe, iWriteBuf, iBufSz);
 	#endif
@@ -781,6 +891,7 @@
 	iFileName.Format(_L("%c:"), aDriveLetter.operator TUint());
 	iFileName.Append(KFileName);
 	TUSB_PRINT1("\nFilename = %S", &iFileName);
+	OstTraceExt1(TRACE_NORMAL, CACTIVERW_WRITETODISK, "\nFilename = %S", iFileName);
 
 	// open the record file
 	r = iFile.Replace(iFs, iFileName, EFileWrite);
@@ -788,10 +899,11 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFile::Replace() returned %d", r);
+		OstTrace1(TRACE_ERROR, CACTIVERW_WRITETODISK_DUP01, "RFile::Replace() returned %d", r);
 		iDiskAccessEnabled = EFalse;
 		return r;
 		}
-		
+
 	return r;
 	}
 
@@ -804,13 +916,16 @@
 	iFileName.Format(_L("%c:"), aDriveLetter.operator TUint());
 	iFileName.Append(KFileName);
 	TUSB_PRINT1("\nFilename = %S", &iFileName);
+	OstTraceExt1(TRACE_NORMAL, CACTIVERW_READFROMDISK, "\nFilename = %S", iFileName);
 	TUSB_PRINT1("File size: %d", aMaxFileSize);
+	OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP01, "File size: %d", aMaxFileSize);
 
 	// First create the file & fill it
 	r = iFile.Replace(iFs, iFileName, EFileWrite);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFile::Replace() returned %d", r);
+		OstTrace1(TRACE_ERROR, CACTIVERW_READFROMDISK_DUP02, "RFile::Replace() returned %d", r);
 		iDiskAccessEnabled = EFalse;
 		return r;
 		}
@@ -822,24 +937,28 @@
 		buffer[n] = static_cast<TUint8>(n & 0x000000ff);
 		}
 	TUSB_PRINT("Writing data to file (this may take some minutes...)");
+	OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP03, "Writing data to file (this may take some minutes...)");
 	for (TInt n = 0; n < aMaxFileSize; n += KBufferSize)
 		{
 		r = iFile.Write(buffer, KBufferSize);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("RFile::Write() returned %d (disk full?)", r);
+			OstTrace1(TRACE_ERROR, CACTIVERW_READFROMDISK_DUP04, "RFile::Write() returned %d (disk full?)", r);
 			iFile.Close();
 			iDiskAccessEnabled = EFalse;
 			return r;
 			}
 		}
 	TUSB_PRINT("Done.");
+	OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP05, "Done.");
 	iFile.Close();
 	// Now open the file for reading
 	r = iFile.Open(iFs, iFileName, EFileRead);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFile::Open() returned %d", r);
+		OstTrace1(TRACE_ERROR, CACTIVERW_READFROMDISK_DUP06, "RFile::Open() returned %d", r);
 		iDiskAccessEnabled = EFalse;
 		return r;
 		}
@@ -852,10 +971,15 @@
 void CActiveRW::WriteBufferToDisk(TDes8& aBuffer, TInt aLen)
 	{
 	TUSB_VERBOSE_PRINT1("CActiveRW::WriteBufferToDisk(), len = %d", aLen);
+	if(gVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_WRITEBUFFERTODISK, "CActiveRW::WriteBufferToDisk(), len = %d", aLen);
+	    }
 	TInt r = iFile.Write(aBuffer, aLen);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error writing to %S (%d)", &iFileName, r);
+		OstTraceExt2(TRACE_ERROR, CACTIVERW_WRITEBUFFERTODISK_DUP01, "Error writing to %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -869,15 +993,22 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error reading from %S (%d)", &iFileName, r);
+		OstTraceExt2(TRACE_ERROR, CACTIVERW_READBUFFERFROMDISK, "Error reading from %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
 	TInt readLen = aBuffer.Length();
 	TUSB_VERBOSE_PRINT1("CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
+	if(gVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVERW_READBUFFERFROMDISK_DUP01, "CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
+	    }
 	if (readLen < aLen)
 		{
 		TUSB_PRINT3("Only %d bytes of %d read from file %S)",
 					readLen, aLen, &iFileName);
+		OstTraceExt3(TRACE_NORMAL, CACTIVERW_READBUFFERFROMDISK_DUP02, "Only %d bytes of %d read from file %S)",
+					readLen, aLen, iFileName);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -890,13 +1021,17 @@
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 664));
 	iCurrentXfer = EReadXfer;
 	#ifdef	USB_SC
-	TUint readSize = 0;			// note that this returns zero when asynchronous read is pending 
+	TUint readSize = 0;			// note that this returns zero when asynchronous read is pending
 	TInt r = 0;
 	do
 		{
 		r = iSCReadBuf.GetBuffer (iSCReadData,readSize,iReadZlp,iStatus);
 		test_Value(r, (r == KErrNone) || (r == KErrCompletion) || (r == KErrEof));
-		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d DataPtr 0x%x Size %d", r, iStatus.Int(),iSCReadData,readSize);	
+		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d DataPtr 0x%x Size %d", r, iStatus.Int(),iSCReadData,readSize);
+		if(gVerbose)
+		    {
+		    OstTraceExt4(TRACE_VERBOSE, CACTIVERW_READDATA, "Get Buffer Return code %d Status %d DataPtr 0x%x Size %d", r, iStatus.Int(),(TInt)iSCReadData,readSize);
+		    }
 		}
 	while ((r == KErrCompletion && readSize == 0) || (r == KErrEof));
 	if (r == KErrCompletion)
@@ -917,12 +1052,20 @@
 		{
 		// Testing the packet version of Read()
 		TUSB_VERBOSE_PRINT3("ReadData (single packet) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
+		if(gVerbose)
+		    {
+		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_READDATA_DUP01, "ReadData (single packet) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
+		    }
 		iPort->ReadPacket(iStatus, (TENDPOINTNUMBER)iTestParams.outPipe, iReadBuf, iBufSz);
 		}
 	else if ((TUint)iBufSz == iTestParams.maxSize)
 		{
 		// Testing the two-parameter version
 		TUSB_VERBOSE_PRINT3("ReadData (w/o length) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
+		if(gVerbose)
+		    {
+		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_READDATA_DUP02, "ReadData (w/o length) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
+		    }
 		iPort->Read(iStatus, (TENDPOINTNUMBER)iTestParams.outPipe, iReadBuf);
 		}
 	else
@@ -930,6 +1073,10 @@
 		// otherwise, we use the universal default version
 		// Testing the three-parameter version
 		TUSB_VERBOSE_PRINT3("ReadData (normal) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
+		if(gVerbose)
+		    {
+		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_READDATA_DUP03, "ReadData (normal) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
+		    }
 		iPort->Read(iStatus, (TENDPOINTNUMBER)iTestParams.outPipe, iReadBuf, iBufSz);
 		}
 	if (!IsActive())
@@ -946,9 +1093,11 @@
 	if (!IsActive())
 		{
 		TUSB_PRINT("CActiveRW::Stop(): Not active");
+		OstTrace0(TRACE_NORMAL, CACTIVERW_STOP, "CActiveRW::Stop(): Not active");
 		return;
 		}
 	TUSB_PRINT("Cancelling outstanding transfer requests\n");
+	OstTrace0(TRACE_NORMAL, CACTIVERW_STOP_DUP01, "Cancelling outstanding transfer requests\n");
 	iBufSz = 0;
 	iPktNum = 0;
 	iDoStop = ETrue;
@@ -960,18 +1109,26 @@
 void CActiveRW::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::DoCancel()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DOCANCEL, "CActiveRW::DoCancel()");
+	    }
 	// Canceling the transfer requests can be done explicitly
 	// for every transfer...
 	iPort->WriteCancel((TENDPOINTNUMBER)iTestParams.inPipe);
 	iPort->ReadCancel((TENDPOINTNUMBER)iTestParams.outPipe);
 	// or like this:
-	// iPort->EndpointTransferCancel(~0);	
+	// iPort->EndpointTransferCancel(~0);
 	}
 
 
 TBool CActiveRW::CompareBuffers()
 	{
 	TUSB_VERBOSE_PRINT2("CActiveRW::CompareBuffers() ReadOffset %d ReadSize %d",iReadOffset,iReadSize);
+	if(gVerbose)
+	    {
+	    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS, "CActiveRW::CompareBuffers() ReadOffset %d ReadSize %d",iReadOffset,iReadSize);
+	    }
 	#ifdef USB_SC
 	TUint8 *readPtr = reinterpret_cast<TUint8*>(iSCReadData);
 	TUint8* writePtr;
@@ -984,8 +1141,10 @@
 		#ifdef USB_SC
 		if (*readPtr != *writePtr)
 			{
-			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset); 
-			TUSB_PRINT2 ("*** Read byte 0x%x Write byte 0x%x",*readPtr,*writePtr); 
+			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset);
+			OstTraceExt3 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP01, "*** Error while comparing tx & rx buffers packet 0x%x length %u index %u",iPktNum, (TUint32)iReadSize,(TUint32)(i + iReadOffset));
+			TUSB_PRINT2 ("*** Read byte 0x%x Write byte 0x%x",*readPtr,*writePtr);
+			OstTraceExt2 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP02, "*** Read byte 0x%x Write byte 0x%x",*readPtr,*writePtr);
 			return EFalse;
 			}
 		readPtr++;
@@ -993,17 +1152,26 @@
 		#else
 		if (iReadBuf[i] != iWriteBuf[i + iReadOffset])
 			{
-			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset); 
+			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset);
+			OstTraceExt3 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP03, "*** Error while comparing tx & rx buffers packet 0x%x length %u index %u",(TUint32)iPktNum, (TUint32)iReadSize,(TUint32)(i + iReadOffset));
 			TUSB_PRINT5 ("WriteBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
-				iWriteBuf[i], iWriteBuf[i+1], iWriteBuf[i+2], iWriteBuf[i+3], iWriteBuf[i+4]); 
+				iWriteBuf[i], iWriteBuf[i+1], iWriteBuf[i+2], iWriteBuf[i+3], iWriteBuf[i+4]);
+			OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP04, "WriteBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
+				iWriteBuf[i], iWriteBuf[i+1], iWriteBuf[i+2], iWriteBuf[i+3], iWriteBuf[i+4]);
 			TUSB_PRINT5 ("ReadBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
 				iReadBuf[i], iReadBuf[i+1], iReadBuf[i+2], iReadBuf[i+3], iReadBuf[i+4]);
+			OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP05, "ReadBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
+				iReadBuf[i], iReadBuf[i+1], iReadBuf[i+2], iReadBuf[i+3], iReadBuf[i+4]);
 			if (iReadSize >= 10)
 				{
 				TUSB_PRINT5 ("WriteBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
-					iWriteBuf[iReadSize-5], iWriteBuf[iReadSize-4], iWriteBuf[iReadSize-3], iWriteBuf[iReadSize-2], iWriteBuf[iReadSize-1]); 
+					iWriteBuf[iReadSize-5], iWriteBuf[iReadSize-4], iWriteBuf[iReadSize-3], iWriteBuf[iReadSize-2], iWriteBuf[iReadSize-1]);
+				OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP06, "WriteBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
+					iWriteBuf[iReadSize-5], iWriteBuf[iReadSize-4], iWriteBuf[iReadSize-3], iWriteBuf[iReadSize-2], iWriteBuf[iReadSize-1]);
 				TUSB_PRINT5 ("ReadBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
-					iReadBuf[iReadSize-5], iReadBuf[iReadSize-4], iReadBuf[iReadSize-3], iReadBuf[iReadSize-2], iReadBuf[iReadSize-1]); 
+					iReadBuf[iReadSize-5], iReadBuf[iReadSize-4], iReadBuf[iReadSize-3], iReadBuf[iReadSize-2], iReadBuf[iReadSize-1]);
+				OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP07, "ReadBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
+					iReadBuf[iReadSize-5], iReadBuf[iReadSize-4], iReadBuf[iReadSize-3], iReadBuf[iReadSize-2], iReadBuf[iReadSize-1]);
 				}
 			return EFalse;
 			}
@@ -1015,9 +1183,13 @@
 void CActiveRW::TestComplete(TBool aResult)
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::TestComplete()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVERW_TESTCOMPLETE, "CActiveRW::TestComplete()");
+	    }
 
 	iResult = aResult;
-	
+
 	if (iComplete || !iResult || iTestParams.repeat == 0)
 		{
 		test(iResult);
--- a/kerneltest/e32test/usb/t_usb_device/src/activestallnotifier.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activestallnotifier.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -18,6 +18,10 @@
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "activestallnotifierTraces.h"
+#endif
 #include "activestallnotifier.h"
 
 extern RTest test;
@@ -56,6 +60,10 @@
 CActiveStallNotifier::~CActiveStallNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::~CActiveStallNotifier()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER, "CActiveStallNotifier::~CActiveStallNotifier()");
+	    }
 	Cancel();												// base class
 	}
 
@@ -63,6 +71,10 @@
 void CActiveStallNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::DoCancel()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DOCANCEL, "CActiveStallNotifier::DoCancel()");
+	    }
 	iPort->EndpointStatusNotifyCancel();
 	}
 
@@ -73,6 +85,10 @@
 	// In a real world program, the user could take here appropriate action (cancel a
 	// transfer request or whatever).
 	TUSB_VERBOSE_PRINT1("StallNotifier: Endpointstate 0x%x\n", iEndpointState);
+	if(gVerbose)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_RUNL, "StallNotifier: Endpointstate 0x%x\n", iEndpointState);
+	    }
 	Activate();
 	}
 
--- a/kerneltest/e32test/usb/t_usb_device/src/activetimer.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activetimer.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -18,6 +18,10 @@
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "activetimerTraces.h"
+#endif
 #include "activetimer.h"
 
 extern RTest test;
@@ -58,6 +62,10 @@
 CActiveTimer::~CActiveTimer()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::~CActiveTimer()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DCACTIVETIMER, "CActiveTimer::~CActiveTimer()");
+	    }
 	Cancel();												// base class
 	iTimer.Close();
 	}
@@ -66,6 +74,10 @@
 void CActiveTimer::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::DoCancel()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DOCANCEL, "CActiveTimer::DoCancel()");
+	    }
 	iTimer.Cancel();
 	}
 
@@ -73,6 +85,10 @@
 void CActiveTimer::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::RunL()");
+	if(gVerbose)
+	    {
+	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_RUNL, "CActiveTimer::RunL()");
+	    }
 	// Nothing to do here, as we call ReadCancel() after a manual WaitForRequest()
 	// (in CActiveRW::ReceiveVersion()).
 	}
--- a/kerneltest/e32test/usb/t_usb_device/src/apitests.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/apitests.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -14,12 +14,17 @@
 // e32test/usb/t_usb_device/src/apitests.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-// 
+//
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
 #include "config.h"
 #include "usblib.h"										// Helpers
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "apitestsTraces.h"
+#endif
+
 
 extern RTest test;
 extern TBool gVerbose;
@@ -65,14 +70,14 @@
 	deviceDescriptor[KUsbVendorIdOffset+1] = HiByte(aLddPtr->iVid);
 	// Change the device product ID (PID)
 	if (aPid != 0)
-		{	
+		{
 		deviceDescriptor[KUsbProductIdOffset]	= LoByte(aPid);		// little endian!
-		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aPid);		
+		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aPid);
 		}
 	else
 		{
 		deviceDescriptor[KUsbProductIdOffset]	= LoByte(aLddPtr->iPid);		// little endian!
-		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aLddPtr->iPid);		
+		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aLddPtr->iPid);
 		}
 	// Change the device release number
 	deviceDescriptor[KUsbDevReleaseOffset]	 = LoByte(aLddPtr->iRelease);	// little endian!
@@ -89,7 +94,7 @@
 
 		test.Next(_L("Compare device descriptor with value set"));
 		r = descriptor2.Compare(deviceDescriptor);
-		test_KErrNone(r);	
+		test_KErrNone(r);
 		}
 
 	// === Configuration Descriptor
@@ -110,7 +115,7 @@
 	const TUint8 KUsbAttributeDefault = 0x80;
 	const TUint8 KUsbAttributeSelfPower = 0x40;
 	const TUint8 KUsbAttributeRemoteWakeup = 0x20;
-	configDescriptor[KUsbAttributesOffset] = KUsbAttributeDefault | (aLddPtr->iSelfPower ? KUsbAttributeSelfPower : 0) 
+	configDescriptor[KUsbAttributesOffset] = KUsbAttributeDefault | (aLddPtr->iSelfPower ? KUsbAttributeSelfPower : 0)
 													| (aLddPtr->iRemoteWakeup ? KUsbAttributeRemoteWakeup : 0);
 	// Change the reported max power
 	// 100mA (= 2 * 0x32) is the highest value allowed for a bus-powered device.
@@ -130,7 +135,7 @@
 		r = descriptor2.Compare(configDescriptor);
 		test_KErrNone(r);
 		}
-		
+
 	// === String Descriptors
 
 	test.Next(_L("SetStringDescriptor"));
@@ -141,7 +146,7 @@
 		r = aPort->SetManufacturerStringDescriptor(* aLddPtr->iManufacturer);
 		test_KErrNone(r);
 		}
-		
+
 	if (aLddPtr->iProduct)
 		{
 		r = aPort->SetProductStringDescriptor(* aLddPtr->iProduct);
@@ -156,7 +161,7 @@
 
 	// Set up two arbitrary string descriptors, which can be queried
 	// manually from the host side for testing purposes
-	
+
 	TBuf16<KUsbStringDescStringMaxSize / 2> wr_str(KString_one);
 	r = aPort->SetStringDescriptor(stridx1, wr_str);
 	test_KErrNone(r);
@@ -167,7 +172,7 @@
 	test_KErrNone(r);
 
 	test.End();
-	
+
 	}
 
 static void TestDeviceQualifierDescriptor(RDEVCLIENT* aPort)
@@ -246,12 +251,12 @@
 	TBuf8<KUsbDescSize_Interface> descriptor2;
 	for (TInt i =0; i < aNumSettings; i++)
 		{
-		
+
 		test.Next(_L("GetInterfaceDescriptorSize()"));
 		r = aPort->GetInterfaceDescriptorSize(i, desc_size);
 		if (r != KErrNone)
 			{
-			RDebug::Printf ("Error %d in GetInterfaceDescriptorSize %d\n",r,i);
+			OstTraceExt2(TRACE_NORMAL, TESTINTERFACEDESCRIPTOR_TESTINTERFACEDESCRIPTOR, "Error %d in GetInterfaceDescriptorSize %d\n",r,i);
 			}
 		test_KErrNone(r);
 		test_Equal(KUsbDescSize_Interface,static_cast<TUint>(desc_size));
@@ -277,7 +282,7 @@
 		r = descriptor2.Compare(descriptor);
 		test_KErrNone(r);
 		}
-		
+
 	test.Next(_L("GetInterfaceDescriptor()"));
 	r = aPort->GetInterfaceDescriptor(aNumSettings, descriptor);
 	test_Equal(KErrNotFound,r);
@@ -285,7 +290,7 @@
 	test.Next(_L("SetInterfaceDescriptor()"));
 	r = aPort->SetInterfaceDescriptor(aNumSettings, descriptor);
 	test_Equal(KErrNotFound,r);
-		
+
 	test.End();
 	}
 
@@ -368,7 +373,7 @@
 		!(aEpInfo.iDir & KUsbEpDirIn) && !(epDescriptor[KEpDesc_AddressOffset] & 0x80)) &&
 			EpTypeMask2Value(aEpInfo.iType) == (TUint)(epDescriptor[KEpDesc_AttributesOffset] & 0x03) &&
 			aEpInfo.iInterval == epDescriptor[KEpDesc_IntervalOffset]);
-			
+
 	// Change the endpoint poll interval
 	TUint8 ival = 0x66;
 	if (epDescriptor[KEpDesc_IntervalOffset] == ival)
@@ -423,6 +428,7 @@
 	TInt r = aPort->GetStringDescriptorLangId(rd_langid_orig);
 	test_KErrNone(r);
 	test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig);
+	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS, "Original LANGID code: 0x%04X\n", rd_langid_orig);
 
 	test.Next(_L("SetStringDescriptorLangId()"));
 	TUint16 wr_langid = 0x0809;								// English (UK) Language ID
@@ -436,6 +442,7 @@
 	r = aPort->GetStringDescriptorLangId(rd_langid);
 	test_KErrNone(r);
 	test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid);
+	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01, "New LANGID code: 0x%04X\n", rd_langid);
 
 	test.Next(_L("Compare LANGID codes"));
 	test_Equal(wr_langid,rd_langid);
@@ -459,11 +466,13 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02, "Original Manufacturer string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
 		{
 		test.Printf(_L("No Manufacturer string set\n"));
+		OstTrace0(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03, "No Manufacturer string set\n");
 		restore_string = EFalse;
 		}
 
@@ -478,6 +487,7 @@
 	r = aPort->GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -495,6 +505,7 @@
 	r = aPort->GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -528,6 +539,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06, "Old Product string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -545,6 +557,7 @@
 	r = aPort->GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -562,6 +575,7 @@
 	r = aPort->GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -595,6 +609,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09, "Old Serial Number: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -612,6 +627,7 @@
 	r = aPort->GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -629,6 +645,7 @@
 	r = aPort->GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -662,6 +679,7 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig);
+		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12, "Old Configuration string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -679,6 +697,7 @@
 	r = aPort->GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -696,6 +715,7 @@
 	r = aPort->GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
+	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -785,6 +805,7 @@
 	r = aPort->GetStringDescriptor(stridx3, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str);
+	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS, "New test string @ idx %d: \"%lS\"\n", stridx3, rd_str);
 
 	test.Next(_L("Compare test strings 3"));
 	r = rd_str.Compare(wr_str);
@@ -828,17 +849,17 @@
 	if (SupportsAlternateInterfaces())
 		{
 		TInt r = aPort->SetInterface(aNumSettings+1, ifc);
-		test_Compare(r,!=,KErrNone);		
+		test_Compare(r,!=,KErrNone);
 		}
-	
+
 	if (aNumSettings > 1)
 		{
 		TInt r = aPort->SetInterface(aNumSettings-1, ifc);
-		test_Compare(r,!=,KErrNone);		
+		test_Compare(r,!=,KErrNone);
 		}
 
 	TInt r = aPort->SetInterface(0, ifc);
-	test_Compare(r,!=,KErrNone);		
+	test_Compare(r,!=,KErrNone);
 
 	test.End();
 	}
@@ -850,13 +871,13 @@
 	if (aNumSettings > 2)
 		{
 		TInt r = aPort->ReleaseInterface(aNumSettings-3);
-		test_Compare(r,!=,KErrNone);		
+		test_Compare(r,!=,KErrNone);
 		}
 
 	if (aNumSettings > 1)
 		{
 		TInt r = aPort->ReleaseInterface(aNumSettings-2);
-		test_Compare(r,!=,KErrNone);		
+		test_Compare(r,!=,KErrNone);
 		}
 
 	test.End();
@@ -870,7 +891,7 @@
 		{
 		TestDeviceQualifierDescriptor(aPort);
 
-		TestOtherSpeedConfigurationDescriptor(aPort);	
+		TestOtherSpeedConfigurationDescriptor(aPort);
 		}
 
 	TestInterfaceDescriptor(aPort,aNumSettings);
@@ -880,6 +901,7 @@
 	TestStandardStringDescriptors(aPort);
 
 	TestArbitraryStringDescriptors(aPort,aNumSettings);
+	test.Next(_L("Test USB Descriptor Manipulation1"));
 
 	test.End();
 	}
@@ -933,11 +955,14 @@
 		TBool a_AltHnpSupport = (features & KUsbOtgAttr_A_AltHnpSupport) ? ETrue : EFalse;
 		test.Printf(_L("### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n"),
 					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
+		OstTraceExt3(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS, "### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n",
+					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
 		}
 	else
 		{
 		test_Equal(KErrNotSupported,r);
 		test.Printf(_L("GetOtgFeatures() not supported\n"));
+		OstTrace0(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01, "GetOtgFeatures(not supported\n");
 		}
 
 	test.End();
@@ -989,10 +1014,12 @@
 			if (good)
 				{
 				test.Printf(_L("Ep0 supports %d bytes MaxPacketSize\n"), mpsize);
+				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES, "Ep0 supports %d bytes MaxPacketSize\n", mpsize);
 				}
 			else
 				{
 				test.Printf(_L("Bad Ep0 size: 0x%08x, failure will occur\n"), bit);
+				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01, "Bad Ep0 size: 0x%08x, failure will occur\n", bit);
 				r = KErrGeneral;
 				}
 			}
--- a/kerneltest/e32test/usb/t_usb_device/src/config.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/config.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -14,10 +14,14 @@
 // e32test/usb/t_usbdev/src/config.cpp
 // USB Test Program T_USB_DEVICE.
 // Reading and converting the XML configuration file.
-// 
+//
 //
 
 #include "general.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "configTraces.h"
+#endif
 #include "config.h"
 
 _LIT(KCfgLDD,"LDD");
@@ -70,7 +74,7 @@
 
 static const TInt8 KMaxXMLNesting = 3;						// max 3 levels of xml nesting
 
-static const TPtrC xmlKeys[] = 
+static const TPtrC xmlKeys[] =
 	{
 	(TDesC&)KCfgLDD, (TDesC&)KCfgLDD1, (TDesC&)KCfgLDD2, (TDesC&)KCfgLDD3, (TDesC&)KCfgLDD4, (TDesC&)KCfgLDD5, (TDesC&)KCfgLDD6,
 	(TDesC&)KCfgLDD7, (TDesC&)KCfgLDD8, (TDesC&)KCfgLDD9, (TDesC&)KCfgLDD10, (TDesC&)KCfgLDD11, (TDesC&)KCfgLDD12, (TDesC&)KCfgLDD13,
@@ -99,7 +103,7 @@
 	ExiSerialNumber,
 	ExiOTG,
 	ExiInterface,					// xmlKeys index for Interface
-	ExiSetting,						
+	ExiSetting,
 	ExiClass,
 	ExiSubclass,
 	ExiProtocol,
@@ -118,13 +122,13 @@
 	ExiReadSize,
 	ExiLAST
 	};
-	
+
 // This array provides the index into xmlKeys for each level of xml key
 // the first index for level n being defined by xmlLevels[n]
 // and the last index for level n being defined by xmlLevels[n+1] - 1
 // this means this must have two more entries than the number of nesting levels
-// and the last entry must be the size of xmlKeys 
-static const TUint8 xmlLevels[] = 
+// and the last entry must be the size of xmlKeys
+static const TUint8 xmlLevels[] =
 	{
 	ExiLdd,ExiLdd+1,ExiSetting+1,ExiEndpoint+1,ExiLAST
 	};
@@ -186,7 +190,8 @@
 bool ProcessConfigFile (RFile aConfigFile,CConsoleBase* iConsole, LDDConfigPtr * LDDPtrPtr)
 	{
 	TUSB_PRINT ("Processing Configuration File");
-	
+	OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS, "Processing Configuration File");
+
 	TBuf8<100> configBuf;
 	TBuf<101> stringBuf;
 	bool done = false;
@@ -203,7 +208,7 @@
 	TInt levelKeys[KMaxXMLNesting+1];
 
 	* LDDPtrPtr = NULL;
-	ConfigPtrsPtr cpPtr = new ConfigPtrs (LDDPtrPtr); 			
+	ConfigPtrsPtr cpPtr = new ConfigPtrs (LDDPtrPtr);
 
 	while (!done && !error)
 		{
@@ -211,13 +216,14 @@
 		if (rStatus != KErrNone)
 			{
 			error = true;
-			TUSB_PRINT1("Config file error %d", rStatus);			
+			TUSB_PRINT1("Config file error %d", rStatus);
+			OstTrace1(TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP01, "Config file error %d", rStatus);
 			}
 		else
 			{
 			if (configBuf.Length() == 0)
 				{
-				done = true;			
+				done = true;
 				}
 			else
 				{
@@ -232,6 +238,7 @@
 						{
 						error = true;
 						TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
+						OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP02, "Config File Syntax Error at index %d of %S",i,stringBuf);
 						}
 					switch (state)
 						{
@@ -245,14 +252,15 @@
 									{
 									error = true;
 									TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
+									OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP03, "Config File Syntax Error at index %d of %S",i,stringBuf);
 									}
 							break;
-						
+
 						case EStartKey:
 							if (nextChar == '/')
 								{
 								state = EEndKey;
-								endkeyString.SetLength(0);															
+								endkeyString.SetLength(0);
 								}
 							else
 								{
@@ -262,7 +270,8 @@
 									if (level > KMaxXMLNesting)
 										{
 										error = true;
-										TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());								
+										TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());
+										OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP04, "Config File Too Many levels %S",stringBuf);
 										}
 									else
 										{
@@ -270,19 +279,25 @@
 										if (levelKeys[level] < 0)
 											{
 											error = true;
-											TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());																	
+											TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());
+											OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP05, "Invalid XML key %S",keyString);
 											}
 										else
 											{
 											if (CheckAttribute(iConsole,cpPtr,levelKeys[level],attributeString))
 												{
 												state = EValue;
-												TUSB_VERBOSE_PRINT2 ("Start key: %s level %d",keyString.PtrZ(),level);			
+												TUSB_VERBOSE_PRINT2 ("Start key: %s level %d",keyString.PtrZ(),level);
+												if(gVerbose)
+												    {
+												    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP06, "Start key: %S level %d",keyString,level);
+												    }
 												}
 											else
 												{
-												error = true;	
-												TUSB_PRINT1 ("No attribute for XML key %s",keyString.PtrZ());																	
+												error = true;
+												TUSB_PRINT1 ("No attribute for XML key %s",keyString.PtrZ());
+												OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP07, "No attribute for XML key %S",keyString);
 												}
 											}
 										}
@@ -297,7 +312,8 @@
 										if (nextChar.IsSpace())
 											{
 											error = true;
-											TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());					
+											TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
+											OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP08, "Config File Syntax Error at index %d of %S",i,stringBuf);
 											}
 										}
 									if (nextChar.IsSpace())
@@ -311,28 +327,34 @@
 									}
 								}
 							break;
-							
+
 						case EEndKey:
 							if (nextChar == '>')
 								{
 								if (levelKeys[level] != CheckXmlKey (endkeyString,level))
 									{
 									error = true;
-									TUSB_PRINT1 ("Invalid XML end key %s",endkeyString.PtrZ());																	
+									TUSB_PRINT1 ("Invalid XML end key %s",endkeyString.PtrZ());
+									OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP09, "Invalid XML end key %S",endkeyString);
 									}
 								else
-									{												
+									{
 									if (CheckValue(iConsole,cpPtr,levelKeys[level],valueString))
 										{
 										state = EEmpty;
 										TUSB_VERBOSE_PRINT2 ("End Key: %s value %s",endkeyString.PtrZ(),valueString.PtrZ());
+										if(gVerbose)
+										    {
+										    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP10, "End Key: %S value %S",endkeyString,valueString);
+										    }
 										level--;
 										valueString.SetLength(0);
 										}
 									else
 										{
 										error = true;
-										TUSB_PRINT2 ("Incorrect value string %s for XML key %s",valueString.PtrZ(),endkeyString.PtrZ());	
+										TUSB_PRINT2 ("Incorrect value string %s for XML key %s",valueString.PtrZ(),endkeyString.PtrZ());
+										OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP11, "Incorrect value string %S for XML key %S",valueString,endkeyString);
 										}
 									}
 								}
@@ -340,13 +362,14 @@
 								{
 									error = true;
 									TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
+									OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP12, "Config File Syntax Error at index %d of %S",i,stringBuf);
 								}
 							else
 								{
 								endkeyString.Append(nextChar);
 								}
 							break;
-							
+
 						case EAttribute:
 							if (nextChar == '>')
 								{
@@ -354,7 +377,8 @@
 								if (level > KMaxXMLNesting)
 									{
 									error = true;
-									TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());								
+									TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());
+									OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP13, "Config File Too Many levels %s",stringBuf);
 									}
 								else
 									{
@@ -362,7 +386,8 @@
 									if (levelKeys[level] < 0)
 										{
 										error = true;
-										TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());																	
+										TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());
+										OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP14, "Invalid XML key %s",keyString);
 										}
 									else
 										{
@@ -370,11 +395,16 @@
 											{
 											state = EValue;
 											TUSB_VERBOSE_PRINT3 ("Start key: %s level %d attribute %s",keyString.PtrZ(),level,attributeString.PtrZ());
+											if(gVerbose)
+											    {
+											    OstTraceExt3 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP15, "Start key: %S level %d attribute %S",keyString,level,attributeString);
+											    }
 											}
 										else
 											{
-											error = true;	
-											TUSB_PRINT2 ("Incorrect attribute %s for XML key %s",attributeString.PtrZ(),keyString.PtrZ());																	
+											error = true;
+											TUSB_PRINT2 ("Incorrect attribute %s for XML key %s",attributeString.PtrZ(),keyString.PtrZ());
+											OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP16, "Incorrect attribute %s for XML key %s",attributeString,keyString);
 											}
 										}
 									}
@@ -384,7 +414,7 @@
 								attributeString.Append(nextChar);
 								}
 							break;
-							
+
 						case EValue:
 							if (nextChar == '<')
 								{
@@ -395,7 +425,7 @@
 								// Don't add any leading spaces
 								if (!nextChar.IsSpace() || valueString.Length() != 0)
 									{
-									valueString.Append(nextChar);						
+									valueString.Append(nextChar);
 									}
 								}
 							break;
@@ -404,14 +434,14 @@
 				}
 			}
 		}
-		
+
 	delete cpPtr;
 
 	return !error;
 	}
 
 
-	
+
 TBool CheckAttribute (CConsoleBase* iConsole, ConfigPtrsPtr cpPtr,TInt aKeyIndex, TPtrC aDes)
 	{
 	TBool retValue = ETrue;
@@ -436,10 +466,14 @@
 				if (attrib[0] == ((TDesC&)KQuote)[0] && attrib[attrib.Length()-1] == ((TDesC&)KQuote)[0])
 					{
 					TUSB_VERBOSE_PRINT1 ("LDD with attribute name %s",attrib.PtrZ());
-					cpPtr->iThisLDDPtr = new LDDConfig (attrib.MidTPtr(1,attrib.Length()-2));		
+					if(gVerbose)
+					    {
+					    OstTraceExt1 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP17, "LDD with attribute name %s",attrib);
+					    }
+					cpPtr->iThisLDDPtr = new LDDConfig (attrib.MidTPtr(1,attrib.Length()-2));
 					*cpPtr->iNextLDDPtrPtr = cpPtr->iThisLDDPtr;
 					cpPtr->iNextLDDPtrPtr = &(cpPtr->iThisLDDPtr->iPtrNext);
-					cpPtr->iNextIFPtrPtr = &(cpPtr->iThisLDDPtr->iIFPtr);			
+					cpPtr->iNextIFPtrPtr = &(cpPtr->iThisLDDPtr->iIFPtr);
 					}
 				else
 					retValue = EFalse;
@@ -449,7 +483,7 @@
 				retValue = EFalse;
 				}
 			break;
-			
+
 		//	level 1 index INTERFACE
 		case ExiInterface :
 			if (attrib.Find(KAttributeNumber) == 0)
@@ -462,31 +496,38 @@
 						if (cpPtr->iThisLDDPtr == NULL)
 							{
 							TUSB_PRINT ("No LDD container for interface");
-							retValue = EFalse;				
+							OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP18, "No LDD container for interface");
+							retValue = EFalse;
 							}
 						}
 					else
 						{
 						TUSB_PRINT2 ("Number conversion error %s %d",attrib.PtrZ(),ifNumber);
+						OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP19, "Number conversion error %S %u",attrib,ifNumber);
 						retValue = EFalse;
 						}
 					}
 				else
 					{
 					TUSB_PRINT1 ("Attribute number not in \"\" %s",attrib.PtrZ());
-					retValue = EFalse;	
+					OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP20, "Attribute number not in \"\" %s",attrib);
+					retValue = EFalse;
 					}
 				}
 			if (retValue)
 				{
 	 			TUSB_VERBOSE_PRINT1 ("Interface number %d",ifNumber);
+	 			if(gVerbose)
+	 			    {
+	 			    OstTrace1 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP21, "Interface number %d",ifNumber);
+	 			    }
 				cpPtr->iThisIFPtr = new IFConfig ((TUint8)ifNumber);
 				* cpPtr->iNextIFPtrPtr = cpPtr->iThisIFPtr;
 				cpPtr->iNextIFPtrPtr = &cpPtr->iThisIFPtr->iPtrNext;
 				cpPtr->iThisLDDPtr->iNumChannels++;
 				}
-			break;	
-			
+			break;
+
 
 		//	level 1 index Setting
 		case ExiSetting :
@@ -499,43 +540,48 @@
 				if (cpPtr->iThisLDDPtr == NULL)
 					{
 					TUSB_PRINT ("No LDD container for interface");
-					retValue = EFalse;				
+					OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP22, "No LDD container for interface");
+					retValue = EFalse;
 					}
 				else
 					{
-					TUSB_VERBOSE_PRINT ("Alternate Interface Setting");			
-					cpPtr->iThisIFPtr = new IFConfig (0);		
+					TUSB_VERBOSE_PRINT ("Alternate Interface Setting");
+					if(gVerbose)
+					    {
+					    OstTrace0 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP23, "Alternate Interface Setting");
+					    }
+					cpPtr->iThisIFPtr = new IFConfig (0);
 					* cpPtr->iNextIFPtrPtr = cpPtr->iThisIFPtr;
 					cpPtr->iNextIFPtrPtr = &cpPtr->iThisIFPtr->iPtrNext;
 					cpPtr->iThisIFPtr->iAlternateSetting = ETrue;
-					}					
+					}
 				}
 			break;
-			
+
 		//	level 2 index ENDPOINT
 		case ExiEndpoint :
 			typePos = attrib.Find(KAttributeType);
 			dirPos = attrib.Find(KAttributeDirection);
-			
+
 			if (typePos == KErrNotFound || dirPos == KErrNotFound)
 				{
 				retValue = EFalse;
 				}
-			else	
+			else
 				{
 				if (typePos < dirPos)
 					{
 					typePos += ((TDesC&)KAttributeType).Length();
 					typeLen = dirPos - typePos;
 					dirPos += ((TDesC&)KAttributeDirection).Length();
-					dirLen = attrib.Length() - dirPos;			
+					dirLen = attrib.Length() - dirPos;
 					}
 				else
 					{
-					dirPos += ((TDesC&)KAttributeDirection).Length();			
+					dirPos += ((TDesC&)KAttributeDirection).Length();
 					dirLen = typePos - dirPos;
 					typePos += ((TDesC&)KAttributeType).Length();
-					typeLen = attrib.Length() - typePos;			
+					typeLen = attrib.Length() - typePos;
 					}
 				TPtr attribPtr = attrib.MidTPtr(typePos,typeLen);
 				attribPtr.UpperCase();
@@ -558,7 +604,7 @@
 							}
 						else
 							{
-							retValue = EFalse;					
+							retValue = EFalse;
 							}
 						}
 					}
@@ -585,12 +631,17 @@
 					if (cpPtr->iThisIFPtr == NULL)
 						{
 						TUSB_PRINT ("No Interface container for Endpoint");
-						retValue = EFalse;				
+						OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP24, "No Interface container for Endpoint");
+						retValue = EFalse;
 						}
 					else
 						{
 						TUint epIndex = cpPtr->iThisIFPtr->iInfoPtr->iTotalEndpointsUsed;
-						TUSB_VERBOSE_PRINT2 ("Endpoint with type %d %d",epType,epDir);			
+						TUSB_VERBOSE_PRINT2 ("Endpoint with type %d %d",epType,epDir);
+						if(gVerbose)
+						    {
+						    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP25, "Endpoint with type %u %u",(TUint32)epType,(TUint32)epDir);
+						    }
 						cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iType = epType;
 						cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iDir = epDir;
 						#ifdef USB_SC
@@ -604,14 +655,14 @@
 					}
 				}
 			break;
-		
+
 		default :
 			if (aDes.Length() != 0)
 				{
 				retValue = EFalse;
 				}
 		}
-		
+
 	return retValue;
 	}
 
@@ -621,13 +672,17 @@
 	TBool boolValue;
 	TUint uintValue;
 	TInt epIndex = -1;
-	
+
 	if (cpPtr->iThisIFPtr != NULL)
 		{
 		epIndex = cpPtr->iThisIFPtr->iInfoPtr->iTotalEndpointsUsed -1;
 		}
-		
+
 	TUSB_VERBOSE_PRINT2 ("CheckValue keyIndex %d %s",aKeyIndex,aDes.Ptr());
+	if(gVerbose)
+	    {
+	    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP26, "CheckValue keyIndex %d %s",aKeyIndex,aDes);
+	    }
 	switch (aKeyIndex)
 		{
 		case ExiLdd:						// xmlKeys index for LDD
@@ -638,19 +693,19 @@
 				retValue = EFalse;
 				}
 			break;
-			
+
 		case ExiEndpoints:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (uintValue == 0 || uintValue > 128)
 				{
-				retValue = EFalse;			
+				retValue = EFalse;
 				}
 			else
 				{
 				cpPtr->iThisLDDPtr->iNumEndpoints = uintValue;
 				}
 			break;
-			
+
 		case ExiSoftconnect:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -660,7 +715,7 @@
 				cpPtr->iThisLDDPtr->iSoftConnect = boolValue;
 				}
 			break;
-			
+
 		case ExiSelfPower:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -670,7 +725,7 @@
 				cpPtr->iThisLDDPtr->iSelfPower = boolValue;
 				}
 			break;
-			
+
 		case ExiRemoteWakeup:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -680,7 +735,7 @@
 				cpPtr->iThisLDDPtr->iRemoteWakeup = boolValue;
 				}
 			break;
-			
+
 		case ExiHighSpeed:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -690,7 +745,7 @@
 				cpPtr->iThisLDDPtr->iHighSpeed = boolValue;
 				}
 			break;
-			
+
 		case ExiFeatures:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -700,7 +755,7 @@
 				cpPtr->iThisLDDPtr->iFeatures = uintValue;
 				}
 			break;
-			
+
 		case ExiMaxPower:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL || uintValue > 50)
@@ -710,7 +765,7 @@
 				cpPtr->iThisLDDPtr->iMaxPower = uintValue;
 				}
 			break;
-			
+
 		case ExiEpStall:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -720,7 +775,7 @@
 				cpPtr->iThisLDDPtr->iEPStall = boolValue;
 				}
 			break;
-			
+
 		case ExiSpec:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -730,7 +785,7 @@
 				cpPtr->iThisLDDPtr->iSpec = uintValue;
 				}
 			break;
-			
+
 		case ExiVID:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -740,7 +795,7 @@
 				cpPtr->iThisLDDPtr->iVid = uintValue;
 				}
 			break;
-			
+
 		case ExiPID:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -750,7 +805,7 @@
 				cpPtr->iThisLDDPtr->iPid = uintValue;
 				}
 			break;
-			
+
 		case ExiRelease:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -760,7 +815,7 @@
 				cpPtr->iThisLDDPtr->iRelease = uintValue;
 				}
 			break;
-			
+
 		case ExiManufacturer:
 			cpPtr->iThisLDDPtr->iManufacturer = aDes.Alloc();
 			break;
@@ -775,7 +830,7 @@
 
 		case ExiOTG:
 			break;
-			
+
 		case ExiClass:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 0xFF)
@@ -785,7 +840,7 @@
 				cpPtr->iThisIFPtr->iInfoPtr->iClass.iClassNum = uintValue;
 				}
 			break;
-			
+
 		case ExiSubclass:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 0xFF)
@@ -795,7 +850,7 @@
 				cpPtr->iThisIFPtr->iInfoPtr->iClass.iSubClassNum = uintValue;
 				}
 			break;
-			
+
 		case ExiProtocol:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 0xFF)
@@ -805,15 +860,15 @@
 				cpPtr->iThisIFPtr->iInfoPtr->iClass.iProtocolNum = uintValue;
 				}
 			break;
-			
+
 		case ExiDescriptor:
 			cpPtr->iThisIFPtr->iInfoPtr->iString = aDes.Alloc();
 			break;
-			
+
 		case ExiBandwidthIn:
 			#ifdef USB_SC
 			retValue = EFalse;
-			#else			
+			#else
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 3)
 				retValue = EFalse;
@@ -837,11 +892,11 @@
 				}
 			#endif
 			break;
-			
+
 		case ExiBandwidthOut:
 			#ifdef USB_SC
 			retValue = EFalse;
-			#else			
+			#else
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 3)
 				retValue = EFalse;
@@ -865,7 +920,7 @@
 				}
 			#endif
 			break;
-			
+
 		case ExiSize:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0)
@@ -887,29 +942,29 @@
 								retValue = EFalse;
 							}
 						break;
-						
+
 					case KUsbEpTypeInterrupt :
 						if ((defaultIF && uintValue > 64) ||
 							(!cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 64) ||
 							(!defaultIF && cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 1024))
 							retValue = EFalse;
 						break;
-						
+
 					case KUsbEpTypeIsochronous :
 						if ((defaultIF && uintValue > 0) ||
 							(!defaultIF && !cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 1023) ||
 							(!defaultIF && cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 1024))
 							retValue = EFalse;
-						break;					
+						break;
 					}
 				if (retValue)
 					{
 					cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iSize = uintValue;
 					}
 				}
-			
+
 			break;
-			
+
 		case ExiInterval:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0)
@@ -921,16 +976,16 @@
 					case KUsbEpTypeBulk :
 						retValue = EFalse;
 						break;
-						
+
 					case KUsbEpTypeInterrupt :
 						if (uintValue < 1 || uintValue > 255)
 							retValue = EFalse;
 						break;
-						
+
 					case KUsbEpTypeIsochronous :
 						if (uintValue < 1 || uintValue > 16)
 							retValue = EFalse;
-						break;					
+						break;
 					}
 				if (retValue)
 					{
@@ -938,7 +993,7 @@
 					}
 				}
 			break;
-			
+
 		case ExiHSInterval:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0 || !cpPtr->iThisLDDPtr->iHighSpeed)
@@ -951,16 +1006,16 @@
 						if (uintValue > 255)
 							retValue = EFalse;
 						break;
-						
+
 					case KUsbEpTypeInterrupt :
 						if (uintValue < 1 || uintValue > 16)
 							retValue = EFalse;
 						break;
-						
+
 					case KUsbEpTypeIsochronous :
 						if (uintValue < 1 || uintValue > 16)
 							retValue = EFalse;
-						break;					
+						break;
 					}
 				if (retValue)
 					{
@@ -968,7 +1023,7 @@
 					}
 				}
 			break;
-			
+
 		case ExiHSTransactions:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0 || !cpPtr->iThisLDDPtr->iHighSpeed)
@@ -983,7 +1038,7 @@
 					}
 				}
 			break;
-			
+
 		case ExiDMA:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (epIndex < 0)
@@ -993,7 +1048,7 @@
 				cpPtr->iThisIFPtr->iEpDMA[epIndex] = boolValue;
 				}
 			break;
-			
+
 		case ExiDoubleBuff:
 			#ifdef USB_SC
 			retValue = EFalse;
@@ -1007,7 +1062,7 @@
 				}
 			#endif
 			break;
-			
+
 		case ExiExtra:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0)
@@ -1027,7 +1082,7 @@
 				{
 				cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iBufferSize = uintValue;
 				}
-			#else			
+			#else
 			retValue = EFalse;
 			#endif
 			break;
@@ -1041,7 +1096,7 @@
 				{
 				cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iReadSize = uintValue;
 				}
-			#else			
+			#else
 			retValue = EFalse;
 			#endif
 			break;
@@ -1049,11 +1104,11 @@
 
 	return retValue;
 	}
-	
+
 TInt CheckXmlKey (TPtrC aKey,TInt aLevel)
 	{
 	TInt keyIndex = -1;
-	
+
 	for (TInt i = xmlLevels[aLevel]; i < xmlLevels[aLevel+1]; i++)
 		{
 		if (aKey == xmlKeys[i])
@@ -1063,7 +1118,7 @@
 			}
 		}
 
-			
+
 	return keyIndex;
 	}
 
@@ -1075,13 +1130,13 @@
 	TBool conversionOK = ETrue;
 	TUint8 desIndex = 0;
 	* aValue = 0;
-	
+
 	if (numDes.LeftTPtr(((TDesC&)KHexPrefix).Length()) == KHexPrefix)
 		{
 		hexBase = ETrue;
-		desIndex = ((TDesC&)KHexPrefix).Length();	
+		desIndex = ((TDesC&)KHexPrefix).Length();
 		}
-		
+
 	while (desIndex < numDes.Length() && conversionOK)
 		{
 		if (hexBase)
@@ -1112,19 +1167,19 @@
 				else
 					{
 					conversionOK = EFalse;
-					* aValue = 222;				
-					}	
+					* aValue = 222;
+					}
 				}
 			else
 				{
-				conversionOK = EFalse;	
+				conversionOK = EFalse;
 				* aValue = 333;
 				}
-			
+
 			}
 		desIndex++;
 		}
-		
+
 	return conversionOK;
 	}
 
@@ -1134,7 +1189,7 @@
 	_LIT (KBoolN,"N");
 	TBool conversionOK = ETrue;
 	TBuf<50> boolDes = aDes;
-	
+
 	boolDes.TrimAll();
 	boolDes.UpperCase();
 	if (boolDes == KBoolY)
@@ -1149,9 +1204,9 @@
 			}
 		else
 			{
-			conversionOK = EFalse;	
+			conversionOK = EFalse;
 			}
 		}
-		
+
 	return conversionOK;
 	}
--- a/kerneltest/e32test/usb/t_usb_device/src/main.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/main.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -14,12 +14,16 @@
 // e32test/usb/t_usb_device/main.cpp
 // USB Test Program, main part.
 // Device-side part, to work against t_usb_host running on the host.
-// 
+//
 //
 
 #include "general.h"
 #include "config.h"
 #include "activecontrol.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "mainTraces.h"
+#endif
 #include "activerw.h"
 
 // --- Global Top Level Variables
@@ -31,7 +35,7 @@
 RTest test(_L("T_USB_DEVICE"));
 #endif
 
-#ifdef USB_SC	
+#ifdef USB_SC
 TBool gShareHandle = EFalse;
 #endif
 TBool gVerbose = EFalse;
@@ -47,7 +51,7 @@
 #ifdef USB_SC
 RChunk gChunk;
 #endif
-	
+
 
 void RunAppL(TDes * aConfigFile, TDes * aScriptFile)
 	{
@@ -66,15 +70,19 @@
 	CleanupStack::PushL(myConsole);
 
 	myConsole->Printf(_L("T_USB_SCDEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
+	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL, "T_USB_SCDEVICE v%d.%d.%d\n",(TInt32)KDeviceVersionMajor,(TInt32)KDeviceVersionMinor,(TInt32)KDeviceVersionMicro);
 	test.Printf(_L("T_USB_SCDEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
+	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP01, "T_USB_SCDEVICE v%d.%d.%d\n",(TInt32)KDeviceVersionMajor,(TInt32)KDeviceVersionMinor,(TInt32)KDeviceVersionMicro);
 	#else
 	CConsoleBase* myConsole = Console::NewL(_L("T_USB_DEVICE - USB Client Test"), TSize(KConsFullScreen, KConsFullScreen));
 	CleanupStack::PushL(myConsole);
 
 	myConsole->Printf(_L("T_USB_DEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
+	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP02, "T_USB_DEVICE v%u.%u.%u\n",KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
 	test.Printf(_L("T_USB_DEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
+	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP03, "T_USB_DEVICE v%u.%u.%u\n",KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
 	#endif
-	
+
 	// outermost test begin
 	test.Start(_L("Outermost test of t_usb_device\n"));
 
@@ -83,18 +91,19 @@
 		gActiveControl = CActiveControl::NewL(myConsole, aConfigFile, aScriptFile);
 		CleanupStack::PushL(gActiveControl);
 
-	
+
 		// Call request function
-#ifdef USB_SC		
+#ifdef USB_SC
 		if (!gShareHandle)
 			gActiveControl->RequestEp0ControlPacket();
 #else
 		gActiveControl->RequestEp0ControlPacket();
 #endif
 		CActiveScheduler::Start();
-		
+
 		test.Printf (_L("Test Run Completed\n"));
-		
+		OstTrace0(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP04, "Test Run Completed\n");
+
 		if (gSoakCount > 0)
 			{
 			gSoakCount--;
@@ -102,7 +111,7 @@
 
 		// Suspend thread for 2 seconds
 		User::After(2000000);
-		
+
 		CleanupStack::PopAndDestroy(gActiveControl);
 
 		}
@@ -122,7 +131,7 @@
 void ParseCommandLine (TDes& aConfigFileName, TDes& aScriptFileName)
 	{
 	TBuf<64> c;
-	
+
 	User::CommandLine(c);
 	c.LowerCase();
 
@@ -137,28 +146,28 @@
 			{
 			if (token == _L("/v"))
 				{
-				RDebug::Print(_L("Verbose output enabled\n"));
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE, "Verbose output enabled\n");
 				gVerbose = ETrue;
 				}
 			else if (token == _L("/s"))
 				{
-				RDebug::Print(_L("Skipping some tests\n"));
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01, "Skipping some tests\n");
 				gSkip = ETrue;
 				}
 			else if (token == _L("/t"))
 				{
-				RDebug::Print(_L("Temporary Test\n"));
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02, "Temporary Test\n");
 				gTempTest = ETrue;
 				}
 			else if (token == _L("/n"))
 				{
-				RDebug::Print(_L("Not Stopping on Test Fail\n"));
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03, "Not Stopping on Test Fail\n");
 				gStopOnFail = EFalse;
 				}
-#ifdef USB_SC	
+#ifdef USB_SC
 			else if (token == _L("/a"))
-				{				
-				RDebug::Print(_L("share handle test\n"));
+				{
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04, "share handle test\n");
 				gShareHandle = ETrue;
 				}
 #endif
@@ -170,9 +179,9 @@
 				if ((equalPos+1) < token.Length())
 					{
 					TLex lexNum(token.Mid(equalPos+1));
-					lexNum.Val(gSoakCount,EDecimal);	
+					lexNum.Val(gSoakCount,EDecimal);
 					}
-				RDebug::Print(_L("Soak test for %d iterations\n"),gSoakCount);
+				OstTrace1(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP05, "Soak test for %d iterations\n",gSoakCount);
 				}
 			else if (token.Left(8) == _L("/script="))
 				{
@@ -184,31 +193,31 @@
 				}
 			}
 		}
-		
+
 	}
-	
+
 TInt E32Main()
 	{
 	__UHEAP_MARK;
-	
+
 	CTrapCleanup* cleanup = CTrapCleanup::New();			// get clean-up stack
 
 	TBuf<64> configFileName;
 	TBuf<64> scriptFileName;
 	ParseCommandLine (configFileName,scriptFileName);
-	
+
 	if (configFileName.Length() == 0)
 		{
-			RDebug::Print(_L("(T_USB: Warning - No Configuration File.)\n"));		
+		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "(T_USB: Warning - No Configuration File.\n");
 		}
 	else
 		{
-		RDebug::Print(_L("T_USB: Config File Name %s\n"),configFileName.PtrZ());
+		OstTraceExt1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "T_USB: Config File Name %S\n",configFileName);
 		}
 
 	if (scriptFileName.Length() != 0)
 		{
-		RDebug::Print(_L("T_USB: Script File Name %s\n"),scriptFileName.PtrZ());
+		OstTraceExt1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP02, "T_USB: Script File Name %S\n",scriptFileName);
 		}
 
 	TRAPD(error, RunAppL(& configFileName, &scriptFileName));
@@ -219,7 +228,8 @@
 
 	__UHEAP_MARKEND;
 
-	RDebug::Print(_L("Program exit: done.\n"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP03, "Program exit: done.\n");
+
 	return 0;												// and return
 	}
 
--- a/kerneltest/e32test/usb/t_usb_device/src/tranhandleserver.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/tranhandleserver.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -25,13 +25,17 @@
 #include "tranhandlesession.h"
 #include "tranhandleserversecuritypolicy.h"
 #include "tranhandleserverconsts.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tranhandleserverTraces.h"
+#endif
 #include "general.h"
 
 
 
 CTranHandleServer* CTranHandleServer::NewL(CActiveControl& aControl)
     {
-    RDebug::Printf("CTranHandleServer::NewL");
+    OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_NEWL, "CTranHandleServer::NewL");
     CTranHandleServer* self = new(ELeave) CTranHandleServer(aControl);
     CleanupStack::PushL(self);
     TInt err = self->Start(KTranHandleServerName);
@@ -46,7 +50,7 @@
 
 CTranHandleServer::~CTranHandleServer()
     {
-    RDebug::Printf("CTranHandleServer::~CTranHandleServer");
+    OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_DCTRANHANDLESERVER, "CTranHandleServer::~CTranHandleServer");
     }
 
 CTranHandleServer::CTranHandleServer(CActiveControl& aControl)
@@ -58,7 +62,7 @@
 CSession2* CTranHandleServer::NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const
     {
     //Validate session as coming from UsbSvr
-	RDebug::Printf("CTranHandleServer::NewSessionL");
+	OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_NEWSESSIONL, "CTranHandleServer::NewSessionL");
     CTranHandleSession* sess = CTranHandleSession::NewL(iActiveControl);
     return sess;
     }
--- a/kerneltest/e32test/usb/t_usb_device/src/tranhandlesession.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/tranhandlesession.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -24,6 +24,10 @@
 
 #include "tranhandleserverconsts.h"
 #include "tranhandlesession.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tranhandlesessionTraces.h"
+#endif
 #include "activecontrol.h"
 
 
@@ -41,12 +45,12 @@
 
 CTranHandleSession::~CTranHandleSession()
     {
-    RDebug::Printf("CTranHandleSession::~CTranHandleSession");
+    OstTrace0(TRACE_NORMAL, CTRANHANDLESESSION_DCTRANHANDLESESSION, "CTranHandleSession::~CTranHandleSession");
     }
 
 void CTranHandleSession::ServiceL(const RMessage2& aMessage)
     {
-	RDebug::Printf("CTranHandleSession::ServiceL");
+	OstTrace0(TRACE_NORMAL, CTRANHANDLESESSION_SERVICEL, "CTranHandleSession::ServiceL");
 	TInt r;
     switch ( aMessage.Function() )
         {
--- a/kerneltest/e32test/usb/t_usb_device/src/transferhandle.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/transferhandle.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -24,6 +24,10 @@
 
 #include "transferhandle.h"
 #include "transferserver.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "transferhandleTraces.h"
+#endif
 
 CTransferHandle* CTransferHandle::NewL(CTransferServer& aServer)
     {
@@ -41,14 +45,14 @@
 
 CTransferHandle::~CTransferHandle()
     {
-    RDebug::Printf("CTransferHandle::~CTransferHandle");
+    OstTrace0(TRACE_NORMAL, CTRANSFERHANDLE_DCTRANSFERHANDLE, "CTransferHandle::~CTransferHandle");
     Cancel();
     iTimer.Close();
     }
 
 void CTransferHandle::DoCancel()
     {
-    RDebug::Printf("CTransferHandle::DoCancel");
+    OstTrace0(TRACE_NORMAL, CTRANSFERHANDLE_DOCANCEL, "CTransferHandle::DoCancel");
     iTimer.Cancel();
     }
 
@@ -66,7 +70,7 @@
 	{
 	if(iStatus.Int() != KErrNone)
 		{		
-		RDebug::Printf("CTransferHandle::RunL");
+		OstTrace0(TRACE_FATAL, CTRANSFERHANDLE_RUNL, "CTransferHandle::RunL");
 		User::Panic(KPanic, KTimerError);
 		return;
 		}
--- a/kerneltest/e32test/usb/t_usb_device/src/transferserver.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/transferserver.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -25,6 +25,10 @@
 #include "transferserversecuritypolicy.h"
 #include "transferhandle.h"
 #include "tranhandlesrv.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "transferserverTraces.h"
+#endif
 
 
 
@@ -34,7 +38,7 @@
 
 CTransferServer* CTransferServer::NewLC()
 	{
-	RDebug::Printf("CTransferServer::NewLC");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_NEWLC, "CTransferServer::NewLC");
 	CTransferServer* self = new(ELeave) CTransferServer;
 	CleanupStack::PushL(self);
 	self->StartL(KTransferServerName);
@@ -44,7 +48,7 @@
 
 CTransferServer::~CTransferServer()
 	{
-	RDebug::Printf("CTransferServer::~CTransferServer");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DCTRANSFERSERVER, "CTransferServer::~CTransferServer");
 	while (iLddPtr->iIFPtr)
 	{
 	IFConfigPtr* ifPtrPtr = & iLddPtr->iIFPtr;
@@ -74,7 +78,7 @@
 
 	delete iShutdownTimer;	
 	delete iTransferHandle;	
-	RDebug::Printf("<<<CTransferServer::~CTransferServer");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DCTRANSFERSERVER_DUP01, "<<<CTransferServer::~CTransferServer");
 	}
 
 
@@ -89,7 +93,7 @@
 	iShutdownTimer->ConstructL(); 
 	
 	iTransferHandle = CTransferHandle::NewL(*this);
-	RDebug::Printf("CTransferServer::ConstructL");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_CONSTRUCTL, "CTransferServer::ConstructL");
 	}
 
 
@@ -108,14 +112,14 @@
 
 void CTransferServer::Error(TInt aError)
 	{
-	RDebug::Printf("CTransferServer::Error");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_ERROR, "CTransferServer::Error");
 	Message().Complete(aError);
 	ReStart();
 	}
 
 void CTransferServer::IncrementSessionCount()
 	{
-	RDebug::Printf("CTransferServer::IncrementSessionCount");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_INCREMENTSESSIONCOUNT, "CTransferServer::IncrementSessionCount");
 	
 	++iSessionCount;
 	iShutdownTimer->Cancel();
@@ -125,11 +129,11 @@
 void CTransferServer::DecrementSessionCount()
 	{
 	--iSessionCount;	
-	RDebug::Printf("CTransferServer::DecrementSessionCount");	
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DECREMENTSESSIONCOUNT, "CTransferServer::DecrementSessionCount");
 	if (iSessionCount == 0)
 		{
 		iShutdownTimer->After(KShutdownDelay);
-		RDebug::Printf("CTransferServer::DecrementSessionCount1");
+		OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DECREMENTSESSIONCOUNT_DUP01, "CTransferServer::DecrementSessionCount1");
 		}
 	}
 
@@ -148,14 +152,14 @@
 
 void CTransferServer::CShutdownTimer::ConstructL()
 	{
-	RDebug::Printf("CTransferServer::CShutdownTimer::ConstructL");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS, "CTransferServer::CShutdownTimer::ConstructL");
 	CTimer::ConstructL();
 	}
 
 
 void CTransferServer::CShutdownTimer::RunL()
 	{
-	RDebug::Printf("CShutdownTimer::RunL");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS_DUP01, "CShutdownTimer::RunL");
 	CActiveScheduler::Stop();
 	}
 
@@ -231,6 +235,7 @@
 	
 	// first of all set the default interface	
 	TUSB_PRINT2 ("Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
+	OstTraceExt2 (TRACE_NORMAL, CTRANSFERSERVER_SETUPINTERFACE, "Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
 #ifdef USB_SC
 	TUsbcScInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
 	TInt r = iPort[aPortNumber].SetInterface(0, ifc);
@@ -262,6 +267,7 @@
 		}
 	TUint8 interfaceNumber = (*aIfPtr)->iNumber;
 	TUSB_PRINT1 ("Interface Number %d",interfaceNumber);
+	OstTrace1 (TRACE_NORMAL, CTRANSFERSERVER_SETUPINTERFACE_DUP01, "Interface Number %d",interfaceNumber);
 	test.End();
 	}
 
@@ -271,24 +277,24 @@
 	TInt r;
 	User::LeaveIfError(iFs.Connect());
 
-	RDebug::Printf ("Configuration");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS, "Configuration");
 	
-	RDebug::Printf ("Open configuration file");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP01, "Open configuration file");
 	// set the session path to use the ROM if no drive specified
 	r=iFs.SetSessionPath(_L("Z:\\test\\"));
 	test_KErrNone(r);
 
 	r = iConfigFile.Open(iFs, aFileName, EFileShareReadersOnly | EFileStreamText | EFileRead);
 	test_KErrNone(r);
-	RDebug::Printf("Configuration file %s Opened successfully", aFileName.PtrZ());
+	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP02, "Configuration file %S Opened successfully", aFileName);
 
-	RDebug::Printf ("Process configuration file");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP03, "Process configuration file");
 	test(ProcessConfigFile (iConfigFile,NULL,&iLddPtr));
 	
 	iConfigFile.Close();
 	iFs.Close();
 
-	RDebug::Printf ("LDD in configuration file");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP04, "LDD in configuration file");
 	test_NotNull(iLddPtr);
 		
 	LDDConfigPtr lddPtr = iLddPtr;
@@ -298,14 +304,15 @@
 		// Load logical driver (LDD)
 		// (There's no physical driver (PDD) with USB: it's a kernel extension DLL which
 		//	was already loaded at boot time.)
-		RDebug::Printf ("Loading USB LDD");
+		OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP05, "Loading USB LDD");
 		TUSB_PRINT1("Loading USB LDD ",lddPtr->iName.PtrZ());
+		OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP06, "Loading USB LDD %s",lddPtr->iName);
 		r = User::LoadLogicalDevice(lddPtr->iName);
 		test(r == KErrNone || r == KErrAlreadyExists);
 	
 		IFConfigPtr ifPtr = lddPtr->iIFPtr;
 		
-		RDebug::Printf ("Opening Channels");
+		OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP07, "Opening Channels");
 		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
 			{
 			test_Compare(lddPtr->iNumChannels,>,0);
@@ -315,6 +322,7 @@
 			r = iPort[portNumber].Open(0);
 			test_KErrNone(r);
 			TUSB_PRINT("Successfully opened USB port");
+			OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP08, "Successfully opened USB port");
 
 			// Query the USB device/Setup the USB interface
 			if (portNumber == nextPort)
@@ -346,6 +354,7 @@
 		}
 		
 	TUSB_PRINT("All Interfaces and Alternate Settings successfully set up");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP09, "All Interfaces and Alternate Settings successfully set up");
 	
 	iTransferHandle->StartTimer();
 
@@ -364,22 +373,37 @@
 	const TInt n = d_caps().iTotalEndpoints;
 
 	TUSB_PRINT("###  USB device capabilities:");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL, "###  USB device capabilities:");
 	TUSB_PRINT1("Number of endpoints:				 %d", n);
+	OstTrace1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP01, "Number of endpoints:     %d", n);
 	TUSB_PRINT1("Supports Software-Connect: 		 %s",
 				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP02, "Supports Software-Connect:     %s",
+				d_caps().iConnect ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Device is Self-Powered:			 %s",
-				d_caps().iSelfPowered ? _S("yes") : _S("no"));
+				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP03, "Device is Self-Powered:    %s",
+				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports Remote-Wakeup:			 %s",
-				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
+				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP04, "Supports Remote-Wakeup:    %s",
+				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports High-speed:				 %s",
-				d_caps().iHighSpeed ? _S("yes") : _S("no"));
+				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP05, "Supports High-speed:       %s",
+				d_caps().iHighSpeed ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports unpowered cable detection: %s\n",
+				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP06, "Supports unpowered cable detection: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-				_S("yes") : _S("no"));
+				_L("yes") : _L("no"));
 	TUSB_PRINT1("Supports endpoint resource allocation v2 scheme: %s\n",
+				d_caps().iConnect ? _S("yes") : _S("no"));
+	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP07, "Supports endpoint resource allocation v2 scheme: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
-				_S("yes") : _S("no"));					
+				_L("yes") : _L("no"));					
 	TUSB_PRINT("");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP08, "");
 
 	iSoftwareConnect = d_caps().iConnect;					// we need to remember this
 	test_Equal(aLddPtr->iSoftConnect,iSoftwareConnect);
@@ -415,6 +439,7 @@
 	test_KErrNone(r);
 
 	TUSB_PRINT("### USB device endpoint capabilities:");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP09, "### USB device endpoint capabilities:");
 	for (TInt i = 0; i < n; i++)
 		{
 		const TUsbcEndpointCaps* caps = &data[i].iCaps;
@@ -476,9 +501,12 @@
 			directionStr = _S("Both");
 				
 		TUSB_PRINT4("Endpoint:%d Sizes =%s Type = %s - %s",
-					i+1,sizeStr.PtrZ(), typeStr.PtrZ(), directionStr.PtrZ());
+			i+1,sizeStr.PtrZ(), typeStr.PtrZ(), directionStr.PtrZ());
+		OstTraceExt4(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP10, "Endpoint:%d Sizes =%S Type = %S - %S",
+					i+1,sizeStr, typeStr, directionStr);
 		}
 	TUSB_PRINT("");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP11, "");
 
 	test.End();
 			
--- a/kerneltest/e32test/usb/t_usb_device/src/transfersession.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/transfersession.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -28,7 +28,10 @@
 #include "transferserver.h"
 #include "transfersrv.h"
 #include "tranhandlesrv.h"
-
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "transfersessionTraces.h"
+#endif
 
 
 CTransferSession* CTransferSession::NewL(CTransferServer* aServer)
@@ -47,8 +50,10 @@
 CTransferSession::~CTransferSession()
 	{
 	TUSB_PRINT("CTransferSession::~CTransferSession");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSESSION_DCTRANSFERSESSION, "CTransferSession::~CTransferSession");
 	iTransferServer->DecrementSessionCount();
 	TUSB_PRINT("<<CTransferSession::~CTransferSession");
+	OstTrace0(TRACE_NORMAL, CTRANSFERSESSION_DCTRANSFERSESSION_DUP01, "<<CTransferSession::~CTransferSession");
 	}
 
 
--- a/kerneltest/e32test/usb/t_usb_device/src/transfersrv.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/transfersrv.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -24,6 +24,10 @@
 #include <e32test.h>
 #include <usb.h>
 #include "transfersrv.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "transfersrvTraces.h"
+#endif
 
 _LIT(KUsbmanImg, "z:\\system\\programs\\t_usb_transfersrv.exe");
 
@@ -34,17 +38,17 @@
 //
 	{
 	const TUidType serverUid(KNullUid, KNullUid, KTransferSvrUid);
-	RDebug::Printf("StartServer1");
+	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER, "StartServer1");
 
 	RProcess server;
 	TInt err = server.Create(KUsbmanImg, KNullDesC, serverUid);
-	RDebug::Printf("StartServer2 %d", err);
+	OstTrace1(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP01, "StartServer2 %d", err);
 	
 	if (err != KErrNone)
 		{
 		return err;
 		}
-	RDebug::Printf("StartServer3");
+	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP02, "StartServer3");
 
 	TRequestStatus stat;
 	server.Rendezvous(stat);
@@ -53,7 +57,7 @@
 		server.Kill(0);		// abort startup
 	else
 		server.Resume();	// logon OK - start the server
-	RDebug::Printf("StartServer4");
+	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP03, "StartServer4");
 
 	User::WaitForRequest(stat);		// wait for start or death
 
@@ -61,11 +65,11 @@
 	// is the panic 'reason' and may be '0' which cannot be distinguished
 	// from KErrNone
 	err = (server.ExitType() == EExitPanic) ? KErrServerTerminated : stat.Int();
-	RDebug::Printf("StartServer5");
+	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP04, "StartServer5");
 
 	//server.Close();
 	
-	RDebug::Printf("transfer server started successfully: \n");
+	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP05, "transfer server started successfully: \n");
 
 	return err;
 	}
@@ -94,23 +98,23 @@
     {
 	TInt retry = 2;
 	
-	RDebug::Printf("Connect1");
+	OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT, "Connect1");
 	FOREVER
 		{
 		TInt err = CreateSession(KTransferServerName, Version(), 10);
-		RDebug::Printf("Connect2");
+		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP01, "Connect2");
 
 		if ((err != KErrNotFound) && (err != KErrServerTerminated))
 			{
 			return err;
 			}
-		RDebug::Printf("Connect3");
+		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP02, "Connect3");
 
 		if (--retry == 0)
 			{
 			return err;
 			}
-		RDebug::Printf("Connect4");
+		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP03, "Connect4");
 
 		err = StartServer();
 
@@ -119,14 +123,14 @@
 			return err;
 			}
 		
-		RDebug::Printf("Connect5");
+		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP04, "Connect5");
 		}
     }
 
 EXPORT_C TInt RTransferSrv::SetConfigFileName(TDes& aString)
 	{
 	
-	RDebug::Printf("SetConfigFileName");
+	OstTrace0(TRACE_NORMAL, RTRANSFERSRV_SETCONFIGFILENAME, "SetConfigFileName");
 	return SendReceive(ESetConfigFileName, TIpcArgs(&aString));
 	}
 
--- a/kerneltest/e32test/usb/t_usb_device/src/transfersrvmain.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/transfersrvmain.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -18,6 +18,10 @@
 #include <e32base.h>
 #include <e32test.h>
 #include "transfersrv.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "transfersrvmainTraces.h"
+#endif
 #include "transferserver.h"
 
 static void RunServerL();
@@ -68,17 +72,17 @@
 
 	//
 	// Ready to run
-	RDebug::Printf(">>>CActiveScheduler::Start");
+	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL, ">>>CActiveScheduler::Start");
 	CActiveScheduler::Start();
-	RDebug::Printf("<<<CActiveScheduler::Start");
+	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL_DUP01, "<<<CActiveScheduler::Start");
 	test.End();
 	test.Close();
 
 	//
 	// Cleanup the server and scheduler
-	RDebug::Printf("tranfermain exit 1");
+	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL_DUP02, "tranfermain exit 1");
 	CleanupStack::PopAndDestroy(2, scheduler);
-	RDebug::Printf("tranfermain exit 2");
+	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL_DUP03, "tranfermain exit 2");
 	}
 
 //
--- a/kerneltest/e32test/usb/t_usb_device/src/usbms.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/usbms.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // USB Mass Storage Application
-// 
+//
 //
 
 /**
@@ -27,6 +27,11 @@
 #include <massstorage.h>
 
 #include "usbms.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "usbmsTraces.h"
+#endif
+
 
 extern CActiveControl* gActiveControl;
 extern RTest test;
@@ -75,10 +80,10 @@
     CFileSystemDescriptor* pSelf = new (ELeave) CFileSystemDescriptor;
 
     CleanupStack::PushL(pSelf);
-    
+
     pSelf->iFsName.CreateMaxL(aFsName.Length());
     pSelf->iFsName.Copy(aFsName);
-    
+
     pSelf->iPrimaryExtName.CreateMaxL(aPrimaryExtName.Length());
     pSelf->iPrimaryExtName.Copy(aPrimaryExtName);
 
@@ -91,7 +96,7 @@
 
 //-----------------------------------------------------------------------------
 /**
-    Dismounts the originally mounted FS and optional primary extension from the drive and stores 
+    Dismounts the originally mounted FS and optional primary extension from the drive and stores
     this information in the FS descriptor
 
     @return on success returns a pointer to the instantinated FS descriptor
@@ -104,6 +109,7 @@
     TBool       bDrvSync = EFalse;
 
     test.Printf(_L("DoDismountOrginalFS drv:%d\n"), aDrive);
+    OstTrace1(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL, "DoDismountOrginalFS drv:%d\n", aDrive);
 
     //-- 1. get file system name
     nRes = aFs.FileSystemName(fsName, aDrive);
@@ -124,23 +130,25 @@
     //-- other extensions (non-primary) are not supported yet
     nRes = aFs.ExtensionName(primaryExtName, aDrive, 0);
     if(nRes != KErrNone)
-        {   
+        {
         primaryExtName.SetLength(0);
         }
 
     //-- 3.1 check if the drive has non-primary extensions, fail in this case, because this FS can't be mounted back normally
     nRes = aFs.ExtensionName(primaryExtName, aDrive, 1);
     if(nRes == KErrNone)
-        {   
+        {
         test.Printf(_L("DoDismountOrginalFS Non-primary extensions are not supported!\n"));
+        OstTrace0(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP01, "DoDismountOrginalFS Non-primary extensions are not supported!\n");
         return NULL;
         }
 
     test.Printf(_L("DoDismountOrginalFS FS:%S, Prim ext:%S, synch:%d\n"), &fsName, &primaryExtName, bDrvSync);
+    OstTraceExt3(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP02, "DoDismountOrginalFS FS:%S, Prim ext:%S, synch:%d\n", fsName, primaryExtName, bDrvSync);
 
     //-- create FS descriptor and dismount the FS
-    CFileSystemDescriptor* pFsDesc = NULL; 
-    
+    CFileSystemDescriptor* pFsDesc = NULL;
+
     TRAP(nRes, pFsDesc = CFileSystemDescriptor::NewL(fsName, primaryExtName, bDrvSync));
     if(nRes != KErrNone)
         return NULL; //-- OOM ?
@@ -151,8 +159,9 @@
         delete pFsDesc;
         pFsDesc = NULL;
         test.Printf(_L("DoDismountOrginalFS Dismounting Err:%d\n"), nRes);
+        OstTrace1(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP03, "DoDismountOrginalFS Dismounting Err:%d\n", nRes);
         }
-    
+
     return pFsDesc;
 }
 
@@ -166,6 +175,7 @@
     TInt nRes;
 
     test.Printf(_L("DoRestoreFS drv:%d\n"), aDrive);
+    OstTrace1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS, "DoRestoreFS drv:%d\n", aDrive);
 
     //-- 1. check that there is no FS installed
     TBuf<128>   fsName;
@@ -173,12 +183,14 @@
     if(nRes == KErrNone)
         {//-- there is a file system already installed
 		test.Printf(_L("DoRestoreFS This drive already has FS intalled:%S \n"), &fsName);
+		OstTraceExt1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP01, "DoRestoreFS This drive already has FS intalled:%S \n", fsName);
         return KErrAlreadyExists;
         }
- 
+
     TPtrC ptrN  (apFsDesc->FsName());
     TPtrC ptrExt(apFsDesc->PrimaryExtName());
     test.Printf(_L("DoRestoreFS Mounting FS:%S, Prim ext:%S, synch:%d\n"), &ptrN, &ptrExt, apFsDesc->DriveIsSynch());
+    OstTraceExt3(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP02, "DoRestoreFS Mounting FS:%S, Prim ext:%S, synch:%d\n", ptrN, ptrExt, apFsDesc->DriveIsSynch());
 
     if(ptrExt.Length() >0)
         {//-- there is a primary extension to be mounted
@@ -197,7 +209,8 @@
 
     if(nRes != KErrNone)
         {
-        test.Printf(_L("DoRestoreFS Mount failed! code:%d\n"),nRes);    
+        test.Printf(_L("DoRestoreFS Mount failed! code:%d\n"),nRes);
+        OstTrace1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP03, "DoRestoreFS Mount failed! code:%d\n",nRes);
         }
 
     return nRes;
@@ -210,7 +223,8 @@
 */
 LOCAL_C void MountMsFs(TInt driveNumber)
 	{
-	test.Printf(_L("MountMsFs driveNumber=%d\n"), driveNumber); 
+	test.Printf(_L("MountMsFs driveNumber=%d\n"), driveNumber);
+	OstTrace1(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS, "MountMsFs driveNumber=%d\n", driveNumber);
 
     //-- 1. try dismounting the original FS
     CFileSystemDescriptor* fsDesc = DoDismountOrginalFS(fs, driveNumber);
@@ -220,16 +234,19 @@
         {
         TPtrC ptrN(fsDesc->FsName());
         test.Printf(_L("drv:%d FS:%S Dismounted OK\n"),driveNumber, &ptrN);
+        OstTraceExt2(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP01, "drv:%d FS:%S Dismounted OK\n",driveNumber, ptrN);
         }
     else
         {
         test.Printf(_L("drv:%d Dismount FS Failed!\n"),driveNumber);
+        OstTrace1(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP02, "drv:%d Dismount FS Failed!\n",driveNumber);
         }
 
     //-- 2. try to mount the "MSFS"
     TInt error;
     error = fs.MountFileSystem(KMsFs, driveNumber);
 	test.Printf(_L("MSFS Mount:   %S (%d)\n"), (error?&KError:&KOk), error);
+	OstTraceExt2(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP03, "MSFS Mount:   %S (%d)\n", (error?KError():KOk()), error);
 	if (!error)
 		msfsMountedList[driveNumber] = ETrue;
 
@@ -237,7 +254,7 @@
 
 //-----------------------------------------------------------------------------
 /**
-    Dismount MsFS and mount the original FS 
+    Dismount MsFS and mount the original FS
 */
 LOCAL_C TInt RestoreMount(TInt driveNumber)
 	{
@@ -248,6 +265,7 @@
 		{
 		err = fs.DismountFileSystem(KMsFs, driveNumber);
 		test.Printf(_L("MSFS Dismount:%S (%d)\n"), (err?&KError:&KOk), err);
+		OstTraceExt2(TRACE_NORMAL, RESTOREMOUNT_RESTOREMOUNT, "MSFS Dismount:%S (%d)\n", (err?KError():KOk()), err);
 		if (err)
 			return err;
 
@@ -262,7 +280,7 @@
 
         TPtrC ptrN(fsDesc->FsName());
         test.Printf(_L("%S Mount:    %S (%d)\n"), &ptrN, (err?&KError:&KOk), err);
-        
+        OstTraceExt3(TRACE_NORMAL, RESTOREMOUNT_RESTOREMOUNT_DUP01, "%S Mount:    %S (%d)\n", ptrN, (err?KError():KOk()), err);
         delete fsDesc;
         unmountedFsList[driveNumber] = NULL;
         }
@@ -334,8 +352,8 @@
 	}
 
 CUsbWatch::CUsbWatch(RUsb& aUsb)
-	: 
-	CActive(0), 
+	:
+	CActive(0),
 	iUsb(aUsb),
 	iUsbDeviceState(EUsbcDeviceStateUndefined),
 	iWasConfigured(EFalse)
@@ -370,7 +388,7 @@
 	fs.DriveToChar(driveNumber, driveLetter);
 	return driveLetter;
 	}
-	
+
 static TBool IsDriveInMountList(TUint driveLetter)
 	{
 	TUint16 driveLetter16 = static_cast<TUint16>(driveLetter);
@@ -386,36 +404,44 @@
 			{
 			case EUsbcDeviceStateUndefined : 					// 0
 				test.Printf(_L(">> CUSBWatch:Undefined %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL, ">> CUSBWatch:Undefined %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-			
+
 			case EUsbcDeviceStateAttached :						// 1
 				test.Printf(_L(">> CUSBWatch:Attached %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP01, ">> CUSBWatch:Attached %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-			
+
 			case EUsbcDeviceStatePowered :						// 2
 				test.Printf(_L(">> CUSBWatch:Powered %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP02, ">> CUSBWatch:Powered %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-	
+
 			case EUsbcDeviceStateDefault :						// 3
 				test.Printf(_L(">> CUSBWatch:Default %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP03, ">> CUSBWatch:Default %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-			
+
 			case EUsbcDeviceStateAddress :						// 4
 				test.Printf(_L(">> CUSBWatch:Address %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP04, ">> CUSBWatch:Address %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-			
+
 			case EUsbcDeviceStateConfigured :					// 5
 				test.Printf(_L(">> CUSBWatch:Configured %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP05, ">> CUSBWatch:Configured %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-			
+
 			case EUsbcDeviceStateSuspended : 					// 6
 				test.Printf(_L(">> CUSBWatch:Suspended %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP06, ">> CUSBWatch:Suspended %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-			
+
 			default :
 				test.Printf(_L(">> CUSBWatch:UNKNOWN %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
+				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP07, ">> CUSBWatch:UNKNOWN %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-		
+
 			}
 		}
 	iUsb.AlternateDeviceStatusNotify(iStatus, iUsbDeviceState);
@@ -428,7 +454,7 @@
 			{
 			if(IsDriveConnected(i))
 				{
-				RDebug::Print(_L("CUsbWatch calling RestoreMount"));
+				OstTrace0(TRACE_NORMAL, CUSBWATCH_RUNL_DUP08, "CUsbWatch calling RestoreMount");
 				RestoreMount(PropertyHandlers::allDrivesStatus[2*i]);
 				}
 			}
@@ -438,7 +464,7 @@
 
 	// If cable is connected, mount all drives in the auto-mount list.
 	// This is done for performance, since if this is not done here,
-	// mounting will happen later after each drive enters the 
+	// mounting will happen later after each drive enters the
 	// Connecting state.
 	if(iUsbDeviceState == EUsbcDeviceStateConfigured)
 		{
@@ -447,7 +473,7 @@
 			TInt driveNumber = PropertyHandlers::allDrivesStatus[2*i];
 			if(!IsDriveConnected(i) && IsDriveInMountList(DriveNumberToLetter(driveNumber)))
 				{
-				RDebug::Print(_L("CUsbWatch calling MountMsFs"));
+				OstTrace0(TRACE_NORMAL, CUSBWATCH_RUNL_DUP09, "CUsbWatch calling MountMsFs");
 				MountMsFs(driveNumber);
 				}
 			}
@@ -486,7 +512,9 @@
 			{
 			if (gVerbose)
 				{
-				test.Printf(KBytesTransferredFmt, 
+				test.Printf(KBytesTransferredFmt,
+						(char)DriveNumberToLetter(allDrivesStatus[2*i]), iKBytesRead[i], iKBytesWritten[i]);
+				OstTraceExt3(TRACE_NORMAL, PROPERTYHANDLERS_TRANSFERRED, "%c:%d/%d \n",
 						(char)DriveNumberToLetter(allDrivesStatus[2*i]), iKBytesRead[i], iKBytesWritten[i]);
 				}
 			}
@@ -494,14 +522,16 @@
 	else
 		{
 		test.Printf(KErrFmt, err);
+		OstTrace1(TRACE_NORMAL, PROPERTYHANDLERS_TRANSFERRED_DUP01, "Error: %d\r", err);
 		}
 	}
-	
+
 void PropertyHandlers::DriveStatus(RProperty& aProperty)
 	{
 	if (gVerbose)
 		{
 		test.Printf(_L(">> PropertyHandlers::DriveStatus"));
+		OstTrace0(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS, ">> PropertyHandlers::DriveStatus");
 		}
 	TInt err = aProperty.Get(allDrivesStatus);
 	if(err == KErrNone)
@@ -509,6 +539,7 @@
 		if (gVerbose)
 			{
 			test.Printf(_L(" Status:  "));
+			OstTrace0(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP01, " Status:  ");
 			}
 		for(TInt i = 0; i < allDrivesStatus.Length()/2; i++)
 			{
@@ -523,51 +554,61 @@
 					case EUsbMsDriveState_Disconnected:
 						{
 						test.Printf(_L("%c:%d:Disconnected\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP02, "%c:%d:Disconnected\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Connecting:
 						{
 						test.Printf(_L("%c:%d:Connecting\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP03, "%c:%d:Connecting\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Connected:
 						{
 						test.Printf(_L("%c:%d:Connected\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP04, "%c:%d:Connected\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Disconnecting:
 						{
 						test.Printf(_L("%c:%d:Disconnecting\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP05, "%c:%d:Disconnecting\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Active:
 						{
 						test.Printf(_L("%c:%d:Active\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP06, "%c:%d:Active\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Locked:
 						{
 						test.Printf(_L("%c:%d:Locked\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP07, "%c:%d:Locked\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_MediaNotPresent:
 						{
 						test.Printf(_L("%c:%d:Not Present\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP08, "%c:%d:Not Present\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Removed:
 						{
 						test.Printf(_L("%c:%d:Removed\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP09, "%c:%d:Removed\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Error:
 						{
 						test.Printf(_L("%c:%d:Error\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP10, "%c:%d:Error\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					default :
 						{
 						test.Printf(_L("%c:%d:Unknown\n"), (char)driveLetter, driveStatus);
+						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP11, "%c:%d:Unknown\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					}
@@ -575,11 +616,11 @@
 
 			if (driveStatus == EUsbMsDriveState_Connected)
 				{
-				gActiveControl->SetMSFinished(EFalse);				
+				gActiveControl->SetMSFinished(EFalse);
 				}
 			if (driveStatus == EUsbMsDriveState_Disconnected)
 				{
-				gActiveControl->SetMSFinished(ETrue);				
+				gActiveControl->SetMSFinished(ETrue);
 				}
 			if(IsDriveInMountList(driveLetter))
 				{
@@ -591,20 +632,13 @@
 					{
 					RestoreMount(driveNumber);
 					}
-				else
-					{
-					//RDebug::Print(_L("PropertyHandlers::DriveStatus: nothing to do"));
-					}
-				}
-			else
-				{
-				//RDebug::Print(_L("PropertyHandlers::DriveStatus: %c: is not in mountList\n"), driveLetter);
-				}
+    			}
 			}
 		}
 	else
 		{
 		test.Printf(KErrFmt, err);
+		OstTrace1(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP14, "Error: %d\r", err);
 		}
 
 	}
@@ -618,6 +652,7 @@
 		}
 
 	test.Printf(_L("Media Error %x\n"), iMediaError);
+	OstTrace1(TRACE_NORMAL, PROPERTYHANDLERS_MEDIAERROR, "Media Error %x\n", iMediaError);
 	if (iMediaError > 0)
 		{
 		gActiveControl->SetMSFinished(ETrue);
@@ -669,11 +704,11 @@
 
 	test.End();
 	}
-	
+
 void StopMassStorage(RDEVCLIENT* aPort)
 	{
     TInt r = KErrUnknown;
-	
+
 	test.Start (_L("Stop Mass Storage"));
 
 	r = UsbMs.Stop();
@@ -695,15 +730,15 @@
 	test_KErrNone (r);
 
 	fs.Close();
-	
+
 	delete usbWatch;
 	for (TUint i =0; i < KNumPropWatch; i++)
 		{
 		delete propWatch[i];
 		}
-	
+
 	aPort->Close();
-		
+
 	test.End();
 	}
 
--- a/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,7 +1,7 @@
 // t_otgdi.mmp
 //
 
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -78,6 +78,7 @@
 
 // include files
 USERINCLUDE     ../inc
+USERINCLUDE     ../traces_t_otgdi
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
--- a/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi_fdfactor.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi_fdfactor.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,7 +1,7 @@
 // t_otgdi_fdfactor.mmp
 //
 
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -33,6 +33,7 @@
 
 // include files
 USERINCLUDE     ../inc
+USERINCLUDE     ../traces_t_otgdi_fdfactor
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
--- a/kerneltest/e32test/usbho/t_otgdi/inc/b2bwatchers.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/inc/b2bwatchers.h	Thu Sep 02 21:54:16 2010 +0300
@@ -208,9 +208,9 @@
 class CNotifyWatcherBase : public CActive
 	{
 public:
-	virtual ~CNotifyWatcherBase() {LOG_FUNC  };
+	virtual ~CNotifyWatcherBase() {  };
 	
-	virtual void StartWatching(TInt aInterval) {LOG_FUNC  TInt n(aInterval); IssueAgain(); SetActive(); };
+	virtual void StartWatching(TInt aInterval) {  TInt n(aInterval); IssueAgain(); SetActive(); };
 	// getter
 	TWatcherNotifyType GetType() {return(iWatchType);};		
 	
@@ -248,16 +248,16 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot);
 		void ConstructL();
-		virtual ~COtgWatchdogWatcher() {LOG_FUNC ;Cancel();};
+		virtual ~COtgWatchdogWatcher() {Cancel();};
 		
 		void StartTimer(TInt aIntervalMs);
 		void StartWatching(TInt aIntervalMs) {StartTimer(aIntervalMs); };
 		
  
 		
-		TInt IssueAgain() { LOG_FUNC ASSERT(0); return(0);};
-		void DoCancel() {LOG_FUNC ;iTimer.Cancel();};
-		void DisplayEvent() {LOG_FUNC ASSERT(0); }; // should never fire this
+		TInt IssueAgain() { ASSERT(0); return(0);};
+		void DoCancel() {iTimer.Cancel();};
+		void DisplayEvent() {ASSERT(0); }; // should never fire this
 	TInt GetEventValue() {return(iIntervalMs);};
 	void StepExpired(TInt aInterval);		
 	
@@ -285,14 +285,14 @@
 	static COtgStateWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
 	
-	virtual ~COtgStateWatcher() {LOG_FUNC Cancel(); };
+	virtual ~COtgStateWatcher() { Cancel(); };
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueOtgStateRequest(iState , iStatus); return(ETrue);};
 	void DisplayEvent(); 
 
 	TInt GetEventValue() {return(iState);};
 	
-	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelOtgStateRequest();};
+	void DoCancel() { iOtgRoot.otgCancelOtgStateRequest();};
 
 protected:
 	COtgStateWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) :
@@ -310,12 +310,12 @@
 public:
 	static COtgEventWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~COtgEventWatcher() {LOG_FUNC Cancel(); };		
+	virtual ~COtgEventWatcher() { Cancel(); };		
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueOtgEventRequest(iEvent , iStatus); return(ETrue);};
 	void DisplayEvent(); 
 	TInt GetEventValue() {return(iEvent);};
-	void DoCancel() { LOG_FUNC iOtgRoot.otgCancelOtgEventRequest();};
+	void DoCancel() {  iOtgRoot.otgCancelOtgEventRequest();};
 
 protected:
 	COtgEventWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
@@ -333,12 +333,12 @@
 public:
 	static COtgMessageWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~COtgMessageWatcher() {LOG_FUNC Cancel(); };	
+	virtual ~COtgMessageWatcher() { Cancel(); };	
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueOtgMessageRequest(iMessage, iStatus); return(ETrue);};
 	void DisplayEvent();
 	TInt GetEventValue() {return(iMessage);};
-	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelOtgMessageRequest();};
+	void DoCancel() { iOtgRoot.otgCancelOtgMessageRequest();};
 
 protected:
 	COtgMessageWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
@@ -354,12 +354,12 @@
 public:
 	static CPeripheralStateWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~CPeripheralStateWatcher() {LOG_FUNC Cancel(); };	
+	virtual ~CPeripheralStateWatcher() { Cancel(); };	
 	
 	TInt IssueAgain() { iOtgRoot.otgQueuePeripheralStateRequest(iPeripheralState, iStatus); return(ETrue);};
 	void DisplayEvent();
 	TInt GetEventValue() {return(iPeripheralState);};
-	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelPeripheralStateRequest();};
+	void DoCancel() { iOtgRoot.otgCancelPeripheralStateRequest();};
 
 protected:
 	CPeripheralStateWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
@@ -375,12 +375,12 @@
 public:
 	static CAConnectionIdleWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~CAConnectionIdleWatcher() {LOG_FUNC Cancel(); };	
+	virtual ~CAConnectionIdleWatcher() { Cancel(); };	
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueAConnectionIdleRequest(iAConnectionIdle, iStatus); return(ETrue);};
 	void DisplayEvent();
 	TInt GetEventValue() {return(iAConnectionIdle);};
-	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelAConnectionIdleRequest();};
+	void DoCancel() { iOtgRoot.otgCancelAConnectionIdleRequest();};
 
 protected:
 	CAConnectionIdleWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
--- a/kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h	Thu Sep 02 21:54:16 2010 +0300
@@ -27,7 +27,6 @@
  e.g. 
 <Function> void CMyClass::MyFunction (TInt aParam)
 */
-#define LOG_FUNC 	if (gVerboseOutput) RDebug::Printf("<Function> %s", __PRETTY_FUNCTION__);
 
 const TInt KErrAssertionInternal	= 3;
 
@@ -36,7 +35,6 @@
 									__ASSERT_ALWAYS(a, User::Panic(_L("Test F/W Err"), KErrAssertionInternal));};
 
 
-#define LOG_FUNCERROR(a) RDebug::Printf("[WARNING %s failed %d]", __PRETTY_FUNCTION__, a);
 
 /**
 Debug macro to output test in 'verbose' detail mode
--- a/kerneltest/e32test/usbho/t_otgdi/src/b2bwatchers.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/b2bwatchers.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -30,6 +30,10 @@
 #include <d32usbc.h>		// USBCC header
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "b2bwatchersTraces.h"
+#endif
 
 
 
@@ -45,7 +49,10 @@
 
 CNotifyCollector::CNotifyCollector(TRequestStatus &aStatus)  : iStatusStep(aStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_CNOTIFYCOLLECTOR);
+	    }
 	TTimeIntervalDays oneday(1);
 	iTimeStarted.HomeTime();
 	iTimeStarted += (oneday); // force all durations to produce a negative (invalid) value
@@ -57,7 +64,10 @@
  */ 
 CNotifyCollector::~CNotifyCollector()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_DCNOTIFYCOLLECTOR);
+	    }
 	
 	ClearAllEvents(); // free event arrays
 
@@ -74,7 +84,6 @@
  */
 void CNotifyCollector::ClearAllEvents(TBool aClearRecieved/*=ETrue*/, TBool aClearRequired /*=ETrue*/)
 	{
-	//LOG_FUNC
 	if (aClearRequired)
 		{
 		iRequiredEvents.Reset();
@@ -92,7 +101,10 @@
  */
 void CNotifyCollector::CreateObserversL(COtgRoot &aOtgDriver)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_CREATEOBSERVERSL);
+	    }
 	TInt watchType;
 	ASSERT(aOtgDriver.LddLoaded());
 	
@@ -125,7 +137,7 @@
 		
 		// add it to our list so we can kill them after the test.
 		iNotifyObjects.Append(pWatcher);
-		//LOG_VERBOSE3(_L("Added watcher type %d, TRequest= %08X.\n"), iType, (TInt)(&pWatcher->iStatus));	
+
 		
 		// start all watchers, except for the watchdog
 		if (watchType != EWatcherTimeouts)
@@ -134,6 +146,7 @@
 			}
 		}
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_CREATEOBSERVERSL_DUP02, "\n");
 	}
 
 
@@ -141,12 +154,19 @@
  */
 void CNotifyCollector::DestroyObservers()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_DESTROYOBSERVERS);
+	    }
 	
 	// Free the Watchers
 	for (TInt idx=0; idx < iNotifyObjects.Count(); idx++)
 		{
 		LOG_VERBOSE2(_L(".. %d .."), idx);		
+		if(gVerboseOutput)
+		    {
+		    OstTrace1(TRACE_VERBOSE, CNOTIFYCOLLECTOR_DESTROYOBSERVERS_DUP01, ".. %d ..", idx);		
+		    }
 		delete iNotifyObjects[idx];	// they will call their own Cancel() methods
 		}
 	iNotifyObjects.Close();	
@@ -182,22 +202,42 @@
 		case EWatcherState:
 			COtgRoot::OtgStateString(static_cast<RUsbOtgDriver::TOtgState>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() State %d '%S' wanted\n"), aValue, &aDescription);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION, "AddRequiredNotification() State %d '%S' wanted\n", aValue, aDescription);
+			    }
 			break;
 		case EWatcherEvent:
 			COtgRoot::OtgEventString(static_cast<RUsbOtgDriver::TOtgEvent>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() Event %d '%S' wanted\n"), aValue, &aDescription);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP01, "AddRequiredNotification() Event %d '%S' wanted\n", aValue, aDescription);
+			    }
 			break;
 		case EWatcherMessage:
 			COtgRoot::OtgMessageString(static_cast<RUsbOtgDriver::TOtgMessage>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() Message %d '%S' wanted\n"), aValue, &aDescription);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP02, "AddRequiredNotification() Message %d '%S' wanted\n", aValue, aDescription);
+			    }
 			break;
 		case EWatcherPeripheralState:
 			COtgRoot::PeripheralStateString(static_cast<TUint>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() Peripheral State %d '%S' wanted\n"), aValue, &aDescription);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP03, "AddRequiredNotification() Peripheral State %d '%S' wanted\n", aValue, aDescription);
+			    }
 			break;
 		case EWatcherAConnectionIdle:
 			COtgRoot::AConnectionIdleString(static_cast<RUsbOtgDriver::TOtgConnection>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() AConnectionIdle %d '%S' wanted\n"), aValue, &aDescription);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP04, "AddRequiredNotification() AConnectionIdle %d '%S' wanted\n", aValue, aDescription);
+			    }
 			break;
 
 		}
@@ -311,6 +351,7 @@
 	if (aType == EWatcherTimeouts)
 		{
 		test.Printf(_L("Step timed out..(%dms).\n\n"), GetWatcher(aType)->GetEventValue());
+		OstTrace1(TRACE_NORMAL, CNOTIFYCOLLECTOR_HANDLEEVENT, "Step timed out..(%dms).\n\n", GetWatcher(aType)->GetEventValue());
 		CompleteStep(KTestCaseWatchdogTO);
 		return;
 		}
@@ -323,6 +364,7 @@
 	if (IsFailureEvent(evt))
 		{
 		test.Printf(_L("This event denotes failure for this test\n"));
+		OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_HANDLEEVENT_DUP01, "This event denotes failure for this test\n");
 		CompleteStep(KTestCaseFailureEventReceived);
 		return;
 		}
@@ -332,8 +374,6 @@
 		// itterate all required events, search for each one in the incomming events list
 		while (start< iRequiredEvents.Count())
 			{
-				//LOG_VERBOSE3(_L("Search for=[%d,%d] :"), 
-				//					iRequiredEvents[start].GetType(), iRequiredEvents[start].GetValue());
 				
 				if (!EventReceivedAlready(iRequiredEvents[start]))
 					return;	// missing still, continue
@@ -341,11 +381,16 @@
 			}
 		// found all the required events
 		LOG_VERBOSE1(_L("Found all.\n"));
+		if(gVerboseOutput)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CNOTIFYCOLLECTOR_HANDLEEVENT_DUP03, "Found all.\n");
+		    }
 		CompleteStep(KErrNone);
 		}
 	else
 		{
 		test.Printf(_L("Warning : No required events!\n"));
+		OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_HANDLEEVENT_DUP04, "Warning : No required events!\n");
 		}	
 	}
 
@@ -357,6 +402,7 @@
 	if(iStatusStep.Int() != KRequestPending)
 		{
 		test.Printf(_L("Can't complete step - not KRequestPending!\n"));
+		OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_COMPLETESTEP, "Can't complete step - not KRequestPending!\n");
 		}
 	else
 		{
@@ -372,7 +418,10 @@
 												const TWatcherNotifyType aWatchType, 
 												COtgRoot &aOtgRoot)
 	{
-	LOG_FUNC 
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_COMPLETESTEP_DUP01);
+	    }
 	COtgWatchdogWatcher* self = new (ELeave) COtgWatchdogWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -383,7 +432,10 @@
 
 void COtgWatchdogWatcher::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGWATCHDOGWATCHER_CONSTRUCTL);
+	    }
 	
 	iTimer.CreateLocal();
 	iIntervalMs = -1;
@@ -392,21 +444,26 @@
 
 void COtgWatchdogWatcher::StepExpired(TInt aInterval) 
 	{
-	LOG_FUNC ; 
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGWATCHDOGWATCHER_STEPEXPIRED);
+	    }
 	iHandler.HandleEvent(EWatcherTimeouts, aInterval) ; 
 	}
 
 
 void COtgWatchdogWatcher::RunL()
 	{ 
-	//LOG_FUNC 
 	StepExpired(iIntervalMs); 
 	}
 
 
 void COtgWatchdogWatcher::StartTimer(TInt aIntervalMs)
 	{
-	LOG_FUNC ;
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGWATCHDOGWATCHER_STARTTIMER);
+	    }
 
 	iIntervalMs = aIntervalMs;	// save value for printing latter 
 	if (IsActive()) //cancel the last timer we set, this is easier than cancelling it in each test-step
@@ -421,6 +478,10 @@
 		SetActive();
 		}
 	LOG_VERBOSE2(_L("wd Timer %dms\n"), aIntervalMs)
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, COTGWATCHDOGWATCHER_STARTTIMER_DUP01, "wd Timer %dms\n", aIntervalMs);
+	    }
 	}	
 
 
@@ -431,7 +492,10 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot)
 	{
-	LOG_FUNC 
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGMESSAGEWATCHER_NEWL);
+	    }
 	COtgMessageWatcher* self = new (ELeave) COtgMessageWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -445,6 +509,7 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.OtgMessageString(iMessage, aDescription);
 	test.Printf(_L("Received Message %d '%S'\n"), iMessage, &aDescription);
+	OstTraceExt2(TRACE_NORMAL, COTGMESSAGEWATCHER_DISPLAYEVENT, "Received Message %d '%S'\n", iMessage, aDescription);
 	}
 
 
@@ -452,7 +517,10 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot)
 	{
-	LOG_FUNC 
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGSTATEWATCHER_NEWL);
+	    }
 	COtgStateWatcher* self = new (ELeave) COtgStateWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -463,10 +531,10 @@
 
 void COtgStateWatcher::DisplayEvent() 
 	{
-	//LOG_FUNC
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.OtgStateString(iState, aDescription);
 	test.Printf(_L("Received State %d '%S'\n"), iState, &aDescription);
+	OstTraceExt2(TRACE_NORMAL, COTGSTATEWATCHER_DISPLAYEVENT_DUP01, "Received State %d '%S'\n", iState, aDescription);
 	}
 
 
@@ -474,7 +542,6 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot)
 	{
-	//LOG_FUNC 
 	COtgEventWatcher* self = new (ELeave) COtgEventWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -487,13 +554,13 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.OtgEventString(iEvent, aDescription);
 	test.Printf(_L("Received Event %d '%S'\n"), iEvent, &aDescription);
+	OstTraceExt2(TRACE_NORMAL, COTGEVENTWATCHER_DISPLAYEVENT, "Received Event %d '%S'\n", iEvent, aDescription);
 	}
 
 CPeripheralStateWatcher* CPeripheralStateWatcher::NewL(MOtgNotificationHandler &wdHandler, 
 														const TWatcherNotifyType aWatchType, 
 														COtgRoot &aOtgRoot)
 	{
-	//LOG_FUNC 
 	CPeripheralStateWatcher* self = new (ELeave) CPeripheralStateWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -506,13 +573,13 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.PeripheralStateString(iPeripheralState, aDescription);
 	test.Printf(_L("Peripheral State %d '%S'\n"), iPeripheralState, &aDescription);
+	OstTraceExt2(TRACE_NORMAL, CPERIPHERALSTATEWATCHER_DISPLAYEVENT, "Peripheral State %u '%S'\n", iPeripheralState, aDescription);
 	}
 
 CAConnectionIdleWatcher* CAConnectionIdleWatcher::NewL(MOtgNotificationHandler &wdHandler, 
 														const TWatcherNotifyType aWatchType, 
 														COtgRoot &aOtgRoot)
 	{
-	//LOG_FUNC 
 	CAConnectionIdleWatcher* self = new (ELeave) CAConnectionIdleWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -550,4 +617,5 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.AConnectionIdleString(iAConnectionIdle, aDescription);
 	test.Printf(_L("AConnectionIdle %d '%S'\n"), iAConnectionIdle, &aDescription);
+	OstTraceExt2(TRACE_NORMAL, CACONNECTIONIDLEWATCHER_DISPLAYEVENT, "AConnectionIdle %d '%S'\n", iAConnectionIdle, aDescription);
 	}
--- a/kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -27,6 +27,10 @@
 #include "testcasewd.h"
 #include "testcasefactory.h"
 #include "exampletestcase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "exampletestcaseTraces.h"
+#endif
 
 
 
@@ -39,7 +43,10 @@
 
 CExampleTestCase* CExampleTestCase::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_NEWL);
+	    }
 	CExampleTestCase* self = new (ELeave) CExampleTestCase(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -51,13 +58,19 @@
 CExampleTestCase::CExampleTestCase(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_CEXAMPLETESTCASE);
+	    }
 	} 
 
 
 void CExampleTestCase::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_CONSTRUCTL);
+	    }
 	BaseConstructL();
 	iWDTimer = CTestCaseWatchdog::NewL();
 	}
@@ -65,7 +78,10 @@
 
 CExampleTestCase::~CExampleTestCase()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_DCEXAMPLETESTCASE);
+	    }
 
 	delete iWDTimer;
 	Cancel();
@@ -74,7 +90,10 @@
 
 void CExampleTestCase::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EFirstStep;
 
 	//	
@@ -87,11 +106,15 @@
 void CExampleTestCase::DescribePreconditions()
 	{
 	test.Printf(_L("This is an example test, there is nothing to do beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_DESCRIBEPRECONDITIONS, "This is an example test, there is nothing to do beforehand.\n");
 	}
 	
 void CExampleTestCase::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_DOCANCEL);
+	    }
 
 	}
 
@@ -107,6 +130,7 @@
 	CExampleTestCase * p = REINTERPRET_CAST(CExampleTestCase *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	test.Printf(_L("@@@ FuncA cancel a keyboard Read() @@@\n"));
+	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_FUNCA, "@@@ FuncA cancel a keyboard Read(@@@\n"));
 
 	p->iConsole->ReadCancel();
 
@@ -117,6 +141,7 @@
 	CExampleTestCase * p = REINTERPRET_CAST(CExampleTestCase *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	test.Printf(_L("@@@ FuncB cancel a 'B' keyboard Read() @@@\n"));
+	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_FUNCB, "@@@ FuncB cancel a 'B' keyboard Read(@@@\n"));
 
 	p->Cancel();
 	p->iConsole->ReadCancel();
@@ -133,43 +158,55 @@
 // handle event completion	
 void CExampleTestCase::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_RUNSTEPL);
+	    }
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
-	RDebug::Printf("Example test iStatus compl.=%d\n", completionCode);
-	//test.Printf(_L("Example test iStatus compl.=%d\n"), completionCode);
+	OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP01, "Example test iStatus compl.=%d\n", completionCode);
 
 	switch(iCaseStep)
 		{
 		case EFirstStep:
 			iCaseStep=ESecondStep;
 			test.Printf(_L("Test step 1\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP03, "Test step 1\n");
 
 			SelfComplete();
 			break;
 		case ESecondStep:
 			iCaseStep=EThirdStep;
 			test.Printf(_L("Test step 2\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP04, "Test step 2\n");
 			test.Printf(_L("(this test step uses Keyboard)\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP05, "(this test step uses Keyboard\n"));
 			test.Printf(_L("Press ANY key once you have removed the 'A' connector...\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP06, "Press ANY key once you have removed the 'A' connector...\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &FuncA);
 			break;
 		case EThirdStep:
 			test.Printf(_L("key was a '%c'\n"), iKeyCodeInput);
+			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP07, "key was a '%c'\n", iKeyCodeInput);
 			iWDTimer->Cancel();
 			iCaseStep=EFourthStep;
 			test.Printf(_L("Test step 3\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP08, "Test step 3\n");
 			test.Printf(_L("(this test step uses Keyboard)\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP09, "(this test step uses Keyboard\n"));
 			test.Printf(_L("Press <SPACE> key once you have removed the 'A' connector...\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP10, "Press <SPACE> key once you have removed the 'A' connector...\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &FuncB);
 			
 			break;
 		case EFourthStep:
 			test.Printf(_L("key was a '%c'\n"), iKeyCodeInput);
+			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP11, "key was a '%c'\n", iKeyCodeInput);
 			test.Printf(_L("Test step 4\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP12, "Test step 4\n");
 			iWDTimer->Cancel();
 
 			iCaseStep=EFifthStep;
@@ -183,13 +220,16 @@
 		case EFifthStep:
 			iCaseStep=ESixthStep;
 			test.Printf(_L("Test step 5\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP13, "Test step 5\n");
 			test.Printf(_L("(this test uses a delay)\n"));
+			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP14, "(this test uses a delay\n"));
 			iTimer.After(iStatus, 500000);
 			SetActive();
 			break;
 		case ESixthStep:
 			iCaseStep=ELastStep;
 			test.Printf(_L("Test step 6(%d)\n"), completionCode);
+			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP15, "Test step 6(%d)\n", completionCode);
 			RequestCharacter();
 			iConsole->ReadCancel();
 			Cancel();
@@ -200,12 +240,12 @@
 		case ELastStep:
 			iCaseStep=ESecondStep;
 			test.Printf(_L("LAST step7 code (%d)\n"), completionCode);
+			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP16, "LAST step7 code (%d)\n", completionCode);
 			TestPolicy().SignalTestComplete(KErrNone);
 			return TestPassed();
 			//break;
 
 		default:
-			//test.Printf(_L("<Error> unknown test step"));
 			Cancel();
 			TestFailed(KErrCorrupt, _L("unknown test step"));
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/otgroot.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/otgroot.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -28,6 +28,10 @@
 #include <d32usbc.h>		// USBCC header
 #include "otgroot.h"
 #include "testcaseroot.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "otgrootTraces.h"
+#endif
 
 RUsbOtgDriver  oUsbOtgDriver;
 RDevUsbcClient oUsbcClient;
@@ -50,8 +54,15 @@
 TInt COtgRoot::otgLoadLdd()
 	{
 	
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGLOADLDD);
+	    }
 	LOG_VERBOSE2(_L("Load driver: %S\n"), &KOTGDeviceInterfaceDriverName);
+	if(gVerboseOutput)
+	    {
+	    OstTraceExt1(TRACE_VERBOSE, COTGROOT_OTGLOADLDD_DUP01, "Load driver: %S\n", KOTGDeviceInterfaceDriverName);
+	    }
 
 	if (!LddLoaded())
 		{
@@ -61,12 +72,17 @@
 		if ( (err != KErrNone) && (err != KErrAlreadyExists) )
 			{
 			test.Printf(_L("<Error %d> Unable to load driver: %S\n"), err, &KOTGDeviceInterfaceDriverName);
+			OstTraceExt2(TRACE_NORMAL, COTGROOT_OTGLOADLDD_DUP02, "<Error %d> Unable to load driver: %S\n", err, KOTGDeviceInterfaceDriverName);
 			SetLoaded(EFalse);
 			return(err);
 			}
 		else
 			{
 			LOG_VERBOSE2(_L("Loaded driver: '%S' OK\n"), &KOTGDeviceInterfaceDriverName);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt1(TRACE_VERBOSE, COTGROOT_OTGLOADLDD_DUP03, "Loaded driver: '%S' OK\n", KOTGDeviceInterfaceDriverName);
+			    }
 			SetLoaded(ETrue);
 			}
 		
@@ -79,19 +95,31 @@
 */
 TInt COtgRoot::otgOpen()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGOPEN);
+	    }
 	
 	LOG_VERBOSE2(_L("Opening session... loaded = %d\n"), LddLoaded());
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGOPEN_DUP01, "Opening session... loaded = %d\n", LddLoaded());
+	    }
 
 	TInt err(oUsbOtgDriver.Open());
 	if (err != KErrNone)
 		{
 		test.Printf(_L("<Error %d> Unable to open a channel to USB OTG driver\n"),err);
+		OstTrace1(TRACE_NORMAL, COTGROOT_OTGOPEN_DUP02, "<Error %d> Unable to open a channel to USB OTG driver\n",err);
 		return(err);
 		}
 	else
 		{
 		LOG_VERBOSE1(_L("Open channel OK\n"));
+		if(gVerboseOutput)
+		    {
+		    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGOPEN_DUP03, "Open channel OK\n");
+		    }
 		}
 		
 	return(KErrNone);	
@@ -102,9 +130,13 @@
 */
 void COtgRoot::otgClose()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGCLOSE);
+	    }
 	
 	test.Printf(_L("Closing session... loaded = %d\n"), LddLoaded());
+	OstTrace1(TRACE_NORMAL, COTGROOT_OTGCLOSE_DUP01, "Closing session... loaded = %d\n", LddLoaded());
 	oUsbOtgDriver.Close();
 	}
 
@@ -113,7 +145,10 @@
  */ 
 TInt COtgRoot::otgActivateOptTestMode()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGACTIVATEOPTTESTMODE);
+	    }
 
 	TInt err = oUsbOtgDriver.ActivateOptTestMode();
 
@@ -125,13 +160,16 @@
 */
 TInt COtgRoot::otgStartStacks()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGSTARTSTACKS);
+	    }
 
 	TInt err(oUsbOtgDriver.StartStacks());
 	if (err != KErrNone)
 		{
 
-		LOG_FUNCERROR(err)
+		OstTrace1(TRACE_WARNING, COTGROOT_OTGSTARTSTACKS_DUP01, "[WARNING failed %d]", err);
 
 		}
 	return(err);
@@ -143,7 +181,10 @@
 */ 
 void COtgRoot::otgStopStacks()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGSTOPSTACKS);
+	    }
 	
 	oUsbOtgDriver.StopStacks();
 	}
@@ -158,7 +199,7 @@
 	TInt err (User::FreeLogicalDevice(KOTGDeviceInterfaceDriverName));
 	if (err != KErrNone)
 		{
-		LOG_FUNCERROR(err)
+		OstTrace1(TRACE_WARNING, COTGROOT_OTGUNLOADLDD, "[WARNING failed %d]", err);
 		}
 
 	SetLoaded(EFalse);
@@ -169,8 +210,11 @@
 */
 void COtgRoot::otgQueueOtgEventRequest(RUsbOtgDriver::TOtgEvent& aEvent, TRequestStatus &aStatus)
 	{
-	//LOG_FUNC	
 	LOG_VERBOSE2(_L("Queue an Event Request %08X.\n"), (TInt)(&aStatus));
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGQUEUEOTGEVENTREQUEST_DUP01, "Queue an Event Request %08X.\n", (TInt)(&aStatus));
+	    }
 
 	oUsbOtgDriver.QueueOtgEventRequest(aEvent, aStatus);
 	
@@ -182,6 +226,10 @@
 void COtgRoot::otgCancelOtgEventRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel Event Request.\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELOTGEVENTREQUEST, "Cancel Event Request.\n");
+	    }
 	oUsbOtgDriver.CancelOtgEventRequest();
 	}
     
@@ -190,10 +238,13 @@
 */
 void COtgRoot::otgQueueOtgMessageRequest(RUsbOtgDriver::TOtgMessage& aMessage, TRequestStatus &aStatus)
 	{
-	//LOG_FUNC	
+
 	LOG_VERBOSE2(_L("Queue a Message Request %08X.\n"), (TInt)(&aStatus));
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGQUEUEOTGMESSAGEREQUEST_DUP01, "Queue a Message Request %08X.\n", (TInt)(&aStatus));
+	    }
 
-	//LOG_VERBOSE1(_L("Queue a Message Request.\n"));
 	oUsbOtgDriver.QueueOtgMessageRequest(aMessage, aStatus);
 		
 	}
@@ -204,30 +255,50 @@
 void COtgRoot::otgCancelOtgMessageRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel Message Request.\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELOTGMESSAGEREQUEST, "Cancel Message Request.\n");
+	    }
 	oUsbOtgDriver.CancelOtgMessageRequest();
 	}    
     
 void COtgRoot::otgQueuePeripheralStateRequest(TUint& aPeripheralState, TRequestStatus& aStatus)
 	{
 	LOG_VERBOSE1(_L("Queue Peripheral State Request.\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGQUEUEPERIPHERALSTATEREQUEST, "Queue Peripheral State Request.\n");
+	    }
 	oUsbcClient.AlternateDeviceStatusNotify(aStatus, aPeripheralState);
 	}
 
 void COtgRoot::otgCancelPeripheralStateRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel Peripheral State Request.\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELPERIPHERALSTATEREQUEST, "Cancel Peripheral State Request.\n");
+	    }
 	oUsbcClient.AlternateDeviceStatusNotifyCancel();	
 	}
 
 void COtgRoot::otgQueueAConnectionIdleRequest(RUsbOtgDriver::TOtgConnection& aAConnectionIdle, TRequestStatus& aStatus)
 	{
 	LOG_VERBOSE1(_L("Queue A Connection Idle Request.\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGQUEUEACONNECTIONIDLEREQUEST, "Queue A Connection Idle Request.\n");
+	    }
 	oUsbOtgDriver.QueueOtgConnectionNotification(aAConnectionIdle, aStatus);
 	}
 
 void COtgRoot::otgCancelAConnectionIdleRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel A Connection Idle Request.\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELACONNECTIONIDLEREQUEST, "Cancel A Connection Idle Request.\n");
+	    }
 	oUsbOtgDriver.CancelOtgConnectionNotification();
 	}
 
@@ -236,8 +307,11 @@
 */
 void COtgRoot::otgQueueOtgStateRequest(RUsbOtgDriver::TOtgState& aState, TRequestStatus &aStatus)
 	{
-	//LOG_FUNC	
 	LOG_VERBOSE2(_L("Queue a State Request %08X.\n"), (TInt)(&aStatus));
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGQUEUEOTGSTATEREQUEST_DUP01, "Queue a State Request %08X.\n", (TInt)(&aStatus));
+	    }
 
 	oUsbOtgDriver.QueueOtgStateRequest(aState, aStatus);
 	
@@ -249,6 +323,10 @@
 void COtgRoot::otgCancelOtgStateRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel State Request.\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELOTGSTATEREQUEST, "Cancel State Request.\n");
+	    }
 	oUsbOtgDriver.CancelOtgStateRequest();
 	}
 
@@ -258,13 +336,16 @@
 */
 TInt COtgRoot::otgBusRequest()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGBUSREQUEST);
+	    }
 	
 	TInt err(0);
 	err = oUsbOtgDriver.BusRequest();
 	if (err != KErrNone)
 		{
-		LOG_FUNCERROR(err)
+		OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSREQUEST_DUP01, "[WARNING failed %d]", err);
 		}
 	return(err);
 	}
@@ -275,12 +356,15 @@
  */
 TInt COtgRoot::otgBusRespondSRP()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGBUSRESPONDSRP);
+	    }
 	TInt err(0);
 		err = oUsbOtgDriver.BusRespondSrp();
 		if (err != KErrNone)
 			{
-			LOG_FUNCERROR(err)
+			OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSRESPONDSRP_DUP01, "[WARNING failed %d]", err);
 			}
 		return(err);
 	}
@@ -290,12 +374,15 @@
 */	
 TInt COtgRoot::otgBusDrop()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGBUSDROP);
+	    }
 	TInt err(0);
 	err = oUsbOtgDriver.BusDrop();
 	if (err != KErrNone)
 		{
-		LOG_FUNCERROR(err)
+		OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSDROP_DUP01, "[WARNING failed %d]", err);
 		}
 	return(err);
 	}
@@ -304,13 +391,16 @@
 */
 TInt COtgRoot::otgBusClearError()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGBUSCLEARERROR);
+	    }
 	
 	TInt err(0);
 	err = oUsbOtgDriver.BusClearError();
 	if (err != KErrNone)
 		{
-		LOG_FUNCERROR(err)
+		OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSCLEARERROR_DUP01, "[WARNING failed %d]", err);
 		}
 	return(err);
 	}
@@ -319,14 +409,20 @@
 	
 void COtgRoot::otgQueueOtgIdPinNotification(RUsbOtgDriver::TOtgIdPin& aPin, TRequestStatus& aStatus)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGQUEUEOTGIDPINNOTIFICATION);
+	    }
 	oUsbOtgDriver.QueueOtgIdPinNotification(aPin, aStatus);	// the kernel driver populates aPin...
 	}
 
 	
 void COtgRoot::otgCancelOtgIdPinNotification()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGCANCELOTGIDPINNOTIFICATION);
+	    }
 	oUsbOtgDriver.CancelOtgIdPinNotification();
 	}
 
@@ -335,25 +431,38 @@
                                                 TRequestStatus& aStatus
                                                )
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGQUEUEOTGVBUSNOTIFICATION);
+	    }
 	oUsbOtgDriver.QueueOtgVbusNotification(aVbus, aStatus);
 	}
 	
 	
 void COtgRoot::otgCancelOtgVbusNotification()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGCANCELOTGVBUSNOTIFICATION);
+	    }
 	oUsbOtgDriver.CancelOtgVbusNotification();
 	}
 
 
 TBool COtgRoot::otgIdPinPresent()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGIDPINPRESENT);
+	    }
 	TRequestStatus aStatus;
 	RUsbOtgDriver::TOtgIdPin aPin;
 	oUsbOtgDriver.QueueOtgIdPinNotification(aPin, aStatus);	// the kernel driver populates aPin...
 	LOG_VERBOSE2(_L("(sync) ID_PIN=%d\n"), iOTGIdPin);
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGIDPINPRESENT_DUP01, "(sync) ID_PIN=%d\n", iOTGIdPin);
+	    }
 	
 	oUsbOtgDriver.CancelOtgIdPinNotification();
 	// swallow the event
@@ -369,7 +478,10 @@
 	
 TBool COtgRoot::otgVbusPresent()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(COTGROOT_OTGVBUSPRESENT);
+	    }
 	TRequestStatus aStatus;
  	RUsbOtgDriver::TOtgVbus aVBus;
 	oUsbOtgDriver.QueueOtgVbusNotification(aVBus, aStatus);	// the kernel driver populates aPin in a kernel thread...
@@ -517,21 +629,21 @@
 	{
 	if(iFdfActorActive)
 		{
-		RDebug::Print(_L("FdfActor already exists!"));
+		OstTrace0(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR, "FdfActor already exists!");
 		return KErrAlreadyExists;
 		}
 		
 	const TUid KFdfSvrUid={0x10282B48};
 	const TUidType fdfActorUid(KNullUid, KNullUid, KFdfSvrUid);
 
-	RDebug::Print(_L("About to activate FDF Actor"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP01, "About to activate FDF Actor");
 
 //	RProcess fdfActorProcess;
 	TInt err = iFdfActorProcess.Create(_L("t_otgdi_fdfactor.exe"), KNullDesC, fdfActorUid);
 	
 	if (err != KErrNone)
 		{
-		RDebug::Print(_L("Failed to create FDF Actor, err=%d"),err);
+		OstTrace1(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP02, "Failed to create FDF Actor, err=%d",err);
 		iFdfActorProcess.Close();
 		return err;
 		}
@@ -541,7 +653,7 @@
 	
 	if (stat!=KRequestPending)
 		{
-		RDebug::Print(_L("Failed to commence rendezvous, err=%d"),stat.Int());
+		OstTrace1(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP03, "Failed to commence rendezvous, err=%d",stat.Int());
 		iFdfActorProcess.Kill(0);		// abort startup
 		iFdfActorProcess.Close();
 		return stat.Int();
@@ -556,7 +668,7 @@
 		{
 		//	Wasn't KErrNone, which means that the FDFActor didn't successfully
 		//	start up. We shouldn't proceed with the test we're in.
-		RDebug::Print(_L("Failed to activate FDF Actor, err=%d"),stat.Int());
+		OstTrace1(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP04, "Failed to activate FDF Actor, err=%d",stat.Int());
 		iFdfActorProcess.Close();
 		return stat.Int();
 		}
@@ -564,7 +676,7 @@
 	//	We rendezvoused(?) with the FDFActor OK, so it is going to suspend
 	//	any devices it sees being attached, and will shut itself down
 	//	when this process signals its Rendezvous (at the end of the test)...
-	RDebug::Print(_L("Activated FDF Actor"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP05, "Activated FDF Actor");
 	iFdfActorActive = ETrue;
 
 	return KErrNone;
@@ -574,7 +686,7 @@
 	{
 	if(!iFdfActorActive)
 		{
-		RDebug::Print(_L("FdfActor is not running!"));
+		OstTrace0(TRACE_NORMAL, COTGROOT_OTGDEACTIVATEFDFACTOR, "FdfActor is not running!");
 		return;
 		}
 
@@ -591,6 +703,7 @@
 	//	...and wait for it to go away.
 	User::WaitForRequest(waitForCloseStat);
 	test.Printf(_L("T_OTGDI confirms FDF Actor has gone away %d\n"), waitForCloseStat.Int());
+	OstTrace1(TRACE_NORMAL, COTGROOT_OTGDEACTIVATEFDFACTOR_DUP01, "T_OTGDI confirms FDF Actor has gone away %d\n", waitForCloseStat.Int());
 	
 	//	Now close our handle, and record that the process is no more...
 	iFdfActorProcess.Close();
@@ -603,17 +716,20 @@
 TBool COtgRoot::StepUnloadClient()
 	{
 	test.Printf(_L("Unload USBCC Client\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADCLIENT, "Unload USBCC Client\n");
 
 	TInt err;
 
 	// Close the Client
 
 	test.Printf(_L("..Close\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADCLIENT_DUP01, "..Close\n");
 	oUsbcClient.Close();
 
 	// Unload the LDD - note the name is *not* the same as for loading
 
 	test.Printf(_L("..Unload\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADCLIENT_DUP02, "..Unload\n");
 	err = User::FreeLogicalDevice( KUsbDeviceName );
 	if (err != KErrNone)
 		{
@@ -635,6 +751,7 @@
 								TBool aEnableSRP/*=ETrue*/)
 	{
 	test.Printf(_L("Load USBCC Client 0x%04x\n"),aPID);
+	OstTrace1(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT, "Load USBCC Client 0x%04x\n",aPID);
 
 	TInt err;
 
@@ -668,6 +785,7 @@
 	// Load the LDD - note the name is *not* the same as for unload
 
 	test.Printf(_L("..Load LDD\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP01, "..Load LDD\n");
 	err = User::LoadLogicalDevice( KUsbcLddFileName );
 	if ((err != KErrNone) && (err !=KErrAlreadyExists))
 		{
@@ -678,6 +796,7 @@
 	// Open the Client
 
 	test.Printf(_L("..Open LDD\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP02, "..Open LDD\n");
 	err = oUsbcClient.Open(0);
 	if (err != KErrNone)
 		{
@@ -688,6 +807,7 @@
 	// Set up descriptors
 	
 	test.Printf(_L("..Setup Descriptors\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP03, "..Setup Descriptors\n");
 
 	// the OTG descriptor
 	TBuf8<KUsbDescSize_Otg> theOtgDescriptor;
@@ -709,6 +829,7 @@
 		aByte |= (aEnableSRP? 1 : 0); 
 		aByte |= (aEnableHNP? 2 : 0); 
 	test.Printf(_L("..Change OTG 0x%02X->0x%02X\n"), theOtgDescriptor[2], aByte);
+	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP04, "..Change OTG 0x%02X->0x%02X\n", (TUint32)theOtgDescriptor[2], (TUint32)aByte);
 	theOtgDescriptor[2] = aByte;
 	
 	err = oUsbcClient.SetOtgDescriptor(theOtgDescriptor);
@@ -734,6 +855,7 @@
 
 	softwareConnect = d_caps().iConnect;
 	test.Printf(_L("..SoftwareConnect = %d\n"),softwareConnect);
+	OstTrace1(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP05, "..SoftwareConnect = %d\n",softwareConnect);
 
 	if (n < 2)
 		{
@@ -829,6 +951,7 @@
 	theDeviceDescriptor[11] = ( aPID & 0xFF00 ) >> 8;
 
 	test.Printf(_L("..Change PID 0x%04X->0x%04X\n"), oldPID, aPID);
+	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP06, "..Change PID 0x%04X->0x%04X\n", (TUint32)oldPID, (TUint32)aPID);
 
 	err = oUsbcClient.SetDeviceDescriptor(theDeviceDescriptor);
 	if (err != KErrNone)
@@ -841,6 +964,7 @@
 	// Power Up UDC - KErrNotReady is expected
 
 	test.Printf(_L("..Power Up UDC\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP07, "..Power Up UDC\n");
 
 	err = oUsbcClient.PowerUpUdc();
 	if( err != KErrNotReady )
@@ -852,6 +976,7 @@
 	// Connect to Host
 
 	test.Printf(_L("..Connect to Host\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP08, "..Connect to Host\n");
 
 	err = oUsbcClient.DeviceConnectToHost();
 	if( err != KErrNone )
@@ -872,6 +997,7 @@
 TBool COtgRoot::StepDisconnect()
 	{
 	test.Printf(_L("Disconnect from Host\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPDISCONNECT, "Disconnect from Host\n");
 
 	TInt err;
 	
@@ -890,6 +1016,7 @@
 TBool COtgRoot::StepConnect()
 	{
 	test.Printf(_L("Connect to Host\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPCONNECT, "Connect to Host\n");
 
 	TInt err;
 	
@@ -914,6 +1041,7 @@
 
 	{
 	test.Printf(_L("Load USBCC HS Test Client 0x%04x/0x%04x\n"),aVID,aPID);
+	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID, "Load USBCC HS Test Client 0x%04x/0x%04x\n",(TUint32)aVID,(TUint32)aPID);
 
 	TInt err;
 
@@ -934,6 +1062,7 @@
 	theDeviceDescriptor[9] = ( aVID & 0xFF00 ) >> 8;
 
 	test.Printf(_L("..Change VID 0x%04X->0x%04X\n"), oldVID, aVID);
+	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID_DUP01, "..Change VID 0x%04X->0x%04X\n", (TUint32)oldVID, (TUint32)aVID);
 
 	TUint16 oldPID = ( theDeviceDescriptor[10] )
 		           + ( theDeviceDescriptor[11] << 8 );
@@ -942,6 +1071,7 @@
 	theDeviceDescriptor[11] = ( aPID & 0xFF00 ) >> 8;
 
 	test.Printf(_L("..Change PID 0x%04X->0x%04X\n"), oldPID, aPID);
+	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID_DUP02, "..Change PID 0x%04X->0x%04X\n", (TUint32)oldPID, (TUint32)aPID);
 
 	err = oUsbcClient.SetDeviceDescriptor(theDeviceDescriptor);
 	if (err != KErrNone)
@@ -972,12 +1102,21 @@
 TBool COtgRoot::StepUnloadLDD()
 	{ 
 	test.Printf(_L("Unload otg LDD (implicit Stop() + Close()) \n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADLDD, "Unload otg LDD (implicit Stop(+ Close()) \n");
 	
 	LOG_VERBOSE1(_L("  Stop OTG+Host Stack\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPUNLOADLDD_DUP01, "  Stop OTG+Host Stack\n");
+	    }
 	otgStopStacks();
 	otgClose();
 	
 	LOG_VERBOSE1(_L("  Unload\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPUNLOADLDD_DUP02, "  Unload\n");
+	    }
 	otgUnloadLdd();
 	
 	iOptActive = EFalse; // retain the OTGDI behavour to clears this flag when client shuts 
@@ -994,6 +1133,10 @@
 	TInt err;	
 
 	LOG_VERBOSE1(_L("Load otg LDD\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPLOADLDD, "Load otg LDD\n");
+	    }
 	err = otgLoadLdd();
 	if (err != KErrNone)
 		{
@@ -1002,6 +1145,10 @@
 		}
 		
 	LOG_VERBOSE1(_L("Open the LDD session\n"));
+	if(gVerboseOutput)
+	    {
+	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPLOADLDD_DUP01, "Open the LDD session\n");
+	    }
 	err = otgOpen();
 	if (err != KErrNone)
 		{
@@ -1012,6 +1159,7 @@
 	if ( iOptActive )
 		{
 		test.Printf(_L("Activate OPT Test Mode\n"));
+		OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADLDD_DUP02, "Activate OPT Test Mode\n");
 		err = otgActivateOptTestMode();
 		if (err != KErrNone)
 			{
@@ -1021,6 +1169,7 @@
 		}
 
 	test.Printf(_L("Start OTG+Host Stack\n"));
+	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADLDD_DUP03, "Start OTG+Host Stack\n");
 	err = otgStartStacks();
 	if (err != KErrNone)
 		{
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -30,6 +30,10 @@
 #include "testengine.h"
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_otgdiTraces.h"
+#endif
 
 
 
@@ -102,44 +106,38 @@
 		if ( (err != KErrNone) && (err != KErrAlreadyExists) )
 			{
 			test.Printf(_L("<Error %d> Unable to load driver: %S"), err, &KOTGDeviceInterfaceDriverName);
+			OstTraceExt2(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE, "<Error %d> Unable to load driver: %S", err, KOTGDeviceInterfaceDriverName);
 			}
 		err = oUsbOtgDriver.Open();
 		if (err != KErrNone)
+		    {
 			test.Printf(_L("<Error %d> Unable to OPEN driver: %S"), err, &KOTGDeviceInterfaceDriverName);
-		else	
+			OstTraceExt2(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP01, "<Error %d> Unable to OPEN driver: %S", err, KOTGDeviceInterfaceDriverName);
+			}
+		else
+			{	
 			test.Printf(_L("OPEN driver: %S OK!"), &KOTGDeviceInterfaceDriverName);
+			OstTraceExt1(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP02, "OPEN driver: %S OK!", KOTGDeviceInterfaceDriverName);
+			}
 		
 		oUsbOtgDriver.StartStacks();
 		test.Printf(_L("Stack started\n"));
+		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP03, "Stack started\n");
 		
-/*
-		for (TInt loop=0; loop <6; loop++)
-			// TEST Events
-			do		
-				{
-				test.Printf(_L("Waiting for OTG...\n"));
-				status1 = KRequestPending; // reset the status object
-				oUsbOtgDriver.QueueOtgEventRequest( event, status1 );
-				
-				// wait			
-				User::WaitForRequest(status1);
-				TInt completionCode(status1.Int());
-				CTestCaseRoot::OtgEventString(event, aDescription);
-				test.Printf(_L("Received event %d '%S' status(%d) \n"), event, &aDescription, completionCode);
-				}
-			while (event != RUsbOtgDriver::EEventAPlugInserted); // 'A' plug found
 
-*/
 		test.Printf(_L("API QueueOtgIdPinNotification test:\n"));
+		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP06, "API QueueOtgIdPinNotification test:\n");
 
 		for (TInt loop=0; loop <6; loop++)
 			// TEST Events
 			do		
 				{
 				test.Printf(_L("Waiting for OTG...\n"));
+				OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP07, "Waiting for OTG...\n");
 				status1 = KRequestPending; // reset the status object
 				oUsbOtgDriver.QueueOtgIdPinNotification( OTGIdPin, status1 );
 				test.Printf(_L("Current pin %d  \n"), OTGIdPin);
+				OstTrace1(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP08, "Current pin %d  \n", OTGIdPin);
 				
 				// wait			
 				User::WaitForRequest(status1);
@@ -157,28 +155,35 @@
 						break;
 					}
 				test.Printf(_L("Received pin %d '%S' status(%d) \n"), OTGIdPin, &aDescription, completionCode);
+				OstTraceExt3(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP09, "Received pin %d '%S' status(%d) \n", OTGIdPin, aDescription, completionCode);
 				}
 			while (OTGIdPin != RUsbOtgDriver::EIdPinAPlug); // 'A' plug found
 
 		test.Printf(_L("Press any key.\n"));
+		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP10, "Press any key.\n");
 		test.Getch();
 
 		test.Printf(_L("Shutting down stack.\n"));
+		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP11, "Shutting down stack.\n");
 		oUsbOtgDriver.StopStacks();
 
 		oUsbOtgDriver.Close();
 
 		test.Printf(_L("Free the LDD.\n"));
+		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP12, "Free the LDD.\n");
 		err = User::FreeLogicalDevice( RUsbOtgDriver::Name() );			
 		if (err != KErrNone)
 			{
 			test.Printf(_L("<Error %d> Unable to UN-load driver: %S"), err, &KOTGDeviceInterfaceDriverName);
+			OstTraceExt2(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP13, "<Error %d> Unable to UN-load driver: %S", err, KOTGDeviceInterfaceDriverName);
 			}		
 		test.Printf(_L("#############\nPress any key.\n"));
+		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP14, "#############\nPress any key.\n");
 		}
 		test.Getch();
 
 		test.Printf(_L("Free the LDD.\n"));
+		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP15, "Free the LDD.\n");
 		// end this process, if we do not want to run a test now as well
 		RProcess process;
 		process.Open(RProcess().Id());
@@ -190,7 +195,10 @@
 
 static void MainL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(MAINL_MAINL);
+	    }
 	// Leave the hooks in for platform security
 #ifdef __DATA_CAGING__
 	RProcess().DataCaging(RProcess::EDataCagingOn);
@@ -246,9 +254,15 @@
 	else
 		{
 		if (-2 == err)
+		    {
 			test.Printf(_L("Warning, no tests were selected!: %d\n"), err);
+			OstTrace1(TRACE_NORMAL, MAINL_MAINL_DUP01, "Warning, no tests were selected!: %d\n", err);
+			}
 		else
+		    {
 			test.Printf(_L("Unable to create the test engine: %d\n"), err);
+			OstTrace1(TRACE_NORMAL, MAINL_MAINL_DUP02, "Unable to create the test engine: %d\n", err);
+			}
 		}
 
 	// test DONE, if we are running manual, have a delay
@@ -256,18 +270,21 @@
 		{
 		// Get the engine to hang around so we can look at the screen output
 		test.Printf(KPressAnyKeyToEnd);
+		OstTrace0(TRACE_NORMAL, MAINL_MAINL_DUP03, KPressAnyKeyToEnd);
 		test.Getch();
 		}
 
 	__UHEAP_MARKEND;
 #ifdef _DEBUG
 	test.Printf(_L("Test heap leaks #1 OK\n"));
+	OstTrace0(TRACE_NORMAL, MAINL_MAINL_DUP04, "Test heap leaks #1 OK\n");
 #endif
 
 	CleanupStack::PopAndDestroy(sched);
 	__UHEAP_MARKEND;
 #ifdef _DEBUG
 	test.Printf(_L("Test heap leaks #2 OK\n"));
+	OstTrace0(TRACE_NORMAL, MAINL_MAINL_DUP05, "Test heap leaks #2 OK\n");
 #endif
 	
 	// Finish test and release resources - this ends up closing the console (our application window)
@@ -279,7 +296,10 @@
 
 TInt E32Main()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(E32MAIN_E32MAIN);
+	    }
 	// Create the new trap-cleanup mechanism
 	CTrapCleanup* cleanup = CTrapCleanup::New();
 	
@@ -293,6 +313,7 @@
 	if (err != KErrNone)
 		{
 		test.Printf(_L("MainL error: %d\n"),err);		
+		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "MainL error: %d\n",err);		
 		}
 	
 	delete cleanup;
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -19,6 +19,10 @@
 */
 
 #include "t_otgdi_fdfactor.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_otgdi_fdfactorTraces.h"
+#endif
 #include <Usb.h>
 
 #define LOG_FUNC
@@ -48,7 +52,7 @@
 	TInt err(iDriver.Open());
 	if (err != KErrNone)
 		{
-		RDebug::Print(_L("<Error %d> Unable to open driver channel"),err);
+		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL, "<Error %d> Unable to open driver channel",err);
 		User::Leave(err);
 		}		
 	
@@ -56,7 +60,7 @@
 	if (err != KErrNone)
 		{
 		// Test case did not run successfully
-		RDebug::Print(_L("<Error %d> USB Host stack not starting"),err);		
+		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP01, "<Error %d> USB Host stack not starting",err);		
 		}
 	}
 
@@ -92,7 +96,7 @@
 void CActorFDF::Monitor()
 	{
 	LOG_FUNC
-	RDebug::Print(_L("Monitoring Bus Events"));
+	OstTrace0(TRACE_NORMAL, CACTORFDF_MONITOR, "Monitoring Bus Events");
 	iDriver.WaitForBusEvent(iBusEvent,iStatus);
 	SetActive();
 	}
@@ -110,14 +114,14 @@
 
 	// Obtain completion code
 	TInt completionCode(iStatus.Int());
-	RDebug::Print(_L("Completion code  : %d"),completionCode);
+	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL, "Completion code  : %d",completionCode);
 	
 	 if (completionCode == KErrNone)
 		{
 		if (iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceAttached)
 			{
 			// Device Attached
-			RDebug::Print(_L("Usb device attached: %d"),iBusEvent.iDeviceHandle);
+			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP01, "Usb device attached: %d",iBusEvent.iDeviceHandle);
 			
 			// Create the test device object
 			iDevices.InsertL(iBusEvent.iDeviceHandle,CUsbTestDevice::NewL(iDriver,iBusEvent.iDeviceHandle,iObserver));
@@ -129,23 +133,23 @@
 			CUsbTestDevice* newDevice = iDevices.FindL(iBusEvent.iDeviceHandle);
 			if(newDevice)
 				{
-				RDebug::Print(_L("Suspending device %d"),iBusEvent.iDeviceHandle);
+				OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP02, "Suspending device %d",iBusEvent.iDeviceHandle);
 				TInt err = newDevice->Suspend();
 				if(err)
 					{
-					RDebug::Print(_L("Suspending device %d returned error %d"), iBusEvent.iDeviceHandle, err);
+					OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP03, "Suspending device %d returned error %d", (TInt)iBusEvent.iDeviceHandle, err);
 					}
 				}
 			else
 				{
-				RDebug::Print(_L("Can't find newly attached device %d"),iBusEvent.iDeviceHandle);
+				OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP04, "Can't find newly attached device %d",iBusEvent.iDeviceHandle);
 				}
 
 			}
 		else if (iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceRemoved)
 			{
 			// Device Removed
-			RDebug::Print(_L("Usb device removed: %d"),iBusEvent.iDeviceHandle);
+			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP05, "Usb device removed: %d",iBusEvent.iDeviceHandle);
 			
 			// Notify observer
 			iObserver.DeviceRemovedL(iBusEvent.iDeviceHandle);
@@ -156,12 +160,12 @@
 			}
 		else
 			{
-			RDebug::Print(_L("<Warning> Bus event %d occured, still monitoring, reason = %d"),iBusEvent.iEventType, iBusEvent.iReason);
+			OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP06, "<Warning> Bus event %d occured, still monitoring, reason = %d",iBusEvent.iEventType, iBusEvent.iReason);
 			}
 		}
 	else
 		{
-		RDebug::Print(_L("<Error %d> Bus event %d"),completionCode,iBusEvent.iEventType);
+		OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP07, "<Error %d> Bus event %d",completionCode,iBusEvent.iEventType);
 		iObserver.BusErrorL(completionCode);
 		}
 	Monitor();	//	Requeue for notification of further bus events
@@ -171,7 +175,7 @@
 TInt CActorFDF::RunError(TInt aError)
 	{
 	LOG_FUNC
-	RDebug::Print(_L("<Error %d> CActorFDF::RunError"),aError);
+	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNERROR, "<Error %d> CActorFDF::RunError",aError);
 	return KErrNone;
 	}
 	
@@ -222,14 +226,14 @@
 	TInt err(iDevice.GetDeviceDescriptor(iDeviceDescriptor));
 	if (err != KErrNone)
 		{
-		RDebug::Print(_L("<Error %d> Getting device (%d) descriptor"),err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL, "<Error %d> Getting device (%d) descriptor",err,(TInt)iHandle);
 		User::Leave(err);
 		}
 	
 	err = iDevice.GetConfigurationDescriptor(iConfigDescriptor);
 	if (err != KErrNone)
 		{
-		RDebug::Print(_L("<Error %d> Getting device (%d) configuration descriptor"),err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP01, "<Error %d> Getting device (%d) configuration descriptor",err,(TInt)iHandle);
 		User::Leave(err);
 		}
 
@@ -237,10 +241,10 @@
 	iPid = iDeviceDescriptor.ProductId();
 	iVid = iDeviceDescriptor.VendorId();
 	
-	RDebug::Print(_L("%dmA configuration maximum power consumption"),iConfigDescriptor.MaxPower()*2);
-	RDebug::Print(_L("%d number of interface(s)"),iConfigDescriptor.NumInterfaces());
-	RDebug::Print(_L("Vendor Id=0x%04x, Product Id=0x%04x"),iVid,iPid);
-	RDebug::Print(_L("TotalLength() = %d"),iConfigDescriptor.TotalLength());
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP02, "%dmA configuration maximum power consumption",iConfigDescriptor.MaxPower()*2);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP03, "%d number of interface(s)",iConfigDescriptor.NumInterfaces());
+	OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP04, "Vendor Id=0x%04x, Product Id=0x%04x",iVid,iPid);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP05, "TotalLength() = %d",iConfigDescriptor.TotalLength());
 
 	// Get changes in device state
 	iDevice.QueueDeviceStateChangeNotification(iCurrentState,iStatus); // iCurrentState now holds the current device state
@@ -297,7 +301,7 @@
 	
 	if ( completionCode != KErrCancel )
 		{
-		RDebug::Print(_L("CUsbTestDevice::RunL completionCode(%d)"),completionCode);
+		OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNL, "CUsbTestDevice::RunL completionCode(%d)",completionCode);
 		}
 	
 	if(completionCode == KErrNone)
@@ -315,7 +319,7 @@
 	{
 	LOG_FUNC
 
-	RDebug::Print(_L("<Error %d>"),aError);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNERROR, "<Error %d>",aError);
 	return KErrNone;
 	}
 
@@ -333,7 +337,7 @@
 	TInt err=iTotgdiProcess.RendezvousCancel(iStatus);
 	if(err)
 		{
-		RDebug::Print(_L("Cancelling Rendezvous completed with %d"),err);
+		OstTrace1(TRACE_NORMAL, CFDFTOTGDIWATCHER_DOCANCEL, "Cancelling Rendezvous completed with %d",err);
 		}
 	}
 	
@@ -341,7 +345,7 @@
 	{
 	//	The t_otgdi process has signalled its rendezvous
 	//	Time to stop the active scheduler, tidy up and go away
-	RDebug::Print(_L("Rendezvous signalled from t_otgdi"));
+	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_RUNL, "Rendezvous signalled from t_otgdi");
 	CActiveScheduler::Stop();
 	}
 	
@@ -359,7 +363,7 @@
 	
 	if(err)
 		{
-		RDebug::Print(_L("Couldn't open process handle to t_otgdi.exe"));
+		OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_CONSTRUCTL, "Couldn't open process handle to t_otgdi.exe");
 		}
 	User::LeaveIfError(err);
 
@@ -370,13 +374,13 @@
 	
 TInt CFdfTOtgdiWatcher::FindTOtgdiProcessName(TFullName& aProcessName)
 	{
-	RDebug::Print(_L("Into FindTOtgdiProcessName"));
+	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME, "Into FindTOtgdiProcessName");
 	TInt successCode = KErrNotFound;
 	TFindProcess fp;
 	fp.Find(_L("t_otgdi.exe*"));	//	Process name match pattern
 	while(fp.Next(aProcessName)==KErrNone)
 		{
-		RDebug::Print(_L("FDFActor Found process %S"),&aProcessName);
+		OstTraceExt1(TRACE_NORMAL, CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME_DUP01, "FDFActor Found process %S",aProcessName);
 		successCode = KErrNone;
 		}
 	return successCode;
@@ -389,9 +393,9 @@
 	
 CFdfTOtgdiWatcher::~CFdfTOtgdiWatcher()
 	{
-	RDebug::Print(_L("About to call CFdfTOtgdiWatcher::Cancel"));
+	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER, "About to call CFdfTOtgdiWatcher::Cancel");
 	Cancel();
-	RDebug::Print(_L("About to call iTotgdiProcess.Close"));
+	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER_DUP01, "About to call iTotgdiProcess.Close");
 	iTotgdiProcess.Close();
 	}
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor_main.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor_main.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -24,6 +24,10 @@
 #include <e32std_private.h>
 
 #include "t_otgdi_fdfactor.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_otgdi_fdfactor_mainTraces.h"
+#endif
 
 LOCAL_C void DoStartL()
 	{
@@ -31,7 +35,7 @@
 	TInt err = User::LoadLogicalDevice(KDriverLddFileName);
 	if(err)
 		{
-		RDebug::Print(_L("FDFActor failed to load LDD %d"),err);
+		OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL, "FDFActor failed to load LDD %d",err);
 		}
 
 	// Create active scheduler (to run active objects)
@@ -63,7 +67,7 @@
 	err = User::FreeLogicalDevice(RUsbHubDriver::Name());
 	if(err)
 		{
-		RDebug::Print(_L("FDFActor failed to unload LDD %d"),err);
+		OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL_DUP01, "FDFActor failed to unload LDD %d",err);
 		}	
 	}
 
@@ -81,7 +85,7 @@
 
 	if (mainError)
 		{
-		RDebug::Print(_L("FDF Actor left with %d"), mainError);
+		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN, "FDF Actor left with %d", mainError);
 		//	Also means that we left before we did a Rendezvous(KErrNone) to free up t_otgdi.exe
 		//	Rendezvous with KErrAbort to indicate we couldn't start up properly.
 		RProcess::Rendezvous(KErrAbort);
@@ -90,7 +94,7 @@
 	delete cleanup;
 	__UHEAP_MARKEND;
 
-	RDebug::Print(_L("About to end FDFActor process"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "About to end FDFActor process");
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_uid.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_uid.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0456.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0456.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,6 +26,10 @@
 #include "testcaseroot.h"
 #include "testcasefactory.h"
 #include "testcase0456.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0456Traces.h"
+#endif
 
 
 
@@ -38,7 +42,10 @@
 
 CTestCase0456* CTestCase0456::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0456_NEWL);
+	    }
 	CTestCase0456* self = new (ELeave) CTestCase0456(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -50,7 +57,10 @@
 CTestCase0456::CTestCase0456(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{	
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0456_CTESTCASE0456);
+	    }
 	} 
 
 
@@ -59,7 +69,10 @@
 */
 void CTestCase0456::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0456_CONSTRUCTL);
+	    }
 	iRepeats = OPEN_REPEATS;
 	
 	BaseConstructL();
@@ -68,7 +81,10 @@
 
 CTestCase0456::~CTestCase0456()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0456_DCTESTCASE0456);
+	    }
 
 	Cancel();
 	}
@@ -76,7 +92,10 @@
 
 void CTestCase0456::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0456_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -87,12 +106,16 @@
 void CTestCase0456::DescribePreconditions()
 	{
 	test.Printf(_L("Insert A connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0456_DESCRIBEPRECONDITIONS, "Insert A connector beforehand.\n");
 	}
 
 	
 void CTestCase0456::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0456_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -102,7 +125,10 @@
 // handle event completion	
 void CTestCase0456::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0456_RUNSTEPL);
+	    }
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -112,6 +138,7 @@
 		case EPreconditions:
 			{
 			test.Printf(KPressAnyKeyToStart);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP01, KPressAnyKeyToStart);
 			iCaseStep = ELoadLdd;
 			RequestCharacter();			
 			break;			
@@ -120,6 +147,7 @@
 		
 		case ELoadLdd:
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP02, "Load the LDD iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			if (!StepLoadLDD())
 				{
 				break;
@@ -138,6 +166,7 @@
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP03, "Repeat test\n");
 
 			if (--iRepeats)
 				iCaseStep = ELoadLdd;
@@ -154,6 +183,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP04, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0457.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0457.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0457.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0457Traces.h"
+#endif
 
 
 
@@ -37,7 +41,10 @@
 
 CTestCase0457* CTestCase0457::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0457_NEWL);
+	    }
 	CTestCase0457* self = new (ELeave) CTestCase0457(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -49,7 +56,10 @@
 CTestCase0457::CTestCase0457(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{	
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0457_CTESTCASE0457);
+	    }
 	} 
 
 
@@ -58,7 +68,10 @@
 */
 void CTestCase0457::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0457_CONSTRUCTL);
+	    }
 	iRepeats = OPEN_REPEATS;
 	
 	BaseConstructL();
@@ -67,7 +80,10 @@
 
 CTestCase0457::~CTestCase0457()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0457_DCTESTCASE0457);
+	    }
 
 	Cancel();
 	}
@@ -75,7 +91,10 @@
 
 void CTestCase0457::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0457_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -86,12 +105,16 @@
 void CTestCase0457::DescribePreconditions()
 	{
 	test.Printf(_L("Remove any USB plug beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0457_DESCRIBEPRECONDITIONS, "Remove any USB plug beforehand.\n");
 	}
 
 	
 void CTestCase0457::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0457_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -101,7 +124,10 @@
 // handle event completion	
 void CTestCase0457::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0457_RUNSTEPL);
+	    }
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -111,6 +137,7 @@
 		case EPreconditions:
 			{
 			test.Printf(KPressAnyKeyToStart);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP01, KPressAnyKeyToStart);
 			iCaseStep = ELoadLdd;
 			RequestCharacter();			
 			break;			
@@ -118,6 +145,7 @@
 
 		case ELoadLdd:
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP02, "Load the LDD iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			if (!StepLoadLDD())
 				{
 				break;
@@ -136,6 +164,7 @@
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP03, "Repeat test\n");
 
 			if (--iRepeats)
 				iCaseStep = ELoadLdd;
@@ -152,6 +181,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP04, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0458.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0458.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0458.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0458Traces.h"
+#endif
 
 
 
@@ -55,7 +59,10 @@
 */
 void CTestCase0458::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0458_CONSTRUCTL);
+	    }
 	iRepeats = OPEN_REPEATS;
 	
 	BaseConstructL();
@@ -64,7 +71,10 @@
 
 CTestCase0458::~CTestCase0458()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0458_DCTESTCASE0458);
+	    }
 
 	Cancel();
 	}
@@ -72,7 +82,10 @@
 
 void CTestCase0458::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0458_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -83,13 +96,18 @@
 void CTestCase0458::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'B' connector from cable\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0458_DESCRIBEPRECONDITIONS, "Insert 'B' connector from cable\n");
 	test.Printf(_L("attached to powered host beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0458_DESCRIBEPRECONDITIONS_DUP01, "attached to powered host beforehand.\n");
 	}
 
 	
 void CTestCase0458::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0458_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -99,7 +117,10 @@
 // handle event completion	
 void CTestCase0458::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0458_RUNSTEPL);
+	    }
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -109,6 +130,7 @@
 		case EPreconditions:
 			{
 			test.Printf(KPressAnyKeyToStart);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP01, KPressAnyKeyToStart);
 			iCaseStep = ELoadLdd;
 			RequestCharacter();			
 			break;			
@@ -116,6 +138,7 @@
 
 		case ELoadLdd:
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP02, "Load the LDD iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			if (!StepLoadLDD())
 				{
 				break;
@@ -134,6 +157,7 @@
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP03, "Repeat test\n");
 
 			if (--iRepeats)
 				{
@@ -154,6 +178,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP04, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0459.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0459.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,6 +25,10 @@
 #include "testcaseroot.h"
 #include "testcasefactory.h"
 #include "testcase0459.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0459Traces.h"
+#endif
 
 
 
@@ -35,7 +39,10 @@
 
 CTestCase0459* CTestCase0459::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0459_NEWL);
+	    }
 	CTestCase0459* self = new (ELeave) CTestCase0459(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -47,7 +54,10 @@
 CTestCase0459::CTestCase0459(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0459_CTESTCASE0459);
+	    }
 		
 	} 
 
@@ -57,7 +67,10 @@
 */
 void CTestCase0459::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0459_CONSTRUCTL);
+	    }
 	
 	BaseConstructL();
 	}
@@ -65,7 +78,10 @@
 
 CTestCase0459::~CTestCase0459()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0459_DCTESTCASE0459);
+	    }
 
 	Cancel();
 	}
@@ -73,7 +89,10 @@
 
 void CTestCase0459::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0459_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -85,12 +104,16 @@
 void CTestCase0459::DescribePreconditions()
 	{
 	test.Printf(_L("Remove 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0459_DESCRIBEPRECONDITIONS, "Remove 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0459::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0459_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -100,7 +123,10 @@
 // handle event completion	
 void CTestCase0459::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0459_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -117,7 +143,9 @@
 				}
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP01, KRemoveAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -140,8 +168,10 @@
 				}
 
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 			iCaseStep = ETestStateA;
 			test.Printf(_L("Waiting for OTG Event\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP04, "Waiting for OTG Event\n");
 
 			otgQueueOtgEventRequest( iOTGEvent, iStatus);
 
@@ -166,6 +196,7 @@
 			TTimeIntervalMicroSeconds ivlMicro(iIDcheckEnd.MicroSecondsFrom(iIDcheckStart));
 			aMillisec = (TInt)(ivlMicro.Int64())/1000;	// USB times are in uSec, but in ms for the user layer
 			test.Printf(_L("Received event %d '%S' status(%d) in %d ms"), iOTGEvent, &aDescription, completionCode, aMillisec);
+			OstTraceExt4(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP05, "Received event %d '%S' status(%d) in %d ms", iOTGEvent, aDescription, completionCode, aMillisec);
 			
 			// check the parameters gathered
 			if (RUsbOtgDriver::EEventAPlugInserted == iOTGEvent)
@@ -176,6 +207,7 @@
 					{
 					// 'A' was in the receptacle when we started the stack, so it fires immediately, consume it and wait for another.
 					test.Printf(_L("Please first remove and then replace the A connector.\n"));
+					OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP06, "Please first remove and then replace the A connector.\n");
 					// wrong event in the Q already, keep at it
 					iCaseStep = ERegisterForEvents;	
 					}
@@ -199,6 +231,7 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP07, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0460.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0460.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,6 +25,10 @@
 #include "testcaseroot.h"
 #include "testcasefactory.h"
 #include "testcase0460.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0460Traces.h"
+#endif
 
 
 
@@ -36,7 +40,10 @@
 
 CTestCase0460* CTestCase0460::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0460_NEWL);
+	    }
 	CTestCase0460* self = new (ELeave) CTestCase0460(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -48,7 +55,10 @@
 CTestCase0460::CTestCase0460(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0460_CTESTCASE0460);
+	    }
 		
 	} 
 
@@ -58,7 +68,10 @@
 */
 void CTestCase0460::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0460_CONSTRUCTL);
+	    }
 	
 	BaseConstructL();
 	}
@@ -66,7 +79,10 @@
 
 CTestCase0460::~CTestCase0460()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0460_DCTESTCASE0460);
+	    }
 
 	Cancel();
 	}
@@ -74,7 +90,10 @@
 
 void CTestCase0460::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0460_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -86,12 +105,16 @@
 void CTestCase0460::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0460_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0460::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0460_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -101,7 +124,10 @@
 // handle event completion	
 void CTestCase0460::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0460_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -118,7 +144,9 @@
 				}
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP01, KRemoveAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -133,7 +161,9 @@
 
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			// wait on ID_PIN
@@ -145,6 +175,7 @@
 			iCaseStep = ETestStateA;
 
 			test.Printf(_L("Waiting for OTG Event\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP05, "Waiting for OTG Event\n");
 			otgQueueOtgEventRequest( iOTGEvent, iStatus);
 
 			SetActive();
@@ -160,6 +191,7 @@
 		case ETestStateA:
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)"), iOTGEvent, &aDescription, completionCode);
+			OstTraceExt3(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP06, "Received event %d '%S' status(%d)", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventAPlugInserted == iOTGEvent)
 				{
 				iCaseStep = EUnloadLdd;
@@ -183,6 +215,7 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP07, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0461.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0461.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,6 +25,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0461.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0461Traces.h"
+#endif
 
 
 
@@ -35,7 +39,10 @@
 
 CTestCase0461* CTestCase0461::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0461_NEWL);
+	    }
 	CTestCase0461* self = new (ELeave) CTestCase0461(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -47,7 +54,10 @@
 CTestCase0461::CTestCase0461(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0461_CTESTCASE0461);
+	    }
 		
 	} 
 
@@ -57,7 +67,10 @@
 */
 void CTestCase0461::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0461_CONSTRUCTL);
+	    }
 	iRepeats = KOperationRetriesMax;
 	BaseConstructL();
 	
@@ -67,7 +80,10 @@
 
 CTestCase0461::~CTestCase0461()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0461_DCTESTCASE0461);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -76,7 +92,10 @@
 
 void CTestCase0461::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0461_EXECUTETESTCASEL);
+	    }
 	iCaseStep = ELoadLdd;
 	
 	CActiveScheduler::Add(this);
@@ -88,12 +107,16 @@
 void CTestCase0461::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0461_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0461::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0461_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -111,7 +134,10 @@
 // handle event completion	
 void CTestCase0461::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0461_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -128,7 +154,9 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -147,6 +175,7 @@
 		case ERegisterForEvents:
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);		
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP03, KRemoveAConnectorPrompt);		
 			if (iDequeAttempts > 3)
 				{
 				return (TestFailed(KErrCorrupt, _L("<Error> too many irrelevant/incorrect events")));
@@ -179,6 +208,7 @@
 		case EGetAndCancelEvent: //4.
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)"), iOTGEvent, &aDescription, completionCode);
+			OstTraceExt3(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP04, "Received event %d '%S' status(%d)", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventAPlugRemoved == iOTGEvent)
 				{
 				otgQueueOtgEventRequest( iOTGEvent, iStatus);
@@ -212,8 +242,10 @@
 			iWDTimer->Cancel();
 			iConsole->ReadCancel();
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP05, KInsertAConnectorPrompt);
 			iCaseStep = ERemoveA;
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP06, KPressAnyKeyToContinue);
 			
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &CancelKB);			
@@ -226,6 +258,7 @@
 			iWDTimer->Cancel();
 			iConsole->ReadCancel();
 			test.Printf(KRemoveAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP07, KRemoveAConnectorPrompt);
 			if (iRepeats-- >0)
 				{
 				// Do it again please
@@ -236,6 +269,7 @@
 				iCaseStep = ETallyEvents;
 				}
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP08, KPressAnyKeyToContinue);
 
 			RequestCharacter();			
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &CancelKB);			
@@ -274,6 +308,7 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP09, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0462.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0462.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0462.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0462Traces.h"
+#endif
 
 
 
@@ -34,7 +38,10 @@
 
 CTestCase0462* CTestCase0462::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0462_NEWL);
+	    }
 	CTestCase0462* self = new (ELeave) CTestCase0462(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -46,7 +53,10 @@
 CTestCase0462::CTestCase0462(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0462_CTESTCASE0462);
+	    }
 		
 	} 
 
@@ -56,7 +66,10 @@
 */
 void CTestCase0462::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0462_CONSTRUCTL);
+	    }
 	iRepeats = KOperationRetriesMax;
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
@@ -66,7 +79,10 @@
 
 CTestCase0462::~CTestCase0462()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0462_DCTESTCASE0462);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -75,7 +91,10 @@
 
 void CTestCase0462::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0462_EXECUTETESTCASEL);
+	    }
 	iCaseStep = ELoadLdd;
 	
 	CActiveScheduler::Add(this);
@@ -87,12 +106,16 @@
 void CTestCase0462::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0462_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0462::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0462_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -111,7 +134,10 @@
 // handle event completion	
 void CTestCase0462::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0462_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	// NOTE: Look at its iStatus.iFlags. 
@@ -132,7 +158,9 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -151,6 +179,7 @@
 		case ERegisterForEvents:
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);		
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP03, KRemoveAConnectorPrompt);		
 			if (iDequeAttempts > 3)
 				{
 				return (TestFailed(KErrCorrupt, _L("<Error> too many irrelevant/incorrect events")));
@@ -185,6 +214,7 @@
 		case EGetAndCancelEvent:
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)"), iOTGEvent, &aDescription, completionCode);
+			OstTraceExt3(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP04, "Received event %d '%S' status(%d)", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventAPlugRemoved == iOTGEvent)
 				{
 				otgQueueOtgEventRequest( iOTGEvent, iStatus);
@@ -214,9 +244,11 @@
 		case EInsertA: // 6. remove 'A'
 			iConsole->ReadCancel();
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP05, KInsertAConnectorPrompt);
 
 			iCaseStep = ERemoveA;
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP06, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -224,11 +256,13 @@
 		case ERemoveA:
 			iConsole->ReadCancel();
 			test.Printf(KRemoveAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP07, KRemoveAConnectorPrompt);
 			if (iRepeats-- >0)
 				iCaseStep = EInsertA;
 			else
 				iCaseStep = ETallyEvents;
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP08, KPressAnyKeyToContinue);
 			RequestCharacter();
 			break;
 			
@@ -251,6 +285,7 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP09, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0463.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0463.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0463.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0463Traces.h"
+#endif
 
 
 
@@ -36,7 +40,10 @@
 
 CTestCase0463* CTestCase0463::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0463_NEWL);
+	    }
 	CTestCase0463* self = new (ELeave) CTestCase0463(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -48,7 +55,10 @@
 CTestCase0463::CTestCase0463(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{	
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0463_CTESTCASE0463);
+	    }
 	} 
 
 
@@ -57,7 +67,10 @@
 */
 void CTestCase0463::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0463_CONSTRUCTL);
+	    }
 	iRepeats = OOMOPEN_REPEATS;
 	iAllocFailNumber = OOMOPEN_REPEATS + 1; // allocs 1..11 fail
 	
@@ -67,7 +80,10 @@
 
 CTestCase0463::~CTestCase0463()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0463_DCTESTCASE0463);
+	    }
 
 	Cancel();
 	}
@@ -75,7 +91,10 @@
 
 void CTestCase0463::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0463_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EMarkStack;
 	CActiveScheduler::Add(this);
 
@@ -86,12 +105,16 @@
 void CTestCase0463::DescribePreconditions()
 	{
 	test.Printf(_L("Insert A connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0463_DESCRIBEPRECONDITIONS, "Insert A connector beforehand.\n");
 	}
 
 	
 void CTestCase0463::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0463_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -101,7 +124,10 @@
 // handle event completion	
 void CTestCase0463::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0463_RUNSTEPL);
+	    }
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -117,6 +143,7 @@
 			__UHEAP_SETFAIL(RHeap::EDeterministic, iAllocFailNumber);
 			__UHEAP_MARK;
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OOMOPEN_REPEATS-iRepeats+1, OOMOPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP01, "Load the LDD iteration %d/%d\n", OOMOPEN_REPEATS-iRepeats+1, OOMOPEN_REPEATS);
 			aIntegerP = new TInt;
 			CleanupStack::PushL(aIntegerP);
 			if (!StepLoadLDD())
@@ -143,12 +170,14 @@
 				return TestFailed(KErrAbort,_L("Unload Ldd failure"));	
 			__UHEAP_MARKEND;
 			test.Printf(_L("Heap intact: Asize %d\n"), iAllocFailNumber);
+			OstTrace1(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP03, "Heap intact: Asize %d\n", iAllocFailNumber);
 			iCaseStep = ELoopDecrement;
 			SelfComplete();			
 			break;
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP04, "Repeat test\n");
 			__UHEAP_RESET;
 			iAllocFailNumber--;
 			
@@ -166,6 +195,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP05, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0464.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0464.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -23,6 +23,10 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0464.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0464Traces.h"
+#endif
 
 
 
@@ -33,7 +37,10 @@
 
 CTestCase0464* CTestCase0464::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0464_NEWL);
+	    }
 	CTestCase0464* self = new (ELeave) CTestCase0464(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -45,7 +52,10 @@
 CTestCase0464::CTestCase0464(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0464_CTESTCASE0464);
+	    }
 		
 	} 
 
@@ -55,7 +65,10 @@
 */
 void CTestCase0464::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0464_CONSTRUCTL);
+	    }
 
 	BaseConstructL();
 	}
@@ -63,7 +76,10 @@
 
 CTestCase0464::~CTestCase0464()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0464_DCTESTCASE0464);
+	    }
 
 	Cancel();
 	}
@@ -71,7 +87,10 @@
 
 void CTestCase0464::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0464_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -82,12 +101,16 @@
 void CTestCase0464::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0464_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0464::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0464_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -107,7 +130,10 @@
 // handle event completion	
 void CTestCase0464::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0464_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -125,7 +151,9 @@
 				}
 			// prompt to insert 'A' connector
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 
@@ -141,6 +169,10 @@
 
 		case EDriveBus:
 			LOG_VERBOSE1(_L("Turn ON VBus\n"))
+			if(gVerboseOutput)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CTESTCASE0464_RUNSTEPL_DUP03, "Turn ON VBus\n");
+			    }
 			err = otgBusRequest();
 			if (KErrNone != err)
 				{
@@ -152,19 +184,29 @@
 
 		case EUnloadLdd:
 			LOG_VERBOSE1(_L("Unload.\n"))
+			if(gVerboseOutput)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CTESTCASE0464_RUNSTEPL_DUP04, "Unload.\n");
+			    }
 			if (EFalse == StepUnloadLDD())
 				return TestFailed(KErrAbort,_L("unload Ldd failure"));	
 			test.Printf(_L("Measure VBus =0 and then press Y or N to continue."));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP05, "Measure VBus =0 and then press Y or N to continue.");
 			RequestCharacter();
 			iCaseStep = EVerifyVBusGone;
 			break;
 
 		case EVerifyVBusGone:
 			LOG_VERBOSE1(_L("Test !VBus after unload.\n"))
+			if(gVerboseOutput)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CTESTCASE0464_RUNSTEPL_DUP06, "Test !VBus after unload.\n");
+			    }
 			// test key response (or via an API)
 			if (('y' == iKeyCodeInput) ||('Y' == iKeyCodeInput))
 				{
 				test.Printf(_L("VBUS drop 'seen' \n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP07, "VBUS drop 'seen' \n");
 				SelfComplete();
 				}
 			else
@@ -179,6 +221,7 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0465.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0465.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0465.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0465Traces.h"
+#endif
 
 
 
@@ -35,7 +39,10 @@
 
 CTestCase0465* CTestCase0465::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0465_NEWL);
+	    }
 	CTestCase0465* self = new (ELeave) CTestCase0465(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -47,7 +54,10 @@
 CTestCase0465::CTestCase0465(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0465_CTESTCASE0465);
+	    }
 		
 	} 
 
@@ -57,7 +67,10 @@
 */
 void CTestCase0465::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0465_CONSTRUCTL);
+	    }
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
 	BaseConstructL();
@@ -66,7 +79,10 @@
 
 CTestCase0465::~CTestCase0465()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0465_DCTESTCASE0465);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -76,7 +92,10 @@
 
 void CTestCase0465::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0465_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -89,7 +108,10 @@
 	
 void CTestCase0465::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0465_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -118,21 +140,33 @@
 void CTestCase0465::DescribePreconditions()
 	{
 	test.Printf(_L("BEFORE running this test\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS, "BEFORE running this test\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP01, "\n");
 	test.Printf(_L("Insert 'A' connector\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP02, "Insert 'A' connector\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP03, "\n");
 	test.Printf(_L("Confirm passing tests\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP04, "Confirm passing tests\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP05, "\n");
 	test.Printf(_L("ID_PIN detection\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP06, "ID_PIN detection\n");
 	test.Printf(_L("VBus Driving\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP07, "VBus Driving\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP08, "\n");
 	}
 		
 
 // handle event completion	
 void CTestCase0465::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0465_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -150,10 +184,15 @@
 				}
 			// prompt to insert connector
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP01, "\n");
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP02, KInsertAConnectorPrompt);
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP03, "\n");
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP05, "\n");
 			RequestCharacter();			
 			break;
 			
@@ -191,6 +230,7 @@
 			iCaseStep = EUnloadLdd;
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)\n"), iOTGEvent, &aDescription, completionCode);
+			OstTraceExt3(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP06, "Received event %d '%S' status(%d)\n", iOTGEvent, aDescription, completionCode);
 			
 			if (iOTGEvent != RUsbOtgDriver::EEventVbusRaised)
 				{
@@ -206,6 +246,7 @@
 				break;	
 				}
 			test.Printf(_L("VBus seen OK.\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP07, "VBus seen OK.\n");
 			
 			SelfComplete();
 			break;
@@ -221,12 +262,19 @@
 			User::After(100000);
 			
 			test.Printf(_L("Use meter or oscilloscope\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP08, "Use meter or oscilloscope\n");
 			test.Printf(_L("to measure VBUS, which should\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP09, "to measure VBUS, which should\n");
 			test.Printf(_L("have dropped\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP10, "have dropped\n");
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP11, "\n");
 			test.Printf(_L("Is it below 0.2 volts?\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP12, "Is it below 0.2 volts?\n");
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP13, "\n");
 			test.Printf(_L("Select Y or N to continue\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP14, "Select Y or N to continue\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &CancelKB);
 			iCaseStep = EVerifyBusGone;
@@ -243,6 +291,7 @@
 			if (('y' == iKeyCodeInput) ||('Y' == iKeyCodeInput))
 				{
 				test.Printf(_L("VBUS 'drop' seen\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP15, "VBUS 'drop' seen\n");
 				SelfComplete();
 				}
 			else
@@ -258,6 +307,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP16, "<Error> unknown test step\n");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0466.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0466.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0466.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0466Traces.h"
+#endif
 
 
 
@@ -34,7 +38,10 @@
 
 CTestCase0466* CTestCase0466::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0466_NEWL);
+	    }
 	CTestCase0466* self = new (ELeave) CTestCase0466(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -46,7 +53,10 @@
 CTestCase0466::CTestCase0466(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0466_CTESTCASE0466);
+	    }
 		
 	} 
 
@@ -56,7 +66,10 @@
 */
 void CTestCase0466::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0466_CONSTRUCTL);
+	    }
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
 	BaseConstructL();
@@ -65,7 +78,10 @@
 
 CTestCase0466::~CTestCase0466()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0466_DCTESTCASE0466);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -74,7 +90,10 @@
 
 void CTestCase0466::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0466_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;
@@ -88,23 +107,38 @@
 void CTestCase0466::DescribePreconditions()
 	{
 	test.Printf(_L("BEFORE running this test\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS, "BEFORE running this test\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP01, "\n");
 	test.Printf(_L("Insert the connector\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP02, "Insert the connector\n");
 	test.Printf(_L("from the OET with SW9\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP03, "from the OET with SW9\n");
 	test.Printf(_L("set to 'A-DEVICE' and\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP04, "set to 'A-DEVICE' and\n");
 	test.Printf(_L("all other switches OFF\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP05, "all other switches OFF\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP06, "\n");
 	test.Printf(_L("Confirm passing tests\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP07, "Confirm passing tests\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP08, "\n");
 	test.Printf(_L("ID_PIN detection\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP09, "ID_PIN detection\n");
 	test.Printf(_L("VBus Driving\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP10, "VBus Driving\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP11, "\n");
 	}
 
 	
 void CTestCase0466::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0466_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -123,7 +157,10 @@
 // handle event completion	
 void CTestCase0466::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0466_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -141,10 +178,15 @@
 				}
 			// prompt to insert connector
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP01, "\n");
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP02, KInsertAConnectorPrompt);
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP03, "\n");
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP05, "\n");
 			RequestCharacter();			
 			break;
 			
@@ -182,11 +224,17 @@
 
 			// ...and tell user to apply load	
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP06, "\n");
 			test.Printf(_L("************************\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP07, "************************\n");
 			test.Printf(_L("* Using SW4 on the OET *\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP08, "* Using SW4 on the OET *\n");
 			test.Printf(_L("* Apply 100mA LOAD now *\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP09, "* Apply 100mA LOAD now *\n");
 			test.Printf(_L("************************\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP10, "************************\n");
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP11, "\n");
 			
 			iCaseStep = EVerifyBusFail;
 			
@@ -196,6 +244,7 @@
 		
 			OtgMessageString(iOTGMessage, aDescription);
 			test.Printf(_L("Received message %d '%S' status(%d)\n"), iOTGMessage, &aDescription, completionCode);
+			OstTraceExt3(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP12, "Received message %d '%S' status(%d)\n", iOTGMessage, aDescription, completionCode);
 
 			if (RUsbOtgDriver::EMessageVbusError == iOTGMessage)
 				{
@@ -234,15 +283,22 @@
 
 			// remove 100ma Load - this reminds the user
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP13, "\n");
 			test.Printf(_L("************************\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP14, "************************\n");
 			test.Printf(_L("* Using SW4 on the OET *\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP15, "* Using SW4 on the OET *\n");
 			test.Printf(_L("* Remove 100mA LOAD!   *\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP16, "* Remove 100mA LOAD!   *\n");
 			test.Printf(_L("************************\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP17, "************************\n");
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP18, "\n");
 			
 			iCaseStep = ELastStep;
 			// press any key
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP19, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -251,6 +307,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP20, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0467.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0467.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0467.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0467Traces.h"
+#endif
 
 
 
@@ -37,7 +41,10 @@
 
 CTestCase0467* CTestCase0467::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_NEWL);
+	    }
 	CTestCase0467* self = new (ELeave) CTestCase0467(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -49,7 +56,10 @@
 CTestCase0467::CTestCase0467(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_CTESTCASE0467);
+	    }
 		
 	} 
 
@@ -59,7 +69,10 @@
 */
 void CTestCase0467::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_CONSTRUCTL);
+	    }
 	iRepeats = INSERT_REPEATS;
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
@@ -69,7 +82,10 @@
 
 CTestCase0467::~CTestCase0467()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_DCTESTCASE0467);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -79,7 +95,10 @@
 
 void CTestCase0467::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -92,7 +111,10 @@
 	
 void CTestCase0467::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -111,7 +133,10 @@
 
 void CTestCase0467::CancelIdPin(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_CANCELIDPIN);
+	    }
 	
 	CTestCase0467 * p = REINTERPRET_CAST(CTestCase0467 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
@@ -124,14 +149,19 @@
 void CTestCase0467::DescribePreconditions()
 	{
 	test.Printf(_L("Remove 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0467_DESCRIBEPRECONDITIONS, "Remove 'A' connector beforehand.\n");
 	test.Printf(_L("ID_PIN detection and VBus driving tests must already pass.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0467_DESCRIBEPRECONDITIONS_DUP01, "ID_PIN detection and VBus driving tests must already pass.\n");
 	}
 		
 
 // handle event completion	
 void CTestCase0467::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0467_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -148,7 +178,9 @@
 				}
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP01, KRemoveAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -166,6 +198,7 @@
 			
 		case ERepeatLoop: // 2
 			test.Printf(_L("Repeat test %d/%d\n"), INSERT_REPEATS-iRepeats+1, INSERT_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP03, "Repeat test %d/%d\n", INSERT_REPEATS-iRepeats+1, INSERT_REPEATS);
 
 			if (--iRepeats)
 				iCaseStep = EWaitForIDPresent;
@@ -177,6 +210,7 @@
 		case EWaitForIDPresent:
 			// 3. prompt for insertion
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP04, KInsertAConnectorPrompt);
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
 
 			SetActive();
@@ -187,6 +221,10 @@
 		case EVerifyIDPresent:
 			// 4. detect id_pin event
 			LOG_VERBOSE1(_L("STEP4 - detect id_pin event 'A'\n"));
+			if(gVerboseOutput)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CTESTCASE0467_RUNSTEPL_DUP05, "STEP4 - detect id_pin event 'A'\n");;
+			    }
 
 			// retrieve the current ID_PIN value
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
@@ -224,6 +262,7 @@
 		case EWaitForIDGone: 
 			// 5. prompt for insertion
 			test.Printf(KRemoveAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP06, KRemoveAConnectorPrompt);
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
 			SetActive();
 			iCaseStep = EVerifyIDGone;
@@ -232,13 +271,19 @@
 		case EVerifyIDGone:
 			// 6. detect id_pin gone event
 			LOG_VERBOSE1(_L("STEP4 - detect id_pin remove event 'B'\n"));
+			if(gVerboseOutput)
+			    {
+			    OstTrace0(TRACE_VERBOSE, CTESTCASE0467_RUNSTEPL_DUP07, "STEP4 - detect id_pin remove event 'B'\n");;
+			    }
 			test.Printf(_L("ID_PIN=%d\n"), iOTGIdPin);
+			OstTrace1(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP08, "ID_PIN=%d\n", iOTGIdPin);
 
 			User::After(5000); // 5ms
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
 			otgCancelOtgIdPinNotification();
 			User::WaitForRequest(iStatus); // swallow it
 			test.Printf(_L("ID_PIN=%d\n"), iOTGIdPin);
+			OstTrace1(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP09, "ID_PIN=%d\n", iOTGIdPin);
 
 			if (iOTGIdPin != RUsbOtgDriver::EIdPinBPlug)
 				{
@@ -278,6 +323,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP10, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0468.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0468.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0468.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0468Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0468* CTestCase0468::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_NEWL);
+	    }
 	CTestCase0468* self = new (ELeave) CTestCase0468(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -48,7 +55,10 @@
 CTestCase0468::CTestCase0468(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_CTESTCASE0468);
+	    }
 		
 	} 
 
@@ -58,7 +68,10 @@
 */
 void CTestCase0468::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_CONSTRUCTL);
+	    }
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -68,7 +81,10 @@
 
 CTestCase0468::~CTestCase0468()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_DCTESTCASE0468);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -78,7 +94,10 @@
 
 void CTestCase0468::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -91,7 +110,10 @@
 	
 void CTestCase0468::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -100,7 +122,10 @@
 
 void CTestCase0468::CancelKB(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_CANCELKB);
+	    }
 	CTestCase0468 * p = REINTERPRET_CAST(CTestCase0468 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -110,7 +135,10 @@
 
 void CTestCase0468::CancelNotify(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_CANCELNOTIFY);
+	    }
 	CTestCase0468 * p = REINTERPRET_CAST(CTestCase0468 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	p->otgCancelOtgVbusNotification();
@@ -122,12 +150,18 @@
 void CTestCase0468::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0468_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	test.Printf(_L("ID_PIN detection and VBus driving tests must already pass.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0468_DESCRIBEPRECONDITIONS_DUP01, "ID_PIN detection and VBus driving tests must already pass.\n");
 	}
 
 void CTestCase0468::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CTESTCASE0468_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
+	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -136,7 +170,10 @@
 // handle event completion	
 void CTestCase0468::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0468_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -155,7 +192,9 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -181,7 +220,9 @@
 			if (!otgIdPinPresent())
 				{
 				test.Printf(KInsertAConnectorPrompt);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 
 				iCaseStep = EDetectAPlug;
@@ -210,8 +251,10 @@
 			// 4. DRIVE VBUS
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			// test for VBus rise next
 			test.Printf(_L("Waiting for VBus Event\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP06, "Waiting for VBus Event\n");
 			iStatus = KRequestPending;
 			otgQueueOtgVbusNotification( iOTGVBus, iStatus );
 
@@ -229,6 +272,10 @@
 		case ELoopVerifyVBus:
 			// 5. get VBus rise event
 			LOG_VERBOSE2(_L("Post notification val=%d\n\n"), iOTGVBus);
+			if(gVerboseOutput)
+			    {
+			    OstTrace1(TRACE_VERBOSE, CTESTCASE0468_RUNSTEPL_DUP07, "Post notification val=%d\n\n", iOTGVBus);;
+			    }
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				return TestFailed(KErrAbort, _L("Vbus rise not signalled in time - FAILED!"));
@@ -313,6 +360,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0469.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0469Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0469* CTestCase0469::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_NEWL);
+	    }
 	CTestCase0469* self = new (ELeave) CTestCase0469(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -47,7 +54,10 @@
 CTestCase0469::CTestCase0469(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_CTESTCASE0469);
+	    }
 		
 	} 
 
@@ -56,7 +66,10 @@
 */
 void CTestCase0469::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_CONSTRUCTL);
+	    }
     iDualRoleCase = EFalse; // Not back to back
 	BaseConstructL();
 	}
@@ -64,7 +77,10 @@
 
 CTestCase0469::~CTestCase0469()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_DCTESTCASE0469);
+	    }
     iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -72,7 +88,10 @@
 
 void CTestCase0469::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iRepeats = 3;
 	
@@ -83,7 +102,10 @@
 	
 void CTestCase0469::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -91,7 +113,10 @@
 // handle event completion	
 void CTestCase0469::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0469_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -105,8 +130,11 @@
         iCaseStep = ELoadLdd;
         // prompt to insert connectors
         test.Printf(KInsertBCablePrompt);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP01, KInsertBCablePrompt);
         test.Printf(KRemoveAFromPC);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP02, KRemoveAFromPC);
         test.Printf(KPressAnyKeyToContinue);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP03, KPressAnyKeyToContinue);
         RequestCharacter();			
         break;
 			
@@ -149,12 +177,12 @@
 
         if (iRepeats--)
             {
-            RDebug::Printf("ELoopControl around again %d", iRepeats);
+            OstTrace1(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP04, "ELoopControl around again %d", iRepeats);
             iCaseStep = ETestVbusRise;
             }
         else
             {
-            RDebug::Printf("ELoopControl we're done");
+            OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP05, "ELoopControl we're done");
             iCaseStep = EUnloadLdd;
             }
         SelfComplete();
@@ -172,6 +200,7 @@
         iCollector.AddRequiredNotification(EWatcherEvent, RUsbOtgDriver::EEventVbusRaised);
         iCaseStep = ETestVbusFall;
         test.Printf(KInsertAIntoPC);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP06, KInsertAIntoPC);
         SetActive();
         break;
 
@@ -187,19 +216,20 @@
         iCollector.AddRequiredNotification(EWatcherEvent, RUsbOtgDriver::EEventVbusDropped);
         iCaseStep = ELoopControl;
         test.Printf(KRemoveAFromPC);
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP07, KRemoveAFromPC);
         SetActive();
         break;
 
     case EUnloadLdd:
         LOG_STEPNAME(_L("EUnloadLdd"))
         iCollector.DestroyObservers();
-        RDebug::Printf("Destroyed observers");
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP08, "Destroyed observers");
         if (EFalse == StepUnloadLDD())
             return TestFailed(KErrAbort,_L("unload Ldd failure"));	
-        RDebug::Printf("unloaded ldd");
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP09, "unloaded ldd");
         if (!StepUnloadClient())
             return TestFailed(KErrAbort,_L("Client Unload Failure"));	
-        RDebug::Printf("unloaded client");
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP10, "unloaded client");
 
         iCaseStep = ELastStep;
         SelfComplete();
@@ -212,6 +242,7 @@
 			
     default:
         test.Printf(_L("<Error> unknown test step"));
+        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP11, "<Error> unknown test step");
         Cancel();
         return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0670.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0670.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0670.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0670Traces.h"
+#endif
 
 
 
@@ -34,7 +38,10 @@
 
 CTestCase0670* CTestCase0670::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0670_NEWL);
+	    }
 	CTestCase0670* self = new (ELeave) CTestCase0670(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -46,7 +53,10 @@
 CTestCase0670::CTestCase0670(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0670_CTESTCASE0670);
+	    }
 		
 	} 
 
@@ -82,7 +92,10 @@
 	
 void CTestCase0670::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0670_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -110,19 +123,29 @@
 	{
 	// H4 width     ****************************
 	test.Printf(_L("***************************\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS, "***************************\n");
 	test.Printf(_L("* This test uses a Mini-A *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP01, "* This test uses a Mini-A *\n");
 	test.Printf(_L("* to Mini-B cable to link *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP02, "* to Mini-B cable to link *\n");
 	test.Printf(_L("* the H4 board to the OPT *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP03, "* the H4 board to the OPT *\n");
 	test.Printf(_L("* and makes use of the    *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP04, "* and makes use of the    *\n");
 	test.Printf(_L("*  USB OPT test code      *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP05, "*  USB OPT test code      *\n");
 	test.Printf(_L("***************************\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP06, "***************************\n");
 	}
 
 
 // handle event completion	
 void CTestCase0670::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0670_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -155,10 +178,14 @@
 		case EConnectAtoB:
 			// H4 width     ****************************
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP01, "\n");
 			test.Printf(_L("***********************\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP02, "***********************\n");
 //			WAIT_ON_KEYOP( "Connect H4(A) to OPT(B)\n");
 			test.Printf(_L("Connect H4(A) to OPT(B)\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP03, "Connect H4(Ato OPT(B)\n");
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 
 			iCaseStep = EStartOptTD4_5;
 			RequestCharacter();	
@@ -167,10 +194,15 @@
 		case EStartOptTD4_5:
 			// H4 width     ****************************
 			test.Printf(_L("On the OPT, select:\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP05, "On the OPT, select:\n");
 			test.Printf(_L("  Certified FS-A-UUT Test\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP06, "  Certified FS-A-UUT Test\n");
 			test.Printf(_L("  Test TD.4.5-2.9ms-100ms\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP07, "  Test TD.4.5-2.9ms-100ms\n");
 			test.Printf(_L("  And then Click 'Run' "));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP08, "  And then Click 'Run' ");
 			test.Printf(_L("  When test starts, press any key"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP09, "  When test starts, press any key");
 			iCaseStep = EPromptYOpt4_5;
 			RequestCharacter();	
 			break;
@@ -178,6 +210,7 @@
 		case EPromptYOpt4_5:
 			iCaseStep = EConfirmOpt4_5;
 			test.Printf(_L("Did it PASS (Y/N)?"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP10, "Did it PASS (Y/N?");
 			RequestCharacter(); // 30 seconds for user input
 			iWDTimer->IssueRequest(KDelayDurationForTest4_5, this, &CancelKB);
 			break;
@@ -224,6 +257,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0671.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0671.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0671.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0671Traces.h"
+#endif
 
 
 
@@ -34,7 +38,10 @@
 
 CTestCase0671* CTestCase0671::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0671_NEWL);
+	    }
 	CTestCase0671* self = new (ELeave) CTestCase0671(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -46,7 +53,10 @@
 CTestCase0671::CTestCase0671(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0671_CTESTCASE0671);
+	    }
 		
 	} 
 
@@ -82,7 +92,10 @@
 	
 void CTestCase0671::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0671_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -110,19 +123,29 @@
 	{
 	// H4 width     ****************************
 	test.Printf(_L("***************************\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS, "***************************\n");
 	test.Printf(_L("* This test uses a Mini-A *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP01, "* This test uses a Mini-A *\n");
 	test.Printf(_L("* to Mini-B cable to link *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP02, "* to Mini-B cable to link *\n");
 	test.Printf(_L("* the H4 board to the OPT *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP03, "* the H4 board to the OPT *\n");
 	test.Printf(_L("* and makes use of the    *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP04, "* and makes use of the    *\n");
 	test.Printf(_L("*  USB OPT test code      *\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP05, "*  USB OPT test code      *\n");
 	test.Printf(_L("***************************\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP06, "***************************\n");
 	}
 
 
 // handle event completion	
 void CTestCase0671::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0671_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -155,9 +178,13 @@
 		case EConnectAtoB:
 			// H4 width     ****************************
 			test.Printf(_L("\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP01, "\n");
 			test.Printf(_L("***********************\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP02, "***********************\n");
 			test.Printf(_L("Connect H4(B) to OPT(A)\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP03, "Connect H4(Bto OPT(A)\n");
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 
 			iCaseStep = EStartOptTD5_5;
 			RequestCharacter();	
@@ -166,10 +193,15 @@
 		case EStartOptTD5_5:
 			// H4 width     ****************************
 			test.Printf(_L("On the OPT, select:\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP05, "On the OPT, select:\n");
 			test.Printf(_L("  Certified FS-B-UUT Test\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP06, "  Certified FS-B-UUT Test\n");
 			test.Printf(_L("  Test TD.5.5\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP07, "  Test TD.5.5\n");
 			test.Printf(_L("  And then Click 'Run' "));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP08, "  And then Click 'Run' ");
 			test.Printf(_L("  When test starts, press any key"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP09, "  When test starts, press any key");
 			iCaseStep = EPromptYOpt5_5;
 			RequestCharacter();	
 			break;
@@ -177,6 +209,7 @@
 		case EPromptYOpt5_5:
 			iCaseStep = EConfirmOpt5_5;
 			test.Printf(_L("Did it PASS (Y/N)?"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP10, "Did it PASS (Y/N?");
 			RequestCharacter(); // 30 seconds for user input
 			iWDTimer->IssueRequest(KDelayDurationForTest4_5, this, &CancelKB);
 			break;
@@ -223,6 +256,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0675.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0675.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0675.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0675Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0675* CTestCase0675::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_NEWL);
+	    }
 	CTestCase0675* self = new (ELeave) CTestCase0675(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -48,7 +55,10 @@
 CTestCase0675::CTestCase0675(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_CTESTCASE0675);
+	    }
 		
 	} 
 
@@ -58,7 +68,10 @@
 */
 void CTestCase0675::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_CONSTRUCTL);
+	    }
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -68,7 +81,10 @@
 
 CTestCase0675::~CTestCase0675()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_DCTESTCASE0675);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -78,7 +94,10 @@
 
 void CTestCase0675::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -91,7 +110,10 @@
 	
 void CTestCase0675::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -100,7 +122,10 @@
 
 void CTestCase0675::CancelKB(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_CANCELKB);
+	    }
 	CTestCase0675 * p = REINTERPRET_CAST(CTestCase0675 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -110,7 +135,10 @@
 
 void CTestCase0675::CancelNotify(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_CANCELNOTIFY);
+	    }
 	CTestCase0675 * p = REINTERPRET_CAST(CTestCase0675 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	p->otgCancelOtgVbusNotification();
@@ -122,12 +150,17 @@
 void CTestCase0675::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0675_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	
 	}
 
 void CTestCase0675::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CTESTCASE0675_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
+	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -136,7 +169,10 @@
 // handle event completion	
 void CTestCase0675::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0675_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -155,7 +191,9 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -181,7 +219,9 @@
 			if (!otgIdPinPresent())
 				{
 				test.Printf(KInsertAConnectorPrompt);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 				iCaseStep = EDetectAPlug;
 				}
@@ -209,8 +249,10 @@
 		case ELoopDriveVBus1:
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			// test for VBus rise next
 			test.Printf(_L("Waiting for VBus Event\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP06, "Waiting for VBus Event\n");
 			iStatus = KRequestPending;
 			otgQueueOtgVbusNotification( iOTGVBus, iStatus );
 			SetActive();
@@ -247,6 +289,7 @@
 		case ELoopDriveVBus2:
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus double, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP07, "Drive VBus double, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 
 			err = otgBusRequest();	// duplicate turn on VBus, we expect an error 
 			if (KErrUsbOtgVbusAlreadyRaised != err)
@@ -327,6 +370,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0676.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0676.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0676.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0676Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0676* CTestCase0676::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_NEWL);
+	    }
 	CTestCase0676* self = new (ELeave) CTestCase0676(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -48,7 +55,10 @@
 CTestCase0676::CTestCase0676(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_CTESTCASE0676);
+	    }
 		
 	} 
 
@@ -58,7 +68,10 @@
 */
 void CTestCase0676::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_CONSTRUCTL);
+	    }
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -68,7 +81,10 @@
 
 CTestCase0676::~CTestCase0676()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_DCTESTCASE0676);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -78,7 +94,10 @@
 
 void CTestCase0676::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -91,7 +110,10 @@
 	
 void CTestCase0676::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -100,7 +122,10 @@
 
 void CTestCase0676::CancelKB(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_CANCELKB);
+	    }
 	CTestCase0676 * p = REINTERPRET_CAST(CTestCase0676 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -110,7 +135,10 @@
 
 void CTestCase0676::CancelNotify(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_CANCELNOTIFY);
+	    }
 	CTestCase0676 * p = REINTERPRET_CAST(CTestCase0676 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	p->otgCancelOtgVbusNotification();
@@ -122,11 +150,16 @@
 void CTestCase0676::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0676_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 void CTestCase0676::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CTESTCASE0676_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
+	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -135,7 +168,10 @@
 // handle event completion	
 void CTestCase0676::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0676_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -154,7 +190,9 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -180,7 +218,9 @@
 			if (!otgIdPinPresent())
 				{
 				test.Printf(KInsertAConnectorPrompt);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 
 				iCaseStep = EDetectAPlug;
@@ -209,8 +249,10 @@
 			// 4. DRIVE VBUS
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			// test for VBus rise next
 			test.Printf(_L("Waiting for VBus Event\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP06, "Waiting for VBus Event\n");
 			iStatus = KRequestPending;
 			otgQueueOtgVbusNotification( iOTGVBus, iStatus );
 
@@ -311,6 +353,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP07, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0677.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0677.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0677.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0677Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0677* CTestCase0677::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_NEWL);
+	    }
 	CTestCase0677* self = new (ELeave) CTestCase0677(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -48,7 +55,10 @@
 CTestCase0677::CTestCase0677(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_CTESTCASE0677);
+	    }
 		
 	} 
 
@@ -58,7 +68,10 @@
 */
 void CTestCase0677::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_CONSTRUCTL);
+	    }
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -68,7 +81,10 @@
 
 CTestCase0677::~CTestCase0677()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_DCTESTCASE0677);
+	    }
 
 	Cancel();
 	delete iWDTimer;
@@ -78,7 +94,10 @@
 
 void CTestCase0677::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -91,7 +110,10 @@
 	
 void CTestCase0677::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_DOCANCEL);
+	    }
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -100,7 +122,10 @@
 
 void CTestCase0677::CancelKB(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_CANCELKB);
+	    }
 	CTestCase0677 * p = REINTERPRET_CAST(CTestCase0677 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -110,7 +135,10 @@
 
 void CTestCase0677::CancelNotify(CTestCaseRoot *pThis)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_CANCELNOTIFY);
+	    }
 	CTestCase0677 * p = REINTERPRET_CAST(CTestCase0677 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	switch (p->iCancelWhat)
@@ -136,15 +164,23 @@
 void CTestCase0677::DescribePreconditions()
 	{
 	test.Printf(_L("Using OET, connect oscilloscope chan.A to VBus\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS, "Using OET, connect oscilloscope chan.A to VBus\n");
 	test.Printf(_L("Connect oscilloscope chan.B to D+\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP01, "Connect oscilloscope chan.B to D+\n");
 	test.Printf(_L("Trigger once, 200mV, 100ms \n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP02, "Trigger once, 200mV, 100ms \n");
 	test.Printf(_L("Prepare to observe VBus, D+ pulse.\n\n"));
+	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP03, "Prepare to observe VBus, D+ pulse.\n\n");
 	}
 
 
 void CTestCase0677::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CTESTCASE0677_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
+	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -154,7 +190,10 @@
 // handle event completion	
 void CTestCase0677::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0677_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -173,7 +212,9 @@
 				}
 			// prompt to insert connector
 			test.Printf(KAttachOETAsBDevice);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP01, KAttachOETAsBDevice);
 			test.Printf(KPressAnyKeyToContinue);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -199,7 +240,9 @@
 			if (otgIdPinPresent())
 				{
 				test.Printf(KRemoveAConnectorPrompt);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP03, KRemoveAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 
 				iCaseStep = EDetectBPlug;
@@ -216,6 +259,7 @@
 			iWDTimer->Cancel();
 
 			test.Printf(KMsgWaitingForSRPInitiated);
+			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP05, KMsgWaitingForSRPInitiated);
 			otgQueueOtgEventRequest( iOTGEvent, iStatus );
 
 			// turn on VBus (B-SRP)
@@ -240,6 +284,7 @@
 				}
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)\n"), iOTGEvent, &aDescription, completionCode);
+			OstTraceExt3(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP06, "Received event %d '%S' status(%d)\n", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventSrpInitiated == iOTGEvent)
 				{
 				// calc interval
@@ -248,16 +293,22 @@
 				aNowTime.HomeTime();
 				aIntvlMicro = aNowTime.MicroSecondsFrom(iTimeSRPStart);
 				LOG_VERBOSE2(_L("SRP active after %d ms\n"), (TInt)(aIntvlMicro.Int64()/1000));
+				if(gVerboseOutput)
+				    {
+				    OstTrace1(TRACE_VERBOSE, CTESTCASE0677_RUNSTEPL_DUP07, "SRP active after %d ms\n", (TInt)(aIntvlMicro.Int64()/1000));;
+				    }
 				iCancelWhat = ECancelMessageNotify;
 				otgQueueOtgMessageRequest( iOTGMessage, iStatus );
 				iCaseStep = EWaitForSRPTimeout;
 				test.Printf(KMsgWaitingForSRPTimeout);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP08, KMsgWaitingForSRPTimeout);
 				SetActive();
 				}
 			else
 				{
 				iCaseStep = EWaitForSRPInitiated;
 				test.Printf(KMsgWaitingForSRPInitiated);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP09, KMsgWaitingForSRPInitiated);
 				iStatus = KRequestPending;
 				otgQueueOtgEventRequest( iOTGEvent, iStatus );
 				SetActive();
@@ -272,6 +323,7 @@
 				}
 			OtgMessageString(iOTGMessage, aDescription);
 			test.Printf(_L("Received message %d '%S' status(%d)\n"), iOTGMessage, &aDescription, completionCode);
+			OstTraceExt3(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP10, "Received message %d '%S' status(%d)\n", iOTGMessage, aDescription, completionCode);
 			if (RUsbOtgDriver::EMessageSrpTimeout == iOTGMessage)
 				{
 				iWDTimer->Cancel();		//	Only cancel WD Timer here, when timed portion of test is over
@@ -281,6 +333,10 @@
 				aNowTime.HomeTime();
 				aIntvlMicro = aNowTime.MicroSecondsFrom(iTimeSRPStart);
 				LOG_VERBOSE2(_L("SRP times out after %d ms\n"), (TInt)(aIntvlMicro.Int64()/1000));
+				if(gVerboseOutput)
+				    {
+				    OstTrace1(TRACE_VERBOSE, CTESTCASE0677_RUNSTEPL_DUP11, "SRP times out after %d ms\n", (TInt)(aIntvlMicro.Int64()/1000));;
+				    }
 				// the correct value is 32 seconds, not 4.9 seconds as per the spec.
 
 				iCaseStep = EIssueSRPObservedPrompt;
@@ -290,6 +346,7 @@
 				{
 				iCaseStep = EWaitForSRPTimeout;
 				test.Printf(KMsgWaitingForSRPTimeout);
+				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP12, KMsgWaitingForSRPTimeout);
 				iStatus = KRequestPending;
 				otgQueueOtgMessageRequest( iOTGMessage, iStatus );
 				SetActive();
@@ -299,7 +356,9 @@
 		case EIssueSRPObservedPrompt:
 			{
 			test.Printf(_L("\nPress Y to verify that SRP was observed\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP13, "\nPress Y to verify that SRP was observed\n");
 			test.Printf(_L("or any other key to fail test.\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP14, "or any other key to fail test.\n");
 			RequestCharacter();
 			iCaseStep = ECheckSRPObservedUserInput;
 			break;
@@ -332,6 +391,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP15, "<Error> unknown test step\n");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0678.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0678.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,6 +25,10 @@
 //#include "testcasewd.h"
 #include "b2bwatchers.h"
 #include "testcase0678.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0678Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -38,7 +42,10 @@
 
 CTestCase0678* CTestCase0678::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0678_NEWL);
+	    }
 	CTestCase0678* self = new (ELeave) CTestCase0678(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -50,7 +57,10 @@
 CTestCase0678::CTestCase0678(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0678_CTESTCASE0678);
+	    }
 		
 	} 
 
@@ -60,7 +70,10 @@
 */
 void CTestCase0678::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0678_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -70,7 +83,10 @@
 
 CTestCase0678::~CTestCase0678()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0678_DCTESTCASE0678);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -78,7 +94,10 @@
 
 void CTestCase0678::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0678_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -88,7 +107,10 @@
 	
 void CTestCase0678::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0678_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -97,7 +119,10 @@
 // handle event completion	
 void CTestCase0678::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0678_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -178,6 +203,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP01, "Into EDefaultRoles step...\n");
 			
 			if ( --iHNPCounter >= 0)
 				{
@@ -210,6 +236,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP02, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -224,6 +251,7 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP03, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -232,6 +260,7 @@
 			
 			// issue HNP
 			test.Printf(_L("VBus present, attempting a swap.\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP04, "VBus present, attempting a swap.\n");
 			iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 
 			err = otgBusRequest();	//	Request the host role
@@ -239,6 +268,7 @@
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d\n"),err);
+				OstTrace1(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP05, "BusRequest returned %d\n",err);
 				return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}
 		
@@ -250,6 +280,7 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP06, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -275,6 +306,7 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillAConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP07, "Into EWaitTillAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -290,6 +322,7 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillASuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP08, "Into EWaitTillASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -357,6 +390,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP09, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0679.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0679.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0679.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0679Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -37,7 +41,10 @@
 
 CTestCase0679* CTestCase0679::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0679_NEWL);
+	    }
 	CTestCase0679* self = new (ELeave) CTestCase0679(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -49,7 +56,10 @@
 CTestCase0679::CTestCase0679(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0679_CTESTCASE0679);
+	    }
 		
 	} 
 
@@ -59,7 +69,10 @@
 */
 void CTestCase0679::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0679_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -69,7 +82,10 @@
 
 CTestCase0679::~CTestCase0679()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0679_DCTESTCASE0679);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -77,7 +93,10 @@
 
 void CTestCase0679::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0679_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -86,7 +105,10 @@
 	
 void CTestCase0679::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0679_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -95,7 +117,10 @@
 // handle event completion	
 void CTestCase0679::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0679_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -178,6 +203,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP01, "Into EDefaultRoles step...\n");
 			LOG_STEPNAME(_L("EWaitEnumeration"));
 			
 			if (gTestRoleMaster)
@@ -201,6 +227,7 @@
 				iCollector.AddStepTimeout(KTestCase0679ATimeout);	//	NB. In this test on the A-Device, we expect to timeout
 																	//	so a timeout isn't treated as a failure
 				test.Printf(_L("NOTE : Please observe test result on B-Device...\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP02, "NOTE : Please observe test result on B-Device...\n");
 				iCaseStep = EDropVBus;	//	This is the step the A-Device will go to
 										//	when the timer (set up in previous test) fires
 				}
@@ -212,6 +239,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP03, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -226,6 +254,7 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP04, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -234,6 +263,7 @@
 			
 			// issue HNP
 			test.Printf(_L("Attempting a swap on a non-HNP enabled link...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP05, "Attempting a swap on a non-HNP enabled link...\n");
 			iCollector.AddRequiredNotification(EWatcherMessage, RUsbOtgDriver::EMessageHnpNotEnabled);
 
 			err = otgBusRequest();	//	Request the host role
@@ -241,6 +271,7 @@
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d)"),err);
+				OstTrace1(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP06, "BusRequest returned %d)",err);
 				//DS Temp! return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}
 		
@@ -252,6 +283,7 @@
 		case EBErrorReceived:
 			{
 			test.Printf(_L("Into EBErrorReceived step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP07, "Into EBErrorReceived step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -317,6 +349,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0680.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0680.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0680.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0680Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -37,7 +41,10 @@
 
 CTestCase0680* CTestCase0680::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0680_NEWL);
+	    }
 	CTestCase0680* self = new (ELeave) CTestCase0680(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -49,7 +56,10 @@
 CTestCase0680::CTestCase0680(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0680_CTESTCASE0680);
+	    }
 		
 	} 
 
@@ -59,7 +69,10 @@
 */
 void CTestCase0680::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0680_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -69,7 +82,10 @@
 
 CTestCase0680::~CTestCase0680()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0680_DCTESTCASE0680);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -77,7 +93,10 @@
 
 void CTestCase0680::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0680_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -86,7 +105,10 @@
 	
 void CTestCase0680::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0680_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -95,7 +117,10 @@
 // handle event completion	
 void CTestCase0680::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0680_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -144,6 +169,7 @@
 		case EReadyToRaiseVBus:
 			{
 			test.Printf(_L("Into EReadyToRaiseVBus step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP01, "Into EReadyToRaiseVBus step...\n");
 			if (gTestRoleMaster)
 				{
 				// wait for Vbus to be raised
@@ -177,6 +203,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP02, "Into EDefaultRoles step...\n");
 			LOG_STEPNAME(_L("EWaitEnumeration"));
 			
 			if (gTestRoleMaster)
@@ -200,6 +227,7 @@
 				iCollector.AddStepTimeout(KTestCase0680ATimeout);	//	NB. In this test on the A-Device, we expect to timeout
 																	//	so a timeout isn't treated as a failure
 				test.Printf(_L("NOTE : Please observe test result on B-Device...\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP03, "NOTE : Please observe test result on B-Device...\n");
 				iCaseStep = EDropVBus;	//	This is the step the A-Device will go to
 										//	when the timer (set up in previous test) fires
 				}
@@ -211,6 +239,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP04, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -220,11 +249,13 @@
 			iCollector.AddRequiredNotification(EWatcherMessage, RUsbOtgDriver::EMessageHnpNotSuspended);
 
 			test.Printf(_L("Attempting a swap on an unsuspended link...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP05, "Attempting a swap on an unsuspended link...\n");
 			err = otgBusRequest();	//	Request the host role
 
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d)"),err);
+				OstTrace1(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP06, "BusRequest returned %d)",err);
 				return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}			
 
@@ -242,6 +273,7 @@
 				}
 
 			test.Printf(_L("Into EBErrorReceived step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP07, "Into EBErrorReceived step...\n");
 			iCaseStep = EDropVBus;	//	Test has pretty much passed now. Just wait for A-Device to drop VBus.
 			SelfComplete();
 			break;
@@ -302,6 +334,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0681.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0681Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -37,7 +41,10 @@
 
 CTestCase0681* CTestCase0681::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0681_NEWL);
+	    }
 	CTestCase0681* self = new (ELeave) CTestCase0681(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -49,7 +56,10 @@
 CTestCase0681::CTestCase0681(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0681_CTESTCASE0681);
+	    }
 		
 	} 
 
@@ -59,7 +69,10 @@
 */
 void CTestCase0681::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0681_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -69,7 +82,10 @@
 
 CTestCase0681::~CTestCase0681()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0681_DCTESTCASE0681);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -77,7 +93,10 @@
 
 void CTestCase0681::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0681_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -87,7 +106,10 @@
 	
 void CTestCase0681::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0681_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -98,16 +120,24 @@
 	if (gTestRoleMaster)
 		{ // "B" device
 		test.Printf(_L("***** Important note *****\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS, "***** Important note *****\n");
 		test.Printf(_L("Before commencing test, please\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP01, "Before commencing test, please\n");
 		test.Printf(_L("insert 'B'-cable end and activate\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP02, "insert 'B'-cable end and activate\n");
 		test.Printf(_L("the test on the 'A' device.\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP03, "the test on the 'A' device.\n");
 		test.Printf(_L("Then, press any key to continue.\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP04, "Then, press any key to continue.\n");
 		test.Printf(_L("**************************\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP05, "**************************\n");
 		}
 	else
 		{
 		test.Printf(KInsertACablePrompt);
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP06, KInsertACablePrompt);
 		test.Printf(KPressAnyKeyToContinue);
+		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP07, KPressAnyKeyToContinue);
 		}
 
 	RequestCharacter();	
@@ -116,7 +146,10 @@
 // handle event completion	
 void CTestCase0681::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0681_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -192,6 +225,7 @@
 		case EPerformSrp:
 			{
 			test.Printf(_L("Into EPerformSrp step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP01, "Into EPerformSrp step...\n");
 
 			if (gTestRoleMaster)
 				{
@@ -231,6 +265,7 @@
 		case EAReceivedSrp:		//	A-Device step only!
 			{
 			test.Printf(_L("Into EAReceivedSrp step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP02, "Into EAReceivedSrp step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -257,6 +292,7 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP03, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -282,6 +318,7 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EAConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP04, "Into EAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -297,6 +334,7 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EASuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP05, "Into EASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -313,6 +351,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP06, "Into EDefaultRoles step...\n");
 			
 			if ( --iHNPCounter >= 0)
 				{
@@ -345,6 +384,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP07, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -359,6 +399,7 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP08, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -367,6 +408,7 @@
 			
 			// issue HNP
 			test.Printf(_L("VBus present, attempting a swap.\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP09, "VBus present, attempting a swap.\n");
 			iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 
 			err = otgBusRequest();	//	Request the host role
@@ -374,6 +416,7 @@
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d\n"),err);
+				OstTrace1(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP10, "BusRequest returned %d\n",err);
 				return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}
 		
@@ -438,6 +481,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,6 +24,10 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0682.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0682Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -36,7 +40,10 @@
 
 CTestCase0682* CTestCase0682::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_NEWL);
+	    }
 	CTestCase0682* self = new (ELeave) CTestCase0682(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -49,7 +56,10 @@
 : 	CTestCaseB2BRoot(KTestCaseId, aHost, iStatus),
 	iFirstRoleSwap(ETrue)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_CTESTCASE0682);
+	    }
 		
 	} 
 
@@ -59,7 +69,10 @@
 */
 void CTestCase0682::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -69,7 +82,10 @@
 
 CTestCase0682::~CTestCase0682()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_DCTESTCASE0682);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -77,7 +93,10 @@
 
 void CTestCase0682::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -87,7 +106,10 @@
 	
 void CTestCase0682::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -98,16 +120,24 @@
 	if (gTestRoleMaster)
 		{ // "B" device
 		test.Printf(_L("***** Important note *****\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS, "***** Important note *****\n");
 		test.Printf(_L("Before commencing test, please\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP01, "Before commencing test, please\n");
 		test.Printf(_L("insert 'B'-cable end and activate\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP02, "insert 'B'-cable end and activate\n");
 		test.Printf(_L("the test on the 'A' device.\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP03, "the test on the 'A' device.\n");
 		test.Printf(_L("Then, press any key to continue.\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP04, "Then, press any key to continue.\n");
 		test.Printf(_L("**************************\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP05, "**************************\n");
 		}
 	else
 		{
 		test.Printf(KInsertACablePrompt);
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP06, KInsertACablePrompt);
 		test.Printf(KPressAnyKeyToContinue);
+		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP07, KPressAnyKeyToContinue);
 		}
 
 	RequestCharacter();	
@@ -116,7 +146,10 @@
 // handle event completion	
 void CTestCase0682::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0682_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -167,6 +200,7 @@
 		case EPerformSrp:
 			{
 			test.Printf(_L("Into EPerformSrp step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP01, "Into EPerformSrp step...\n");
 
 			if (gTestRoleMaster)
 				{
@@ -200,6 +234,7 @@
 		case EAReceivedSrp:		//	A-Device step only!
 			{
 			test.Printf(_L("Into EAReceivedSrp step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP02, "Into EAReceivedSrp step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -228,6 +263,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP03, "Into EDefaultRoles step...\n");
 			
 			if ( --iHNPCounter >= 0)
 				{
@@ -260,6 +296,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP04, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -274,6 +311,7 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP05, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -292,6 +330,7 @@
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
+					OstTrace1(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP06, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 				}
@@ -309,6 +348,7 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP07, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -334,6 +374,7 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillAConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP08, "Into EWaitTillAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -349,6 +390,7 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillASuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP09, "Into EWaitTillASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -416,6 +458,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP10, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,6 +25,10 @@
 //#include "testcasewd.h"
 #include "b2bwatchers.h"
 #include "testcase0683.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0683Traces.h"
+#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -38,7 +42,10 @@
 
 CTestCase0683* CTestCase0683::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_NEWL);
+	    }
 	CTestCase0683* self = new (ELeave) CTestCase0683(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -50,7 +57,10 @@
 CTestCase0683::CTestCase0683(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_CTESTCASE0683);
+	    }
 		
 	} 
 
@@ -60,7 +70,10 @@
 */
 void CTestCase0683::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -70,7 +83,10 @@
 
 CTestCase0683::~CTestCase0683()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_DCTESTCASE0683);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -78,7 +94,10 @@
 
 void CTestCase0683::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -88,7 +107,10 @@
 	
 void CTestCase0683::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -97,7 +119,10 @@
 // handle event completion	
 void CTestCase0683::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0683_RUNSTEPL);
+	    }
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -181,6 +206,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP01, "Into EDefaultRoles step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -229,6 +255,7 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP02, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -243,6 +270,7 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP03, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -253,12 +281,14 @@
 				{			
 				// issue bus request to trigger HNP
 				test.Printf(_L("VBus present, attempting a swap.\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP04, "VBus present, attempting a swap.\n");
 				iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 
 				err = otgBusRequest();	//	Request the host role
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
+					OstTrace1(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP05, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 			
@@ -279,6 +309,7 @@
 		case EAIdleHostPriorToAPeripheral:	//	an "A-Device only" step
 			{
 			test.Printf(_L("Into EAIdleHostPriorToAPeripheral step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP06, "Into EAIdleHostPriorToAPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -296,6 +327,7 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP07, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -321,6 +353,7 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EAConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP08, "Into EAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -337,6 +370,7 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EASuspended step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP09, "Into EASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -354,6 +388,7 @@
 		case EAIdleHostPriorToVBusDown:
 			{
 			test.Printf(_L("Into EAIdleHostPriorToVBusDown step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP10, "Into EAIdleHostPriorToVBusDown step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -422,6 +457,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0684.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0684.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,6 +25,10 @@
 //#include "testcasewd.h"
 #include "b2bwatchers.h"
 #include "testcase0684.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase0684Traces.h"
+#endif
 
 #include <e32debug.h> 
 
@@ -40,7 +44,10 @@
 
 CTestCase0684* CTestCase0684::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0684_NEWL);
+	    }
 	CTestCase0684* self = new (ELeave) CTestCase0684(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -52,7 +59,10 @@
 CTestCase0684::CTestCase0684(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0684_CTESTCASE0684);
+	    }
 		
 	} 
 
@@ -62,7 +72,10 @@
 */
 void CTestCase0684::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0684_CONSTRUCTL);
+	    }
 
 	iDualRoleCase = ETrue;
 	iBusRequestCounter = 2;
@@ -74,7 +87,10 @@
 
 CTestCase0684::~CTestCase0684()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0684_DCTESTCASE0684);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -82,7 +98,10 @@
 
 void CTestCase0684::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0684_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -91,13 +110,19 @@
 	
 void CTestCase0684::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0684_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
 void CTestCase0684::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE0684_RUNSTEPL);
+	    }
 	
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -161,6 +186,7 @@
 		case EReadyToRaiseVBus:
 			{
 			test.Printf(_L("Into EReadyToRaiseVBus step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP01, "Into EReadyToRaiseVBus step...\n");
 			
 			if (gTestRoleMaster)
 				{
@@ -199,6 +225,7 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP02, "Into EDefaultRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -221,6 +248,7 @@
 		case EAIdleHostPriorToAPeripheral:	//	an "A-Device only" step
 			{
 			test.Printf(_L("Into EAIdleHostPriorToAPeripheral step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP03, "Into EAIdleHostPriorToAPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -240,10 +268,11 @@
 		case EBConfigured:
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP04, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
-				RDebug::Print(_L("Timeout"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP05, "Timeout");
 				return TestFailed(KErrAbort, _L("Timeout"));
 				}
 			iCollector.AddRequiredNotification(EWatcherPeripheralState, EUsbcDeviceStateSuspended);
@@ -255,15 +284,17 @@
 		case EBSuspended:
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));					
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP06, "Into EBSuspended step...\n");					
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
-				RDebug::Print(_L("Timeout"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP07, "Timeout");
 				return TestFailed(KErrAbort, _L("Timeout"));
 				}
 			
 			if(iBusRequestCounter > 0){
 				test.Printf(_L("VBus present, attempting a swap.\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP08, "VBus present, attempting a swap.\n");
 				iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 				
 				iBusRequestCounter --;
@@ -271,6 +302,7 @@
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
+					OstTrace1(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP09, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 				iCaseStep = EBToHost;
@@ -286,6 +318,7 @@
 		case EAToHost:
 			{
 			test.Printf(_L("Into EAToHost step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP10, "Into EAToHost step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -298,6 +331,7 @@
 				TUint16 val = 0;
 				GetMaxPower(val);
 				test.Printf(_L("bMaxPower= %d\n"), val);
+				OstTrace1(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP11, "bMaxPower= %d\n", val);
 				iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateAPeripheral);
 				iCaseStep = EAToPeripheral;
 			}
@@ -313,6 +347,7 @@
 		case EAToPeripheral:
 			{
 			test.Printf(_L("Into EAToPeripheral step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP12, "Into EAToPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -327,6 +362,7 @@
 		case EBToHost:
 			{
 			test.Printf(_L("Into EBToHost step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP13, "Into EBToHost step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -341,6 +377,7 @@
 		case EBToPeripheral:
 			{
 			test.Printf(_L("Into EBToPeripheral step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP14, "Into EBToPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -363,6 +400,7 @@
 		case EIdleHostPriorToVBusDown:
 			{
 			test.Printf(_L("Into EAIdleHostPriorToVBusDown step...\n"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP15, "Into EAIdleHostPriorToVBusDown step...\n");
 			
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -435,6 +473,7 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
+			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP16, "<Error> unknown test step");
 			Cancel();
 			RequestCharacter();	
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase1233.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase1233.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,11 +24,16 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase1233.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcase1233Traces.h"
+#endif
 
 #include <e32debug.h> 
 
 #define LOG_INTO_STEP(a) test.Printf(_L("\nInto Step [%S]\n\n"), &a);
 
+
 /* **************************************************************************************
  * the name below is used to add a pointer to our construction method to a pointer MAP in 
  * the class factory
@@ -38,7 +43,10 @@
 
 CTestCase1233* CTestCase1233::NewL(TBool aHost)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE1233_NEWL);
+	    }
 	CTestCase1233* self = new (ELeave) CTestCase1233(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -50,7 +58,10 @@
 CTestCase1233::CTestCase1233(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE1233_CTESTCASE1233);
+	    }
 		
 	} 
 
@@ -60,7 +71,10 @@
 */
 void CTestCase1233::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE1233_CONSTRUCTL);
+	    }
 
 	iTestVID = 0x0E22;		// Symbian
 	iTestPID = 0xF000 + 1233; // Test 1233
@@ -71,7 +85,10 @@
 
 CTestCase1233::~CTestCase1233()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE1233_DCTESTCASE1233);
+	    }
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -79,7 +96,10 @@
 
 void CTestCase1233::ExecuteTestCaseL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE1233_EXECUTETESTCASEL);
+	    }
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -88,7 +108,10 @@
 	
 void CTestCase1233::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE1233_DOCANCEL);
+	    }
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -96,7 +119,10 @@
 
 void CTestCase1233::RunStepL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASE1233_RUNSTEPL);
+	    }
 	
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -186,6 +212,7 @@
 			if ( iTestPID > 0x0108 )
 				{
 				test.Printf(_L("All VID/PID pairs done\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP01, "All VID/PID pairs done\n");
 				
 				iCaseStep = EUnloadLdd;
 				}
@@ -195,6 +222,7 @@
 					{
 					// B
 					test.Printf(_L("Setting VID/PID of 0x%04x/0x%04x\n"),iTestVID,iTestPID);
+					OstTraceExt2(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP02, "Setting VID/PID of 0x%04x/0x%04x\n",(TUint32)iTestVID,(TUint32)iTestPID);
 					
 					if (!StepChangeVidPid(iTestVID,iTestPID))
 						{
@@ -205,6 +233,7 @@
 					{
 					// A
 					test.Printf(_L("Expecting VID/PID of 0x%04x/0x%04x\n"),iTestVID,iTestPID);
+					OstTraceExt2(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP03, "Expecting VID/PID of 0x%04x/0x%04x\n",(TUint32)iTestVID,(TUint32)iTestPID);
 					}
 				
 				iCollector.ClearAllEvents();
@@ -239,6 +268,7 @@
 				{ 
 				// A device
 				test.Printf(_L("Raising VBUS for VID/PID = 0x%04x/0x%04x\n"),iTestVID,iTestPID);
+				OstTraceExt2(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP04, "Raising VBUS for VID/PID = 0x%04x/0x%04x\n",(TUint32)iTestVID,(TUint32)iTestPID);
 				
 				if ( otgBusRequest() != KErrNone )
 					{
@@ -267,11 +297,13 @@
 			if ( otgVbusPresent() )
 				{
 				test.Printf(_L("...VBUS is UP\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP05, "...VBUS is UP\n");
 				iCaseStep = EDropVBus;
 				}
 			else
 				{
 				test.Printf(_L("...VBUS is DOWN\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP06, "...VBUS is DOWN\n");
 				return TestFailed(KErrAbort, _L("Vbus did not rise - FAILED!"));
 				}
 
@@ -344,11 +376,13 @@
 			if ( otgVbusPresent() )
 				{
 				test.Printf(_L("...VBUS is UP\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP07, "...VBUS is UP\n");
 				return TestFailed(KErrAbort, _L("Vbus did not rise - FAILED!"));
 				}
 			else
 				{
 				test.Printf(_L("...VBUS is DOWN\n"));
+				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP08, "...VBUS is DOWN\n");
 				iCaseStep = ELoopToNextPID;
 				}
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcasecontroller.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcasecontroller.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -29,6 +29,10 @@
 #include "testcaseroot.h"
 #include "testcasecontroller.h"
 #include "testengine.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcasecontrollerTraces.h"
+#endif
 
 
 
@@ -93,10 +97,12 @@
 	if (err != KErrNone)
 		{
 		test.Printf(_L("<Error> Test case %lS failed\n"),&iTestCaseId);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL, "<Error> Test case %lS failed\n",iTestCaseId);
 		}
 	else
 		{
 		test.Printf(_L("Test case %lS passed\n"),&iTestCaseId);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP01, "Test case %lS passed\n",iTestCaseId);
 		}
 		
 	// Find next test to run	
@@ -104,7 +110,9 @@
 	if (err == KErrNone)
 		{
 		test.Printf(_L("\n"));	// ensures blank line between tests
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP02, "\n");	// ensures blank line between tests
 		test.Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP03, "\n");
 		test.Next(iTestCaseId);
 		
 		// run the next test here
@@ -113,12 +121,12 @@
 		}
 	else if (err == KErrNotFound)
 		{
-		RDebug::Printf("All specified test cases performed");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP04, "All specified test cases performed");
 		CActiveScheduler::Stop();
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
+		OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP05, "<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
 		User::Leave(err);
 		}
 	}
@@ -126,7 +134,10 @@
 	
 TInt CTestCaseController::RunError(TInt aError)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASECONTROLLER_RUNERROR);
+	    }
 	switch (aError)
 		{
 		case KErrNoMemory:
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcasefactory.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcasefactory.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,6 +26,10 @@
 #include <e32def_private.h>
 #include "TestCaseFactory.h"
 #include "debugmacros.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcasefactoryTraces.h"
+#endif
 
 
 	
@@ -49,25 +53,24 @@
 	
 void RTestFactory::RegisterTestCase(const TDesC& aTestCaseId,TCreationMethod aCreationMethod)
 	{
-	//LOG_FUNC
 	TStringIdentity key(aTestCaseId);
 	TInt err(Instance().iTestCases.Insert(key,aCreationMethod));
 	if (err != KErrNone)
 		{
 		// Log that a test case could not be registered due to err
-		RDebug::Print(_L("Test case '%S' could not be registered with test case factory"),&aTestCaseId);
+		OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE_DUP01, "Test case '%S' could not be registered with test case factory",aTestCaseId);
 		}
 	else
 		{
 		RTestFactory::TCreationMethod* creatorFunction = Instance().iTestCases.Find(key);
 		if (creatorFunction == NULL)
 			{
-			RDebug::Print(_L("<Error> Test case '%S' did not register"),&aTestCaseId);
+			OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE_DUP02, "<Error> Test case '%S' did not register",aTestCaseId);
 			ListRegisteredTestCases();
 			}
 		else
 			{
-			RDebug::Print(_L("Test case '%S' registered in factory"),&aTestCaseId);
+			OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE_DUP03, "Test case '%S' registered in factory",aTestCaseId);
 			}
 		}
 	}
@@ -87,7 +90,10 @@
  */
 void RTestFactory::GetTestID(TInt aIndex, TBuf<KTestCaseIdLength> &aTestID)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(RTESTFACTORY_GETTESTID);
+	    }
 
 	RFactoryMap::TIter it(Instance().iTestCases);
 	
@@ -127,12 +133,16 @@
  */	
 void RTestFactory::ListRegisteredTestCases(RPointerArray<HBufC> & aTestCaseNameArr)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(RTESTFACTORY_LISTREGISTEREDTESTCASES);
+	    }
 	RFactoryMap::TIter it(Instance().iTestCases);
 	TInt count(0);
 	TInt cases(Instance().iTestCases.Count());
 	
 	test.Printf(_L("------ F A C T O R Y -------\n"));
+	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01, "------ F A C T O R Y -------\n");
 	
 	it.Reset();
 	for (count=0; count<Instance().iTestCases.Count(); count++)
@@ -176,15 +186,20 @@
 	for (count=0; count<aTestCaseNameArr.Count(); count++)
 		{
 		test.Printf(_L("% 2d: %S\n"), count, aTestCaseNameArr[count]);
+		OstTraceExt2(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02, "% 2d: %S\n", count, *aTestCaseNameArr[count]);
 		}
 	
 	test.Printf(_L("----------------------------\n"));
+	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP03, "----------------------------\n");
 	}
 
 
 CTestCaseRoot* RTestFactory::CreateTestCaseL(const TDesC& aTestCaseId)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(RTESTFACTORY_CREATETESTCASEL);
+	    }
 	RTestFactory::TCreationMethod creatorFunction = NULL;
 	TInt err(KErrNone);
 	TStringIdentity key(aTestCaseId);
@@ -193,12 +208,12 @@
 	if (err != KErrNone)
 		{
 		// Test case is not present in the factory therefore test cannot support specified test case
-		RDebug::Print(_L("<Error %d> Test case '%S' not supported"),err,&aTestCaseId);
+		OstTraceExt2(TRACE_NORMAL, RTESTFACTORY_CREATETESTCASEL_DUP01, "<Error %d> Test case '%S' not supported",err,aTestCaseId);
 		ListRegisteredTestCases();
 		User::Leave(err);
 		}
 
-	RDebug::Print(_L("Creating test case '%S'"),&aTestCaseId);
+	OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_CREATETESTCASEL_DUP02, "Creating test case '%S'",aTestCaseId);
 		
 	// Call the creator function to create the test case object
 	return creatorFunction(gSemiAutomated);
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcaseroot.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcaseroot.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -29,6 +29,10 @@
 #include <d32otgdi.h>		// OTGDI header
 #include <d32usbc.h>		// USBCC header
 #include "testcaseroot.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcaserootTraces.h"
+#endif
 
 /* Implemention of classes CTestCaseRoot, CTestCaseB2BRoot
  *
@@ -48,17 +52,24 @@
 	
 void CTestCaseRoot::BaseConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_BASECONSTRUCTL);
+	    }
 	
 
 	TInt err(iTimer.CreateLocal());
 	if (err == KErrNone)
 		{
 		LOG_VERBOSE1(_L("Test case timer created"));
+		if(gVerboseOutput)
+		    {
+		    OstTrace0(TRACE_VERBOSE, CTESTCASEROOT_BASECONSTRUCTL_DUP01, "Test case timer created");
+		    }
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Test case timer could not be created",err);
+		OstTrace1(TRACE_NORMAL, CTESTCASEROOT_BASECONSTRUCTL_DUP02, "<Error %d> Test case timer could not be created",err);
 		User::Leave(err);
 		}
 	//
@@ -69,17 +80,24 @@
 	
 CTestCaseRoot::~CTestCaseRoot()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_DCTESTCASEROOT);
+	    }
 	Cancel();
 	}
 
 // utility GUI methods
 void CTestCaseRoot::DisplayTestCaseOptions()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_DISPLAYTESTCASEOPTIONS);
+	    }
 
 	// commonly overridden to display any options for that test
 	test.Printf(_L("Press <ESC> to end the test.\n"));	
+	OstTrace0(TRACE_NORMAL, CTESTCASEROOT_DISPLAYTESTCASEOPTIONS_DUP01, "Press <ESC> to end the test.\n");	
 	}
 
     
@@ -100,7 +118,10 @@
 
 void CTestCaseRoot::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_DOCANCEL);
+	    }
 	}
 
     
@@ -116,7 +137,10 @@
     
 void CTestCaseRoot::ProcessEngineKey(TKeyCode &aKey)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_PROCESSENGINEKEY);
+	    }
 	
 	if (EKeyEscape == aKey)
 		{
@@ -135,7 +159,10 @@
 
 void CTestCaseRoot::RequestCharacter()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_REQUESTCHARACTER);
+	    }
 	  // A request is issued to the CConsoleBase to accept a
 	  // character from the keyboard.
 
@@ -149,7 +176,10 @@
 
 void CTestCaseRoot::RunL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_RUNL);
+	    }
 	TInt complCode(iStatus.Int());
 	if (iRequestedChar)
 		{
@@ -175,8 +205,16 @@
 		TInt currentStep(GetStepIndex());
 		PreRunStep();
 		LOG_VERBOSE2(_L("\n<< RunStepL() step=%d\n"), currentStep);
+		if(gVerboseOutput)
+		    {
+		    OstTrace1(TRACE_VERBOSE, CTESTCASEROOT_RUNL_DUP01, "\n<< RunStepL() step=%d\n", currentStep);
+		    }
 		RunStepL();
 		LOG_VERBOSE3(_L(">> RunStepL() step=%d->%d\n"), currentStep, GetStepIndex());
+		if(gVerboseOutput)
+		    {
+		    OstTraceExt2(TRACE_VERBOSE, CTESTCASEROOT_RUNL_DUP02, ">> RunStepL() step=%d->%d\n", currentStep, GetStepIndex());
+		    }
 		PostRunStep();
 		}
 	}
@@ -194,8 +232,12 @@
 
 TInt CTestCaseRoot::RunError(TInt aError)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_RUNERROR);
+	    }
 	test.Printf(_L("Test case C%lS::RunL left with %d"), &iTestCaseId, aError);
+	OstTraceExt2(TRACE_NORMAL, CTESTCASEROOT_RUNERROR_DUP01, "Test case C%lS::RunL left with %d", iTestCaseId, aError);
 	AssertionFailed(aError, _L("RunError"));
 	return KErrNone;
 	}
@@ -224,15 +266,23 @@
 
 void CTestCaseRoot::TestFailed(TInt aFailResult, const TDesC &aErrorDescription)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTFAILED);
+	    }
 	iTestResult = aFailResult;
 	test.Printf(_L("Test %S\n"), &TestCaseId());
+	OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP01, "Test %S\n", TestCaseId());
 	test.Printf(_L("Failed (%d)\n"), aFailResult);
+	OstTrace1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP02, "Failed (%d)\n", aFailResult);
 	test.Printf(_L("%S!\n"), &aErrorDescription);
+	OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP03, "%S!\n", aErrorDescription);
 	if (!iAutomated)
 		{
 		test.Printf(_L("\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP04, "\n");
 		test.Printf(KPressAnyKeyToContinue);
+		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP05, KPressAnyKeyToContinue);
 		iConsole->Getch();
 		}
 	// the next call panics the framework!
@@ -242,13 +292,21 @@
 	
 void CTestCaseRoot::TestFailed2(TInt aFailResult, const TDesC &aErrorDescription, TInt errorCode)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTFAILED2);
+	    }
 	iTestResult = aFailResult;
 	test.Printf(_L("Test %S FAILED %d '%S %d'!\n"), 
 	            &TestCaseId(), 
 	            aFailResult, 
 	            &aErrorDescription, 
 	            errorCode);
+	OstTraceExt4(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED2_DUP01, "Test %S FAILED %d '%S %d'!\n", 
+	            TestCaseId(), 
+	            aFailResult, 
+	            aErrorDescription, 
+	            errorCode);
 	// the next call panics the framework!
 	TestPolicy().SignalTestComplete(iTestResult);
 	}
@@ -257,7 +315,10 @@
 	
 void CTestCaseRoot::TestPassed()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTPASSED);
+	    }
 	iTestResult = KErrNone;
 	TestPolicy().SignalTestComplete(iTestResult);
 	}
@@ -285,9 +346,11 @@
 	if (gVerboseOutput) 
 		{
 		test.Printf(_L("--------------\n %S "), &aStepName);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_PRINTSTEPNAME, "--------------\n %S ", aStepName);
 		// B2B class method dumps the engine state
 		//
 		test.Printf(_L("\n--------------\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_PRINTSTEPNAME_DUP01, "\n--------------\n");
 		}
 	}
 
@@ -298,14 +361,20 @@
 CTestCaseB2BRoot::CTestCaseB2BRoot(const TDesC& aTestCaseId, TBool aHost, TRequestStatus &aStatus) 
 	: CTestCaseRoot(aTestCaseId, aHost) , iCollector(aStatus)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_CTESTCASEB2BROOT);
+	    }
 	
 	}
 
 
 CTestCaseB2BRoot::~CTestCaseB2BRoot()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_DCTESTCASEB2BROOT);
+	    }
 	
 	}
 
@@ -316,6 +385,7 @@
 	if (gVerboseOutput) 
 		{
 		test.Printf(_L("--------------\n %S "), &aStepName);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASEB2BROOT_PRINTSTEPNAME, "--------------\n %S ", aStepName);
 		// engine state
 		CNotifyWatcherBase *pWatcher = iCollector.GetWatcher(EWatcherState);
 		if (pWatcher)
@@ -325,8 +395,13 @@
 			
 			OtgStateString(aState, aDescription);
 			LOG_VERBOSE3(_L("OTGState %d '%S' \n"), aState, &aDescription);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt2(TRACE_VERBOSE, CTESTCASEB2BROOT_PRINTSTEPNAME_DUP01, "OTGState %d '%S' \n", aState, aDescription);
+			    }
 			}
 		test.Printf(_L(" : time = %dms\n--------------\n"), iCollector.DurationElapsed());
+		OstTrace1(TRACE_NORMAL, CTESTCASEB2BROOT_PRINTSTEPNAME_DUP02, " : time = %dms\n--------------\n", iCollector.DurationElapsed());
 		}
 	}
 
@@ -335,10 +410,17 @@
 void CTestCaseB2BRoot::DescribePreconditions()
 	{
 	test.Printf(KTestTypeB2BMsg); // B2B
+	OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS, KTestTypeB2BMsg); // B2B
 	if (gTestRoleMaster)
+	   {
 		test.Printf(KRoleMasterMsg);
+		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP01, KRoleMasterMsg);
+		}
 	else
+	    {
 		test.Printf(KRoleSlaveMsg);
+		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP02, KRoleSlaveMsg);
+		}
 	}
 
 
@@ -348,10 +430,12 @@
 	if (gTestRoleMaster)
 		{ // "B" device
 		test.Printf(KInsertBCablePrompt);
+		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS, KInsertBCablePrompt);
 		}
 	else
 		{
 		test.Printf(KInsertACablePrompt);
+		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP01, KInsertACablePrompt);
 		}
 	if (iAutomated)
 		{
@@ -360,6 +444,7 @@
 		return;
 		}
 	test.Printf(KPressAnyKeyToContinue);
+	OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP02, KPressAnyKeyToContinue);
 	RequestCharacter();	
 	}
 
@@ -373,6 +458,7 @@
 		if (otgIdPinPresent())
 			{ // oops
 			test.Printf(KMsgErrorPreconditionFailed);
+			OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_CHECKROLECONNECTIONS, KMsgErrorPreconditionFailed);
 			return TestFailed(KErrAbort, KMsgBPlugNotFound);
 			}
 		}
@@ -381,6 +467,7 @@
 		if (!otgIdPinPresent())
 			{ // oops
 			test.Printf(KMsgErrorPreconditionFailed);
+			OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_CHECKROLECONNECTIONS_DUP01, KMsgErrorPreconditionFailed);
 			return TestFailed(KErrAbort, KMsgAPlugNotFound);
 			}
 		}
@@ -392,7 +479,10 @@
  */
 void CTestCaseB2BRoot::PreRunStep()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_PRERUNSTEP);
+	    }
 		
 		iCollector.ClearAllEvents(EFalse, ETrue);
 	}
@@ -400,7 +490,10 @@
 
 void CTestCaseB2BRoot::PostRunStep()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_POSTRUNSTEP);
+	    }
 		// clear the recieved event Q, but not the expected Q
 		iCollector.ClearAllEvents(ETrue, EFalse);
 	
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcasewd.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcasewd.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,6 +26,10 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "TestCasewd.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testcasewdTraces.h"
+#endif
 
 
 
@@ -71,7 +75,10 @@
 void CTestCaseWatchdog::RunL()
 // Timer request has completed, so notify the timer's owner that we timed out
     {
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTCASEWATCHDOG_RUNL);
+	    }
 	__ASSERT_ALWAYS(iCancelFriendFunc, User::Panic(KMsgWatchdogPanicd, EPanicWatchdogError));
 	__ASSERT_ALWAYS(iThisPointer, User::Panic(KMsgWatchdogPanicd, EPanicWatchdogError));
 	(*iCancelFriendFunc)(iThisPointer);
@@ -85,6 +92,10 @@
 		WDCancellerMethod cancelMethod)
 	{
 	LOG_VERBOSE2(_L("Watchdogging this step for %d ms\n"), aWatchdogIntervalMS);
+	if(gVerboseOutput)
+	    {
+	    OstTrace1(TRACE_VERBOSE, CTESTCASEWATCHDOG_ISSUEREQUEST, "Watchdogging this step for %d ms\n", aWatchdogIntervalMS);
+	    }
 	if (IsValid())
 		{
 		Cancel();
@@ -108,6 +119,7 @@
 		{
 		
 		test.Printf(_L("CTestCaseWatchdog obj not properly constructed!\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASEWATCHDOG_ISVALID, "CTestCaseWatchdog obj not properly constructed!\n");
 		return(EFalse);
 		}
 	return(ETrue);	
--- a/kerneltest/e32test/usbho/t_otgdi/src/testengine.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testengine.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -29,6 +29,10 @@
 #include "TestCaseController.h"
 #include "TestCaseFactory.h"
 #include "TestCaseRoot.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testengineTraces.h"
+#endif
 
 // Console application parameter options
 _LIT(KArgAllTestCases,"/ALL");			// see default test-list below
@@ -80,7 +84,10 @@
 
 CTestEngine::~CTestEngine()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTENGINE_DCTESTENGINE);
+	    }
 	// Destroy the test case controller
 	if (iTestCaseController)
 		{
@@ -94,15 +101,21 @@
 	
 void CTestEngine::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTENGINE_CONSTRUCTL);
+	    }
 	TInt menuSelection(0);
 
 	// Display information 
 	test.Title();
 	test.Start(_L("Test Engine Initiation v2.00 "));
 	test.Printf(_L(">>\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP01, ">>\n");
 	test.Printf(_L(">>   T E S T   R U N \n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP02, ">>   T E S T   R U N \n");
 	test.Printf(_L(">>\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP03, ">>\n");
 	
 
 	// Process the command line parameters for batch/etc
@@ -131,7 +144,9 @@
 		iTestCasesIdentities.ResetAndDestroy();
 		
 		test.Printf(_L("Please select 0 to %d\n"), RTestFactory::TestCaseCount()-1);
+		OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP04, "Please select 0 to %d\n", RTestFactory::TestCaseCount()-1);
 		test.Printf(_L("or 99<ENTER> to exit\n"));
+		OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP05, "or 99<ENTER> to exit\n");
 		GetNumericInput(menuSelection);
 		if ((menuSelection >=0) &&(menuSelection < RTestFactory::TestCaseCount()))
 			{
@@ -153,6 +168,7 @@
 		{
 		// Create the test case controller
 		test.Printf(_L("Creating the test controller\n"));
+		OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP06, "Creating the test controller\n");
 		iTestCaseController = CTestCaseController::NewL(*this, ETrue);
 		
 		// Test-engine is non CActive class
@@ -161,6 +177,7 @@
 		{
 		// nothing to do, exit. USER aborted
 		test.Printf(_L("Test run stopped by user, nothing to do.\n"));
+		OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP07, "Test run stopped by user, nothing to do.\n");
 		User::Leave(-2);
 		}
 	}
@@ -171,18 +188,31 @@
 void CTestEngine::PrintUsage()
 	{
 	test.Printf(_L("OTGDI Unit Test Suite.\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE, "OTGDI Unit Test Suite.\n");
 	test.Printf(_L("Usage : t_otgdi.exe [/option] /G:<TESTNUM1>\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP01, "Usage : t_otgdi.exe [/option] /G:<TESTNUM1>\n");
 	test.Printf(_L("  /ALL = add default test subset to List\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP02, "  /ALL = add default test subset to List\n");
 	test.Printf(_L("  /G:<TESTNUM>  where <testname> is the test# to add \n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP03, "  /G:<TESTNUM>  where <testname> is the test# to add \n");
 	test.Printf(_L("  /AUTO  = largely unattended operation\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP04, "  /AUTO  = largely unattended operation\n");
 	test.Printf(_L("  /VERBOSE = test debugging info\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP05, "  /VERBOSE = test debugging info\n");
 	test.Printf(_L("  /LOOPO:<n> = Open/close repeat counter<n>\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP06, "  /LOOPO:<n> = Open/close repeat counter<n>\n");
 	test.Printf(_L("  /LOOPM:<n> = OOM HEAP_ALLOCS counter<n>\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP07, "  /LOOPM:<n> = OOM HEAP_ALLOCS counter<n>\n");
 	test.Printf(_L("  /SLAVE = Test-peer server mode\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP08, "  /SLAVE = Test-peer server mode\n");
 	test.Printf(_L("  /PID:<n> = USB VID/PID in hex eg 2670\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP09, "  /PID:<n> = USB VID/PID in hex eg 2670\n");
 	test.Printf(_L("Valid test ID range 0456...0469\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP10, "Valid test ID range 0456...0469\n");
 	test.Printf(_L("and 0675...0684 .\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP11, "and 0675...0684 .\n");
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP12, "\n");
 	}
 	
 /** process the command-line, ; arguments appear in any order
@@ -238,6 +268,7 @@
 			{
 			// skip some of the press-any key things
 			test.Printf(_L("Test semi-automated mode.\n"));
+			OstTrace0(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL, "Test semi-automated mode.\n");
 			gSemiAutomated = ETrue;
 			tokenParsed = ETrue;
 			}
@@ -250,6 +281,10 @@
 			TPtrC testID = tc->Right(tc->Length() - pos - KArgGoTestCase().Length());
 
 			LOG_VERBOSE2(_L("Parameter found:'%S'\n"), &testID);
+			if(gVerboseOutput)
+			    {
+			    OstTraceExt1(TRACE_VERBOSE, CTESTENGINE_PROCESSCOMMANDLINEL_DUP01, "Parameter found:'%S'\n", testID);
+			    }
 
 			// Check if it is a test we know of in our suite, users may provide the full  
 			// name "PBASE-USB_OTGDI-0466", or just the last 4 digits "0466", in such cases, fetch the full name
@@ -263,6 +298,7 @@
 					{
 					
 					test.Printf(_L("Test case does NOT Exist: '%lS'\n"), &testID);
+					OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP02, "Test case does NOT Exist: '%lS'\n", testID);
 					}
 				else
 					{ // only the number was supplied, copy the full name
@@ -275,6 +311,7 @@
 				HBufC* testIdentity = HBufC::NewLC(KTestCaseIdLength);
 				*testIdentity = testID;
 				test.Printf(_L("Test case specified: %lS\n"), testIdentity);
+				OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP03, "Test case specified: %lS\n", *testIdentity);
 
 				iTestCasesIdentities.Append(testIdentity);
 				CleanupStack::Pop(testIdentity);
@@ -332,12 +369,17 @@
 					prodID = 0xFFFF;
 				tokenParsed = ETrue;
 				LOG_VERBOSE2(_L(" accept param %04X \n\n"), prodID);
+				if(gVerboseOutput)
+				    {
+				    OstTrace1(TRACE_VERBOSE, CTESTENGINE_PROCESSCOMMANDLINEL_DUP05, " accept param %04X \n\n", prodID);
+				    }
 				gUSBVidPid = prodID; // replace the vid-pid with the user-supplied one 
 				}
 			else
 				{
 				// print error
 				test.Printf(_L("Warning: VID+PID '%lS' not parsed .\n"), tc);
+				OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP06, "Warning: VID+PID '%lS' not parsed .\n", *tc);
 				}
 			}
 		
@@ -360,6 +402,7 @@
 			{
 			// warn about unparsed parameter
 			test.Printf(_L("Warning: '%lS'??? not parsed\n"), tc);
+			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP07, "Warning: '%lS'??? not parsed\n", *tc);
 			iHelpRequested = ETrue;
 			}
 			
@@ -376,6 +419,7 @@
 void CTestEngine::AddAllDefaultTests()
 	{
 	test.Printf(_L("Adding default set test cases\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_ADDALLDEFAULTTESTS, "Adding default set test cases\n");
 	//
 	TInt index(0);
 	while (index < sizeof(KAllDefaultTestIDs)/sizeof(KAllDefaultTestIDs[0]))
@@ -430,6 +474,7 @@
 		if ( ( key >= '0' ) && ( key <= '9' ) )
 			{
 			test.Printf(_L("%c"),key);
+			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_GETNUMERICINPUT, "%c",key);
 			
 			value = ( 10 * value ) + ( key - '0' );
 			digits++;
@@ -440,6 +485,7 @@
 				value = value/10;
 				digits--;
 				test.Printf(_L("\r    \r%d"), value);
+				OstTrace1(TRACE_NORMAL, CTESTENGINE_GETNUMERICINPUT_DUP01, "\r    \r%d", value);
 				}
 			}
 		}
@@ -449,6 +495,7 @@
 		aNumber = value;
 		}
 	test.Printf(_L("\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_GETNUMERICINPUT_DUP02, "\n");
 	}
 
 
@@ -458,19 +505,25 @@
 	{
 	TBuf<KTestCaseIdLength> aTestCaseId;
 	test.Printf(_L("============================\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_REPORT, "============================\n");
 	test.Printf(_L("PASSED TESTS:\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_REPORT_DUP01, "PASSED TESTS:\n");
 	// itterate our list of tests to perform
 	ResetTestCaseIndex();
 	while (KErrNone == NextTestCaseId(aTestCaseId))
 		{
 		test.Printf(_L("%S\n"), &aTestCaseId);
+		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_REPORT_DUP02, "%S\n", aTestCaseId);
 		}
 	}
 	
 	
 void CTestEngine::DoCancel()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CTESTENGINE_DOCANCEL);
+	    }
 	test.Console()->ReadCancel();	
 	}
 		
--- a/kerneltest/e32test/usbho/t_otgdi/src/testpolicy.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testpolicy.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,6 +26,10 @@
 #include "testcaseroot.h"
 #include "testpolicy.h"
 #include "testcasefactory.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testpolicyTraces.h"
+#endif
 
 
 
@@ -49,7 +53,10 @@
 		
 void CBasicTestPolicy::ConstructL()
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CBASICTESTPOLICY_CONSTRUCTL);
+	    }
 
 	}
 	
@@ -70,7 +77,10 @@
  */
 void CBasicTestPolicy::RunTestCaseL(const TDesC& aTestCaseId, TRequestStatus* aNotifierStatus)
 	{
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CBASICTESTPOLICY_RUNTESTCASEL);
+	    }
 	iNotifierStatus = aNotifierStatus;
 	// delete previous test run
 	if (iTestCase)
@@ -122,7 +132,10 @@
 	
 void CBasicTestPolicy::RunL()
 	{ 
-	LOG_FUNC
+	if(gVerboseOutput)
+	    {
+	    OstTraceFunctionEntry0(CBASICTESTPOLICY_RUNL);
+	    }
 	
 	}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,747 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[GROUP]TRACE_VERBOSE=0xde
+[GROUP]TRACE_WARNING=0x83
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CONSTRUCTL=0xf2
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNL=0xf4
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNTESTCASEL=0xf3
+[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_CNOTIFYCOLLECTOR=0x1
+[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_COMPLETESTEP_DUP01=0x5
+[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_CREATEOBSERVERSL=0x3
+[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_DCNOTIFYCOLLECTOR=0x2
+[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_DESTROYOBSERVERS=0x4
+[TRACE]TRACE_FLOW[0x8A]_COTGMESSAGEWATCHER_NEWL=0x9
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGACTIVATEOPTTESTMODE=0xe
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSCLEARERROR=0x14
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSDROP=0x13
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSREQUEST=0x11
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSRESPONDSRP=0x12
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGCANCELOTGIDPINNOTIFICATION=0x16
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGCANCELOTGVBUSNOTIFICATION=0x18
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGCLOSE=0xd
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGIDPINPRESENT=0x19
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGLOADLDD=0xb
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGOPEN=0xc
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGQUEUEOTGIDPINNOTIFICATION=0x15
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGQUEUEOTGVBUSNOTIFICATION=0x17
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGSTARTSTACKS=0xf
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGSTOPSTACKS=0x10
+[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGVBUSPRESENT=0x1a
+[TRACE]TRACE_FLOW[0x8A]_COTGSTATEWATCHER_NEWL=0xa
+[TRACE]TRACE_FLOW[0x8A]_COTGWATCHDOGWATCHER_CONSTRUCTL=0x6
+[TRACE]TRACE_FLOW[0x8A]_COTGWATCHDOGWATCHER_STARTTIMER=0x8
+[TRACE]TRACE_FLOW[0x8A]_COTGWATCHDOGWATCHER_STEPEXPIRED=0x7
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_CONSTRUCTL=0x1f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_CTESTCASE0456=0x1e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_DCTESTCASE0456=0x20
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_DOCANCEL=0x22
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_EXECUTETESTCASEL=0x21
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_NEWL=0x1d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_RUNSTEPL=0x23
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_CONSTRUCTL=0x26
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_CTESTCASE0457=0x25
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_DCTESTCASE0457=0x27
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_DOCANCEL=0x29
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_EXECUTETESTCASEL=0x28
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_NEWL=0x24
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_RUNSTEPL=0x2a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_CONSTRUCTL=0x2b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_DCTESTCASE0458=0x2c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_DOCANCEL=0x2e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_EXECUTETESTCASEL=0x2d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_RUNSTEPL=0x2f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_CONSTRUCTL=0x32
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_CTESTCASE0459=0x31
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_DCTESTCASE0459=0x33
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_DOCANCEL=0x35
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_EXECUTETESTCASEL=0x34
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_NEWL=0x30
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_RUNSTEPL=0x36
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_CONSTRUCTL=0x39
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_CTESTCASE0460=0x38
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_DCTESTCASE0460=0x3a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_DOCANCEL=0x3c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_EXECUTETESTCASEL=0x3b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_NEWL=0x37
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_RUNSTEPL=0x3d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_CONSTRUCTL=0x40
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_CTESTCASE0461=0x3f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_DCTESTCASE0461=0x41
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_DOCANCEL=0x43
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_EXECUTETESTCASEL=0x42
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_NEWL=0x3e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_RUNSTEPL=0x44
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_CONSTRUCTL=0x47
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_CTESTCASE0462=0x46
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_DCTESTCASE0462=0x48
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_DOCANCEL=0x4a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_EXECUTETESTCASEL=0x49
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_NEWL=0x45
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_RUNSTEPL=0x4b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_CONSTRUCTL=0x4e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_CTESTCASE0463=0x4d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_DCTESTCASE0463=0x4f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_DOCANCEL=0x51
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_EXECUTETESTCASEL=0x50
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_NEWL=0x4c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_RUNSTEPL=0x52
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_CONSTRUCTL=0x55
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_CTESTCASE0464=0x54
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_DCTESTCASE0464=0x56
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_DOCANCEL=0x58
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_EXECUTETESTCASEL=0x57
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_NEWL=0x53
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_RUNSTEPL=0x59
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_CONSTRUCTL=0x5c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_CTESTCASE0465=0x5b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_DCTESTCASE0465=0x5d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_DOCANCEL=0x5f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_EXECUTETESTCASEL=0x5e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_NEWL=0x5a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_RUNSTEPL=0x60
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_CONSTRUCTL=0x63
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_CTESTCASE0466=0x62
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_DCTESTCASE0466=0x64
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_DOCANCEL=0x66
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_EXECUTETESTCASEL=0x65
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_NEWL=0x61
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_RUNSTEPL=0x67
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_CANCELIDPIN=0x6e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_CONSTRUCTL=0x6a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_CTESTCASE0467=0x69
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_DCTESTCASE0467=0x6b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_DOCANCEL=0x6d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_EXECUTETESTCASEL=0x6c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_NEWL=0x68
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_RUNSTEPL=0x6f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CANCELKB=0x76
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CANCELNOTIFY=0x77
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CONSTRUCTL=0x72
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CTESTCASE0468=0x71
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_DCTESTCASE0468=0x73
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_DOCANCEL=0x75
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_EXECUTETESTCASEL=0x74
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_NEWL=0x70
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_RUNSTEPL=0x78
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_CONSTRUCTL=0x7b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_CTESTCASE0469=0x7a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_DCTESTCASE0469=0x7c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_DOCANCEL=0x7e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_EXECUTETESTCASEL=0x7d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_NEWL=0x79
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_RUNSTEPL=0x7f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_CTESTCASE0670=0x81
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_DOCANCEL=0x82
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_NEWL=0x80
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_RUNSTEPL=0x83
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_CTESTCASE0671=0x85
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_DOCANCEL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_NEWL=0x84
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_RUNSTEPL=0x87
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CANCELKB=0x8e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CANCELNOTIFY=0x8f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CONSTRUCTL=0x8a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CTESTCASE0675=0x89
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_DCTESTCASE0675=0x8b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_DOCANCEL=0x8d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_EXECUTETESTCASEL=0x8c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_NEWL=0x88
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_RUNSTEPL=0x90
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CANCELKB=0x97
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CANCELNOTIFY=0x98
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CONSTRUCTL=0x93
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CTESTCASE0676=0x92
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_DCTESTCASE0676=0x94
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_DOCANCEL=0x96
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_EXECUTETESTCASEL=0x95
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_NEWL=0x91
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_RUNSTEPL=0x99
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CANCELKB=0xa0
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CANCELNOTIFY=0xa1
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CONSTRUCTL=0x9c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CTESTCASE0677=0x9b
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_DCTESTCASE0677=0x9d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_DOCANCEL=0x9f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_EXECUTETESTCASEL=0x9e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_NEWL=0x9a
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_RUNSTEPL=0xa2
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_CONSTRUCTL=0xa5
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_CTESTCASE0678=0xa4
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_DCTESTCASE0678=0xa6
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_DOCANCEL=0xa8
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_EXECUTETESTCASEL=0xa7
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_NEWL=0xa3
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_RUNSTEPL=0xa9
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_CONSTRUCTL=0xac
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_CTESTCASE0679=0xab
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_DCTESTCASE0679=0xad
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_DOCANCEL=0xaf
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_EXECUTETESTCASEL=0xae
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_NEWL=0xaa
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_RUNSTEPL=0xb0
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_CONSTRUCTL=0xb3
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_CTESTCASE0680=0xb2
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_DCTESTCASE0680=0xb4
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_DOCANCEL=0xb6
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_EXECUTETESTCASEL=0xb5
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_NEWL=0xb1
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_RUNSTEPL=0xb7
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_CONSTRUCTL=0xba
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_CTESTCASE0681=0xb9
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_DCTESTCASE0681=0xbb
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_DOCANCEL=0xbd
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_EXECUTETESTCASEL=0xbc
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_NEWL=0xb8
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_RUNSTEPL=0xbe
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_CONSTRUCTL=0xc1
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_CTESTCASE0682=0xc0
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_DCTESTCASE0682=0xc2
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_DOCANCEL=0xc4
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_EXECUTETESTCASEL=0xc3
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_NEWL=0xbf
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_RUNSTEPL=0xc5
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_CONSTRUCTL=0xc8
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_CTESTCASE0683=0xc7
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_DCTESTCASE0683=0xc9
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_DOCANCEL=0xcb
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_EXECUTETESTCASEL=0xca
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_NEWL=0xc6
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_RUNSTEPL=0xcc
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_CONSTRUCTL=0xcf
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_CTESTCASE0684=0xce
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_DCTESTCASE0684=0xd0
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_DOCANCEL=0xd2
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_EXECUTETESTCASEL=0xd1
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_NEWL=0xcd
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_RUNSTEPL=0xd3
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_CONSTRUCTL=0xd6
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_CTESTCASE1233=0xd5
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_DCTESTCASE1233=0xd7
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_DOCANCEL=0xd9
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_EXECUTETESTCASEL=0xd8
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_NEWL=0xd4
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_RUNSTEPL=0xda
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_CTESTCASEB2BROOT=0xea
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_DCTESTCASEB2BROOT=0xeb
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_POSTRUNSTEP=0xed
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_PRERUNSTEP=0xec
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNERROR=0xdb
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_BASECONSTRUCTL=0xdf
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_DCTESTCASEROOT=0xe0
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_DISPLAYTESTCASEOPTIONS=0xe1
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_DOCANCEL=0xe2
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_PROCESSENGINEKEY=0xe3
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_REQUESTCHARACTER=0xe4
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_RUNERROR=0xe6
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_RUNL=0xe5
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_TESTFAILED=0xe7
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_TESTFAILED2=0xe8
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_TESTPASSED=0xe9
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASEWATCHDOG_RUNL=0xee
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CONSTRUCTL=0xf0
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DCTESTENGINE=0xef
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DOCANCEL=0xf1
+[TRACE]TRACE_FLOW[0x8A]_E32MAIN_E32MAIN=0x1c
+[TRACE]TRACE_FLOW[0x8A]_MAINL_MAINL=0x1b
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_CREATETESTCASEL=0xde
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_GETTESTID=0xdc
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_LISTREGISTEREDTESTCASES=0xdd
+[TRACE]TRACE_NORMAL[0x86]_CACONNECTIONIDLEWATCHER_DISPLAYEVENT=0xa
+[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_COMPLETESTEP=0x5
+[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_CREATEOBSERVERSL_DUP02=0x1
+[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_HANDLEEVENT=0x2
+[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_HANDLEEVENT_DUP01=0x3
+[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_HANDLEEVENT_DUP04=0x4
+[TRACE]TRACE_NORMAL[0x86]_COTGEVENTWATCHER_DISPLAYEVENT=0x8
+[TRACE]TRACE_NORMAL[0x86]_COTGMESSAGEWATCHER_DISPLAYEVENT=0x6
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR=0xe
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP01=0xf
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP02=0x10
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP03=0x11
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP04=0x12
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP05=0x13
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGCLOSE_DUP01=0xd
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGDEACTIVATEFDFACTOR=0x14
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGDEACTIVATEFDFACTOR_DUP01=0x15
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGLOADLDD_DUP02=0xb
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGOPEN_DUP02=0xc
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCHANGEVIDPID=0x24
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCHANGEVIDPID_DUP01=0x25
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCHANGEVIDPID_DUP02=0x26
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCONNECT=0x23
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPDISCONNECT=0x22
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT=0x19
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP01=0x1a
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP02=0x1b
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP03=0x1c
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP04=0x1d
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP05=0x1e
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP06=0x1f
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP07=0x20
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP08=0x21
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADLDD_DUP02=0x28
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADLDD_DUP03=0x29
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADCLIENT=0x16
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADCLIENT_DUP01=0x17
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADCLIENT_DUP02=0x18
+[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADLDD=0x27
+[TRACE]TRACE_NORMAL[0x86]_COTGSTATEWATCHER_DISPLAYEVENT_DUP01=0x7
+[TRACE]TRACE_NORMAL[0x86]_CPERIPHERALSTATEWATCHER_DISPLAYEVENT=0x9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_DESCRIBEPRECONDITIONS=0x3e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP01=0x3f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP02=0x40
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP03=0x41
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP04=0x42
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_DESCRIBEPRECONDITIONS=0x43
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP01=0x44
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP02=0x45
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP03=0x46
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP04=0x47
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_DESCRIBEPRECONDITIONS=0x48
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_DESCRIBEPRECONDITIONS_DUP01=0x49
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP01=0x4a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP02=0x4b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP03=0x4c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP04=0x4d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_DESCRIBEPRECONDITIONS=0x4e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP01=0x4f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP02=0x50
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP03=0x51
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP04=0x52
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP05=0x53
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP06=0x54
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP07=0x55
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_DESCRIBEPRECONDITIONS=0x56
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP01=0x57
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP02=0x58
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP03=0x59
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP04=0x5a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP05=0x5b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP06=0x5c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP07=0x5d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_DESCRIBEPRECONDITIONS=0x5e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP01=0x5f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP02=0x60
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP03=0x61
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP04=0x62
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP05=0x63
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP06=0x64
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP07=0x65
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP08=0x66
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP09=0x67
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_DESCRIBEPRECONDITIONS=0x68
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP01=0x69
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP02=0x6a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP03=0x6b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP04=0x6c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP05=0x6d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP06=0x6e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP07=0x6f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP08=0x70
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP09=0x71
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_DESCRIBEPRECONDITIONS=0x72
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP01=0x73
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP03=0x74
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP04=0x75
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP05=0x76
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_DESCRIBEPRECONDITIONS=0x77
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP01=0x78
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP02=0x79
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP05=0x7a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP07=0x7b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP08=0x7c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS=0x7d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP01=0x7e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP02=0x7f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP03=0x80
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP04=0x81
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP05=0x82
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP06=0x83
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP07=0x84
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP08=0x85
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP01=0x86
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP02=0x87
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP03=0x88
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP04=0x89
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP05=0x8a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP06=0x8b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP07=0x8c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP08=0x8d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP09=0x8e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP10=0x8f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP11=0x90
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP12=0x91
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP13=0x92
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP14=0x93
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP15=0x94
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP16=0x95
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS=0x96
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP01=0x97
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP02=0x98
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP03=0x99
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP04=0x9a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP05=0x9b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP06=0x9c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP07=0x9d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP08=0x9e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP09=0x9f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP10=0xa0
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP11=0xa1
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP01=0xa2
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP02=0xa3
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP03=0xa4
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP04=0xa5
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP05=0xa6
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP06=0xa7
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP07=0xa8
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP08=0xa9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP09=0xaa
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP10=0xab
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP11=0xac
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP12=0xad
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP13=0xae
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP14=0xaf
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP15=0xb0
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP16=0xb1
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP17=0xb2
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP18=0xb3
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP19=0xb4
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP20=0xb5
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_DESCRIBEPRECONDITIONS=0xb6
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_DESCRIBEPRECONDITIONS_DUP01=0xb7
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP01=0xb8
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP02=0xb9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP03=0xba
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP04=0xbb
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP06=0xbc
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP08=0xbd
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP09=0xbe
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP10=0xbf
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_DESCRIBEPRECONDITIONS=0xc0
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_DESCRIBEPRECONDITIONS_DUP01=0xc1
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP01=0xc2
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP02=0xc3
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP03=0xc4
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP04=0xc5
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP05=0xc6
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP06=0xc7
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP08=0xc8
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP01=0xc9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP02=0xca
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP03=0xcb
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP04=0xcc
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP05=0xcd
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP06=0xce
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP07=0xcf
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP08=0xd0
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP09=0xd1
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP10=0xd2
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP11=0xd3
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS=0xd4
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP01=0xd5
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP02=0xd6
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP03=0xd7
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP04=0xd8
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP05=0xd9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP06=0xda
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP01=0xdb
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP02=0xdc
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP03=0xdd
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP04=0xde
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP05=0xdf
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP06=0xe0
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP07=0xe1
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP08=0xe2
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP09=0xe3
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP10=0xe4
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP11=0xe5
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS=0xe6
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP01=0xe7
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP02=0xe8
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP03=0xe9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP04=0xea
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP05=0xeb
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP06=0xec
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP01=0xed
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP02=0xee
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP03=0xef
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP04=0xf0
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP05=0xf1
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP06=0xf2
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP07=0xf3
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP08=0xf4
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP09=0xf5
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP10=0xf6
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP11=0xf7
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_DESCRIBEPRECONDITIONS=0xf8
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP01=0xf9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP02=0xfa
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP03=0xfb
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP04=0xfc
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP05=0xfd
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP06=0xfe
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP07=0xff
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP08=0x100
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_DESCRIBEPRECONDITIONS=0x101
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP01=0x102
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP02=0x103
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP03=0x104
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP04=0x105
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP05=0x106
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP06=0x107
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP07=0x108
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS=0x109
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP01=0x10a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP02=0x10b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP03=0x10c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP01=0x10d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP02=0x10e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP03=0x10f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP04=0x110
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP05=0x111
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP06=0x112
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP08=0x113
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP09=0x114
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP10=0x115
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP12=0x116
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP13=0x117
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP14=0x118
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP15=0x119
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP01=0x11a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP02=0x11b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP03=0x11c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP04=0x11d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP05=0x11e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP06=0x11f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP07=0x120
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP08=0x121
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP09=0x122
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP01=0x123
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP02=0x124
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP03=0x125
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP04=0x126
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP05=0x127
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP06=0x128
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP07=0x129
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP08=0x12a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP01=0x12b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP02=0x12c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP03=0x12d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP04=0x12e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP05=0x12f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP06=0x130
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP07=0x131
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP08=0x132
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP01=0x13b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP02=0x13c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP03=0x13d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP04=0x13e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP05=0x13f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP06=0x140
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP07=0x141
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP08=0x142
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP09=0x143
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP10=0x144
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP11=0x145
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS=0x133
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP01=0x134
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP02=0x135
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP03=0x136
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP04=0x137
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP05=0x138
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP06=0x139
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP07=0x13a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP01=0x14e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP02=0x14f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP03=0x150
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP04=0x151
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP05=0x152
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP06=0x153
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP07=0x154
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP08=0x155
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP09=0x156
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP10=0x157
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS=0x146
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP01=0x147
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP02=0x148
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP03=0x149
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP04=0x14a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP05=0x14b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP06=0x14c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP07=0x14d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP01=0x158
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP02=0x159
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP03=0x15a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP04=0x15b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP05=0x15c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP06=0x15d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP07=0x15e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP08=0x15f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP09=0x160
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP10=0x161
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP11=0x162
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP01=0x163
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP02=0x164
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP03=0x165
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP04=0x166
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP05=0x167
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP06=0x168
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP07=0x169
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP08=0x16a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP09=0x16b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP10=0x16c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP11=0x16d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP12=0x16e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP13=0x16f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP14=0x170
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP15=0x171
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP16=0x172
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP01=0x173
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP02=0x174
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP03=0x175
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP04=0x176
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP05=0x177
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP06=0x178
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP07=0x179
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP08=0x17a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_CHECKROLECONNECTIONS=0x19c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_CHECKROLECONNECTIONS_DUP01=0x19d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS=0x196
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP01=0x197
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP02=0x198
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_PRINTSTEPNAME=0x194
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_PRINTSTEPNAME_DUP02=0x195
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_STEPB2BPRECONDITIONS=0x199
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP01=0x19a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP02=0x19b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL=0x17b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP01=0x17c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP02=0x17d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP03=0x17e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP04=0x17f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP05=0x180
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_BASECONSTRUCTL_DUP02=0x189
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_DISPLAYTESTCASEOPTIONS_DUP01=0x18a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_PRINTSTEPNAME=0x192
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_PRINTSTEPNAME_DUP01=0x193
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_RUNERROR_DUP01=0x18b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED2_DUP01=0x191
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP01=0x18c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP02=0x18d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP03=0x18e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP04=0x18f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP05=0x190
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASEWATCHDOG_ISVALID=0x19e
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_ADDALLDEFAULTTESTS=0x1b8
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP01=0x19f
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP02=0x1a0
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP03=0x1a1
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP04=0x1a2
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP05=0x1a3
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP06=0x1a4
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP07=0x1a5
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_GETNUMERICINPUT=0x1b9
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_GETNUMERICINPUT_DUP01=0x1ba
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_GETNUMERICINPUT_DUP02=0x1bb
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE=0x1a6
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP01=0x1a7
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP02=0x1a8
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP03=0x1a9
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP04=0x1aa
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP05=0x1ab
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP06=0x1ac
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP07=0x1ad
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP08=0x1ae
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP09=0x1af
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP10=0x1b0
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP11=0x1b1
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP12=0x1b2
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL=0x1b3
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP02=0x1b4
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP03=0x1b5
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP06=0x1b6
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP07=0x1b7
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_REPORT=0x1bc
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_REPORT_DUP01=0x1bd
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_REPORT_DUP02=0x1be
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x3d
+[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP01=0x38
+[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP02=0x39
+[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP03=0x3a
+[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP04=0x3b
+[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP05=0x3c
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE=0x2a
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP01=0x2b
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP02=0x2c
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP03=0x2d
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP06=0x2e
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP07=0x2f
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP08=0x30
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP09=0x31
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP10=0x32
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP11=0x33
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP12=0x34
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP13=0x35
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP14=0x36
+[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP15=0x37
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_CREATETESTCASEL_DUP01=0x187
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_CREATETESTCASEL_DUP02=0x188
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01=0x184
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02=0x185
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP03=0x186
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE_DUP01=0x181
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE_DUP02=0x182
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE_DUP03=0x183
+[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION=0x2
+[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP01=0x3
+[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP02=0x4
+[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP03=0x5
+[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP04=0x6
+[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_DESTROYOBSERVERS_DUP01=0x1
+[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_HANDLEEVENT_DUP03=0x7
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELACONNECTIONIDLEREQUEST=0x14
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELOTGEVENTREQUEST=0xe
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELOTGMESSAGEREQUEST=0x10
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELOTGSTATEREQUEST=0x16
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELPERIPHERALSTATEREQUEST=0x12
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGIDPINPRESENT_DUP01=0x17
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGLOADLDD_DUP01=0x9
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGLOADLDD_DUP03=0xa
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGOPEN_DUP01=0xb
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGOPEN_DUP03=0xc
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEACONNECTIONIDLEREQUEST=0x13
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEOTGEVENTREQUEST_DUP01=0xd
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEOTGMESSAGEREQUEST_DUP01=0xf
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEOTGSTATEREQUEST_DUP01=0x15
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEPERIPHERALSTATEREQUEST=0x11
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPLOADLDD=0x1a
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPLOADLDD_DUP01=0x1b
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPUNLOADLDD_DUP01=0x18
+[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPUNLOADLDD_DUP02=0x19
+[TRACE]TRACE_VERBOSE[0xDE]_COTGWATCHDOGWATCHER_STARTTIMER_DUP01=0x8
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0464_RUNSTEPL_DUP03=0x1c
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0464_RUNSTEPL_DUP04=0x1d
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0464_RUNSTEPL_DUP06=0x1e
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0467_RUNSTEPL_DUP05=0x1f
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0467_RUNSTEPL_DUP07=0x20
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0468_CONTINUEAFTER=0x21
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0468_RUNSTEPL_DUP07=0x22
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0675_CONTINUEAFTER=0x23
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0676_CONTINUEAFTER=0x24
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0677_CONTINUEAFTER=0x25
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0677_RUNSTEPL_DUP07=0x26
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0677_RUNSTEPL_DUP11=0x27
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEB2BROOT_PRINTSTEPNAME_DUP01=0x2b
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEROOT_BASECONSTRUCTL_DUP01=0x28
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEROOT_RUNL_DUP01=0x29
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEROOT_RUNL_DUP02=0x2a
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEWATCHDOG_ISSUEREQUEST=0x2c
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP01=0x2d
+[TRACE]TRACE_VERBOSE[0xDE]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP05=0x2e
+[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSCLEARERROR_DUP01=0x6
+[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSDROP_DUP01=0x5
+[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSREQUEST_DUP01=0x3
+[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSRESPONDSRP_DUP01=0x4
+[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGSTARTSTACKS_DUP01=0x1
+[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGUNLOADLDD=0x2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,33 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL=0x1
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP01=0x2
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_MONITOR=0x3
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNERROR=0xc
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL=0x4
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP01=0x5
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP02=0x6
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP03=0x7
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP04=0x8
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP05=0x9
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP06=0xa
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP07=0xb
+[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_CONSTRUCTL=0x17
+[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER_DUP01=0x1b
+[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_DOCANCEL=0x15
+[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME=0x18
+[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME_DUP01=0x19
+[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_RUNL=0x16
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL=0xd
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP01=0xe
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP02=0xf
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP03=0x10
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP04=0x11
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP05=0x12
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNERROR=0x14
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNL=0x13
+[TRACE]TRACE_NORMAL[0x86]_DOSTARTL_DOSTARTL=0x1c
+[TRACE]TRACE_NORMAL[0x86]_DOSTARTL_DOSTARTL_DUP01=0x1d
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x1e
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x1f
--- a/kerneltest/e32test/usbho/t_usbdi/group/t_usbdi.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/group/t_usbdi.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -27,7 +27,8 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
-USERINCLUDE		../inc 
+USERINCLUDE		../inc
+USERINCLUDE		../traces_t_usbdi
 
 // Source file paths
 
@@ -39,31 +40,31 @@
 
 // Engine and controller
 
-SOURCE			testengine.cpp
-SOURCE			testcasecontroller.cpp
-SOURCE			testpolicy.cpp
-SOURCE			usbdescriptoroffsets.cpp
-SOURCE			fdfactor.cpp
+SOURCE			TestEngine.cpp
+SOURCE			TestCaseController.cpp
+SOURCE			TestPolicy.cpp
+SOURCE			UsbDescriptorOffsets.cpp
+SOURCE			FDFActor.cpp
 
 // Test factory
 
-SOURCE			testcasefactory.cpp
+SOURCE			TestCaseFactory.cpp
 
 // Timers/Watchers
 
-SOURCE			usbclientstatewatcher.cpp
-SOURCE			basicwatcher.cpp
-SOURCE			softwareconnecttimer.cpp
+SOURCE			UsbClientStateWatcher.cpp
+SOURCE			BasicWatcher.cpp
+SOURCE			SoftwareConnectTimer.cpp
 SOURCE			wakeuptimer.cpp
 
 // Modelled test devices
 
-SOURCE			testdevicebase.cpp
-SOURCE			testinterfacebase.cpp
+SOURCE			TestDeviceBase.cpp
+SOURCE			TestInterfaceBase.cpp
 SOURCE			testinterfacesettingbase.cpp
 SOURCE			vendordevice.cpp
 SOURCE			testdeviceA.cpp
-SOURCE			testdeviceB.cpp
+SOURCE			testdeviceb.cpp
 SOURCE			testdeviceC.cpp
 SOURCE			testdeviceD.cpp
 SOURCE			endpointreader.cpp
--- a/kerneltest/e32test/usbho/t_usbdi/group/t_usbhost_usbman.mmp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/group/t_usbhost_usbman.mmp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,8 @@
 target			t_usbhost_usbman.exe
 targettype		exe
 
+USERINCLUDE ../traces_t_usbhost_usbman
+
 sourcepath		../t_usbhost_usbman_src
 source			t_usbhost_usbman.cpp
 
--- a/kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h	Thu Sep 02 21:54:16 2010 +0300
@@ -110,7 +110,6 @@
 	*/
 	void DoCancel()
 		{
-		LOG_FUNC
 		iUsbInterface.CancelPermitSuspend();
 		}
 
@@ -119,7 +118,6 @@
 	*/
 	void RunL()
 		{
-		LOG_FUNC
 		iCompletionCode = iStatus.Int();
 		User::LeaveIfError(iResumeCallBack.CallBack());
 		}
@@ -128,8 +126,6 @@
 	*/
 	TInt RunError()
 		{
-		LOG_FUNC
-
 		return KErrNone;
 		}
 
--- a/kerneltest/e32test/usbho/t_usbdi/inc/EndpointStallWatcher.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/EndpointStallWatcher.h	Thu Sep 02 21:54:16 2010 +0300
@@ -61,8 +61,6 @@
 	*/
 	void DoCancel()
 		{
-		LOG_FUNC
-		
 		iClientDriver.EndpointStatusNotifyCancel();
 		}
 		
@@ -75,8 +73,6 @@
 	of an endpoint.
 	*/
 		{
-		LOG_FUNC
-		
 		TUint epMask = iEpMask;
 
 		if(iStatus.Int() != KErrNone)
@@ -121,8 +117,6 @@
 	*/
 	TInt RunError(TInt aError)
 		{
-		LOG_FUNC
-		
 		return KErrNone;
 		}
 
--- a/kerneltest/e32test/usbho/t_usbdi/inc/HostTransfers.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/HostTransfers.h	Thu Sep 02 21:54:16 2010 +0300
@@ -108,8 +108,6 @@
 	*/
 	void RunL()
 		{
-		LOG_FUNC
-		
 		TInt completionCode(iStatus.Int());
 		RDebug::Printf("Transfer err=%d",completionCode);
 		
@@ -121,8 +119,6 @@
 	*/
 	void DoCancel()
 		{
-		LOG_FUNC
-		
 		// Will cancel all transfers on this pipe
 		
 		Pipe().CancelAllTransfers();
--- a/kerneltest/e32test/usbho/t_usbdi/inc/testdebug.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/testdebug.h	Thu Sep 02 21:54:16 2010 +0300
@@ -28,14 +28,6 @@
 #include <d32usbdi.h>
 #include <f32file.h>
 
-/**
-Debug macro for serial port logging of function names and signatures
-*/
-#define LOG_CFUNC TFunctionLog funcLog(__PRETTY_FUNCTION__, NULL);
-#define LOG_FUNC TFunctionLog funcLog(__PRETTY_FUNCTION__,this);
-
-#define LOG_POINT(x) RDebug::Printf(">> Debug point: " #x);
-
 //#define LOG_INFO(x) RDebug::Print x;
 
 #define LOG_INFO(x) 
--- a/kerneltest/e32test/usbho/t_usbdi/src/BaseBulkTestCase.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BaseBulkTestCase.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -13,27 +13,33 @@
 // Description:
 // @file BaseBulkTestCase.cpp
 // @internalComponent
-// 
+//
 //
 
 #include "BaseBulkTestCase.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "BaseBulkTestCaseTraces.h"
+#endif
 
 
- 
+
 namespace NUnitTesting_USBDI
 	{
 
 //*****************************************************************************************************
 
-//Bulk Timer Class 
+//Bulk Timer Class
 CBulkTestTimer* CBulkTestTimer::NewL(MBulkTestTimerObserver& aParent)
 	{
+	OstTraceFunctionEntry1( CBULKTESTTIMER_NEWL_ENTRY, ( TUint )&( aParent ) );
 	CBulkTestTimer* self = new (ELeave) CBulkTestTimer(aParent);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CBULKTESTTIMER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -42,27 +48,33 @@
 :	CTimer(EPriorityStandard),
 	iParent(aParent)
 	{
+	OstTraceFunctionEntryExt( CBULKTESTTIMER_CBULKTESTTIMER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CBULKTESTTIMER_CBULKTESTTIMER_EXIT, this );
 	}
 
 
 CBulkTestTimer::~CBulkTestTimer()
 	{
+	OstTraceFunctionEntry1( CBULKTESTTIMER_CBULKTESTTIMER_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CBULKTESTTIMER_CBULKTESTTIMER_EXIT_DUP01, this );
 	}
 
 
 void CBulkTestTimer::ConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CBULKTESTTIMER_CONSTRUCTL_ENTRY, this );
 	CTimer::ConstructL();
+	OstTraceFunctionExit1( CBULKTESTTIMER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CBulkTestTimer::RunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CBULKTESTTIMER_RUNL_ENTRY, this );
 
 	iParent.HandleBulkTestTimerFired();
+	OstTraceFunctionExit1( CBULKTESTTIMER_RUNL_EXIT, this );
 	}
 
 
@@ -75,29 +87,33 @@
 	: CBaseTestCase(aTestCaseId, aHostFlag, aHostOnly),
 	iInBufferPtr(NULL,0),
 	iOutBufferPtr(NULL,0),
-	iValidateBufferPtr(NULL,0)	
+	iValidateBufferPtr(NULL,0)
 	{
-	
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY, this );
+
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT, this );
 	}
 
 
 void CBaseBulkTestCase::BaseBulkConstructL()
 	{
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceD(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_EXIT, this );
 	}
 
 
 CBaseBulkTestCase::~CBaseBulkTestCase()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY_DUP01, this );
+
 	Cancel();
 
 	//Do this before deleting the transfer objects
 	//NB this should do nothing if already called from a derived test class
 	CloseInterfaceAndPipes();
-	
+
 	delete iValidateBuffer;
 	delete iInBuffer;
 	delete iOutBuffer;
@@ -113,7 +129,7 @@
 		{
 		delete iInTransfer[count];
 		}
-	
+
 	delete iControlEp0;
 	delete iActorFDF;
 	if(!IsHost() && iTestDevice)
@@ -121,115 +137,126 @@
 		iTestDevice->Close();
 		}
 	delete iTestDevice;
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT_DUP01, this );
 	}
-	
-void CBaseBulkTestCase::ExecuteHostTestCaseL()	
+
+void CBaseBulkTestCase::ExecuteHostTestCaseL()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_ENTRY, this );
+
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
-	
+
 void CBaseBulkTestCase::HostDoCancel()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_HOSTDOCANCEL_ENTRY, this );
+
 	// Cancel the test step timeout timer
-	
+
 	CancelTimeout();
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_HOSTDOCANCEL_EXIT, this );
 	}
-	
-	
+
+
 void CBaseBulkTestCase::ExecuteDeviceTestCaseL()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_ENTRY, this );
+
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
-	
+
 	// Connect the device to the host
-	
+
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
-	
+
 void CBaseBulkTestCase::DeviceDoCancel()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_DEVICEDOCANCEL_ENTRY, this );
+
 	// Cancel the test device error reports
-	
+
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICEDOCANCEL_EXIT, this );
 	}
-	
-	
+
+
 void CBaseBulkTestCase::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 				RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_DEVICESTATECHANGEL_ENTRY, this );
 	Cancel();
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICESTATECHANGEL_EXIT, this );
 	}
-	
-	
+
+
 TInt CBaseBulkTestCase::BaseBulkDeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
-	RDebug::Printf("this - %08x", this);
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL, "this - %08x", this);
 	return BaseBulkDeviceInsertedL(aDeviceHandle, EFalse);
 	}
 
 void CBaseBulkTestCase::DeviceInsertedL(TUint aDeviceHandle)
 	{
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_DEVICEINSERTEDL_ENTRY, this );
 	//to be implemnted in individual test cases, possibly with the help of BaseBulkDeviceInsertedL
 	BaseBulkDeviceInsertedL(aDeviceHandle);
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICEINSERTEDL_EXIT, this );
 	};
 
 TInt CBaseBulkTestCase::BaseBulkDeviceInsertedL(TUint aDeviceHandle, TBool aUseTwoInterfaces)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY_DUP01, this );
 	TInt err(KErrNone);
-	
-	// Validate connected device	
+
+	// Validate connected device
 	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
-	
-	RDebug::Printf("device serial number (%S)",&testDevice.SerialNumber());
-	RDebug::Printf("Manufacturer (%S)",&testDevice.Manufacturer());
-	RDebug::Printf("Product (%S)",&testDevice.Product());
-	RDebug::Printf("ProductId (%d)",testDevice.ProductId());
-	RDebug::Printf("VendorId (%d)",testDevice.VendorId());
-	
+
+	OstTraceExt1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP08, "device serial number (%S)",testDevice.SerialNumber());
+	OstTraceExt1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP01, "Manufacturer (%S)",testDevice.Manufacturer());
+	OstTraceExt1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP02, "Product (%S)",testDevice.Product());
+	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP03, "ProductId (%d)",testDevice.ProductId());
+	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP04, "VendorId (%d)",testDevice.VendorId());
+
 	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
 		{
-		// Incorrect device for this test case	
+		// Incorrect device for this test case
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP05, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
-		}	
+		}
 
 
 	TUint32 token0;
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP06, "<Error %d> Token for interface 0 could not be retrieved",err);
 
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP01, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP07, "<Error %d> Unable to open interface 0 using token %d",err,token0);
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP02, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
 		}
 
@@ -237,15 +264,17 @@
 	if(err != ENone)
 		//msg already setup, and failure message sent
 		{
-		return EDeviceConfigurationError;	
+		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP03, this, EDeviceConfigurationError );
+		return EDeviceConfigurationError;
 		}
+	OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP04, this, ENone );
 	return ENone;
 	}
 
 
 TInt CBaseBulkTestCase::SetUpInterfaceAndPipesL(TUint aDeviceHandle, TUint8 aInterfaceNum)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_ENTRY, this );
 	TInt err(KErrNone);
 	TInt endpointAddress;
 	RUsbInterface* pTestInterface = NULL;
@@ -253,7 +282,7 @@
 	RUsbPipe* pTestPipeBulkOut1 = NULL;
 	RUsbPipe* pTestPipeBulkOut2 = NULL;
 	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
-	
+
 	switch(aInterfaceNum)
 		{
 		case 1:
@@ -273,16 +302,17 @@
 			break;
 		}
 
-	RDebug::Printf("this - %08x", this);
-	
+	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL, "this - %08x", this);
+
 	TUint32 token;
 	err = testDevice.Device().GetTokenForInterface(aInterfaceNum,token);
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP01, msg);
 		TTestCaseFailed request(err,msg);
+		OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
 		}
 	if(pTestInterface != NULL)
@@ -292,12 +322,13 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP02, msg);
 			TTestCaseFailed request(err,msg);
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP01, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
-	
+
 	if(pTestPipeBulkIn != NULL)
 		{
 		err = GetEndpointAddress(*pTestInterface,0,KTransferTypeBulk,KEpDirectionIn,endpointAddress);
@@ -305,24 +336,26 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Address for bulk in endpoint could not be obtained"),err);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP03, msg);
 			TTestCaseFailed request(err,msg);
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP02, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
-		
-		RDebug::Printf("IN Endpoint address %08x",endpointAddress);
-		
+
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP04, "IN Endpoint address %08x",endpointAddress);
+
 		err = pTestInterface->OpenPipeForEndpoint(*pTestPipeBulkIn,endpointAddress,ETrue);
 		if(err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP05, msg);
 			TTestCaseFailed request(err,msg);
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP03, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
-		
+
 	if(pTestPipeBulkOut1 != NULL)
 		{
 		err = GetEndpointAddress(*pTestInterface,0,KTransferTypeBulk,KEpDirectionOut,endpointAddress);
@@ -330,24 +363,26 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Address for(first) bulk out endpoint could not be obtained"),err);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP06, msg);
 			TTestCaseFailed request(err,msg);
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP04, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
-		
-		RDebug::Printf("OUT Endpoint address %08x",endpointAddress);
-		
+
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP07, "OUT Endpoint address %08x",endpointAddress);
+
 		err = pTestInterface->OpenPipeForEndpoint(*pTestPipeBulkOut1,endpointAddress,ETrue);
 		if(err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP08, msg);
 			TTestCaseFailed request(err,msg);
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP05, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
-	
+
 	if(pTestPipeBulkOut2 != NULL)
 		{
 		err = GetEndpointAddress(*pTestInterface,0,KTransferTypeBulk,KEpDirectionOut,1,endpointAddress);
@@ -355,111 +390,123 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Address for(second) bulk out endpoint could not be obtained"),err);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP09, msg);
 			TTestCaseFailed request(err,msg);
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP06, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
-		
-		RDebug::Printf("OUT Endpoint address %08x",endpointAddress);
-		
+
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP10, "OUT Endpoint address %08x",endpointAddress);
+
 		err = pTestInterface->OpenPipeForEndpoint(*pTestPipeBulkOut2,endpointAddress,ETrue);
 		if(err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP11, msg);
 			TTestCaseFailed request(err,msg);
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP07, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
 
+	OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP08, this, ENone );
 	return ENone;
 	}
-	
+
 void CBaseBulkTestCase::CloseInterfaceAndPipes()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_ENTRY, this );
+
 	// Close the pipe(s) before interface(s)
 	iTestPipeInterface2BulkIn.Close();
 	iTestPipeInterface2BulkOut1.Close();
 	iTestPipeInterface2BulkOut2.Close();
 	iTestPipeInterface1BulkIn.Close();
 	iTestPipeInterface1BulkOut.Close();
-	
+
 	iUsbInterface2.Close();
 	iUsbInterface1.Close();
 	iUsbInterface0.Close();
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_EXIT, this );
 	}
 
 void CBaseBulkTestCase::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_DEVICEREMOVEDL_ENTRY, this );
+
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
-	
+
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICEREMOVEDL_EXIT, this );
 	}
-	
-	
+
+
 void CBaseBulkTestCase::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_BUSERRORL_ENTRY, this );
+
 	// This test case handles no failiures on the bus
-	
+
 	TestFailed(KErrCompletion);
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_BUSERRORL_EXIT, this );
 	}
 
 void CBaseBulkTestCase::HostRunL()
 	{
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
-	
+
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_HOSTRUNL_EXIT, this );
 	}
 
 void CBaseBulkTestCase::DeviceRunL()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_DEVICERUNL_ENTRY, this );
+
 	// Disconnect the device
 	iTestDevice->SoftwareDisconnect();
-	
+
 	// Complete the test case request
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICERUNL_EXIT, this );
 	}
 
 TBool CBaseBulkTestCase::ValidateData (const TDesC8& aDataToValidate, const TDesC8& aDataPattern)
 	{
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_VALIDATEDATA_ENTRY, this );
 	return ValidateData(aDataToValidate, aDataPattern, aDataPattern.Length());
 	}
 
 TBool CBaseBulkTestCase::ValidateData (const TDesC8& aDataToValidate, const TDesC8& aDataPattern, const TUint aNumBytes)
 	{
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP01, this );
 	return ValidateData(aDataToValidate, aDataPattern, 0, aNumBytes);
 	}
 
 TBool CBaseBulkTestCase::ValidateData (const TDesC8& aDataToValidate, const TDesC8& aDataPattern, const TUint aStartPoint, const TUint aNumBytes)
 	{
-	LOG_FUNC
-		
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP02, this );
+
 	__ASSERT_DEBUG(aDataPattern.Length()!=0, User::Panic(_L("Trying to validate with ZERO LENGTH STRING"), KErrArgument));
 
 	if(aDataToValidate.Length()!=aNumBytes)
 		{
-		RDebug::Printf("ROUND TRIP VALIDATION: Length Match Failure, Sent = %d, Returned = %d", aNumBytes, aDataToValidate.Length());
+		OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA, "ROUND TRIP VALIDATION: Length Match Failure, Sent = %d, Returned = %d", aNumBytes, aDataToValidate.Length());
+		OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT, this, EFalse );
 		return EFalse;
 		}
 	TUint startPoint = aStartPoint%aDataPattern.Length();
@@ -472,14 +519,17 @@
 		{
 		if(aDataToValidate.Left(numStartBytes).Compare(aDataPattern.Mid(startPoint, numStartBytes)) != 0)
 			{
-			RDebug::Printf("ROUND TRIP VALIDATION: Start Bytes Match Failure");
-			RDebug::Printf("ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
-			RDebug::Printf("Start of EXPECTED data ...");
-			RDebug::RawPrint(aDataPattern.Mid(startPoint, numStartBytes));
-			RDebug::Printf("\n");
-			RDebug::Printf("Start of RETURNED data ...");				
-			RDebug::RawPrint(aDataToValidate.Left(numStartBytes));
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP01, "ROUND TRIP VALIDATION: Start Bytes Match Failure");
+			OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP02, "ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP03, "Start of EXPECTED data ...");
+			const TPtrC8& midDataPattern = aDataPattern.Mid(startPoint, numStartBytes);
+			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP50, "", midDataPattern.Ptr(), midDataPattern.Length());
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP04, "\n");
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP05, "Start of RETURNED data ...");
+			const TPtrC8& leftDataToValidate = aDataToValidate.Left(numStartBytes);
+			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP51, "", leftDataToValidate.Ptr(), leftDataToValidate.Length());
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP06, "\n");
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP01, this, EFalse );
 			return EFalse;
 			}
 		}
@@ -487,14 +537,17 @@
 		{
 		if(aDataToValidate.Mid(startEndPoint,numEndBytes).Compare(aDataPattern.Left(numEndBytes)) != 0)
 			{
-			RDebug::Printf("ROUND TRIP VALIDATION: End Bytes Match Failure");
-			RDebug::Printf("ROUND TRIP VALIDATION: startEndPoint = %d, numEndBytes = %d", startEndPoint, numEndBytes);
-			RDebug::Printf("End of EXPECTED data ...");
-			RDebug::RawPrint(aDataPattern.Left(numEndBytes));
-			RDebug::Printf("\n");
-			RDebug::Printf("End of RETURNED data ...");				
-			RDebug::RawPrint(aDataToValidate.Mid(startEndPoint,numEndBytes));
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP07, "ROUND TRIP VALIDATION: End Bytes Match Failure");
+			OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP08, "ROUND TRIP VALIDATION: startEndPoint = %d, numEndBytes = %d", startEndPoint, numEndBytes);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP09, "End of EXPECTED data ...");
+			const TPtrC8& leftDataPattern = aDataPattern.Left(numEndBytes);
+			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP52, "", leftDataPattern.Ptr(), leftDataPattern.Length());
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP10, "\n");
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP11, "End of RETURNED data ...");
+			const TPtrC8& midDataToValidate = aDataToValidate.Mid(startEndPoint,numEndBytes);
+			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP53, "", midDataToValidate.Ptr(), midDataToValidate.Length());
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP12, "\n");
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP02, this, EFalse );
 			return EFalse;
 			}
 		}
@@ -502,83 +555,93 @@
 		{
 		if(aDataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()).Compare(aDataPattern) != 0)
 			{
-			RDebug::Printf("ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
-			RDebug::Printf("Middle block of EXPECTED data ...");
-			RDebug::RawPrint(aDataPattern);
-			RDebug::Printf("\n");
-			RDebug::Printf("Middle block of RETURNED data ...");
-			RDebug::RawPrint(aDataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()));
-			RDebug::Printf("\n");
+			OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP13, "ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP14, "Middle block of EXPECTED data ...");
+			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP54, "", aDataPattern.Ptr(), aDataPattern.Length());
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP15, "\n");
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP16, "Middle block of RETURNED data ...");
+			const TPtrC8& midDataToValidate = aDataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length());
+			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP55, "", midDataToValidate.Ptr(), midDataToValidate.Length());
+			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP17, "\n");
+			OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP03, this, EFalse );
 			return EFalse; //from 'for' loop
 			}
 		}
+	OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP04, this, ETrue );
 	return ETrue;
 	}
 
 void CBaseBulkTestCase::RecordTime(const TUint8 aTimerIndex)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_RECORDTIME_ENTRY, this );
 	if(aTimerIndex >= KMaxNumTimers)
 		{
-		RDebug::Printf("Record Timer with index %d called - index OUT OF RANGE", aTimerIndex);
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_RECORDTIME, "Record Timer with index %d called - index OUT OF RANGE", aTimerIndex);
 		User::Panic(_L("BAD TIMER INDEX"), KErrArgument);
 		}
 	iEndTime[aTimerIndex].HomeTime();
 	iTimeElapsed[aTimerIndex] = iEndTime[aTimerIndex].MicroSecondsFrom(iStartTime[aTimerIndex]);
-	RDebug::Printf("Timer with index %d completed in %d uSec", aTimerIndex, (TInt)(iTimeElapsed[aTimerIndex].Int64()));
+	OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_RECORDTIME_DUP01, "Timer with index %d completed in %d uSec", aTimerIndex, (TInt)(iTimeElapsed[aTimerIndex].Int64()));
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_RECORDTIME_EXIT, this );
 	}
 
 TInt CBaseBulkTestCase::CheckTimes(const TUint8 aFirstTimerIndex, const TUint8 aSecondTimerIndex, const TUint aPercentage)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_CHECKTIMES_ENTRY, this );
 	if(aFirstTimerIndex >= KMaxNumTimers)
 		{
-		RDebug::Printf("First timer with index %d called - index OUT OF RANGE", aFirstTimerIndex);
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES, "First timer with index %d called - index OUT OF RANGE", aFirstTimerIndex);
 		User::Panic(_L("BAD TIMER INDEX"), KErrArgument);
 		}
 	if(aSecondTimerIndex >= KMaxNumTimers)
 		{
-		RDebug::Printf("Second timer with index %d called - index OUT OF RANGE", aSecondTimerIndex);
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP01, "Second timer with index %d called - index OUT OF RANGE", aSecondTimerIndex);
 		User::Panic(_L("BAD TIMER INDEX"), KErrArgument);
 		}
 
 	TInt ret = KErrNone;
-	RDebug::Printf("Transfer %d completed in %d uSec\nTransfer %d completed in %d uSec", aFirstTimerIndex, (TInt)(iTimeElapsed[aFirstTimerIndex].Int64()), aSecondTimerIndex, (TInt)(iTimeElapsed[aSecondTimerIndex].Int64()));
+	OstTraceExt4(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP02, "Transfer %d completed in %d uSec\nTransfer %d completed in %d uSec", aFirstTimerIndex, (TInt)(iTimeElapsed[aFirstTimerIndex].Int64()), aSecondTimerIndex, (TInt)(iTimeElapsed[aSecondTimerIndex].Int64()));
 	if(aPercentage*iTimeElapsed[aFirstTimerIndex].Int64() > KPercent*iTimeElapsed[aSecondTimerIndex].Int64())
 		{
 		ret = KErrTooBig;
-		RDebug::Printf("Time %d too big", aFirstTimerIndex);
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP03, "Time %d too big", aFirstTimerIndex);
 		}
 	if(aPercentage*iTimeElapsed[aSecondTimerIndex].Int64() > KPercent*iTimeElapsed[aFirstTimerIndex].Int64())
 		{
 		ret = KErrTooBig;
-		RDebug::Printf("Time %d too big", aSecondTimerIndex);
+		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP04, "Time %d too big", aSecondTimerIndex);
 		}
-	
+
+	OstTraceFunctionExitExt( CBASEBULKTESTCASE_CHECKTIMES_EXIT, this, ret );
 	return ret;
 	}
 
 void CBaseBulkTestCase::ResetTimes(const TUint8 aTimerIndex)
 	{
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_RESETTIMES_ENTRY, this );
 	iStartTime[aTimerIndex] = 0;
 	iEndTime[aTimerIndex] = 0;
 	iTimeElapsed[aTimerIndex] = 0;
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_RESETTIMES_EXIT, this );
 	}
 
 TInt CBaseBulkTestCase::CheckAndResetTimes(const TUint8 aFirstTimerIndex, const TUint8 aSecondTimerIndex, const TUint aPercentage)
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_CHECKANDRESETTIMES_ENTRY, this );
+
 	TInt ret = CheckTimes(aFirstTimerIndex, aSecondTimerIndex, aPercentage);
 	ResetTimes(aFirstTimerIndex);
 	ResetTimes(aSecondTimerIndex);
-	
+
+	OstTraceFunctionExitExt( CBASEBULKTESTCASE_CHECKANDRESETTIMES_EXIT, this, ret );
 	return ret;
 	}
 
 void CBaseBulkTestCase::HandleBulkTestTimerFired()
 	{
+	OstTraceFunctionEntry1( CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_ENTRY, this );
 	//do nothing here - leave to derived class if required
+	OstTraceFunctionExit1( CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_EXIT, this );
 	}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/BaseTestCase.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BaseTestCase.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,6 +21,10 @@
 #include <d32usbdi.h>
 #include "testdebug.h"
 #include "testpolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "BaseTestCaseTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -46,45 +50,51 @@
 	iHost(aHostFlag),
 	iHostOnly(aHostOnly)
 	{
+	OstTraceFunctionEntryExt( CBASETESTCASE_CBASETESTCASE_ENTRY, this );
 	iTestCaseId.Copy(aTestCaseId);
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CBASETESTCASE_CBASETESTCASE_EXIT, this );
 	}
 	
 void CBaseTestCase::BaseConstructL()
 	{
-	LOG_FUNC	
-	RDebug::Printf("Creating test case timer");
+	OstTraceFunctionEntry1( CBASETESTCASE_BASECONSTRUCTL_ENTRY, this );
+	OstTrace0(TRACE_NORMAL, CBASETESTCASE_BASECONSTRUCTL, "Creating test case timer");
 	TInt err(iTimer.CreateLocal());
 	if(err == KErrNone)
 		{
-		RDebug::Printf("Test case timer created");
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_BASECONSTRUCTL_DUP01, "Test case timer created");
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Test case timer could not be created",err);
+		OstTrace1(TRACE_NORMAL, CBASETESTCASE_BASECONSTRUCTL_DUP02, "<Error %d> Test case timer could not be created",err);
 		User::Leave(err);
 		}	
+	OstTraceFunctionExit1( CBASETESTCASE_BASECONSTRUCTL_EXIT, this );
 	}
 
 void CBaseTestCase::TimeoutIn(TInt aTimeoutPeriod)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASETESTCASE_TIMEOUTIN_ENTRY, this );
 	
 	CancelTimeout();
 	iTimer.After(iStatus,aTimeoutPeriod*1000000);
 	SetActive();
+	OstTraceFunctionExit1( CBASETESTCASE_TIMEOUTIN_EXIT, this );
 	}
 
 
 void CBaseTestCase::CancelTimeout()
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_CANCELTIMEOUT_ENTRY, this );
 	iTimer.Cancel();
+	OstTraceFunctionExit1( CBASETESTCASE_CANCELTIMEOUT_EXIT, this );
 	}
 
 TInt CBaseTestCase::GenerateRefFile(const TDesC& aFileName)
 	{
+	OstTraceFunctionEntryExt( CBASETESTCASE_GENERATEREFFILE_ENTRY, this );
 	
-	LOG_FUNC
 	TBuf<256> refTreeFullFileName(KGeneratedFilesPath);
 	refTreeFullFileName.Append(aFileName);	
 	refTreeFullFileName.Append(KExtensionFile);
@@ -95,7 +105,8 @@
 	if(ret!=KErrNone && ret!=KErrAlreadyExists)
 	// if already connected, ignore
 		{ 
-		RDebug::Printf("iFs.Connect fails, ret = %d", ret);
+		OstTrace1(TRACE_NORMAL, CBASETESTCASE_GENERATEREFFILE, "iFs.Connect fails, ret = %d", ret);
+		OstTraceFunctionExitExt( CBASETESTCASE_GENERATEREFFILE_EXIT, this, ret );
 		return ret;
 		}
 			
@@ -107,7 +118,8 @@
 	
 	if(ret!=KErrNone) 
 		{ 
-		RDebug::Printf("refFile.Create fails, ret = %d", ret);
+		OstTrace1(TRACE_NORMAL, CBASETESTCASE_GENERATEREFFILE_DUP01, "refFile.Create fails, ret = %d", ret);
+		OstTraceFunctionExitExt( CBASETESTCASE_GENERATEREFFILE_EXIT_DUP01, this, ret );
 		return ret;
 		}
 		 
@@ -115,13 +127,14 @@
 	refFile.Flush(); 
 	refFile.Close();
 			 
+	OstTraceFunctionExitExt( CBASETESTCASE_GENERATEREFFILE_EXIT_DUP02, this, KErrNone );
 	return KErrNone;
 	}	
 
 TInt CBaseTestCase::CompareCurrentTreeToRef(const TDesC& aFileName, TBool& aIsIdentical)
 	{
+	OstTraceFunctionEntryExt( CBASETESTCASE_COMPARECURRENTTREETOREF_ENTRY, this );
 	
-	LOG_FUNC								
 	TBuf<256> refTreeFullFileName(KRefPath);
 	refTreeFullFileName.Append(aFileName);
 	refTreeFullFileName.Append(KExtensionFile);	 	
@@ -131,7 +144,8 @@
 	if(ret!=KErrNone && ret!=KErrAlreadyExists)
 	// if already connected, ignore
 		{ 
-		RDebug::Printf("iFs.Connect fails, ret = %d", ret);
+		OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF, "iFs.Connect fails, ret = %d", ret);
+		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT, this, ret );
 		return ret;
 		}
 
@@ -140,8 +154,9 @@
 		
 	if(ret!=KErrNone)
 		{
-		RDebug::Printf("Reference File path: %S", &refTreeFullFileName);
-		RDebug::Printf("refFile.Open fails ret = %d", ret);
+		OstTraceExt1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP01, "Reference File path: %S", refTreeFullFileName);
+		OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP02, "refFile.Open fails ret = %d", ret);
+		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP01, this, ret );
 		return ret;
 		}
 		
@@ -151,7 +166,7 @@
 	// check size is identical
 	if(refFileSize != iTreeBuffer.Size())
 		{		
-		RDebug::Printf("sizes are NOT identical, refFileSize = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
+		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP03, "sizes are NOT identical, refFileSize = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
 		//return KErrGeneral; not an issue, \n encoded differently by perforce... x0D x0A. (x0A only in generated ref file)
 		}
 		
@@ -162,7 +177,8 @@
 
 	if(ret!=KErrNone)
 		{
-		RDebug::Printf("refFile.Read fails %d", ret);
+		OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP04, "refFile.Read fails %d", ret);
+		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP02, this, ret );
 		return ret;
 		}
 		
@@ -189,66 +205,73 @@
 		}
 	refBuf.Close();
 	
-	RDebug::Printf("copyRefBuf.Size %d", copyRefBuf.Size());
+	OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP05, "copyRefBuf.Size %d", copyRefBuf.Size());
 		
 
 	// check size is identical, should be identical now
 	if(copyRefBuf.Size() != iTreeBuffer.Size())
 		{		
-		RDebug::Printf("sizes are NOT identical, copyRefBuf.Size() = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
+		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP06, "sizes are NOT identical, copyRefBuf.Size() = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
+		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP03, this, KErrGeneral );
 		return KErrGeneral;
 		}
 	
 	// now compare the 2 buffers		
     // Can only go as far as the smallest buffer
     TInt bufferSizeToCheck = Min(copyRefBuf.Size(), iTreeBuffer.Size());
-	RDebug::Print(_L("bufferSizeToCheck = %d"), bufferSizeToCheck);
+	OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP07, "bufferSizeToCheck = %d", bufferSizeToCheck);
 
 	aIsIdentical = ETrue;	
 	for(TInt iRefBuffer=0; iRefBuffer < bufferSizeToCheck; iRefBuffer++)
 		{
 		if(iTreeBuffer[iRefBuffer] != copyRefBuf[iRefBuffer])
 			{
-			RDebug::Print(_L("Failed buffer comparison at position %d"), iRefBuffer);
-            RDebug::Print(_L("Missmatching chars (%d %d) (%c %c)"), iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer], iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer]);
+			OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP08, "Failed buffer comparison at position %d", iRefBuffer);
+            OstTraceExt4(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP09, "Missmatching chars (%d %d) (%c %c)", iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer], iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer]); 
 			aIsIdentical = EFalse;
 			break;
 			}			 	 	 
 		}		
 
-	RDebug::Print(_L("Finished Buffer comparison aIsIdentical=%d"), aIsIdentical); 
+	OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP10, "Finished Buffer comparison aIsIdentical=%d", aIsIdentical); 
 
  	copyRefBuf.Close();
 	
+	OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP04, this, KErrNone );
 	return KErrNone;	
 	}	
 
 CBaseTestCase::~CBaseTestCase()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CBASETESTCASE_CBASETESTCASE_ENTRY_DUP01, this );
 	Cancel();
 	iTimer.Close();
 	iTreeBuffer.Close();
 	iFs.Close();
+	OstTraceFunctionExit1( CBASETESTCASE_CBASETESTCASE_EXIT_DUP01, this );
 	}
 
 void CBaseTestCase::SelfComplete()
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_SELFCOMPLETE_ENTRY, this );
 	SelfComplete(KErrNone);
+	OstTraceFunctionExit1( CBASETESTCASE_SELFCOMPLETE_EXIT, this );
 	}
 
 void CBaseTestCase::SelfComplete(TInt aError)
 	{
+	OstTraceFunctionEntryExt( CBASETESTCASE_SELFCOMPLETE_ENTRY_DUP01, this );
 	TRequestStatus* s = &iStatus;
 	iStatus = KRequestPending;
 	User::RequestComplete(s,aError);
 	SetActive();
+	OstTraceFunctionExit1( CBASETESTCASE_SELFCOMPLETE_EXIT_DUP01, this );
 	}
 
 
 void CBaseTestCase::DoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CBASETESTCASE_DOCANCEL_ENTRY, this );
 	iTimer.Cancel();
 	if(iHost)
 		{
@@ -258,10 +281,12 @@
 		{
 		DeviceDoCancel();
 		}
+	OstTraceFunctionExit1( CBASETESTCASE_DOCANCEL_EXIT, this );
 	}
 
 void CBaseTestCase::RunL()
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_RUNL_ENTRY, this );
 	if(iHost)
 		{
 		HostRunL();
@@ -270,39 +295,50 @@
 		{
 		DeviceRunL();
 		}
+	OstTraceFunctionExit1( CBASETESTCASE_RUNL_EXIT, this );
 	}
 
 TInt CBaseTestCase::RunError(TInt aError)
 	{
-	LOG_FUNC
-	RDebug::Printf("Test case C%lS::RunL left with %d",&iTestCaseId,aError);
+	OstTraceFunctionEntryExt( CBASETESTCASE_RUNERROR_ENTRY, this );
+	OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_RUNERROR, "Test case C%lS::RunL left with %d",iTestCaseId,aError);
 	iTestPolicy->SignalTestComplete(aError);
+	OstTraceFunctionExitExt( CBASETESTCASE_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
 TDesC& CBaseTestCase::TestCaseId()
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_TESTCASEID_ENTRY, this );
+	OstTraceFunctionExitExt( CBASETESTCASE_TESTCASEID_EXIT, this, ( TUint )&( iTestCaseId ) );
 	return iTestCaseId;
 	}
 	
 	
 TInt CBaseTestCase::TestResult() const
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_TESTRESULT_ENTRY, this );
+	OstTraceFunctionExitExt( CBASETESTCASE_TESTRESULT_EXIT, this, iTestResult );
 	return iTestResult;
 	}
 	
 TBool CBaseTestCase::IsHostOnly() const
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_ISHOSTONLY_ENTRY, this );
+	OstTraceFunctionExitExt( CBASETESTCASE_ISHOSTONLY_EXIT, this, iHostOnly );
 	return iHostOnly;
 	}
 		
 TBool CBaseTestCase::IsHost() const
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_ISHOST_ENTRY, this );
+	OstTraceFunctionExitExt( CBASETESTCASE_ISHOST_EXIT, this, iHost );
 	return iHost;
 	}
 		
 void CBaseTestCase::PerformTestL()
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_PERFORMTESTL_ENTRY, this );
 	
 	if(iHost)
 		{
@@ -313,37 +349,44 @@
 		{
 		ExecuteDeviceTestCaseL();
 		}	
+	OstTraceFunctionExit1( CBASETESTCASE_PERFORMTESTL_EXIT, this );
 	}
 
 void CBaseTestCase::SetTestPolicy(CBasicTestPolicy* aTestPolicy)
 	{
+	OstTraceFunctionEntryExt( CBASETESTCASE_SETTESTPOLICY_ENTRY, this );
 	iTestPolicy = aTestPolicy;
+	OstTraceFunctionExit1( CBASETESTCASE_SETTESTPOLICY_EXIT, this );
 	}
 
 void CBaseTestCase::TestFailed(TInt aFailResult)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASETESTCASE_TESTFAILED_ENTRY, this );
 	iTestResult = aFailResult;
 	if(!iHostOnly)
 		{
-		RDebug::Printf("CActiveScheduler::Stop CBaseTestCase::TestFailed");
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_TESTFAILED, "CActiveScheduler::Stop CBaseTestCase::TestFailed");
 		CActiveScheduler::Stop();
 		}		
+	OstTraceFunctionExit1( CBASETESTCASE_TESTFAILED_EXIT, this );
 	}
 	
 void CBaseTestCase::TestPassed()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CBASETESTCASE_TESTPASSED_ENTRY, this );
 	iTestResult = KErrNone;	
 	if(!iHostOnly)
 		{
-		RDebug::Printf("CActiveScheduler::Stop CBaseTestCase::TestPassed");
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_TESTPASSED, "CActiveScheduler::Stop CBaseTestCase::TestPassed");
 		CActiveScheduler::Stop();
 		}
+	OstTraceFunctionExit1( CBASETESTCASE_TESTPASSED_EXIT, this );
 	}
 
 CBasicTestPolicy& CBaseTestCase::TestPolicy()
 	{
+	OstTraceFunctionEntry1( CBASETESTCASE_TESTPOLICY_ENTRY, this );
+	OstTraceFunctionExit1( CBASETESTCASE_TESTPOLICY_EXIT, this );
 	return *iTestPolicy;
 	}
 	
@@ -357,7 +400,7 @@
 TInt CBaseTestCase::GetEndpointAddress(RUsbInterface& aUsbInterface,TInt aInterfaceSetting,
 		TUint8 aTransferType,TUint8 aDirection,TInt& aEndpointAddress)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASETESTCASE_GETENDPOINTADDRESS_ENTRY, this );
 	
 	return GetEndpointAddress(aUsbInterface, aInterfaceSetting, aTransferType, aDirection, 0, aEndpointAddress);
 	}
@@ -370,46 +413,48 @@
 TInt CBaseTestCase::GetEndpointAddress(RUsbInterface& aUsbInterface,TInt aInterfaceSetting,
 		TUint8 aTransferType,TUint8 aDirection,TUint8 aIndex,TInt& aEndpointAddress)
 	{
-	LOG_FUNC
+		OstTraceFunctionEntryExt( CBASETESTCASE_GETENDPOINTADDRESS_ENTRY_DUP01, this );
 		
 	// Get the interface descriptor
-	RDebug::Printf("Getting the interface descriptor for this alternate setting");
+	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS, "Getting the interface descriptor for this alternate setting");
 
 	TUsbInterfaceDescriptor alternateInterfaceDescriptor;
 	TInt err = aUsbInterface.GetAlternateInterfaceDescriptor(aInterfaceSetting, alternateInterfaceDescriptor);
 
 	if(err)
 		{
-		RDebug::Printf("<Error %d> Unable to get alternate interface (%d) descriptor",err,aInterfaceSetting);
+		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP01, "<Error %d> Unable to get alternate interface (%d) descriptor",err,aInterfaceSetting);
+		OstTraceFunctionExitExt( CBASETESTCASE_GETENDPOINTADDRESS_EXIT, this, err );
 		return err;
 		}
 
 	// Parse the descriptor tree from the interface 	
-	RDebug::Printf("Search the child descriptors for matching endpoint attributes");
+	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP02, "Search the child descriptors for matching endpoint attributes");
 	
 	TUsbGenericDescriptor* descriptor = alternateInterfaceDescriptor.iFirstChild;
 	TUint8 indexCount = 0;
 	while(descriptor)
 		{
-		RDebug::Printf("Check descriptor type for endpoint");
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP03, "Check descriptor type for endpoint");
 
 		// Cast the descriptor to an endpoint descriptor
 		TUsbEndpointDescriptor* endpoint = TUsbEndpointDescriptor::Cast(descriptor);
 		
 		if(endpoint)
 			{
-			RDebug::Printf("Match attributes for transfer type");
+			OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP04, "Match attributes for transfer type");
 			
 			if( (endpoint->Attributes() & aTransferType) == aTransferType)
 				{
-				RDebug::Printf("Match attributes for endpoint direction");
+				OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP05, "Match attributes for endpoint direction");
 				
 				if( (endpoint->EndpointAddress() & aDirection) == aDirection) 
 					{
 					if(indexCount==aIndex)
 						{
 						aEndpointAddress = endpoint->EndpointAddress();
-						RDebug::Printf("Endpoint address found");
+						OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP06, "Endpoint address found");
+						OstTraceFunctionExitExt( CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP01, this, KErrNone );
 						return KErrNone;
 						}
 					else
@@ -424,21 +469,25 @@
 		}
 
 	// Unable to find the endpoint address	
-	RDebug::Printf("Unable to find endpoint address matching the specified attributes");
+	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP07, "Unable to find endpoint address matching the specified attributes");
 	
+	OstTraceFunctionExitExt( CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP02, this, KErrNotFound );
 	return KErrNotFound;
 	}
 	
 /*static*/ void CBaseTestCase::LogWithCondAndInfo(const TDesC& aCondition, const TDesC& aFileName, TInt aLine)
 	{
+	OstTraceFunctionEntryExt( CBASETESTCASE_LOGWITHCONDANDINFO_ENTRY, 0 );
 	TBuf<256> buf;
  	buf.Format(KFailText, &aCondition, &aFileName, aLine);
- 	RDebug::Print(buf); 
+ 	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP08, buf);
+ 	OstTraceFunctionExit1( CBASETESTCASE_LOGWITHCONDANDINFO_EXIT, 0 );
  	} 	
  
   	
 /*static*/ void CBaseTestCase::PrintAndStoreTree(TUsbGenericDescriptor& aDesc, TInt aDepth)
 	{ 
+	OstTraceFunctionEntryExt( CBASETESTCASE_PRINTANDSTORETREE_ENTRY, 0 );
 	
 	TBuf8<20> buf;	
 	for(TInt depth=aDepth;depth>=0;--depth)
@@ -451,12 +500,12 @@
 	unicodeBuf.Copy(buf);	// Ideally this needs conversion to UNICODE
 	if(aDesc.iRecognisedAndParsed == TUsbGenericDescriptor::ERecognised)
 		{ 
-		RDebug::Printf("%S+ length=%d, type=0x%02x", &unicodeBuf, aDesc.ibLength, aDesc.ibDescriptorType);
+		OstTraceExt3(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP09, "%s+ length=%u, type=0x%02x", unicodeBuf, aDesc.ibLength, (TUint32)aDesc.ibDescriptorType);
    		iTreeBuffer.AppendFormat(_L8("%S+ length=%d, type=0x%02x\n"), &buf, aDesc.ibLength, aDesc.ibDescriptorType);		
 		}
 	else
 		{
-		RDebug::Printf("%S- length=%d, type=0x%02x", &unicodeBuf, aDesc.ibLength, aDesc.ibDescriptorType);
+		OstTraceExt3(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP10, "%s- length=%u, type=0x%02x", unicodeBuf, aDesc.ibLength, (TUint32)aDesc.ibDescriptorType);
 		iTreeBuffer.AppendFormat(_L8("%S- length=%d, type=0x%02x\n"), &buf, aDesc.ibLength, aDesc.ibDescriptorType);
 		} 		
 
@@ -464,22 +513,24 @@
 		
 		if(aDesc.iFirstChild)    
 		{
-		RDebug::Printf("%S \\ ", &unicodeBuf);
+		OstTraceExt1(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP11, "%s \n", unicodeBuf);
 		iTreeBuffer.AppendFormat(_L8("%S \\ \n"), &buf);		
 		
 		PrintAndStoreTree(*(aDesc.iFirstChild), aDepth+1);		
 	
-		RDebug::Printf("%S / ", &unicodeBuf);
+		OstTraceExt1(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP12, "%s \n", unicodeBuf);
 		iTreeBuffer.AppendFormat(_L8("%S / \n"), &buf);
 		}
 	if(aDesc.iNextPeer)
 		{
 		PrintAndStoreTree(*(aDesc.iNextPeer), aDepth);
 		}		
+	OstTraceFunctionExit1( CBASETESTCASE_PRINTANDSTORETREE_EXIT, 0 );
 	} 
 	   
 void CBaseTestCase::PrintAndStoreBlob(TDes8& aBuf, TPtrC8& aBlob)
 	{
+	OstTraceFunctionEntryExt( CBASETESTCASE_PRINTANDSTOREBLOB_ENTRY, this );
 	
 	HBufC8* chunk = HBufC8::New(KChunkSize);
 	
@@ -504,10 +555,12 @@
 		PrintAndStoreChunk(chunk, remainderSize ,aBlob,offset, i ,aBuf);				
 		}
 	delete chunk;
+	OstTraceFunctionExit1( CBASETESTCASE_PRINTANDSTOREBLOB_EXIT, this );
 	} 
 	
 void CBaseTestCase::PrintAndStoreChunk(HBufC8* aChunk, TUint aSize, TPtrC8& aBlob, TUint aOffset, TUint aIter, TDes8& aBuf)
 	{	
+	OstTraceFunctionEntryExt( CBASETESTCASE_PRINTANDSTORECHUNK_ENTRY, this );
 	for(TInt i=0;i<aSize;++i)
 		{
 		aChunk->Des().AppendFormat(_L8("%02x"), aBlob[i+aOffset]);
@@ -520,20 +573,21 @@
 			
 	if(aIter ==0)
 		{		
-		RDebug::Printf("%S >%S", &unicodeBuf, &unicodeChunk);					
+		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_PRINTANDSTORECHUNK, "%S >%S", unicodeBuf, unicodeChunk);					
 		iTreeBuffer.AppendFormat(_L8("%S >%S\n"), &aBuf, aChunk);	
 		}
 	else
 		{	
-		RDebug::Printf("%S  %S\n", &unicodeBuf, &unicodeChunk); 
+		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_PRINTANDSTORECHUNK_DUP01, "%S  %S\n", unicodeBuf, unicodeChunk); 
 		iTreeBuffer.AppendFormat(_L8("%S  %S\n"), &aBuf, aChunk);
 		}
 	aChunk->Des().Zero();		
+	OstTraceFunctionExit1( CBASETESTCASE_PRINTANDSTORECHUNK_EXIT, this );
 	}	
 	
 TInt CBaseTestCase::CheckTree(TUsbGenericDescriptor& aDevDesc, TUsbGenericDescriptor& aConfigDesc, const TDesC& aFileName)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASETESTCASE_CHECKTREE_ENTRY, this );
 	TInt ret = KErrNone;
 	
 	// flush buffer
@@ -552,34 +606,37 @@
 	TBool isIdentical;
 	if(KErrNone != CompareCurrentTreeToRef(aFileName, isIdentical))
 		{ 
-		RDebug::Printf("CompareCurrentTreeToRef error"); 
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_CHECKTREE, "CompareCurrentTreeToRef error");
 		ret = KErrGeneral;
 		}	
 	if(!isIdentical)
 		{ 
-		RDebug::Printf("!isIdentical"); 
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_CHECKTREE_DUP01, "!isIdentical");
 		ret = KErrGeneral;
 		}
+	OstTraceFunctionExitExt( CBASETESTCASE_CHECKTREE_EXIT, this, ret );
 	return ret;
 	}
 	
 	
 TInt CBaseTestCase::ParseConfigDescriptorAndCheckTree(TUsbDeviceDescriptor *devDesc, const TDesC8& configSet, TUint indexTest)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_ENTRY, this );
 	// Parse config. descriptor
 	TUsbGenericDescriptor* parsed = NULL;
 	TInt err = UsbDescriptorParser::Parse(configSet, parsed);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("parsing error : UsbDescriptorParser::Parse"); 
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE, "parsing error : UsbDescriptorParser::Parse");
+		OstTraceFunctionExitExt( CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT, this, err );
 		return err;
 		}
 	TUsbConfigurationDescriptor* configDesc = TUsbConfigurationDescriptor::Cast(parsed);
 	// checks 
 	if(configDesc == 0)
 		{
-		RDebug::Printf("configDesc == 0");
+		OstTrace0(TRACE_NORMAL, CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_DUP01, "configDesc == 0");
+		OstTraceFunctionExitExt( CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT_DUP01, this, KErrGeneral );
 		return KErrGeneral; 
 		}
 		
@@ -591,7 +648,7 @@
 	
 TInt CBaseTestCase::CheckTreeAfterDeviceInsertion(CUsbTestDevice& aTestDevice, const TDesC& aFileName)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASETESTCASE_CHECKTREEAFTERDEVICEINSERTION_ENTRY, this );
 	TUsbGenericDescriptor deviceDesc = aTestDevice.DeviceDescriptor();
 	TUsbGenericDescriptor configDesc = aTestDevice.ConfigurationDescriptor();	
 	return CheckTree(deviceDesc, configDesc, aFileName); 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,10 @@
 
 #include "BasicWatcher.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "BasicWatcherTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -27,51 +31,58 @@
 	iCallBack(aCallBack),
 	iCompletionCode(KErrNone)
 	{
+	OstTraceFunctionEntryExt( CBASICWATCHER_CBASICWATCHER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CBASICWATCHER_CBASICWATCHER_EXIT, this );
 	}
 	
 CBasicWatcher::~CBasicWatcher()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CBASICWATCHER_CBASICWATCHER_ENTRY_DUP01, this );
 
 	Cancel();
+	OstTraceFunctionExit1( CBASICWATCHER_CBASICWATCHER_EXIT_DUP01, this );
 	}
 
 void CBasicWatcher::DoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CBASICWATCHER_DOCANCEL_ENTRY, this );
 
-	RDebug::Printf("Watch cancelled");
+	OstTrace0(TRACE_NORMAL, CBASICWATCHER_DOCANCEL, "Watch cancelled");
 	iStatus = KErrCancel;
+	OstTraceFunctionExit1( CBASICWATCHER_DOCANCEL_EXIT, this );
 	}
 
 
 void CBasicWatcher::StartWatching()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CBASICWATCHER_STARTWATCHING_ENTRY, this );
 
 	if(iStatus != KRequestPending)
 		{
 		User::Panic(_L("iStatus has not been set to pending this will lead to E32USER-CBase Panic"),46);
 		}
 	SetActive();
+	OstTraceFunctionExit1( CBASICWATCHER_STARTWATCHING_EXIT, this );
 	}
 
 
 void CBasicWatcher::RunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CBASICWATCHER_RUNL_ENTRY, this );
 
 	iCompletionCode = iStatus.Int();
 	User::LeaveIfError(iCallBack.CallBack());
+	OstTraceFunctionExit1( CBASICWATCHER_RUNL_EXIT, this );
 	}
 
 
 TInt CBasicWatcher::RunError(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CBASICWATCHER_RUNERROR_ENTRY, this );
 
-	RDebug::Printf("Watcher code Left with %d",aError);
+	OstTrace1(TRACE_NORMAL, CBASICWATCHER_RUNERROR, "Watcher code Left with %d",aError);
+	OstTraceFunctionExitExt( CBASICWATCHER_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -16,28 +16,36 @@
 
 #include "Ep0Reader.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "Ep0ReaderTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
 	
 CDeviceEndpoint0* CDeviceEndpoint0::NewL(MRequestHandler& aRequestHandler)
 	{
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_NEWL_ENTRY, ( TUint )&( aRequestHandler ) );
 	CDeviceEndpoint0* self = new (ELeave) CDeviceEndpoint0();
 	CleanupStack::PushL(self);
 	self->ConstructL(aRequestHandler);
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
 	
 CDeviceEndpoint0::CDeviceEndpoint0()
 	{
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY, this );
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT, this );
 	}	
 	
 	
 CDeviceEndpoint0::~CDeviceEndpoint0()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY_DUP01, this );
 
 	// Destroy the reader/writer
 	delete iEndpoint0Writer; 
@@ -45,16 +53,17 @@
 	
 	// Close channel to the driver
 	iClientDriver.Close();
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT_DUP01, this );
 	}
 	
 	
 void CDeviceEndpoint0::ConstructL(MRequestHandler& aRequestHandler)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_CONSTRUCTL_ENTRY, this );
 	TInt err(iClientDriver.Open(0));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
+		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_CONSTRUCTL, "<Error %d> Unable to open a channel to USB client driver",err);
 		User::Leave(err);
 		}
 	
@@ -63,12 +72,13 @@
 	
 	// Create the writer of data on device endpoint 0
 	iEndpoint0Writer = new (ELeave) CEndpointWriter(iClientDriver,EEndpoint0);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_CONSTRUCTL_EXIT, this );
 	}
 
 	
 TInt CDeviceEndpoint0::Start()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_START_ENTRY, this );
 	
 	// Make this channel to the driver able to get device directed ep0 requests
 	TInt err(iClientDriver.SetDeviceControl());
@@ -76,20 +86,22 @@
 	// Check operation success
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to obtain device control",err);
+		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_START, "<Error %d> Unable to obtain device control",err);
+		OstTraceFunctionExitExt( CDEVICEENDPOINT0_START_EXIT, this, err );
 		return err;
 		}
 		
 	// Start reading for requests from host
 	TRAP(err,iEndpoint0Reader->ReadRequestsL());
 	
+	OstTraceFunctionExitExt( CDEVICEENDPOINT0_START_EXIT_DUP01, this, err );
 	return err;
 	}
 
 
 TInt CDeviceEndpoint0::Stop()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_STOP_ENTRY, this );
 	// Cancel the data reader and writer
 	iEndpoint0Writer->Cancel();
 	iEndpoint0Reader->Cancel();
@@ -98,26 +110,32 @@
 	TInt err(iClientDriver.ReleaseDeviceControl());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to release device control",err);
+		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_STOP, "<Error %d> Unable to release device control",err);
 		}
+	OstTraceFunctionExitExt( CDEVICEENDPOINT0_STOP_EXIT, this, err );
 	return err;
 	}
 
 
 void CDeviceEndpoint0::SendData(const TDesC8& aData)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_SENDDATA_ENTRY, this );
 	iEndpoint0Writer->Write(aData, ETrue);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_SENDDATA_EXIT, this );
 	}
 
 TInt CDeviceEndpoint0::SendDataSynchronous(const TDesC8& aData)
 	{
-	LOG_FUNC
-	return iEndpoint0Writer->WriteSynchronous(aData, ETrue);
+	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_ENTRY, this );
+	TInt ret = iEndpoint0Writer->WriteSynchronous(aData, ETrue);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_EXIT, this );
+	return ret;
 	}
 
 CControlEndpointReader& CDeviceEndpoint0::Reader()
 	{
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_READER_ENTRY, this );
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_READER_EXIT, this );
 	return *iEndpoint0Reader;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/FDFActor.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/FDFActor.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,6 +21,10 @@
 #include <Usb.h>
 #include "UsbDescriptorOffsets.h"
 #include "BaseTestCase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "FDFActorTraces.h"
+#endif
 #include <e32property.h>
 
 extern RTest gtest;
@@ -34,10 +38,12 @@
 
 CActorFDF* CActorFDF::NewL(MUsbBusObserver& aObserver)
 	{
+	OstTraceFunctionEntry1( CACTORFDF_NEWL_ENTRY, ( TUint )&( aObserver ) );
 	CActorFDF* self = new (ELeave) CActorFDF(aObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CACTORFDF_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -46,22 +52,24 @@
 :	CActive(EPriorityStandard),
 	iObserver(aObserver)
 	{
+	OstTraceFunctionEntryExt( CACTORFDF_CACTORFDF_ENTRY, this );
+	OstTraceFunctionExit1( CACTORFDF_CACTORFDF_EXIT, this );
 	}
 
 
 void CActorFDF::ConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CACTORFDF_CONSTRUCTL_ENTRY, this );
 	CActiveScheduler::Add(this);
 	
 	TInt err(iDriver.Open());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open driver channel",err);
+		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL, "<Error %d> Unable to open driver channel",err);
 		User::Leave(err);
 		}		
 	
-	RDebug::Printf("PBASE-T_USBDI-xxxx: Stack starting");
+	OstTrace0(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP01, "PBASE-T_USBDI-xxxx: Stack starting");
 	/*
 	@SYMTestCaseID				PBASE-T_USBDI-xxxx
 	@SYMTestCaseDesc			Test for host stack initiation
@@ -78,15 +86,15 @@
 	if(err != KErrNone)
 		{
 		// Test case did not run successfully
-		RDebug::Printf("<Error %d> USB Host stack not starting",err);		
+		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP02, "<Error %d> USB Host stack not starting",err);		
 		gtest(EFalse);
 		}
 	  
-	RDebug::Printf("starting t_usbhost_usbman.exe");
+	OstTrace0(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP03, "starting t_usbhost_usbman.exe");
 	TInt r = iOtgUsbMan.Create(_L("t_usbhost_usbman.exe"), KNullDesC); //LIT does not seem to work here
 	if(r != KErrNone && r != KErrAlreadyExists)
 		{
-  		RDebug::Printf("can't start t_usbhost_usbman.exe");
+  		OstTrace0(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP04, "can't start t_usbhost_usbman.exe");
 		gtest(EFalse);
 		}
 	
@@ -96,25 +104,28 @@
     r = RProperty::Define(KWordOfDeathCat, KWordOfDeathKey, RProperty::EInt,KAllowAllPolicy, KAllowAllPolicy, 0);
 	if(r != KErrNone && r != KErrAlreadyExists)
         {
-        RDebug::Printf("Could not create the WordOfDeath P&S   (%d)", r);
+        OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP05, "Could not create the WordOfDeath P&S   (%d)", r);
  		gtest(EFalse);
         }
 
 	iOtgUsbMan.Resume();	
 	
 	User::After(1500000); //allow time for t_usbhost_usbman.exe to start	
+	OstTraceFunctionExit1( CACTORFDF_CONSTRUCTL_EXIT, this );
 	}
 
 void KillTest()
 	{
-	RDebug::Printf("BEFORE gtest(EFalse)");
+	OstTraceFunctionEntry0( _KILLTEST_ENTRY );
+	OstTrace0(TRACE_NORMAL, KILLTEST_KILLTEST, "BEFORE gtest(EFalse)");
 	gtest(EFalse);
-	RDebug::Printf("AFTER gtest(EFalse)");
+	OstTrace0(TRACE_NORMAL, KILLTEST_KILLTEST_DUP01, "AFTER gtest(EFalse)");
+	OstTraceFunctionExit0( _KILLTEST_EXIT );
 	}
 
 CActorFDF::~CActorFDF()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CACTORFDF_CACTORFDF_ENTRY_DUP01, this );
 	Cancel();
 	
 	// Destroy all test device objects that represented connected devices
@@ -126,11 +137,11 @@
 		delete *it.NextValue();
 		}
 
-	RDebug::Printf("killing t_usbhost_usbman.exe");
+	OstTrace0(TRACE_NORMAL, CACTORFDF_DCACTORFDF, "killing t_usbhost_usbman.exe");
 	TInt r = RProperty::Set(KWordOfDeathCat, KWordOfDeathKey, KErrAbort);   // Send the word of death
     if(r != KErrNone)
         {
-        RDebug::Printf("failed to kill t_usbhost-usbhan  (%d)", r);      
+        OstTrace1(TRACE_NORMAL, CACTORFDF_DCACTORFDF_DUP01, "failed to kill t_usbhost-usbhan  (%d)", r);      
 		RProperty::Delete(KWordOfDeathCat, KWordOfDeathKey); //try to clean this up ready for next test
 		User::After(1000000); //allow time for property to clean up
 		gtest(EFalse);
@@ -139,7 +150,7 @@
 
 	// Stop the USB Hub driver
 		
-	RDebug::Printf("UT-USBD-P1782-TN0001: Hub driver stopping...");
+	OstTrace0(TRACE_NORMAL, CACTORFDF_DCACTORFDF_DUP02, "UT-USBD-P1782-TN0001: Hub driver stopping...");
 
 	// Close the channel to the USB Hub driver	
 	iDriver.Close();	
@@ -157,54 +168,58 @@
 			//give up
 			{
 			User::After(1000000); //allow time for property to clean up JUST IN CASE it can despite returning an error!
-	        RDebug::Printf("failed to delete wordofdeath P&S  (%d)", r);
+	        OstTrace1(TRACE_NORMAL, CACTORFDF_DCACTORFDF_DUP03, "failed to delete wordofdeath P&S  (%d)", r);
 			gtest(EFalse);
 			}
         }
 
+	OstTraceFunctionExit1( CACTORFDF_CACTORFDF_EXIT_DUP01, this );
 	}
 	
 void CActorFDF::DoCancel()
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( CACTORFDF_DOCANCEL_ENTRY, this );
 
 
-	RDebug::Printf("Cancelling bus event notifications");
+	OstTrace0(TRACE_NORMAL, CACTORFDF_DOCANCEL, "Cancelling bus event notifications");
 	iDriver.CancelWaitForBusEvent();
 	gtest((iStatus == KErrCancel) || (iStatus == KErrNone));	
-	RDebug::Printf("Bus event notifications successfully cancelled");	
+	OstTrace0(TRACE_NORMAL, CACTORFDF_DOCANCEL_DUP01, "Bus event notifications successfully cancelled");
+	OstTraceFunctionExit1( CACTORFDF_DOCANCEL_EXIT, this );
 	}
 	
 void CActorFDF::Monitor()
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( CACTORFDF_MONITOR_ENTRY, this );
 
-	RDebug::Printf("Monitoring bus events");
+	OstTrace0(TRACE_NORMAL, CACTORFDF_MONITOR, "Monitoring bus events");
 	iDriver.WaitForBusEvent(iBusEvent,iStatus);
 	SetActive();
+	OstTraceFunctionExit1( CACTORFDF_MONITOR_EXIT, this );
 	}
 	
 	
 			
 CUsbTestDevice& CActorFDF::DeviceL(TUint aDeviceHandle)
 	{
+	OstTraceFunctionEntryExt( CACTORFDF_DEVICEL_ENTRY, this );
 	return *iDevices.FindL(aDeviceHandle);
 	}
 	
 void CActorFDF::RunL()
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( CACTORFDF_RUNL_ENTRY, this );
 
 	// Obtain completion code
 	TInt completionCode(iStatus.Int());
-	RDebug::Printf("Completion code  : %d",completionCode);
+	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL, "Completion code  : %d",completionCode);
 	
 	 if(completionCode == KErrNone)
 		{
 		if(iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceAttached)
 			{
 			// Device Attached
-			RDebug::Printf("Usb device attached: %d",iBusEvent.iDeviceHandle);
+			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP01, "Usb device attached: %d",iBusEvent.iDeviceHandle);
 			
 			// Create the test device object
 			iDevices.InsertL(iBusEvent.iDeviceHandle,CUsbTestDevice::NewL(iDriver,iBusEvent.iDeviceHandle,iObserver));
@@ -215,7 +230,7 @@
 		else if(iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceRemoved)
 			{
 			// Device Removed
-			RDebug::Printf("Usb device removed: %d",iBusEvent.iDeviceHandle);
+			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP02, "Usb device removed: %d",iBusEvent.iDeviceHandle);
 			
 			// Notify observer
 			iObserver.DeviceRemovedL(iBusEvent.iDeviceHandle);
@@ -227,24 +242,26 @@
 		else
 			{
 			// TODO: Upcall for USB Man etc
-			RDebug::Printf("<Warning> Bus event %d occured, still monitoring, reason = %d",iBusEvent.iEventType, iBusEvent.iReason);
+			OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP03, "<Warning> Bus event %d occured, still monitoring, reason = %d",iBusEvent.iEventType, iBusEvent.iReason);
 			iDriver.WaitForBusEvent(iBusEvent,iStatus);
 			SetActive();
 			}
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Bus event %d",completionCode,iBusEvent.iEventType);
+		OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP04, "<Error %d> Bus event %d",completionCode,iBusEvent.iEventType);
 		iObserver.BusErrorL(completionCode);
 		}
+	OstTraceFunctionExit1( CACTORFDF_RUNL_EXIT, this );
 	}
 	
 
 TInt CActorFDF::RunError(TInt aError)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CACTORFDF_RUNERROR_ENTRY, this );
 
-	RDebug::Printf("<Error %d> CActorFDF::RunError",aError);
+	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNERROR, "<Error %d> CActorFDF::RunError",aError);
+	OstTraceFunctionExitExt( CACTORFDF_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
@@ -260,10 +277,12 @@
 	
 CUsbTestDevice* CUsbTestDevice::NewL(RUsbHubDriver& aHubDriver,TUint aDeviceHandle,MUsbBusObserver& aObserver)
 	{
+	OstTraceFunctionEntryExt( CUSBTESTDEVICE_NEWL_ENTRY, 0 );
 	CUsbTestDevice* self = new (ELeave) CUsbTestDevice(aHubDriver,aDeviceHandle,aObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUSBTESTDEVICE_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -273,21 +292,23 @@
 	iHandle(aHandle),
 	iObserver(aObserver)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY, this );
 
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT, this );
 	}
 	
 CUsbTestDevice::~CUsbTestDevice()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY_DUP01, this );
 	Cancel();
 	iDevice.Close();
+	OstTraceFunctionExit1( CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT_DUP01, this );
 	}
 	
 void CUsbTestDevice::ConstructL()
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( CUSBTESTDEVICE_CONSTRUCTL_ENTRY, this );
 
 	// Open the usb device object
 	User::LeaveIfError(iDevice.Open(iDriver,iHandle));
@@ -295,14 +316,14 @@
 	TInt err(iDevice.GetDeviceDescriptor(iDeviceDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Getting device (%d) descriptor",err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL, "<Error %d> Getting device (%u) descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	
 	err = iDevice.GetConfigurationDescriptor(iConfigDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Getting device (%d) configuration descriptor",err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP01, "<Error %d> Getting device (%u) configuration descriptor",err,iHandle);
 		User::Leave(err);
 		}
 
@@ -310,16 +331,16 @@
 	iPid = iDeviceDescriptor.ProductId();
 	iVid = iDeviceDescriptor.VendorId();
 	
-	RDebug::Printf("%dmA configuration maximum power consumption",iConfigDescriptor.MaxPower()*2);
-	RDebug::Printf("%d number of interface(s)",iConfigDescriptor.NumInterfaces());
-	RDebug::Printf("Product Id=0x%04x, Vendor Id=0x%04x",iPid,iVid);
-	RDebug::Printf("TotalLength() = %d",iConfigDescriptor.TotalLength());
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP02, "%dmA configuration maximum power consumption",iConfigDescriptor.MaxPower()*2);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP03, "%d number of interface(s)",iConfigDescriptor.NumInterfaces());
+	OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP04, "Product Id=0x%04x, Vendor Id=0x%04x",(TUint32)iPid,(TUint32)iVid);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP05, "TotalLength() = %d",iConfigDescriptor.TotalLength());
 
 	// The manufacturer string
 	err = iDevice.GetStringDescriptor(iManufacturerStringDesc,iManufacturerStringData,iDeviceDescriptor.ManufacturerIndex());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Getting device (%d) manufacturer string descriptor",err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP06, "<Error %d> Getting device (%u) manufacturer string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iManufacturerStringDesc->StringData(iManufacturerString);
@@ -328,7 +349,7 @@
 	err = iDevice.GetStringDescriptor(iProductStringDesc,iProductStringData,iDeviceDescriptor.ProductIndex());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Getting device (%d) product string descriptor",err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP07, "<Error %d> Getting device (%u) product string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iProductStringDesc->StringData(iProductString);
@@ -337,7 +358,7 @@
 	err = iDevice.GetStringDescriptor(iSerialNumberDesc,iSerialNumberStringData,iDeviceDescriptor.SerialNumberIndex());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Getting device (%d) serial number string descriptor",err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP08, "<Error %d> Getting device (%u) serial number string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iSerialNumberDesc->StringData(iSerialNumber);
@@ -346,7 +367,7 @@
 	err = iDevice.GetStringDescriptor(iConfigStringDesc,iConfigStringData,iConfigDescriptor.ConfigurationIndex());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Getting device (%d) configuration string descriptor",err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP09, "<Error %d> Getting device (%u) configuration string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iConfigStringDesc->StringData(iConfigString);
@@ -358,80 +379,102 @@
 	if(err != KErrUsbStalled)
 		{
 		delete unusedStringDescriptor; //in case 'err ==  KErrNone', in which case this will need freeing
-		RDebug::Printf("GetStringDescriptor with nonExistentString didn't return KErrUsbStalled",err,iHandle);
+		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP10, "GetStringDescriptor with %d Handle %u",err,iHandle);
 		User::Leave(err);
 		}
-	RDebug::Printf("String not present error(%d)",err);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP11, "String not present error(%d)",err);
 
 	// Get changes in device state
 	iDevice.QueueDeviceStateChangeNotification(iCurrentState,iStatus); // iCurrentState now holds the current device state
 	SetActive();
+	OstTraceFunctionExit1( CUSBTESTDEVICE_CONSTRUCTL_EXIT, this );
 	}
 	
 RUsbDevice& CUsbTestDevice::Device()
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_DEVICE_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_DEVICE_EXIT, this, ( TUint )&( iDevice ) );
 	return iDevice;
 	}
 	
 TUint16 CUsbTestDevice::DeviceSpec() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_DEVICESPEC_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_DEVICESPEC_EXIT, this, ( TUint16 )( iDeviceSpec ) );
 	return iDeviceSpec;
 	}
 	
 TUint16 CUsbTestDevice::ProductId() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_PRODUCTID_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_PRODUCTID_EXIT, this, ( TUint16 )( iPid ) );
 	return iPid;
 	}
 	
 TUint16 CUsbTestDevice::VendorId() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_VENDORID_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_VENDORID_EXIT, this, ( TUint16 )( iVid ) );
 	return iVid;
 	}
 
 const TDesC16& CUsbTestDevice::SerialNumber() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_SERIALNUMBER_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_SERIALNUMBER_EXIT, this, ( TUint )&( iSerialNumber ) );
 	return iSerialNumber;
 	}
 
 const TDesC16& CUsbTestDevice::Manufacturer() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_MANUFACTURER_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_MANUFACTURER_EXIT, this, ( TUint )&( iManufacturerString ) );
 	return iManufacturerString;
 	}
 	
 const TDesC16& CUsbTestDevice::Product() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_PRODUCT_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_PRODUCT_EXIT, this, ( TUint )&( iProductString ) );
 	return iProductString;
 	}
 	
 const TDesC16& CUsbTestDevice::ConfigurationString() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_CONFIGURATIONSTRING_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_CONFIGURATIONSTRING_EXIT, this, ( TUint )&( iConfigString ) );
 	return iConfigString;
 	}
 
 const TUsbConfigurationDescriptor& CUsbTestDevice::ConfigurationDescriptor() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_EXIT, this, ( TUint )&( iConfigDescriptor ) );
 	return iConfigDescriptor;
 	}
 		
 const TUsbDeviceDescriptor& CUsbTestDevice::DeviceDescriptor() const
 	{
+	OstTraceFunctionEntry1( CUSBTESTDEVICE_DEVICEDESCRIPTOR_ENTRY, this );
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_DEVICEDESCRIPTOR_EXIT, this, ( TUint )&( iDeviceDescriptor ) );
 	return iDeviceDescriptor;
 	}
 
 void CUsbTestDevice::DoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUSBTESTDEVICE_DOCANCEL_ENTRY, this );
 
 	iDevice.CancelDeviceStateChangeNotification();
+	OstTraceFunctionExit1( CUSBTESTDEVICE_DOCANCEL_EXIT, this );
 	}
 
 
 void CUsbTestDevice::RunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUSBTESTDEVICE_RUNL_ENTRY, this );
 
 	TInt completionCode(iStatus.Int());
-	RDebug::Printf("CUsbTestDevice::RunL completionCode(%d)",completionCode);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNL, "CUsbTestDevice::RunL completionCode(%d)",completionCode);
 
 	if(completionCode == KErrNone)
 		{
@@ -441,14 +484,16 @@
 		iObserver.DeviceStateChangeL(iCurrentState,newState,completionCode);
 		iCurrentState = newState;
 		}
+	OstTraceFunctionExit1( CUSBTESTDEVICE_RUNL_EXIT, this );
 	}
 
 
 TInt CUsbTestDevice::RunError(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUSBTESTDEVICE_RUNERROR_ENTRY, this );
 
-	RDebug::Printf("<Error %d>",aError);
+	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNERROR, "<Error %d>",aError);
+	OstTraceFunctionExitExt( CUSBTESTDEVICE_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0472.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0472.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,6 +22,10 @@
 #include <e32debug.h>
 #include "UsbDescriptorOffsets.h"
 #include "TestPolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0472Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -31,10 +35,12 @@
 
 CUT_PBASE_T_USBDI_0472* CUT_PBASE_T_USBDI_0472::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0472* self = new (ELeave) CUT_PBASE_T_USBDI_0472(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -42,19 +48,23 @@
 CUT_PBASE_T_USBDI_0472::CUT_PBASE_T_USBDI_0472(TBool aHostRole)
 :	CBaseTestCase(KTestCaseId,aHostRole)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0472::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0472::~CUT_PBASE_T_USBDI_0472()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY_DUP01, this );
 	Cancel();
 
 	delete iClientAction;
@@ -64,52 +74,57 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0472::ExecuteHostTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iInterface0);
 	iCaseStep = EConnectDevice;
 	iActorFDF->Monitor();
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0472::ExecuteDeviceTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);	
 	SetActive();
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0472::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the test step action timeout timer
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0472::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the test device
 	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0472::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_ENTRY, this );
 
 	Cancel();
 	TInt err(KErrNone);
@@ -121,12 +136,13 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 		
@@ -137,50 +153,50 @@
 		case EConnectDevice:
 			{
 			// Validate vendor identity
-			RDebug::Printf("Vendor identity: 0x%04x",testDevice.VendorId());
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP01, "Vendor identity: 0x%04x",testDevice.VendorId());
 			if(testDevice.VendorId() != 0x0E22)
 				{
-				RDebug::Printf("<Error> Vendor identity is not 0x0E22");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP02, "<Error> Vendor identity is not 0x0E22");
 				return TestFailed(KErrCorrupt);
 				}
 				
 			// Validate product information
-			RDebug::Printf("Usb device supported specification: 0x%04x",testDevice.DeviceSpec());
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP03, "Usb device supported specification: 0x%04x",testDevice.DeviceSpec());
 			if(testDevice.DeviceSpec() != 0x0200)
 				{
-				RDebug::Printf("<Error> Usb device supported specification is not 2.0");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP04, "<Error> Usb device supported specification is not 2.0");
 				return TestFailed(KErrCorrupt);
 				}
-			RDebug::Printf("Usb product identity: 0x%04x",testDevice.ProductId());
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP05, "Usb product identity: 0x%04x",testDevice.ProductId());
 			if(testDevice.ProductId() != 0x0040)
 				{
-				RDebug::Printf("<Error> Usb product idenity is not 0x0040");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP06, "<Error> Usb product idenity is not 0x0040");
 				return TestFailed(KErrCorrupt);
 				}
 		
-			RDebug::Printf("testDevice.ConfigurationString() = %S",&testDevice.ConfigurationString());		
+			OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP07, "testDevice.ConfigurationString() = %S",testDevice.ConfigurationString());		
 			gtest(KErrNone == testDevice.ConfigurationString().Compare(KConfigurationString()));		
 					
-			RDebug::Printf("testDevice.Manufacturer() = %S",&testDevice.Manufacturer());
+			OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP08, "testDevice.Manufacturer() = %S",testDevice.Manufacturer());
 			gtest(KErrNone == testDevice.Manufacturer().Compare(KManufacturer()));
 			
-			RDebug::Printf("testDevice.SerialNumber = %s",&testDevice.SerialNumber());	
+			OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP09, "testDevice.SerialNumber = %s",testDevice.SerialNumber());	
 			gtest(KErrNone == testDevice.SerialNumber().Compare(KTestCaseId()));
 		
-			RDebug::Printf("Waiting for device removal");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP10, "Waiting for device removal");
 			iCaseStep = ERemoveDevice;
 			
 			TUint32 token;
 			err = testDevice.Device().GetTokenForInterface(0,token);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to get token for interface 0",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP11, "<Error %d> Unable to get token for interface 0",err);
 				return TestFailed(err);
 				}
 			err = iInterface0.Open(token);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to open interface 0",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP12, "<Error %d> Unable to open interface 0",err);
 				return TestFailed(err);
 				}
 			
@@ -197,7 +213,7 @@
 			break;
 			
 		case EConnectCancelled:
-			RDebug::Printf("<Error> Bus event cancellation not successful");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP13, "<Error> Bus event cancellation not successful");
 			TestFailed(KErrCorrupt);
 			break;
 			
@@ -207,13 +223,13 @@
 			err = testDevice.Device().GetTokenForInterface(0,token);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to get token for interface 0",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP14, "<Error %d> Unable to get token for interface 0",err);
 				return TestFailed(err);
 				}
 			err = iInterface0.Open(token);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to open interface 0",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP15, "<Error %d> Unable to open interface 0",err);
 				return TestFailed(err);
 				}
 	
@@ -224,16 +240,17 @@
 			break;
 			
 		default:
-			RDebug::Printf("<Error> Test case actions out of sync");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP16, "<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0472::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
 	switch(iCaseStep)
 		{
@@ -256,16 +273,17 @@
 			break;
 			
 		default:
-			RDebug::Printf("<Error %d> Unknown test step",KErrCorrupt);
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL, "<Error %d> Unknown test step",KErrCorrupt);
 			TestFailed(KErrCorrupt);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0472::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_ENTRY, this );
 
 	Cancel();
 	
@@ -281,28 +299,32 @@
 			break;
 			
 		default:
-			RDebug::Printf("<Error> Test case actions out of sync");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL, "<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0472::BusErrorL(TInt aError)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_BUSERRORL_ENTRY, this );
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0472::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0472::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_HOSTRUNL_ENTRY, this );
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -312,28 +334,29 @@
 		if(iCaseStep == EConnectCancelled)
 			{
 			// not a time-out 
-			RDebug::Printf("Timer elapsed, reactivating notifications now");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_HOSTRUNL, "Timer elapsed, reactivating notifications now");
 			iCaseStep = EPassed;			
 			iActorFDF->Monitor();
 			}
 		else
 			{
 			// Action timeout
-			RDebug::Printf("<Error> Action timeout");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP01, "<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}	
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP02, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_HOSTRUNL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0472::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -342,6 +365,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICERUNL_EXIT, this );
 	}	
 	
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0473.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0473.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,6 +21,10 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0473Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -30,10 +34,12 @@
 
 CUT_PBASE_T_USBDI_0473* CUT_PBASE_T_USBDI_0473::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0473* self = new (ELeave) CUT_PBASE_T_USBDI_0473(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_NEWL_EXIT, ( TUint )( self ) );
 	return self; 
 	}
 	   
@@ -44,19 +50,23 @@
 	iSuspendedI1(EFalse),
 	iDeviceNotificationPending(ETrue)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0473::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0473::~CUT_PBASE_T_USBDI_0473()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY_DUP01, this );
 	
 	// Cancel any async operations
 	
@@ -78,12 +88,13 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::ExecuteHostTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	iCaseStep = EStepSuspend;
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
@@ -95,11 +106,12 @@
 
 	// Start the connection timeout	
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0473::ExecuteDeviceTestCaseL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_ENTRY, this );
 
 	// Construct the device for the test case
 	iTestDevice->OpenL(TestCaseId());
@@ -108,29 +120,32 @@
 
 	// Connect the test device	
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0473::HostDoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_ENTRY, this );
 
 	// Cancel the timeout timer
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0473::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_ENTRY, this );
 
 	Cancel(); // Cancel the timer
 	TInt err(KErrNone);
@@ -143,11 +158,12 @@
 		{
 		// Incorrect device for this test case
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	// Check tree now	
@@ -161,61 +177,61 @@
 			TUint32 token1(0);
 			TUint32 token2(0);
 	
-			RDebug::Printf("Obtaining token for interface 0");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP01, "Obtaining token for interface 0");
 			err = testDevice.Device().GetTokenForInterface(0,token1);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP02, "<Error %d> Token for interface 0 could not be retrieved",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Token 1 (%d) retrieved",token1);
-			RDebug::Printf("Opening interface 0");
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP03, "Token 1 (%d) retrieved",token1);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP04, "Opening interface 0");
 			err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Interface 0 could not be opened",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP05, "<Error %d> Interface 0 could not be opened",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Interface 0 opened");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP06, "Interface 0 opened");
 		
 																
-			RDebug::Printf("Obtaining token for interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP07, "Obtaining token for interface 1");
 			err = testDevice.Device().GetTokenForInterface(1,token2);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Token for interface 1 could not be retrieved",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP08, "<Error %d> Token for interface 1 could not be retrieved",err);
 				return TestFailed(err);			
 				}	
-			RDebug::Printf("Opening interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP09, "Opening interface 1");
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Interface 1 could not be opened",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP10, "<Error %d> Interface 1 could not be opened",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Interface 1 opened");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP11, "Interface 1 opened");
 	
 			// close it
 			iUsbInterface1.Close();		
-			RDebug::Printf("Interface 1 closed");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP12, "Interface 1 closed");
 	
 			//re-open now
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Interface 1 could not be re-opened",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP13, "<Error %d> Interface 1 could not be re-opened",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Interface 1 re-opened");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP14, "Interface 1 re-opened");
 			
 			
 			// Suspend interface 0
-			RDebug::Printf("Suspending interface 0");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP15, "Suspending interface 0");
 			iInterface0Watcher->SuspendAndWatch();
 			iSuspendedI0 = ETrue;
 			
 			// Suspend interface 1
-			RDebug::Printf("Suspending interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP16, "Suspending interface 1");
 			iInterface1Watcher->SuspendAndWatch();
 			iSuspendedI1 = ETrue;
 			
@@ -228,15 +244,16 @@
 			TestFailed(KErrCorrupt);
 			break;
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 
 
 TInt CUT_PBASE_T_USBDI_0473::Interface0ResumedL(TAny* aPtr)
 	{
-	LOG_CFUNC
-	RDebug::Printf("Interface 0 resumed");
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_ENTRY, 0 );
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL, "Interface 0 resumed");
 	CUT_PBASE_T_USBDI_0473* self = reinterpret_cast<CUT_PBASE_T_USBDI_0473*>(aPtr);
-	RDebug::Printf("watcher 0 iStatus=%d",self->iInterface0Watcher->CompletionCode());
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_DUP01, "watcher 0 iStatus=%d",self->iInterface0Watcher->CompletionCode());
 	self->iSuspendedI0 = EFalse;
 	return self->CheckForAllResumedNotificationsAndContinueFSM();
 	}
@@ -244,10 +261,10 @@
 	
 TInt CUT_PBASE_T_USBDI_0473::Interface1ResumedL(TAny* aPtr)
 	{
-	LOG_CFUNC
-	RDebug::Printf("Interface 1 resumed");
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_ENTRY, 0 );
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL, "Interface 1 resumed");
 	CUT_PBASE_T_USBDI_0473* self = reinterpret_cast<CUT_PBASE_T_USBDI_0473*>(aPtr);
-	RDebug::Printf("watcher 1 iStatus=%d",self->iInterface1Watcher->CompletionCode());
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_DUP01, "watcher 1 iStatus=%d",self->iInterface1Watcher->CompletionCode());
 	self->iSuspendedI1 = EFalse;
 	return self->CheckForAllResumedNotificationsAndContinueFSM();
 	}
@@ -255,39 +272,41 @@
 	
 void CUT_PBASE_T_USBDI_0473::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0473::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_BUSERRORL_EXIT, this );
 	}
 
 TInt CUT_PBASE_T_USBDI_0473::CheckForAllResumedNotificationsAndContinueFSM()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_ENTRY, this );
 	TBool readyToContinueFSM= ETrue;
 	if( iInterface0Watcher->IsActive()
 	||  iInterface0Watcher->iStatus == KRequestPending)
 		{
-		RDebug::Printf("Interface 0 watcher still pending");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM, "Interface 0 watcher still pending");
 		readyToContinueFSM= EFalse;
 		}
 
 	if( iInterface1Watcher->IsActive()
 	||  iInterface1Watcher->iStatus == KRequestPending)
 		{
-		RDebug::Printf("Interface 1 watcher still pending");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_DUP01, "Interface 1 watcher still pending");
 		readyToContinueFSM= EFalse;
 		}
 
@@ -302,25 +321,28 @@
 		}
 	else
 		{
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_EXIT, this, KErrNone );
 		return KErrNone;
 		}
 	}
 
 TInt CUT_PBASE_T_USBDI_0473::ContinueFSMAfterAllResumedNotifications()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_ENTRY, this );
 	iDeviceNotificationPending= ETrue;
 	if(iSuspendedI0)
 		{
-		RDebug::Printf("<Error %d> Interface 0 still suspended",KErrCompletion);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS, "<Error %d> Interface 0 still suspended",KErrCompletion);
 		TestFailed(KErrCompletion);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT, this, KErrCompletion );
 		return KErrCompletion;
 		}
 
 	if(iSuspendedI1)
 		{
-		RDebug::Printf("<Error %d> Interface 1 still suspended",KErrCompletion);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP01, "<Error %d> Interface 1 still suspended",KErrCompletion);
 		TestFailed(KErrCompletion);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP01, this, KErrCompletion );
 		return KErrCompletion;
 		}
 
@@ -333,14 +355,14 @@
 			
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to permit remote device wakeup",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP02, "<Error %d> Unable to permit remote device wakeup",err);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,_L8("Unable to permit remote device wakeup"));
 				iControlEp0->SendRequest(request,this);
 				}
 			else
 				{
-				RDebug::Printf("Device is resumed, send request to client: Remote wake up in 6 secs");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP03, "Device is resumed, send request to client: Remote wake up in 6 secs");
 				
 				TRemoteWakeupRequest request(6);
 				iControlEp0->SendRequest(request,this);			
@@ -355,11 +377,11 @@
 				{
 				// Now suspend the device again after resumption from remote wakeup
 			
-				RDebug::Printf("Suspending interface 0");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP04, "Suspending interface 0");
 				iInterface0Watcher->SuspendAndWatch();
 				iSuspendedI0 = ETrue;
 				
-				RDebug::Printf("Suspending interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP05, "Suspending interface 1");
 				iInterface1Watcher->SuspendAndWatch();
 				iSuspendedI1 = ETrue;
 				
@@ -367,28 +389,31 @@
 				}
 			else
 				{
-				RDebug::Printf("<Error %d> Device is still suspended",KErrCompletion);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP06, "<Error %d> Device is still suspended",KErrCompletion);
 				TestFailed(KErrCompletion);
+				OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP02, this, KErrCompletion );
 				return KErrCompletion;
 				}
 			}
 			break;
 
 		default:
-			RDebug::Printf("CUT_PBASE_T_USBDI_0473::ContinueFSMAfterAllResumedNotifications: Invalid state %d", iCaseStep);
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP07, "CUT_PBASE_T_USBDI_0473::ContinueFSMAfterAllResumedNotifications: Invalid state %d", iCaseStep);
 			TestFailed(KErrCompletion);
+			OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP03, this, KErrCompletion );
 			return KErrCompletion;
 		}
 
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP04, this, KErrNone );
 	return KErrNone;
 	}
 
 void CUT_PBASE_T_USBDI_0473::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_ENTRY, this );
 	Cancel();
 	
-	RDebug::Printf("Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL, "Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -401,13 +426,13 @@
 				{
 				// Device state is suspended now resume it by resuming one of the interfaces
 				
-				RDebug::Printf("Device is suspended now resume device by resuming one of the interfaces");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP01, "Device is suspended now resume device by resuming one of the interfaces");
 				iUsbInterface0.CancelPermitSuspend();
 				iCaseStep = EValidateResumptionAfterInterfaceSuspension;
 				}
 			else
 				{
-				RDebug::Printf("<Error %d> State was not suspended",KErrCompletion);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP02, "<Error %d> State was not suspended",KErrCompletion);
 				
 				// Since the device is not suspended, send test case failed to the device
 	
@@ -430,7 +455,7 @@
 				}
 			else
 				{
-				RDebug::Printf("<Error %d> Device is still suspended",KErrCompletion);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP03, "<Error %d> Device is still suspended",KErrCompletion);
 				return TestFailed(KErrCompletion);
 				}
 			}
@@ -443,7 +468,7 @@
 				{
 				// Now awaiting a remote wake up state change notification
 				
-				RDebug::Printf("Now awaiting a remote wake up state change notification");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP04, "Now awaiting a remote wake up state change notification");
 				
 				CancelTimeout();
 				iTimer.After(iStatus,10000000); // Give 10 seconds for device to signal remote wake-up
@@ -452,7 +477,7 @@
 				}
 			else
 				{
-				RDebug::Printf("<Error %d> State was not suspended",KErrCompletion);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP05, "<Error %d> State was not suspended",KErrCompletion);
 				
 				// Since the device is not suspended, send test case failed to the device
 	
@@ -466,7 +491,7 @@
 		// This step should never be reached as ep0 complete traps this step, but if it does test fails.
 		case ESuspendForRemoteWakeup:
 			{
-			RDebug::Printf("Resumed before suspended");	    
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP06, "Resumed before suspended");
 		    iCaseStep = EFailed;
 		    TTestCaseFailed request(KErrCompletion,_L8("State was not suspended"));
 		    iControlEp0->SendRequest(request,this);
@@ -492,15 +517,15 @@
 				// Device is now suspended, now activate the device again to send test case
 				// completed request to device
 	
-				RDebug::Printf("Device is now suspended, now activate the device again to send test case completed request to device");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP07, "Device is now suspended, now activate the device again to send test case completed request to device");
 	
 				CUsbTestDevice& testDevice = iActorFDF->DeviceL(iDeviceHandle);
 	
-				RDebug::Printf("Resuming at device level");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP08, "Resuming at device level");
 				TInt err(testDevice.Device().Resume());
 				if(err != KErrNone)
 					{
-					RDebug::Printf("<Error %d> Unable to suspend the device",err);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP09, "<Error %d> Unable to suspend the device",err);
 					iCaseStep = EFailed;
 					TTestCaseFailed request(err,_L8("Unable to suspend the device"));
 					iControlEp0->SendRequest(request,this);
@@ -510,7 +535,7 @@
 				}
 			else
 				{
-				RDebug::Printf("<Error %d> State was not suspended",KErrCompletion);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP10, "<Error %d> State was not suspended",KErrCompletion);
 				
 				// Since the device is not suspended, send test case failed to the device
 	
@@ -527,13 +552,13 @@
 			{
 			if(aNewState == RUsbDevice::EDeviceActive)
 				{
-				RDebug::Printf("Device is active again, test case passed");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP11, "Device is active again, test case passed");
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
 				}
 			else
 				{
-				RDebug::Printf("<Error %d> Device is still suspended",KErrCompletion);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP12, "<Error %d> Device is still suspended",KErrCompletion);
 				return TestFailed(KErrCompletion);
 				}
 			}
@@ -542,27 +567,28 @@
 		default:
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	switch(iCaseStep)
 		{
 		case ESuspendForRemoteWakeup:
 			{
 			// Suspend device again so a remote wakeup can be achieved
-			RDebug::Printf("Suspend device again so a remote wakeup can be achieved");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP01, "Suspend device again so a remote wakeup can be achieved");
 	
 			// Suspend interface 0
-			RDebug::Printf("Suspending interface 0");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP02, "Suspending interface 0");
 			iInterface0Watcher->SuspendAndWatch();
 			iSuspendedI0 = ETrue;
 			
 			// Suspend interface 1
-			RDebug::Printf("Suspending interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP03, "Suspending interface 1");
 			iInterface1Watcher->SuspendAndWatch();
 			iSuspendedI1 = ETrue;
 			
@@ -584,12 +610,13 @@
 			TestPassed();
 			break;
 			}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_HOSTRUNL_ENTRY, this );
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -597,20 +624,21 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_HOSTRUNL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0473::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -619,6 +647,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICERUNL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0474.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0474.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0474.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0474Traces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0474* CUT_PBASE_T_USBDI_0474::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0474* self = new (ELeave) CUT_PBASE_T_USBDI_0474(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0474::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceB(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0474::~CUT_PBASE_T_USBDI_0474()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY_DUP01, this );
 	Cancel();
 	
 	iUsbInterface0.Close();
@@ -65,53 +75,58 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::ExecuteHostTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0474::ExecuteDeviceTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_EXIT, this );
 	} 
 	
 	
 void CUT_PBASE_T_USBDI_0474::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the test step timeout
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0474::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device
 	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_EXIT, this );
 	}
 			
 void CUT_PBASE_T_USBDI_0474::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone); 
 	
@@ -121,12 +136,13 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 		
@@ -142,54 +158,58 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 1 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 1 using token %d",err,token0);
 		return TestFailed(err);
 		} 
 	 	
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iClientAction->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_BUSERRORL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_ENTRY, this );
 	Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0474::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(iCaseStep == EPassed)
 		{
@@ -200,12 +220,13 @@
 		{
 		TestFailed(KErrCompletion);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::HostRunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_HOSTRUNL_ENTRY, this );
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -213,19 +234,20 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0474::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -234,6 +256,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICERUNL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,12 @@
 #include "descriptorsRawData.h"
 #include <d32usbdescriptors.h>
 #include "testpolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0475Traces.h"
+#endif
+
+
 
 namespace NUnitTesting_USBDI
 	{
@@ -29,10 +35,12 @@
 
 CUT_PBASE_T_USBDI_0475* CUT_PBASE_T_USBDI_0475::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0475* self = new (ELeave) CUT_PBASE_T_USBDI_0475(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,26 +49,30 @@
 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0475::ConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0475::~CUT_PBASE_T_USBDI_0475()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY_DUP01, this );
 	
 	Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0475::ExecuteHostTestCaseL()	
 	{	
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	TInt err(KErrNone);
 	
 	TUsbGenericDescriptor* parsed = NULL;
@@ -92,34 +104,41 @@
 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorUnexpectedLengthTestCase3, 3) == KErrNone);
 
 	TestPassed();	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}   
 	
 void CUT_PBASE_T_USBDI_0475::HostDoCancel()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0475::ExecuteDeviceTestCaseL()	
 	{	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}	
 	
 void CUT_PBASE_T_USBDI_0475::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_EXIT, this );
 	}	
 
 
 
 void CUT_PBASE_T_USBDI_0475::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0475::DeviceRunL()
 	{	
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0476.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0476.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,12 @@
 #include "descriptorsRawData.h"
 #include <d32usbdescriptors.h>
 #include "testpolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0476Traces.h"
+#endif
+
+
 
 namespace NUnitTesting_USBDI
 	{
@@ -29,10 +35,12 @@
 
 CUT_PBASE_T_USBDI_0476* CUT_PBASE_T_USBDI_0476::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0476* self = new (ELeave) CUT_PBASE_T_USBDI_0476(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,27 +49,31 @@
 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0476::ConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_CONSTRUCTL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0476::~CUT_PBASE_T_USBDI_0476()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY_DUP01, this );
 	
 	Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT_DUP01, this );
 	}
 	
 
 			
 void CUT_PBASE_T_USBDI_0476::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	TInt err(KErrNone);
 	
 	TUsbGenericDescriptor* parsed = NULL;
@@ -117,33 +129,40 @@
 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase14, 14) == KErrNone);
 	
 	TestPassed();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}   
 	
 void CUT_PBASE_T_USBDI_0476::HostDoCancel()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0476::ExecuteDeviceTestCaseL()	
 	{	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}	
 	
 void CUT_PBASE_T_USBDI_0476::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0476::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0476::DeviceRunL()
 	{	
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0477.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0477Traces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0477* CUT_PBASE_T_USBDI_0477::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0477* self = new (ELeave) CUT_PBASE_T_USBDI_0477(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT, this );
 	} 
 
  
 void CUT_PBASE_T_USBDI_0477::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0477::~CUT_PBASE_T_USBDI_0477()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY_DUP01, this );
 	Cancel();
 
 	iTestPipe.Close();
@@ -67,53 +77,58 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::ExecuteHostTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0477::ExecuteDeviceTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the test step timeout
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0477::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device
 	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 TBool CUT_PBASE_T_USBDI_0477::CheckFirstInterfaceDescriptorDeviceA(TUsbInterfaceDescriptor& aIfDescriptor)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_ENTRY, this );
 	/*	Interface0	[setting0]
 		Interface1	[setting0]
 						[endpoint1] Bulk out
@@ -161,13 +176,14 @@
 		desc = desc->iNextPeer; // no peer
 		CHECK_RET_BOOL(desc == 0); 
 		
-		RDebug::Printf("CheckFirstInterfaceDescriptorDeviceA successfull!");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA, "CheckFirstInterfaceDescriptorDeviceA successfull!");
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_EXIT, this, ETrue );
 		return ETrue;
 	}
 	
 void CUT_PBASE_T_USBDI_0477::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -177,11 +193,12 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 			
@@ -190,14 +207,14 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 		
 	err = iUsbInterface0.Open(token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 	
@@ -208,10 +225,11 @@
 		TBuf<256> msg;
 		_LIT(string, "<Error %d> Token for interface could not be retrieved");
 		msg.Format(string,err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
 
@@ -220,16 +238,17 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface using token %d"),err,token1);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP04, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}
 		
 			
 	// check interface descriptor now				 
-	RDebug::Printf("check Interface descriptor now");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP05, "check Interface descriptor now");
 	TUsbInterfaceDescriptor ifDescriptor;
 	CHECK(iUsbInterface1.GetInterfaceDescriptor(ifDescriptor) == KErrNone);	
 	CHECK(CheckFirstInterfaceDescriptorDeviceA(ifDescriptor));
@@ -240,15 +259,15 @@
 	// get busId now				
 	TUsbBusId busId;	 
 	CHECK(iUsbInterface1.GetBusId(busId) == KErrNone);
-	RDebug::Printf("busId(Interface) = %d",busId);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP06, "busId(Interface) = %d",busId);
 	
 	// get device speed now
 	RUsbInterface::TDeviceSpeed deviceSpeed;
 	CHECK(iUsbInterface1.GetDeviceSpeed(deviceSpeed) == KErrNone);
-	RDebug::Printf("GetDeviceSpeed = %d", deviceSpeed);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP07, "GetDeviceSpeed = %d", deviceSpeed);
 	CHECK(deviceSpeed == RUsbInterface::EFullSpeed);	
 		
-	RDebug::Printf("Number of alternate interface settings available: %d",iUsbInterface1.GetAlternateInterfaceCount());
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP08, "Number of alternate interface settings available: %d",iUsbInterface1.GetAlternateInterfaceCount());
 	gtest(iUsbInterface1.GetAlternateInterfaceCount() == 2);
 	
 	// Select alternate interface setting 1	
@@ -257,10 +276,11 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Selecting alternate interface setting 1 on interface 1"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP09, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP03, this );
 		return;
 		}	
 	
@@ -271,37 +291,39 @@
 		{
 		TBuf<128> msg;
 		msg.Format(_L("<Error %d> Could not get address for Bulk out endpoint"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP10, msg);
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP04, this );
 		return;
 		}
 		
-	RDebug::Printf("Opening pipe for endpoint address %02x on interface 1 setting 1",endpointAddress);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP11, "Opening pipe for endpoint address %02x on interface 1 setting 1",endpointAddress);
 	err = iUsbInterface1.OpenPipeForEndpoint(iTestPipe,endpointAddress,EFalse);
 	if(err != KErrNone)
 		{
 		TBuf<128> msg;
 		msg.Format(_L("<Error %d> Unable to open pipe on interface 1 setting 0"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP12, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP05, this );
 		return;
 		}
 		
 	// get busId				
 	TUsbBusId busIdPipe;	 
 	CHECK(iTestPipe.GetBusId(busIdPipe) == KErrNone);
-	RDebug::Printf("busId(Pipe) = %d",busIdPipe);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP13, "busId(Pipe) = %d",busIdPipe);
 	CHECK(busIdPipe == busId);
 	
 	TUsbEndpointId usbEpId;
 	CHECK(iTestPipe.GetEndpointId(usbEpId) == KErrNone);
-	RDebug::Printf("EndpointId = %d",usbEpId); 
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP14, "EndpointId = %d",usbEpId); 
 	
 	// check ep descriptor now				 
-	RDebug::Printf("check ep descriptor now");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP15, "check ep descriptor now");
 	TUsbEndpointDescriptor epDescriptor;
 	
 
@@ -312,15 +334,15 @@
 	CHECK(epDescriptor.iNextPeer != 0);	// 1 peer
 
 		
-	RDebug::Printf("Pipe established now closing");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP16, "Pipe established now closing");
 	iTestPipe.Close();
 	
 	// Select alternate interface 2, error expected
 	err = iUsbInterface1.SelectAlternateInterface(2);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Warning %d> Selecting alternate interface 2",err);
-		RDebug::Printf("...Rolling Back....");
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP17, "<Warning %d> Selecting alternate interface 2",err);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP18, "...Rolling Back....");
 		
 		// Establish pipes on rollback
 		// Open a pipe for endpoint (Bulk out)		
@@ -329,14 +351,15 @@
 			{
 			TBuf<128> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe on interface 1 setting 1 for rollback case"),err);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP19, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err,msg);
 			iClientAction->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP06, this );
 			return;
 			}
 		
-		RDebug::Printf("Pipe established on rollback now closing");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP20, "Pipe established on rollback now closing");
 		iTestPipe.Close();
 		}
 	
@@ -344,42 +367,46 @@
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iClientAction->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP07, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_BUSERRORL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_ENTRY, this );
 	Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0477::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(iCaseStep == EPassed)
 		{
@@ -390,12 +417,13 @@
 		{
 		TestFailed(KErrCompletion);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::HostRunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_HOSTRUNL_ENTRY, this );
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -403,19 +431,20 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0477::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -424,6 +453,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICERUNL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0478.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0478.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0478.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0478Traces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0478* CUT_PBASE_T_USBDI_0478::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0478* self = new (ELeave) CUT_PBASE_T_USBDI_0478(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0478::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0478::~CUT_PBASE_T_USBDI_0478()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY_DUP01, this );
 	
 	Cancel();
 
@@ -70,11 +80,12 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0478::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_ENTRY, this );
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -91,21 +102,23 @@
 	// Start the connection timeout timer
 
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0478::HostDoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_ENTRY, this );
 
 	// Cancel the timeout timer for activity
 
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_ENTRY, this );
 
 	// Create the test device for this test case
 
@@ -116,30 +129,33 @@
 	// Connect the test device to the host
 
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0478::DeviceDoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_ENTRY, this );
 
 	// Cancel the test device
 	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_ENTRY, this );
 
 	Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_ENTRY, this );
 
 	Cancel();
 	TInt err(KErrNone);
@@ -150,12 +166,13 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 	
@@ -163,27 +180,27 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 
 	err = testDevice.Device().GetTokenForInterface(1,token1);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 1 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP03, "<Error %d> Token for interface 1 could not be retrieved",err);
 		return TestFailed(err);
 		}
 
 	err = iUsbInterface1.Open(token1);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface using token %d",err,token1);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP04, "<Error %d> Unable to open interface using token %d",err,token1);
 		return TestFailed(err);
 		}
 
@@ -194,33 +211,35 @@
 		{
 		TBuf<64> msg;
 		msg.Format(_L("<Error> Able to open a concurrent hande to an interface"));
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP05, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(KErrCompletion,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
-	RDebug::Printf("Attempt to open concurrent interface handle failed with: %d",err);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP06, "Attempt to open concurrent interface handle failed with: %d",err);
 	
 	// Inform client device test case successful 
 	User::After(1000000);
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP02, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_DUP01, msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -237,32 +256,35 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0478::HostRunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_HOSTRUNL_ENTRY, this );
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -270,19 +292,20 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0478::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -291,6 +314,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0479.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0479.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0479.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0479Traces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0479* CUT_PBASE_T_USBDI_0479::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0479* self = new (ELeave) CUT_PBASE_T_USBDI_0479(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0479::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0479::~CUT_PBASE_T_USBDI_0479()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY_DUP01, this );
 	
 	Cancel();
 	
@@ -67,56 +77,63 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel timing out the test step
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_ENTRY, this );
 	Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::DeviceInsertedL(TUint aDeviceHandle)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -126,12 +143,13 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
@@ -141,13 +159,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,validToken);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(validToken); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,validToken);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,validToken);
 		return TestFailed(err);
 		}
 	
@@ -156,54 +174,57 @@
 		{
 		TBuf<64> msg;
 		msg.Format(_L("<Error %d> Able to open an interface that is not present"),KErrCorrupt);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(KErrCorrupt,msg);
 		iClientAction->SendRequest(request,this);
 		}
 	else
 		{
-		RDebug::Printf("Opening interface with invalid token failed with %d",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP04, "Opening interface with invalid token failed with %d",err);
 		User::After(1000000);
 		iCaseStep = EPassed;
 		TTestCasePassed request;
 		iClientAction->SendRequest(request,this);	
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_ENTRY, this );
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_BUSERRORL_ENTRY, this );
 	
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0479::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_DUP01, msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -220,30 +241,33 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::HostRunL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0479::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -252,6 +276,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0480.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0480.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0480.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0480Traces.h"
+#endif
 
 	
 namespace NUnitTesting_USBDI
@@ -31,10 +35,12 @@
 
 CUT_PBASE_T_USBDI_0480* CUT_PBASE_T_USBDI_0480::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0480* self = new (ELeave) CUT_PBASE_T_USBDI_0480(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -43,19 +49,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iPtrTemp(NULL,0)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0480::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0480::~CUT_PBASE_T_USBDI_0480()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY_DUP01, this );
 	
 	Cancel();
 	
@@ -71,58 +81,64 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0480::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0480::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_ENTRY, this );
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0480::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_ENTRY, this );
 	
 	Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0480::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
 	TInt err(KErrNone);
@@ -133,11 +149,12 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
@@ -146,13 +163,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 	
@@ -161,10 +178,11 @@
 		{
 		TBuf<64> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
 	err = iUsbInterface1.Open(token1);
@@ -172,10 +190,11 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP04, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}
 	
@@ -187,29 +206,31 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Descriptor for endpoint 0 cannot be obtained"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP05, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP03, this );
 		return;
 		}
 	TUint16 maxPacketSize(endpointDescriptor.MaxPacketSize());
 	
-	RDebug::Printf("Maximum packet size for endpoint 1 on interface 1 setting 0 is: %d",maxPacketSize);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP06, "Maximum packet size for endpoint 1 on interface 1 setting 0 is: %d",maxPacketSize);
 	
 	// Perform a device directed control transfer
 	User::After(1000000);	
 	iCaseStep = EEmptyDeviceXfer;
 	TEmptyDeviceRequest request;
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP04, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0480::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
@@ -220,10 +241,11 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP01, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -278,34 +300,37 @@
 			break;
 			
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP02, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrGeneral);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0480::HostRunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_HOSTRUNL_ENTRY, this );
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -313,25 +338,27 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0480::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();
 	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0481.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0481.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0481Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0481* CUT_PBASE_T_USBDI_0481::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0481* self = new (ELeave) CUT_PBASE_T_USBDI_0481(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	} 
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0481::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0481::~CUT_PBASE_T_USBDI_0481()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY_DUP01, this );
 	
 	Cancel();
 	
@@ -69,11 +79,12 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0481::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_ENTRY, this );
 
 	// Create the actor for the Function Driver Framework 	
 	iActorFDF = CActorFDF::NewL(*this);
@@ -86,12 +97,13 @@
 	
 	// Start the connection timeout timer
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0481::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	// Create the test device	
 	iTestDevice->OpenL(TestCaseId());
@@ -100,38 +112,42 @@
 	
 	// Connect the device to the host	
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0481::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the test step action timeout timer	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0481::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device (the activity timer and the error reporting)	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0481::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_ENTRY, this );
 	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0481::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_ENTRY, this );
 
 	// Cancel the timeout timer	
 	Cancel();
@@ -143,11 +159,12 @@
 	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
 		{
 		// Incorrect device for this test case
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	
@@ -155,7 +172,7 @@
 	err = testDevice.Device().GetTokenForInterface(0,iToken0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
 		TestFailed(err);
 		}
 	
@@ -163,7 +180,7 @@
 	err = iUsbInterface0.Open(iToken0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0");
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
 		TestFailed(err);
 		}
 		
@@ -172,14 +189,14 @@
 	err = testDevice.Device().GetTokenForInterface(1,token1);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> token1 for interface 1",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP03, "<Error %d> token1 for interface 1",err);
 		return TestFailed(err);
 		}
 	// Open interface 1
 	err = iUsbInterface1.Open(token1); // Alternate interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 1");
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP04, "<Error %d> Unable to open interface 1", err);
 		return TestFailed(err);
 		}
 
@@ -188,16 +205,16 @@
 	err = testDevice.Device().GetTokenForInterface(1,token1Bis);
 	if(err != KErrInUse)
 		{
-		RDebug::Printf("GetTokenForInterface(1,token1Bis), err != KErrInUse");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP05, "GetTokenForInterface(1,token1Bis), err != KErrInUse");
 		return TestFailed(err);
 		}
 		
 	// Open interface 1 again, fails
-	RDebug::Printf("open it twice, catch error Code");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP06, "open it twice, catch error Code");
 	err = iUsbInterface1.Open(token1); // Alternate interface setting 0
 	if(err != KErrInUse)
 		{
-		RDebug::Printf("iUsbInterface1.Open(token1), err != KErrInUse");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP07, "iUsbInterface1.Open(token1), err != KErrInUse");
 		return TestFailed(err);
 		}
 
@@ -206,19 +223,20 @@
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iControlEp0->SendRequest(request,this);	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0481::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_DUP01, msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -235,30 +253,33 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0481::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0481::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0481::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_HOSTRUNL_ENTRY, this );
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -266,14 +287,15 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_HOSTRUNL_EXIT, this );
 	}
 
 /**
@@ -282,11 +304,12 @@
 */
 void CUT_PBASE_T_USBDI_0481::DeviceRunL()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_DEVICERUNL_ENTRY, this );
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0482.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0482.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,10 @@
 
 #include "PBASE-T_USBDI-0482.h"
 #include "tada22.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0482Traces.h"
+#endif
 #include <d32usbdescriptors.h>
 
 
@@ -45,10 +49,12 @@
 
 CUT_PBASE_T_USBDI_0482* CUT_PBASE_T_USBDI_0482::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0482* self = new (ELeave) CUT_PBASE_T_USBDI_0482(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -57,21 +63,25 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY, this );
 	iEndpointAddressIn = 0x84;
 	iEndpointAddressOut = 0x01;
 	iOutTransferBuf.CreateL(KChunkSize);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0482::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_CONSTRUCTL_ENTRY, this );
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0482::~CUT_PBASE_T_USBDI_0482()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY_DUP01, this );
 	
 	Cancel();
 		
@@ -92,11 +102,12 @@
 	delete iIsochInTransfer;
 	delete iControlEp0;
 	delete iActorFDF;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0482::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
@@ -104,90 +115,101 @@
 	
 	// Wait for the usb headset to be connected	
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 		
 void CUT_PBASE_T_USBDI_0482::HostDoCancel()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_EXIT, this );
 	}	
 	
 
 void CUT_PBASE_T_USBDI_0482::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 		
 	
 void CUT_PBASE_T_USBDI_0482::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0482::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
 		TInt aCompletionCode)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 
 TInt CUT_PBASE_T_USBDI_0482::FindOUTIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_ENTRY, this );
 	aDescriptor = NULL;
 
 	TUsbInterfaceDescriptor alternate;
 	TInt err = iUsbInterface1.GetAlternateInterfaceDescriptor(1, alternate);
 	if(err)
 		{
-		RDebug::Printf("iUsbInterface1.GetAlternateInterfaceDescriptor error = %d",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT, "iUsbInterface1.GetAlternateInterfaceDescriptor error = %d",err);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT, this, err );
 		return err;
 		} 
 
 	TUsbGenericDescriptor* descriptor = alternate.iFirstChild;
 	while(descriptor)
 		{
-		RDebug::Printf("ibDescriptorType = %d", descriptor->ibDescriptorType);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP01, "ibDescriptorType = %d", descriptor->ibDescriptorType);
 		if(descriptor->ibDescriptorType == EEndpoint)
 			{
 			aDescriptor = descriptor;
-			RDebug::Printf("found descriptor return KErrNone");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP02, "found descriptor return KErrNone");
+			OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP01, this, KErrNone );
 			return KErrNone;
 			}	
 		descriptor = descriptor->iNextPeer;
 		}
 
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP02, this, KErrNotFound );
 	return KErrNotFound;	
 	}
 
 	
 TInt CUT_PBASE_T_USBDI_0482::FindINIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_ENTRY, this );
 	aDescriptor = NULL;
 
 	TUsbInterfaceDescriptor alternate;
 	TInt err = iUsbInterface2.GetAlternateInterfaceDescriptor(1, alternate);
 	if(err)
 		{
-		RDebug::Printf("iUsbInterface2.GetAlternateInterfaceDescriptor error = %d",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT, "iUsbInterface2.GetAlternateInterfaceDescriptor error = %d",err);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT, this, err );
 		return err;
 		} 
 
 	TUsbGenericDescriptor* descriptor = alternate.iFirstChild;
 	while(descriptor)
 		{
-		RDebug::Printf("ibDescriptorType = %d", descriptor->ibDescriptorType);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP01, "ibDescriptorType = %d", descriptor->ibDescriptorType);
 		if(descriptor->ibDescriptorType == EEndpoint)
 			{
 			aDescriptor = descriptor;
-			RDebug::Printf("found descriptor return KErrNone");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP02, "found descriptor return KErrNone");
+			OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP01, this, KErrNone );
 			return KErrNone;
 			}
 		descriptor = descriptor->iNextPeer;
 		}
 
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP02, this, KErrNotFound );
 	return KErrNotFound;	
 	}	
 	
@@ -195,7 +217,7 @@
 	
 void CUT_PBASE_T_USBDI_0482::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
 	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
@@ -213,7 +235,7 @@
 	
 	CHECK(iUsbInterface1.Open(token1) == KErrNone); // Default interface setting 0
 	
-	RDebug::Printf("Selecting alternate interface setting 1");		
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL, "Selecting alternate interface setting 1");
 	CHECK(iUsbInterface1.SelectAlternateInterface(1) == KErrNone);
 
 	
@@ -223,21 +245,21 @@
 	CHECK(iUsbInterface2.Open(token2) == KErrNone); // Default interface setting 0
 
 	
-	RDebug::Printf("Selecting alternate interface setting 1");		
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP01, "Selecting alternate interface setting 1");
 	CHECK(iUsbInterface2.SelectAlternateInterface(1) == KErrNone);
 
 																
 	iCaseStep = EWaitEndOfMusicTrack;
 												
 	// Open a pipe for endpoint (Isoch out)		
-	RDebug::Printf("Finding address for an out isoch endpoint on interface 1 setting 1");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP02, "Finding address for an out isoch endpoint on interface 1 setting 1");
 	// Isochronous OUT	
 	TUsbGenericDescriptor* isochEpDescriptorOut;
 	CHECK(KErrNone == FindOUTIsochronousEndpoint(isochEpDescriptorOut));
 	
 	// Get the maximum packet size for this isochronous endpoint
 	TUint16 wMaxPacketSizeOut = isochEpDescriptorOut->TUint16At(KMaxPacketSizeOffset);	
-	RDebug::Printf("wMaxPacketSizeOut = %d", wMaxPacketSizeOut);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP03, "wMaxPacketSizeOut = %d", wMaxPacketSizeOut);
 	CHECK(wMaxPacketSizeOut == KMaxPacketSizeOutExpected); 
 	
 	// Isochronous IN		
@@ -246,22 +268,22 @@
 	
 	// Get the maximum packet size for this isochronous endpoint
 	TUint16 wMaxPacketSizeIn = isochEpDescriptorIn->TUint16At(KMaxPacketSizeOffset);	
-	RDebug::Printf("wMaxPacketSizeIn = %d", wMaxPacketSizeIn);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP04, "wMaxPacketSizeIn = %d", wMaxPacketSizeIn);
 	CHECK(wMaxPacketSizeIn == KMaxPacketSizeInExpected); 
 		
 	
 	// open pipes now.
 	// Out
-	RDebug::Printf("Opening a pipe to %08x",iEndpointAddressOut);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP05, "Opening a pipe to %08x",iEndpointAddressOut);
 	CHECK(iUsbInterface1.OpenPipeForEndpoint(iPipeOut,iEndpointAddressOut,EFalse) == KErrNone);
 		
-	RDebug::Printf("Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressOut);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP06, "Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressOut);
 				
 	// In
-	RDebug::Printf("Opening a pipe to %08x",iEndpointAddressIn);		
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP07, "Opening a pipe to %08x",iEndpointAddressIn);		
 	CHECK(iUsbInterface2.OpenPipeForEndpoint(iPipeIn,iEndpointAddressIn,EFalse) == KErrNone);
 		
-	RDebug::Printf("Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressIn);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP08, "Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressIn);
 	
 	// SET_CUR class specific command
 	TSetCurRequest request(KHighRecordSamplingRate ,iEndpointAddressIn);
@@ -275,7 +297,7 @@
 	CHECK(iIsochInTransfer->RegisterTransferDescriptor() == KErrNone);
 			
 	// Initialise the descriptors for transfer	
-	RDebug::Printf("Initialising the transfer descriptors interface 2"); 
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP09, "Initialising the transfer descriptors interface 2");
 	CHECK(iUsbInterface2.InitialiseTransferDescriptors() == KErrNone);
 
 				
@@ -312,7 +334,7 @@
 	// create Transfers
 	for(iChunk = 0; iChunk < nbChunks; iChunk++)
 		{
-		RDebug::Printf("iChunk = %d", iChunk);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP10, "iChunk = %d", iChunk);
 		
 		// remainder(last loop)
 		if(remainderSize != 0 && (iChunk == nbChunks-1))
@@ -327,18 +349,18 @@
 		}			
 	
 	// Initialise the descriptors for transfer	
-	RDebug::Printf("Initialising the transfer descriptors"); 
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP11, "Initialising the transfer descriptors");
 	CHECK(iUsbInterface1.InitialiseTransferDescriptors() == KErrNone);
 	
 	// prepare & send transfers(TODO streaming algorithm with 3 Transfers only, filling 2 while the 3rd is transferring his data)
 	size = KChunkSize;
 	for(TInt iTransfers = 0; iTransfers < iOutTransfers.Count(); iTransfers++)
 		{	
-		RDebug::Printf("iTransfers = %d", iTransfers);	
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP12, "iTransfers = %d", iTransfers);	
 		// remainder(last loop)
 		if(remainderSize != 0 && (iTransfers == iOutTransfers.Count()-1))
 			{
-			RDebug::Printf("remainderSize = %d", remainderSize);
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP13, "remainderSize = %d", remainderSize);
 			size = remainderSize;
 			}			
 		CHECK(trackFile.Read(KChunkSize*iTransfers, iOutTransferBuf, size) == KErrNone);
@@ -346,19 +368,20 @@
 		CHECK(iOutTransfers[iTransfers]->TransferOut() == KErrNone);
 		iOutTransferBuf.Zero();		
 		}												
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 TBool CUT_PBASE_T_USBDI_0482::ReplayRecordedData()
 	{
-	LOG_FUNC
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_ENTRY, this );
 		
 	iOutTransferBuf.Zero();	
 	
 	// Transfer OUT						
 	TInt nbChunks = iDataPolledBuf.Length()/KChunkSize;
 	TInt remainderSize = iDataPolledBuf.Length()%KChunkSize; 
-	RDebug::Printf("nbChunks = %d", nbChunks);
-	RDebug::Printf("remainderSize = %d", remainderSize);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA, "nbChunks = %d", nbChunks);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP01, "remainderSize = %d", remainderSize);
 		
 	if(remainderSize != 0) 
 		{
@@ -368,29 +391,31 @@
 	// prepare transfers	
 	for(TInt iTransfers = 0; iTransfers < nbChunks; iTransfers++)
 		{	
-		RDebug::Printf("iTransfers = %d", iTransfers);	
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP02, "iTransfers = %d", iTransfers);	
 		// remainder(last loop)
 		if(remainderSize != 0 && (iTransfers == nbChunks-1))
 			{
-			RDebug::Printf("remainderSize = %d", remainderSize);
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP03, "remainderSize = %d", remainderSize);
 			}		
 		CHECK_RET_BOOL(iOutTransfers[iTransfers]->PrepareTransfer(iDataPolledBuf) == KErrNone); // TODO retrieve relevant part of iDataPolledBuf if several chunks
 		CHECK_RET_BOOL(iOutTransfers[iTransfers]->TransferOut() == KErrNone);
 		iOutTransferBuf.Zero();	
 		}
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_EXIT, this, ETrue );
 	return ETrue;			
 	}
 		
 void CUT_PBASE_T_USBDI_0482::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_ENTRY, this );
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 	Cancel();
 
 	if(aCompletionCode != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Transfer %d not successful",aCompletionCode,aTransferId);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP01, "<Error %d> Transfer %d not successful",aCompletionCode,aTransferId);
 		TestFailed(aCompletionCode);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT, this );
 		return;
 		}
 	
@@ -400,6 +425,7 @@
 		// 1. save data recorded
 		CHECK(iIsochInTransfer->DataPolled(KRecordedPacketsExpected, iDataPolledBuf));
 		// 2. waiting now for the end of the music track
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP01, this );
 		return;	
 		}
 				
@@ -409,14 +435,14 @@
 			{
 			if(aTransferId != iExpectedTransferId)
 				{
-				RDebug::Printf("unexpected transfer!");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP02, "unexpected transfer!");
 				TestFailed(KErrCorrupt);
 				}
 			iExpectedTransferId++;		
 			// is it the last transfer?
 			if(iExpectedTransferId == iOutTransfers.Count())
 				{
-				RDebug::Printf("last transfer successful! lets replay recorded data");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP03, "last transfer successful! lets replay recorded data");
 						
 				iCaseStep = EReplayRecordedData; // assuming that recording is finished
 				TSetCurRequest request(KLowSamplingRate ,iEndpointAddressOut);
@@ -435,18 +461,20 @@
 			TestFailed(KErrDisconnected);
 			break;
 		}			
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP02, this );
 	}									   
 
 void CUT_PBASE_T_USBDI_0482::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
-	RDebug::Printf("Transfer EP0 completed aCompletionCode = %d", aCompletionCode);
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL, "Transfer EP0 completed aCompletionCode = %d", aCompletionCode);
 
 	if(aCompletionCode != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		RDebug::Print(msg);			
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP01, msg);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT, this );
 		return;			
 		}	
 	switch(iCaseStep)
@@ -461,16 +489,17 @@
 			break;			
 		
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP02, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}	
 	 	
 	
 void CUT_PBASE_T_USBDI_0482::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_ENTRY, this );
 	
 	// Manual test over	
 	switch(iCaseStep)
@@ -484,20 +513,22 @@
 			TestFailed(KErrDisconnected);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0482::BusErrorL(TInt aError)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_BUSERRORL_ENTRY, this );
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrCompletion);	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0482::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_HOSTRUNL_ENTRY, this );
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -505,18 +536,21 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0482::DeviceRunL()
 	{	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_DEVICERUNL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICERUNL_EXIT, this );
 	}
 		
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0483.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0483.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0483.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0483Traces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0483* CUT_PBASE_T_USBDI_0483::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0483* self = new (ELeave) CUT_PBASE_T_USBDI_0483(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,18 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0483::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceB(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0483::~CUT_PBASE_T_USBDI_0483()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY_DUP01, this );
 	Cancel();
 	
 	// Close the interface
@@ -65,11 +76,12 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0483::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_ENTRY, this );
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -87,21 +99,23 @@
 
 	TimeoutIn(30);
 
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0483::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the test step timeout timer
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	// Create the test device
 	
@@ -112,32 +126,35 @@
 	// Connect the device to the host
 	
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the reporting or errors from opertaions perfomed by the test device
 	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC       
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_ENTRY, this );
 	
 	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0483::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
@@ -148,10 +165,11 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP01, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -180,14 +198,15 @@
 			break;
 			
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP02, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}	
 void CUT_PBASE_T_USBDI_0483::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC 
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
@@ -199,83 +218,89 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 		
-	RDebug::Printf("iControlEp0->SendRequest(getConfiguration,this)");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP01, "iControlEp0->SendRequest(getConfiguration,this)");
 	TUint32 token0;
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP02, "<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 1 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP03, "<Error %d> Unable to open interface 1 using token %d",err,token0);
 		return TestFailed(err);
 		} 
 	
 	// get config. descriptor now
 	TUint totalLength = testDevice.ConfigurationDescriptor().TotalLength();
-	RDebug::Printf("totalLength ==== %d",totalLength);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP04, "totalLength ==== %d",totalLength);
 	iConfigDescriptorData = HBufC8::NewL(totalLength); 		
 	TPtr8 des(iConfigDescriptorData->Des());
 	des.SetLength(totalLength);		
 	TDescriptorGetRequest getConfiguration(KGetConfigDescriptor,0,des);
 	iControlEp0->SendRequest(getConfiguration,this);	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}	 
 
 	
 void CUT_PBASE_T_USBDI_0483::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_ENTRY, this );
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 	
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_BUSERRORL_ENTRY, this );
 	
 	// This test case handles no failiures on the bus
 	
 	TestFailed(KErrCompletion);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0483::HostRunL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0483::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -284,6 +309,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0484.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0484.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0484.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0484Traces.h"
+#endif
 
 
  
@@ -37,10 +41,12 @@
 
 CUT_PBASE_T_USBDI_0484* CUT_PBASE_T_USBDI_0484::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0484* self = new (ELeave) CUT_PBASE_T_USBDI_0484(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -49,32 +55,37 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0484::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0484::~CUT_PBASE_T_USBDI_0484()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0484::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();	
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_DUP01, msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -91,14 +102,16 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0484::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone);
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	if(aTransferId == KBulkTransferId1)
 		{
@@ -108,7 +121,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> The transfer completed with no errors but should have stalled"),aCompletionCode);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP01, msg);
 				TTestCaseFailed request(KErrCorrupt,msg);
 				return iControlEp0->SendRequest(request,this);
 				}
@@ -120,14 +133,14 @@
 					{
 					TBuf<256> msg;
 					msg.Format(_L("<Error %d> The remote stall cannot be cleared"),err);
-					RDebug::Print(msg);
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP02, msg);
 					iCaseStep = EFailed;
 					TTestCaseFailed request(err,msg);
 					return iControlEp0->SendRequest(request,this);
 					}
 					
 				// try to get data now, after EP has been stalled
-				RDebug::Printf("try to get data now, after EP has been stalled");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP03, "try to get data now, after EP has been stalled");
 				iInTransfer[0]->TransferIn(KDataPayload1().Length());
 				iInTransfer[1]->TransferIn(KDataPayload2().Length());
 				iInTransfer[2]->TransferIn(KDataPayload3().Length());
@@ -135,6 +148,7 @@
 				iCaseStep = ETransferAfterStall;
 				TEndpointWriteRequest request(1,1,KDataPayload1);// EP1 because 1st writter EP
 				iControlEp0->SendRequest(request,this);	
+				OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT, this );
 				return;		
 				}
 			}
@@ -144,7 +158,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP04, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -157,13 +171,13 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP05, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCompletion,msg);
 				return iControlEp0->SendRequest(request,this);
 				}			 
 			// Comparison is a match, wait for next transfer
-			RDebug::Printf("Comparison is a match, wait for transfer 2");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP06, "Comparison is a match, wait for transfer 2");
 			User::After(500000);
 			TEndpointWriteRequest request(1,1,KDataPayload2);// EP1 because 1st writter EP
 			iControlEp0->SendRequest(request,this);						
@@ -175,7 +189,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP07, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -188,13 +202,13 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP08, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
 			}			 
 		// Comparison is a match, wait for next transfer
-		RDebug::Printf("Comparison is a match, wait for transfer 3");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP09, "Comparison is a match, wait for transfer 3");
 		User::After(500000);
 		TEndpointWriteRequest request(1,1,KDataPayload3);// EP1 because 1st writter EP
 		iControlEp0->SendRequest(request,this);					
@@ -205,7 +219,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP10, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -217,7 +231,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP11, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -229,18 +243,19 @@
 		}
 	else
 		{
-		RDebug::Printf("<Error> a transfer completed (id=%d) that was not expected",aTransferId);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP12, "<Error> a transfer completed (id=%d) that was not expected",aTransferId);
 		return TestFailed(KErrCorrupt);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0484::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -258,7 +273,7 @@
 		iInTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId3);	
 		
 		// Initialise the descriptors for transfer		
-		RDebug::Printf("Initialising the transfer descriptors - interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
 		err = iUsbInterface1.InitialiseTransferDescriptors();
 		if(err != KErrNone)
 			{
@@ -268,7 +283,7 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP02, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
@@ -281,6 +296,7 @@
 		TStallEndpointRequest r2(2,1); // Stall endpoint 2 interface 1
 		iControlEp0->SendRequest(r2,this);		
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0485.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0485.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0485Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0485* CUT_PBASE_T_USBDI_0485::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0485* self = new (ELeave) CUT_PBASE_T_USBDI_0485(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	} 
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0485::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0485::~CUT_PBASE_T_USBDI_0485()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY_DUP01, this );
 	
 	Cancel();
 	
@@ -67,11 +77,12 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0485::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_ENTRY, this );
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -88,12 +99,13 @@
 	// Start the connection timeout timer
 
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0485::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	// Create the test device
 	
@@ -104,40 +116,44 @@
 	// Connect the device to the host
 	
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0485::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the test step action timeout timer
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0485::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device (the activity timer and the error reporting)
 	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0485::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_ENTRY, this );
 	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0485::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_ENTRY, this );
 
 	// Cancel the timeout timer
 	
@@ -152,12 +168,13 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	
@@ -166,7 +183,7 @@
 	err = testDevice.Device().GetTokenForInterface(0,iToken0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
 		TestFailed(err);
 		}
 	
@@ -174,7 +191,7 @@
 	err = iUsbInterface0.Open(iToken0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0");
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
 		TestFailed(err);
 		}
 	
@@ -187,15 +204,16 @@
 	
 	// Wait 1 second then close the interface	
 	User::After(1000000);
-	RDebug::Printf("Closing interface 0");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP03, "Closing interface 0");
 	iUsbInterface0.Close();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0485::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 		
 	switch(iCaseStep)
 		{
@@ -203,24 +221,24 @@
 			{
 			if(aCompletionCode != KErrCancel)
 				{
-				RDebug::Printf("<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP01, "<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
 				return TestFailed(aCompletionCode);
 				}
 		
 			// No panic or leave so passed
 			
-			RDebug::Printf("No leave or panic occured so open interface again and send test passed");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP02, "No leave or panic occured so open interface again and send test passed");
 			
 			// Open the interface
 			
 			TInt err(iUsbInterface0.Open(iToken0));
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to open interface 0");
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP03, "<Error %d> Unable to open interface 0", err);
 				return TestFailed(err);
 				}
 			
-			RDebug::Printf("Interface 0 re-opened");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP04, "Interface 0 re-opened");
 			
 			iCaseStep = EPassed;
 			TTestCasePassed request;
@@ -237,32 +255,35 @@
 			TestFailed(KErrCompletion);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0485::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0485::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0485::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_HOSTRUNL_ENTRY, this );
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -270,14 +291,15 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_HOSTRUNL_EXIT, this );
 	}
 
 /**
@@ -286,7 +308,7 @@
 */
 void CUT_PBASE_T_USBDI_0485::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -295,6 +317,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0486.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0486.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0486Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -31,10 +35,12 @@
 
 CUT_PBASE_T_USBDI_0486* CUT_PBASE_T_USBDI_0486::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0486* self = new (ELeave) CUT_PBASE_T_USBDI_0486(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_NEWL_EXIT, ( TUint )( self ) );
 	return self;  
 	} 
 	
@@ -43,20 +49,25 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EWaitForDeviceCConnection)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0486::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 	iTestDeviceC = new RUsbDeviceC(this);  // TODO check tree for device C, once inserted
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_CONSTRUCTL_EXIT, this );
 	}
 
 CUT_PBASE_T_USBDI_0486::~CUT_PBASE_T_USBDI_0486()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY_DUP01, this );
 	
 	delete iTestDeviceC;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT_DUP01, this );
 	}
 	
 /**
@@ -65,37 +76,41 @@
 */
 void CUT_PBASE_T_USBDI_0486::DeviceRunL()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_DEVICERUNL_ENTRY, this );
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICERUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0486::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_ENTRY, this );
 	iTestDeviceC->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 TBool CUT_PBASE_T_USBDI_0486::CheckSN(const TDesC16& aSerialNumberGot, const TDesC& aExpectedSerialNumber)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_CHECKSN_ENTRY, this );
 	TBool areSNsIdenticals = (aSerialNumberGot.Compare(aExpectedSerialNumber) == 0);	
 	 
 	if(!areSNsIdenticals)
 		{
 		// Incorrect device for this test case	
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&aSerialNumberGot, &aExpectedSerialNumber);
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_CHECKSN, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,aSerialNumberGot, aExpectedSerialNumber);
 		}
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0486_CHECKSN_EXIT, this, areSNsIdenticals );
 	return areSNsIdenticals;
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0486::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_ENTRY, this );
 
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
-	RDebug::Printf("--->Ep0TransferCompleteL, case step = %d", iCaseStep);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP01, "--->Ep0TransferCompleteL, case step = %d", iCaseStep);
 
 	switch(iCaseStep)
 		{
@@ -103,7 +118,7 @@
 			{
 			if(aCompletionCode != KErrNone)
 				{
-				RDebug::Printf("<Error %d> aCompletionCode != KErrNone",aCompletionCode);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP02, "<Error %d> aCompletionCode != KErrNone",aCompletionCode);
 				return TestFailed(aCompletionCode);
 				}
 			// close interface 0			
@@ -120,13 +135,14 @@
 			TestFailed(KErrCompletion);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0486::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
-	RDebug::Printf("--->TransferCompleteL, case step = %d", iCaseStep);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL, "--->TransferCompleteL, case step = %d", iCaseStep);
 
 	if(aTransferId == KBulkTranferId)
 		{							
@@ -134,23 +150,24 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> The transfer completed with no errors but should have done so"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP01, msg);
 			TTestCaseFailed request(KErrCorrupt,msg);
 			return iControlEp0->SendRequest(request,this);
 			} 					
 		}
 	else
 		{
-		RDebug::Printf("<Error> a transfer completed (id=%d) that was not expected",aTransferId);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP02, "<Error> a transfer completed (id=%d) that was not expected",aTransferId);
 		return TestFailed(KErrCorrupt);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_EXIT, this );
 	}	
 	
 	
 void CUT_PBASE_T_USBDI_0486::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
-	RDebug::Printf("--->DeviceInsertedL, case step = %d", iCaseStep);
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL, "--->DeviceInsertedL, case step = %d", iCaseStep);
 
 	// Cancel the timeout timer	
 	Cancel();	
@@ -173,14 +190,14 @@
 			err = testDevice.Device().GetTokenForInterface(0,iToken0DeviceC);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
 				TestFailed(err);
 				} 
 			// Open the interface	
 			err = iUsbInterface0.Open(iToken0DeviceC);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to open interface 0");
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
 				TestFailed(err);
 				}
 				
@@ -190,7 +207,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP03, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -202,7 +219,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP04, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -215,19 +232,19 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Address for bulk in endpoint could not be obtained"),err);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP05, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
 				}
-			RDebug::Printf("Endpoint adress %08x",endpointAddress);
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP06, "Endpoint adress %08x",endpointAddress);
 	
 			err = iUsbInterface1.OpenPipeForEndpoint(iTestPipeInterface1BulkIn,endpointAddress,ETrue);
 			if(err != KErrNone)
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP07, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -237,13 +254,13 @@
 			iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this, KBulkTranferId);
 		
 			// Initialise the descriptors for transfer		
-			RDebug::Printf("Initialising the transfer descriptors");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP08, "Initialising the transfer descriptors");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP09, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -271,7 +288,7 @@
 			err = iUsbInterface0.Open(iToken0DeviceC);
 			if(err != KErrNotFound) // invalid token
 				{
-				RDebug::Printf("iUsbInterface0.Open(iToken0DeviceC) === %d", err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP10, "iUsbInterface0.Open(iToken0DeviceC) === %d", err);
 				TestFailed(err);
 				}
 			
@@ -280,14 +297,14 @@
 			err = testDevice.Device().GetTokenForInterface(0,token0DeviceA);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to retrieve token(device A) for interface 0",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP11, "<Error %d> Unable to retrieve token(device A) for interface 0",err);
 				TestFailed(err);
 				} 
 			// Open the interface	
 			err = iUsbInterface0.Open(token0DeviceA);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to open interface 0(device A)");
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP12, "<Error %d> Unable to open interface 0(device A)", err);
 				TestFailed(err);
 				}
 			
@@ -302,18 +319,19 @@
 			
 		default:
 			{
-			RDebug::Printf("<Error> Test case actions out of sync");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP13, "<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			}	
 			break;
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0486::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_ENTRY, this );
 	Cancel();	
-	RDebug::Printf("--->DeviceRemovedL, case step = %d", iCaseStep);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL, "--->DeviceRemovedL, case step = %d", iCaseStep);
 
 	switch(iCaseStep)
 		{
@@ -325,23 +343,25 @@
 			break;		
 	
 		default:
-			RDebug::Printf("<Error> Test case actions out of sync");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_DUP01, "<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			break;
 			}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0486::HandleDeviceDConnection()
 	{
-	LOG_FUNC
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_ENTRY, this );
 		
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0486::ExecuteDeviceTestCaseL()	
 	{ 
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	// Create the test device	
 	iTestDeviceC->OpenL(KTestDeviceC_SN());
@@ -350,15 +370,20 @@
 	
 	// Connect the device to the host	
 	iTestDeviceC->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 RUsbDeviceC* CUT_PBASE_T_USBDI_0486::TestDeviceC()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_TESTDEVICEC_ENTRY, this );
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0486_TESTDEVICEC_EXIT, this, ( TUint )( iTestDeviceC ) );
 	return iTestDeviceC;
 	}
 
 RUsbDeviceD* CUT_PBASE_T_USBDI_0486::TestDeviceD()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_TESTDEVICED_ENTRY, this );
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0486_TESTDEVICED_EXIT, this, ( TUint )( iTestDevice ) );
 	return iTestDevice; //from CBaseBulkTestCase
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0487.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0487Traces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -37,10 +41,12 @@
 
 CUT_PBASE_T_USBDI_0487* CUT_PBASE_T_USBDI_0487::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0487* self = new (ELeave) CUT_PBASE_T_USBDI_0487(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -49,19 +55,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0487::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0487::~CUT_PBASE_T_USBDI_0487()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY_DUP01, this );
 	
 	Cancel();
 	delete iTransferIn;
@@ -82,56 +92,62 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0487::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0487::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the timeout timer	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0487::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0487::DeviceDoCancel()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_ENTRY, this );
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0487::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
 		TInt aCompletionCode)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -141,14 +157,15 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		CancelTimeout();
 		iTimer.After(iStatus,30000000);
 		SetActive();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
@@ -156,13 +173,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 	
@@ -171,7 +188,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -181,7 +198,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP04, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -193,10 +210,11 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Selecting alternate interface setting 1 on interface 1"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP05, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
 	
@@ -207,10 +225,11 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> unable to get endpoint address for interrupt in endpoint"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP06, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}	
 	
@@ -219,12 +238,12 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open pipe for endpoint 1"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP07, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);		
 		}	
-	RDebug::Printf("Opened pipe to endpoint address %08x for interrupt transfer to host",endpointAddress);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP08, "Opened pipe to endpoint address %08x for interrupt transfer to host",endpointAddress);
 	
 	
 	// create an interrupt transfer
@@ -240,11 +259,12 @@
 	iTransferIn3->RegisterTransferDescriptor();		
 	
 	// Initialise the descriptors for transfer
-	RDebug::Printf("Initialising the transfer descriptors");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP09, "Initialising the transfer descriptors");
 	err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to initialise transfer descriptors",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP10, "<Error %d> Unable to initialise transfer descriptors",err);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP03, this );
 		return;
 		} 
 			
@@ -254,7 +274,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to queue an interrupt transfer"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP11, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);	
@@ -266,7 +286,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to queue an interrupt transfer"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP12, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);	
@@ -278,7 +298,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to queue an interrupt transfer"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP13, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);	
@@ -289,12 +309,13 @@
 	// Instruct the client device to write the following data through the valid endpoint	
 	TEndpointWriteRequest request(1,1,KDataPayload1);
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP04, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
 	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d"),aCompletionCode;
 	
@@ -302,7 +323,7 @@
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL, msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -319,21 +340,22 @@
 		{
 		return TestFailed(KErrCompletion);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
-	RDebug::Printf("Transfer %d completed with %d",aTransferId,aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL, "Transfer %d completed with %d",aTransferId,aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer %d did not complete successfully"),aCompletionCode,aTransferId);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP01, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(aCompletionCode,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -343,20 +365,20 @@
 		{
 		TPtrC8 data(iTransferIn->DataPolled());
 		
-		RDebug::Printf("data.Length 1()= %d", data.Length());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP02, "data.Length 1()= %d", data.Length());
 		
 			TBuf<256> msg;
 		for(int i = 0 ; i < data.Length(); i++)
 			{		
 			msg.AppendFormat(_L("%02x"),data[i]);
 			}
-			RDebug::Print(msg);	
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP03, msg);
 		// Compare the data to what is expected		
 		if(data.Compare(KDataPayload1) != 0)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP04, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -369,21 +391,21 @@
 	else if(aTransferId == KInterruptTransferId2)
 		{
 		TPtrC8 data(iTransferIn2->DataPolled());
-		RDebug::Printf("data.Length 2()= %d", data.Length());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP05, "data.Length 2()= %d", data.Length());
 	
 		TBuf<256> msg;
 		for(int i = 0 ; i < data.Length(); i++)
 			{		
 			msg.AppendFormat(_L("%02x"),data[i]);
 			}
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP06, msg);
 				
 		// Compare the data to what is expected		
 		if(data.Compare(KDataPayload1) != 0)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP07, msg);
 			//TODO if test fails! Test fail code below WAS commented out
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
@@ -402,7 +424,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP08, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -414,58 +436,63 @@
 		}		
 	else
 		{
-		RDebug::Printf("<Error> Unknown transfer identity");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP09, "<Error> Unknown transfer identity");
 		TestFailed(KErrUnknown);	
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_ENTRY, this );
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error	
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0487::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_BUSERRORL_ENTRY, this );
 	
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrCompletion);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0487::HostRunL()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0487::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();
 	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0488.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0488.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0488.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0488Traces.h"
+#endif
 #include <d32usbdi_errors.h>
 
 namespace NUnitTesting_USBDI
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0488* CUT_PBASE_T_USBDI_0488::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0488* self = new (ELeave) CUT_PBASE_T_USBDI_0488(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0488::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0488::~CUT_PBASE_T_USBDI_0488()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY_DUP01, this );
 	
 	Cancel();
 	
@@ -67,27 +77,30 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_ENTRY, this );
 		
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 /*static*/ TInt CUT_PBASE_T_USBDI_0488::TestSelectAlternateInterfaceThenPanic(TAny* aTest) 
 	{
-	LOG_CFUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_ENTRY, 0 );
 	
 	CTrapCleanup* trapHandler=CTrapCleanup::New();
 	if(!trapHandler)
 		{
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT, 0, KErrNoMemory );
 		return KErrNoMemory;
 		}		
 						
@@ -97,6 +110,7 @@
 	pTest->iUsbInterface1.SelectAlternateInterface(0); // panic expected
 	
 	// Should never get here.*/
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT_DUP01, 0, KErrNone );
 	return KErrNone;
 	}
 	
@@ -104,39 +118,43 @@
 	
 void CUT_PBASE_T_USBDI_0488::HostDoCancel()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_ENTRY, this );
 	// Cancel the timeout timer	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0488::DeviceDoCancel()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_ENTRY, this );
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
 		TInt aCompletionCode)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0488::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -145,12 +163,13 @@
 	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
 		{
 		// Incorrect device for this test case
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 		// Start the connection timeout again
 		CancelTimeout();
 		iTimer.After(iStatus,30000000);
 		SetActive();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 	
@@ -159,13 +178,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 		
@@ -175,7 +194,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -185,7 +204,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP04, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -197,10 +216,11 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Selecting alternate interface setting 1 on interface 1"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP05, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}  
 	
@@ -211,10 +231,11 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> unable to get endpoint address for interrupt in endpoint"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP06, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}	
 	
@@ -223,7 +244,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open pipe for endpoint 1"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP07, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);		
@@ -252,15 +273,15 @@
 
 void CUT_PBASE_T_USBDI_0488::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_DUP01, msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -277,55 +298,60 @@
 		{
 		return TestFailed(KErrCompletion);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0488::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_ENTRY, this );
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error	
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_BUSERRORL_ENTRY, this );
 	
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrCompletion);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0488::HostRunL()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0488::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();
 	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0489Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -29,10 +33,12 @@
 
 CUT_PBASE_T_USBDI_0489* CUT_PBASE_T_USBDI_0489::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0489* self = new (ELeave) CUT_PBASE_T_USBDI_0489(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	} 
 	
@@ -41,19 +47,23 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0489::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0489::~CUT_PBASE_T_USBDI_0489()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY_DUP01, this );
 	
 	Cancel();
 	
@@ -67,11 +77,12 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::ExecuteHostTestCaseL()	
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_ENTRY, this );
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -88,12 +99,13 @@
 	// Start the connection timeout timer
 
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::ExecuteDeviceTestCaseL()	
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_ENTRY, this );
 	
 	// Create the test device
 	
@@ -104,40 +116,44 @@
 	// Connect the device to the host
 	
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::HostDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_ENTRY, this );
 	
 	// Cancel the test step action timeout timer
 	
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0489::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device (the activity timer and the error reporting)
 	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_ENTRY, this );
 	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_ENTRY, this );
 
 	// Cancel the timeout timer
 	
@@ -152,12 +168,13 @@
 		{
 		// Incorrect device for this test case	
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	
@@ -166,7 +183,7 @@
 	err = testDevice.Device().GetTokenForInterface(0,iToken0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
 		TestFailed(err);
 		}
 	
@@ -174,7 +191,7 @@
 	err = iUsbInterface0.Open(iToken0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open interface 0");
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
 		TestFailed(err);
 		}
 	
@@ -187,13 +204,14 @@
 	
 	// Wait 1 second then cancel EP0 transfer
 	User::After(1000000);
-	RDebug::Printf("Cancelling EP0 transfer");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP03, "Cancelling EP0 transfer");
 	iUsbInterface0.CancelEP0Transfer();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
 	switch(iCaseStep)
 		{
@@ -201,23 +219,23 @@
 			{
 			if(aCompletionCode != KErrCancel)
 				{
-				RDebug::Printf("<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL, "<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
 				return TestFailed(aCompletionCode);
 				}
 		
 			// No panic or leave so passed
 			
-			RDebug::Printf("No leave or panic occured so open interface again and send test passed");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP01, "No leave or panic occured so open interface again and send test passed");
 			
 			// Open the interface		
 			/*TODO DMA TInt err(iUsbInterface0.Open(iToken0));
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Unable to open interface 0"));
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP02, "<Error %d> Unable to open interface 0"));
 				return TestFailed(err);
 				}
 			
-			RDebug::Printf("Interface 0 re-opened"));*/
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP03, "Interface 0 re-opened"));*/
 			
 			iCaseStep = EPassed;
 			TTestCasePassed request;
@@ -234,32 +252,35 @@
 			TestFailed(KErrCompletion);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_HOSTRUNL_ENTRY, this );
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -267,14 +288,15 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_HOSTRUNL_EXIT, this );
 	}
 
 /**
@@ -283,7 +305,7 @@
 */
 void CUT_PBASE_T_USBDI_0489::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -292,6 +314,7 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0490.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0490.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -19,6 +19,10 @@
 #include "PBASE-T_USBDI-0490.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0490Traces.h"
+#endif
 
 
  
@@ -40,10 +44,12 @@
 
 CUT_PBASE_T_USBDI_0490* CUT_PBASE_T_USBDI_0490::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0490_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0490* self = new (ELeave) CUT_PBASE_T_USBDI_0490(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -52,40 +58,46 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0490::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0490_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0490::~CUT_PBASE_T_USBDI_0490()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0490::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -103,30 +115,31 @@
 			break;
 			
 		case ETransferOut:
-			RDebug::Printf("Try to send data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
 			iOutTransfer[0]->TransferOut(KPayloadPattern);
 			break;
 		
 		case ETransferIn:
-			RDebug::Printf("Try to receive data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
 			iInTransfer[0]->TransferIn(KBulkTransferSize);
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0490::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -145,7 +158,7 @@
 						       err, KBulkTransferOutId, aTransferId);
 				break;
 				}
-			RDebug::Printf("Try to receive back sent data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP01, "Try to receive back sent data");
 			iCaseStep = ETransferIn;
 			TWriteSynchronousCachedReadDataRequest request(1,1,1); //Use first read EP and first write EP (on interface 1)
 			iControlEp0->SendRequest(request,this);	
@@ -177,7 +190,7 @@
 			if(err == KErrNone)
 				{
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP02, "Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -194,16 +207,17 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0490::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
@@ -217,22 +231,24 @@
 	iOutTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId);
 	
 	// Initialise the descriptors for transfer		
-	RDebug::Printf("Initialising the transfer descriptors");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL, "Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_DUP01, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;
 	TEndpointReadUntilShortRequest request(1,1,KBulkTransferSize);// EP1 because 1st reader EP
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0491.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0491.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0491Traces.h"
+#endif
 
 
  
@@ -40,10 +44,12 @@
 
 CUT_PBASE_T_USBDI_0491* CUT_PBASE_T_USBDI_0491::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0491_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0491* self = new (ELeave) CUT_PBASE_T_USBDI_0491(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -52,40 +58,46 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0491::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0491_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0491::~CUT_PBASE_T_USBDI_0491()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT_DUP01, this );
 	}
 
 void CUT_PBASE_T_USBDI_0491::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -103,30 +115,31 @@
 			break;
 			
 		case ETransferOut:
-			RDebug::Printf("Try to send data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish2(), KBulkTransferSize);
 			break;
 		
 		case ETransferIn:
-			RDebug::Printf("Try to receive data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
 			iInTransfer[0]->TransferIn(KBulkTransferSize);
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0491::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -145,7 +158,7 @@
 						       err, KBulkTransferOutId, aTransferId);
 				break;
 				}
-			RDebug::Printf("Try to receive back sent data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP01, "Try to receive back sent data");
 			iCaseStep = ETransferIn;
 			TWriteSynchronousCachedReadDataRequest request(1,1,1);  //Use first read EP and first write EP (on interface 1)
 			iControlEp0->SendRequest(request,this);	
@@ -177,7 +190,7 @@
 			if(err == KErrNone)
 				{
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP02, "Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -194,18 +207,19 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0491::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
-	RDebug::Printf("****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish2().Length());
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL, "****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish2().Length());
 	
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
 		// Prepare for response from control transfer to client
@@ -218,22 +232,24 @@
 	iOutTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId);
 	
 	// Initialise the descriptors for transfer		
-	RDebug::Printf("Initialising the transfer descriptors");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP02, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;	
 	TEndpointReadUntilShortRequest request(1,1,KBulkTransferSize);// EP1 because 1st reader EP
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0492.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0492.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0492Traces.h"
+#endif
 
 
  
@@ -53,10 +57,12 @@
 
 CUT_PBASE_T_USBDI_0492* CUT_PBASE_T_USBDI_0492::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0492_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0492* self = new (ELeave) CUT_PBASE_T_USBDI_0492(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -65,41 +71,47 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0492::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0492_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0492::~CUT_PBASE_T_USBDI_0492()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0492::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -117,34 +129,35 @@
 			break;
 			
 		case ETransferOut:
-			RDebug::Printf("Try to send data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0, KHostNumWriteBytes1), EFalse);
 			iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1, KHostNumWriteBytes2), EFalse);
 			iOutTransfer[2]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1+KHostNumWriteBytes2, KHostNumWriteBytes3), ETrue); //do not suppress ZLP on this last one  (though should be irrelevant here)    
 			break;
 		
 		case ETransferIn:
-			RDebug::Printf("Try to receive data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
 			iInTransfer[0]->TransferIn(KHostNumReadBytes1);
 			iInTransfer[1]->TransferIn(KHostNumReadBytes2);
 			iInTransfer[2]->TransferIn(KHostNumReadBytes3);
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0492::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -162,7 +175,7 @@
 				case KBulkTransferOutId1:
 				case KBulkTransferOutId2:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer %d completed", aTransferId);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP01, "Transfer %d completed", aTransferId);
 					break; // switch(aTransferId)
 
 				default:
@@ -175,7 +188,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1 | KBulkTransferOutId2))
 				{
-				RDebug::Printf("Try to receive back sent data. Transfers Completed %d", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP02, "Try to receive back sent data. Transfers Completed %d", iTransferComplete);
 				iCaseStep = ETransferIn;
 				TUint numBytes[KNumSplitWriteSections] = {KHostNumReadBytes1, KHostNumReadBytes2, KHostNumReadBytes3};
 				TSplitWriteCachedReadDataRequest request(1,1,1,numBytes);
@@ -233,7 +246,7 @@
 					}
 
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP03, "Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -255,16 +268,17 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP04, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0492::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
 	
@@ -283,22 +297,24 @@
 	iOutTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId2);
 	
 	// Initialise the descriptors for transfer		
-	RDebug::Printf("Initialising the transfer descriptors");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL, "Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_DUP01, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;	
 	TEndpointReadRequest request(1,1,KBulkTransferSize);// EP1 means endpoint index 1 not the actual endpoint number
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0493Traces.h"
+#endif
 
 
  
@@ -57,10 +61,12 @@
 
 CUT_PBASE_T_USBDI_0493* CUT_PBASE_T_USBDI_0493::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0493_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0493* self = new (ELeave) CUT_PBASE_T_USBDI_0493(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -70,25 +76,30 @@
 	iNumTransferBytes(KStartNumTransferBytes),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0493::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0493_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0493::~CUT_PBASE_T_USBDI_0493()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT_DUP01, this );
 	}
 
 void CUT_PBASE_T_USBDI_0493::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
@@ -99,10 +110,11 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP01, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -120,8 +132,11 @@
 			break;
 			
 		case ETransferOut:
-			RDebug::Printf("Try to send %d bytes of data", iNumTransferBytes);
-			RDebug::RawPrint(KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes));
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP02, "Try to send %d bytes of data", iNumTransferBytes);
+			{
+			    const TPtrC8& midKLiteralEnglish = KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes);
+                OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP52, "", midKLiteralEnglish.Ptr(), midKLiteralEnglish.Length());
+			}
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
 			iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(1*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
 			iOutTransfer[2]->TransferOut(KLiteralEnglish8().Mid(2*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
@@ -129,7 +144,7 @@
 			break;
 		
 		case ETransferIn:
-			RDebug::Printf("Try to receive max %d bytes of data", 3*KHostNumReadBytes + KHostFinalNumReadBytes);
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP03, "Try to receive max %d bytes of data", 3*KHostNumReadBytes + KHostFinalNumReadBytes);
 			iInTransfer[0]->TransferIn(KHostNumReadBytes);
 			iInTransfer[1]->TransferIn(KHostNumReadBytes);
 			iInTransfer[2]->TransferIn(KHostNumReadBytes);
@@ -137,20 +152,21 @@
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP04, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0493::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -169,7 +185,7 @@
 				case KBulkTransferOutId2:		
 				case KBulkTransferOutId3:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer %d completed", aTransferId);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP01, "Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 					
 				default:
@@ -182,7 +198,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1 | KBulkTransferOutId2 | KBulkTransferOutId3))
 				{
-				RDebug::Printf("Try to receive back sent data. Transfers Completed %d", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP02, "Try to receive back sent data. Transfers Completed %d", iTransferComplete);
 				iCaseStep = ETransferIn;
 				TWriteSynchronousCachedReadDataRequest request(1,1,1);  //Use first read EP and first write EP (on interface 1)
 				iControlEp0->SendRequest(request,this);	
@@ -207,7 +223,7 @@
 					break; //switch(aTransferId)
 					
 				default:
-					RDebug::Printf("Bad Transfer ID");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP03, "Bad Transfer ID");
 					iTransferComplete = 0; //reset
 					err = KUnexpectedTransferID;
 					msg.Format(_L("<Error %d> Unexpected transfer ID, wanted %d or %d or %d or %d, got %d"),
@@ -249,7 +265,7 @@
 				if(err == KErrNone)
 					{
 					// Comparison is a match
-					RDebug::Printf("Comparison for IN transfer is a match - Number of Transfer Bytes %d", iNumTransferBytes);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match - Number of Transfer Bytes %d", iNumTransferBytes);
 					iTransferComplete = 0; //reset
 					if(++iNumTransferBytes<=KFinishNumTransferBytes)
 						/*
@@ -284,20 +300,22 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP05, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT, this );
 		return;
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0493::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
-	RDebug::Printf("****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish8Length);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL, "****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish8Length);
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
 		// Prepare for response from control transfer to client
 		{
@@ -305,7 +323,7 @@
 		}
 	
 	// Create the bulk transfers	
-	RDebug::Printf("Trying to create the bulk transfers - size 0x%u", KBulkTransferMaxSize);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP01, "Trying to create the bulk transfers - size 0x%u", KBulkTransferMaxSize);
 	iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferInId0);
 	iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferInId1);
 	iInTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferInId2);
@@ -316,23 +334,25 @@
 	iOutTransfer[3] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferOutId3);
 		
 	// Initialise the descriptors for transfer		
-	RDebug::Printf("Initialising the transfer descriptors");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP02, "Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 			
-	RDebug::Printf("Ask client to read %d bytes of data", KClientNumReadBytes);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP04, "Ask client to read %d bytes of data", KClientNumReadBytes);
 	iCaseStep = ETransferOut;
 	TEndpointReadUntilShortRequest request(1,1,KClientNumReadBytes);// EP1 because 1st reader EP
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0494.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0494.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0494Traces.h"
+#endif
 
 
  
@@ -41,10 +45,12 @@
 
 CUT_PBASE_T_USBDI_0494* CUT_PBASE_T_USBDI_0494::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0494_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0494* self = new (ELeave) CUT_PBASE_T_USBDI_0494(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -53,40 +59,46 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0494::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0494_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0494::~CUT_PBASE_T_USBDI_0494()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT_DUP01, this );
 	}
 
 void CUT_PBASE_T_USBDI_0494::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -104,30 +116,31 @@
 			break;
 			
 		case ETransferOut:
-			RDebug::Printf("Try to send data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8(), KBulkTransferSize, ETrue);
 			break;
 		
 		case ETransferIn:
-			RDebug::Printf("Try to receive data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
 			iInTransfer[0]->TransferIn(KBulkNumReadBytes); //require completion using ZLP
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0494::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -148,7 +161,7 @@
 				break;
 				}
 
-			RDebug::Printf("Try to receive back sent data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP01, "Try to receive back sent data");
 			iCaseStep = ETransferIn;
 			TWriteSynchronousCachedReadDataRequest request(1,1,1);  //Use first read EP and first write EP (on interface 1)
 			iControlEp0->SendRequest(request,this);
@@ -183,7 +196,7 @@
 			if(err == KErrNone)
 				{
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP02, "Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -199,16 +212,17 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0494::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
@@ -222,22 +236,24 @@
 	iOutTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTranferOutId);
 	
 	// Initialise the descriptors for transfer		
-	RDebug::Printf("Initialising the transfer descriptors");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL, "Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_DUP01, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;	
 	TEndpointReadUntilShortRequest request(1,1,KBulkTransferSize);// EP1 because 1st reader EP ??FIXME
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0495Traces.h"
+#endif
 
 
  
@@ -47,10 +51,12 @@
 
 CUT_PBASE_T_USBDI_0495* CUT_PBASE_T_USBDI_0495::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0495* self = new (ELeave) CUT_PBASE_T_USBDI_0495(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -60,11 +66,14 @@
 	iCaseStep(EInProgress),
 	iRequestValidationResultPtr(NULL,0)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0495::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -80,36 +89,39 @@
 		iOutBufferPtr.Append(KLiteralEnglish5());
 		}
 
-	RDebug::Printf("CUT_PBASE_T_USBDI_0495::ConstructL(): buffer created");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_CONSTRUCTL, "CUT_PBASE_T_USBDI_0495::ConstructL(): buffer created");
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0495::~CUT_PBASE_T_USBDI_0495()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0495::KillTransfers()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_ENTRY, this );
 	
 	iOutTransfer[0]->Cancel();
 	iOutTransfer[1]->Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_EXIT, this );
 	}
 	
 	
 	
 void CUT_PBASE_T_USBDI_0495::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -117,10 +129,11 @@
 			KillTransfers();
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -139,7 +152,7 @@
 		
 		case ERequestRepeatedReadAndValidate:
 			{
-			RDebug::Printf("Try to perform ALL transfers");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP03, "Try to perform ALL transfers");
 	
 			iCaseStep = ETransfer;	
 			
@@ -149,7 +162,7 @@
 				{
 				_LIT(lit, "TEST FAILURE: No data to send!!");
 				TBuf<40> msg(lit);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP04, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrAbort,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -159,7 +172,7 @@
 			
 		case ERequestPrepareEndpointValidationResult:
 			{
-			RDebug::Printf("Asking client to prepare the result of its continuous validation");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP05, "Asking client to prepare the result of its continuous validation");
 			iCaseStep = ERequestValidationResult;
 			iRequestValidationResultPtr.Set( iInBuffer->Des());
 			iRequestValidationResultPtr.Zero(); //reset
@@ -171,14 +184,14 @@
 	
 		case ERequestValidationResult:
 			{
-			RDebug::Printf("Collect client's return validation  result in a pass or fail string ...");
-			RDebug::RawPrint(*iInBuffer);
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP06, "Collect client's return validation  result in a pass or fail string ...");
+            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP56, "", iInBuffer->Ptr(), iInBuffer->Length());
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP07, "\n");
 			TPtr8 ptr(iInBuffer->Des());
 			if(ptr.Compare(KClientPassString) == 0)
 				{
-				RDebug::Printf("Client Validation Result is a PASS");
-				RDebug::Printf("This is the FINAL check - the whole test has a PASSED");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP08, "Client Validation Result is a PASS");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP09, "This is the FINAL check - the whole test has a PASSED");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -188,7 +201,7 @@
 				TBuf<256> msg;
 				_LIT(lit, "<Error> Bulk data VALIDATION check was NOT successful");
 				msg.Format(lit);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP10, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -197,20 +210,21 @@
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP11, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0495::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -235,7 +249,7 @@
 				break;
 				}
 
-			RDebug::Printf("Transfer OUT %d completed - num bytes sent = %d", aTransferId, iNumWriteBytesRequested);
+			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed - num bytes sent = %u", aTransferId, iNumWriteBytesRequested);
 			
 			iTransferComplete |= PerformNextTransfer(aTransferId);
 			
@@ -244,10 +258,10 @@
 				/*
 				Transfers all complete - now ask device to validate first interface's transfer OUT
 				*/
-				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP02, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				if(err==KErrNone)
 					{
-					RDebug::Printf("Asking client to post validation recorded on the endpoint on its interface - ready for collection");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP03, "Asking client to post validation recorded on the endpoint on its interface - ready for collection");
 					iCaseStep = ERequestPrepareEndpointValidationResult;
 					TRecordedValidationResultRequest request(1,1);
 					iControlEp0->SendRequest(request,this);
@@ -273,19 +287,20 @@
 	if(err!=KErrNone)
 		{	
 		KillTransfers();
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP04, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0495::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -312,7 +327,7 @@
 			iOutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferOutId[1]);
 			
 			// Initialise the descriptors for transfer		
-			RDebug::Printf("Initialising the transfer descriptors - interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -323,18 +338,19 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP02, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		RDebug::Printf("Asking client for continuous 'Read' and 'Validate'");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP03, "Asking client for continuous 'Read' and 'Validate'");
 		iCaseStep = ERequestRepeatedReadAndValidate;	
 		TRepeatedReadAndValidateDataRequest request(1,1,KLiteralEnglish5,KDeviceNumReadBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 		iControlEp0->SendRequest(request,this);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_EXIT, this );
 	}
 
 TInt CUT_PBASE_T_USBDI_0495::PerformNextTransfer(TInt aTransferId)
@@ -345,12 +361,13 @@
 		transfer ID.
 */
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_ENTRY, this );
 	
 	if(iNumWriteBytesRequested >= KTotalBytesToTransfer)
 		{
-		RDebug::Printf("****ALL DONE for Transfer using ID %d****", aTransferId);
-		RDebug::Printf("Num bytes actually written = %d, num bytes required to be written = %d", iNumWriteBytesRequested, KTotalBytesToTransfer);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER, "****ALL DONE for Transfer using ID %d****", aTransferId);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_DUP01, "Num bytes actually written = %u, num bytes required to be written = %u", iNumWriteBytesRequested, KTotalBytesToTransfer);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT, this, aTransferId );
 		return aTransferId; //Not writing any more - signal to user that no more transfers are required on this transfer ID
 		}
 	TUint bytesToWrite = KTotalBytesToTransfer - iNumWriteBytesRequested;
@@ -362,6 +379,7 @@
 	bulkTransfer.TransferOut(iOutBufferPtr.Mid(iNumWriteBytesRequested%(KLiteralEnglish5().Length()), numWriteBytes), EFalse);
 	iNumWriteBytesRequested += numWriteBytes;
 
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT_DUP01, this );
 	return 0; //Signal to the user that another transfer is queued on the specified transfer ID
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0496.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0496.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0496Traces.h"
+#endif
 
 
  
@@ -48,10 +52,12 @@
 
 CUT_PBASE_T_USBDI_0496* CUT_PBASE_T_USBDI_0496::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0496* self = new (ELeave) CUT_PBASE_T_USBDI_0496(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -60,11 +66,14 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0496::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -80,36 +89,39 @@
 		iValidateBufferPtr.Append(KLiteralEnglish5());
 		}
 	
-	RDebug::Printf("CUT_PBASE_T_USBDI_0496::ConstructL(): buffer created");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_CONSTRUCTL, "CUT_PBASE_T_USBDI_0496::ConstructL(): buffer created");
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0496::~CUT_PBASE_T_USBDI_0496()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0496::KillTransfers()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_ENTRY, this );
 	
 	iInTransfer[0]->Cancel();
 	iInTransfer[1]->Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_EXIT, this );
 	}
 	
 	
 	
 void CUT_PBASE_T_USBDI_0496::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -117,10 +129,11 @@
 			TBuf<256> msg;
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -139,20 +152,20 @@
 		
 		case ERequestRepeatedWrite:
 			{
-			RDebug::Printf("Try to perform ALL transfers");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP03, "Try to perform ALL transfers");
 			
 			iCaseStep = ETransfer;	
 			iIsValid = ETrue; //innocent until proved guilty
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP04, "\n");
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[0]); //should not validate - just perform necessary transfers
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[1]); //should not validate - just perform necessary transfers
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP05, "\n");
 			if((iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
 				{
 				iTransferComplete = 0; //reset
 				_LIT(lit, "TEST FAILURE: No data to send!!");
 				TBuf<40> msg(lit);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP06, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrAbort,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -161,20 +174,21 @@
 			break;
 
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP07, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0496::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -198,16 +212,16 @@
 				break;
 				}
 	
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP01, "\n");
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(aTransferId);
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP02, "\n");
 			
 			if(err==KErrNone && (iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
 				{
 				/*
 				Transfers all complete - check all were valid, and if so pass the test
 				*/
-				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP03, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				if(!iIsValid)
 					{
 					err = KErrCompletion; //indicates data validation failure
@@ -215,7 +229,7 @@
 					break;
 					}
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -242,19 +256,20 @@
 	if(err!=KErrNone)
 		{	
 		KillTransfers();
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP05, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0496::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -281,7 +296,7 @@
 			iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferInId[1]);
 			
 			// Initialise the descriptors for transfer		
-			RDebug::Printf("Initialising the transfer descriptors - interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -292,22 +307,24 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP02, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		RDebug::Printf("Asking client for 'Read' on interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP03, "Asking client for 'Read' on interface 1");
 		iCaseStep = ERequestRepeatedWrite;	
 		TRepeatedWriteDataRequest request(1,1,KLiteralEnglish5(),KDeviceNumWriteBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 		iControlEp0->SendRequest(request,this);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_EXIT, this );
 	}
 
 TUint8 CUT_PBASE_T_USBDI_0496::Index(TUint8 aTransferId)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_INDEX_ENTRY, this );
 	switch(aTransferId)
 		{
 		case KBulkTransferInId0:
@@ -317,6 +334,7 @@
 		default:
 			_LIT(lit, "TRANSFER ID OUT OF RANGE");
 			User::Panic(lit, KErrArgument);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_INDEX_EXIT, this );
 			return 0; //should never get here
 		}
 	}
@@ -329,11 +347,11 @@
 		transfer ID.
 */
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY, this );
 	
 	TUint8 index = Index(aTransferId);
-	RDebug::Printf("\n");
-	RDebug::Printf("Transfer[%d]", index);
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS, "\n");
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01, "Transfer[%d]", index);
 	
 	
 	if(iNumBytesExpected[index] != 0)
@@ -341,7 +359,7 @@
 		TPtrC8 data1(iInTransfer[index]->DataPolled());
 		if(ValidateData(data1, iValidateBufferPtr.Mid(iValidationStringStartPointTransfer[index], iNumBytesExpected[index])) == EFalse)
 			{
-			RDebug::Printf("=====VALIDATION FAILURE: Point of Validation String Entry %d, Newly Read Bytes %d=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
+			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02, "=====VALIDATION FAILURE: Point of Validation String Entry %u, Newly Read Bytes %u=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
 			iIsValid = EFalse;
 			}
 		iNumBytesExpected[index] = 0; //reset
@@ -349,7 +367,8 @@
 	if(iNumBytesRequestedSoFar >= KTotalBytesToTransfer)
 		//if we are near the end the other transfer will mop up remaining bytes...
 		{
-		RDebug::Printf("****ALL DONE for Transfer[%d]****", index);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03, "****ALL DONE for Transfer[%d]****", index);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT, this, aTransferId );
 		return aTransferId; //tell caller that all transfers are complete for this transfer ID
 		}
 
@@ -360,6 +379,7 @@
 	iInTransfer[index]->TransferIn(KHostNumReadBytes); //rely on ZLP to complete the last 'TransferIn'
 	iExpectedNextTransferNumber = 1 - iExpectedNextTransferNumber;
 
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01, this );
 	return 0; //tell caller there are still transfers to complete for the requested transfer ID
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0497Traces.h"
+#endif
 
 
  
@@ -63,10 +67,12 @@
 
 CUT_PBASE_T_USBDI_0497* CUT_PBASE_T_USBDI_0497::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0497_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0497* self = new (ELeave) CUT_PBASE_T_USBDI_0497(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -75,12 +81,16 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0497::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0497_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_CONSTRUCTL_EXIT, this );
 	}
 
 
@@ -89,7 +99,7 @@
 	The transfer objects have test specific names - so perform transfer specific clean up here.
 	*/
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY_DUP01, this );
 	
 	Cancel();
 
@@ -111,29 +121,31 @@
 		delete iIfc2InTransfer[count];
 		iIfc2InTransfer[count] = NULL;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0497::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -152,7 +164,7 @@
 		
 		case ERequestDeviceRead:
 			{
-			RDebug::Printf("Asking client for 'Read' on interface 2");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for 'Read' on interface 2");
 			iCaseStep = ETransferOut;	
 			TEndpointReadRequest request(2,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 			iControlEp0->SendRequest(request,this);
@@ -160,7 +172,7 @@
 			break;
 			
 		case ETransferOut:
-			RDebug::Printf("Try to write data on BOTH interfaces");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP04, "Try to write data on BOTH interfaces");
 	
 			iStartTime[0].HomeTime();
 			iStartTime[1].HomeTime();
@@ -173,7 +185,7 @@
 		
 		case ERequestDeviceWriteBack:
 			{
-			RDebug::Printf("Asking client for 'Write' back on interface 2");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP05, "Asking client for 'Write' back on interface 2");
 			iCaseStep = ETransferIn;	
 			TWriteCachedReadDataRequest request(2,1,1);// EP1 means endpoint index 1 not the actual endpoint number
 			iControlEp0->SendRequest(request,this);
@@ -181,7 +193,7 @@
 			break;
 			
 		case ETransferIn:
-			RDebug::Printf("Try to receive data on BOTH interfaces");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP06, "Try to receive data on BOTH interfaces");
 	
 			iStartTime[0].HomeTime();
 			iStartTime[1].HomeTime();
@@ -193,20 +205,21 @@
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP07, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0497::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 	switch(iCaseStep)
 		{
@@ -229,7 +242,7 @@
 				case KIfc2BulkTransferOutId1:
 				case KIfc2BulkTransferOutId2:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 				default:
 					iTransferComplete = 0; //reset
@@ -253,7 +266,7 @@
 
 			if(err==KErrNone && (iTransferComplete & KBulkTransferOutIdMask) == KBulkTransferOutIdMask)
 				{
-				RDebug::Printf("All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP02, "All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				iTransferComplete = 0; //reset
 				err = CheckAndResetTimes(0, 1, KMaxTimeDiffPercentage);
 				if(err!=KErrNone)
@@ -261,7 +274,7 @@
 					break; //switch(iCaseStep)
 					}
 	
-				RDebug::Printf("Asking client for 'Write' back on interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP03, "Asking client for 'Write' back on interface 1");
 				iCaseStep = ERequestDeviceWriteBack;
 				TWriteCachedReadDataRequest request(1,1,1);// EP1 means endpoint index 1 not the actual endpoint number
 				iControlEp0->SendRequest(request,this);
@@ -288,7 +301,7 @@
 				case KIfc2BulkTransferInId1:
 				case KIfc2BulkTransferInId2:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP04, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 	
 				default:
@@ -314,7 +327,7 @@
 			if(err==KErrNone && (iTransferComplete & KBulkTransferInIdMask) == KBulkTransferInIdMask)
 				{
 				// ok, compare data rcvd now
-				RDebug::Printf("All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP05, "All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				iTransferComplete = 0; //reset
 				err = CheckAndResetTimes(0, 1, KMaxTimeDiffPercentage);
 				if(err!=KErrNone)
@@ -329,7 +342,7 @@
 				//Validate first transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data1, KLiteralFrench4(), KHostNumWriteBytes1) == EFalse)
 					{
-					RDebug::Printf("Validation failure 1st transfer, Interface 1");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP06, "Validation failure 1st transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -337,7 +350,7 @@
 				//Validate second transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data2, KLiteralFrench4(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					RDebug::Printf("Validation failure 2nd transfer, Interface 1");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP07, "Validation failure 2nd transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -345,7 +358,7 @@
 				//Validate first transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data3, KLiteralEnglish8(), KHostNumWriteBytes1) == EFalse)
 					{
-					RDebug::Printf("Validation failure 1st transfer, Interface 2");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP08, "Validation failure 1st transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -353,13 +366,13 @@
 				//Validate second transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data4, KLiteralEnglish8(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					RDebug::Printf("Validation failure 2nd transfer, Interface 2");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP09, "Validation failure 2nd transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
 
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP10, "Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -386,19 +399,20 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP11, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0497::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -430,7 +444,7 @@
 			iIfc2OutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface2BulkOut1,iUsbInterface2,KBulkMaxTransferSize,*this,KIfc2BulkTransferOutId2);
 			
 			// Initialise the descriptors for transfer		
-			RDebug::Printf("Initialising the transfer descriptors - interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -439,7 +453,7 @@
 			else
 				{
 				// Initialise the descriptors for transfer		
-				RDebug::Printf("Initialising the transfer descriptors (Interface 2)");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP02, "Initialising the transfer descriptors (Interface 2)");
 				err = iUsbInterface2.InitialiseTransferDescriptors();
 				if(err != KErrNone)
 					{
@@ -450,18 +464,19 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		RDebug::Printf("Asking client for 'Read' on interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP04, "Asking client for 'Read' on interface 1");
 		iCaseStep = ERequestDeviceRead;	
 		TEndpointReadRequest request(1,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request,this);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0498Traces.h"
+#endif
 
 
  
@@ -65,10 +69,12 @@
 
 CUT_PBASE_T_USBDI_0498* CUT_PBASE_T_USBDI_0498::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0498_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0498* self = new (ELeave) CUT_PBASE_T_USBDI_0498(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -78,15 +84,19 @@
 	iCaseStep(EInProgress),
 	iRequestDeviceValidationResultPtr(NULL,0)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0498::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0498_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
-	RDebug::Printf("CUT_PBASE_T_USBDI_0491::ConstructL(): buffer created");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_CONSTRUCTL, "CUT_PBASE_T_USBDI_0491::ConstructL(): buffer created");
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_CONSTRUCTL_EXIT, this );
 	}
 
 
@@ -95,7 +105,7 @@
 The transfer objects have test specific names - so perform transfer specific clean up here.
 */
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY_DUP01, this );
 	
 	Cancel();
 
@@ -117,29 +127,31 @@
 		delete iIfc2InTransfer[count];
 		iIfc2InTransfer[count] = NULL;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0498::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -158,7 +170,7 @@
 		
 		case ERequestDeviceIFC1Read:
 			{
-			RDebug::Printf("Asking client for 'Read' on interface 2");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for 'Read' on interface 2");
 			iCaseStep = ERequestDeviceIFC2Read;	
 			TEndpointReadRequest request(2,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 			iControlEp0->SendRequest(request,this);
@@ -167,7 +179,7 @@
 			
 		case ERequestDeviceIFC2Read:
 			{
-			RDebug::Printf("Asking client to 'Write' on interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP04, "Asking client to 'Write' on interface 1");
 			iCaseStep = ERequestDeviceIFC1Write;	
 			TEndpointPatternWriteRequest request(1,1,KLiteralFrench4(),KDeviceNumWriteBytes);
 			iControlEp0->SendRequest(request,this);
@@ -176,7 +188,7 @@
 			
 		case ERequestDeviceIFC1Write:
 			{
-			RDebug::Printf("Asking client to 'Write' on interface 2");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP05, "Asking client to 'Write' on interface 2");
 			iCaseStep = ERequestDeviceIFC2Write;	
 			TEndpointPatternWriteRequest request(2,1,KLiteralEnglish2(),KDeviceNumWriteBytes);
 			iControlEp0->SendRequest(request,this);
@@ -185,7 +197,7 @@
 			
 		case ERequestDeviceIFC2Write:
 			{
-			RDebug::Printf("Try to perform ALL transfers on BOTH interfaces");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP06, "Try to perform ALL transfers on BOTH interfaces");
 	
 			iCaseStep = ETransfer;	
 	
@@ -209,7 +221,7 @@
 		case ERequestDeviceValidateIFC1:
 			{
 			iCaseStep = ERequestDeviceValidationResultIFC1;
-			RDebug::Printf("Interface 1: Request Client Validation Result");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP07, "Interface 1: Request Client Validation Result");
 			iRequestDeviceValidationResultPtr.Set(iInBuffer->Des());
 			iRequestDeviceValidationResultPtr.Zero(); //reset
 			iRequestDeviceValidationResultPtr.SetLength(KPassFailStringLength);
@@ -220,14 +232,14 @@
 		
 		case ERequestDeviceValidationResultIFC1:
 			{
-			RDebug::Printf("Interface 1: Client Validation Result string ...");
-			RDebug::RawPrint(*iInBuffer);
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP08, "Interface 1: Client Validation Result string ...");
+            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP58, "", iInBuffer->Ptr(), iInBuffer->Length());
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP09, "\n");
 			TPtr8 ptr(iInBuffer->Des());
 			if(ptr.Compare(KClientPassString) == 0)
 				{
-				RDebug::Printf("Client Validation Interface 1 Result is a PASS");
-				RDebug::Printf("Now performing Client Validation for Interface 2");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP10, "Client Validation Interface 1 Result is a PASS");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP11, "Now performing Client Validation for Interface 2");
 				iCaseStep = ERequestDeviceValidateIFC2;
 				TEndpointStringValidationRequest request(2,1,KLiteralEnglish2(),KDeviceNumReadBytes);
 				iControlEp0->SendRequest(request,this);
@@ -236,7 +248,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error> Bulk data VALIDATION check was NOT successful"));
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP12, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -247,7 +259,7 @@
 		case ERequestDeviceValidateIFC2:
 			{
 			iCaseStep = ERequestDeviceValidationResultIFC2;
-			RDebug::Printf("Interface 2: Request Client Validation Result");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP13, "Interface 2: Request Client Validation Result");
 			iRequestDeviceValidationResultPtr.Set(iInBuffer->Des());
 			iRequestDeviceValidationResultPtr.Zero(); //reset
 			iRequestDeviceValidationResultPtr.SetLength(KPassFailStringLength);
@@ -258,14 +270,14 @@
 		
 		case ERequestDeviceValidationResultIFC2:
 			{
-			RDebug::Printf("Interface 1: Client Validation Result string ...");
-			RDebug::RawPrint(*iInBuffer);
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP14, "Interface 1: Client Validation Result string ...");
+            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP54, "", iInBuffer->Ptr(), iInBuffer->Length());
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP15, "\n");
 			TPtr8 ptr(iInBuffer->Des());
 			if(ptr.Compare(KClientPassString) == 0)
 				{
-				RDebug::Printf("Client Validation Interface 2 Result is a PASS");
-				RDebug::Printf("This is the FINAL check - the whole test has a PASSED");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP16, "Client Validation Interface 2 Result is a PASS");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP17, "This is the FINAL check - the whole test has a PASSED");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -274,7 +286,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error> Bulk data VALIDATION check was NOT successful"));
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP18, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -283,20 +295,21 @@
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP19, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0498::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -324,7 +337,7 @@
 				case KIfc2BulkTransferOutId1:
 				case KIfc2BulkTransferOutId2:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 
 				case KIfc1BulkTransferInId1:
@@ -332,7 +345,7 @@
 				case KIfc2BulkTransferInId1:
 				case KIfc2BulkTransferInId2:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP02, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 
 				default:
@@ -365,7 +378,7 @@
 				}
 			if(err==KErrNone && (iTransferComplete & KBulkTransferOutIdMask) == KBulkTransferOutIdMask)
 				{
-				RDebug::Printf("All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP03, "All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				//Leave validation to the point at which all transfers have completed.
 				}
 	
@@ -383,7 +396,7 @@
 			if(err==KErrNone && (iTransferComplete & KBulkTransferInIdMask) == KBulkTransferInIdMask)
 				{
 				// ok, compare data rcvd now
-				RDebug::Printf("All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP04, "All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 	
 				TPtrC8 data1(iIfc1InTransfer[0]->DataPolled());	
 				TPtrC8 data2(iIfc1InTransfer[1]->DataPolled());		
@@ -392,7 +405,7 @@
 				//Validate first transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data1, KLiteralFrench4(), KHostNumWriteBytes1) == EFalse)
 					{
-					RDebug::Printf("Validation failure 1st transfer, Interface 1");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP05, "Validation failure 1st transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -400,7 +413,7 @@
 				//Validate second transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data2, KLiteralFrench4(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					RDebug::Printf("Validation failure 2nd transfer, Interface 1");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP06, "Validation failure 2nd transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -408,7 +421,7 @@
 				//Validate first transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data3, KLiteralEnglish2(), KHostNumWriteBytes1) == EFalse)
 					{
-					RDebug::Printf("Validation failure 1st transfer, Interface 2");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP07, "Validation failure 1st transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -416,13 +429,13 @@
 				//Validate second transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data4, KLiteralEnglish2(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					RDebug::Printf("Validation failure 2nd transfer, Interface 2");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP08, "Validation failure 2nd transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
 				
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP09, "Comparison for IN transfer is a match");
 				}
 			break; //switch(iCaseStep)
 
@@ -437,7 +450,7 @@
 	Transfers all complete - now ask device to validate first interface's transfer OUT
 	*/
 		{
-		RDebug::Printf("Checking all times against each other");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP10, "Checking all times against each other");
 		err = CheckTimes(0, 1, KMaxTimeDiffPercentage);
 		err = err?err:CheckTimes(0, 2, KMaxTimeDiffPercentage);
 		err = err?err:CheckTimes(0, 3, KMaxTimeDiffPercentage);
@@ -451,7 +464,7 @@
 		
 		if(err==KErrNone)
 			{
-			RDebug::Printf("Asking client for 'Validate' data written on interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP11, "Asking client for 'Validate' data written on interface 1");
 			iCaseStep = ERequestDeviceValidateIFC1;
 			TEndpointStringValidationRequest request(1,1,KLiteralFrench4(),KDeviceNumReadBytes);
 			iControlEp0->SendRequest(request,this);
@@ -472,19 +485,20 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP12, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0498::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -516,7 +530,7 @@
 			iIfc2OutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface2BulkOut1,iUsbInterface2,KBulkMaxTransferSize,*this,KIfc2BulkTransferOutId2);
 			
 			// Initialise the descriptors for transfer		
-			RDebug::Printf("Initialising the transfer descriptors - interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -525,7 +539,7 @@
 			else
 				{
 				// Initialise the descriptors for transfer		
-				RDebug::Printf("Initialising the transfer descriptors (Interface 2)");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP02, "Initialising the transfer descriptors (Interface 2)");
 				err = iUsbInterface2.InitialiseTransferDescriptors();
 				if(err != KErrNone)
 					{
@@ -536,18 +550,19 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP03, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		RDebug::Printf("Asking client for 'Read' on interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP04, "Asking client for 'Read' on interface 1");
 		iCaseStep = ERequestDeviceIFC1Read;	
 		TEndpointReadRequest request(1,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request,this);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0499.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0499.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0499Traces.h"
+#endif
 
 
  
@@ -53,10 +57,12 @@
 
 CUT_PBASE_T_USBDI_0499* CUT_PBASE_T_USBDI_0499::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0499_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0499* self = new (ELeave) CUT_PBASE_T_USBDI_0499(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -65,41 +71,47 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0499::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0499_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0499::~CUT_PBASE_T_USBDI_0499()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0499::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -123,7 +135,7 @@
 		
 		case EAwaitClearPreHalt:
 			{
-			RDebug::Printf("Client has been asked to clear endpoint buffer");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP03, "Client has been asked to clear endpoint buffer");
 			User::After(1000000); //Give client time to clear buffer
 			TEndpointCancelReadRequest request(1,1);
 			iControlEp0->SendRequest(request,this);
@@ -140,31 +152,32 @@
 			break;
 			
 		case ETransferOut:
-			RDebug::Printf("Try to send data (post halt)");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP04, "Try to send data (post halt)");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0, KHostNumWriteBytesPostHalt1), EFalse);
 			iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytesPostHalt1, KHostNumWriteBytesPostHalt2), EFalse);
 			break;
 		
 		case ETransferIn:
-			RDebug::Printf("Try to receive data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP05, "Try to receive data");
 			iInTransfer[0]->TransferIn(KHostNumReadBytesPostHalt);
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP06, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0499::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -184,7 +197,7 @@
 				case KBulkTransferOutId0:
 				case KBulkTransferOutId1:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer %d stalled", aTransferId);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP01, "Transfer %d stalled", aTransferId);
 					break; //switch(aTransferId)
 				
 				default:
@@ -197,7 +210,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1))
 				{
-				RDebug::Printf("Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP02, "Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
 				// Acknowledge the stall and clear				
 				err = iTestPipeInterface1BulkOut.ClearRemoteStall();
 				if(err != KErrNone)
@@ -229,7 +242,7 @@
 				case KBulkTransferOutId0:
 				case KBulkTransferOutId1:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer %d completed", aTransferId);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP03, "Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 
 				default:
@@ -242,7 +255,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1))
 				{
-				RDebug::Printf("Try to receive back sent data. Transfers Completed %d", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP04, "Try to receive back sent data. Transfers Completed %d", iTransferComplete);
 				iCaseStep = ETransferIn;
 				TWriteSynchronousCachedReadDataRequest request(1,1,1);
 				iControlEp0->SendRequest(request,this);	
@@ -277,7 +290,7 @@
 				}
 			
 			// Comparison is a match
-			RDebug::Printf("Comparison for IN transfer is a match");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP05, "Comparison for IN transfer is a match");
 			iCaseStep = EPassed;
 			TTestCasePassed request;
 			iControlEp0->SendRequest(request,this);
@@ -299,16 +312,17 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP06, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0499::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
 	
@@ -324,22 +338,24 @@
 	iOutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkMaxOUTTransferSize,*this,KBulkTransferOutId1);
 	
 	// Initialise the descriptors for transfer		
-	RDebug::Printf("Initialising the transfer descriptors");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL, "Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_DUP01, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOutHalt;	
 	TEndpointReadAndHaltRequest request(1,1,KDeviceNumReadBytesPreHalt);// EP1 means endpoint index 1 not the actual endpoint number
 	iControlEp0->SendRequest(request,this);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-0500Traces.h"
+#endif
 
 
  
@@ -49,10 +53,12 @@
 
 CUT_PBASE_T_USBDI_0500* CUT_PBASE_T_USBDI_0500::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0500* self = new (ELeave) CUT_PBASE_T_USBDI_0500(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -61,41 +67,47 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0500::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0500::~CUT_PBASE_T_USBDI_0500()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0500::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -113,32 +125,33 @@
 			break;
 			
 		case ETransferInHalt:
-			RDebug::Printf("Try to receive data (pre halt)");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP03, "Try to receive data (pre halt)");
 			iInTransfer[0]->TransferIn(KHostNumReadBytesPreHalt1);
 			iInTransfer[1]->TransferIn(KHostNumReadBytesPreHalt2);
 			break;
 		
 		case ETransferIn:
-			RDebug::Printf("Try to receive data");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
 			iInTransfer[0]->TransferIn(KHostNumReadBytesPostHalt1);
 			iInTransfer[1]->TransferIn(KHostNumReadBytesPostHalt2);
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0500::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -158,7 +171,7 @@
 				case KBulkTransferInId0:
 				case KBulkTransferInId1:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer %d completed", aTransferId);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP01, "Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 
 				default:
@@ -171,7 +184,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferInId0 | KBulkTransferInId1))
 				{
-				RDebug::Printf("Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP02, "Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
 				iTransferComplete = 0; //reset
 				// Acknowledge the stall and clear				
 				err = iTestPipeInterface1BulkIn.ClearRemoteStall();
@@ -204,7 +217,7 @@
 				case KBulkTransferInId0:
 				case KBulkTransferInId1:
 					iTransferComplete |= aTransferId;
-					RDebug::Printf("Transfer %d completed", aTransferId);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP03, "Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 
 				default:
@@ -237,7 +250,7 @@
 					}
 
 				// Comparison is a match
-				RDebug::Printf("Comparison for IN transfer is a match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -259,19 +272,20 @@
 	
 	if(err!=KErrNone)
 		{	
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP05, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0500::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -287,7 +301,7 @@
 		iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxINTransferSize,*this,KBulkTransferInId1);
 		
 		// Initialise the descriptors for transfer		
-		RDebug::Printf("Initialising the transfer descriptors");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors");
 		err = iUsbInterface1.InitialiseTransferDescriptors();
 		if(err != KErrNone)
 			{
@@ -296,18 +310,19 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP02, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		RDebug::Printf("Asking client for 'Write' and 'Halt'");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP03, "Asking client for 'Write' and 'Halt'");
 		iCaseStep = ETransferInHalt;	
 		TEndpointPatternSynchronousWriteAndHaltRequest request(1,1,KLiteralFrench4(),KDeviceNumWriteBytesPreHalt);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request,this);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1229.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1229.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-1229Traces.h"
+#endif
 
 
  
@@ -56,10 +60,12 @@
 
 CUT_PBASE_T_USBDI_1229* CUT_PBASE_T_USBDI_1229::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_1229* self = new (ELeave) CUT_PBASE_T_USBDI_1229(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -68,11 +74,14 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_1229::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -92,39 +101,42 @@
 		iOutBufferPtr.Append(KLiteralEnglish5());
 		}
 
-	RDebug::Printf("CUT_PBASE_T_USBDI_1229::ConstructL(): buffer created");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_CONSTRUCTL, "CUT_PBASE_T_USBDI_1229::ConstructL(): buffer created");
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_1229::~CUT_PBASE_T_USBDI_1229()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1229::KillTransfers()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_ENTRY, this );
 	
 	iOutTransfer[0]->Cancel();
 	iOutTransfer[1]->Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1229::ExtractDeviceReadBytes()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_ENTRY, this );
 	
 	iControlEp0->LastRequestCompletionTime( iEndTime[KTestTimer]);
 	iTimingError = iTimingError == KErrNone ? CheckTimes(KBaseTimer, KTestTimer, KMaxTimeDiffPercentage) : iTimingError;
 	ResetTimes(KTestTimer);
 	
-	RDebug::Printf("Collect client's return of the number of bytes read on its bulk out endpoint ...");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES, "Collect client's return of the number of bytes read on its bulk out endpoint ...");
 	TLex8 lex(iInBufferPtr.Left(KNumberStringLength));
 	TUint32 numBytes = 0;
 	User::LeaveIfError(lex.Val(numBytes, EDecimal));
-	RDebug::Printf("********************NUM*BYTES****************************");
-	RDebug::Printf("         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
-	RDebug::Printf("********************NUM*BYTES****************************");
-	RDebug::Printf("\n");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP01, "********************NUM*BYTES****************************");
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP02, "         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP03, "********************NUM*BYTES****************************");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP04, "\n");
 
 	if(numBytes != 0)
 		//Do not count this case - it may result from the remote resetting when all bulk transfers have completed
@@ -134,11 +146,13 @@
 		iDeviceMinTimedNumBytesRead = numBytesSinceLast < iDeviceMinTimedNumBytesRead ?  numBytesSinceLast : iDeviceMinTimedNumBytesRead ;
 		iDeviceMaxTimedNumBytesRead = numBytesSinceLast > iDeviceMaxTimedNumBytesRead ?  numBytesSinceLast : iDeviceMaxTimedNumBytesRead ;;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1229::PostTransferAction()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_ENTRY, this );
 	switch(iTransferResult)
 		{
 		case KErrNone:
@@ -148,20 +162,22 @@
 		case KTransferSuccess:
 			//indicates data validation failure
 			{
-			RDebug::Printf("Asking client to post validation recorded on the endpoint on its interface - ready for collection");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION, "Asking client to post validation recorded on the endpoint on its interface - ready for collection");
 			iCaseStep = ERequestPrepareEndpointValidationResult;
 			TRecordedValidationResultRequest request(1,1);
 			iControlEp0->SendRequest(request,this);
 			}
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT, this );
 			return;
 		
 		default:
 			{
 			iCaseStep = EFailed;
-			RDebug::Print(iMsg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_DUP01, iMsg);
 			TTestCaseFailed request(iTransferResult,iMsg);
 			iControlEp0->SendRequest(request,this);
 			}
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT_DUP01, this );
 			return;
 		}
 	}
@@ -169,11 +185,12 @@
 
 TBool CUT_PBASE_T_USBDI_1229::PerformNextTransfer(TInt aTransferId)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_ENTRY, this );
 	
 	if(iNumWriteBytesRequested >= KTotalBytesToTransfer)
 		{
-		RDebug::Printf("All transfers sent - num bytes actually written = %d, num bytes required to be written = %d", iNumWriteBytesRequested, KTotalBytesToTransfer);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER, "All transfers sent - num bytes actually written = %u, num bytes required to be written = %u", iNumWriteBytesRequested, KTotalBytesToTransfer);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT, this, EFalse );
 		return EFalse; //Not writing any more - signal to user that no more transfers are required
 		}
 	TUint bytesToWrite = KTotalBytesToTransfer - iNumWriteBytesRequested;
@@ -185,32 +202,35 @@
 	bulkTransfer.TransferOut(iOutBufferPtr.Mid(iNumWriteBytesRequested%(KLiteralEnglish5().Length()), numWriteBytes), EFalse);
 	iNumWriteBytesRequested += numWriteBytes;
 
+	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT_DUP01, this, ETrue );
 	return ETrue;
 	}
 
 	
 void CUT_PBASE_T_USBDI_1229::RequestNumBytesSent(TUint8 aTimerIndex)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_ENTRY, this );
 	iInBufferPtr.Set(iInBuffer->Des());
 	iInBufferPtr.Zero(); //reset
 	iInBufferPtr.SetLength(KNumberStringLength);
 	TInterfaceGetRecordedNumBytesReadInPayload request(1,1,iInBufferPtr);
 	iControlEp0->SendRequest(request,this);
 	iControlEp0->LastRequestStartTime( iStartTime[aTimerIndex]);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1229::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -218,10 +238,11 @@
 			KillTransfers();
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -241,7 +262,7 @@
 		case EGetTimerBase:
 			{
 			iControlEp0->LastRequestCompletionTime( iEndTime[KBaseTimer]);
-			RDebug::Printf("Asking client for continuous 'Read' and 'Validate'");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for continuous 'Read' and 'Validate'");
 			iCaseStep = ERequestRepeatedReadAndValidate;
 			TRepeatedReadAndValidateDataRequest request(1,1,KLiteralEnglish5(),KDeviceNumReadBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 			iControlEp0->SendRequest(request,this);
@@ -250,7 +271,7 @@
 			
 		case ERequestRepeatedReadAndValidate:
 			{
-			RDebug::Printf("Try to perform ALL transfers");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP04, "Try to perform ALL transfers");
 	
 			iCaseStep = ETransfer;	
 			
@@ -278,7 +299,7 @@
 			
 		case ERequestPrepareEndpointValidationResult:
 			{
-			RDebug::Printf("Asking client to prepare the result of its continuous validation");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP05, "Asking client to prepare the result of its continuous validation");
 			iCaseStep = ERequestValidationResult;
 			iInBufferPtr.Set(iInBuffer->Des());
 			iInBufferPtr.Zero(); //reset
@@ -289,14 +310,14 @@
 			break;
 	
 		case ERequestValidationResult:
-			RDebug::Printf("Collect client's return validation  result in a pass or fail string ...");
-			RDebug::RawPrint(*iInBuffer);
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP06, "Collect client's return validation  result in a pass or fail string ...");
+            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP56, "", iInBuffer->Ptr(), iInBuffer->Length());
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP07, "\n");
 			iInBufferPtr.Set(iInBuffer->Des());
 			if(iInBufferPtr.Compare(KClientPassString) == 0)
 				{
-				RDebug::Printf("Client Validation Result is a PASS");
-				RDebug::Printf("This is the FINAL check - the whole test has a PASSED");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP08, "Client Validation Result is a PASS");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP09, "This is the FINAL check - the whole test has a PASSED");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -306,7 +327,7 @@
 				TBuf<256> msg;
 				_LIT(lit, "<Error> Bulk data VALIDATION check was NOT successful");
 				msg.Format(lit);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP10, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -314,19 +335,20 @@
 			break;
 	
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP11, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1229::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	iTransferResult = KErrNone;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -348,12 +370,12 @@
 				iMsg.Format(lit, iTransferResult, KBulkTransferOutId[0], KBulkTransferOutId[1], aTransferId);
 				break;
 				}
-			RDebug::Printf("Transfer OUT %d completed - num bytes sent = %d", aTransferId, iNumWriteBytesRequested);
+			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed - num bytes sent = %d", aTransferId, iNumWriteBytesRequested);
 			
 			if(PerformNextTransfer(aTransferId)==EFalse)
 				{
 				iTransferComplete |= aTransferId;
-				RDebug::Printf("All transfer OUT %ds completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+				OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP02, "All transfer OUT %ds completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 				}
 			
 			if(iTransferResult==KErrNone && (iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
@@ -361,7 +383,7 @@
 				/*
 				Transfers all complete - now ask device to validate first interface's transfer OUT
 				*/
-				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP03, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				if(iTransferResult==KErrNone)
 					{
 					iBulkTestTimer->Cancel(); //Cancel Timer 
@@ -374,9 +396,9 @@
 						}
 					if(KMaxBytesReadDiffPercentage*iDeviceMaxTimedNumBytesRead > KPercent*iDeviceMinTimedNumBytesRead)
 						{
-						RDebug::Printf("Device APPARENTLY reading rate erratic:-");
-						RDebug::Printf("Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
-						RDebug::Printf("Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
+						OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP04, "Device APPARENTLY reading rate erratic:-");
+						OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP05, "Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
+						OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP06, "Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
 						iTransferResult = KErrTooBig;
 						iDeviceMaxTimedNumBytesRead = 0;
 						iDeviceMinTimedNumBytesRead = KMaxTUint;
@@ -424,14 +446,15 @@
 			iCaseStep = EDelayedTransferComplete; //so that we move forward when the EP0 transfer has completed
 			}
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1229::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -458,7 +481,7 @@
 			iOutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferOutId[1]);
 			
 			// Initialise the descriptors for transfer		
-			RDebug::Printf("Initialising the transfer descriptors - interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -469,7 +492,7 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP02, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
@@ -482,14 +505,17 @@
 		iDeviceNumBytesReadInTotal = 0;
 		RequestNumBytesSent(KBaseTimer);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1229::HandleBulkTestTimerFired()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_ENTRY, this );
 	if(iCaseStep == ETransfer)
 		{
 		RequestNumBytesSent(KTestTimer);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1230.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1230.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -20,6 +20,10 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-1230Traces.h"
+#endif
 
 
  
@@ -58,10 +62,12 @@
 
 CUT_PBASE_T_USBDI_1230* CUT_PBASE_T_USBDI_1230::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_1230* self = new (ELeave) CUT_PBASE_T_USBDI_1230(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -70,11 +76,14 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_1230::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -92,39 +101,42 @@
 		iValidateBufferPtr.Append(KLiteralEnglish5());
 		}
 	
-	RDebug::Printf("CUT_PBASE_T_USBDI_1230::ConstructL(): buffer created");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_CONSTRUCTL, "CUT_PBASE_T_USBDI_1230::ConstructL(): buffer created");
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_1230::~CUT_PBASE_T_USBDI_1230()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1230::KillTransfers()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_ENTRY, this );
 	
 	iInTransfer[0]->Cancel();
 	iInTransfer[1]->Cancel();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1230::ExtractDeviceReadBytes()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_ENTRY, this );
 	
 	iControlEp0->LastRequestCompletionTime( iEndTime[KTestTimer]);
 	iTimingError = iTimingError == KErrNone ? CheckTimes(KBaseTimer, KTestTimer, KMaxTimeDiffPercentage) : iTimingError;
 	ResetTimes(KTestTimer);
 	
-	RDebug::Printf("Collect client's return of the number of bytes written on its bulk in endpoint ...");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES, "Collect client's return of the number of bytes written on its bulk in endpoint ...");
 	TLex8 lex(iInBufferPtr.Left(KNumberStringLength));
 	TUint32 numBytes = 0;
 	User::LeaveIfError(lex.Val(numBytes, EDecimal));
-	RDebug::Printf("********************NUM*BYTES****************************");
-	RDebug::Printf("         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
-	RDebug::Printf("********************NUM*BYTES****************************");
-	RDebug::Printf("\n");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP01, "********************NUM*BYTES****************************");
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP02, "         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP03, "********************NUM*BYTES****************************");
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP04, "\n");
 
 	if(numBytes != 0)
 		//Do not count this case - it may result from the remote resetting when all bulk transfers have completed
@@ -134,11 +146,13 @@
 		iDeviceMinTimedNumBytesRead = numBytesSinceLast < iDeviceMinTimedNumBytesRead ?  numBytesSinceLast : iDeviceMinTimedNumBytesRead ;
 		iDeviceMaxTimedNumBytesRead = numBytesSinceLast > iDeviceMaxTimedNumBytesRead ?  numBytesSinceLast : iDeviceMaxTimedNumBytesRead ;;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1230::PostTransferAction()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_ENTRY, this );
 	switch(iTransferResult)
 		{
 		case KErrNone:
@@ -148,22 +162,24 @@
 		case KTransferSuccess:
 			{
 			// Indicates success - comparison is a match
-			RDebug::Printf("Comparison for IN transfer is a match");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION, "Comparison for IN transfer is a match");
 			iCaseStep = EPassed;
 			TTestCasePassed request;
 			iTransferComplete = 0; //reset
 			iControlEp0->SendRequest(request,this);
 			}
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT, this );
 			return; 
 			
 			
 		default:
 			{
 			iCaseStep = EFailed;
-			RDebug::Print(iMsg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_DUP01, iMsg);
 			TTestCaseFailed request(iTransferResult,iMsg);
 			iControlEp0->SendRequest(request,this);
 			}
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT_DUP01, this );
 			return;
 		}
 	}
@@ -171,7 +187,7 @@
 
 TInt CUT_PBASE_T_USBDI_1230::ValidatePreviousAndPerformNextTransfers(TInt aTransferId)
 		{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY, this );
 	
 	TUint8 index = 0;
 	switch(aTransferId)
@@ -187,11 +203,12 @@
 		default:
 			_LIT(lit, "TRANSFER ID OUT OF RANGE");
 			User::Panic(lit, KErrArgument);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT, this );
 			return 0; //should never get here
 		}
 
-	RDebug::Printf("\n");
-	RDebug::Printf("Transfer[%d]", index);
+	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS, "\n");
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01, "Transfer[%d]", index);
 	
 	
 	if(iNumBytesExpected[index] != 0)
@@ -199,7 +216,7 @@
 		TPtrC8 data1(iInTransfer[index]->DataPolled());
 		if(ValidateData(data1, iValidateBufferPtr.Mid(iValidationStringStartPointTransfer[index], iNumBytesExpected[index])) == EFalse)
 			{
-			RDebug::Printf("=====VALIDATION FAILURE: Point of Validation String Entry %d, Newly Read Bytes %d=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
+			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02, "=====VALIDATION FAILURE: Point of Validation String Entry %u, Newly Read Bytes %u=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
 			iIsValid = EFalse;
 			}
 		iNumBytesExpected[index] = 0; //reset
@@ -207,7 +224,8 @@
 	if(iNumBytesRequestedSoFar >= KTotalBytesToTransfer)
 		//if we are near the end end the other transfer will mop up remaining bytes...
 		{
-		RDebug::Printf("****ALL DONE for Transfer[%d]****", index);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03, "****ALL DONE for Transfer[%d]****", index);
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01, this, (TUint)KBulkTransferInId[index] );
 		return KBulkTransferInId[index];
 		}
 	iValidationStringStartPointTransfer[index] = iNumBytesRequestedSoFar%(KLiteralEnglish5().Length()); //PRIOR TO THIS TRANSFER
@@ -217,32 +235,35 @@
 	iInTransfer[index]->TransferIn(KHostNumReadBytes); //rely on ZLP to complete the last 'TransferIn'
 	iExpectedNextTransferNumber = 1 - iExpectedNextTransferNumber;
 
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP02, this );
 	return 0;
 	}
 
 	
 void CUT_PBASE_T_USBDI_1230::RequestNumBytesSent(TUint8 aTimerIndex)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_ENTRY, this );
 	iInBufferPtr.Set(iInBuffer->Des());
 	iInBufferPtr.Zero(); //reset
 	iInBufferPtr.SetLength(KNumberStringLength);
 	TInterfaceGetRecordedNumBytesReadInPayload request(1,1,iInBufferPtr);
 	iControlEp0->SendRequest(request,this);
  	iControlEp0->LastRequestStartTime( iStartTime[aTimerIndex]);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1230::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_ENTRY, this );
 	
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
+	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -250,10 +271,11 @@
 			KillTransfers();
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP02, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -273,7 +295,7 @@
 		case EGetTimerBase:
 			{
 			iControlEp0->LastRequestCompletionTime( iEndTime[KBaseTimer]);
-			RDebug::Printf("Asking client for repeated 'Write'");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for repeated 'Write'");
 			iCaseStep = ERequestRepeatedWrite;	
 			TRepeatedWriteDataRequest request(1,1,KLiteralEnglish5(),KDeviceNumWriteBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 			iControlEp0->SendRequest(request,this);
@@ -282,14 +304,14 @@
 			
 		case ERequestRepeatedWrite:
 			{
-			RDebug::Printf("Try to perform ALL transfers");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP04, "Try to perform ALL transfers");
 			
 			iCaseStep = ETransfer;	
 			iIsValid = ETrue; //innocent until proved guilty
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP05, "\n");
 			ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[0]); //should not validate - just perform necessary transfers
 			ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[1]); //should not validate - just perform necessary transfers
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP06, "\n");
 			_LITDBG("Bulk test timer NOT instanciated");
 			__ASSERT_DEBUG(iBulkTestTimer, User::Panic(lit, KErrGeneral));
 			iBulkTestTimer->After(KRepeatedTimerInterval);
@@ -315,19 +337,20 @@
 			break;
 			
 		default:
-			RDebug::Printf("<Error> Unknown test step");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP07, "<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1230::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	
 	iTransferResult = KErrNone;
-	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -350,18 +373,18 @@
 				break;
 				}
 		
-			RDebug::Printf("Transfer IN %d completed - num bytes requested = %d", aTransferId, iNumBytesRequestedSoFar);
+			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP01, "Transfer IN %d completed - num bytes requested = %u", aTransferId, iNumBytesRequestedSoFar);
 	
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP02, "\n");
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(aTransferId);
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP03, "\n");
 			
 			if(iTransferResult==KErrNone && (iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
 				{
 				/*
 				Transfers all complete - now check validation
 				*/
-				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP04, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				iBulkTestTimer->Cancel(); //Cancel Timer 
 				iTransferResult = KTransferSuccess;
 				if(!iIsValid)
@@ -379,9 +402,9 @@
 				
 				if(KMaxBytesWrittenDiffPercentage*iDeviceMaxTimedNumBytesRead > KPercent*iDeviceMinTimedNumBytesRead)
 					{
-					RDebug::Printf("Device APPARENTLY reading rate erratic:-");
-					RDebug::Printf("Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
-					RDebug::Printf("Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP05, "Device APPARENTLY reading rate erratic:-");
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP06, "Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP07, "Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
 					iTransferResult = KErrTooBig;
 					iDeviceMaxTimedNumBytesRead = 0;
 					iDeviceMinTimedNumBytesRead = KMaxTUint;
@@ -428,14 +451,15 @@
 			iCaseStep = EDelayedTransferComplete; //so that we move forward when the EP0 transfer has completed
 			}
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1230::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_ENTRY, this );
 	
 	Cancel();
-	RDebug::Printf("this - %08x", this);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL, "this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -462,7 +486,7 @@
 			iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferInId[1]);
 			
 			// Initialise the descriptors for transfer		
-			RDebug::Printf("Initialising the transfer descriptors - interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -473,7 +497,7 @@
 		}
 	if(err != KErrNone)
 		{
-		RDebug::Print(msg);
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP02, msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
@@ -486,14 +510,17 @@
 		iDeviceNumBytesReadInTotal = 0;
 		RequestNumBytesSent(KBaseTimer);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1230::HandleBulkTestTimerFired()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_ENTRY, this );
 	if(iCaseStep == ETransfer)
 		{
 		RequestNumBytesSent(KTestTimer);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1231.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1231.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,6 +21,10 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-1231Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -32,34 +36,40 @@
 
 	CUT_PBASE_T_USBDI_1231* CUT_PBASE_T_USBDI_1231::NewL(TBool aHostRole)
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_NEWL_ENTRY, aHostRole );
 		CUT_PBASE_T_USBDI_1231* self = new (ELeave) CUT_PBASE_T_USBDI_1231(aHostRole);
 		CleanupStack::PushL(self);
 		self->ConstructL();
 		CleanupStack::Pop(self);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_NEWL_EXIT, ( TUint )( self ) );
 		return self;
 		}
 
 	CUT_PBASE_T_USBDI_1231::CUT_PBASE_T_USBDI_1231(TBool aHostRole) :
 		CBaseTestCase(KTestCaseId, aHostRole), iInterface0Resumed(EFalse)
 		{
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY, this );
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ConstructL()
 		{
-		RDebug::Printf("====> Constructor entry priority = %d", RThread().Priority());
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_CONSTRUCTL_ENTRY, this );
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231, "====> Constructor entry priority = %d", RThread().Priority());
 
 		// Collect existing thread priority (to reinstate later)
 		iPriority = RThread().Priority();
 
 		iTestDevice = new RUsbDeviceA(this);
 		BaseConstructL();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_CONSTRUCTL_EXIT, this );
 		}
 
 	CUT_PBASE_T_USBDI_1231::~CUT_PBASE_T_USBDI_1231()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY_DUP01, this );
 
-		RDebug::Printf("====> Destructor entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231, "====> Destructor entry priority = %d", RThread().Priority());
 
 		// Reinstate original priority
 
@@ -85,19 +95,20 @@
 			iTestDevice->Close();
 			}
 		delete iTestDevice;
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ExecuteHostTestCaseL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_ENTRY, this );
 
-		RDebug::Printf("====> ExecuteHostTestCaseL entry priority = %d",
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP01, "====> ExecuteHostTestCaseL entry priority = %d",
 				RThread().Priority());
 
 		// Bump thread priority for this test only
 
 		RThread().SetPriority(EPriorityAbsoluteHigh);
-		RDebug::Printf("Thread priority raised %d->%d", iPriority, RThread().Priority());
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP02, "Thread priority raised %d->%d", iPriority, RThread().Priority());
 
 		iCaseStep = EInProcess;
 		iActorFDF = CActorFDF::NewL(*this);
@@ -110,11 +121,12 @@
 
 		// Start the connection timeout	
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ExecuteDeviceTestCaseL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_ENTRY, this );
 
 		// Construct the device for the test case
 		iTestDevice->OpenL(TestCaseId());
@@ -123,31 +135,34 @@
 
 		// Connect the test device	
 		iTestDevice->SoftwareConnect();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::HostDoCancel()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_ENTRY, this );
 
-		RDebug::Printf("====> HostDoCancel entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP03, "====> HostDoCancel entry priority = %d", RThread().Priority());
 
 		// Cancel the timeout timer
 		CancelTimeout();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceDoCancel()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_ENTRY, this );
 
 		// Cancel the device	
 		iTestDevice->CancelSubscriptionToReports();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceInsertedL(TUint aDeviceHandle)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_ENTRY, this );
 
-		RDebug::Printf("====> DeviceInsertedL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP04, "====> DeviceInsertedL entry priority = %d", RThread().Priority());
 		
 		iInterface0Resumed = EFalse;
 		
@@ -168,6 +183,7 @@
 
 			// Start the connection timeout again
 			TimeoutIn(30);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT, this );
 			return;
 			}
 		// Check tree now	
@@ -181,7 +197,7 @@
 				TUint32 token1(0);
 				TUint32 token2(0);
 
-				RDebug::Printf("Obtaining token for interface 0");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP05, "Obtaining token for interface 0");
 				err = testDevice.Device().GetTokenForInterface(0, token1);
 				if (err != KErrNone)
 					{
@@ -190,8 +206,8 @@
 							err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Token 1 (%d) retrieved", token1);
-				RDebug::Printf("Opening interface 0");
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP06, "Token 1 (%d) retrieved", token1);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP07, "Opening interface 0");
 				err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -199,9 +215,9 @@
 							"<Error %d> Interface 0 could not be opened", err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Interface 0 opened");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP08, "Interface 0 opened");
 
-				RDebug::Printf("Obtaining token for interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP09, "Obtaining token for interface 1");
 				err = testDevice.Device().GetTokenForInterface(1, token2);
 				if (err != KErrNone)
 					{
@@ -210,7 +226,7 @@
 							err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Opening interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP10, "Opening interface 1");
 				err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -218,7 +234,7 @@
 							"<Error %d> Interface 1 could not be opened", err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Interface 1 opened");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP11, "Interface 1 opened");
 
 				ResumeWhenSuspending();
 
@@ -229,22 +245,23 @@
 				TestFailed(KErrCorrupt);
 				break;
 			}
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT_DUP01, this );
 		}
 
 	TInt CUT_PBASE_T_USBDI_1231::Interface0ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_ENTRY, 0 );
 
-		RDebug::Printf("====> Interface0ResumedL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP12, "====> Interface0ResumedL entry priority = %d", RThread().Priority());
 
-		RDebug::Printf("-Interface 0 resumed");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP13, "-Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1231* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1231*>(aPtr);
 		
 		TInt completionCode=self->iInterface0Watcher->CompletionCode();
 		
 		TInt testStep = self->iCaseStep;
-		RDebug::Printf(" -watcher 0 iStatus = %d <teststep %d>",completionCode, testStep);
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP14, " -watcher 0 iStatus = %d <teststep %d>",completionCode, testStep);
            
 		self->iInterface0Resumed = ETrue;
 		
@@ -255,7 +272,7 @@
 				{
 				if (completionCode == KErrNone)
 				 {
-				 RDebug::Printf("Device resume while suspending succeed!");
+				 OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP15, "Device resume while suspending succeed!");
 				 self->TimeoutIn(10);
 				 self->iCaseStep = EPassed;
 				 self->SendEp0Request();
@@ -275,51 +292,55 @@
 				break;
 			};
 
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1231::Interface1ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_ENTRY, 0 );
 
-		RDebug::Printf("====> Interface1ResumedL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP16, "====> Interface1ResumedL entry priority = %d", RThread().Priority());
 
-		RDebug::Printf("Interface 1 resumed");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP17, "Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1231* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1231*>(aPtr);
-		RDebug::Printf("watcher 1 iStatus=%d",
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP18, "watcher 1 iStatus=%d",
 				self->iInterface1Watcher->CompletionCode());
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceRemovedL(TUint aDeviceHandle)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_ENTRY, this );
 
 		// The test device should not be removed until the test case has passed
 		// so this test case has not completed, and state this event as an error
 
 		TestFailed(KErrDisconnected);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::BusErrorL(TInt aError)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_BUSERRORL_ENTRY, this );
 
 		// This test case handles no failiures on the bus
 
 		TestFailed(aError);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_BUSERRORL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceStateChangeL(
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
-		LOG_FUNC
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_ENTRY, this );
 		Cancel();
 
 		// test RInterface , the  RUsbDevice notification logic not used . 
-		RDebug::Printf(" -Device State change from %d to %d err=%d",
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP19, " -Device State change from %d to %d err=%d",
 				aPreviousState, aNewState, aCompletionCode);
 
 		switch (iCaseStep)
@@ -327,12 +348,12 @@
 			case EValidDeviceSuspend:
 				if (aNewState == RUsbDevice::EDeviceSuspended)
 					{
-					RDebug::Printf("Device suspend!");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP20, "Device suspend!");
 					iCaseStep = EValidDeviceResume;
 					}
 				else
 					{
-					RDebug::Printf("Device suspend failed!");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP21, "Device suspend failed!");
 					iCaseStep = EFailed;
 					SendEp0Request();
 					}
@@ -341,7 +362,7 @@
 
 				if (aNewState == RUsbDevice::EDeviceActive)
 					{
-					RDebug::Printf("Device resume!");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP22, "Device resume!");
 					if (!iInterface0Resumed)
                         {
                         iCaseStep = EValidResumeWhenSuspending;
@@ -363,12 +384,13 @@
 				break;
 			}
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-		LOG_FUNC
-		RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_ENTRY, this );
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP23, "Ep0TransferCompleteL with aCompletionCode = %d",
 				aCompletionCode);
 		switch (iCaseStep)
 			{
@@ -382,13 +404,14 @@
 				TestPassed();
 				break;
 			}
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::HostRunL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_HOSTRUNL_ENTRY, this );
 
-		RDebug::Printf("====> HostRunL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP24, "====> HostRunL entry priority = %d", RThread().Priority());
 
 		// Obtain the completion code
 		TInt completionCode(iStatus.Int());
@@ -396,20 +419,21 @@
 		if (completionCode == KErrNone)
 			{
 			// Action timeout
-			RDebug::Printf("<Error> Action timeout");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP25, "<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}
 		else
 			{
-			RDebug::Printf("<Error %d> Timeout timer could not complete",
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP26, "<Error %d> Timeout timer could not complete",
 					completionCode);
 			TestFailed(completionCode);
 			}
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_HOSTRUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceRunL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_DEVICERUNL_ENTRY, this );
 
 		// Disconnect the device
 
@@ -418,33 +442,38 @@
 		// Complete the test case request
 
 		TestPolicy().SignalTestComplete(iStatus.Int());
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICERUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ResumeWhenSuspending()
 		{
-		RDebug::Printf("====> ResumeWhenSuspending entry priority = %d",
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_ENTRY, this );
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP27, "====> ResumeWhenSuspending entry priority = %d",
 				RThread().Priority());
 
 		// Suspend interface 0
-		RDebug::Printf("Suspending interface 0");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP28, "Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();
 
 		// Suspend interface 1
-		RDebug::Printf("Suspending interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP29, "Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 
 		// Cancel suspend-in-progress
-		RDebug::Printf("Cancel Suspend interface 0");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP30, "Cancel Suspend interface 0");
 		iUsbInterface0.CancelPermitSuspend();
 
 		iCaseStep = EValidDeviceSuspend;
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::SendEp0Request()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_ENTRY, this );
 		TTestCasePassed request;
 		iControlEp0->SendRequest(request, this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_EXIT, this );
 		}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1232.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1232.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,6 +21,10 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-1232Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -46,7 +50,7 @@
 
 	void CUT_PBASE_T_USBDI_1232::ConstructL()
 		{
-		RDebug::Printf("====> Constructor entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_CUT_PBASE_T_USBDI_1232, "====> Constructor entry priority = %d", RThread().Priority());
 
 		// Collect existing thread priority (to reinstate later)
 		iPriority = RThread().Priority();
@@ -57,9 +61,8 @@
 
 	CUT_PBASE_T_USBDI_1232::~CUT_PBASE_T_USBDI_1232()
 		{
-		LOG_FUNC
 
-		RDebug::Printf("====> Destructor entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232, "====> Destructor entry priority = %d", RThread().Priority());
 
 		// Reinstate original priority
 
@@ -89,15 +92,14 @@
 
 	void CUT_PBASE_T_USBDI_1232::ExecuteHostTestCaseL()
 		{
-		LOG_FUNC
 
-		RDebug::Printf("====> ExecuteHostTestCaseL entry priority = %d",
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP01, "====> ExecuteHostTestCaseL entry priority = %d",
 				RThread().Priority());
 
 		// Bump thread priority for this test only
 
 		RThread().SetPriority(EPriorityAbsoluteHigh);
-		RDebug::Printf("Thread priority raised %d->%d", iPriority, RThread().Priority());
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP02, "Thread priority raised %d->%d", iPriority, RThread().Priority());
 
 		iCaseStep = EInProcess;
 		iActorFDF = CActorFDF::NewL(*this);
@@ -114,7 +116,6 @@
 
 	void CUT_PBASE_T_USBDI_1232::ExecuteDeviceTestCaseL()
 		{
-		LOG_FUNC
 
 		// Construct the device for the test case
 		iTestDevice->OpenL(TestCaseId());
@@ -127,9 +128,8 @@
 
 	void CUT_PBASE_T_USBDI_1232::HostDoCancel()
 		{
-		LOG_FUNC
 
-		RDebug::Printf("====> HostDoCancel entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP03, "====> HostDoCancel entry priority = %d", RThread().Priority());
 
 		// Cancel the timeout timer
 		CancelTimeout();
@@ -137,7 +137,6 @@
 
 	void CUT_PBASE_T_USBDI_1232::DeviceDoCancel()
 		{
-		LOG_FUNC
 
 		// Cancel the device	
 		iTestDevice->CancelSubscriptionToReports();
@@ -145,9 +144,8 @@
 
 	void CUT_PBASE_T_USBDI_1232::DeviceInsertedL(TUint aDeviceHandle)
 		{
-		LOG_FUNC
 
-		RDebug::Printf("====> DeviceInsertedL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP04, "====> DeviceInsertedL entry priority = %d", RThread().Priority());
 
 		Cancel(); // Cancel the timer
 		TInt err(KErrNone);
@@ -179,7 +177,7 @@
 				TUint32 token1(0);
 				TUint32 token2(0);
 
-				RDebug::Printf("Obtaining token for interface 0");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP05, "Obtaining token for interface 0");
 				err = testDevice.Device().GetTokenForInterface(0, token1);
 				if (err != KErrNone)
 					{
@@ -188,8 +186,8 @@
 							err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Token 1 (%d) retrieved", token1);
-				RDebug::Printf("Opening interface 0");
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP06, "Token 1 (%d) retrieved", token1);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP07, "Opening interface 0");
 				err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -197,9 +195,9 @@
 							"<Error %d> Interface 0 could not be opened", err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Interface 0 opened");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP08, "Interface 0 opened");
 
-				RDebug::Printf("Obtaining token for interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP09, "Obtaining token for interface 1");
 				err = testDevice.Device().GetTokenForInterface(1, token2);
 				if (err != KErrNone)
 					{
@@ -208,7 +206,7 @@
 							err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Opening interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP10, "Opening interface 1");
 				err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -216,15 +214,15 @@
 							"<Error %d> Interface 1 could not be opened", err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Interface 1 opened");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP11, "Interface 1 opened");
 
 				// device go to suspend
 				// Suspend interface 0
-				RDebug::Printf("Suspending interface 0");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP12, "Suspending interface 0");
 				iInterface0Watcher->SuspendAndWatch();
 
 				// Suspend interface 1
-				RDebug::Printf("Suspending interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP13, "Suspending interface 1");
 				iInterface1Watcher->SuspendAndWatch();
 
 				iCaseStep = ESuspendWhenResuming;
@@ -245,15 +243,14 @@
 
 	TInt CUT_PBASE_T_USBDI_1232::Interface0ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
 
-		RDebug::Printf("====> Interface0ResumedL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP14, "====> Interface0ResumedL entry priority = %d", RThread().Priority());
 
-		RDebug::Printf(" -Interface 0 resumed");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP15, " -Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1232* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1232*>(aPtr);
 		TInt completionCode = self->iInterface0Watcher->CompletionCode();
-		RDebug::Printf(" -watcher 0 iStatus=%d",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP16, " -watcher 0 iStatus=%d",completionCode);
 
 		switch (self->iCaseStep)
 			{	
@@ -262,12 +259,12 @@
 				{
 				if (completionCode == KErrNone)
 					{
-					RDebug::Printf("Device resume successed,test passed!");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP17, "Device resume successed,test passed!");
 					self->SendEp0Request(); // stop client site
 					}
 				else
 					{
-					RDebug::Printf("Device resume failed, err = %d ",completionCode);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP18, "Device resume failed, err = %d ",completionCode);
 					self->iCaseStep = EFailed;
 					self->SendEp0Request();
 					}
@@ -286,20 +283,18 @@
 
 	TInt CUT_PBASE_T_USBDI_1232::Interface1ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
 
-		RDebug::Printf("====> Interface1ResumedL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP19, "====> Interface1ResumedL entry priority = %d", RThread().Priority());
 
-		RDebug::Printf("Interface 1 resumed");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP20, "Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1232* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1232*>(aPtr);
-		RDebug::Printf("watcher 1 iStatus=%d", self->iInterface1Watcher->CompletionCode());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP21, "watcher 1 iStatus=%d", self->iInterface1Watcher->CompletionCode());
 		return KErrNone;
 		}
 
 	void CUT_PBASE_T_USBDI_1232::DeviceRemovedL(TUint aDeviceHandle)
 		{
-		LOG_FUNC
 
 		// The test device should not be removed until the test case has passed
 		// so this test case has not completed, and state this event as an error
@@ -309,7 +304,6 @@
 
 	void CUT_PBASE_T_USBDI_1232::BusErrorL(TInt aError)
 		{
-		LOG_FUNC
 
 		// This test case handles no failiures on the bus
 
@@ -320,18 +314,17 @@
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
-		LOG_FUNC
 		Cancel();
 
 		// test RInterface , the  RUsbDevice notification logic not used . 
-		RDebug::Printf(" -Device State change from err=%d",aCompletionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP22, " -Device State change from err=%d",aCompletionCode);
 
 		switch (iCaseStep)
 			{
 			case ESuspendWhenResuming:
 				if (aNewState == RUsbDevice::EDeviceSuspended)
 					{
-					RDebug::Printf("====> device has suspended!");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP23, "====> device has suspended!");
                     
 					SuspendWhenResuming();					
 					}
@@ -340,7 +333,7 @@
 				if (aPreviousState == RUsbDevice::EDeviceSuspended&&aNewState
 						== RUsbDevice::EDeviceSuspended)
 					{
-					RDebug::Printf("====> device suspended again,suspend while resuming succeed!");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP24, "====> device suspended again,suspend while resuming succeed!");
 					iCaseStep = EPassed;
 					iUsbInterface0.CancelPermitSuspend();
 					}
@@ -359,8 +352,7 @@
 
 	void CUT_PBASE_T_USBDI_1232::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-		LOG_FUNC
-		RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP25, "Ep0TransferCompleteL with aCompletionCode = %d",
 				aCompletionCode);
 		switch (iCaseStep)
 			{
@@ -378,9 +370,8 @@
 
 	void CUT_PBASE_T_USBDI_1232::HostRunL()
 		{
-		LOG_FUNC
 
-		RDebug::Printf("====> HostRunL entry priority = %d", RThread().Priority());
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP26, "====> HostRunL entry priority = %d", RThread().Priority());
 
 		// Obtain the completion code
 		TInt completionCode(iStatus.Int());
@@ -388,12 +379,12 @@
 		if (completionCode == KErrNone)
 			{
 			// Action timeout
-			RDebug::Printf("<Error> Action timeout");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP27, "<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}
 		else
 			{
-			RDebug::Printf("<Error %d> Timeout timer could not complete",
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP28, "<Error %d> Timeout timer could not complete",
 					completionCode);
 			TestFailed(completionCode);
 			}
@@ -401,7 +392,6 @@
 
 	void CUT_PBASE_T_USBDI_1232::DeviceRunL()
 		{
-		LOG_FUNC
 
 		// Disconnect the device
 
@@ -414,21 +404,21 @@
 
 	void CUT_PBASE_T_USBDI_1232::SuspendWhenResuming()
 		{
-		RDebug::Printf("====> SuspendWhenResuming entry priority = %d",
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP29, "====> SuspendWhenResuming entry priority = %d",
 				RThread().Priority());
 
 		// Cancel suspend-in-progress
-		RDebug::Printf("Cancel Suspend interface 0");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP30, "Cancel Suspend interface 0");
 				
 		iUsbInterface0.CancelPermitSuspend();
 		
 		// how to prove, see log? 
 		// Suspend interface 0
-		RDebug::Printf("Suspending interface 0");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP31, "Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();			
 
 		// Suspend interface 1
-		RDebug::Printf("Suspending interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP32, "Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 
 		iCaseStep = EValidSuspendWhenResuming;
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1234.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1234.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,10 @@
 #include "modelleddevices.h"
 #include "testpolicy.h"
 #include "testliterals.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-1234Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -53,35 +57,43 @@
 
 	CUT_PBASE_T_USBDI_1234* CUT_PBASE_T_USBDI_1234::NewL(TBool aHostRole)
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_NEWL_ENTRY, aHostRole );
 		CUT_PBASE_T_USBDI_1234* self = new (ELeave) CUT_PBASE_T_USBDI_1234(aHostRole);
 		CleanupStack::PushL(self);
 		self->ConstructL();
 		CleanupStack::Pop(self);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_NEWL_EXIT, ( TUint )( self ) );
 		return self;
 		}
 
 	CUT_PBASE_T_USBDI_1234::CUT_PBASE_T_USBDI_1234(TBool aHostRole) :
 		CBaseBulkTestCase(KTestCaseId, aHostRole), iCaseStep(EInProgress)
 		{
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY, this );
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::ExecuteHostTestCaseL()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_ENTRY, this );
 		CBaseBulkTestCase::ExecuteHostTestCaseL();
 		iInterface0Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface0,TCallBack(CUT_PBASE_T_USBDI_1234::Interface0ResumedL,this));
 		iInterface1Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface1,TCallBack(CUT_PBASE_T_USBDI_1234::Interface1ResumedL,this));
 		iInterface2Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface1,TCallBack(CUT_PBASE_T_USBDI_1234::Interface2ResumedL,this));
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::ConstructL()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_CONSTRUCTL_ENTRY, this );
 		BaseBulkConstructL();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_CONSTRUCTL_EXIT, this );
 		}
 
 	CUT_PBASE_T_USBDI_1234::~CUT_PBASE_T_USBDI_1234()
 		{
-		LOG_FUNC
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY_DUP01, this );
 		// Cancel any async operations
 
 		Cancel(); // Cancel host timer
@@ -99,11 +111,12 @@
 			delete iInterface2Watcher;
 			}
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::DeviceInsertedL(TUint aDeviceHandle)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_ENTRY, this );
 
 		Cancel();
 
@@ -128,16 +141,17 @@
 				= new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId2);
 
 		// Initialise the descriptors for transfer		
-		RDebug::Printf("Initialising the transfer descriptors");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234, "Initialising the transfer descriptors");
 		TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 		if (err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP01, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err, msg);
 			iControlEp0->SendRequest(request, this);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT, this );
 			return;
 			}
 
@@ -145,18 +159,19 @@
 
 		TrySuspendDeviceByInterfaces();
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT_DUP01, this );
 		}
 
 	TInt CUT_PBASE_T_USBDI_1234::Interface0ResumedL(TAny* aPtr)
 		{
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_ENTRY, 0 );
 		
 		// when device is really resumed , the whole of interfaces' previous call  PermitSuspendAndWaitForResume()'s requests of the device will be completed , random chose one .
-		LOG_CFUNC
-		RDebug::Printf("Interface 0 resumed");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP02, "Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1234* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1234*>(aPtr);
 		TInt completionCode = self->iInterface0Watcher->CompletionCode();
-		RDebug::Printf("watcher 0 errCode=%d",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP03, "watcher 0 errCode=%d",completionCode);
 		self->iSuspendedI0 = EFalse;
 
 		switch (self->iCaseStep)
@@ -166,13 +181,13 @@
 				{
 				if (completionCode == KErrNone)
 					{
-					RDebug::Printf("device resumed succeed, do bulk transfer!");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP04, "device resumed succeed, do bulk transfer!");
 					self->iCaseStep = EBulkTransferOutWhenResume;
 					self->SendEpTransferRequest();
 					}
 				else
 					{
-					RDebug::Printf("device resumed failed,<err %d> ",completionCode);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP05, "device resumed failed,<err %d> ",completionCode);
 					self->iCaseStep = EFailed;
 					self->SendEpRequest();
 					}
@@ -184,30 +199,33 @@
 				break;
 			};
 
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1234::Interface1ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
-		RDebug::Printf("Interface 1 resumed");
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_ENTRY, 0 );
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP06, "Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1234* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1234*>(aPtr);
-		RDebug::Printf("watcher 1 iStatus=%d",
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP07, "watcher 1 iStatus=%d",
 				self->iInterface1Watcher->CompletionCode());
 		self->iSuspendedI1 = EFalse;
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1234::Interface2ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
-		RDebug::Printf("Interface 2 resumed");
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_ENTRY, 0 );
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP08, "Interface 2 resumed");
 		CUT_PBASE_T_USBDI_1234* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1234*>(aPtr);
-		RDebug::Printf("watcher 2 iStatus=%d",
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP09, "watcher 2 iStatus=%d",
 				self->iInterface2Watcher->CompletionCode());
 		self->iSuspendedI2 = EFalse;
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
@@ -215,17 +233,18 @@
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
-		LOG_FUNC
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_ENTRY, this );
 		Cancel();
 
 		RDebug::Printf(
 				"Device State change from %d to %d err=%d",
 				aPreviousState, aNewState, aCompletionCode);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_ENTRY, this );
 
 		RDebug::Printf(
 				"Ep0TransferCompleteL with aCompletionCode = %d",
@@ -235,16 +254,17 @@
 			{
 			if (iCaseStep == EFailed)
 				{// ignore error, and catch the TestFailed method called further down.
-				RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP10, "***Failure sending FAIL message to client on endpoint 0***");
 				}
 			else
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-				RDebug::Print(msg);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP11, msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(aCompletionCode, msg);
 				iControlEp0->SendRequest(request, this);
+				OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT, this );
 				return;
 				}
 			}
@@ -262,7 +282,7 @@
 				break;
 
 			case EBulkTransferOutWhenResume:
-				RDebug::Printf("Try to send data");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP12, "Try to send data");
 				iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0, KHostNumWriteBytes1), EFalse);
 				iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1, KHostNumWriteBytes2), EFalse);
 				iOutTransfer[2]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1+KHostNumWriteBytes2,
@@ -270,28 +290,29 @@
 				break;
 
 			case EValidBulkTransfeOut:
-				RDebug::Printf("Try to receive data");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP13, "Try to receive data");
 				iInTransfer[0]->TransferIn(KHostNumReadBytes1);
 				iInTransfer[1]->TransferIn(KHostNumReadBytes2);
 				iInTransfer[2]->TransferIn(KHostNumReadBytes3);
 				break;
 
 			default:
-				RDebug::Printf("<Error> Unknown test step");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP14, "<Error> Unknown test step");
 				TestFailed(KErrUnknown);
 				break;
 			}
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::TransferCompleteL(TInt aTransferId,
 			TInt aCompletionCode)
 		{
-		LOG_FUNC
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_ENTRY, this );
 		Cancel();
 
 		TInt err(KErrNone);
 		TBuf<256> msg;
-		RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",
+		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP15, "Transfer completed (id=%d), aCompletionCode = %d",
 				aTransferId, aCompletionCode);
 
 		switch (iCaseStep)
@@ -310,7 +331,7 @@
 					case KBulkTransferOutId1:
 					case KBulkTransferOutId2:
 						iTransferComplete |= aTransferId;
-						RDebug::Printf("Transfer %d completed", aTransferId);
+						OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP16, "Transfer %d completed", aTransferId);
 						break; // switch(aTransferId)
 
 					default:
@@ -392,7 +413,7 @@
 						}
 
 					// Comparison is a match
-					RDebug::Printf("Comparison for IN transfer is a match");
+					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP17, "Comparison for IN transfer is a match");
 					iCaseStep = EPassed;
 					TTestCasePassed request;
 					iControlEp0->SendRequest(request, this);
@@ -414,28 +435,30 @@
 
 		if (err!=KErrNone)
 			{
-			RDebug::Print(msg);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP18, msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err, msg);
 			iControlEp0->SendRequest(request, this);
 			}
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::TrySuspendDeviceByInterfaces()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_ENTRY, this );
 		// Suspend interface 0
-		RDebug::Printf("Suspending interface 0");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP19, "Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();
 		iSuspendedI0 = ETrue;
 
 		// Suspend interface 1
-		RDebug::Printf("Suspending interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP20, "Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 		iSuspendedI1 = ETrue;
 
 		// Suspend interface 2
-		RDebug::Printf("Suspending interface 2");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP21, "Suspending interface 2");
 		iInterface2Watcher->SuspendAndWatch();
 		iSuspendedI2 = ETrue;
 
@@ -446,17 +469,22 @@
 
 		iCaseStep = EValidateResumebyInterface;
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::SendEpRequest()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_ENTRY, this );
 		TTestCasePassed request;
 		iControlEp0->SendRequest(request, this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_EXIT, this );
 		}
 	void CUT_PBASE_T_USBDI_1234::SendEpTransferRequest()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_ENTRY, this );
 		TEndpointReadRequest request(1, 1, KBulkTransferSize);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request, this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_EXIT, this );
 		}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1235.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1235.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,6 +21,10 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-1235Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -32,10 +36,12 @@
 
 	CUT_PBASE_T_USBDI_1235* CUT_PBASE_T_USBDI_1235::NewL(TBool aHostRole)
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_NEWL_ENTRY, aHostRole );
 		CUT_PBASE_T_USBDI_1235* self = new (ELeave) CUT_PBASE_T_USBDI_1235(aHostRole);
 		CleanupStack::PushL(self);
 		self->ConstructL();
 		CleanupStack::Pop(self);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_NEWL_EXIT, ( TUint )( self ) );
 		return self;
 		}
 
@@ -43,17 +49,21 @@
 		CBaseTestCase(KTestCaseId, aHostRole), iSuspendedI0(EFalse),
 				iSuspendedI1(EFalse)
 		{
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY, this );
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::ConstructL()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_CONSTRUCTL_ENTRY, this );
 		iTestDevice = new RUsbDeviceA(this);
 		BaseConstructL();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_CONSTRUCTL_EXIT, this );
 		}
 
 	CUT_PBASE_T_USBDI_1235::~CUT_PBASE_T_USBDI_1235()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY_DUP01, this );
 
 		// Cancel any async operations
 
@@ -74,11 +84,12 @@
 			iTestDevice->Close();
 			}
 		delete iTestDevice;
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::ExecuteHostTestCaseL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_ENTRY, this );
 
 		iCaseStep = EInProcess;
 		iActorFDF = CActorFDF::NewL(*this);
@@ -91,11 +102,12 @@
 
 		// Start the connection timeout	
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::ExecuteDeviceTestCaseL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_ENTRY, this );
 
 		// Construct the device for the test case
 		iTestDevice->OpenL(TestCaseId());
@@ -104,27 +116,30 @@
 
 		// Connect the test device	
 		iTestDevice->SoftwareConnect();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::HostDoCancel()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_ENTRY, this );
 
 		// Cancel the timeout timer
 		CancelTimeout();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceDoCancel()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_ENTRY, this );
 
 		// Cancel the device	
 		iTestDevice->CancelSubscriptionToReports();
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceInsertedL(TUint aDeviceHandle)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_ENTRY, this );
 
 		Cancel(); // Cancel the timer
 		TInt err(KErrNone);
@@ -143,6 +158,7 @@
 
 			// Start the connection timeout again
 			TimeoutIn(30);
+			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT, this );
 			return;
 			}
 		// Check tree now	
@@ -156,7 +172,7 @@
 				TUint32 token1(0);
 				TUint32 token2(0);
 
-				RDebug::Printf("Obtaining token for interface 0");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235, "Obtaining token for interface 0");
 				err = testDevice.Device().GetTokenForInterface(0, token1);
 				if (err != KErrNone)
 					{
@@ -165,8 +181,8 @@
 							err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Token 1 (%d) retrieved", token1);
-				RDebug::Printf("Opening interface 0");
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP01, "Token 1 (%d) retrieved", token1);
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP02, "Opening interface 0");
 				err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -174,9 +190,9 @@
 							"<Error %d> Interface 0 could not be opened", err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Interface 0 opened");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP03, "Interface 0 opened");
 
-				RDebug::Printf("Obtaining token for interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP04, "Obtaining token for interface 1");
 				err = testDevice.Device().GetTokenForInterface(1, token2);
 				if (err != KErrNone)
 					{
@@ -185,7 +201,7 @@
 							err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Opening interface 1");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP05, "Opening interface 1");
 				err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -193,7 +209,7 @@
 							"<Error %d> Interface 1 could not be opened", err);
 					return TestFailed(err);
 					}
-				RDebug::Printf("Interface 1 opened");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP06, "Interface 1 opened");
 
 				SuspendDeviceByInterfacesAndCancelWaitForResume();
 
@@ -206,12 +222,13 @@
 				TestFailed(KErrCorrupt);
 				break;
 			}
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT_DUP01, this );
 		}
 
 	TInt CUT_PBASE_T_USBDI_1235::Interface0ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
-		RDebug::Printf("Interface 0 resumed");
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_ENTRY, 0 );
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP07, "Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1235* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1235*>(aPtr);
 		TInt completionCode=self->iInterface0Watcher->CompletionCode();
@@ -227,7 +244,7 @@
 				{
 				if (completionCode == KErrCancel)
 					{
-					RDebug::Printf("CancelWaitForResume request: Success <>!",completionCode);
+					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP08, "CancelWaitForResume request: Success <%d>!",completionCode);
 				    // do not care the device's status.
 					self->iCaseStep = EPassed;					
 					}
@@ -247,45 +264,49 @@
 				break;
 			};
 
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1235::Interface1ResumedL(TAny* aPtr)
 		{
-		LOG_CFUNC
-		RDebug::Printf("Interface 1 resumed");
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_ENTRY, 0 );
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP09, "Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1235* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1235*>(aPtr);
 		TInt completionCode = self->iInterface1Watcher->CompletionCode();		
-		RDebug::Printf("watcher 1 iStatus=%d",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP10, "watcher 1 iStatus=%d",completionCode);
 		self->iSuspendedI1 = EFalse;
 		
 		if(self->iCaseStep == EPassed && completionCode == KErrNone )
 			{
-			RDebug::Printf("Device resumed,test passed!");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP11, "Device resumed,test passed!");
 			self->SendEp0Request(); // stop client;
 			}
 		
+		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceRemovedL(TUint aDeviceHandle)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_ENTRY, this );
 
 		// The test device should not be removed until the test case has passed
 		// so this test case has not completed, and state this event as an error
 
 		TestFailed(KErrDisconnected);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::BusErrorL(TInt aError)
 		{
-		LOG_FUNC
+        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_BUSERRORL_ENTRY, this );
 
 		// This test case handles no failiures on the bus
 
 		TestFailed(aError);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_BUSERRORL_EXIT, this );
 		}
 
 
@@ -293,7 +314,7 @@
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
-		LOG_FUNC
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_ENTRY, this );
 		Cancel();
 		
 		// test RInterface , the  RUsbDevice notification logic not used . 
@@ -301,12 +322,13 @@
 				"-Device State change from %d to %d err=%d",
 				aPreviousState, aNewState, aCompletionCode);
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-		LOG_FUNC
-		RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",
+		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_ENTRY, this );
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP12, "Ep0TransferCompleteL with aCompletionCode = %d",
 				aCompletionCode);
 		switch (iCaseStep)
 			{
@@ -320,11 +342,12 @@
 				TestPassed();
 				break;
 			}
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::HostRunL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_HOSTRUNL_ENTRY, this );
 
 		// Obtain the completion code
 		TInt completionCode(iStatus.Int());
@@ -332,20 +355,21 @@
 		if (completionCode == KErrNone)
 			{
 			// Action timeout
-			RDebug::Printf("<Error> Action timeout");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP13, "<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}
 		else
 			{
-			RDebug::Printf("<Error %d> Timeout timer could not complete",
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP14, "<Error %d> Timeout timer could not complete",
 					completionCode);
 			TestFailed(completionCode);
 			}
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_HOSTRUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceRunL()
 		{
-		LOG_FUNC
+        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_DEVICERUNL_ENTRY, this );
 
 		// Disconnect the device
 
@@ -354,36 +378,41 @@
 		// Complete the test case request
 
 		TestPolicy().SignalTestComplete(iStatus.Int());
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICERUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::SuspendDeviceByInterfacesAndCancelWaitForResume()
 		{
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_ENTRY, this );
 		// Suspend interface 0
-		RDebug::Printf("Suspending interface 0");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP15, "Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();
 		iSuspendedI0 = ETrue;
 		
 		// Suspend interface 1
-		RDebug::Printf("Suspending interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP16, "Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 		iSuspendedI1 = ETrue;
 		
-		RDebug::Printf("CancelPermitSuspend interface 1");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP17, "CancelPermitSuspend interface 1");
 		// try to resume device,then host can notify peripheral test passed.
 		iUsbInterface1.CancelPermitSuspend();
 
 		// Only test the CancelWaitForResume() operation 
 		// If we let the devic to suspend ,the periperal site could not receive the test control transfer which test finish result.
         // select interface0 to test the function CancelWaitForResume	
-		RDebug::Printf("CacelWaitForResume interface 0");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP18, "CacelWaitForResume interface 0");
 		iUsbInterface0.CancelWaitForResume();
 
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_EXIT, this );
 		}
 	
 	void CUT_PBASE_T_USBDI_1235::SendEp0Request()
 		{		
+		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_ENTRY, this );
 		TTestCasePassed request;
 		iControlEp0->SendRequest(request, this);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_EXIT, this );
 		}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1236.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1236.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,6 +22,10 @@
 #include <d32usbdescriptors.h>
 #include "testdebug.h"
 #include "TestPolicy.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "PBASE-T_USBDI-1236Traces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -31,10 +35,12 @@
 
 CUT_PBASE_T_USBDI_1236* CUT_PBASE_T_USBDI_1236::NewL(TBool aHostRole)
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_1236* self = new (ELeave) CUT_PBASE_T_USBDI_1236(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_NEWL_EXIT, ( TUint )( self ) );
 	return self; 
 	}
 	   
@@ -42,19 +48,23 @@
 CUT_PBASE_T_USBDI_1236::CUT_PBASE_T_USBDI_1236(TBool aHostRole)
 :	CBaseTestCase(KTestCaseId,aHostRole)
 	{
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY, this );
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_1236::ConstructL()
 	{
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_1236::~CUT_PBASE_T_USBDI_1236()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY_DUP01, this );
 	
 	// Cancel any async operations
 	
@@ -71,12 +81,13 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::ExecuteHostTestCaseL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_ENTRY, this );
 	iCaseStep = EStepGetInterfaceString;
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
@@ -86,11 +97,12 @@
 
 	// Start the connection timeout	
 	TimeoutIn(30);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1236::ExecuteDeviceTestCaseL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_ENTRY, this );
 
 	// Construct the device for the test case
 	iTestDevice->OpenL(TestCaseId());
@@ -99,12 +111,13 @@
 
 	// Connect the test device	
 	iTestDevice->SoftwareConnect();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_1236::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_ENTRY, this );
 
 	Cancel(); // Cancel the timer
 	TInt err(KErrNone);
@@ -117,11 +130,12 @@
 		{
 		// Incorrect device for this test case
 
-		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
+		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
+		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 		
@@ -133,52 +147,52 @@
 			TUint32 token1(0);
 			TUint32 token2(0);
 	
-			RDebug::Printf("Obtaining token for interface 0");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP01, "Obtaining token for interface 0");
 			err = testDevice.Device().GetTokenForInterface(0,token1);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP02, "<Error %d> Token for interface 0 could not be retrieved",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Token 1 (%d) retrieved",token1);
-			RDebug::Printf("Opening interface 0");
+			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP03, "Token 1 (%d) retrieved",token1);
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP04, "Opening interface 0");
 			err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Interface 0 could not be opened",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP05, "<Error %d> Interface 0 could not be opened",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Interface 0 opened");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP06, "Interface 0 opened");
 		
 																
-			RDebug::Printf("Obtaining token for interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP07, "Obtaining token for interface 1");
 			err = testDevice.Device().GetTokenForInterface(1,token2);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Token for interface 1 could not be retrieved",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP08, "<Error %d> Token for interface 1 could not be retrieved",err);
 				return TestFailed(err);			
 				}	
-			RDebug::Printf("Opening interface 1");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP09, "Opening interface 1");
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Interface 1 could not be opened",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP10, "<Error %d> Interface 1 could not be opened",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Interface 1 opened");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP11, "Interface 1 opened");
 	
 			// close it
 			iUsbInterface1.Close();		
-			RDebug::Printf("Interface 1 closed");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP12, "Interface 1 closed");
 	
 			//re-open now
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> Interface 1 could not be re-opened",err);
+				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP13, "<Error %d> Interface 1 could not be re-opened",err);
 				return TestFailed(err);
 				}
-			RDebug::Printf("Interface 1 re-opened");
+			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP14, "Interface 1 re-opened");
 			
 
 			
@@ -195,14 +209,14 @@
 			u16String.SetLength(interfaceString.Length()/2);
 			if (u16String.Compare(_L16("i1s0")) == 0)
 				{
-				RDebug::Printf("interface String match");
+				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP15, "interface String match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
 				}
 			else
 				{
-				RDebug::Printf("interface String not match %S", &interfaceString);
+				OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP16, "interface String not match %s", interfaceString);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCompletion, _L8("interface string not match"));
 				iControlEp0->SendRequest(request,this);
@@ -214,42 +228,46 @@
 			TestFailed(KErrCorrupt);
 			break;
 		}	
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 
 
 	
 void CUT_PBASE_T_USBDI_1236::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_ENTRY, this );
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_1236::BusErrorL(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_BUSERRORL_ENTRY, this );
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_BUSERRORL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1236::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_ENTRY, this );
 	Cancel();
-	RDebug::Printf("Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
+	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL, "Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	LOG_FUNC
-	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	switch(iCaseStep)
 		{
 		// Fail the test case
@@ -264,12 +282,13 @@
 			TestPassed();
 			break;
 			}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::HostRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_HOSTRUNL_ENTRY, this );
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -277,20 +296,21 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		RDebug::Printf("<Error> Action timeout");
+		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_HOSTRUNL, "<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
+		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_HOSTRUNL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_1236::DeviceRunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_DEVICERUNL_ENTRY, this );
 	
 	// Disconnect the device
 	
@@ -299,23 +319,26 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICERUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1236::HostDoCancel()
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_ENTRY, this );
 
 	// Cancel the timeout timer
 	CancelTimeout();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::DeviceDoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_ENTRY, this );
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
+	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/SoftwareConnectTimer.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/SoftwareConnectTimer.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,6 +17,10 @@
 //
 
 #include "softwareconnecttimer.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SoftwareConnectTimerTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -25,10 +29,12 @@
 	
 CSoftwareConnectTimer* CSoftwareConnectTimer::NewL(RUsbTestDevice& aTestDevice)
 	{
+	OstTraceFunctionEntry1( CSOFTWARECONNECTTIMER_NEWL_ENTRY, ( TUint )&( aTestDevice ) );
 	CSoftwareConnectTimer* self = new (ELeave) CSoftwareConnectTimer(aTestDevice);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -38,48 +44,54 @@
 	iTestDevice(aTestDevice),
 	iConnectType(EUnknown)
 	{
+	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT, this );
 	}
 	
 	
 CSoftwareConnectTimer::~CSoftwareConnectTimer()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT_DUP01, this );
 	}
 	
 	
 void CSoftwareConnectTimer::SoftwareConnect(TInt aInterval)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_SOFTWARECONNECT_ENTRY, this );
 	iConnectType = EConnect;
 	After(aInterval*KOneSecond);
+	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_SOFTWARECONNECT_EXIT, this );
 	}
 	
 
 void CSoftwareConnectTimer::SoftwareDisconnect(TInt aInterval)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_ENTRY, this );
 	iConnectType = EDisconnect;
 	After(aInterval*KOneSecond);
+	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_EXIT, this );
 	}
 	
 	
 void CSoftwareConnectTimer::SoftwareReConnect(TInt aInterval)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_ENTRY, this );
 	iTestDevice.SoftwareDisconnect();
 	SoftwareConnect(aInterval);
+	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_EXIT, this );
 	}
 
 
 void CSoftwareConnectTimer::RunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CSOFTWARECONNECTTIMER_RUNL_ENTRY, this );
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode != KErrNone)
 		{
-		RDebug::Printf("<Error %d> software connect/disconnect timer error",completionCode);
+		OstTrace1(TRACE_NORMAL, CSOFTWARECONNECTTIMER_RUNL, "<Error %d> software connect/disconnect timer error",completionCode);
 		iTestDevice.ReportError(completionCode);
 		}
 	else
@@ -95,13 +107,14 @@
 				break;
 				
 			case EUnknown:
-				RDebug::Printf("<Error> Unknown state for software connect timer");
+				OstTrace0(TRACE_NORMAL, CSOFTWARECONNECTTIMER_RUNL_DUP01, "<Error> Unknown state for software connect timer");
 				break;
 			
 			default:
 				break;
 			}			
 		}	
+	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_RUNL_EXIT, this );
 	}
 
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestCaseController.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestCaseController.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,6 +22,10 @@
 #include "testengine.h"
 #include "testpolicy.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TestCaseControllerTraces.h"
+#endif
 
 _LIT(KClientDeviceDriverName,"EUSBC");
 _LIT(KHostDeviceDriverName,"usbhubdriver");
@@ -33,10 +37,12 @@
 	
 CTestCaseController* CTestCaseController::NewL(CTestEngine& aTestEngine,TBool aHostRole)
 	{
+	OstTraceFunctionEntryExt( CTESTCASECONTROLLER_NEWL_ENTRY, 0 );
 	CTestCaseController* self = new (ELeave) CTestCaseController(aTestEngine,aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CTESTCASECONTROLLER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -46,14 +52,16 @@
 	iTestEngine(aTestEngine),
 	iHostRole(aHostRole)
 	{
+	OstTraceFunctionEntryExt( CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY, this );
 	// Add to current threads active scheduler
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT, this );
 	}
 	
 	
 CTestCaseController::~CTestCaseController()
 	{
-	LOG_FUNC 
+    OstTraceFunctionEntry1( CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY_DUP01, this );
 
 	Cancel(); // Cancels any oustanding test cases
 
@@ -64,19 +72,19 @@
 		TInt err = User::FreeLogicalDevice(KHostDeviceInterfaceDriverName);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KHostDeviceInterfaceDriverName);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER, "<Error %d> Unable to unload driver: %S",err,KHostDeviceInterfaceDriverName());
 			}
 		
 		err = User::FreeLogicalDevice(KHostDeviceDriverName);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KHostDeviceDriverName);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP01, "<Error %d> Unable to unload driver: %S",err,KHostDeviceDriverName());
 			}
 			
 		err = User::FreeLogicalDevice(KOtgdiLddFileName);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KHostDeviceDriverName);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP02, "<Error %d> Unable to unload driver: %S",err,KHostDeviceDriverName());
 			}			
 		}
 	else
@@ -84,14 +92,15 @@
 		TInt err(User::FreeLogicalDevice(KClientDeviceDriverName));
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KClientDeviceDriverName);
+			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP03, "<Error %d> Unable to unload driver: %S",err,KClientDeviceDriverName());
 			}		
 		}
+	OstTraceFunctionExit1( CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT_DUP01, this );
 	}
 
 void CTestCaseController::ConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CTESTCASECONTROLLER_CONSTRUCTL_ENTRY, this );
 	TInt err = KErrNone;
 	
 	_LIT(KLoadingNamedDriverString,"loading driver: %S\n");
@@ -101,15 +110,18 @@
 	if(iHostRole)
 		{
 		gtest.Printf(KLoadingNamedDriverString,&KHostDeviceDriverName);		
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL, "loading driver: %S\n", KHostDeviceDriverName());		
 		// Load both Host USB device drivers
 		err = User::LoadLogicalDevice(KHostDeviceDriverName);
 		gtest((err == KErrNone) || (err == KErrAlreadyExists));
 		gtest.Printf(KLoadedNamedDriverString,&KHostDeviceDriverName);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP01, "loaded driver: %S\n",KHostDeviceDriverName());
 		
-		RDebug::Print(KLoadingNamedDriverString,&KHostDeviceInterfaceDriverName);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP02, "loading driver: %S\n",KHostDeviceInterfaceDriverName());
 		err = User::LoadLogicalDevice(KHostDeviceInterfaceDriverName);
 		gtest((err == KErrNone) || (err == KErrAlreadyExists));
 		gtest.Printf(KLoadedNamedDriverString,&KHostDeviceInterfaceDriverName);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP03, "loaded driver: %S\n",KHostDeviceInterfaceDriverName());
 		  												 
 		// If test cases are running USB host side actions
 		// then run each test case in its own thread		
@@ -120,9 +132,11 @@
 				  		
 		// Load the USB client driver	
 		gtest.Printf(KLoadingNamedDriverString,&KClientDeviceDriverName);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP04, "loading driver: %S\n",KClientDeviceDriverName());
 		err = User::LoadLogicalDevice(KClientDeviceDriverName);
 		gtest((err == KErrNone) || (err == KErrAlreadyExists));
 		gtest.Printf(KLoadedNamedDriverString,&KClientDeviceDriverName);
+		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP05, "loaded driver: %S\n",KClientDeviceDriverName());
 		
 		// Run each test case in the main thread as its not new API 
 		// and not expected to panic
@@ -136,20 +150,23 @@
 	// Run the test case	
 	iTestPolicy->RunTestCaseL(iTestCaseId,iStatus);
 	SetActive();
+	OstTraceFunctionExit1( CTESTCASECONTROLLER_CONSTRUCTL_EXIT, this );
 	}
 	
 
 void CTestCaseController::DoCancel()
 	{
+	OstTraceFunctionEntry1( CTESTCASECONTROLLER_DOCANCEL_ENTRY, this );
 	// Cancel the outstanding test case running
 
 	iTestPolicy->Cancel();
+	OstTraceFunctionExit1( CTESTCASECONTROLLER_DOCANCEL_EXIT, this );
 	}
 	
 	
 void CTestCaseController::RunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CTESTCASECONTROLLER_RUNL_ENTRY, this );
 
 	// Retrieve the completion code of the last test case run
 	TInt err(iStatus.Int());
@@ -159,11 +176,13 @@
 		{
 		iTestCasesResults.Append(EFalse);
 		gtest.Printf(_L("FAILED err=%d\n"),err);
+		OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL, "FAILED err=%d\n",err);
 		}
 	else
 		{
 		iTestCasesResults.Append(ETrue);
 		gtest.Printf(_L("PASSED\n"));
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP01, "PASSED\n");
 		}
 		
 	// Get the identity of the next test case to run
@@ -171,14 +190,14 @@
 	err = iTestEngine.NextTestCaseId(iTestCaseId);
 	if(err == KErrNone)
 		{
-		RDebug::Printf("\n");
-		RDebug::Printf("\n");
-		RDebug::Printf("\n");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP02, "\n");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP03, "\n");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP04, "\n");
 		gtest.Next(iTestCaseId);
-		RDebug::Printf("                              --------------------");
-		RDebug::Printf("\n");
-		RDebug::Printf("\n");
-		RDebug::Printf("\n");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP05, "                              --------------------");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP06, "\n");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP07, "\n");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP08, "\n");
 		
 		// Run the next test case
 		
@@ -187,8 +206,8 @@
 		}
 	else if(err == KErrNotFound)
 		{
-		RDebug::Printf("All specified test cases performed");
-		RDebug::Printf("----------------------------------");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP09, "All specified test cases performed");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP10, "----------------------------------");
 		
 		
 		// count nb failures
@@ -202,15 +221,15 @@
 				nbFailures++;
 				}
 			}
-		RDebug::Printf("There are %d test case results, %d failures", iTestCasesResults.Count(), nbFailures);
+		OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP11, "There are %d test case results, %d failures", iTestCasesResults.Count(), nbFailures);
 
 		// Number of tests that should have been run (including repeats)
 		TUint nbTests = iTestEngine.TestCasesIdentities().Count() * iTestEngine.NumRepeats();
 		if(nbTests!=iTestCasesResults.Count())
 			{
-			RDebug::Printf("The number of tests that should have been run (%d) DOES NOT EQUAL the actual number of tests run (%d).", 
+			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP12, "The number of tests that should have been run (%d) DOES NOT EQUAL the actual number of tests run (%d).", 
 						  nbTests, iTestCasesResults.Count());
-			RDebug::Printf("This test suite will now PANIC!");
+			OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP13, "This test suite will now PANIC!");
 			}
 		ASSERT((nbTests==iTestCasesResults.Count()));
 
@@ -219,35 +238,36 @@
 			{
 			if(iTestEngine.NumRepeats() > 1)
 				{
-				RDebug::Printf("Test Case Loop %d..........",	repeat+1);			
+				OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP14, "Test Case Loop %d..........",	repeat+1);			
 				}
 			for(TInt testIndex = 0; testIndex < iTestEngine.TestCasesIdentities().Count() ; testIndex++)
 				{
 				if(iTestCasesResults[testIndex])
 					{
-					RDebug::Print(_L("Test Case: %S : PASSED"),	(iTestEngine.TestCasesIdentities())[testIndex]);			
+					OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP15, "Test Case: %S : PASSED",	*(iTestEngine.TestCasesIdentities())[testIndex]);			
 					}
 				else
 					{
-					RDebug::Print(_L("Test Case: %S : FAILED"),	(iTestEngine.TestCasesIdentities())[testIndex]);
+					OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP16, "Test Case: %S : FAILED",	*(iTestEngine.TestCasesIdentities())[testIndex]);
 					}
 				}
 			}
 
-		RDebug::Printf("CActiveScheduler::Stop CTestCaseController::RunL");
+		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP17, "CActiveScheduler::Stop CTestCaseController::RunL");
 		CActiveScheduler::Stop();
 		}
 	else
 		{
-		RDebug::Printf("<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
+		OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP18, "<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
 		User::Leave(err);
 		}
+	OstTraceFunctionExit1( CTESTCASECONTROLLER_RUNL_EXIT, this );
 	}
 	
 	
 TInt CTestCaseController::RunError(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CTESTCASECONTROLLER_RUNERROR_ENTRY, this );
 	
 	switch(aError)
 		{
@@ -257,6 +277,7 @@
 			gtest(EFalse);
 			break;
 		}
+	OstTraceFunctionExitExt( CTESTCASECONTROLLER_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestCaseFactory.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestCaseFactory.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,10 @@
 
 #include "TestCaseFactory.h"
 #include "testdevicebase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TestCaseFactoryTraces.h"
+#endif
 #include <e32debug.h>
 
 namespace NUnitTesting_USBDI
@@ -25,23 +29,29 @@
 	
 RTestFactory& RTestFactory::Instance()
 	{
+	OstTraceFunctionEntry1( RTESTFACTORY_INSTANCE_ENTRY, 0 );
 	static RTestFactory singleton;
+	OstTraceFunctionExitExt( RTESTFACTORY_INSTANCE_EXIT, 0, ( TUint )&( singleton ) );
 	return singleton;
 	}
 	
 RTestFactory::~RTestFactory()
 	{
+	OstTraceFunctionEntry1( RTESTFACTORY_RTESTFACTORY_ENTRY, this );
+	OstTraceFunctionExit1( RTESTFACTORY_RTESTFACTORY_EXIT, this );
 	}
 	
 	
 RTestFactory::RTestFactory()
 :	iTestCases(TStringIdentity::Hash,TStringIdentity::Id)
 	{
+	OstTraceFunctionEntry1( RTESTFACTORY_RTESTFACTORY_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( RTESTFACTORY_RTESTFACTORY_EXIT_DUP01, this );
 	}
 	
 void RTestFactory::RegisterTestCase(const TDesC& aTestCaseId,TBaseTestCaseFunctor const* aFunctor)
 	{
-	LOG_CFUNC
+    OstTraceFunctionEntryExt( RTESTFACTORY_REGISTERTESTCASE_ENTRY, 0 );
 
 	LOG_INFO((_L("Registering test case '%S'"),&aTestCaseId))
 	
@@ -50,14 +60,15 @@
 	if(err != KErrNone)
 		{
 		// Log that a test case could not be registered due to err
-		RDebug::Printf("Test case '%S' could not be registered with test case factory",&aTestCaseId);
+		OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE, "Test case '%S' could not be registered with test case factory",aTestCaseId);
 		}
+	OstTraceFunctionExit1( RTESTFACTORY_REGISTERTESTCASE_EXIT, 0 );
 	}
 
 
 CBaseTestCase* RTestFactory::CreateTestCaseL(const TDesC& aTestCaseId,TBool aHostRole)
 	{
-	LOG_CFUNC
+	OstTraceFunctionEntryExt( RTESTFACTORY_CREATETESTCASEL_ENTRY, 0 );
 	
 	TStringIdentity key(aTestCaseId);
 	const TBaseTestCaseFunctor& functor = *(*Instance().iTestCases.Find(key));
@@ -67,18 +78,19 @@
 
 void RTestFactory::ListRegisteredTestCases()
 	{
-	LOG_CFUNC
+	OstTraceFunctionEntry1( RTESTFACTORY_LISTREGISTEREDTESTCASES_ENTRY, 0 );
 	RFactoryMap::TIter it(Instance().iTestCases);
 	
-	RDebug::Printf("-------- F A C T O R Y ---------");
+	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES, "-------- F A C T O R Y ---------");
 	
 	TInt count(0);
 	for(count=0; count<Instance().iTestCases.Count(); count++)
 		{
-		RDebug::Printf("%d: %S",count,it.NextKey());
+		OstTrace1(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01, "%d",count);
 		}
 	
-	RDebug::Printf("--------------------------------");
+	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02, "--------------------------------");
+	OstTraceFunctionExit1( RTESTFACTORY_LISTREGISTEREDTESTCASES_EXIT, 0 );
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,6 +25,10 @@
 #include "controltransferrequests.h"
 #include "testinterfacebase.h"
 #include "PBASE-T_USBDI-0486.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TestDeviceBaseTraces.h"
+#endif
 #include <e32property.h>
 
 namespace NUnitTesting_USBDI
@@ -37,6 +41,8 @@
 	iConnectTimer(NULL), iWakeupTimer(NULL),
 	iAuxBuffer(NULL)
 	{
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY, this );
+	OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT, this );
 	}
 	
 RUsbTestDevice::RUsbTestDevice(CBaseTestCase* aTestCase)
@@ -46,25 +52,29 @@
 	iConnectTimer(NULL), iWakeupTimer(NULL),
 	iAuxBuffer(NULL)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP01, this );
 	iTestCase = aTestCase;
-	RDebug::Printf("iTestCase = %d", iTestCase);
+	OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_RUSBTESTDEVICE, "iTestCase = %d", iTestCase);
+	OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP01, this );
 	}
 		
 void RUsbTestDevice::ResetState()
 	{
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_RESETSTATE_ENTRY, this );
 	iCurrentState = EUsbcDeviceStateUndefined;
+	OstTraceFunctionExit1( RUSBTESTDEVICE_RESETSTATE_EXIT, this );
 	}
 
 RUsbTestDevice::~RUsbTestDevice()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP02, this );
 	
+	OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP02, this );
 	}
 	
 void RUsbTestDevice::Close()
 	{
-	LOG_FUNC
+OstTraceFunctionEntry1( RUSBTESTDEVICE_CLOSE_ENTRY, this );
 
 	delete iWakeupTimer;
 	delete iConnectTimer;
@@ -85,41 +95,44 @@
         TInt r = RProperty::Define(KWordOfDeathCat, KWordOfDeathKey, RProperty::EInt,KAllowAllPolicy, KAllowAllPolicy, 0);
         if(r != KErrNone)
             {
-            RDebug::Print(_L("Could not create the WordOfDeath P&S   (%d)"), r);
+            OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_CLOSE, "Could not create the WordOfDeath P&S   (%d)", r);
             }
-		RDebug::Printf("killing t_usbhost_usbman.exe");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_CLOSE_DUP01, "killing t_usbhost_usbman.exe");
         RProperty::Set(KWordOfDeathCat, KWordOfDeathKey, KErrAbort);   // Send the word of death
         User::After(1000000); //allow time for t_usbhost_usbman.exe to clean up
 		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_CLOSE_EXIT, this );
 	}
 
 
 void RUsbTestDevice::SubscribeToReports(TRequestStatus& aObserverStatus)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_SUBSCRIBETOREPORTS_ENTRY, this );
 	
 	// Signal the request as pending
 	
 	iObserverStatus = &aObserverStatus;
 	*iObserverStatus = KRequestPending;
+	OstTraceFunctionExit1( RUSBTESTDEVICE_SUBSCRIBETOREPORTS_EXIT, this );
 	}
 
 
 void RUsbTestDevice::CancelSubscriptionToReports()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_ENTRY, this );
 	
 	// Signal the request as cancelled
 	User::RequestComplete(iObserverStatus,KErrCancel);
+	OstTraceFunctionExit1( RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_EXIT, this );
 	}
 	
 		
 void RUsbTestDevice::OpenL()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_OPENL_ENTRY, this );
 	TInt err = KErrNone;
 	
-	RDebug::Printf("starting t_usbhost_usbman.exe");
+	OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL, "starting t_usbhost_usbman.exe");
 	TInt r = iOtgUsbMan.Create(_L("t_usbhost_usbman.exe"), _L("client"));
 	gtest(r == KErrNone);
 	iOtgUsbMan.Resume();	
@@ -130,7 +143,7 @@
 	err = iClientDriver.Open(0);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP01, "<Error %d> Unable to open a channel to USB client driver",err);
 		User::Leave(err);
 		}
 	
@@ -138,7 +151,7 @@
 	err = iClientDriver.DeviceDisconnectFromHost();
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> unable to disconnect device from host",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP02, "<Error %d> unable to disconnect device from host",err);
 		User::Leave(err);
 		}
 	
@@ -156,28 +169,29 @@
 	_LIT8(KYes, "yes");
 	_LIT8(KNo, "no");
 	User::LeaveIfError(iClientDriver.DeviceCaps(iDeviceCaps));
- 	RDebug::Printf("------ USB device capabilities -------");
-	RDebug::Printf("Number of endpoints:                %d",iDeviceCaps().iTotalEndpoints);	
-	RDebug::Printf("Supports Software-Connect:          %S",iDeviceCaps().iConnect ? &KYes() : &KNo());
-	RDebug::Printf("Device is Self-Powered:             %S",iDeviceCaps().iSelfPowered ? &KYes() : &KNo());
-	RDebug::Printf("Supports Remote-Wakeup:             %S",iDeviceCaps().iRemoteWakeup ? &KYes() : &KNo());
-	RDebug::Printf("Supports High-speed:                %S",iDeviceCaps().iHighSpeed ? &KYes() : &KNo());
-	RDebug::Printf("Supports unpowered cable detection: %S",(iDeviceCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? &KYes() : &KNo());
-	RDebug::Printf("--------------------------------------");
+ 	OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP03, "------ USB device capabilities -------");
+	OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP04, "Number of endpoints:                %d",iDeviceCaps().iTotalEndpoints);	
+	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP05, "Supports Software-Connect:          %s",iDeviceCaps().iConnect ? KYes() : KNo());
+	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP06, "Device is Self-Powered:             %S",iDeviceCaps().iSelfPowered ? KYes() : KNo());
+	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP07, "Supports Remote-Wakeup:             %S",iDeviceCaps().iRemoteWakeup ? KYes() : KNo());
+	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP08, "Supports High-speed:                %S",iDeviceCaps().iHighSpeed ? KYes() : KNo());
+	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP09, "Supports unpowered cable detection: %S",(iDeviceCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? KYes() : KNo());
+	OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP10, "--------------------------------------");
 	
+	OstTraceFunctionExit1( RUSBTESTDEVICE_OPENL_EXIT, this );
 	}
 
 
 TInt RUsbTestDevice::SetClassCode(TUint8 aClassCode,TUint8 aSubClassCode,TUint8 aDeviceProtocol)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETCLASSCODE_ENTRY, this );
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCLASSCODE, "<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -188,23 +202,24 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to set the device dsecriptor",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCLASSCODE_DUP01, "<Error %d> Unable to set the device dsecriptor",err);
 			}
 		}
+	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETCLASSCODE_EXIT, this, err );
 	return err;
 	}
 
 
 TInt RUsbTestDevice::SetUsbSpecification(TUint16 aSpecification)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETUSBSPECIFICATION_ENTRY, this );
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETUSBSPECIFICATION, "<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -221,23 +236,24 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to set the device dsecriptor",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETUSBSPECIFICATION_DUP01, "<Error %d> Unable to set the device dsecriptor",err);
 			}
 		}
+	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETUSBSPECIFICATION_EXIT, this, err );
 	return err;
 	}
 
 
 TInt RUsbTestDevice::SetVendor(TUint16 aVendorId)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETVENDOR_ENTRY, this );
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETVENDOR, "<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -249,9 +265,10 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to set the device descriptor",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETVENDOR_DUP01, "<Error %d> Unable to set the device descriptor",err);
 			}
 		}
+	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETVENDOR_EXIT, this, err );
 	return err;
 	}
 
@@ -259,14 +276,14 @@
 TInt RUsbTestDevice::SetProduct(TUint16 aProductId,const TDesC16& aProductString,
 				const TDesC16& aManufacturerString,const TDesC16& aSerialNumberString)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETPRODUCT_ENTRY, this );
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT, "<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -278,17 +295,19 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to set the device dsecriptor",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP01, "<Error %d> Unable to set the device dsecriptor",err);
+			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT, this, err );
 			return err;
 			}
 		
-		RDebug::Printf("Product Identity set");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP02, "Product Identity set");
 	
 		// Product string
 		err = iClientDriver.SetProductStringDescriptor(aProductString);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to set product string descriptor",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP03, "<Error %d> Unable to set product string descriptor",err);
+			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP01, this, err );
 			return err;
 			}
 
@@ -296,7 +315,8 @@
 		err = iClientDriver.SetManufacturerStringDescriptor(aManufacturerString);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to set the manufacturer string descriptor",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP04, "<Error %d> Unable to set the manufacturer string descriptor",err);
+			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP02, this, err );
 			return err;
 			}
 	
@@ -304,55 +324,61 @@
 		err = iClientDriver.SetSerialNumberStringDescriptor(aSerialNumberString);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to set the serial number string descriptor",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP05, "<Error %d> Unable to set the serial number string descriptor",err);
+			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP03, this, err );
 			return err;
 			}
 		}
+	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP04, this, KErrNone );
 	return KErrNone;
 	}
 
 
 TInt RUsbTestDevice::SetConfigurationString(const TDesC16& aConfigString)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETCONFIGURATIONSTRING_ENTRY, this );
 
 	TInt err(iClientDriver.SetConfigurationStringDescriptor(aConfigString));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set configuration string descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCONFIGURATIONSTRING, "<Error %d> Unable to set configuration string descriptor",err);
 		}
+	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETCONFIGURATIONSTRING_EXIT, this, err );
 	return err;
 	}
 
 
 void RUsbTestDevice::AddInterface(CInterfaceBase* aInterface)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_ADDINTERFACE_ENTRY, this );
 		
 	// Add the interface to the device
 	TInt err = iInterfaces.Append(aInterface);
 	
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to add interface",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_ADDINTERFACE, "<Error %d> Unable to add interface",err);
 		return ReportError(err);
 		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_ADDINTERFACE_EXIT, this );
 	}
 
 
 CInterfaceBase& RUsbTestDevice::Interface(TInt aIndex)
 	{
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_INTERFACE_ENTRY, this );
+	OstTraceFunctionExit1( RUSBTESTDEVICE_INTERFACE_EXIT, this );
 	return *iInterfaces[aIndex];
 	}
 
 
 void RUsbTestDevice::SoftwareConnect()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_SOFTWARECONNECT_ENTRY, this );
 	TInt err(iClientDriver.PowerUpUdc());
 	if((err != KErrNone) && (err != KErrNotReady))
 		{
-		RDebug::Printf("<Error %d> Power Up Udc",err);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT, "<Error %d> Power Up Udc",err);
 		ReportError(err);
 		}
 		
@@ -361,60 +387,63 @@
 		err = iClientDriver.DeviceConnectToHost();
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to connect to the host",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT_DUP01, "<Error %d> Unable to connect to the host",err);
 			ReportError(err);
 			}
 		}
 	else
 		{
-		RDebug::Printf("Please connect device to Host");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT_DUP02, "Please connect device to Host");
 		}	
+	OstTraceFunctionExit1( RUSBTESTDEVICE_SOFTWARECONNECT_EXIT, this );
 	}   	
 	 
 void RUsbTestDevice::SoftwareDisconnect()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_SOFTWAREDISCONNECT_ENTRY, this );
 	
 	if(iDeviceCaps().iConnect) 
 		{
 		TInt err(iClientDriver.DeviceDisconnectFromHost());
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to disconnect from the host",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWAREDISCONNECT, "<Error %d> Unable to disconnect from the host",err);
 			ReportError(err);
 			}
 		}
 	else
 		{
-		RDebug::Printf("Please disconnect device from Host");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWAREDISCONNECT_DUP01, "Please disconnect device from Host");
 		}
 		
+	OstTraceFunctionExit1( RUSBTESTDEVICE_SOFTWAREDISCONNECT_EXIT, this );
 	}       
 
 
 void RUsbTestDevice::RemoteWakeup()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_REMOTEWAKEUP_ENTRY, this );
 	if(iDeviceCaps().iConnect) 
 		{
 		TInt err(iClientDriver.SignalRemoteWakeup());
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to perform a remote wakeup",err);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP, "<Error %d> Unable to perform a remote wakeup",err);
 			ReportError(err);
 			}
 		}
 	else
 		{
-		RDebug::Printf("remote wakeup not supported");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP_DUP01, "remote wakeup not supported");
 		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_REMOTEWAKEUP_EXIT, this );
 	}
 
 
 TInt RUsbTestDevice::ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex,
 	TUint16 aDataReqLength,const TDesC8& aPayload)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_PROCESSREQUESTL_ENTRY, this );
 	
 	if(aRequest == KVendorEmptyRequest)
 		{
@@ -431,7 +460,7 @@
 		}
 	else if(aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest)
 		{
-		RDebug::Printf("**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL, "**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this);
 		// Handle a reconnect requests from the host		
 		AcknowledgeRequestReceived();			
 		
@@ -445,11 +474,12 @@
 		iTestCaseT_USBDI_0486->TestDeviceC()->OpenL(KTestDeviceC_SN);		
 		// Connect the device to the host	
 		iTestCaseT_USBDI_0486->TestDeviceC()->SoftwareConnect();
+		OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT, this, KErrAbort );
 		return KErrAbort;
 		}
 	else if(aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest)
 		{
-		RDebug::Printf("**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP01, "**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this);
 		// Handle a reconnect requests from the host		
 		AcknowledgeRequestReceived();		
 		 
@@ -468,6 +498,7 @@
 		
 		// Connect the device to the host	
 		iTestCaseT_USBDI_0486->TestDeviceD()->SoftwareConnect();	
+		OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP01, this, KErrAbort );
 		return KErrAbort;
 		}		
 	else if(aRequest == KVendorTestCasePassed)
@@ -487,7 +518,7 @@
 		
 		HBufC16* msg = HBufC16::NewL(aPayload.Length());
 		msg->Des().Copy(aPayload);
-		RDebug::Printf("<Host> Test case failed: %S",msg);
+		OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP02, "<Host> Test case failed: %S",*msg);
 		delete msg;
 		msg = 0;
 		ReportError(-aValue);
@@ -504,10 +535,10 @@
 		// Handle a payload request from the host
 
 		AcknowledgeRequestReceived();
-		RDebug::Printf("Put payload");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP03, "Put payload");
 		if(aPayload.Compare(_L8("DEADBEEF")) != 0)
 			{
-			RDebug::Printf("<Error %d> Payload not as expected",KErrCorrupt);
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP04, "<Error %d> Payload not as expected",KErrCorrupt);
 			ReportError(KErrCorrupt);
 			}
 		}
@@ -515,45 +546,46 @@
 		{
 		// Handle a payload request to the host
 
-		RDebug::Printf("Get payload");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP05, "Get payload");
 		__ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral));
-		RDebug::Printf("iAuxBuffer = ....");
-		RDebug::RawPrint(*iAuxBuffer);
-		RDebug::Printf("\n");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP06, "iAuxBuffer = ....");
+        OstTraceData(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP56, "", iAuxBuffer->Ptr(), iAuxBuffer->Length());
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP07, "\n");
 		
 		//Perform synchronous write to EP0
 		//This allows the subsequent 'Read' request to
 		//take place
 		TInt ret = iDeviceEp0->SendDataSynchronous(*iAuxBuffer);
-		RDebug::Printf("Write (from device callback) executed with error %d", ret);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP08, "Write (from device callback) executed with error %d", ret);
 		}
 	else if(aRequest == KVendorUnrespondRequest)
 		{
 		// Do not acknowledge this request
 		
-		RDebug::Printf("Unrespond request: continually NAK the host");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP09, "Unrespond request: continually NAK the host");
 		}
 	else if(aRequest == KVendorStallRequest)
 		{
 		// Stall the specified endpoint
 		
 		AcknowledgeRequestReceived();
-		RDebug::Printf("Stalling endpoint %d",aValue);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP10, "Stalling endpoint %d",aValue);
 						
 		}
 	else
 		{
 		// Maybe forward to derived classes
 		}
+	OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP02, this, KErrNone );
 	return KErrNone;
 	}
 
 
 void RUsbTestDevice::StateChangeL(TUsbcDeviceState aNewState,TInt aChangeCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_STATECHANGEL_ENTRY, this );
 	
-	RDebug::Printf("Client state change to %d err=%d",aNewState,aChangeCompletionCode);
+	OstTraceExt2(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL, "Client state change to %d err=%d",aNewState,aChangeCompletionCode);
 	
 	// Notify the test case of failed state change notification
 	
@@ -577,7 +609,7 @@
 			// The is a state change from EUsbcDeviceStateConfigured to aNewState
 			// so stop reading from control ep0
 			
-			RDebug::Printf("Ignoring control ep0");
+			OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL_DUP01, "Ignoring control ep0");
 			
 			// Stop reading ep0 directed requests
 			
@@ -597,7 +629,7 @@
 			// Device has now been placed into a fully configured state by the host
 			// so start reading from control ep0
 			
-			RDebug::Printf("Reading from control ep0");
+			OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL_DUP02, "Reading from control ep0");
 			
 			// Start reading ep0 directed requests
 			
@@ -618,12 +650,13 @@
 	// Forward the state change notification to derived classes
 	
 	OnStateChangeL(aNewState);
+	OstTraceFunctionExit1( RUSBTESTDEVICE_STATECHANGEL_EXIT, this );
 	}
 	
 
 void RUsbTestDevice::StartEp0Reading()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( RUSBTESTDEVICE_STARTEP0READING_ENTRY, this );
 
 	// Start reading device directed ep0 requests
 	
@@ -640,12 +673,13 @@
 		{
 		iInterfaces[i]->StartEp0Reading();
 		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_STARTEP0READING_EXIT, this );
 	}
 
 
 void RUsbTestDevice::StopEp0Reading()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( RUSBTESTDEVICE_STOPEP0READING_ENTRY, this );
 
 	// Stop reading interface directed requests
 	
@@ -662,33 +696,36 @@
 		{
 		return ReportError(err);
 		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_STOPEP0READING_EXIT, this );
 	}
 
 
 void RUsbTestDevice::AcknowledgeRequestReceived()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_ENTRY, this );
 	
 	TInt err(iDeviceEp0->Reader().Acknowledge());
-	RDebug::Printf("err = %d",err);
+	OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED, "err = %d",err);
 	if(err != KErrNone)
 		{
 		ReportError(err);
 		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_EXIT, this );
 	}
 
 
 
 void RUsbTestDevice::ReportError(TInt aCompletionCode)
 	{
-	LOG_FUNC
-	RDebug::Printf("err or aCompletionCode = %d, observer status = %d, KRequestPending = %d",
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_REPORTERROR_ENTRY, this );
+	OstTraceExt3(TRACE_NORMAL, RUSBTESTDEVICE_REPORTERROR, "err or aCompletionCode = %d, observer status = %d, KRequestPending = %d",
 			aCompletionCode, iObserverStatus->Int(), KRequestPending);
 	if(*iObserverStatus == KRequestPending)
 		{
-		RDebug::Printf("In complete request");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REPORTERROR_DUP01, "In complete request");
 		User::RequestComplete(iObserverStatus,aCompletionCode);
 		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_REPORTERROR_EXIT, this );
 	}
 	
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestEngine.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestEngine.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,6 +20,10 @@
 #include "testdebug.h"
 #include "TestCaseController.h"
 #include "TestCaseFactory.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TestEngineTraces.h"
+#endif
 
 // Console application options
 
@@ -43,10 +47,12 @@
 	
 CTestEngine* CTestEngine::NewL()
 	{
+	OstTraceFunctionEntry0( CTESTENGINE_NEWL_ENTRY );
 	CTestEngine* self = new (ELeave) CTestEngine;
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CTESTENGINE_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -56,12 +62,15 @@
 :	CActive(EPriorityUserInput),
 	iTestCaseIndex(0), iRepeat(0), iNumRepeats(KDefaultNumRepeats)
 	{
+	OstTraceFunctionEntry1( CTESTENGINE_CTESTENGINE_ENTRY, this );
+	OstTraceFunctionExit1( CTESTENGINE_CTESTENGINE_EXIT, this );
 	}
 
 
 
 CTestEngine::~CTestEngine()
 	{
+	OstTraceFunctionEntry1( CTESTENGINE_CTESTENGINE_ENTRY_DUP01, this );
 	// Cancel reading user console input
 	Cancel();
 	
@@ -74,21 +83,25 @@
 	// Finish test and release resources
 	gtest.End();
 	gtest.Close();
+	OstTraceFunctionExit1( CTESTENGINE_CTESTENGINE_EXIT_DUP01, this );
 	}
 	
 	
 	
 void CTestEngine::ConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CTESTENGINE_CONSTRUCTL_ENTRY, this );
 	CActiveScheduler::Add(this);
 
 	// Display information (construction text and OS build version number
 	gtest.Title();
 	gtest.Start(_L("Test Engine Initiation"));
 	gtest.Printf(_L(">>\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL, ">>\n");
 	gtest.Printf(_L(">>   T E S T   R U N \n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP01, ">>   T E S T   R U N \n");
 	gtest.Printf(_L(">>\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP02, ">>\n");
 
 	// Process the command line option for role
 	TInt cmdLineLength(User::CommandLineLength());
@@ -99,6 +112,7 @@
 	
 	// be careful, command line length is limited(248 characters)	
 	gtest.Printf(_L("***cmdLine = %lS\n"), cmdLine);
+	OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP03, "***cmdLine = %lS\n", *cmdLine);
 		
 	TLex args(*cmdLine);
 	args.SkipSpace();
@@ -123,12 +137,14 @@
 		else
 			{
 			gtest.Printf(_L("Test configuration: could not find option -role\n"));
+			OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP04, "Test configuration: could not find option -role\n");
 			gtest(EFalse);
 			}
 		}
 	else
 		{
 		gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgRole);
+		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP05, "Test configuration option not found: %S\n",KArgRole);
 		gtest(EFalse);
 		}
 		
@@ -161,6 +177,7 @@
 				}									
 							
 			gtest.Printf(_L("Test case specified: %S\n"),tc);
+			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP06, "Test case specified: %S\n",*tc);
 			
 						
 			iTestCasesIdentities.Append(tc);
@@ -171,6 +188,7 @@
 	else
 		{
 		gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgTestCases);
+		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP07, "Test configuration option not found: %S\n",KArgTestCases());
 		gtest(EFalse);		
 		}
 				
@@ -187,32 +205,39 @@
 		if(ret)
 			{
 			gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgTestRepeats);
+			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP08, "Test configuration option not found: %S\n",KArgTestRepeats());
 			gtest.Printf(_L("DEFAULT to number of repeats = %d\n"),KDefaultNumRepeats);
+			OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP09, "DEFAULT to number of repeats = %d\n",KDefaultNumRepeats);
 			iNumRepeats = KDefaultNumRepeats;
 			}
 		gtest.Printf(_L("Test repeats specified: %d cycles\n"),iNumRepeats);
+		OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP10, "Test repeats specified: %d cycles\n",iNumRepeats);
 		}
 	else
 		{
 		gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgTestRepeats);
+		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP11, "Test configuration option not found: %S\n",KArgTestRepeats());
 		gtest.Printf(_L("DEFAULT to number of repeats = %d\n"),KDefaultNumRepeats);
+		OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP12, "DEFAULT to number of repeats = %d\n",KDefaultNumRepeats);
 		iNumRepeats = KDefaultNumRepeats;
 		}
 		
 	// Create the test case controller
 	gtest.Printf(_L("Creating the test controller\n"));
+	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP13, "Creating the test controller\n");
 	iTestCaseController = CTestCaseController::NewL(*this,hostFlag);
 
 	CleanupStack::PopAndDestroy(cmdLine);
 
 	gtest.Console()->Read(iStatus);
 	SetActive();	
+	OstTraceFunctionExit1( CTESTENGINE_CONSTRUCTL_EXIT, this );
 	}
 	
 
 TInt CTestEngine::NextTestCaseId(TDes& aTestCaseId)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CTESTENGINE_NEXTTESTCASEID_ENTRY, this );
 	if(iTestCaseIndex < iTestCasesIdentities.Count())
 		{
 		aTestCaseId = *iTestCasesIdentities[iTestCaseIndex++];
@@ -224,34 +249,41 @@
 				iTestCaseIndex = 0; //prepare to start again
 				}
 			}
+		OstTraceFunctionExitExt( CTESTENGINE_NEXTTESTCASEID_EXIT, this, KErrNone );
 		return KErrNone;
 		}
 	else
 		{
+		OstTraceFunctionExitExt( CTESTENGINE_NEXTTESTCASEID_EXIT_DUP01, this, KErrNotFound );
 		return KErrNotFound;
 		}
 	}
 
 RPointerArray<HBufC>& CTestEngine::TestCasesIdentities()
 	{
+	OstTraceFunctionEntry1( CTESTENGINE_TESTCASESIDENTITIES_ENTRY, this );
+	OstTraceFunctionExitExt( CTESTENGINE_TESTCASESIDENTITIES_EXIT, this, ( TUint )&( iTestCasesIdentities ) );
 	return iTestCasesIdentities;
 	}
 
 TUint CTestEngine::NumRepeats()
 	{
+	OstTraceFunctionEntry1( CTESTENGINE_NUMREPEATS_ENTRY, this );
+	OstTraceFunctionExitExt( CTESTENGINE_NUMREPEATS_EXIT, this, iNumRepeats );
 	return iNumRepeats;
 	}
 
 void CTestEngine::DoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CTESTENGINE_DOCANCEL_ENTRY, this );
 	gtest.Console()->ReadCancel();	
+	OstTraceFunctionExit1( CTESTENGINE_DOCANCEL_EXIT, this );
 	}
 	
 
 void CTestEngine::RunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CTESTENGINE_RUNL_ENTRY, this );
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
@@ -264,24 +296,30 @@
 			{
 			iTestCaseController->Cancel();
 			gtest.Printf(_L("Test module terminating\n"));
-			RDebug::Printf("CActiveScheduler::Stop CTestEngine::RunL");
+			OstTrace0(TRACE_NORMAL, CTESTENGINE_RUNL, "Test module terminating\n");
+			OstTrace0(TRACE_NORMAL, CTESTENGINE_RUNL_DUP01, "CActiveScheduler::Stop CTestEngine::RunL");
 			CActiveScheduler::Stop();
 			}
 		else
 			{
 			gtest.Printf(_L("%d key pressed"),keyCode);
+			OstTrace1(TRACE_NORMAL, CTESTENGINE_RUNL_DUP02, "%d key pressed",keyCode);
 			}
 		}
 	else
 		{
 		gtest.Printf(_L("Manual key error %d\n"),completionCode);
+		OstTrace1(TRACE_NORMAL, CTESTENGINE_RUNL_DUP03, "Manual key error %d\n",completionCode);
 		SetActive();
 		}
+	OstTraceFunctionExit1( CTESTENGINE_RUNL_EXIT, this );
 	}
 	
 	
 TInt CTestEngine::RunError(TInt aError)
 	{
+	OstTraceFunctionEntryExt( CTESTENGINE_RUNERROR_ENTRY, this );
+	OstTraceFunctionExitExt( CTESTENGINE_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,6 +22,10 @@
 #include "testdebug.h"
 #include "controltransferrequests.h"
 #include "endpointwriter.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TestInterfaceBaseTraces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -33,11 +37,13 @@
 	iInterfaceName(aName),
 	iCurrentAlternateInterfaceSetting(0) // The default alternate interface setting will be zero when opened
 	{
+	OstTraceFunctionEntryExt( CINTERFACEBASE_CINTERFACEBASE_ENTRY, this );
+	OstTraceFunctionExit1( CINTERFACEBASE_CINTERFACEBASE_EXIT, this );
 	}
 	
 CInterfaceBase::~CInterfaceBase()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CINTERFACEBASE_CINTERFACEBASE_ENTRY_DUP01, this );
 	
 	delete iAuxBuffer;
 	delete iStallWatcher;
@@ -54,17 +60,18 @@
 	
 	// Close the channel to the driver
 	iClientDriver.Close();
+	OstTraceFunctionExit1( CINTERFACEBASE_CINTERFACEBASE_EXIT_DUP01, this );
 	}
 	
 	
 void CInterfaceBase::BaseConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CINTERFACEBASE_BASECONSTRUCTL_ENTRY, this );
 	// Open channel to driver
 	TInt err(iClientDriver.Open(0));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
+		OstTrace1(TRACE_NORMAL, CINTERFACEBASE_BASECONSTRUCTL, "<Error %d> Unable to open a channel to USB client driver",err);
 		User::Leave(err);
 		}
 
@@ -80,18 +87,19 @@
 
 	// Hide bus from host while interfaces are being set up
 	iClientDriver.DeviceDisconnectFromHost();
+	OstTraceFunctionExit1( CINTERFACEBASE_BASECONSTRUCTL_EXIT, this );
 	}
 
 
 void CInterfaceBase::AddInterfaceSettingL(CInterfaceSettingBase* aInterfaceSetting)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CINTERFACEBASE_ADDINTERFACESETTINGL_ENTRY, this );
 	
 	// Append to the container
 	TInt err(iAlternateSettings.Append(aInterfaceSetting));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to add interface setting",err);
+		OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL, "<Error %d> Unable to add interface setting",err);
 		User::Leave(err);
 		}
 	
@@ -102,14 +110,14 @@
 	
 	if(endpointSettingCount > 0)
 		{
-		RDebug::Printf("%u endpoint(s) to configure for this interface setting",endpointSettingCount);
+		OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP01, "%u endpoint(s) to configure for this interface setting",endpointSettingCount);
 				
 		// Device capabilities
 		TUsbDeviceCaps devCaps;
 		err = iClientDriver.DeviceCaps(devCaps);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to retrieve device capabilities",err);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP02, "<Error %d> Unable to retrieve device capabilities",err);
 			User::Leave(err);
 			}
 
@@ -119,7 +127,7 @@
 		err = iClientDriver.EndpointCaps(dataptr);
 		if(err != KErrNone)
 			{
-			RDebug::Printf("<Error %d> Unable to get endpoint capabilities",err);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP03, "<Error %d> Unable to get endpoint capabilities",err);
 			User::Leave(err);
 			}		
 		
@@ -133,13 +141,13 @@
 		
 		for(; epIndex<totalEndpoints; epIndex++)
 			{
-			RDebug::Printf("Examining hardware endpoint %u",epIndex);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP04, "Examining hardware endpoint %u",epIndex);
 			const TUsbcEndpointData ep = endpointCaps[epIndex];
 			
 			// Check the endpoint index to see if already claimed
 			if(!ep.iInUse)
 				{			
-				RDebug::Printf("...its free");
+				OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP05, "...its free");
 				const TUsbcEndpointCaps caps(ep.iCaps);
 				
 				// Information about the endpoint we are looking for	
@@ -157,18 +165,18 @@
 						// Create an endpoint writer for this endpoint
 						
 						aInterfaceSetting->CreateEndpointWriterL(iClientDriver,(epCount+1));
-						RDebug::Printf("Created endpoint writer for endpoint%d",epCount+1);
+						OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP06, "Created endpoint writer for endpoint%d",epCount+1);
 						}
 					else if(endpointSpec.iDir == KUsbEpDirOut)
 						{
 						// Create an endpoint reader for this endpoint
 												
 						aInterfaceSetting->CreateEndpointReaderL(iClientDriver,epCount+1);
-						RDebug::Printf("Created endpoint reader for endpoint%d",epCount+1);
+						OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP07, "Created endpoint reader for endpoint%d",epCount+1);
 						}					
 					
 					epCount++; // Increment to next endpoint spec
-					RDebug::Printf("Endpoint %u configured",epCount);
+					OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP08, "Endpoint %u configured",epCount);
 					endpointSpec.iSize = caps.MaxPacketSize();
 					
 					if(epCount >= endpointSettingCount)
@@ -180,98 +188,107 @@
 				}
 			else
 				{
-				RDebug::Printf("...its busy");
+				OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP09, "...its busy");
 				}
 			}
 		
-		RDebug::Printf("Configure %u out of %u endpoints",epCount,endpointSettingCount);			
+		OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP10, "Configure %u out of %u endpoints",epCount,endpointSettingCount);			
 		
 		if(epCount < endpointSettingCount)
 			{
-			RDebug::Printf("<Error %d> Only managed to configure %u out of %u endpoints",KErrNotFound,epCount,endpointSettingCount);
+			OstTraceExt3(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP11, "<Error %d> Only managed to configure %u out of %u endpoints",KErrNotFound,epCount,endpointSettingCount);
 			User::Leave(KErrNotFound);
 			}			
 		}
 	else
 		{
-		RDebug::Printf("No endpoints for this interface setting");
+		OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP12, "No endpoints for this interface setting");
 		}
 	
 	// Add the new setting to the device
 	err = iClientDriver.SetInterface(alternateSettingNumber,aInterfaceSetting->iInterfaceInfo);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set the alternate interface setting %d",err,alternateSettingNumber);
+		OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP13, "<Error %d> Unable to set the alternate interface setting %d",err,alternateSettingNumber);
 		User::Leave(err);
 		}
 	
-	RDebug::Printf("Alternate interface setting %d set",alternateSettingNumber);
+	OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP14, "Alternate interface setting %d set",alternateSettingNumber);
+	OstTraceFunctionExit1( CINTERFACEBASE_ADDINTERFACESETTINGL_EXIT, this );
 	}
 
 
 TInt CInterfaceBase::StallEndpoint(TUint16 aEndpointNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CINTERFACEBASE_STALLENDPOINT_ENTRY, this );
 	
-	RDebug::Printf("Stalling endpoint%d",aEndpointNumber);
+	OstTrace1(TRACE_NORMAL, CINTERFACEBASE_STALLENDPOINT, "Stalling endpoint%d",aEndpointNumber);
 	return iClientDriver.HaltEndpoint(static_cast<TEndpointNumber>(aEndpointNumber));
 	}
 
 	
 CInterfaceSettingBase& CInterfaceBase::AlternateSetting(TInt aSettingNumber) const
 	{
+	OstTraceFunctionEntryExt( CINTERFACEBASE_ALTERNATESETTING_ENTRY, this );
+	OstTraceFunctionExit1( CINTERFACEBASE_ALTERNATESETTING_EXIT, this );
 	return *iAlternateSettings[aSettingNumber];
 	}
 
 	
 TInt CInterfaceBase::InterfaceSettingCount() const
 	{
+	OstTraceFunctionEntry1( CINTERFACEBASE_INTERFACESETTINGCOUNT_ENTRY, this );
 	return iAlternateSettings.Count();
 	}
 
 
 TUint32 CInterfaceBase::ExtractNumberL(const TDesC8& aPayload)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CINTERFACEBASE_EXTRACTNUMBERL_ENTRY, this );
 
 	// Read the number of repeats and the data supplied by the host, on the specified endpoint
 	TLex8 lex(aPayload.Left(KNumberStringLength));
 	TUint32 numBytes;
 	User::LeaveIfError(lex.Val(numBytes, EDecimal));
-	RDebug::Printf("Writing %d bytes using string pattern below to IN endpoint",numBytes);
-	RDebug::RawPrint(aPayload.Mid(KNumberStringLength));
-	RDebug::Printf(""); //new line
+	OstTrace1(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL, "Writing %d bytes using string pattern below to IN endpoint",numBytes);
+	const TPtrC8& midPayload = aPayload.Mid(KNumberStringLength);
+    OstTraceData(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL_DUP50, "", midPayload.Ptr(), midPayload.Length());
+	OstTrace0(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL_DUP01, "");
+	OstTraceFunctionExitExt( CINTERFACEBASE_EXTRACTNUMBERL_EXIT, this, ( TUint )( numBytes ) );
 	return numBytes;
 	}
 
 void CInterfaceBase::ExtractTwoNumbersL(const TDesC8& aPayload, TUint32& aFirstNum, TUint32& aSecondNum)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CINTERFACEBASE_EXTRACTTWONUMBERSL_ENTRY, this );
 
 	// Read the number of repeats and the data supplied by the host, on the specified endpoint
 	TLex8 lex1(aPayload.Left(KNumberStringLength));
 	User::LeaveIfError(lex1.Val(aFirstNum, EDecimal));
 	TLex8 lex2(aPayload.Mid(KNumberStringLength, KNumberStringLength));
 	User::LeaveIfError(lex2.Val(aSecondNum, EDecimal));
-	RDebug::Printf("Writing or Reading a total of %d bytes in repeats of %d bytes using string pattern below to IN endpoint",aFirstNum,aSecondNum);
-	RDebug::RawPrint(aPayload.Mid(2*KNumberStringLength));
-	RDebug::Printf(""); //new line
+	OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL, "Writing or Reading a total of %d bytes in repeats of %d bytes using string pattern below to IN endpoint",aFirstNum,aSecondNum);
+	const TPtrC8& midPayload = aPayload.Mid(2*KNumberStringLength);
+    OstTraceData(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP50, "", midPayload.Ptr(), midPayload.Length());
+	OstTrace0(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP01, "");
+	OstTraceFunctionExit1( CINTERFACEBASE_EXTRACTTWONUMBERSL_EXIT, this );
 	return;
 	}
 
 void CInterfaceBase::AlternateInterfaceSelectedL(TInt aAlternateInterfaceSetting)
 	{
-	LOG_FUNC
-	RDebug::Printf("Interface %S:",&iInterfaceName);	
+	OstTraceFunctionEntryExt( CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_ENTRY, this );
+	OstTraceExt1(TRACE_NORMAL, CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL, "Interface %S:",iInterfaceName);	
 	iCurrentAlternateInterfaceSetting = aAlternateInterfaceSetting;
+	OstTraceFunctionExit1( CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_EXIT, this );
 	}
 
 
 TInt CInterfaceBase::ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex,
 	TUint16 aDataReqLength,const TDesC8& aPayload)
 	{
-	LOG_FUNC
-	RDebug::Printf("Interface %S:",&iInterfaceName);
+	OstTraceFunctionEntryExt( CINTERFACEBASE_PROCESSREQUESTL_ENTRY, this );
+	OstTraceExt1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL, "Interface %S:",iInterfaceName);
 	
 	switch(aRequest)
 		{
@@ -279,34 +296,34 @@
 			// Acknowledge the request and do nothing
 			iEp0Reader->Acknowledge();
 			
-			RDebug::Printf("Request: Empty");
+			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP01, "Request: Empty");
 			break;
 			
 		case KVendorPutPayloadRequest:
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			RDebug::Printf("Put payload");
+			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP02, "Put payload");
 			if(aPayload.Compare(_L8("DEADBEEF")) != 0)
 				{
-				RDebug::Printf("<Error %d> Payload not as expected",KErrCorrupt);
+				OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP03, "<Error %d> Payload not as expected",KErrCorrupt);
 				iDevice.ReportError(KErrCorrupt);
 				}
 			break;
 			
 		case KVendorGetPayloadRequest:
 			{
-			RDebug::Printf("Get payload");
+			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP04, "Get payload");
 			__ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral));
-			RDebug::Printf("iAuxBuffer = ....");
-			RDebug::RawPrint(*iAuxBuffer);
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP05, "iAuxBuffer = ....");
+            OstTraceData(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP55, "", iAuxBuffer->Ptr(), iAuxBuffer->Length());
+			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP06, "\n");
 			
 			//Perform synchronous write to EP0
 			//This allows the subsequent 'Read' request to
 			//take place
 			TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
-			RDebug::Printf("Write (from interface callback) executed with error %d", ret);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP07, "Write (from interface callback) executed with error %d", ret);
 			}
 			break;
 			
@@ -324,7 +341,7 @@
 			//This allows the subsequent 'Read' request to
 			//take place
 			TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
-			RDebug::Printf("Write (from interface callback) executed with error %d", ret);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP08, "Write (from interface callback) executed with error %d", ret);
 			}
 			break;
 			
@@ -342,7 +359,7 @@
 			//This allows the subsequent 'Read' request to
 			//take place
 			TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
-			RDebug::Printf("Write (from interface callback) executed with error %d", ret);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP09, "Write (from interface callback) executed with error %d", ret);
 			}
 			break;
 			
@@ -350,7 +367,7 @@
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			RDebug::Printf("Writing %d bytes to IN endpoint (index %d)",aPayload.Length(),aValue);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP10, "Writing %d bytes to IN endpoint (index %d)",aPayload.Length(),aValue);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			
@@ -361,7 +378,7 @@
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			RDebug::Printf("CANCEL Writing to IN endpoint (index %d)",aValue);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP11, "CANCEL Writing to IN endpoint (index %d)",aValue);
 			
 			// CANCEL writing the data supplied by the host, back to the host though the specified endpoint
 			
@@ -416,7 +433,7 @@
 			TUint32 numBytesPerRead = 0;
 			TUint32 totalNumBytes = 0;
 			ExtractTwoNumbersL(aPayload, numBytesPerRead, totalNumBytes);
-			RDebug::Printf("Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerRead,totalNumBytes);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP12, "Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerRead,totalNumBytes);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			AlternateSetting(iCurrentAlternateInterfaceSetting).RepeatedReadAndValidateFromEndpointL(aPayload.Mid(KTwoNumberStringLength),numBytesPerRead,totalNumBytes,aValue);
@@ -432,7 +449,7 @@
 			TUint32 numBytesPerWrite = 0;
 			TUint32 totalNumBytes = 0;
 			ExtractTwoNumbersL(aPayload, numBytesPerWrite, totalNumBytes);
-			RDebug::Printf("Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerWrite,totalNumBytes);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP13, "Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerWrite,totalNumBytes);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			AlternateSetting(iCurrentAlternateInterfaceSetting).RepeatedWriteSpecifiedDataToEndpointL(aPayload.Mid(KTwoNumberStringLength),numBytesPerWrite,totalNumBytes,aValue);
@@ -447,7 +464,7 @@
 			TUint16 readEndpoint = aValue >> 8; //HI 8 buts
 			TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
 			
-			RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP14, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			
@@ -463,7 +480,7 @@
 			TUint16 readEndpoint = aValue >> 8; //HI 8 buts
 			TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
 			
-			RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP15, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			
@@ -478,7 +495,7 @@
 			
 			TUint16 readEndpoint = aValue >> 8; //HI 8 buts
 			TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
-			RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d) in sections of....",readEndpoint,writeEndpoint);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP16, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d) in sections of....",readEndpoint,writeEndpoint);
 			
 			// Read the number of bytes to use for each Write
 			TUint numBytes[KNumSplitWriteSections];
@@ -487,7 +504,7 @@
 				{
 				TLex8 lex(aPayload.Mid(i*KNumberStringLength, KNumberStringLength));
 				User::LeaveIfError(lex.Val(numBytes[i], EDecimal));
-				RDebug::Printf("%d bytes", numBytes[i]);
+				OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP17, "%d bytes", numBytes[i]);
 				// Write the data supplied by the host, back to the host though the specified endpoint
 				AlternateSetting(iCurrentAlternateInterfaceSetting).WriteSynchronousCachedEndpointDataToEndpointL(readEndpoint,writeEndpoint,numBytesWritten,numBytes[i]);
 				// Updates bytes written for next round of 'for'loop
@@ -505,7 +522,7 @@
 			TLex8 lex(aPayload);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			RDebug::Printf("Reading %d bytes on OUT endpoint (index %d)",numBytes,aValue);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP18, "Reading %u bytes on OUT endpoint (index %u)",numBytes,(TUint32)aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataFromEndpointL(numBytes,aValue);
 			}
 			break;
@@ -519,7 +536,7 @@
 			TLex8 lex(aPayload);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			RDebug::Printf("Reading %d bytes on OUT endpoint (index %d) ... then halting endpoint",numBytes,aValue);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP19, "Reading %u bytes on OUT endpoint (index %u) ... then halting endpoint",numBytes,(TUint32)aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataFromAndHaltEndpointL(numBytes,aValue);
 			}
 			break;
@@ -529,7 +546,7 @@
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			RDebug::Printf("CANCEL Reading on OUT endpoint (index %d)",aValue);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP20, "CANCEL Reading on OUT endpoint (index %u)",(TUint32)aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).CancelAnyReadDataFromEndpointL(aValue);
 			}
 			break;
@@ -543,7 +560,7 @@
 			TLex8 lex(aPayload);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			RDebug::Printf("Reading %d bytes on OUT endpoint (index %d)",numBytes,aValue);
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP21, "Reading %u bytes on OUT endpoint (index %u)",numBytes,(TUint32)aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataUntilShortFromEndpointL(numBytes,aValue);
 			}
 			break;
@@ -555,12 +572,13 @@
 			
 			// Read the number of repeats and the data supplied by the host, on the specified endpoint
 			TLex8 lex(aPayload.Left(KNumberStringLength));
-			RDebug::Printf("NUMBER STRING LENGTH CALCULATED AS %d",KNumberStringLength);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP22, "NUMBER STRING LENGTH CALCULATED AS %d",KNumberStringLength);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			RDebug::Printf("Validation");
-			RDebug::Printf("Checking %d bytes using string pattern below exist in the buffer for endpoint %d",numBytes,aValue);
-			RDebug::RawPrint(aPayload.Mid(KNumberStringLength));
+			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP23, "Validation");
+			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP24, "Checking %u bytes using string pattern below exist in the buffer for endpoint %u",numBytes,(TUint32)aValue);
+            const TPtrC8& midPayload = aPayload.Mid(KNumberStringLength);
+            OstTraceData(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP54, "", midPayload.Ptr(), midPayload.Length());
 			
 			delete iAuxBuffer;
 			iAuxBuffer = HBufC8::NewL(KPassFailStringLength);
@@ -598,18 +616,18 @@
 		case KVendorUnrespondRequest:
 			// Do not acknowledge this request
 			
-			RDebug::Printf("Unrespond request: continually NAK the host");
+			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP25, "Unrespond request: continually NAK the host");
 			break;
 			
 		case KVendorStallRequest:
 			{
 			// Stall the specified endpoint		
 			iEp0Reader->Acknowledge();
-			RDebug::Printf("Stalling endpoint%d",aValue);
+			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP26, "Stalling endpoint%d",aValue);
 			TInt err = StallEndpoint(aValue);
 			if(err != KErrNone)
 				{
-				RDebug::Printf("<Error %d> unable to stall endpoint index %d",err,aValue);
+				OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP27, "<Error %d> unable to stall endpoint index %d",err,aValue);
 				iDevice.ReportError(err);
 				}
 			}
@@ -619,23 +637,26 @@
 			break;
 		}
 
+	OstTraceFunctionExitExt( CINTERFACEBASE_PROCESSREQUESTL_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
 
 void CInterfaceBase::StartEp0Reading()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CINTERFACEBASE_STARTEP0READING_ENTRY, this );
 	
 	iEp0Reader->ReadRequestsL();
+	OstTraceFunctionExit1( CINTERFACEBASE_STARTEP0READING_EXIT, this );
 	}
 	
 
 void CInterfaceBase::StopEp0Reading()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CINTERFACEBASE_STOPEP0READING_ENTRY, this );
 	
 	iEp0Reader->Cancel();		
+	OstTraceFunctionExit1( CINTERFACEBASE_STOPEP0READING_EXIT, this );
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestPolicy.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestPolicy.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,16 +21,22 @@
 #include "BaseTestCase.h"
 #include "TestCaseFactory.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TestPolicyTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
 	
 CBasicTestPolicy* CBasicTestPolicy::NewL()
 	{
+	OstTraceFunctionEntry0( CBASICTESTPOLICY_NEWL_ENTRY );
 	CBasicTestPolicy* self = new (ELeave) CBasicTestPolicy;
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CBASICTESTPOLICY_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -38,26 +44,31 @@
 CBasicTestPolicy::CBasicTestPolicy()
 :	CActive(EPriorityStandard)
 	{
+	OstTraceFunctionEntry1( CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT, this );
 	}
 
 	
 CBasicTestPolicy::~CBasicTestPolicy()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY_DUP01, this );
 
 	Cancel();
+	OstTraceFunctionExit1( CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT_DUP01, this );
 	}
 	
 
 void CBasicTestPolicy::ConstructL()
 	{
+	OstTraceFunctionEntry1( CBASICTESTPOLICY_CONSTRUCTL_ENTRY, this );
+	OstTraceFunctionExit1( CBASICTESTPOLICY_CONSTRUCTL_EXIT, this );
 	}
 
 	
 void CBasicTestPolicy::RunTestCaseL(const TDesC& aTestCaseId,TRequestStatus& aNotifierStatus)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CBASICTESTPOLICY_RUNTESTCASEL_ENTRY, this );
 
 	iNotifierStatus = &aNotifierStatus;
 
@@ -71,12 +82,13 @@
 	
 	*iNotifierStatus = iStatus = KRequestPending;
 	SetActive();
+	OstTraceFunctionExit1( CBASICTESTPOLICY_RUNTESTCASEL_EXIT, this );
 	}
 
 
 void CBasicTestPolicy::DoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CBASICTESTPOLICY_DOCANCEL_ENTRY, this );
 
 	// Cancel running the test cases
 	
@@ -85,24 +97,26 @@
 	// Notify the test case controller that test case execution was cancelled
 	
 	User::RequestComplete(iNotifierStatus,KErrCancel);
+	OstTraceFunctionExit1( CBASICTESTPOLICY_DOCANCEL_EXIT, this );
 	}
 
 
 void CBasicTestPolicy::SignalTestComplete(TInt aCompletionCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASICTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY, this );
 	
 	// Complete the test policy request with the test case completion code
 	// (Basically self completion)
 	
 	TRequestStatus* s = &iStatus;	
 	User::RequestComplete(s,aCompletionCode);
+	OstTraceFunctionExit1( CBASICTESTPOLICY_SIGNALTESTCOMPLETE_EXIT, this );
 	}
 
 	
 void CBasicTestPolicy::RunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CBASICTESTPOLICY_RUNL_ENTRY, this );
 	
 	// Complete the request of the notifier with the test case 
 	// completion code
@@ -112,52 +126,62 @@
 	// Destroy the test case
 	
 	delete iTestCase;
+	OstTraceFunctionExit1( CBASICTESTPOLICY_RUNL_EXIT, this );
 	}
 
 
 TInt CBasicTestPolicy::RunError(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBASICTESTPOLICY_RUNERROR_ENTRY, this );
 	
 	aError = KErrNone;
+	OstTraceFunctionExitExt( CBASICTESTPOLICY_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 	
 CThreadTestPolicy* CThreadTestPolicy::NewL()
 	{
+	OstTraceFunctionEntry0( CTHREADTESTPOLICY_NEWL_ENTRY );
 	CThreadTestPolicy* self = new (ELeave) CThreadTestPolicy;
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
 	
 CThreadTestPolicy::CThreadTestPolicy()
 	{
+	OstTraceFunctionEntry1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY, this );
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT, this );
 	}
 	
 	
 CThreadTestPolicy::~CThreadTestPolicy()
 	{
+	OstTraceFunctionEntry1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY_DUP01, this );
 	iTestThread.Close();
 	if(iTestCaseId)
 		{
 		delete iTestCaseId;
 		iTestCaseId = NULL;
 		}
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT_DUP01, this );
 	}
 
 void CThreadTestPolicy::ConstructL()
 	{
+	OstTraceFunctionEntry1( CTHREADTESTPOLICY_CONSTRUCTL_ENTRY, this );
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_CONSTRUCTL_EXIT, this );
 	}
 
 void CThreadTestPolicy::RunTestCaseL(const TDesC& aTestCaseId,TRequestStatus& aNotifierStatus)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CTHREADTESTPOLICY_RUNTESTCASEL_ENTRY, this );
 
 	iNotifierStatus = &aNotifierStatus;
-	RDebug::Printf("Creating thread for test case '%S'",&aTestCaseId);
+	OstTraceExt1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNTESTCASEL, "Creating thread for test case '%S'",aTestCaseId);
 		
 	if(iTestCaseId)
 		{
@@ -173,58 +197,61 @@
 	
 	if(err != KErrNone)
 		{
-		RDebug::Printf("Test thread creation unsuccessful: %d",err);
+		OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNTESTCASEL_DUP01, "Test thread creation unsuccessful: %d",err);
 		User::Leave(err);
 		}
 
-	RDebug::Printf("Test thread '%S' created",&aTestCaseId);
+	OstTraceExt1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNTESTCASEL_DUP02, "Test thread '%S' created",aTestCaseId);
 	// Start the test case in the thread
 	iTestThread.Logon(iStatus);
 	SetActive();
 	iTestThread.Resume();
 	*iNotifierStatus = KRequestPending;
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_RUNTESTCASEL_EXIT, this );
 	}
 
 
 void CThreadTestPolicy::SignalTestComplete(TInt aCompletionCode)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY, this );
 
 	if(aCompletionCode == KErrNone)
 		{
-		RDebug::Printf("CActiveScheduler::Stop CThreadTestPolicy::SignalTestComplete");
+		OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_SIGNALTESTCOMPLETE, "CActiveScheduler::Stop CThreadTestPolicy::SignalTestComplete");
 		CActiveScheduler::Stop();
 		}
 	else
 		{
-		RDebug::Printf("Killing thread with: %d",aCompletionCode);
+		OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_DUP01, "Killing thread with: %d",aCompletionCode);
 		iTestThread.Kill(aCompletionCode);
 		}
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_EXIT, this );
 	}
 
 void CThreadTestPolicy::DoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CTHREADTESTPOLICY_DOCANCEL_ENTRY, this );
 
 	iTestCase->Cancel();
-	LOG_POINT(1)
+	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL, ">> Debug point: 1");
 	TInt err(iTestThread.LogonCancel(iStatus));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("Unable to cancel thread logon: %d",err);
+		OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP01, "Unable to cancel thread logon: %d",err);
 		}
-	LOG_POINT(2)
+	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP02, ">> Debug point: 2");
 	TRequestStatus cancelStatus;
 	iTestThread.Logon(cancelStatus);
-	LOG_POINT(3)
+	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP03, ">> Debug point: 3");
 	iTestThread.Kill(KErrCancel);		
-	LOG_POINT(4)
+	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP04, ">> Debug point: 4");
 	User::RequestComplete(iNotifierStatus,cancelStatus.Int());
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_DOCANCEL_EXIT, this );
 	}
 	
 TInt CThreadTestPolicy::ThreadFunction(TAny* aThreadParameter)
 	{
-	LOG_CFUNC
+	OstTraceFunctionEntry0( CTHREADTESTPOLICY_THREADFUNCTION_ENTRY);
 
 	TInt err(KErrNone);
 	TInt leaveCode(KErrNone);
@@ -235,24 +262,26 @@
 	CTrapCleanup* cleanup = CTrapCleanup::New();
 	if(cleanup == NULL)
 		{
+		OstTraceFunctionExitExt( CTHREADTESTPOLICY_THREADFUNCTION_EXIT, 0, KErrNoMemory );
 		return KErrNoMemory;
 		}
 		
 	TRAP(leaveCode,err = CThreadTestPolicy::DoTestL(*testCaseId));
 	if(leaveCode != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Thread '%S' DoTest",leaveCode,&testCaseId);
+		OstTraceExt2(TRACE_NORMAL, CTHREADTESTPOLICY_THREADFUNCTION, "<Error %d> Thread '%S' DoTest",leaveCode, *testCaseId);
 		err = leaveCode;
 		}
 	
 	delete cleanup;
+	OstTraceFunctionExitExt( CTHREADTESTPOLICY_THREADFUNCTION_EXIT_DUP01, 0, err );
 	return err;
 	}
 	
 	
 TInt CThreadTestPolicy::DoTestL(const TDesC& aTestCaseId)
 	{
-	LOG_CFUNC
+	OstTraceFunctionEntryExt( CTHREADTESTPOLICY_DOTESTL_ENTRY, 0 );
 	TInt err(KErrNone);
 	
 	// Create a new active scheduler for this thread
@@ -269,7 +298,7 @@
 	if(!testCase->IsHostOnly())
 		{
 		// Loop for active objects
-		RDebug::Printf("CActiveScheduler::Start in CThreadTestPolicy::DoTestL");	
+		OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOTESTL, "CActiveScheduler::Start in CThreadTestPolicy::DoTestL");
 		CActiveScheduler::Start();
 		}	
 	// Get the test case execution result 
@@ -281,18 +310,19 @@
 	// Destroy the active scheduler	
 	CleanupStack::PopAndDestroy(sched);
 	
+	OstTraceFunctionExitExt( CTHREADTESTPOLICY_DOTESTL_EXIT, 0, err );
 	return err;
 	}
 
 void CThreadTestPolicy::RunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CTHREADTESTPOLICY_RUNL_ENTRY, this );
 	TInt completionCode(iStatus.Int());
 	
 	TExitType exitType(iTestThread.ExitType());
 	TExitCategoryName exitName(iTestThread.ExitCategory());
 	TInt exitReason(iTestThread.ExitReason());
-	RDebug::Printf("Test thread '%S' completed with completion code %d",&iTestThread.Name(),completionCode);
+	OstTraceExt2(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL, "Test thread '%S' completed with completion code %d",iTestThread.Name(),completionCode);
 		
 	switch(exitType)
 		{
@@ -300,8 +330,8 @@
 		// This will occur if test API panics or RTest expression is false (i.e. test case fails)
 		case EExitPanic:
 			{
-			RDebug::Printf("Test thread '%S' has panicked with category '%S' reason %d",
-						&iTestThread.Name(),&exitName,exitReason);
+			OstTraceExt3(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL_DUP01, "Test thread '%S' has panicked with category '%S' reason %d",
+						iTestThread.Name(),exitName,exitReason);
 			// May require to stop and start host/client USB depending on what panic category it is
 			// can no longer trust RUsbHubDriver/RDevUsbcClient to be in good state
 			completionCode = KErrAbort;
@@ -311,8 +341,8 @@
 		// The thread has been terminated
 		case EExitTerminate:
 			{
-			RDebug::Printf("Test thread '%S' terminated with category %s reason %d",
-				&iTestThread.Name(),&exitName,exitReason);
+			OstTraceExt3(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL_DUP02, "Test thread '%S' terminated with category %s reason %d",
+				iTestThread.Name(),exitName,exitReason);
 			}
 			break;
 				
@@ -320,7 +350,7 @@
 		// This will occur when the test thread executes normally or is cancelled
 		case EExitKill:
 			{
-			RDebug::Printf("Test thread '%S' has been killed with reason %d",&iTestThread.Name(),exitReason);
+			OstTraceExt2(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL_DUP03, "Test thread '%S' has been killed with reason %d",iTestThread.Name(),exitReason);
 			}
 			break;
 				
@@ -336,11 +366,14 @@
 		
 	// Complete the notifier's request status
 	User::RequestComplete(iNotifierStatus,completionCode);
+	OstTraceFunctionExit1( CTHREADTESTPOLICY_RUNL_EXIT, this );
 	}
 
 TInt CThreadTestPolicy::RunError(TInt aError)
 	{
-	RDebug::Printf("<Error %d><Test Policy> RunError",aError);
+	OstTraceFunctionEntryExt( CTHREADTESTPOLICY_RUNERROR_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNERROR, "<Error %d><Test Policy> RunError",aError);
+	OstTraceFunctionExitExt( CTHREADTESTPOLICY_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,6 +17,10 @@
 //
 
 #include "UsbClientStateWatcher.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "UsbClientStateWatcherTraces.h"
+#endif
 #include <d32usbc.h>
 #include <e32test.h>
 #include <e32debug.h>
@@ -28,10 +32,12 @@
 
 CUsbClientStateWatcher* CUsbClientStateWatcher::NewL(RDevUsbcClient& aClientDriver,MUsbClientStateObserver& aStateObserver)
 	{
+	OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_NEWL_ENTRY, 0 );
 	CUsbClientStateWatcher* self = new (ELeave) CUsbClientStateWatcher(aClientDriver,aStateObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -41,33 +47,41 @@
 	iClientDriver(aClientDriver),
 	iStateObserver(aStateObserver)
 	{
+	OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT, this );
 	}
 
 
 CUsbClientStateWatcher::~CUsbClientStateWatcher()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY_DUP01, this );
 	Cancel();
+	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT_DUP01, this );
 	}
 	
 	
 void CUsbClientStateWatcher::ConstructL()
 	{
-	RDebug::Printf("<Client State Watcher> Watching state of device");
+	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_ENTRY, this );
+	OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_CONSTRUCTL, "<Client State Watcher> Watching state of device");
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();
+	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CUsbClientStateWatcher::DoCancel()
 	{
+	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_DOCANCEL_ENTRY, this );
 	// Cancel device status notification
 	iClientDriver.AlternateDeviceStatusNotifyCancel();	
+	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_DOCANCEL_EXIT, this );
 	}
 
 void CUsbClientStateWatcher::RunL()
 	{
+	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_RUNL_ENTRY, this );
 	// Retrieve the asynchronous completion code
 	TInt completionCode(iStatus.Int());
 	
@@ -83,42 +97,42 @@
 			switch(iState)
 				{
 				case EUsbcDeviceStateUndefined:
-					RDebug::Printf("<Client State> Not attached");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL, "<Client State> Not attached");
 					break;
 				
 				case EUsbcDeviceStateAttached:
-					RDebug::Printf("<Client State> Attached to host but not powered");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP01, "<Client State> Attached to host but not powered");
 					break;
 					
 				case EUsbcDeviceStatePowered:
-					RDebug::Printf("<Client State> Attached and powered but no reset");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP02, "<Client State> Attached and powered but no reset");
 					break;
 					
 				case EUsbcDeviceStateDefault:
-					RDebug::Printf("<Client State> Reset but not addressed");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP03, "<Client State> Reset but not addressed");
 					break;
 					
 				case EUsbcDeviceStateAddress:
-					RDebug::Printf("<Client State> Addressed but not configured");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP04, "<Client State> Addressed but not configured");
 					break;
 	 
 				case EUsbcDeviceStateConfigured:
-					RDebug::Printf("<Client State> Fully configured");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP05, "<Client State> Fully configured");
 					break;
 	 
 				case EUsbcDeviceStateSuspended:
-					RDebug::Printf("<Client State> Suspended");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP06, "<Client State> Suspended");
 					break;
 					
 				case EUsbcNoState: //follow through
 				default:
-					RDebug::Printf("<Client State> Not specified");
+					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP07, "<Client State> Not specified");
 					break;
 				}
 			}
 		else
 			{
-			RDebug::Printf("<Client State> Notification error %d",completionCode);
+			OstTrace1(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP08, "<Client State> Notification error %d",completionCode);
 			}
 		
 		// Device state change
@@ -128,12 +142,15 @@
 	// Keep asking to be informed for status notifications
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();	
+	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_RUNL_EXIT, this );
 	}
 	
 	
 TInt CUsbClientStateWatcher::RunError(TInt aError)
 	{
+	OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_RUNERROR_ENTRY, this );
 	aError = KErrNone;
+	OstTraceFunctionExitExt( CUSBCLIENTSTATEWATCHER_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 
@@ -145,10 +162,12 @@
 CAlternateInterfaceSelectionWatcher* CAlternateInterfaceSelectionWatcher::NewL(
 	RDevUsbcClient& aClientDriver,MAlternateSettingObserver& aObserver)
 	{
+	OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_ENTRY, 0 );
 	CAlternateInterfaceSelectionWatcher* self = new (ELeave) CAlternateInterfaceSelectionWatcher(aClientDriver,aObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -159,38 +178,43 @@
 	iClientDriver(aClientDriver),
 	iObserver(aObserver)
 	{
+	OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT, this );
 	}
 	
 	
 CAlternateInterfaceSelectionWatcher::~CAlternateInterfaceSelectionWatcher()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY_DUP01, this );
 
 	Cancel();
+	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT_DUP01, this );
 	}
 	
 	
 void CAlternateInterfaceSelectionWatcher::ConstructL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_ENTRY, this );
 
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();	
+	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CAlternateInterfaceSelectionWatcher::DoCancel()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_ENTRY, this );
 
 	iClientDriver.AlternateDeviceStatusNotifyCancel();
+	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_EXIT, this );
 	}
 	
 	
 void CAlternateInterfaceSelectionWatcher::RunL()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_ENTRY, this );
 
 	TInt completionCode(iStatus.Int());
 	
@@ -201,13 +225,15 @@
 	// Keep asking to be informed for status notifications
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();	
+	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_EXIT, this );
 	}
 
 
 TInt CAlternateInterfaceSelectionWatcher::RunError(TInt aError)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_ENTRY, this );
 
+	OstTraceFunctionExitExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/controlendpointreader.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/controlendpointreader.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,10 @@
 
 #include "controlendpointreader.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "controlendpointreaderTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{	
@@ -28,43 +32,48 @@
 	iDataPhase(EFalse),
 	iRequestHandler(aRequestHandler)
 	{
+	OstTraceFunctionEntryExt( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY, this );
+	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT, this );
 	}
 	
 	
 CControlEndpointReader::~CControlEndpointReader()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT_DUP01, this );
 	}
 
 
 void CControlEndpointReader::ReadRequestsL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CCONTROLENDPOINTREADER_READREQUESTSL_ENTRY, this );
 	
 	// Read a packet from endpoint 0 (this should incorporate a request)
 	
 	ReadPacketL(this);
+	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_READREQUESTSL_EXIT, this );
 	}
 	
 
 void CControlEndpointReader::EndpointReadError(TEndpointNumber aEndpointNumber,TInt aErrorCode)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CCONTROLENDPOINTREADER_ENDPOINTREADERROR_ENTRY, this );
 	
-	RDebug::Printf("<Error %d> Asynchronous read on endpoint %d",aErrorCode,aEndpointNumber);
+	OstTraceExt2(TRACE_NORMAL, CCONTROLENDPOINTREADER_ENDPOINTREADERROR, "<Error %d> Asynchronous read on endpoint %d",aErrorCode,aEndpointNumber);
+	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_ENDPOINTREADERROR_EXIT, this );
 	}
 	
 	
 void CControlEndpointReader::DataReceivedFromEndpointL(TEndpointNumber aEndpointNumber,const TDesC8& aData)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_ENTRY, this );
 	
-	RDebug::Printf("ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
-	RDebug::Printf("iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
+	OstTraceExt5(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL, "ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
+	OstTraceExt2(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP01, "iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
 	if(iDeviceToHost && iDataPhase)
 		{
 		TInt err = iRequestHandler.ProcessRequestL(ibRequest,iwValue,iwIndex,iwLength,aData);
-		RDebug::Printf("ProdessRequestL returned %d",err);
+		OstTrace1(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP02, "ProdessRequestL returned %d",err);
 		
 		if(err != KErrAbort)
 			{
@@ -104,12 +113,12 @@
 		
 		// Read all information about the request sent by the host
 		// i.e. any DATA1 packets sent after the setup DATA0 packet
-		RDebug::Printf("AFTER UPDATES");
-		RDebug::Printf("ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
-		RDebug::Printf("iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
+		OstTrace0(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP03, "AFTER UPDATES");
+		OstTraceExt5(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP04, "ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
+		OstTraceExt2(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP05, "iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
 		if(iDeviceToHost && iDataPhase)
 			{
-			RDebug::Printf("Issuing another read of %d bytes",iwLength);
+			OstTrace1(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP06, "Issuing another read of %d bytes",iwLength);
 			ReadL(iwLength);
 			}
 		else
@@ -124,6 +133,7 @@
 				}
 			}
 		}
+	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/controltransferrequests.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/controltransferrequests.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,10 @@
 
 #include "controltransferrequests.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "controltransferrequestsTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -28,162 +32,181 @@
 	iUsbInterface0(aInterface0),
 	iDataRequest(EFalse)
 	{
+	OstTraceFunctionEntryExt( CEP0TRANSFER_CEP0TRANSFER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CEP0TRANSFER_CEP0TRANSFER_EXIT, this );
 	}
 	
 	
 CEp0Transfer::~CEp0Transfer()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CEP0TRANSFER_CEP0TRANSFER_ENTRY_DUP01, this );
 	Cancel();
+	OstTraceFunctionExit1( CEP0TRANSFER_CEP0TRANSFER_EXIT_DUP01, this );
 	}
 	
 	
 void CEp0Transfer::DoCancel()
 	{
+	OstTraceFunctionEntry1( CEP0TRANSFER_DOCANCEL_ENTRY, this );
 	// Pretend cancel
 	TRequestStatus* s = &iStatus;
 	User::RequestComplete(s,KErrCancel);
+	OstTraceFunctionExit1( CEP0TRANSFER_DOCANCEL_EXIT, this );
 	}
 
 void CEp0Transfer::CancelSendRequest()
 	{
+	OstTraceFunctionEntry1( CEP0TRANSFER_CANCELSENDREQUEST_ENTRY, this );
 	// Pretend cancel
 	iUsbInterface0.CancelEP0Transfer();
+	OstTraceFunctionExit1( CEP0TRANSFER_CANCELSENDREQUEST_EXIT, this );
 	}
 
 
 void CEp0Transfer::SendRequest(TEmptyRequest& aSetupPacket,MCommandObserver* aObserver) 
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY, this );
 	iObserver = aObserver;	
 	
-	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
-	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
-	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
-	RDebug::Printf("total sent   : 8");
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP01, "bRequest     : 0x%02x",aSetupPacket.iRequest);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP02, "wValue       : 0x%04x",aSetupPacket.iValue);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP03, "wIndex       : 0x%04x",aSetupPacket.iIndex);
+	OstTrace0(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP04, "total sent   : 8");
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,KNullDesC8,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();	
+	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT, this );
 	}
 
 
 void CEp0Transfer::SendRequest(TDataSendRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP01, this );
 	iObserver = aObserver;
 	
-	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
-	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
-	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
-	RDebug::Printf("data length  : %d",aSetupPacket.iSendData.Length());
-	RDebug::Printf("total sent   : %d",8+aSetupPacket.iSendData.Length());
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP10, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP11, "bRequest     : 0x%02x",aSetupPacket.iRequest);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP12, "wValue       : 0x%04x",aSetupPacket.iValue);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP13, "wIndex       : 0x%04x",aSetupPacket.iIndex);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP14, "data length  : %d",aSetupPacket.iSendData.Length());
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP15, "total sent   : %d",8+aSetupPacket.iSendData.Length());
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,aSetupPacket.iSendData,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
+	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP01, this );
 	}
 	
 void CEp0Transfer::SendRequest(TWriteSynchronousCachedReadDataRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP02, this );
 	iObserver = aObserver;
 	
-	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
-	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
-	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
-	RDebug::Printf("total sent   : 8");
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP20, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP21, "bRequest     : 0x%02x",aSetupPacket.iRequest);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP22, "wValue       : 0x%04x",aSetupPacket.iValue);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP23, "wIndex       : 0x%04x",aSetupPacket.iIndex);
+	OstTrace0(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP24, "total sent   : 8");
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,KNullDesC8,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
+	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP02, this );
 	}
 
 
 void CEp0Transfer::SendRequest(TEndpointReadRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP03, this );
 	iObserver = aObserver;
 	
-	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
-	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
-	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
-	RDebug::Printf("data length  : %d",aSetupPacket.iReadSpecificationData.Length());
-	RDebug::Printf("total sent   : %d",8+aSetupPacket.iReadSpecificationData.Length());
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP30, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP31, "bRequest     : 0x%02x",aSetupPacket.iRequest);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP32, "wValue       : 0x%04x",aSetupPacket.iValue);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP33, "wIndex       : 0x%04x",aSetupPacket.iIndex);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP34, "data length  : %d",aSetupPacket.iReadSpecificationData.Length());
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP35, "total sent   : %d",8+aSetupPacket.iReadSpecificationData.Length());
 	TLex8 lex(aSetupPacket.iReadSpecificationData);
 	TUint numBytes = 0;
 	lex.Val(numBytes, EDecimal);
-	RDebug::Printf("Read length required (in bytes)   : %d",numBytes);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP06, "Read length required (in bytes)   : %d",numBytes);
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,aSetupPacket.iReadSpecificationData,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
+	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP03, this );
 	}
 	
 void CEp0Transfer::SendRequest(TClassDataSendRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP04, this );
 	iObserver = aObserver;
 	
-	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
-	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
-	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
-	RDebug::Printf("data length  : %d",aSetupPacket.iSendData.Length());
-	RDebug::Printf("total sent   : %d",8+aSetupPacket.iSendData.Length());
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP40, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP41, "bRequest     : 0x%02x",aSetupPacket.iRequest);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP42, "wValue       : 0x%04x",aSetupPacket.iValue);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP43, "wIndex       : 0x%04x",aSetupPacket.iIndex);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP44, "data length  : %d",aSetupPacket.iSendData.Length());
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP45, "total sent   : %d",8+aSetupPacket.iSendData.Length());
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,aSetupPacket.iSendData,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
+	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP04, this );
 	}
 	
 void CEp0Transfer::SendRequest(TDataRecvRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP05, this );
 	iObserver = aObserver;
 	
-	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
-	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
-	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
-	RDebug::Printf("data length  : %d",aSetupPacket.iRecvData.Length());
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP50, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP51, "bRequest     : 0x%02x",aSetupPacket.iRequest);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP52, "wValue       : 0x%04x",aSetupPacket.iValue);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP53, "wIndex       : 0x%04x",aSetupPacket.iIndex);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP54, "data length  : %d",aSetupPacket.iRecvData.Length());
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,KNullDesC8,aSetupPacket.iRecvData,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
+	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP05, this );
 	}
 
 
 void CEp0Transfer::RunL()
 	{
+	OstTraceFunctionEntry1( CEP0TRANSFER_RUNL_ENTRY, this );
 	iCompletionTime.HomeTime();
-	LOG_FUNC
 	TInt completionCode(iStatus.Int());
 	
-	RDebug::Printf("Client command sent, Completion code: %d",completionCode);
+	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_RUNL, "Client command sent, Completion code: %d",completionCode);
 	iObserver->Ep0TransferCompleteL(completionCode);
+	OstTraceFunctionExit1( CEP0TRANSFER_RUNL_EXIT, this );
 	}
 	
 	
 TInt CEp0Transfer::RunError(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CEP0TRANSFER_RUNERROR_ENTRY, this );
+	OstTraceFunctionExitExt( CEP0TRANSFER_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
 void CEp0Transfer::LastRequestStartTime( TTime& aDuration)
 	{
+	OstTraceFunctionEntryExt( CEP0TRANSFER_LASTREQUESTSTARTTIME_ENTRY, this );
 	aDuration= iRequestTime.Int64();
+	OstTraceFunctionExit1( CEP0TRANSFER_LASTREQUESTSTARTTIME_EXIT, this );
 	}
 
 void CEp0Transfer::LastRequestCompletionTime( TTime& aDuration)
 	{
+	OstTraceFunctionEntryExt( CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_ENTRY, this );
 	aDuration= iCompletionTime.Int64();
+	OstTraceFunctionExit1( CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_EXIT, this );
 	}
 	
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/endpointreader.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/endpointreader.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "endpointreader.h"
 #include "controltransferrequests.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "endpointreaderTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -31,38 +35,47 @@
 	iDataPtr(NULL,0),
 	iValidationPatternPtr(NULL,0)
 	{
+	OstTraceFunctionEntryExt( CENDPOINTREADER_CENDPOINTREADER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CENDPOINTREADER_CENDPOINTREADER_EXIT, this );
 	}
 	
 CEndpointReader::~CEndpointReader()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CENDPOINTREADER_CENDPOINTREADER_ENTRY_DUP01, this );
 	Cancel();
 	delete iDataBuffer;
 	iDataBuffer = NULL;
 	delete iValidationPatternBuffer;
 	iValidationPatternBuffer = NULL;
+	OstTraceFunctionExit1( CENDPOINTREADER_CENDPOINTREADER_EXIT_DUP01, this );
 	}
 			
 TPtr8 CEndpointReader::Buffer()
 	{
+	OstTraceFunctionEntry1( CENDPOINTREADER_BUFFER_ENTRY, this );
+	OstTraceFunctionExitExt( CENDPOINTREADER_BUFFER_EXIT, this, ( TUint )&( iDataPtr ) );
 	return iDataPtr;
 	}
 
 TBool CEndpointReader::IsValid()
 	{
+	OstTraceFunctionEntry1( CENDPOINTREADER_ISVALID_ENTRY, this );
+	OstTraceFunctionExitExt( CENDPOINTREADER_ISVALID_EXIT, this, iIsValid );
 	return iIsValid;
 	}
 
 TUint CEndpointReader::NumBytesReadSoFar()
 	{
+	OstTraceFunctionEntry1( CENDPOINTREADER_NUMBYTESREADSOFAR_ENTRY, this );
+	OstTraceFunctionExitExt( CENDPOINTREADER_NUMBYTESREADSOFAR_EXIT, this, iNumBytesReadSoFar );
 	return iNumBytesReadSoFar;
 	}
 
 void CEndpointReader::ReadPacketL(MEndpointDataHandler* aHandler)
 	{
-	LOG_FUNC
-	RDebug::Printf("Endpoint %d", iEndpoint);
+	OstTraceFunctionEntryExt( CENDPOINTREADER_READPACKETL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_READPACKETL, "Endpoint %d", iEndpoint);
 	
 	iHandler = aHandler;
 
@@ -79,13 +92,14 @@
 	// Read from the endpoint
 	iClientDriver.ReadPacket(iStatus,iEndpoint,iDataPtr,KFullSpeedPacketSize);
 	SetActive();
+	OstTraceFunctionExit1( CENDPOINTREADER_READPACKETL_EXIT, this );
 	}
 
 
 void CEndpointReader::ReadL(TInt aByteCount)
 	{
-	LOG_FUNC
-	RDebug::Printf("Endpoint %d", iEndpoint);
+	OstTraceFunctionEntryExt( CENDPOINTREADER_READL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_READL, "Endpoint %d", iEndpoint);
 	
 	// Allocate buffer for reading a data packet
 	if(iDataBuffer)
@@ -99,12 +113,13 @@
 	// Read from the endpoint
 	iClientDriver.Read(iStatus,iEndpoint,iDataPtr,aByteCount);
 	SetActive();
+	OstTraceFunctionExit1( CENDPOINTREADER_READL_EXIT, this );
 	}
 
 void CEndpointReader::ReadUntilShortL(TInt aByteCount)
 	{
-	LOG_FUNC
-	RDebug::Printf("Endpoint %d", iEndpoint);
+	OstTraceFunctionEntryExt( CENDPOINTREADER_READUNTILSHORTL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_READUNTILSHORTL, "Endpoint %d", iEndpoint);
 	
 	// Allocate buffer for reading a data packet
 	if(iDataBuffer)
@@ -118,18 +133,20 @@
 	// Read from the endpoint
 	iClientDriver.ReadUntilShort(iStatus,iEndpoint,iDataPtr,aByteCount);
 	SetActive();
+	OstTraceFunctionExit1( CENDPOINTREADER_READUNTILSHORTL_EXIT, this );
 	}
 
 void CEndpointReader::ReadAndHaltL(TInt aByteCount)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CENDPOINTREADER_READANDHALTL_ENTRY, this );
 	iCompletionAction = EHaltEndpoint;
 	ReadL(aByteCount);
+	OstTraceFunctionExit1( CENDPOINTREADER_READANDHALTL_EXIT, this );
 	}
 
 void CEndpointReader::RepeatedReadAndValidateL(const TDesC8& aDataPattern, TUint aNumBytesPerRead, TUint aTotalNumBytes)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CENDPOINTREADER_REPEATEDREADANDVALIDATEL_ENTRY, this );
 
 	iCompletionAction = ERepeatedRead;
 	iRepeatedReadTotalNumBytes = aTotalNumBytes;
@@ -137,7 +154,7 @@
 	iNumBytesReadSoFar = 0;
 	iDataPatternLength = aDataPattern.Length();
 	iIsValid = ETrue; //until proven guilty!
-	RDebug::Printf("Total Bytes To Read: %d, Bytes Per Individual Read: %d", iRepeatedReadTotalNumBytes, iRepeatedReadNumBytesPerRead);
+	OstTraceExt2(TRACE_NORMAL, CENDPOINTREADER_REPEATEDREADANDVALIDATEL, "Total Bytes To Read: %u, Bytes Per Individual Read: %u", iRepeatedReadTotalNumBytes, iRepeatedReadNumBytesPerRead);
 	//Create buffer to contain two lots of the payload pattern
 	//..so that we may grab cyclic chunks of said payload pattern
 	delete iValidationPatternBuffer;
@@ -151,36 +168,39 @@
 		}
 
 	ReadUntilShortL(iRepeatedReadNumBytesPerRead);
+	OstTraceFunctionExit1( CENDPOINTREADER_REPEATEDREADANDVALIDATEL_EXIT, this );
 	}
 
 
 TInt CEndpointReader::Acknowledge()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CENDPOINTREADER_ACKNOWLEDGE_ENTRY, this );
 	TInt err(iClientDriver.SendEp0StatusPacket());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Sending acknowledge packet",err);
+		OstTrace1(TRACE_NORMAL, CENDPOINTREADER_ACKNOWLEDGE, "<Error %d> Sending acknowledge packet",err);
 		}
+	OstTraceFunctionExitExt( CENDPOINTREADER_ACKNOWLEDGE_EXIT, this, err );
 	return err;
 	}
 			
 			
 void CEndpointReader::DoCancel()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CENDPOINTREADER_DOCANCEL_ENTRY, this );
 	
 	// Cancel reading from the endpoint
 	
 	iClientDriver.ReadCancel(iEndpoint);
+	OstTraceFunctionExit1( CENDPOINTREADER_DOCANCEL_EXIT, this );
 	}
 	
 	
 void CEndpointReader::RunL()
 	{
-	LOG_FUNC
-	RDebug::Printf("Endpoint %d", iEndpoint);
-	RDebug::Printf("Completion Action %d", iCompletionAction);
+	OstTraceFunctionEntry1( CENDPOINTREADER_RUNL_ENTRY, this );
+	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNL, "Endpoint %d", iEndpoint);
+	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP01, "Completion Action %d", iCompletionAction);
 	TCompletionAction completionAction = iCompletionAction;
 	iCompletionAction = ENone; //reset here in case of 'early' returns
 	
@@ -189,7 +209,7 @@
 	
 	if(completionCode != KErrNone)
 		{
-		RDebug::Printf("<Error> void CEndpointReader::RunL()completed with ERROR %d", completionCode);
+		OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP02, "<Error> void CEndpointReader::RunL()completed with ERROR %d", completionCode);
 		
 		// Nak the packet received
 		iClientDriver.HaltEndpoint(iEndpoint);
@@ -200,7 +220,7 @@
 			}
 		else
 			{
-			RDebug::Printf("No handler set");
+			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP03, "No handler set");
 			}
 		}
 	else
@@ -210,7 +230,7 @@
 		ent = ent==0?1:ent;
 		for(TInt i=0; i<iDataBuffer->Length(); i+=ent)
 			{
-			RDebug::Printf("byte %d %02x %c",i,(*iDataBuffer)[i],(*iDataBuffer)[i]);
+			OstTraceExt3(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP04, "byte %d %02x %c",i,(*iDataBuffer)[i],(*iDataBuffer)[i]);
 			}
 
 		if(iHandler)
@@ -219,18 +239,18 @@
 			}
 		else
 			{
-			RDebug::Printf("No handler set");
+			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP05, "No handler set");
 			}
 		
 		if(completionAction==EHaltEndpoint)
 			{
-			RDebug::Printf("Halting Endpoint");
+			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP06, "Halting Endpoint");
 			iClientDriver.HaltEndpoint(iEndpoint);
 			}
 
 		if(completionAction==ERepeatedRead)
 			{
-			RDebug::Printf("Repeated Read");
+			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP07, "Repeated Read");
 			iCompletionAction = ERepeatedRead;
 			
 			//Prepare to validate
@@ -240,16 +260,16 @@
 			TInt err = iDataPtr.Compare(valDesc);
 
 			iNumBytesReadSoFar += iDataPtr.Length();
-			RDebug::Printf("Bytes read so far %d, Total bytes to read %d", iNumBytesReadSoFar, iRepeatedReadTotalNumBytes);
+			OstTraceExt2(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP08, "Bytes read so far %u, Total bytes to read %u", iNumBytesReadSoFar, iRepeatedReadTotalNumBytes);
 
 			if(err!=0)
 				{
-				RDebug::Printf("Validation Result %d, Validation String Length %d, Bytes Actually Read %d", err, valDesc.Length(), iDataPtr.Length());
-				RDebug::Printf("Expected string, followed by read string");
-				RDebug::RawPrint(valDesc);
-				RDebug::Printf("\n");
-				RDebug::RawPrint(iDataPtr);
-				RDebug::Printf("\n");
+				OstTraceExt3(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP09, "Validation Result %d, Validation String Length %d, Bytes Actually Read %d", err, valDesc.Length(), iDataPtr.Length());
+				OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP10, "Expected string, followed by read string");
+                OstTraceData(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP50, "", valDesc.Ptr(), valDesc.Length());
+				OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP11, "\n");
+                OstTraceData(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP51, "", iDataPtr.Ptr(), iDataPtr.Length());
+				OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP12, "\n");
 				iIsValid = EFalse; //record validation error
 				}
 			
@@ -268,18 +288,20 @@
 				}
 			}
 		}
+	OstTraceFunctionExit1( CENDPOINTREADER_RUNL_EXIT, this );
 	}
 
 TInt CEndpointReader::RunError(TInt aError)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CENDPOINTREADER_RUNERROR_ENTRY, this );
 	
-	RDebug::Printf("<Leaving Error> void CEndpointReader::RunError()called with ERROR %d", aError);
+	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNERROR, "<Leaving Error> void CEndpointReader::RunError()called with ERROR %d", aError);
 
 	// Nak the packet received
 	iClientDriver.HaltEndpoint(iEndpoint);
 
 	aError = KErrNone;	
+	OstTraceFunctionExitExt( CENDPOINTREADER_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/endpointwriter.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/endpointwriter.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -13,7 +13,7 @@
 // Description:
 // @file endpointwriter.cpp
 // @internalComponent
-// 
+//
 //
 
 #include <e32base.h>
@@ -21,6 +21,10 @@
 #include <d32usbc.h>
 #include "endpointwriter.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "endpointwriterTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -33,48 +37,54 @@
 	iEndpoint(aEndpoint),
 	iBufPtr(NULL,0)
 	{
+	OstTraceFunctionEntryExt( CENDPOINTWRITER_CENDPOINTWRITER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CENDPOINTWRITER_CENDPOINTWRITER_EXIT, this );
 	}
-	
-					
+
+
 CEndpointWriter::~CEndpointWriter()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CENDPOINTWRITER_CENDPOINTWRITER_ENTRY_DUP01, this );
+
 	Cancel();
 	if(iBuffer)
 		{
-		RDebug::Printf("Freeing %d bytes", iBuffer->Size());
+		OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_DCENDPOINTWRITER, "Freeing %d bytes", iBuffer->Size());
 		}
 	delete iBuffer;
+	OstTraceFunctionExit1( CENDPOINTWRITER_CENDPOINTWRITER_EXIT_DUP01, this );
 	}
 
 
 void CEndpointWriter::DoCancel()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CENDPOINTWRITER_DOCANCEL_ENTRY, this );
+
 	// Cancel the write to the endpoint
-	
+
 	iClientDriver.WriteCancel(iEndpoint);
+	OstTraceFunctionExit1( CENDPOINTWRITER_DOCANCEL_EXIT, this );
 	}
-	
-	
+
+
 TUint CEndpointWriter::NumBytesWrittenSoFar()
 	{
+	OstTraceFunctionEntry1( CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_ENTRY, this );
+	OstTraceFunctionExitExt( CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_EXIT, this, iNumBytesWritten );
 	return iNumBytesWritten;
 	}
 
 void CEndpointWriter::RunL()
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntry1( CENDPOINTWRITER_RUNL_ENTRY, this );
+
 	TInt completionCode(iStatus.Int());
-	RDebug::Printf("Write completed, err=%d",completionCode);
-	
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_RUNL, "Write completed, err=%d",completionCode);
+
 	iNumBytesWritten += iNumBytesOnCurrentWrite; // all zero if not a repeated write
 	if(iNumBytesWritten < iTotalNumBytes)
-		//This conditional will not be entered for non-repeat cases because then 
+		//This conditional will not be entered for non-repeat cases because then
 		//'iNumBytesWritten' and 'iTotalNumBytes' will both be zero.
 		{
 		TUint totalNumBytesStillToWrite = iTotalNumBytes - iNumBytesWritten;
@@ -85,30 +95,30 @@
 		//Only add a ZLP, if requested and if the last 'Write'
 		TBool useUsb = totalNumBytesStillToWrite <= iNumBytesOnCurrentWrite ? iUseZLP : EFalse;
 		TPtrC8 writeDesc = iBufPtr.Mid(iNumBytesWritten%iDataPatternLength, iNumBytesOnCurrentWrite);
-		RDebug::Printf("Total Bytes To Write = %d, Bytes Still To Write = %d, Bytes Written = %d, Bytes on Current 'Write'", iTotalNumBytes, totalNumBytesStillToWrite, iNumBytesWritten, iNumBytesOnCurrentWrite);
-		 
-		RDebug::Printf("\n");
-		RDebug::Printf("First 256 bytes (or all) of data to write");
-		RDebug::RawPrint(writeDesc);
-		RDebug::Printf("\n");
-		
-		
+		OstTraceExt4(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP01, "Total Bytes To Write = %u, Bytes Still To Write = %u, Bytes Written = %d, Bytes on Current Write = %d", iTotalNumBytes, totalNumBytesStillToWrite, iNumBytesWritten, iNumBytesOnCurrentWrite);
+
+		OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP02, "\n");
+		OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP03, "First 256 bytes (or all) of data to write");
+		OstTraceData(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP53, "", writeDesc.Ptr(), writeDesc.Length());
+		OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP04, "\n");
+
+
 		Write(writeDesc, useUsb, EFalse);
 		}
 	else
 		{
 		if(iBuffer!=NULL)
 			{
-			RDebug::Printf("Freeing %d bytes", iBuffer->Size());
+			OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP05, "Freeing %d bytes", iBuffer->Size());
 			}
 		else
 			{
-			RDebug::Printf("iBuffer is NULL");
+			OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP06, "iBuffer is NULL");
 			}
 		if(iTotalNumBytes != 0)
 			//if a repeated write
 			{
-			RDebug::Printf("Total Bytes = %d, Bytes Written = %d", iTotalNumBytes, iNumBytesWritten);
+			OstTraceExt2(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP07, "Total Bytes = %u, Bytes Written = %u", iTotalNumBytes, iNumBytesWritten);
 			}
 		delete iBuffer;
 		iBuffer = 0;
@@ -118,33 +128,36 @@
 		iDataPatternLength = 0;
 		iUseZLP = EFalse;
 		}
+	OstTraceFunctionExit1( CENDPOINTWRITER_RUNL_EXIT, this );
 	}
 
 
 TInt CEndpointWriter::RunError(TInt aError)
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntryExt( CENDPOINTWRITER_RUNERROR_ENTRY, this );
+
 	aError = KErrNone;
+	OstTraceFunctionExitExt( CENDPOINTWRITER_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 
 
 void CEndpointWriter::Write(const TDesC8& aData, TBool aUseZLP, TBool aCreateBuffer)
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITE_ENTRY, this );
+
   	if(aCreateBuffer == EFalse)
   		{
-  		RDebug::Printf("Use ZLP %d", aUseZLP?1:0);
+  		OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITE, "Use ZLP %d", aUseZLP?1:0);
   		iClientDriver.Write(iStatus,iEndpoint,aData,aData.Length(),aUseZLP);
   		SetActive();
+ 		OstTraceFunctionExit1( CENDPOINTWRITER_WRITE_EXIT, this );
  		return;
   		}
 
-	
+
 	//Copy aData to this object's buffer
-	//'aData' will go out of scope before the USB driver 'Write' completes	
+	//'aData' will go out of scope before the USB driver 'Write' completes
 	delete iBuffer;
   	iBuffer = NULL;
 	iBuffer = HBufC8::NewL(aData.Length());
@@ -152,32 +165,33 @@
 	iBufPtr.Copy(aData);
 
 	// Write the data to the host through the endpoint (host opened pipe)
-	RDebug::Printf("Write Length = %d", iBufPtr.Length());
-	RDebug::RawPrint(iBufPtr);
-	RDebug::Printf("\n");
-	RDebug::Printf("Use ZLP %d", aUseZLP?1:0);
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP01, "Write Length = %d", iBufPtr.Length());
+	OstTraceData(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP51, "", iBufPtr.Ptr(), iBufPtr.Length());
+	OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP02, "\n");
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP03, "Use ZLP %d", aUseZLP?1:0);
 	iClientDriver.Write(iStatus,iEndpoint,iBufPtr,iBufPtr.Length(),aUseZLP);
 	SetActive();
+	OstTraceFunctionExit1( CENDPOINTWRITER_WRITE_EXIT_DUP01, this );
 	}
 
 TInt CEndpointWriter::WriteSynchronous(const TDesC8& aData, TBool aUseZLP)
 	{
-	LOG_FUNC
-	
+	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUS_ENTRY, this );
+
 	TRequestStatus status = KRequestPending;
-	RDebug::Printf("Write Length = %d", aData.Length());
-	RDebug::RawPrint(aData);
-	RDebug::Printf("\n");
-	RDebug::Printf("Use ZLP %d", aUseZLP?1:0);
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS, "Write Length = %d", aData.Length());
+	OstTraceData(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP50, "", aData.Ptr(), aData.Length());
+	OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP01, "\n");
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP02, "Use ZLP %d", aUseZLP?1:0);
 	iClientDriver.Write(status,iEndpoint,aData,aData.Length(),aUseZLP);
 	User::WaitForRequest(status);
-	RDebug::Printf("Write has completed with error %d", status.Int());
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP03, "Write has completed with error %d", status.Int());
 	return status.Int();
 	}
 
 void CEndpointWriter::WriteSynchronousUsingPatternL(const TDesC8& aData, const TUint aNumBytes, const TBool aUseZLP)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY, this );
 
 	TBool useZLP = EFalse; //only want this if you are making the last call to client Write (=WriteSynchronous)
 	if(aNumBytes <= aData.Length())
@@ -246,29 +260,33 @@
 		}
 	delete iBuffer;
 	iBuffer = 0;
+	OstTraceFunctionExit1( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT, this );
 	}
 
 void CEndpointWriter::WriteSynchronousUsingPatternL(const TDesC8& aData, const TUint aNumBytes)
 	{
+	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY_DUP01, this );
 	WriteSynchronousUsingPatternL(aData, aNumBytes, ETrue);
+	OstTraceFunctionExit1( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT_DUP01, this );
 	}
 
 void CEndpointWriter::WriteSynchronousUsingPatternAndHaltL(const TDesC8& aData, const TUint aNumBytes)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_ENTRY, this );
 	WriteSynchronousUsingPatternL(aData, aNumBytes, EFalse);
 	iClientDriver.HaltEndpoint(iEndpoint);
+	OstTraceFunctionExit1( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_EXIT, this );
 	}
 
 void CEndpointWriter::WriteUsingPatternL(const TDesC8& aData, const TUint aNumBytes, const TBool aUseZLP)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITEUSINGPATTERNL_ENTRY, this );
 
-	RDebug::Printf("Allocating %d bytes", aNumBytes);
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITEUSINGPATTERNL, "Allocating %d bytes", aNumBytes);
   	delete iBuffer;
   	iBuffer = NULL;
 	iBuffer = HBufC8::NewL(aNumBytes);
-	RDebug::Printf("Allocated %d bytes", aNumBytes);
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITEUSINGPATTERNL_DUP01, "Allocated %d bytes", aNumBytes);
 	iBufPtr.Set(iBuffer->Des());
 	iBufPtr.Zero();
 	TInt repeats = aNumBytes/aData.Length();
@@ -281,11 +299,12 @@
 		iBufPtr.Append(aData.Left(extraBytes));
 		}
 	Write(*iBuffer, aUseZLP, EFalse);
+	OstTraceFunctionExit1( CENDPOINTWRITER_WRITEUSINGPATTERNL_EXIT, this );
 	}
 
 void CEndpointWriter::WriteInPartsUsingPatternL(const TDesC8& aData, const TUint aNumBytesPerWrite, TUint aTotalNumBytes, const TBool aUseZLP)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_ENTRY, this );
 
 	iUseZLP = aUseZLP;
 	TInt repeats = aNumBytesPerWrite/aData.Length() + 1;
@@ -296,8 +315,9 @@
 	iNumBytesOnCurrentWrite = aNumBytesPerWrite;
 	iNumBytesWritten = 0;
 	Write(iBufPtr.Mid(iNumBytesWritten%iDataPatternLength, iNumBytesOnCurrentWrite), EFalse, EFalse); //this is not the first 'Write' so do not use a ZLP
-	RDebug::Printf("Write %d bytes",iNumBytesOnCurrentWrite);
-	RDebug::Printf("Total Bytes = %d, Data Pattern Length = %d", iTotalNumBytes, iDataPatternLength);
+	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL, "Write %d bytes",iNumBytesOnCurrentWrite);
+	OstTraceExt2(TRACE_NORMAL, CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_DUP01, "Total Bytes = %u, Data Pattern Length = %u", iTotalNumBytes, iDataPatternLength);
+	OstTraceFunctionExit1( CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_EXIT, this );
 	}
 
 void CEndpointWriter::CreateBigBuffer(const TDesC8& aData, const TUint aRepeats)
@@ -305,11 +325,12 @@
 Create a payload buffer a section of which can always be used for each cyclic 'Write'.
 */
 	{
+	OstTraceFunctionEntryExt( CENDPOINTWRITER_CREATEBIGBUFFER_ENTRY, this );
 	//We require a buffer containing a sufficient number of repeats of the data pattern
 	//to allow us simply to use a section of it for any individual 'Write' payload.
  	delete iBuffer;
  	iBuffer = NULL;
- 	RDebug::Printf("Data buffer is using %d repeats of string starting...\n\"%S\"", aRepeats, &aData);
+ 	OstTraceExt2(TRACE_NORMAL, CENDPOINTWRITER_CREATEBIGBUFFER, "Data buffer is using %u repeats of string starting...\n\"%s\"", aRepeats, aData);
  	iBuffer = HBufC8::NewL(aRepeats*aData.Length());
 	iBufPtr.Set(iBuffer->Des());
 	iBufPtr.Zero();
@@ -317,6 +338,7 @@
   		{
   		iBufPtr.Append(aData);
   		}
+	OstTraceFunctionExit1( CENDPOINTWRITER_CREATEBIGBUFFER_EXIT, this );
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/hostbulktransfers.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/hostbulktransfers.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,6 +17,10 @@
 //
 
 #include "hosttransfers.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "hostbulktransfersTraces.h"
+#endif
 #include <e32debug.h>
 
 namespace NUnitTesting_USBDI
@@ -27,60 +31,65 @@
 :	CBaseTransfer(aPipe,aInterface,aObserver,aTransferId),
 	iTransferDescriptor(aMaxTransferSize) // Allocate the buffer for bulk transfers
 	{
+    OstTraceFunctionEntryExt( CBULKTRANSFER_CBULKTRANSFER_ENTRY, this );
 
 	// Register the transfer descriptor with the interface
 	
 	TInt err(Interface().RegisterTransferDescriptor(iTransferDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to register transfer descriptor",err);
+		OstTrace1(TRACE_NORMAL, CBULKTRANSFER_CBULKTRANSFER, "<Error %d> Unable to register transfer descriptor",err);
 		}
+	OstTraceFunctionExit1( CBULKTRANSFER_CBULKTRANSFER_EXIT, this );
 	}
 	
 	
 CBulkTransfer::~CBulkTransfer()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CBULKTRANSFER_CBULKTRANSFER_ENTRY_DUP01, this );
 	
 	// Cancel the transfer
 
 	Cancel();
+	OstTraceFunctionExit1( CBULKTRANSFER_CBULKTRANSFER_EXIT_DUP01, this );
 	}
 	
 	
 TPtrC8 CBulkTransfer::DataPolled()
 	{
+	OstTraceFunctionEntry1( CBULKTRANSFER_DATAPOLLED_ENTRY, this );
 	return iTransferDescriptor.Buffer();
 	}
 
 
 void CBulkTransfer::TransferIn(TInt aExpectedDataSize)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFERIN_ENTRY, this );
 	
 	// Activate the asynchronous transfer 
 	
-	RDebug::Printf("Activating bulk in transfer");
+	OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFERIN, "Activating bulk in transfer");
 	iTransferDescriptor.SaveData(aExpectedDataSize);
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
+	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFERIN_EXIT, this );
 	}
 
 void CBulkTransfer::TransferOut(const TDesC8& aBulkData, TBool aUseZLPIfRequired)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFEROUT_ENTRY, this );
 
 	// Copy the data across
 	if(aBulkData.Length() > iTransferDescriptor.iMaxSize)
 		{
-		RDebug::Printf("Too much data in bulk transfer. This test suite will now PANIC!");
-		RDebug::Printf("Bytes requested %d, Max allowed %d", aBulkData.Length(), iTransferDescriptor.iMaxSize);
+		OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT, "Too much data in bulk transfer. This test suite will now PANIC!");
+		OstTraceExt2(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP01, "Bytes requested %d, Max allowed %d", aBulkData.Length(), iTransferDescriptor.iMaxSize);
 		ASSERT(EFalse);
 		}
 		
 	TPtr8 buffer = iTransferDescriptor.WritableBuffer();
 	buffer.Copy(aBulkData);
-	RDebug::Printf("Transfer buffer now has %d bytes to write",buffer.Length());
+	OstTrace1(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP02, "Transfer buffer now has %d bytes to write",buffer.Length());
 	iTransferDescriptor.SaveData(buffer.Length());
 	if(aUseZLPIfRequired)
 		{
@@ -93,33 +102,35 @@
 	
 	// Activate the asynchronous transfer 
 	
-	RDebug::Printf("Activating bulk out transfer");
+	OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP03, "Activating bulk out transfer");
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
+	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFEROUT_EXIT, this );
 	}
 
 void CBulkTransfer::TransferOut(const TDesC8& aBulkDataPattern, TUint aNumBytes, TBool aUseZLPIfRequired)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP01, this );
 	
 	TransferOut(aBulkDataPattern, 0, aNumBytes, aUseZLPIfRequired);
+	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFEROUT_EXIT_DUP01, this );
 	}
 
 
 void CBulkTransfer::TransferOut(const TDesC8& aBulkDataPattern, TUint aStartPoint, TUint aNumBytes, TBool aUseZLPIfRequired)
 	{
-	LOG_FUNC
+    OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP02, this );
 
 	// Copy the data across
 	if(aNumBytes > iTransferDescriptor.iMaxSize)
 		{
-		RDebug::Printf("Too much data in bulk transfer. This test suite will now PANIC!");
-		RDebug::Printf("Bytes requested %d, Max allowed %d", aNumBytes, iTransferDescriptor.iMaxSize);
+		OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP10, "Too much data in bulk transfer. This test suite will now PANIC!");
+		OstTraceExt2(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP11, "Bytes requested %d, Max allowed %d", aNumBytes, iTransferDescriptor.iMaxSize);
 		ASSERT(EFalse);
 		}
 	if(aBulkDataPattern.Length()<=0)
 		{
-		RDebug::Printf("ZERO LENGTH data pattern used in TransferOut. This test suite will now PANIC!");
+		OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP12, "ZERO LENGTH data pattern used in TransferOut. This test suite will now PANIC!");
 		ASSERT(EFalse);
 		}
 	TUint startPoint = aStartPoint%aBulkDataPattern.Length();
@@ -140,7 +151,7 @@
 		{
 		buffer.Append(aBulkDataPattern.Left(numEndBytes));
 		}
-	RDebug::Printf("Transfer buffer now has %d bytes to write",buffer.Length());
+	OstTrace1(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP13, "Transfer buffer now has %d bytes to write",buffer.Length());
 	iTransferDescriptor.SaveData(buffer.Length());	
 	if(aUseZLPIfRequired)
 		{
@@ -153,9 +164,10 @@
 	
 	// Activate the asynchronous transfer 
 	
-	RDebug::Printf("Activating bulk out transfer");
+	OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP14, "Activating bulk out transfer");
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
+	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFEROUT_EXIT_DUP02, this );
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/hostinterrupttransfers.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/hostinterrupttransfers.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,10 @@
 
 #include "hosttransfers.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "hostinterrupttransfersTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -27,47 +31,53 @@
 :	CBaseTransfer(aPipe,aInterface,aObserver,aTransferId),
 	iTransferDescriptor(aMaxTransferSize) // Allocate the buffer for interrupt transfers
 	{
+    OstTraceFunctionEntryExt( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY, this );
 
+	OstTraceFunctionExit1( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT, this );
 	}
 	
 CInterruptTransfer::~CInterruptTransfer()
 	{
-	LOG_FUNC 
+	OstTraceFunctionEntry1( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY_DUP01, this );
 	
 	// Cancel the transfer
 
 	Cancel();
+	OstTraceFunctionExit1( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT_DUP01, this );
 	}
 	
 	
 TPtrC8 CInterruptTransfer::DataPolled()
 	{
+	OstTraceFunctionEntry1( CINTERRUPTTRANSFER_DATAPOLLED_ENTRY, this );
 	return iTransferDescriptor.Buffer();
 	}
 	
 	
 TInt CInterruptTransfer::TransferInL(TInt aSize)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CINTERRUPTTRANSFER_TRANSFERINL_ENTRY, this );
 	
 	// Activate the asynchronous transfer 	
-	RDebug::Printf("Activating interrupt in transfer");
+	OstTrace0(TRACE_NORMAL, CINTERRUPTTRANSFER_TRANSFERINL, "Activating interrupt in transfer");
 	iTransferDescriptor.SaveData(aSize);
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
+	OstTraceFunctionExitExt( CINTERRUPTTRANSFER_TRANSFERINL_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
 TInt CInterruptTransfer::RegisterTransferDescriptor()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY, this );
 	
 	// Register the transfer descriptor with the interface	
 	TInt err(Interface().RegisterTransferDescriptor(iTransferDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to register transfer descriptor",err);
+		OstTrace1(TRACE_NORMAL, CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR, "<Error %d> Unable to register transfer descriptor",err);
 		}
+	OstTraceFunctionExitExt( CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT, this, err );
 	return err;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,6 +17,10 @@
 //
 
 #include "hosttransfers.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "hostisochronoustransfersTraces.h"
+#endif
 #include <e32debug.h>
 #include <e32test.h>
 
@@ -31,21 +35,24 @@
 	iTransferDescriptor(aMaxPacketSize,aMaxNumPackets),
 	iMaxPacketSize(aMaxPacketSize)
 	{
-	RDebug::Printf("aMaxPacketSize = %d, aMaxNumPackets = %d",aMaxPacketSize, aMaxNumPackets);
+	OstTraceFunctionEntryExt( CISOCHTRANSFER_CISOCHTRANSFER_ENTRY, this );
+	OstTraceExt2(TRACE_NORMAL, CISOCHTRANSFER_CISOCHTRANSFER, "aMaxPacketSize = %d, aMaxNumPackets = %d",aMaxPacketSize, aMaxNumPackets);
+	OstTraceFunctionExit1( CISOCHTRANSFER_CISOCHTRANSFER_EXIT, this );
 	}
 	
 CIsochTransfer::~CIsochTransfer()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CISOCHTRANSFER_CISOCHTRANSFER_ENTRY_DUP01, this );
 	
 	// Cancel the transfer
 
 	Cancel();
+	OstTraceFunctionExit1( CISOCHTRANSFER_CISOCHTRANSFER_EXIT_DUP01, this );
 	}	
 	
 TBool CIsochTransfer::DataPolled(TUint aPacketsToBeRead, RBuf8& aDataPolled) 
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CISOCHTRANSFER_DATAPOLLED_ENTRY, this );
 	TInt numOfPacketsReturned = 0;	
 	
 	TInt firstPacketIndex = 0;
@@ -57,26 +64,27 @@
 		
 	do {						
 		TPtrC8 ptrRet = iTransferDescriptor.Packets(firstPacketIndex, packetsToBeRead, numOfPacketsReturned); 
-		RDebug::Printf("numOfPacketsReturned = %d", numOfPacketsReturned);
-		RDebug::Printf("ptrRet.Length() = %d", ptrRet.Length());
+		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED, "numOfPacketsReturned = %d", numOfPacketsReturned);
+		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP01, "ptrRet.Length() = %d", ptrRet.Length());
 		firstPacketIndex = numOfPacketsReturned;
 		totalPacketsRead += numOfPacketsReturned;
 		packetsToBeRead = packetsToBeRead - numOfPacketsReturned;
-		RDebug::Printf("totalPacketsRead = %d", totalPacketsRead);	
-		RDebug::Printf("packetsToBeRead = %d", packetsToBeRead);	
+		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP02, "totalPacketsRead = %d", totalPacketsRead);	
+		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP03, "packetsToBeRead = %d", packetsToBeRead);	
 		aDataPolled.Append(ptrRet);		
 		}	while(totalPacketsRead != aPacketsToBeRead); 	
 		
+	OstTraceFunctionExitExt( CISOCHTRANSFER_DATAPOLLED_EXIT, this, ETrue );
 	return ETrue; 
 	}
 	
 	
 TInt CIsochTransfer::TransferInL(TInt aPacketsExpected)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CISOCHTRANSFER_TRANSFERINL_ENTRY, this );
 	
 	// Activate the asynchronous transfer 	
-	RDebug::Printf("Activating isoch. in transfer");
+	OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_TRANSFERINL, "Activating isoch. in transfer");
 	
 	iTransferDescriptor.Reset();
 	TPacketLengths fullLengths = iTransferDescriptor.Lengths();
@@ -86,36 +94,38 @@
 		fullLengths[packet] = iMaxPacketSize;
 		}	
 
-	RDebug::Printf("fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
+	OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_TRANSFERINL_DUP01, "fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
 	iTransferDescriptor.ReceivePackets(aPacketsExpected);
 		
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
+	OstTraceFunctionExitExt( CISOCHTRANSFER_TRANSFERINL_EXIT, this, KErrNone );
 	return KErrNone;																
 	}
 		
 TInt CIsochTransfer::RegisterTransferDescriptor()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY, this );
 	
 	// Register the transfer descriptor with the interface	
 	TInt err(Interface().RegisterTransferDescriptor(iTransferDescriptor));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to register transfer descriptor",err);
+		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR, "<Error %d> Unable to register transfer descriptor",err);
 		}
+	OstTraceFunctionExitExt( CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT, this, err );
 	return err;	
 	}
 	
 TInt CIsochTransfer::PrepareTransfer(const TDesC8& aIsochData)
 	{
-	LOG_FUNC
+OstTraceFunctionEntryExt( CISOCHTRANSFER_PREPARETRANSFER_ENTRY, this );
 
 	//	
 	iTransferDescriptor.Reset();
 	TPacketLengths fullLengths = iTransferDescriptor.Lengths();
 
-	RDebug::Printf("fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
+	OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER, "fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
 	
 	//	
 	TInt bytesRemaining(aIsochData.Size());
@@ -123,7 +133,7 @@
 	TInt startOffset(0);
 	TInt startPacket(0); 
 	
-	RDebug::Printf("Audio data is %d bytes",bytesRemaining);
+	OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER_DUP01, "Audio data is %d bytes",bytesRemaining);
 	
 	// Keep saving the isoch data to transfer in each packet buffer supplied 
 	// by the transfer descriptor
@@ -136,7 +146,7 @@
 		
 		if(dataToWrite == 0)
 			{
-			RDebug::Printf("<Warning> dropping the rest of the isoch data");
+			OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER_DUP02, "<Warning> dropping the rest of the isoch data");
 			break;
 			}
 		
@@ -157,15 +167,18 @@
 		startOffset += maxPacket * iMaxPacketSize;
 		startPacket += maxPacket;
 		}	
+	OstTraceFunctionExitExt( CISOCHTRANSFER_PREPARETRANSFER_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
 TInt CIsochTransfer::TransferOut()
 	{	
+	OstTraceFunctionEntry1( CISOCHTRANSFER_TRANSFEROUT_ENTRY, this );
 	// Transfer the iscohronous data	
-	RDebug::Printf("Activating isochronous out transfer");
+	OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_TRANSFEROUT, "Activating isochronous out transfer");
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
+	OstTraceFunctionExitExt( CISOCHTRANSFER_TRANSFEROUT_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/main.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/main.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,6 +22,10 @@
 
 #include "testdebug.h"
 #include "TestEngine.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "mainTraces.h"
+#endif
 
 using namespace NUnitTesting_USBDI;
 
@@ -31,7 +35,7 @@
 
 static void MainL()
 	{
-	LOG_CFUNC
+	OstTraceFunctionEntry0( _MAINL_ENTRY );
 	// Leave the hooks in for platform security
 #ifdef __DATA_CAGING__
 	RProcess().DataCaging(RProcess::EDataCagingOn);
@@ -60,7 +64,7 @@
 		RProcess::Rendezvous(KErrNone);
 
         User::After(150000);
-		RDebug::Print(_L("CActiveScheduler::Start MainL"));	
+		OstTrace0(TRACE_NORMAL, MAINL_MAINL, "CActiveScheduler::Start MainL");	
 		CActiveScheduler::Start();
 		
 		CleanupStack::PopAndDestroy(testEngine);
@@ -68,20 +72,23 @@
 	else
 		{
 		gtest.Printf(_L("Unable to create the test engine: %d\n"),err);
+		OstTrace1(TRACE_NORMAL, MAINL_MAINL_DUP01, "Unable to create the test engine: %d\n",err);
 		}
 		
 	User::After(5000000);
 	CleanupStack::PopAndDestroy(sched);		
+	OstTraceFunctionExit0( _MAINL_EXIT );
 	}
 
 TInt E32Main()
 	{
-	LOG_CFUNC
+	OstTraceFunctionEntry0( _E32MAIN_ENTRY );
 	// Create the new trap-cleanup mechanism
 	CTrapCleanup* cleanup = CTrapCleanup::New();
 	
 	if(cleanup == NULL)
 		{
+		OstTraceFunctionExit0( _E32MAIN_EXIT );
 		return KErrNoMemory;
 		}
 		
@@ -90,11 +97,13 @@
 	if(err != KErrNone)
 		{
 		gtest.Printf(_L("MainL error: %d\n"),err);		
+		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN, "MainL error: %d\n",err);		
 		}
 	
 	delete cleanup;
 	
 	// Provide no error
+	OstTraceFunctionExit0( _E32MAIN_EXIT_DUP01 );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceA.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceA.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,12 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testdeviceATraces.h"
+#endif
+
+
 
 
 namespace NUnitTesting_USBDI
@@ -26,23 +32,26 @@
 	
 RUsbDeviceA::RUsbDeviceA()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBDEVICEA_RUSBDEVICEA_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEA_RUSBDEVICEA_EXIT, this );
 	}
 	
 RUsbDeviceA::RUsbDeviceA(CBaseTestCase* aTestCase):RUsbDeviceVendor(aTestCase)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP01, this );
 	}
 	
 RUsbDeviceA::~RUsbDeviceA()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP02, this );
+	OstTraceFunctionExit1( RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP02, this );
 	}
 	
 
 void RUsbDeviceA::OpenL(const TDesC16& aSerialNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEA_OPENL_ENTRY, this );
 	
 	RUsbDeviceVendor::OpenL(aSerialNumber);
 	
@@ -89,12 +98,14 @@
 	
 	AddInterface(interface1);
 	CleanupStack::Pop(interface1);
+	OstTraceFunctionExit1( RUSBDEVICEA_OPENL_EXIT, this );
 	}
 
 	
 void RUsbDeviceA::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEA_ONSTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEA_ONSTATECHANGEL_EXIT, this );
 	}	
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceC.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceC.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,11 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testdeviceCTraces.h"
+#endif
+
 
 
 namespace NUnitTesting_USBDI
@@ -27,23 +32,26 @@
 
 RUsbDeviceC::RUsbDeviceC()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( RUSBDEVICEC_RUSBDEVICEC_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEC_RUSBDEVICEC_EXIT, this );
 	}
 	
 RUsbDeviceC::RUsbDeviceC(CBaseTestCase* aTestCase):RUsbDeviceVendor(aTestCase)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP01, this );
 	}
 	
 RUsbDeviceC::~RUsbDeviceC()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP02, this );
+	OstTraceFunctionExit1( RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP02, this );
 	}
 	
 
 void RUsbDeviceC::OpenL(const TDesC16& aSerialNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEC_OPENL_ENTRY, this );
 	
 	RUsbDeviceVendor::OpenL(aSerialNumber);
 	
@@ -104,12 +112,14 @@
 	
 	AddInterface(interface1);
 	CleanupStack::Pop(interface1);
+	OstTraceFunctionExit1( RUSBDEVICEC_OPENL_EXIT, this );
 	}
 
 	
 void RUsbDeviceC::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEC_ONSTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEC_ONSTATECHANGEL_EXIT, this );
 	}	
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceD.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceD.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,12 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testdeviceDTraces.h"
+#endif
+
+
 
 
 namespace NUnitTesting_USBDI
@@ -26,23 +32,26 @@
 	
 RUsbDeviceD::RUsbDeviceD()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( RUSBDEVICED_RUSBDEVICED_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICED_RUSBDEVICED_EXIT, this );
 	}
 	
 RUsbDeviceD::RUsbDeviceD(CBaseTestCase* aTestCase):RUsbDeviceVendor(aTestCase)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICED_RUSBDEVICED_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( RUSBDEVICED_RUSBDEVICED_EXIT_DUP01, this );
 	}
 	
 RUsbDeviceD::~RUsbDeviceD()
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntry1( RUSBDEVICED_RUSBDEVICED_ENTRY_DUP02, this );
+	OstTraceFunctionExit1( RUSBDEVICED_RUSBDEVICED_EXIT_DUP02, this );
 	}
 	
 
 void RUsbDeviceD::OpenL(const TDesC16& aSerialNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICED_OPENL_ENTRY, this );
 	
 	RUsbDeviceVendor::OpenL(aSerialNumber);
 	
@@ -120,12 +129,14 @@
 	
 	AddInterface(interface2);
 	CleanupStack::Pop(interface2);
+	OstTraceFunctionExit1( RUSBDEVICED_OPENL_EXIT, this );
 	}
 
 	
 void RUsbDeviceD::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICED_ONSTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICED_ONSTATECHANGEL_EXIT, this );
 	}	
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceb.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceb.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "modelleddevices.h"
 #include "testinterfacesettingbase.h"
 #include "testinterfacebase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testdevicebTraces.h"
+#endif
 #include <e32test.h>
 
 namespace NUnitTesting_USBDI
@@ -26,21 +30,26 @@
 
 RUsbDeviceB::RUsbDeviceB()
 	{
+	OstTraceFunctionEntry1( RUSBDEVICEB_RUSBDEVICEB_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEB_RUSBDEVICEB_EXIT, this );
 	}
 	
 RUsbDeviceB::RUsbDeviceB(CBaseTestCase* aTestCase):RUsbTestDevice(aTestCase)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP01, this );
 	}
 
 RUsbDeviceB::~RUsbDeviceB()
 	{
+	OstTraceFunctionEntry1( RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP02, this );
+	OstTraceFunctionExit1( RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP02, this );
 	}
 
 
 void RUsbDeviceB::OpenL(const TDesC& aSerialNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEB_OPENL_ENTRY, this );
 	
 	RUsbTestDevice::OpenL();
 	
@@ -78,7 +87,7 @@
 	TInt err(iClientDriver.SetInterface(0,interfaceSetting));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set interface setting 0",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL, "<Error %d> Unable to set interface setting 0",err);
 		User::Leave(err);
 		}
 		
@@ -89,7 +98,7 @@
 	err = iClientDriver.SetCSInterfaceDescriptorBlock(0,cs_interfaceDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific interface setting 0 descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP01, "<Error %d> Unable to set class-specific interface setting 0 descriptor",err);
 		User::Leave(err);
 		}
 
@@ -98,21 +107,21 @@
 	err = iClientDriver.SetCSEndpointDescriptorBlock(0,1,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 0",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP02, "<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 0",err);
 		User::Leave(err);
 		}
 			
 	err = iClientDriver.SetCSEndpointDescriptorBlock(0,2,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 0",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP03, "<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 0",err);
 		User::Leave(err);
 		}	
 		
 	err = iClientDriver.SetCSEndpointDescriptorBlock(0,3,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 0",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP04, "<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 0",err);
 		User::Leave(err);
 		}
 	
@@ -121,7 +130,7 @@
 	err = iClientDriver.SetInterface(1,interfaceSetting);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set interface setting 1",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP05, "<Error %d> Unable to set interface setting 1",err);
 		User::Leave(err);
 		}
 	
@@ -132,7 +141,7 @@
 	err = iClientDriver.SetCSInterfaceDescriptorBlock(1,cs_interfaceDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific interface setting 1 descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP06, "<Error %d> Unable to set class-specific interface setting 1 descriptor",err);
 		User::Leave(err);
 		}
 
@@ -141,21 +150,21 @@
 	err = iClientDriver.SetCSEndpointDescriptorBlock(1,1,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 1",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP07, "<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 1",err);
 		User::Leave(err);
 		}
 	
 	err = iClientDriver.SetCSEndpointDescriptorBlock(1,2,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 1",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP08, "<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 1",err);
 		User::Leave(err);
 		}
 		
 	err = iClientDriver.SetCSEndpointDescriptorBlock(1,3,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 1",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP09, "<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 1",err);
 		User::Leave(err);
 		}
 
@@ -164,7 +173,7 @@
 	err = iClientDriver.SetInterface(2,interfaceSetting);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set interface setting 2",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP10, "<Error %d> Unable to set interface setting 2",err);
 		User::Leave(err);
 		}
 
@@ -175,7 +184,7 @@
 	err = iClientDriver.SetCSInterfaceDescriptorBlock(2,cs_interfaceDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific interface setting 2 descriptor",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP11, "<Error %d> Unable to set class-specific interface setting 2 descriptor",err);
 		User::Leave(err);
 		}
 
@@ -184,29 +193,31 @@
 	err = iClientDriver.SetCSEndpointDescriptorBlock(2,1,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 2",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP12, "<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 2",err);
 		User::Leave(err);
 		}
 	
 	err = iClientDriver.SetCSEndpointDescriptorBlock(2,2,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 2",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP13, "<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 2",err);
 		User::Leave(err);
 		}
 		
 	err = iClientDriver.SetCSEndpointDescriptorBlock(2,3,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 2",err);
+		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP14, "<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 2",err);
 		User::Leave(err);
 		}
+	OstTraceFunctionExit1( RUSBDEVICEB_OPENL_EXIT, this );
 	}
 
 
 void RUsbDeviceB::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEB_ONSTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEB_ONSTATECHANGEL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testinterfacesettingbase.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testinterfacesettingbase.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "testinterfacesettingbase.h"
 #include "testinterfacebase.h"
 #include "controltransferrequests.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "testinterfacesettingbaseTraces.h"
+#endif
  
  
 namespace NUnitTesting_USBDI
@@ -29,43 +33,51 @@
 	iIdRelEndpoint(EndpointIdentityRelationship),
 	iEndpoints(iHashEndpointFunction,iIdRelEndpoint)
 	{	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY, this );
 	// Set the name of this interface setting
 	iSettingString.Copy(aString);
 	iInterfaceInfo().iString = &iSettingString;
 	
 	// Zero count the number of endpoints used for this setting
 	iInterfaceInfo().iTotalEndpointsUsed = 0;
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT, this );
 	}
 
 	
 CInterfaceSettingBase::~CInterfaceSettingBase()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY_DUP01, this );
 	
 	iEndpointReaders.ResetAndDestroy();
 	iEndpointWriters.ResetAndDestroy();
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT_DUP01, this );
 	}
 	
 
 const TDesC& CInterfaceSettingBase::Name() const
 	{
+	OstTraceFunctionEntry1( CINTERFACESETTINGBASE_NAME_ENTRY, this );
+	OstTraceFunctionExitExt( CINTERFACESETTINGBASE_NAME_EXIT, this, ( TUint )&( iSettingString ) );
 	return iSettingString;
 	}
 
 
 void CInterfaceSettingBase::SetClassCodeL(TUint8 aClassCode,TUint8 aSubClassCode,TUint8 aDeviceProtocol)
 	{
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_SETCLASSCODEL_ENTRY, this );
 	// Set class specific information
 	iInterfaceInfo().iClass = TUsbcClassInfo(aClassCode,aSubClassCode,aDeviceProtocol);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_SETCLASSCODEL_EXIT, this );
 	}
 
 
 TInt CInterfaceSettingBase::AddEndpoint(TEndpoint& aEndpoint)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_ADDENDPOINT_ENTRY, this );
 	
 	if(aEndpoint.iEndpointNumber == EEndpoint0)
 		{
+		OstTraceFunctionExitExt( CINTERFACESETTINGBASE_ADDENDPOINT_EXIT, this, KErrInUse );
 		return KErrInUse;
 		}
 	
@@ -78,10 +90,12 @@
 		// Update the total endpoints used on this interface
 		iInterfaceInfo().iTotalEndpointsUsed = iEndpoints.Count();
 		
+		OstTraceFunctionExitExt( CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP01, this, KErrNone );
 		return KErrNone;
 		}
 	else
 		{
+		OstTraceFunctionExitExt( CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP02, this, KErrOverflow );
 		return KErrOverflow;
 		}
 	}
@@ -89,93 +103,103 @@
 
 void CInterfaceSettingBase::CreateEndpointReaderL(RDevUsbcClient& aClientDriver,TUint aEndpoint)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_ENTRY, this );
 	// Create the reader for this endpoint and store in the container	
 	CEndpointReader* epReader = new (ELeave) CEndpointReader(aClientDriver,
 	iEndpoints.Find(static_cast<TEndpointNumber>(aEndpoint))->iEndpointNumber);
 	CleanupStack::PushL(epReader);
 	iEndpointReaders.AppendL(epReader);
 	CleanupStack::Pop(epReader);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_EXIT, this );
 	}
 
 
 void CInterfaceSettingBase::CreateEndpointWriterL(RDevUsbcClient& aClientDriver,TUint aEndpoint)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_ENTRY, this );
 	// Create the writer for this endpoint and store in the container	
 	CEndpointWriter* epWriter = new (ELeave) CEndpointWriter(aClientDriver,
 	iEndpoints.Find(static_cast<TEndpointNumber>(aEndpoint))->iEndpointNumber);
 	CleanupStack::PushL(epWriter);
 	iEndpointWriters.AppendL(epWriter);
 	CleanupStack::Pop(epWriter);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSpecifiedDataToEndpointL(const TDesC8& aData,TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY, this );
 	// Access the correct writer for the given endpoint
 	// and write the data to the host			
 	iEndpointWriters[aEndpointNumber-1]->Write(aData, ETrue);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSpecifiedDataToEndpointL(const TDesC8& aDataPattern, const TUint aNumBytes, TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY_DUP01, this );
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteUsingPatternL(aDataPattern,aNumBytes,ETrue);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT_DUP01, this );
 	}
 
 void CInterfaceSettingBase::RepeatedWriteSpecifiedDataToEndpointL(const TDesC8& aDataPattern, TUint aNumBytesPerWrite, TUint aTotalNumBytes, TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_ENTRY, this );
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteInPartsUsingPatternL(aDataPattern,aNumBytesPerWrite,aTotalNumBytes,ETrue);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteCachedEndpointDataToEndpointL(const TUint16 aReadEndpointNumber,TUint16 aWriteEndpointNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_ENTRY, this );
 	
 	iEndpointWriters[aWriteEndpointNumber-1]->Write(iEndpointReaders[aReadEndpointNumber-1]->Buffer(), ETrue);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::CancelWriteDataToEndpointL(TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_ENTRY, this );
 	// Access the correct writer for the given endpoint
 	// and cancel any outstanding write. This will not of course work for 'synchronous' writes.			
 	iEndpointWriters[aEndpointNumber-1]->Cancel();
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousSpecifiedDataToEndpointL(const TDesC8& aDataPattern, const TUint aNumBytes, TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_ENTRY, this );
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteSynchronousUsingPatternL(aDataPattern,aNumBytes,ETrue);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousSpecifiedDataToAndHaltEndpointL(const TDesC8& aDataPattern, const TUint aNumBytes, TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_ENTRY, this );
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteSynchronousUsingPatternAndHaltL(aDataPattern,aNumBytes);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousCachedEndpointDataToEndpointL(const TUint16 aReadEndpointNumber,TUint16 aWriteEndpointNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY, this );
 	
 	//Attempt to write the complete cached buffer by starting at zero and choosing the max length posible
 	WriteSynchronousCachedEndpointDataToEndpointL(aReadEndpointNumber, aWriteEndpointNumber, 0, KMaxTInt);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousCachedEndpointDataToEndpointL(const TUint16 aReadEndpointNumber,TUint16 aWriteEndpointNumber, TUint aStartPoint, TUint aLength)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY_DUP01, this );
 	// Access the correct writer for the given endpoint
 	// Access the 'source' endpoint buffer. This contains data from that endpoint's last read.
 	// Write this data to the host using 'write' endpoint.
@@ -193,11 +217,12 @@
 	// Do the 'Write'
 	// Note we need a synchronous 'Write' here
 	iEndpointWriters[aWriteEndpointNumber-1]->WriteSynchronous(iEndpointReaders[aReadEndpointNumber-1]->Buffer().Mid(aStartPoint, aLength), ETrue);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT_DUP01, this );
 	}
 
 TBool CInterfaceSettingBase::CachedEndpointResultL(const TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CACHEDENDPOINTRESULTL_ENTRY, this );
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -206,7 +231,7 @@
 
 TInt CInterfaceSettingBase::NumBytesReadSoFarL(const TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_NUMBYTESREADSOFARL_ENTRY, this );
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -215,7 +240,7 @@
 
 TInt CInterfaceSettingBase::NumBytesWrittenSoFarL(const TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_NUMBYTESWRITTENSOFARL_ENTRY, this );
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -224,7 +249,7 @@
 
 TBool CInterfaceSettingBase::ValidateCachedEndpointDataL(const TDesC8& aDataPattern, const TUint aNumBytes, const TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY, this );
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -233,7 +258,7 @@
 
 TBool CInterfaceSettingBase::ValidateCachedEndpointDataL(const TDesC8& aDataPattern, const TUint aStartPoint, const TUint aNumBytes, const TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY_DUP01, this );
 	__ASSERT_DEBUG(aDataPattern.Length()!=0, User::Panic(_L("Trying to validate with ZERO LENGTH STRING"), KErrArgument));
 
 	//Check data in endpoint buffer
@@ -250,14 +275,17 @@
 		{
 		if(dataToValidate.Left(numStartBytes).Compare(aDataPattern.Mid(startPoint, numStartBytes)) != 0)
 			{
-			RDebug::Printf("ROUND TRIP VALIDATION: Start Bytes Match Failure");
-			RDebug::Printf("ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
-			RDebug::Printf("Start of sent data ...");
-			RDebug::RawPrint(aDataPattern.Mid(startPoint, numStartBytes));
-			RDebug::Printf("\n");
-			RDebug::Printf("ROUND TRIP VALIDATION: Start of returned data ...");				
-			RDebug::RawPrint(dataToValidate.Left(numStartBytes));
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL, "ROUND TRIP VALIDATION: Start Bytes Match Failure");
+			OstTrace1(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP01, "ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP02, "Start of sent data ...");
+            const TPtrC8& midDataPattern = aDataPattern.Mid(startPoint, numStartBytes);
+            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP52, "", midDataPattern.Ptr(), midDataPattern.Length());
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP03, "\n");
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP04, "ROUND TRIP VALIDATION: Start of returned data ...");
+            const TPtrC8& leftDataToValidate = dataToValidate.Left(numStartBytes);
+            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP54, "", leftDataToValidate.Ptr(), leftDataToValidate.Length());
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP05, "\n");
+			OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT, this, EFalse );
 			return EFalse;
 			}
 		}
@@ -265,14 +293,17 @@
 		{
 		if(dataToValidate.Mid(startEndPoint,numEndBytes).Compare(aDataPattern.Left(numEndBytes)) != 0)
 			{
-			RDebug::Printf("ROUND TRIP VALIDATION: End Bytes Match Failure");
-			RDebug::Printf("ROUND TRIP VALIDATION: startEndPoint = %d, numEndBytes = %d", startEndPoint, numEndBytes);
-			RDebug::Printf("End of sent data ...");
-			RDebug::RawPrint(aDataPattern.Left(numEndBytes));
-			RDebug::Printf("\n");
-			RDebug::Printf("ROUND TRIP VALIDATION: End of returned data ...");				
-			RDebug::RawPrint(dataToValidate.Mid(startEndPoint,numEndBytes));
-			RDebug::Printf("\n");
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP06, "ROUND TRIP VALIDATION: End Bytes Match Failure");
+			OstTraceExt2(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP07, "ROUND TRIP VALIDATION: startEndPoint = %u, numEndBytes = %u", startEndPoint, numEndBytes);
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP08, "End of sent data ...");
+            const TPtrC8& leftDataPattern = aDataPattern.Left(numEndBytes);
+            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP58, "", leftDataPattern.Ptr(), leftDataPattern.Length());
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP09, "\n");
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP10, "ROUND TRIP VALIDATION: End of returned data ...");
+            const TPtrC8& midDataToValidate = dataToValidate.Mid(startEndPoint,numEndBytes);
+            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP60, "", midDataToValidate.Ptr(), midDataToValidate.Length());
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP11, "\n");
+			OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP01, this, EFalse );
 			return EFalse;
 			}
 		}
@@ -280,59 +311,67 @@
 		{
 		if(dataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()).Compare(aDataPattern) != 0)
 			{
-			RDebug::Printf("ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
-			RDebug::Printf("sent data middle block ...");
-			RDebug::RawPrint(aDataPattern);
-			RDebug::Printf("\n");
-			RDebug::Printf("ROUND TRIP VALIDATION: Middle block of returned data ...");
-			RDebug::RawPrint(dataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()));
-			RDebug::Printf("\n");
+			OstTrace1(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP12, "ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP13, "sent data middle block ...");
+            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP53, "", aDataPattern.Ptr(), aDataPattern.Length());
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP14, "\n");
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP15, "ROUND TRIP VALIDATION: Middle block of returned data ...");
+            const TPtrC8& midDataToValidate = dataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length());
+            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP55, "", midDataToValidate.Ptr(), midDataToValidate.Length());
+			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP16, "\n");
+			OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP02, this, EFalse );
 			return EFalse; //from 'for' loop
 			}
 		}
+	OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP03, this, ETrue );
 	return ETrue;
 	}
 
 
 void CInterfaceSettingBase::ReadDataFromEndpointL(TUint aNumBytes, TUint16 aEndpointNumber)	
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_ENTRY, this );
 	// Access the correct readerer for the given endpoint
 	// and prepare to read the data to be sent by the host			
 	iEndpointReaders[aEndpointNumber-1]->ReadL(aNumBytes);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::CancelAnyReadDataFromEndpointL(TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_ENTRY, this );
 	// Access the correct writer for the given endpoint
 	// and cancel any outstanding write. This will not of course work for 'synchronous' writes.			
 	iEndpointReaders[aEndpointNumber-1]->Cancel();
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::ReadDataFromAndHaltEndpointL(TUint aNumBytes, TUint16 aEndpointNumber)	
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_ENTRY, this );
 	// Access the correct reader for the given endpoint
 	// and prepare to read the data to be sent by the host			
 	iEndpointReaders[aEndpointNumber-1]->ReadAndHaltL(aNumBytes);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::RepeatedReadAndValidateFromEndpointL(const TDesC8& aDataPattern, TUint aNumBytesPerRead, TUint aTotalNumBytes, TUint16 aEndpointNumber)
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_ENTRY, this );
 	// Access the correct reader for the given endpoint
 	// and prepare to read the data to be sent by the host
 	// using multiple 'Reads'
 	iEndpointReaders[aEndpointNumber-1]->RepeatedReadAndValidateL(aDataPattern, aNumBytesPerRead, aTotalNumBytes);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::ReadDataUntilShortFromEndpointL(TUint aNumBytes, TUint16 aEndpointNumber)	
 	{
-	LOG_FUNC	
+	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_ENTRY, this );
 	// Access the correct reader for the given endpoint
 	// and prepare to read the data to be sent by the host			
 	iEndpointReaders[aEndpointNumber-1]->ReadUntilShortL(aNumBytes);
+	OstTraceFunctionExit1( CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_EXIT, this );
 	}
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/vendordevice.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/vendordevice.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,6 +19,10 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "vendordeviceTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -26,23 +30,28 @@
 
 RUsbDeviceVendor::RUsbDeviceVendor()
 	{
+	OstTraceFunctionEntry1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT, this );
 	}
 	
 RUsbDeviceVendor::RUsbDeviceVendor(CBaseTestCase* aTestCase):RUsbTestDevice(aTestCase)
 	{
-	LOG_FUNC
-	RDebug::Printf("aTestCase = %d", aTestCase);
+	OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP01, this );
+	OstTrace1(TRACE_NORMAL, RUSBDEVICEVENDOR_RUSBDEVICEVENDOR, "aTestCase = %d", aTestCase);
+	OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP01, this );
 	}
 	
 
 RUsbDeviceVendor::~RUsbDeviceVendor()
 	{	
+	OstTraceFunctionEntry1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP02, this );
+	OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP02, this );
 	}
 	
 
 void RUsbDeviceVendor::OpenL(const TDesC& aSerialNumber)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_OPENL_ENTRY, this );
 	
 	RUsbTestDevice::OpenL();
 	
@@ -67,12 +76,14 @@
 	CleanupStack::Pop(interface0s0);
 	AddInterface(interface0);
 	CleanupStack::Pop(interface0);
+	OstTraceFunctionExit1( RUSBDEVICEVENDOR_OPENL_EXIT, this );
 	}
 
 
 void RUsbDeviceVendor::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_ONSTATECHANGEL_ENTRY, this );
+	OstTraceFunctionExit1( RUSBDEVICEVENDOR_ONSTATECHANGEL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/wakeuptimer.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/wakeuptimer.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,6 +17,10 @@
 //
 
 #include "wakeuptimer.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "wakeuptimerTraces.h"
+#endif
 
 
 namespace NUnitTesting_USBDI
@@ -26,10 +30,12 @@
 
 CRemoteWakeupTimer* CRemoteWakeupTimer::NewL(RUsbTestDevice& aTestDevice)
 	{
+	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_NEWL_ENTRY, ( TUint )&( aTestDevice ) );
 	CRemoteWakeupTimer* self = new (ELeave) CRemoteWakeupTimer(aTestDevice);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -38,43 +44,50 @@
 :	CTimer(EPriorityStandard),
 	iTestDevice(aTestDevice)
 	{
+	OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY, this );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT, this );
 	}
 
 
 CRemoteWakeupTimer::~CRemoteWakeupTimer()
 	{
+	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY_DUP01, this );
+	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT_DUP01, this );
 	}
 
 
 void CRemoteWakeupTimer::ConstructL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CONSTRUCTL_ENTRY, this );
 	CTimer::ConstructL();
+	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CRemoteWakeupTimer::WakeUp(TUint16 aInterval)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_WAKEUP_ENTRY, this );
 	After(aInterval*KOneSecond);
+	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_WAKEUP_EXIT, this );
 	}
 
 
 void CRemoteWakeupTimer::RunL()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_RUNL_ENTRY, this );
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode != KErrNone)
 		{
-		RDebug::Printf("<Error %d> software connect/disconnect timer error",completionCode);
+		OstTrace1(TRACE_NORMAL, CREMOTEWAKEUPTIMER_RUNL, "<Error %d> software connect/disconnect timer error",completionCode);
 		iTestDevice.ReportError(completionCode);
 		}
 	else
 		{
 		iTestDevice.RemoteWakeup();
 		}	
+	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_RUNL_EXIT, this );
 	}	
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/t_usbhost_usbman_src/t_usbhost_usbman.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/t_usbhost_usbman_src/t_usbhost_usbman.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,6 +18,10 @@
 #include <e32property.h>
 #include <d32otgdi.h>
 #include "..\..\t_usbdi\inc\testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "t_usbhost_usbmanTraces.h"
+#endif
 
 _LIT(KOtgdiLddFileName, "otgdi");
 _LIT(KArgClient,        "client");
@@ -30,7 +34,7 @@
 
 TInt E32Main()
 	{
-	RDebug::Print(_L("---> Main OTG Sub-Process"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "---> Main OTG Sub-Process");
 
 	CTrapCleanup* trapHandler = CTrapCleanup::New();
 
@@ -58,12 +62,12 @@
 		if(firstToken.Compare(KArgClient) == 0)
 			{
 			clientFlag = ETrue;
-            RDebug::Print(_L("usbhost_usbman running as a Client"));
+            OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "usbhost_usbman running as a Client");
 			}
 		else
 			{
 			clientFlag = EFalse;
-            RDebug::Print(_L("usbhost_usbman running as a Host"));
+            OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP02, "usbhost_usbman running as a Host");
 			}
 
 		delete cmdLine;
@@ -73,7 +77,7 @@
 
 	if(r != KErrNone && r != KErrAlreadyExists) // persistent loading since process will be killed while it is in the loop below and doesnt unload it
 		{
-		RDebug::Print(_L("   LoadLogicalDevice(KOtgdiLddFileName) error = %d"), r);
+		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP03, "   LoadLogicalDevice(KOtgdiLddFileName) error = %d", r);
 		delete trapHandler;
 		return r;		
 		}
@@ -86,28 +90,28 @@
 	RUsbOtgDriver::TOtgEvent event;
 	TBool running = ETrue;
 	
-	RDebug::Print(_L("   opening otg driver"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP04, "   opening otg driver");
 	
 	r = otg.Open();
 	if(r != KErrNone)
 		{
-		RDebug::Print(_L("   otg.Open fails %d"), r);
+		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP05, "   otg.Open fails %d", r);
         goto Abort;
 		}
 
-	RDebug::Print(_L("   otg driver successfully opened"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP06, "   otg driver successfully opened");
 
-	RDebug::Print(_L("   otg : starting stacks now"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP07, "   otg : starting stacks now");
 	
 	r = otg.StartStacks();
 
 	if(r != KErrNone)
 		{
-		RDebug::Print(_L("   otg.StartStacks fails %d"), r);
+		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP08, "   otg.StartStacks fails %d", r);
         goto Abort;
 		}	
 
-	RDebug::Print(_L("   otg stacks successfully started"));
+	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP09, "   otg stacks successfully started");
 
 //	RProcess::Rendezvous(KErrNone);
 
@@ -115,7 +119,7 @@
     r = wordofdeath.Attach(KWordOfDeathCat, KWordOfDeathKey, EOwnerThread);
     if(r != KErrNone)
         {
-        RDebug::Print(_L("Failed to connect to word of death"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS, "Failed to connect to word of death");
         }
     
     // wait for the previously attached counterproperty to be updated
@@ -125,8 +129,8 @@
 		otg.QueueOtgEventRequest(event, status);
 		User::WaitForRequest(status, waiting_for_death);
 
-        RDebug::Print(_L("waiting_for_death= %d"), waiting_for_death.Int());
-        RDebug::Print(_L("Otg Event        = %d"), status.Int());
+        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP01, "waiting_for_death= %d", waiting_for_death.Int());
+        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP02, "Otg Event        = %d", status.Int());
 
         r = waiting_for_death.Int();
         if(r != KRequestPending)
@@ -152,23 +156,23 @@
 
 	// Shut down nicely
 
-    RDebug::Print(_L("StopStacks()"));
+    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP03, "StopStacks()");
 
     otg.StopStacks(); //NB This drops the bus
 
-    RDebug::Print(_L("******** ShutdownStack Complete ********"));
+    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP04, "******** ShutdownStack Complete ********");
 
-    RDebug::Print(_L("Close Otg stack()"));
+    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP05, "Close Otg stack()");
 
     otg.Close();
 
 Abort:
-    RDebug::Print(_L("Free LDD"));
+    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP06, "Free LDD");
     User::FreeLogicalDevice(RUsbOtgDriver::Name());
 
     delete trapHandler;
 
-    RDebug::Print(_L("usbhost_usbman Finished"));
+    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP07, "usbhost_usbman Finished");
 
     return KErrNone;
     }
@@ -181,15 +185,15 @@
     switch(event)
         {
     case RUsbOtgDriver::EEventVbusRaised:
-        RDebug::Print(_L("Client Side : Vbus raise detected due to Event VbusRaised"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP08, "Client Side : Vbus raise detected due to Event VbusRaised");
         break;
 
     case RUsbOtgDriver::EEventRoleChangedToDevice:
-        RDebug::Print(_L("Client Side : Vbus raise detected due to Event RoleChangedToDevice"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP09, "Client Side : Vbus raise detected due to Event RoleChangedToDevice");
         break;
 
     default:
-        RDebug::Print(_L("Client Side : Event %d received"), event);
+        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP10, "Client Side : Event %d received", event);
         break;
         }
 
@@ -205,71 +209,71 @@
     switch(event)
         {
     case RUsbOtgDriver::EEventAPlugInserted:
-        RDebug::Print(_L("Host side otg got APlugInserted Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP11, "Host side otg got APlugInserted Event");
         r = aOtg.BusRequest();
-        RDebug::Print(_L("BusRequest() made - returned %d"), r);
+        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP12, "BusRequest() made - returned %d", r);
         break;
 
     case RUsbOtgDriver::EEventAPlugRemoved:
-        RDebug::Print(_L("Host side otg got APlugRemoved Event - shutting down"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP13, "Host side otg got APlugRemoved Event - shutting down");
         return EFalse;
 
     case RUsbOtgDriver::EEventVbusRaised:
-        RDebug::Print(_L("Host side otg got VbusRaised Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP14, "Host side otg got VbusRaised Event");
         break;
 
     case RUsbOtgDriver::EEventVbusDropped:
-        RDebug::Print(_L("Host side otg got VbusDropped Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP15, "Host side otg got VbusDropped Event");
         break;
 
     case RUsbOtgDriver::EEventSrpInitiated:
-        RDebug::Print(_L("Host side otg got SrpInitiated Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP16, "Host side otg got SrpInitiated Event");
         break;
 
     case RUsbOtgDriver::EEventSrpReceived:
-        RDebug::Print(_L("Host side otg got SrpReceived Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP17, "Host side otg got SrpReceived Event");
         break;
 
     case RUsbOtgDriver::EEventHnpEnabled:
-        RDebug::Print(_L("Host side otg got HnpEnabled Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP18, "Host side otg got HnpEnabled Event");
         break;
 
     case RUsbOtgDriver::EEventHnpDisabled:
-        RDebug::Print(_L("Host side otg got HnpDisabled Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP19, "Host side otg got HnpDisabled Event");
         break;
 
     case RUsbOtgDriver::EEventHnpSupported:
-        RDebug::Print(_L("Host side otg got HnpSupported Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP20, "Host side otg got HnpSupported Event");
         break;
 
     case RUsbOtgDriver::EEventHnpAltSupported:
-        RDebug::Print(_L("Host side otg got HnpAltSupported Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP21, "Host side otg got HnpAltSupported Event");
         break;
 
 
     case RUsbOtgDriver::EEventBusConnectionBusy:
-        RDebug::Print(_L("Host side otg got BusConnectionBusy Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP22, "Host side otg got BusConnectionBusy Event");
         break;
 
     case RUsbOtgDriver::EEventBusConnectionIdle:
-        RDebug::Print(_L("Host side otg got BusConnectionIdle Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP23, "Host side otg got BusConnectionIdle Event");
         break;
 
 
     case RUsbOtgDriver::EEventRoleChangedToHost:
-        RDebug::Print(_L("Host side otg got RoleChangedToHost Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP24, "Host side otg got RoleChangedToHost Event");
         break;
 
     case RUsbOtgDriver::EEventRoleChangedToDevice:
-        RDebug::Print(_L("Host side otg got RoleChangedToDevice Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP25, "Host side otg got RoleChangedToDevice Event");
         break;
 
     case RUsbOtgDriver::EEventRoleChangedToIdle:
-        RDebug::Print(_L("Host side otg got RoleChangedToIdle Event"));
+        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP26, "Host side otg got RoleChangedToIdle Event");
         break;
 
     default:
-        RDebug::Print(_L("Host Side otg unknown event catcher tickled - event %d - shutting down"), event);
+        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP27, "Host Side otg unknown event catcher tickled - event %d - shutting down", event);
         return EFalse;
      }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,2769 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_ENTRY=0x4c2
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_ENTRY_DUP01=0x4c8
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_EXIT=0x4c3
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_EXIT_DUP01=0x4c9
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CONSTRUCTL_ENTRY=0x4c4
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CONSTRUCTL_EXIT=0x4c5
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_DEVICEL_ENTRY=0x4ce
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_DOCANCEL_ENTRY=0x4ca
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_DOCANCEL_EXIT=0x4cb
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_MONITOR_ENTRY=0x4cc
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_MONITOR_EXIT=0x4cd
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_NEWL_ENTRY=0x4c0
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_NEWL_EXIT=0x4c1
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNERROR_ENTRY=0x4d1
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNERROR_EXIT=0x4d2
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNL_ENTRY=0x4cf
+[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNL_EXIT=0x4d0
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY=0x63e
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY_DUP01=0x640
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT=0x63f
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT_DUP01=0x641
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_ENTRY=0x642
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_EXIT=0x643
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_ENTRY=0x644
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_EXIT=0x645
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_NEWL_ENTRY=0x63c
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_NEWL_EXIT=0x63d
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_ENTRY=0x648
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_EXIT=0x649
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNL_ENTRY=0x646
+[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNL_EXIT=0x647
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_ENTRY=0xd
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_EXIT=0xe
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY=0x1b
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY_DUP01=0x1e
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT=0x1f
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP01=0x20
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP02=0x21
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP03=0x22
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP04=0x23
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BUSERRORL_ENTRY=0x32
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BUSERRORL_EXIT=0x33
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY=0xb
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY_DUP01=0xf
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT=0xc
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT_DUP01=0x10
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKANDRESETTIMES_ENTRY=0x46
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKANDRESETTIMES_EXIT=0x47
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKTIMES_ENTRY=0x42
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKTIMES_EXIT=0x43
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_ENTRY=0x2e
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_EXIT=0x2f
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEDOCANCEL_ENTRY=0x17
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEDOCANCEL_EXIT=0x18
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEINSERTEDL_ENTRY=0x1c
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEINSERTEDL_EXIT=0x1d
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEREMOVEDL_ENTRY=0x30
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEREMOVEDL_EXIT=0x31
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICERUNL_ENTRY=0x36
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICERUNL_EXIT=0x37
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICESTATECHANGEL_ENTRY=0x19
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICESTATECHANGEL_EXIT=0x1a
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_ENTRY=0x15
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_EXIT=0x16
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_ENTRY=0x11
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_EXIT=0x12
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_ENTRY=0x48
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_EXIT=0x49
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTDOCANCEL_ENTRY=0x13
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTDOCANCEL_EXIT=0x14
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTRUNL_ENTRY=0x34
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTRUNL_EXIT=0x35
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RECORDTIME_ENTRY=0x40
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RECORDTIME_EXIT=0x41
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RESETTIMES_ENTRY=0x44
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RESETTIMES_EXIT=0x45
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_ENTRY=0x24
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT=0x25
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP01=0x26
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP02=0x27
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP03=0x28
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP04=0x29
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP05=0x2a
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP06=0x2b
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP07=0x2c
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP08=0x2d
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_ENTRY=0x38
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP01=0x39
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP02=0x3a
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT=0x3b
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP01=0x3c
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP02=0x3d
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP03=0x3e
+[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP04=0x3f
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_BASECONSTRUCTL_ENTRY=0x4c
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_BASECONSTRUCTL_EXIT=0x4d
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CANCELTIMEOUT_ENTRY=0x50
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CANCELTIMEOUT_EXIT=0x51
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_ENTRY=0x4a
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_ENTRY_DUP01=0x5c
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_EXIT=0x4b
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_EXIT_DUP01=0x5d
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CHECKTREEAFTERDEVICEINSERTION_ENTRY=0x8c
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CHECKTREE_ENTRY=0x87
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CHECKTREE_EXIT=0x88
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_ENTRY=0x56
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT=0x57
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP01=0x58
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP02=0x59
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP03=0x5a
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP04=0x5b
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_DOCANCEL_ENTRY=0x62
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_DOCANCEL_EXIT=0x63
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_ENTRY=0x52
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_EXIT=0x53
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_EXIT_DUP01=0x54
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_EXIT_DUP02=0x55
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_ENTRY=0x7a
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_ENTRY_DUP01=0x7b
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_EXIT=0x7c
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP01=0x7d
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP02=0x7e
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOSTONLY_ENTRY=0x6c
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOSTONLY_EXIT=0x6d
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOST_ENTRY=0x6e
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOST_EXIT=0x6f
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_LOGWITHCONDANDINFO_ENTRY=0x7f
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_LOGWITHCONDANDINFO_EXIT=0x80
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_ENTRY=0x89
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT=0x8a
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT_DUP01=0x8b
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PERFORMTESTL_ENTRY=0x70
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PERFORMTESTL_EXIT=0x71
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTOREBLOB_ENTRY=0x83
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTOREBLOB_EXIT=0x84
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORECHUNK_ENTRY=0x85
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORECHUNK_EXIT=0x86
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORETREE_ENTRY=0x81
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORETREE_EXIT=0x82
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNERROR_ENTRY=0x66
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNERROR_EXIT=0x67
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNL_ENTRY=0x64
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNL_EXIT=0x65
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_ENTRY=0x5e
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_ENTRY_DUP01=0x60
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_EXIT=0x5f
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_EXIT_DUP01=0x61
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SETTESTPOLICY_ENTRY=0x72
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SETTESTPOLICY_EXIT=0x73
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTCASEID_ENTRY=0x68
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTCASEID_EXIT=0x69
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTFAILED_ENTRY=0x74
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTFAILED_EXIT=0x75
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPASSED_ENTRY=0x76
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPASSED_EXIT=0x77
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPOLICY_ENTRY=0x78
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPOLICY_EXIT=0x79
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTRESULT_ENTRY=0x6a
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTRESULT_EXIT=0x6b
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TIMEOUTIN_ENTRY=0x4e
+[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TIMEOUTIN_EXIT=0x4f
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY=0x607
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY_DUP01=0x609
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT=0x608
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT_DUP01=0x60a
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CONSTRUCTL_ENTRY=0x60b
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CONSTRUCTL_EXIT=0x60c
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_DOCANCEL_ENTRY=0x60f
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_DOCANCEL_EXIT=0x610
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_NEWL_ENTRY=0x605
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_NEWL_EXIT=0x606
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNERROR_ENTRY=0x615
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNERROR_EXIT=0x616
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNL_ENTRY=0x613
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNL_EXIT=0x614
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNTESTCASEL_ENTRY=0x60d
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNTESTCASEL_EXIT=0x60e
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY=0x611
+[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_SIGNALTESTCOMPLETE_EXIT=0x612
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_ENTRY=0x456
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_ENTRY_DUP01=0x458
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_EXIT=0x457
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_EXIT_DUP01=0x459
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_DOCANCEL_ENTRY=0x45a
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_DOCANCEL_EXIT=0x45b
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNERROR_ENTRY=0x460
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNERROR_EXIT=0x461
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNL_ENTRY=0x45e
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNL_EXIT=0x45f
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_STARTWATCHING_ENTRY=0x45c
+[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_STARTWATCHING_EXIT=0x45d
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_ENTRY=0x3
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_ENTRY_DUP01=0x5
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_EXIT=0x4
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_EXIT_DUP01=0x6
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CONSTRUCTL_ENTRY=0x7
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CONSTRUCTL_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_NEWL_ENTRY=0x1
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_NEWL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_RUNL_ENTRY=0x9
+[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_RUNL_EXIT=0xa
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_ENTRY=0x4f5
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_ENTRY_DUP01=0x4f7
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_EXIT=0x4f6
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_EXIT_DUP01=0x4f8
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_DATAPOLLED_ENTRY=0x4f9
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFERIN_ENTRY=0x4fa
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFERIN_EXIT=0x4fb
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_ENTRY=0x4fc
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP01=0x4fe
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP02=0x500
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_EXIT=0x4fd
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_EXIT_DUP01=0x4ff
+[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_EXIT_DUP02=0x501
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY=0x462
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY_DUP01=0x464
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT=0x463
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT_DUP01=0x465
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_ENTRY=0x46a
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_EXIT=0x46b
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_ENDPOINTREADERROR_ENTRY=0x468
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_ENDPOINTREADERROR_EXIT=0x469
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_READREQUESTSL_ENTRY=0x466
+[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_READREQUESTSL_EXIT=0x467
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY=0x8f
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY_DUP01=0x91
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT=0x90
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT_DUP01=0x92
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CONSTRUCTL_ENTRY=0x93
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CONSTRUCTL_EXIT=0x94
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_NEWL_ENTRY=0x8d
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_NEWL_EXIT=0x8e
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_READER_ENTRY=0x9e
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_READER_EXIT=0x9f
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_ENTRY=0x9c
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_EXIT=0x9d
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATA_ENTRY=0x9a
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATA_EXIT=0x9b
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_START_ENTRY=0x95
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_START_EXIT=0x96
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_START_EXIT_DUP01=0x97
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_STOP_ENTRY=0x98
+[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_STOP_EXIT=0x99
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ACKNOWLEDGE_ENTRY=0x49c
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ACKNOWLEDGE_EXIT=0x49d
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_BUFFER_ENTRY=0x48c
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_BUFFER_EXIT=0x48d
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_ENTRY=0x488
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_ENTRY_DUP01=0x48a
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_EXIT=0x489
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_EXIT_DUP01=0x48b
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_DOCANCEL_ENTRY=0x49e
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_DOCANCEL_EXIT=0x49f
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ISVALID_ENTRY=0x48e
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ISVALID_EXIT=0x48f
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_NUMBYTESREADSOFAR_ENTRY=0x490
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_NUMBYTESREADSOFAR_EXIT=0x491
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READANDHALTL_ENTRY=0x498
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READANDHALTL_EXIT=0x499
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READL_ENTRY=0x494
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READL_EXIT=0x495
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READPACKETL_ENTRY=0x492
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READPACKETL_EXIT=0x493
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READUNTILSHORTL_ENTRY=0x496
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READUNTILSHORTL_EXIT=0x497
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_REPEATEDREADANDVALIDATEL_ENTRY=0x49a
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_REPEATEDREADANDVALIDATEL_EXIT=0x49b
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNERROR_ENTRY=0x4a2
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNERROR_EXIT=0x4a3
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNL_ENTRY=0x4a0
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNL_EXIT=0x4a1
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_ENTRY=0x4a4
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_ENTRY_DUP01=0x4a6
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_EXIT=0x4a5
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_EXIT_DUP01=0x4a7
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CREATEBIGBUFFER_ENTRY=0x4be
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CREATEBIGBUFFER_EXIT=0x4bf
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_DOCANCEL_ENTRY=0x4a8
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_DOCANCEL_EXIT=0x4a9
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_ENTRY=0x4aa
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_EXIT=0x4ab
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNERROR_ENTRY=0x4ae
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNERROR_EXIT=0x4af
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNL_ENTRY=0x4ac
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNL_EXIT=0x4ad
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_ENTRY=0x4bc
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_EXIT=0x4bd
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_ENTRY=0x4b8
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_EXIT=0x4b9
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY=0x4b4
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY_DUP01=0x4b6
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT=0x4b5
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT_DUP01=0x4b7
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUS_ENTRY=0x4b3
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEUSINGPATTERNL_ENTRY=0x4ba
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEUSINGPATTERNL_EXIT=0x4bb
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITE_ENTRY=0x4b0
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITE_EXIT=0x4b1
+[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITE_EXIT_DUP01=0x4b2
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CANCELSENDREQUEST_ENTRY=0x472
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CANCELSENDREQUEST_EXIT=0x473
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_ENTRY=0x46c
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_ENTRY_DUP01=0x46e
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_EXIT=0x46d
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_EXIT_DUP01=0x46f
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_DOCANCEL_ENTRY=0x470
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_DOCANCEL_EXIT=0x471
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_ENTRY=0x486
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_EXIT=0x487
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTSTARTTIME_ENTRY=0x484
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTSTARTTIME_EXIT=0x485
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNERROR_ENTRY=0x482
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNERROR_EXIT=0x483
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNL_ENTRY=0x480
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNL_EXIT=0x481
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY=0x474
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP01=0x476
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP02=0x478
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP03=0x47a
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP04=0x47c
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP05=0x47e
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT=0x475
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP01=0x477
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP02=0x479
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP03=0x47b
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP04=0x47d
+[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP05=0x47f
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ADDINTERFACESETTINGL_ENTRY=0x5be
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ADDINTERFACESETTINGL_EXIT=0x5bf
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_ENTRY=0x5c8
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_EXIT=0x5c9
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATESETTING_ENTRY=0x5c1
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATESETTING_EXIT=0x5c2
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_BASECONSTRUCTL_ENTRY=0x5bc
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_BASECONSTRUCTL_EXIT=0x5bd
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_ENTRY=0x5b8
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_ENTRY_DUP01=0x5ba
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_EXIT=0x5b9
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_EXIT_DUP01=0x5bb
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTNUMBERL_ENTRY=0x5c4
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTNUMBERL_EXIT=0x5c5
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTTWONUMBERSL_ENTRY=0x5c6
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTTWONUMBERSL_EXIT=0x5c7
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_INTERFACESETTINGCOUNT_ENTRY=0x5c3
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_PROCESSREQUESTL_ENTRY=0x5ca
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_PROCESSREQUESTL_EXIT=0x5cb
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STALLENDPOINT_ENTRY=0x5c0
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STARTEP0READING_ENTRY=0x5cc
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STARTEP0READING_EXIT=0x5cd
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STOPEP0READING_ENTRY=0x5ce
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STOPEP0READING_EXIT=0x5cf
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_ENTRY=0x5d8
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_EXIT=0x5d9
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP01=0x5da
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP02=0x5db
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CACHEDENDPOINTRESULTL_ENTRY=0x5f2
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_ENTRY=0x5fd
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_EXIT=0x5fe
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_ENTRY=0x5e8
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_EXIT=0x5e9
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY=0x5d0
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY_DUP01=0x5d2
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT=0x5d1
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT_DUP01=0x5d3
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_ENTRY=0x5dc
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_EXIT=0x5dd
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_ENTRY=0x5de
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_EXIT=0x5df
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NAME_ENTRY=0x5d4
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NAME_EXIT=0x5d5
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NUMBYTESREADSOFARL_ENTRY=0x5f3
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NUMBYTESWRITTENSOFARL_ENTRY=0x5f4
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_ENTRY=0x5ff
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_EXIT=0x600
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_ENTRY=0x5fb
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_EXIT=0x5fc
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_ENTRY=0x603
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_EXIT=0x604
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_ENTRY=0x601
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_EXIT=0x602
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_ENTRY=0x5e4
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_EXIT=0x5e5
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_SETCLASSCODEL_ENTRY=0x5d6
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_SETCLASSCODEL_EXIT=0x5d7
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY=0x5f5
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY_DUP01=0x5f6
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT=0x5f7
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP01=0x5f8
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP02=0x5f9
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP03=0x5fa
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_ENTRY=0x5e6
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_EXIT=0x5e7
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY=0x5e0
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY_DUP01=0x5e2
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT=0x5e1
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT_DUP01=0x5e3
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY=0x5ee
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY_DUP01=0x5f0
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT=0x5ef
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT_DUP01=0x5f1
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_ENTRY=0x5ec
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_EXIT=0x5ed
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_ENTRY=0x5ea
+[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_EXIT=0x5eb
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY=0x502
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY_DUP01=0x504
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT=0x503
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT_DUP01=0x505
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_DATAPOLLED_ENTRY=0x506
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY=0x509
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT=0x50a
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_TRANSFERINL_ENTRY=0x507
+[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_TRANSFERINL_EXIT=0x508
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_ENTRY=0x50b
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_ENTRY_DUP01=0x50d
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_EXIT=0x50c
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_EXIT_DUP01=0x50e
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_DATAPOLLED_ENTRY=0x50f
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_DATAPOLLED_EXIT=0x510
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_PREPARETRANSFER_ENTRY=0x515
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_PREPARETRANSFER_EXIT=0x516
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY=0x513
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT=0x514
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFERINL_ENTRY=0x511
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFERINL_EXIT=0x512
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFEROUT_ENTRY=0x517
+[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFEROUT_EXIT=0x518
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CONSTRUCTL_ENTRY=0x65a
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CONSTRUCTL_EXIT=0x65b
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY=0x656
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY_DUP01=0x658
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT=0x657
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT_DUP01=0x659
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_NEWL_ENTRY=0x654
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_NEWL_EXIT=0x655
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_RUNL_ENTRY=0x65e
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_RUNL_EXIT=0x65f
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_WAKEUP_ENTRY=0x65c
+[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_WAKEUP_EXIT=0x65d
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY=0x520
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY_DUP01=0x522
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT=0x521
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT_DUP01=0x523
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_NEWL_ENTRY=0x51e
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_NEWL_EXIT=0x51f
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_RUNL_ENTRY=0x52a
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_RUNL_EXIT=0x52b
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARECONNECT_ENTRY=0x524
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARECONNECT_EXIT=0x525
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_ENTRY=0x526
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_EXIT=0x527
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_ENTRY=0x528
+[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_EXIT=0x529
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CONSTRUCTL_ENTRY=0x532
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CONSTRUCTL_EXIT=0x533
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY=0x52e
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY_DUP01=0x530
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT=0x52f
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT_DUP01=0x531
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_DOCANCEL_ENTRY=0x534
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_DOCANCEL_EXIT=0x535
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_NEWL_ENTRY=0x52c
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_NEWL_EXIT=0x52d
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNERROR_ENTRY=0x538
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNERROR_EXIT=0x539
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNL_ENTRY=0x536
+[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNL_EXIT=0x537
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CONSTRUCTL_ENTRY=0x5a9
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CONSTRUCTL_EXIT=0x5aa
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_ENTRY=0x5a5
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_ENTRY_DUP01=0x5a7
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_EXIT=0x5a6
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_EXIT_DUP01=0x5a8
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DOCANCEL_ENTRY=0x5b2
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DOCANCEL_EXIT=0x5b3
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEWL_ENTRY=0x5a3
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEWL_EXIT=0x5a4
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEXTTESTCASEID_ENTRY=0x5ab
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEXTTESTCASEID_EXIT=0x5ac
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEXTTESTCASEID_EXIT_DUP01=0x5ad
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NUMREPEATS_ENTRY=0x5b0
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NUMREPEATS_EXIT=0x5b1
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNERROR_ENTRY=0x5b6
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNERROR_EXIT=0x5b7
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNL_ENTRY=0x5b4
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNL_EXIT=0x5b5
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_TESTCASESIDENTITIES_ENTRY=0x5ae
+[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_TESTCASESIDENTITIES_EXIT=0x5af
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CONSTRUCTL_ENTRY=0x61d
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CONSTRUCTL_EXIT=0x61e
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY=0x619
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY_DUP01=0x61b
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT=0x61a
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT_DUP01=0x61c
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOCANCEL_ENTRY=0x623
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOCANCEL_EXIT=0x624
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOTESTL_ENTRY=0x628
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOTESTL_EXIT=0x629
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_NEWL_ENTRY=0x617
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_NEWL_EXIT=0x618
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNERROR_ENTRY=0x62c
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNERROR_EXIT=0x62d
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNL_ENTRY=0x62a
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNL_EXIT=0x62b
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNTESTCASEL_ENTRY=0x61f
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNTESTCASEL_EXIT=0x620
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY=0x621
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_EXIT=0x622
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_THREADFUNCTION_ENTRY=0x625
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_THREADFUNCTION_EXIT=0x626
+[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_THREADFUNCTION_EXIT_DUP01=0x627
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CONSTRUCTL_ENTRY=0x634
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CONSTRUCTL_EXIT=0x635
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY=0x630
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY_DUP01=0x632
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT=0x631
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT_DUP01=0x633
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_DOCANCEL_ENTRY=0x636
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_DOCANCEL_EXIT=0x637
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_NEWL_ENTRY=0x62e
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_NEWL_EXIT=0x62f
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNERROR_ENTRY=0x63a
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNERROR_EXIT=0x63b
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNL_ENTRY=0x638
+[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNL_EXIT=0x639
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_ENTRY=0x4eb
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_EXIT=0x4ec
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONSTRING_ENTRY=0x4e9
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONSTRING_EXIT=0x4ea
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONSTRUCTL_ENTRY=0x4d9
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONSTRUCTL_EXIT=0x4da
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY=0x4d5
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY_DUP01=0x4d7
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT=0x4d6
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT_DUP01=0x4d8
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICEDESCRIPTOR_ENTRY=0x4ed
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICEDESCRIPTOR_EXIT=0x4ee
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICESPEC_ENTRY=0x4dd
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICESPEC_EXIT=0x4de
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICE_ENTRY=0x4db
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICE_EXIT=0x4dc
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DOCANCEL_ENTRY=0x4ef
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DOCANCEL_EXIT=0x4f0
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_MANUFACTURER_ENTRY=0x4e5
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_MANUFACTURER_EXIT=0x4e6
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_NEWL_ENTRY=0x4d3
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_NEWL_EXIT=0x4d4
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCTID_ENTRY=0x4df
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCTID_EXIT=0x4e0
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCT_ENTRY=0x4e7
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCT_EXIT=0x4e8
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNERROR_ENTRY=0x4f3
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNERROR_EXIT=0x4f4
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNL_ENTRY=0x4f1
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNL_EXIT=0x4f2
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_SERIALNUMBER_ENTRY=0x4e3
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_SERIALNUMBER_EXIT=0x4e4
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_VENDORID_ENTRY=0x4e1
+[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_VENDORID_EXIT=0x4e2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_BUSERRORL_ENTRY=0xb7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_BUSERRORL_EXIT=0xb8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CONSTRUCTL_ENTRY=0xa4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CONSTRUCTL_EXIT=0xa5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY=0xa2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY_DUP01=0xa6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT=0xa3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT_DUP01=0xa7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_ENTRY=0xae
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_EXIT=0xaf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_ENTRY=0xb0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT=0xb1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT_DUP01=0xb2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_ENTRY=0xb5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_EXIT=0xb6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICERUNL_ENTRY=0xbd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICERUNL_EXIT=0xbe
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_ENTRY=0xb9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_EXIT=0xba
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_ENTRY=0xb3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_EXIT=0xb4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_ENTRY=0xaa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_EXIT=0xab
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_ENTRY=0xa8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_EXIT=0xa9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_ENTRY=0xac
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_EXIT=0xad
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_ENTRY=0xbb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_EXIT=0xbc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_NEWL_ENTRY=0xa0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_NEWL_EXIT=0xa1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_BUSERRORL_ENTRY=0xd6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_BUSERRORL_EXIT=0xd7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_ENTRY=0xd8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_EXIT=0xd9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONSTRUCTL_ENTRY=0xc3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONSTRUCTL_EXIT=0xc4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_ENTRY=0xda
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT=0xdb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP01=0xdc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP02=0xdd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP03=0xde
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP04=0xdf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY=0xc1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY_DUP01=0xc5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT=0xc2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT_DUP01=0xc6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_ENTRY=0xcd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_EXIT=0xce
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_ENTRY=0xcf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT=0xd0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT_DUP01=0xd1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_ENTRY=0xd4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_EXIT=0xd5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICERUNL_ENTRY=0xe6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICERUNL_EXIT=0xe7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_ENTRY=0xe0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_EXIT=0xe1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_ENTRY=0xe2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_EXIT=0xe3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_ENTRY=0xc9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_EXIT=0xca
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_ENTRY=0xc7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_EXIT=0xc8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_ENTRY=0xcb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_EXIT=0xcc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTRUNL_ENTRY=0xe4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTRUNL_EXIT=0xe5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_ENTRY=0xd2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_ENTRY=0xd3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_NEWL_ENTRY=0xbf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_NEWL_EXIT=0xc0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_BUSERRORL_ENTRY=0xfd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_BUSERRORL_EXIT=0xfe
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CONSTRUCTL_ENTRY=0xec
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CONSTRUCTL_EXIT=0xed
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY=0xea
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY_DUP01=0xee
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT=0xeb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT_DUP01=0xef
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_ENTRY=0xf6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_EXIT=0xf7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_ENTRY=0xf8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT=0xf9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT_DUP01=0xfa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_ENTRY=0xfb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_EXIT=0xfc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICERUNL_ENTRY=0x105
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICERUNL_EXIT=0x106
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_ENTRY=0xff
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_EXIT=0x100
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_ENTRY=0x101
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_EXIT=0x102
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_ENTRY=0xf2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_EXIT=0xf3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_ENTRY=0xf0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_EXIT=0xf1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_ENTRY=0xf4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_EXIT=0xf5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTRUNL_ENTRY=0x103
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTRUNL_EXIT=0x104
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_NEWL_ENTRY=0xe8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_NEWL_EXIT=0xe9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CONSTRUCTL_ENTRY=0x10b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CONSTRUCTL_EXIT=0x10c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY=0x109
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY_DUP01=0x10d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT=0x10a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT_DUP01=0x10e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_ENTRY=0x115
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_EXIT=0x116
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICERUNL_ENTRY=0x119
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICERUNL_EXIT=0x11a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_ENTRY=0x113
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_EXIT=0x114
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_ENTRY=0x10f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_EXIT=0x110
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_ENTRY=0x111
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_EXIT=0x112
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTRUNL_ENTRY=0x117
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTRUNL_EXIT=0x118
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_NEWL_ENTRY=0x107
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_NEWL_EXIT=0x108
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CONSTRUCTL_ENTRY=0x11f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CONSTRUCTL_EXIT=0x120
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY=0x11d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY_DUP01=0x121
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT=0x11e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT_DUP01=0x122
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_ENTRY=0x129
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_EXIT=0x12a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICERUNL_ENTRY=0x12d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICERUNL_EXIT=0x12e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_ENTRY=0x127
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_EXIT=0x128
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_ENTRY=0x123
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_EXIT=0x124
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_ENTRY=0x125
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_EXIT=0x126
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTRUNL_ENTRY=0x12b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTRUNL_EXIT=0x12c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_NEWL_ENTRY=0x11b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_NEWL_EXIT=0x11c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_BUSERRORL_ENTRY=0x14c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_BUSERRORL_EXIT=0x14d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_ENTRY=0x13f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_EXIT=0x140
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CONSTRUCTL_ENTRY=0x133
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CONSTRUCTL_EXIT=0x134
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY=0x131
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY_DUP01=0x135
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT=0x132
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT_DUP01=0x136
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_ENTRY=0x13d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_EXIT=0x13e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_ENTRY=0x141
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT=0x142
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP01=0x143
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP02=0x144
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP03=0x145
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP04=0x146
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP05=0x147
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP06=0x148
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP07=0x149
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_ENTRY=0x14a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_EXIT=0x14b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICERUNL_ENTRY=0x154
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICERUNL_EXIT=0x155
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_ENTRY=0x14e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_EXIT=0x14f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_ENTRY=0x150
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_EXIT=0x151
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_ENTRY=0x139
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_EXIT=0x13a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_ENTRY=0x137
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_EXIT=0x138
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_ENTRY=0x13b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_EXIT=0x13c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTRUNL_ENTRY=0x152
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTRUNL_EXIT=0x153
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_NEWL_ENTRY=0x12f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_NEWL_EXIT=0x130
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_BUSERRORL_ENTRY=0x170
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_BUSERRORL_EXIT=0x171
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CONSTRUCTL_ENTRY=0x15a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CONSTRUCTL_EXIT=0x15b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY=0x158
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY_DUP01=0x15c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT=0x159
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT_DUP01=0x15d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_ENTRY=0x164
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_EXIT=0x165
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_ENTRY=0x168
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT=0x169
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP01=0x16a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP02=0x16b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_ENTRY=0x16e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_EXIT=0x16f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICERUNL_ENTRY=0x174
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICERUNL_EXIT=0x175
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_ENTRY=0x166
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_EXIT=0x167
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_ENTRY=0x16c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_EXIT=0x16d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_ENTRY=0x162
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_EXIT=0x163
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_ENTRY=0x15e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_EXIT=0x15f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_ENTRY=0x160
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_EXIT=0x161
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTRUNL_ENTRY=0x172
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTRUNL_EXIT=0x173
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_NEWL_ENTRY=0x156
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_NEWL_EXIT=0x157
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_BUSERRORL_ENTRY=0x18d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_BUSERRORL_EXIT=0x18e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CONSTRUCTL_ENTRY=0x17a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CONSTRUCTL_EXIT=0x17b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY=0x178
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY_DUP01=0x17c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT=0x179
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT_DUP01=0x17d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_ENTRY=0x184
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_EXIT=0x185
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_ENTRY=0x188
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT=0x189
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT_DUP01=0x18a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_ENTRY=0x18b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_EXIT=0x18c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICERUNL_ENTRY=0x193
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICERUNL_EXIT=0x194
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_ENTRY=0x186
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_EXIT=0x187
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_ENTRY=0x18f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_EXIT=0x190
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_ENTRY=0x182
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_EXIT=0x183
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_ENTRY=0x17e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_EXIT=0x17f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_ENTRY=0x180
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_EXIT=0x181
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTRUNL_ENTRY=0x191
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTRUNL_EXIT=0x192
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_NEWL_ENTRY=0x176
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_NEWL_EXIT=0x177
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_BUSERRORL_ENTRY=0x1b2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_BUSERRORL_EXIT=0x1b3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CONSTRUCTL_ENTRY=0x199
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CONSTRUCTL_EXIT=0x19a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY=0x197
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY_DUP01=0x19b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT=0x198
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT_DUP01=0x19c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_ENTRY=0x1a3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_EXIT=0x1a4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_ENTRY=0x1a7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT=0x1a8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP01=0x1a9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP02=0x1aa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP03=0x1ab
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP04=0x1ac
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_ENTRY=0x1b0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_EXIT=0x1b1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICERUNL_ENTRY=0x1b6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICERUNL_EXIT=0x1b7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_ENTRY=0x1a5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_EXIT=0x1a6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_ENTRY=0x1ad
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT=0x1ae
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x1af
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_ENTRY=0x1a1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_EXIT=0x1a2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_ENTRY=0x19d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_EXIT=0x19e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_ENTRY=0x19f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_EXIT=0x1a0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTRUNL_ENTRY=0x1b4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTRUNL_EXIT=0x1b5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_NEWL_ENTRY=0x195
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_NEWL_EXIT=0x196
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_BUSERRORL_ENTRY=0x1d1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_BUSERRORL_EXIT=0x1d2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CONSTRUCTL_ENTRY=0x1bc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CONSTRUCTL_EXIT=0x1bd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY=0x1ba
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY_DUP01=0x1be
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT=0x1bb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT_DUP01=0x1bf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_ENTRY=0x1c6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_EXIT=0x1c7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_ENTRY=0x1ca
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT=0x1cb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT_DUP01=0x1cc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_ENTRY=0x1cf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_EXIT=0x1d0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICERUNL_ENTRY=0x1d5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICERUNL_EXIT=0x1d6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_ENTRY=0x1c8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_EXIT=0x1c9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_ENTRY=0x1cd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_EXIT=0x1ce
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_ENTRY=0x1c2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_EXIT=0x1c3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_ENTRY=0x1c0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_EXIT=0x1c1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_ENTRY=0x1c4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_EXIT=0x1c5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTRUNL_ENTRY=0x1d3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTRUNL_EXIT=0x1d4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_NEWL_ENTRY=0x1b8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_NEWL_EXIT=0x1b9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_BUSERRORL_ENTRY=0x1fe
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_BUSERRORL_EXIT=0x1ff
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CONSTRUCTL_ENTRY=0x1db
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CONSTRUCTL_EXIT=0x1dc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY=0x1d9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY_DUP01=0x1dd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT=0x1da
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT_DUP01=0x1de
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_ENTRY=0x1e5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_EXIT=0x1e6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_ENTRY=0x1f1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_EXIT=0x1f2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_ENTRY=0x1fc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_EXIT=0x1fd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICERUNL_ENTRY=0x202
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICERUNL_EXIT=0x203
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_ENTRY=0x1e7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_EXIT=0x1e8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_ENTRY=0x1f9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT=0x1fa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x1fb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_ENTRY=0x1e3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_EXIT=0x1e4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_ENTRY=0x1df
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_EXIT=0x1e0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_ENTRY=0x1ed
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT=0x1ee
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP01=0x1ef
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP02=0x1f0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_ENTRY=0x1e9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT=0x1ea
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP01=0x1eb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP02=0x1ec
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_ENTRY=0x1e1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_EXIT=0x1e2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTRUNL_ENTRY=0x200
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTRUNL_EXIT=0x201
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_NEWL_ENTRY=0x1d7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_NEWL_EXIT=0x1d8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_ENTRY=0x1f3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_EXIT=0x1f4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_ENTRY=0x1f5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT=0x1f6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP01=0x1f7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP02=0x1f8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_BUSERRORL_ENTRY=0x21e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_BUSERRORL_EXIT=0x21f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CONSTRUCTL_ENTRY=0x208
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CONSTRUCTL_EXIT=0x209
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY=0x206
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY_DUP01=0x20a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT=0x207
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT_DUP01=0x20b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_ENTRY=0x212
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_EXIT=0x213
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_ENTRY=0x219
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT=0x21a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT_DUP01=0x21b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_ENTRY=0x21c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_EXIT=0x21d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICERUNL_ENTRY=0x222
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICERUNL_EXIT=0x223
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_ENTRY=0x214
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_EXIT=0x215
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_ENTRY=0x216
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT=0x217
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x218
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_ENTRY=0x210
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_EXIT=0x211
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_ENTRY=0x20c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_EXIT=0x20d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_ENTRY=0x20e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_EXIT=0x20f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTRUNL_ENTRY=0x220
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTRUNL_EXIT=0x221
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_NEWL_ENTRY=0x204
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_NEWL_EXIT=0x205
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CONSTRUCTL_ENTRY=0x228
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CONSTRUCTL_EXIT=0x229
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY=0x226
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY_DUP01=0x22a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT=0x227
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT_DUP01=0x22b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_ENTRY=0x231
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_EXIT=0x232
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_ENTRY=0x22c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_EXIT=0x22d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_NEWL_ENTRY=0x224
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_NEWL_EXIT=0x225
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_ENTRY=0x22e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT=0x22f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT_DUP01=0x230
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_BUSERRORL_ENTRY=0x24c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_BUSERRORL_EXIT=0x24d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CONSTRUCTL_ENTRY=0x237
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CONSTRUCTL_EXIT=0x238
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY=0x235
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY_DUP01=0x239
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT=0x236
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT_DUP01=0x23a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_ENTRY=0x241
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_EXIT=0x242
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_ENTRY=0x245
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT=0x246
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT_DUP01=0x247
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_ENTRY=0x24a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_EXIT=0x24b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICERUNL_ENTRY=0x250
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICERUNL_EXIT=0x251
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_ENTRY=0x243
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_EXIT=0x244
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_ENTRY=0x248
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_EXIT=0x249
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_ENTRY=0x23d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_EXIT=0x23e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_ENTRY=0x23b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_EXIT=0x23c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_ENTRY=0x23f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_EXIT=0x240
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTRUNL_ENTRY=0x24e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTRUNL_EXIT=0x24f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_NEWL_ENTRY=0x233
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_NEWL_EXIT=0x234
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CHECKSN_ENTRY=0x25e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CHECKSN_EXIT=0x25f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CONSTRUCTL_ENTRY=0x256
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CONSTRUCTL_EXIT=0x257
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY=0x254
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY_DUP01=0x258
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT=0x255
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT_DUP01=0x259
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_ENTRY=0x25c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_EXIT=0x25d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_ENTRY=0x264
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_EXIT=0x265
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_ENTRY=0x266
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_EXIT=0x267
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICERUNL_ENTRY=0x25a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICERUNL_EXIT=0x25b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_ENTRY=0x260
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_EXIT=0x261
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_ENTRY=0x26a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_EXIT=0x26b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_ENTRY=0x268
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_EXIT=0x269
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_NEWL_ENTRY=0x252
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_NEWL_EXIT=0x253
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICEC_ENTRY=0x26c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICEC_EXIT=0x26d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICED_ENTRY=0x26e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICED_EXIT=0x26f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_ENTRY=0x262
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_EXIT=0x263
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_BUSERRORL_ENTRY=0x28e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_BUSERRORL_EXIT=0x28f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CONSTRUCTL_ENTRY=0x274
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CONSTRUCTL_EXIT=0x275
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY=0x272
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY_DUP01=0x276
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT=0x273
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT_DUP01=0x277
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_ENTRY=0x27e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_EXIT=0x27f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_ENTRY=0x282
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT=0x283
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP01=0x284
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP02=0x285
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP03=0x286
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP04=0x287
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_ENTRY=0x28c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_EXIT=0x28d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICERUNL_ENTRY=0x292
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICERUNL_EXIT=0x293
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_ENTRY=0x280
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_EXIT=0x281
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_ENTRY=0x288
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_EXIT=0x289
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_ENTRY=0x27c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_EXIT=0x27d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_ENTRY=0x278
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_EXIT=0x279
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_ENTRY=0x27a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_EXIT=0x27b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTRUNL_ENTRY=0x290
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTRUNL_EXIT=0x291
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_NEWL_ENTRY=0x270
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_NEWL_EXIT=0x271
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_ENTRY=0x28a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_EXIT=0x28b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_BUSERRORL_ENTRY=0x2b1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_BUSERRORL_EXIT=0x2b2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CONSTRUCTL_ENTRY=0x298
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CONSTRUCTL_EXIT=0x299
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY=0x296
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY_DUP01=0x29a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT=0x297
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT_DUP01=0x29b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_ENTRY=0x2a5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_EXIT=0x2a6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_ENTRY=0x2a9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT=0x2aa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP01=0x2ab
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP02=0x2ac
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_ENTRY=0x2af
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_EXIT=0x2b0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICERUNL_ENTRY=0x2b5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICERUNL_EXIT=0x2b6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_ENTRY=0x2a7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_EXIT=0x2a8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_ENTRY=0x2ad
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_EXIT=0x2ae
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_ENTRY=0x2a3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_EXIT=0x2a4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_ENTRY=0x29c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_EXIT=0x29d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_ENTRY=0x2a1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_EXIT=0x2a2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTRUNL_ENTRY=0x2b3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTRUNL_EXIT=0x2b4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_NEWL_ENTRY=0x294
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_NEWL_EXIT=0x295
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_ENTRY=0x29e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT=0x29f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT_DUP01=0x2a0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_BUSERRORL_ENTRY=0x2d0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_BUSERRORL_EXIT=0x2d1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CONSTRUCTL_ENTRY=0x2bb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CONSTRUCTL_EXIT=0x2bc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY=0x2b9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY_DUP01=0x2bd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT=0x2ba
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT_DUP01=0x2be
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_ENTRY=0x2c5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_EXIT=0x2c6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_ENTRY=0x2c9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT=0x2ca
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT_DUP01=0x2cb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_ENTRY=0x2ce
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_EXIT=0x2cf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICERUNL_ENTRY=0x2d4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICERUNL_EXIT=0x2d5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_ENTRY=0x2c7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_EXIT=0x2c8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_ENTRY=0x2cc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_EXIT=0x2cd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_ENTRY=0x2c1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_EXIT=0x2c2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_ENTRY=0x2bf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_EXIT=0x2c0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_ENTRY=0x2c3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_EXIT=0x2c4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTRUNL_ENTRY=0x2d2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTRUNL_EXIT=0x2d3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_NEWL_ENTRY=0x2b7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_NEWL_EXIT=0x2b8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CONSTRUCTL_ENTRY=0x2da
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CONSTRUCTL_EXIT=0x2db
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY=0x2d8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY_DUP01=0x2dc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT=0x2d9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT_DUP01=0x2dd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_ENTRY=0x2e3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT=0x2e4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT_DUP01=0x2e5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_ENTRY=0x2de
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT=0x2df
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x2e0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_NEWL_ENTRY=0x2d6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_NEWL_EXIT=0x2d7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_ENTRY=0x2e1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_EXIT=0x2e2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CONSTRUCTL_ENTRY=0x2ea
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CONSTRUCTL_EXIT=0x2eb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY=0x2e8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY_DUP01=0x2ec
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT=0x2e9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT_DUP01=0x2ed
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_ENTRY=0x2f3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT=0x2f4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT_DUP01=0x2f5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_ENTRY=0x2ee
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT=0x2ef
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x2f0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_NEWL_ENTRY=0x2e6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_NEWL_EXIT=0x2e7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_ENTRY=0x2f1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_EXIT=0x2f2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CONSTRUCTL_ENTRY=0x2fa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CONSTRUCTL_EXIT=0x2fb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY=0x2f8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY_DUP01=0x2fc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT=0x2f9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT_DUP01=0x2fd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_ENTRY=0x303
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT=0x304
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT_DUP01=0x305
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_ENTRY=0x2fe
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT=0x2ff
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x300
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_NEWL_ENTRY=0x2f6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_NEWL_EXIT=0x2f7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_ENTRY=0x301
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_EXIT=0x302
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CONSTRUCTL_ENTRY=0x30a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CONSTRUCTL_EXIT=0x30b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY=0x308
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY_DUP01=0x30c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT=0x309
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT_DUP01=0x30d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_ENTRY=0x314
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT=0x315
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT_DUP01=0x316
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_ENTRY=0x30e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT=0x30f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x310
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_NEWL_ENTRY=0x306
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_NEWL_EXIT=0x307
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_ENTRY=0x311
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT=0x312
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT_DUP01=0x313
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CONSTRUCTL_ENTRY=0x31b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CONSTRUCTL_EXIT=0x31c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY=0x319
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY_DUP01=0x31d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT=0x31a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT_DUP01=0x31e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_ENTRY=0x324
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT=0x325
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT_DUP01=0x326
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_ENTRY=0x31f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT=0x320
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x321
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_NEWL_ENTRY=0x317
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_NEWL_EXIT=0x318
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_ENTRY=0x322
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_EXIT=0x323
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CONSTRUCTL_ENTRY=0x32b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CONSTRUCTL_EXIT=0x32c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY=0x329
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY_DUP01=0x32d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT=0x32a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT_DUP01=0x32e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_ENTRY=0x336
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_EXIT=0x337
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_ENTRY=0x331
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT=0x332
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x333
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_ENTRY=0x32f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_EXIT=0x330
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_NEWL_ENTRY=0x327
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_NEWL_EXIT=0x328
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_ENTRY=0x338
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT=0x339
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT_DUP01=0x33a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_ENTRY=0x334
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_EXIT=0x335
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CONSTRUCTL_ENTRY=0x33f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CONSTRUCTL_EXIT=0x340
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY=0x33d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY_DUP01=0x341
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT=0x33e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT_DUP01=0x342
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_ENTRY=0x34a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_EXIT=0x34b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_ENTRY=0x345
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT=0x346
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x347
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_INDEX_ENTRY=0x34c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_INDEX_EXIT=0x34d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_ENTRY=0x343
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_EXIT=0x344
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_NEWL_ENTRY=0x33b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_NEWL_EXIT=0x33c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_ENTRY=0x348
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_EXIT=0x349
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY=0x34e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT=0x34f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01=0x350
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CONSTRUCTL_ENTRY=0x355
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CONSTRUCTL_EXIT=0x356
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY=0x353
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY_DUP01=0x357
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT=0x354
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT_DUP01=0x358
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_ENTRY=0x35e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_EXIT=0x35f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_ENTRY=0x359
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT=0x35a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x35b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_NEWL_ENTRY=0x351
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_NEWL_EXIT=0x352
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_ENTRY=0x35c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_EXIT=0x35d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CONSTRUCTL_ENTRY=0x364
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CONSTRUCTL_EXIT=0x365
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY=0x362
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY_DUP01=0x366
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT=0x363
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT_DUP01=0x367
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_ENTRY=0x36d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_EXIT=0x36e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_ENTRY=0x368
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT=0x369
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x36a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_NEWL_ENTRY=0x360
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_NEWL_EXIT=0x361
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_ENTRY=0x36b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_EXIT=0x36c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CONSTRUCTL_ENTRY=0x373
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CONSTRUCTL_EXIT=0x374
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY=0x371
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY_DUP01=0x375
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT=0x372
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT_DUP01=0x376
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_ENTRY=0x37c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT=0x37d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT_DUP01=0x37e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_ENTRY=0x377
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT=0x378
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x379
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_NEWL_ENTRY=0x36f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_NEWL_EXIT=0x370
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_ENTRY=0x37a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_EXIT=0x37b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CONSTRUCTL_ENTRY=0x383
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CONSTRUCTL_EXIT=0x384
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY=0x381
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY_DUP01=0x385
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT=0x382
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT_DUP01=0x386
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_ENTRY=0x38c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_EXIT=0x38d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_ENTRY=0x387
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT=0x388
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x389
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_NEWL_ENTRY=0x37f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_NEWL_EXIT=0x380
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_ENTRY=0x38a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_EXIT=0x38b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CONSTRUCTL_ENTRY=0x392
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CONSTRUCTL_EXIT=0x393
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY=0x390
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY_DUP01=0x394
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT=0x391
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT_DUP01=0x395
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_ENTRY=0x3a7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_EXIT=0x3a8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_ENTRY=0x3a2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT=0x3a3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x3a4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_ENTRY=0x398
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_EXIT=0x399
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_ENTRY=0x3a9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_EXIT=0x3aa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_ENTRY=0x396
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_EXIT=0x397
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_NEWL_ENTRY=0x38e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_NEWL_EXIT=0x38f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_ENTRY=0x39d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT=0x39e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT_DUP01=0x39f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_ENTRY=0x39a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT=0x39b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT_DUP01=0x39c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_ENTRY=0x3a0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_EXIT=0x3a1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_ENTRY=0x3a5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_EXIT=0x3a6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CONSTRUCTL_ENTRY=0x3af
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CONSTRUCTL_EXIT=0x3b0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY=0x3ad
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY_DUP01=0x3b1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT=0x3ae
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT_DUP01=0x3b2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_ENTRY=0x3c5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_EXIT=0x3c6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_ENTRY=0x3c0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT=0x3c1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x3c2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_ENTRY=0x3b5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_EXIT=0x3b6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_ENTRY=0x3c7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_EXIT=0x3c8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_ENTRY=0x3b3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_EXIT=0x3b4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_NEWL_ENTRY=0x3ab
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_NEWL_EXIT=0x3ac
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_ENTRY=0x3b7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT=0x3b8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT_DUP01=0x3b9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_ENTRY=0x3be
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_EXIT=0x3bf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_ENTRY=0x3c3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_EXIT=0x3c4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY=0x3ba
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT=0x3bb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01=0x3bc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP02=0x3bd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_BUSERRORL_ENTRY=0x3e2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_BUSERRORL_EXIT=0x3e3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CONSTRUCTL_ENTRY=0x3cd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CONSTRUCTL_EXIT=0x3ce
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY=0x3cb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY_DUP01=0x3cf
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT=0x3cc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT_DUP01=0x3d0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_ENTRY=0x3d7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_EXIT=0x3d8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_ENTRY=0x3d9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT=0x3da
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT_DUP01=0x3db
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_ENTRY=0x3e0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_EXIT=0x3e1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICERUNL_ENTRY=0x3ea
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICERUNL_EXIT=0x3eb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_ENTRY=0x3e4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_EXIT=0x3e5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_ENTRY=0x3e6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_EXIT=0x3e7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_ENTRY=0x3d3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_EXIT=0x3d4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_ENTRY=0x3d1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_EXIT=0x3d2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_ENTRY=0x3d5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_EXIT=0x3d6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTRUNL_ENTRY=0x3e8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTRUNL_EXIT=0x3e9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_ENTRY=0x3dc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_EXIT=0x3dd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_ENTRY=0x3de
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_EXIT=0x3df
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_NEWL_ENTRY=0x3c9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_NEWL_EXIT=0x3ca
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_ENTRY=0x3ec
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_EXIT=0x3ed
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_ENTRY=0x3ee
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_EXIT=0x3ef
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CONSTRUCTL_ENTRY=0x3f6
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CONSTRUCTL_EXIT=0x3f7
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY=0x3f2
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY_DUP01=0x3f8
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT=0x3f3
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT_DUP01=0x3f9
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_ENTRY=0x3fa
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT=0x3fb
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT_DUP01=0x3fc
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_ENTRY=0x403
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_EXIT=0x404
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_ENTRY=0x405
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT=0x406
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x407
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_ENTRY=0x3f4
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_EXIT=0x3f5
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_ENTRY=0x3fd
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_EXIT=0x3fe
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_ENTRY=0x3ff
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_EXIT=0x400
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_ENTRY=0x401
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_EXIT=0x402
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_NEWL_ENTRY=0x3f0
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_NEWL_EXIT=0x3f1
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_ENTRY=0x40c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_EXIT=0x40d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_ENTRY=0x40e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_EXIT=0x40f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_ENTRY=0x408
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_EXIT=0x409
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_ENTRY=0x40a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_EXIT=0x40b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_BUSERRORL_ENTRY=0x429
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_BUSERRORL_EXIT=0x42a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CONSTRUCTL_ENTRY=0x414
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CONSTRUCTL_EXIT=0x415
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY=0x412
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY_DUP01=0x416
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT=0x413
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT_DUP01=0x417
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_ENTRY=0x41e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_EXIT=0x41f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_ENTRY=0x420
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT=0x421
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT_DUP01=0x422
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_ENTRY=0x427
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_EXIT=0x428
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICERUNL_ENTRY=0x431
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICERUNL_EXIT=0x432
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_ENTRY=0x42b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_EXIT=0x42c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_ENTRY=0x42d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_EXIT=0x42e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_ENTRY=0x41a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_EXIT=0x41b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_ENTRY=0x418
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_EXIT=0x419
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_ENTRY=0x41c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_EXIT=0x41d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTRUNL_ENTRY=0x42f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTRUNL_EXIT=0x430
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_ENTRY=0x423
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_EXIT=0x424
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_ENTRY=0x425
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_EXIT=0x426
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_NEWL_ENTRY=0x410
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_NEWL_EXIT=0x411
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_ENTRY=0x435
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_EXIT=0x436
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_ENTRY=0x433
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_EXIT=0x434
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_BUSERRORL_ENTRY=0x448
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_BUSERRORL_EXIT=0x449
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CONSTRUCTL_ENTRY=0x43b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CONSTRUCTL_EXIT=0x43c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY=0x439
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY_DUP01=0x43d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT=0x43a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT_DUP01=0x43e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_ENTRY=0x454
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_EXIT=0x455
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_ENTRY=0x443
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT=0x444
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT_DUP01=0x445
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_ENTRY=0x446
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_EXIT=0x447
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICERUNL_ENTRY=0x450
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICERUNL_EXIT=0x451
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_ENTRY=0x44a
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_EXIT=0x44b
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_ENTRY=0x44c
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_EXIT=0x44d
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_ENTRY=0x441
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_EXIT=0x442
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_ENTRY=0x43f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_EXIT=0x440
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_ENTRY=0x452
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_EXIT=0x453
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTRUNL_ENTRY=0x44e
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTRUNL_EXIT=0x44f
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_NEWL_ENTRY=0x437
+[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_NEWL_EXIT=0x438
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_CREATETESTCASEL_ENTRY=0x542
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_INSTANCE_ENTRY=0x53a
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_INSTANCE_EXIT=0x53b
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_LISTREGISTEREDTESTCASES_ENTRY=0x543
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_LISTREGISTEREDTESTCASES_EXIT=0x544
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_REGISTERTESTCASE_ENTRY=0x540
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_REGISTERTESTCASE_EXIT=0x541
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_ENTRY=0x53c
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_ENTRY_DUP01=0x53e
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_EXIT=0x53d
+[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_EXIT_DUP01=0x53f
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_ONSTATECHANGEL_ENTRY=0x54d
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_ONSTATECHANGEL_EXIT=0x54e
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_OPENL_ENTRY=0x54b
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_OPENL_EXIT=0x54c
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_ENTRY=0x545
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP01=0x547
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP02=0x549
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_EXIT=0x546
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP01=0x548
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP02=0x54a
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_ONSTATECHANGEL_ENTRY=0x557
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_ONSTATECHANGEL_EXIT=0x558
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_OPENL_ENTRY=0x555
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_OPENL_EXIT=0x556
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_ENTRY=0x54f
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP01=0x551
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP02=0x553
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_EXIT=0x550
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP01=0x552
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP02=0x554
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_ONSTATECHANGEL_ENTRY=0x561
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_ONSTATECHANGEL_EXIT=0x562
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_OPENL_ENTRY=0x55f
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_OPENL_EXIT=0x560
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_ENTRY=0x559
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP01=0x55b
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP02=0x55d
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_EXIT=0x55a
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP01=0x55c
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP02=0x55e
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_ONSTATECHANGEL_ENTRY=0x56b
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_ONSTATECHANGEL_EXIT=0x56c
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_OPENL_ENTRY=0x569
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_OPENL_EXIT=0x56a
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_ENTRY=0x563
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_ENTRY_DUP01=0x565
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_ENTRY_DUP02=0x567
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_EXIT=0x564
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_EXIT_DUP01=0x566
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_EXIT_DUP02=0x568
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_ONSTATECHANGEL_ENTRY=0x652
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_ONSTATECHANGEL_EXIT=0x653
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_OPENL_ENTRY=0x650
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_OPENL_EXIT=0x651
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY=0x64a
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP01=0x64c
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP02=0x64e
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT=0x64b
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP01=0x64d
+[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP02=0x64f
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_ENTRY=0x59f
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_EXIT=0x5a0
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ADDINTERFACE_ENTRY=0x58b
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ADDINTERFACE_EXIT=0x58c
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_ENTRY=0x579
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_EXIT=0x57a
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CLOSE_ENTRY=0x575
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CLOSE_EXIT=0x576
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_INTERFACE_ENTRY=0x58d
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_INTERFACE_EXIT=0x58e
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_OPENL_ENTRY=0x57b
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_OPENL_EXIT=0x57c
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_ENTRY=0x595
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_EXIT=0x596
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP01=0x597
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP02=0x598
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REMOTEWAKEUP_ENTRY=0x593
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REMOTEWAKEUP_EXIT=0x594
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REPORTERROR_ENTRY=0x5a1
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REPORTERROR_EXIT=0x5a2
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RESETSTATE_ENTRY=0x571
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RESETSTATE_EXIT=0x572
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY=0x56d
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP01=0x56f
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP02=0x573
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT=0x56e
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP01=0x570
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP02=0x574
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCLASSCODE_ENTRY=0x57d
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCLASSCODE_EXIT=0x57e
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCONFIGURATIONSTRING_ENTRY=0x589
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCONFIGURATIONSTRING_EXIT=0x58a
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_ENTRY=0x583
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT=0x584
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP01=0x585
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP02=0x586
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP03=0x587
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP04=0x588
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETUSBSPECIFICATION_ENTRY=0x57f
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETUSBSPECIFICATION_EXIT=0x580
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETVENDOR_ENTRY=0x581
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETVENDOR_EXIT=0x582
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWARECONNECT_ENTRY=0x58f
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWARECONNECT_EXIT=0x590
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWAREDISCONNECT_ENTRY=0x591
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWAREDISCONNECT_EXIT=0x592
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STARTEP0READING_ENTRY=0x59b
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STARTEP0READING_EXIT=0x59c
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STATECHANGEL_ENTRY=0x599
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STATECHANGEL_EXIT=0x59a
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STOPEP0READING_ENTRY=0x59d
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STOPEP0READING_EXIT=0x59e
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SUBSCRIBETOREPORTS_ENTRY=0x577
+[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SUBSCRIBETOREPORTS_EXIT=0x578
+[TRACE]TRACE_FLOW[0x8A]__E32MAIN_ENTRY=0x51b
+[TRACE]TRACE_FLOW[0x8A]__E32MAIN_EXIT=0x51c
+[TRACE]TRACE_FLOW[0x8A]__E32MAIN_EXIT_DUP01=0x51d
+[TRACE]TRACE_FLOW[0x8A]__KILLTEST_ENTRY=0x4c6
+[TRACE]TRACE_FLOW[0x8A]__KILLTEST_EXIT=0x4c7
+[TRACE]TRACE_FLOW[0x8A]__MAINL_ENTRY=0x519
+[TRACE]TRACE_FLOW[0x8A]__MAINL_EXIT=0x51a
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL=0x34e
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP01=0x34f
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP02=0x350
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP03=0x351
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP04=0x352
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP05=0x353
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF=0x356
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF_DUP01=0x357
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF_DUP02=0x358
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF_DUP03=0x359
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DOCANCEL=0x35a
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DOCANCEL_DUP01=0x35b
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_MONITOR=0x35c
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNERROR=0x362
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL=0x35d
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP01=0x35e
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP02=0x35f
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP03=0x360
+[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP04=0x361
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL=0x1
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP01=0x3
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP02=0x4
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP03=0x5
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP04=0x6
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP05=0x7
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP06=0x8
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP07=0x9
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP08=0x2
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES=0x32
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP01=0x33
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP02=0x34
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP03=0x35
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP04=0x36
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_HOSTRUNL=0x16
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_HOSTRUNL_DUP01=0x17
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_RECORDTIME=0x30
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_RECORDTIME_DUP01=0x31
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL=0xa
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP01=0xb
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP02=0xc
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP03=0xd
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP04=0xe
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP05=0xf
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP06=0x10
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP07=0x11
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP08=0x12
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP09=0x13
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP10=0x14
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP11=0x15
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA=0x18
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP01=0x19
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP02=0x1a
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP03=0x1b
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP04=0x1d
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP05=0x1e
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP06=0x20
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP07=0x21
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP08=0x22
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP09=0x23
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP10=0x25
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP11=0x26
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP12=0x28
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP13=0x29
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP14=0x2a
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP15=0x2c
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP16=0x2d
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP17=0x2f
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP50=0x1c
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP51=0x1f
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP52=0x24
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP53=0x27
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP54=0x2b
+[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP55=0x2e
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_BASECONSTRUCTL=0x37
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_BASECONSTRUCTL_DUP01=0x38
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_BASECONSTRUCTL_DUP02=0x39
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_CHECKTREE=0x59
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_CHECKTREE_DUP01=0x5a
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF=0x3c
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP01=0x3d
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP02=0x3e
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP03=0x3f
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP04=0x40
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP05=0x41
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP06=0x42
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP07=0x43
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP08=0x44
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP09=0x45
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP10=0x46
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GENERATEREFFILE=0x3a
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GENERATEREFFILE_DUP01=0x3b
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS=0x4a
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP01=0x4b
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP02=0x4c
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP03=0x4d
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP04=0x4e
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP05=0x4f
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP06=0x50
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP07=0x51
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP08=0x52
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP09=0x53
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP10=0x54
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP11=0x55
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP12=0x56
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE=0x5b
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_DUP01=0x5c
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PRINTANDSTORECHUNK=0x57
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PRINTANDSTORECHUNK_DUP01=0x58
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_RUNERROR=0x47
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_TESTFAILED=0x48
+[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_TESTPASSED=0x49
+[TRACE]TRACE_NORMAL[0x86]_CBASICWATCHER_DOCANCEL=0x2f3
+[TRACE]TRACE_NORMAL[0x86]_CBASICWATCHER_RUNERROR=0x2f4
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_CBULKTRANSFER=0x371
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFERIN=0x372
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT=0x373
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP01=0x374
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP02=0x375
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP03=0x376
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP10=0x377
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP11=0x378
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP12=0x379
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP13=0x37a
+[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP14=0x37b
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL=0x2f6
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP01=0x2f7
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP02=0x2f8
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP03=0x2f9
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP04=0x2fa
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP05=0x2fb
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP06=0x2fc
+[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_ENDPOINTREADERROR=0x2f5
+[TRACE]TRACE_NORMAL[0x86]_CDEVICEENDPOINT0_CONSTRUCTL=0x5d
+[TRACE]TRACE_NORMAL[0x86]_CDEVICEENDPOINT0_START=0x5e
+[TRACE]TRACE_NORMAL[0x86]_CDEVICEENDPOINT0_STOP=0x5f
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_ACKNOWLEDGE=0x324
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_READL=0x321
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_READPACKETL=0x320
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_READUNTILSHORTL=0x322
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_REPEATEDREADANDVALIDATEL=0x323
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNERROR=0x334
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL=0x325
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP01=0x326
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP02=0x327
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP03=0x328
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP04=0x329
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP05=0x32a
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP06=0x32b
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP07=0x32c
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP08=0x32d
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP09=0x32e
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP10=0x32f
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP11=0x331
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP12=0x333
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP50=0x330
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP51=0x332
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_CREATEBIGBUFFER=0x34d
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_DCENDPOINTWRITER=0x335
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL=0x336
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP01=0x337
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP02=0x338
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP03=0x339
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP04=0x33b
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP05=0x33c
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP06=0x33d
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP07=0x33e
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP53=0x33a
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE=0x33f
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL=0x34b
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_DUP01=0x34c
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS=0x344
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP01=0x346
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP02=0x347
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP03=0x348
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP50=0x345
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEUSINGPATTERNL=0x349
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEUSINGPATTERNL_DUP01=0x34a
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP01=0x340
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP02=0x342
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP03=0x343
+[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP51=0x341
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_RUNL=0x31f
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST=0x2fd
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP01=0x2fe
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP02=0x2ff
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP03=0x300
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP04=0x301
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP06=0x313
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP10=0x302
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP11=0x303
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP12=0x304
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP13=0x305
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP14=0x306
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP15=0x307
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP20=0x308
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP21=0x309
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP22=0x30a
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP23=0x30b
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP24=0x30c
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP30=0x30d
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP31=0x30e
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP32=0x30f
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP33=0x310
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP34=0x311
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP35=0x312
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP40=0x314
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP41=0x315
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP42=0x316
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP43=0x317
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP44=0x318
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP45=0x319
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP50=0x31a
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP51=0x31b
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP52=0x31c
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP53=0x31d
+[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP54=0x31e
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL=0x407
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP01=0x408
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP02=0x409
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP03=0x40a
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP04=0x40b
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP05=0x40c
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP06=0x40d
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP07=0x40e
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP08=0x40f
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP09=0x410
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP10=0x411
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP11=0x412
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP12=0x413
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP13=0x414
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP14=0x415
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL=0x41d
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_BASECONSTRUCTL=0x406
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTNUMBERL=0x417
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTNUMBERL_DUP01=0x419
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTNUMBERL_DUP50=0x418
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTTWONUMBERSL=0x41a
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP01=0x41c
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP50=0x41b
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL=0x41e
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP01=0x41f
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP02=0x420
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP03=0x421
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP04=0x422
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP05=0x423
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP06=0x425
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP07=0x426
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP08=0x427
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP09=0x428
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP10=0x429
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP11=0x42a
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP12=0x42b
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP13=0x42c
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP14=0x42d
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP15=0x42e
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP16=0x42f
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP17=0x430
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP18=0x431
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP19=0x432
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP20=0x433
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP21=0x434
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP22=0x435
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP23=0x436
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP24=0x437
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP25=0x439
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP26=0x43a
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP27=0x43b
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP54=0x438
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP55=0x424
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_STALLENDPOINT=0x416
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL=0x43c
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP01=0x43d
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP02=0x43e
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP03=0x440
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP04=0x441
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP05=0x443
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP06=0x444
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP07=0x445
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP08=0x446
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP09=0x448
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP10=0x449
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP11=0x44b
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP12=0x44c
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP13=0x44d
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP14=0x44f
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP15=0x450
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP16=0x452
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP52=0x43f
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP53=0x44e
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP54=0x442
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP55=0x451
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP58=0x447
+[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP60=0x44a
+[TRACE]TRACE_NORMAL[0x86]_CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR=0x37d
+[TRACE]TRACE_NORMAL[0x86]_CINTERRUPTTRANSFER_TRANSFERINL=0x37c
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_CISOCHTRANSFER=0x37e
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED=0x37f
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED_DUP01=0x380
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED_DUP02=0x381
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED_DUP03=0x382
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_PREPARETRANSFER=0x386
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_PREPARETRANSFER_DUP01=0x387
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_PREPARETRANSFER_DUP02=0x388
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR=0x385
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_TRANSFERINL=0x383
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_TRANSFERINL_DUP01=0x384
+[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_TRANSFEROUT=0x389
+[TRACE]TRACE_NORMAL[0x86]_CREMOTEWAKEUPTIMER_RUNL=0x46f
+[TRACE]TRACE_NORMAL[0x86]_CSOFTWARECONNECTTIMER_RUNL=0x38d
+[TRACE]TRACE_NORMAL[0x86]_CSOFTWARECONNECTTIMER_RUNL_DUP01=0x38e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL=0x393
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP01=0x394
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP02=0x395
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP03=0x396
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP04=0x397
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP05=0x398
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER=0x38f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP01=0x390
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP02=0x391
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP03=0x392
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL=0x399
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP01=0x39a
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP02=0x39b
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP03=0x39c
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP04=0x39d
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP05=0x39e
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP06=0x39f
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP07=0x3a0
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP08=0x3a1
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP09=0x3a2
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP10=0x3a3
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP11=0x3a4
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP12=0x3a5
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP13=0x3a6
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP14=0x3a7
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP15=0x3a8
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP16=0x3a9
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP17=0x3aa
+[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP18=0x3ab
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL=0x3f4
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP01=0x3f5
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP02=0x3f6
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP03=0x3f7
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP04=0x3f8
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP05=0x3f9
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP06=0x3fa
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP07=0x3fb
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP08=0x3fc
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP09=0x3fd
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP10=0x3fe
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP11=0x3ff
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP12=0x400
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP13=0x401
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL=0x402
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL_DUP01=0x403
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL_DUP02=0x404
+[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL_DUP03=0x405
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL=0x458
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP01=0x459
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP02=0x45a
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP03=0x45b
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP04=0x45c
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOTESTL=0x45e
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNERROR=0x463
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL=0x45f
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL_DUP01=0x460
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL_DUP02=0x461
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL_DUP03=0x462
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNTESTCASEL=0x453
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNTESTCASEL_DUP01=0x454
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNTESTCASEL_DUP02=0x455
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE=0x456
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_DUP01=0x457
+[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_THREADFUNCTION=0x45d
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_CONSTRUCTL=0x464
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL=0x465
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP01=0x466
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP02=0x467
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP03=0x468
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP04=0x469
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP05=0x46a
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP06=0x46b
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP07=0x46c
+[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP08=0x46d
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL=0x363
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP01=0x364
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP02=0x365
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP03=0x366
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP04=0x367
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP05=0x368
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP06=0x369
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP07=0x36a
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP08=0x36b
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP09=0x36c
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP10=0x36d
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP11=0x36e
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNERROR=0x370
+[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNL=0x36f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL=0x60
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP01=0x61
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP02=0x62
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP03=0x63
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP04=0x64
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP05=0x65
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP06=0x66
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP07=0x67
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP08=0x68
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP09=0x69
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP10=0x6a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP11=0x6b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP12=0x6c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP13=0x6d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP14=0x6e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP15=0x6f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP16=0x70
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL=0x72
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL=0x71
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_HOSTRUNL=0x73
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP01=0x74
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP02=0x75
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM=0x8b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_DUP01=0x8c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS=0x8d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP01=0x8e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP02=0x8f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP03=0x90
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP04=0x91
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP05=0x92
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP06=0x93
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP07=0x94
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL=0x76
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP01=0x77
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP02=0x78
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP03=0x79
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP04=0x7a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP05=0x7b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP06=0x7c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP07=0x7d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP08=0x7e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP09=0x7f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP10=0x80
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP11=0x81
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP12=0x82
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP13=0x83
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP14=0x84
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP15=0x85
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP16=0x86
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL=0x95
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP01=0x96
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP02=0x97
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP03=0x98
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP04=0x99
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP05=0x9a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP06=0x9b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP07=0x9c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP08=0x9d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP09=0x9e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP10=0x9f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP11=0xa0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP12=0xa1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL=0xa2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP01=0xa3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP02=0xa4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP03=0xa5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_HOSTRUNL=0xa6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_HOSTRUNL_DUP01=0xa7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL=0x87
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_DUP01=0x88
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL=0x89
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_DUP01=0x8a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL=0xa8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP01=0xa9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP02=0xaa
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL=0xab
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_HOSTRUNL=0xac
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_HOSTRUNL_DUP01=0xad
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA=0xae
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL=0xaf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP01=0xb0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP02=0xb1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP03=0xb2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP04=0xb3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP05=0xb4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP06=0xb5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP07=0xb6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP08=0xb7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP09=0xb8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP10=0xb9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP11=0xba
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP12=0xbb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP13=0xbc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP14=0xbd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP15=0xbe
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP16=0xbf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP17=0xc0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP18=0xc1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP19=0xc2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP20=0xc3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL=0xc4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_HOSTRUNL=0xc5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_HOSTRUNL_DUP01=0xc6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL=0xc7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP01=0xc8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP02=0xc9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP03=0xca
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP04=0xcb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP05=0xcc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP06=0xcd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL=0xce
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_DUP01=0xcf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_HOSTRUNL=0xd0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_HOSTRUNL_DUP01=0xd1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL=0xd2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP01=0xd3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP02=0xd4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP03=0xd5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP04=0xd6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL=0xd7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_DUP01=0xd8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_HOSTRUNL=0xd9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_HOSTRUNL_DUP01=0xda
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL=0xdb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP01=0xdc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP02=0xdd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP03=0xde
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP04=0xdf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP05=0xe0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP06=0xe1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL=0xe2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP01=0xe3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP02=0xe4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_HOSTRUNL=0xe5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_HOSTRUNL_DUP01=0xe6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL=0xe7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP01=0xe8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP02=0xe9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP03=0xea
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP04=0xeb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP05=0xec
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP06=0xed
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP07=0xee
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL=0xef
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_DUP01=0xf0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_HOSTRUNL=0xf1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_HOSTRUNL_DUP01=0xf2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL=0xf9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP01=0xfa
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP02=0xfb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP03=0xfc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP04=0xfd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP05=0xfe
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP06=0xff
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP07=0x100
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP08=0x101
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP09=0x102
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP10=0x103
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP11=0x104
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP12=0x105
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP13=0x106
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL=0x10f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP01=0x110
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP02=0x111
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT=0xf6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP01=0xf7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP02=0xf8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT=0xf3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP01=0xf4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP02=0xf5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_HOSTRUNL=0x112
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_HOSTRUNL_DUP01=0x113
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA=0x107
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP01=0x108
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP02=0x109
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP03=0x10a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL=0x10b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP01=0x10c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP02=0x10d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP03=0x10e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL=0x117
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP01=0x118
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP02=0x119
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP03=0x11a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP04=0x11b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL=0x114
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP01=0x115
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP02=0x116
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_HOSTRUNL=0x11c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_HOSTRUNL_DUP01=0x11d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL=0x12d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP01=0x12e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP02=0x12f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL=0x11e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_DUP01=0x11f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL=0x120
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP01=0x121
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP02=0x122
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP03=0x123
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP04=0x124
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP05=0x125
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP06=0x126
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP07=0x127
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP08=0x128
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP09=0x129
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP10=0x12a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP11=0x12b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP12=0x12c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL=0x130
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP01=0x131
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP02=0x132
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP03=0x133
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL=0x134
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP01=0x135
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP02=0x136
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP03=0x137
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP04=0x138
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_HOSTRUNL=0x139
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_HOSTRUNL_DUP01=0x13a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_CHECKSN=0x13b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL=0x142
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP01=0x143
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP02=0x144
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP03=0x145
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP04=0x146
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP05=0x147
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP06=0x148
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP07=0x149
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP08=0x14a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP09=0x14b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP10=0x14c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP11=0x14d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP12=0x14e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP13=0x14f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL=0x150
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_DUP01=0x151
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL=0x13c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP01=0x13d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP02=0x13e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL=0x13f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP01=0x140
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP02=0x141
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL=0x152
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP01=0x153
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP02=0x154
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP03=0x155
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP04=0x156
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP05=0x157
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP06=0x158
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP07=0x159
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP08=0x15a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP09=0x15b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP10=0x15c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP11=0x15d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP12=0x15e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP13=0x15f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL=0x160
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_HOSTRUNL=0x16b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_HOSTRUNL_DUP01=0x16c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL=0x161
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP01=0x162
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP02=0x163
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP03=0x164
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP04=0x165
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP05=0x166
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP06=0x167
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP07=0x168
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP08=0x169
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP09=0x16a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL=0x16d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP01=0x16e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP02=0x16f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP03=0x170
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP04=0x171
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP05=0x172
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP06=0x173
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP07=0x174
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL=0x175
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_DUP01=0x176
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_HOSTRUNL=0x177
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_HOSTRUNL_DUP01=0x178
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL=0x179
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP01=0x17a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP02=0x17b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP03=0x17c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL=0x17d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP01=0x17e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_HOSTRUNL=0x17f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_HOSTRUNL_DUP01=0x180
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL=0x18b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_DUP01=0x18c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL=0x181
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP01=0x182
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP02=0x183
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP03=0x184
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP04=0x185
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP05=0x186
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL=0x187
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP01=0x188
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP02=0x189
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP03=0x18a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL=0x197
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP01=0x198
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP02=0x199
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL=0x18d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP01=0x18e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP02=0x18f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP03=0x190
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP04=0x191
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP05=0x192
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL=0x193
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP01=0x194
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP02=0x195
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP03=0x196
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL=0x1a5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_DUP01=0x1a6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL=0x19a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP01=0x19b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP02=0x19c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP03=0x19d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP04=0x19e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP05=0x19f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL=0x1a0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP01=0x1a1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP02=0x1a2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP03=0x1a3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP04=0x1a4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL=0x1b3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP01=0x1b4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP02=0x1b5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP03=0x1b6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP04=0x1b7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL=0x1a7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP01=0x1a8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP02=0x1a9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP03=0x1ab
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP04=0x1ac
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP52=0x1aa
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL=0x1ad
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP01=0x1ae
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP02=0x1af
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP03=0x1b0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP04=0x1b1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP05=0x1b2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL=0x1c2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_DUP01=0x1c3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL=0x1b8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP01=0x1b9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP02=0x1ba
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP03=0x1bb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP04=0x1bc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP05=0x1bd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL=0x1be
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP01=0x1bf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP02=0x1c0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP03=0x1c1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_CONSTRUCTL=0x1c4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL=0x1d7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP01=0x1d8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP02=0x1d9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP03=0x1da
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL=0x1c5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP01=0x1c6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP02=0x1c7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP03=0x1c8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP04=0x1c9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP05=0x1ca
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP06=0x1cb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP07=0x1cd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP08=0x1ce
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP09=0x1cf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP10=0x1d0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP11=0x1d1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP56=0x1cc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER=0x1db
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_DUP01=0x1dc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL=0x1d2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP01=0x1d3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP02=0x1d4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP03=0x1d5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP04=0x1d6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_CONSTRUCTL=0x1dd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL=0x1ec
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP01=0x1ed
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP02=0x1ee
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP03=0x1ef
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL=0x1de
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP01=0x1df
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP02=0x1e0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP03=0x1e1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP04=0x1e2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP05=0x1e3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP06=0x1e4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP07=0x1e5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL=0x1e6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP01=0x1e7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP02=0x1e8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP03=0x1e9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP04=0x1ea
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP05=0x1eb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS=0x1f0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01=0x1f1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02=0x1f2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03=0x1f3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL=0x208
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP01=0x209
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP02=0x20a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP03=0x20b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP04=0x20c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL=0x1f4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP01=0x1f5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP02=0x1f6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP03=0x1f7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP04=0x1f8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP05=0x1f9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP06=0x1fa
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP07=0x1fb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL=0x1fc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP01=0x1fd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP02=0x1fe
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP03=0x1ff
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP04=0x200
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP05=0x201
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP06=0x202
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP07=0x203
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP08=0x204
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP09=0x205
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP10=0x206
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP11=0x207
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_CONSTRUCTL=0x20d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL=0x231
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP01=0x232
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP02=0x233
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP03=0x234
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP04=0x235
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL=0x20e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP01=0x20f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP02=0x210
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP03=0x211
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP04=0x212
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP05=0x213
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP06=0x214
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP07=0x215
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP08=0x216
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP09=0x218
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP10=0x219
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP11=0x21a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP12=0x21b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP13=0x21c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP14=0x21d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP15=0x21f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP16=0x220
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP17=0x221
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP18=0x222
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP19=0x223
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP54=0x21e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP58=0x217
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL=0x224
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP01=0x225
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP02=0x226
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP03=0x227
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP04=0x228
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP05=0x229
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP06=0x22a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP07=0x22b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP08=0x22c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP09=0x22d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP10=0x22e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP11=0x22f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP12=0x230
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL=0x244
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_DUP01=0x245
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL=0x236
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP01=0x237
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP02=0x238
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP03=0x239
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP04=0x23a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP05=0x23b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP06=0x23c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL=0x23d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP01=0x23e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP02=0x23f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP03=0x240
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP04=0x241
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP05=0x242
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP06=0x243
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL=0x252
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP01=0x253
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP02=0x254
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP03=0x255
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL=0x246
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP01=0x247
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP02=0x248
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP03=0x249
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP04=0x24a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP05=0x24b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL=0x24c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP01=0x24d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP02=0x24e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP03=0x24f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP04=0x250
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP05=0x251
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_CONSTRUCTL=0x256
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL=0x273
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP01=0x274
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP02=0x275
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL=0x25f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP01=0x260
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP02=0x261
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP03=0x262
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP04=0x263
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP05=0x264
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP06=0x265
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP07=0x267
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP08=0x268
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP09=0x269
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP10=0x26a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP11=0x26b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP56=0x266
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES=0x257
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP01=0x258
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP02=0x259
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP03=0x25a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP04=0x25b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER=0x25e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION=0x25c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_DUP01=0x25d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL=0x26c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP01=0x26d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP02=0x26e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP03=0x26f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP04=0x270
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP05=0x271
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP06=0x272
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_CONSTRUCTL=0x276
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL=0x292
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP01=0x293
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP02=0x294
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL=0x282
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP01=0x283
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP02=0x284
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP03=0x285
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP04=0x286
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP05=0x287
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP06=0x288
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP07=0x289
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES=0x277
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP01=0x278
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP02=0x279
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP03=0x27a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP04=0x27b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION=0x27c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_DUP01=0x27d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL=0x28a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP01=0x28b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP02=0x28c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP03=0x28d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP04=0x28e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP05=0x28f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP06=0x290
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP07=0x291
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS=0x27e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01=0x27f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02=0x280
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03=0x281
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231=0x295
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231=0x296
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP01=0x297
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP02=0x298
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP03=0x299
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP04=0x29a
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP05=0x29b
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP06=0x29c
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP07=0x29d
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP08=0x29e
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP09=0x29f
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP10=0x2a0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP11=0x2a1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP12=0x2a2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP13=0x2a3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP14=0x2a4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP15=0x2a5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP16=0x2a6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP17=0x2a7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP18=0x2a8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP19=0x2a9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP20=0x2aa
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP21=0x2ab
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP22=0x2ac
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP23=0x2ad
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP24=0x2ae
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP25=0x2af
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP26=0x2b0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP27=0x2b1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP28=0x2b2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP29=0x2b3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP30=0x2b4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234=0x2b5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP01=0x2b6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP02=0x2b7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP03=0x2b8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP04=0x2b9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP05=0x2ba
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP06=0x2bb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP07=0x2bc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP08=0x2bd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP09=0x2be
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP10=0x2bf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP11=0x2c0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP12=0x2c1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP13=0x2c2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP14=0x2c3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP15=0x2c4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP16=0x2c5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP17=0x2c6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP18=0x2c7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP19=0x2c8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP20=0x2c9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP21=0x2ca
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235=0x2cb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP01=0x2cc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP02=0x2cd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP03=0x2ce
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP04=0x2cf
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP05=0x2d0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP06=0x2d1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP07=0x2d2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP08=0x2d3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP09=0x2d4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP10=0x2d5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP11=0x2d6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP12=0x2d7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP13=0x2d8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP14=0x2d9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP15=0x2da
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP16=0x2db
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP17=0x2dc
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP18=0x2dd
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL=0x2de
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP01=0x2df
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP02=0x2e0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP03=0x2e1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP04=0x2e2
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP05=0x2e3
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP06=0x2e4
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP07=0x2e5
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP08=0x2e6
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP09=0x2e7
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP10=0x2e8
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP11=0x2e9
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP12=0x2ea
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP13=0x2eb
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP14=0x2ec
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP15=0x2ed
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP16=0x2ee
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL=0x2ef
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL=0x2f0
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_HOSTRUNL=0x2f1
+[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_HOSTRUNL_DUP01=0x2f2
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x38c
+[TRACE]TRACE_NORMAL[0x86]_KILLTEST_KILLTEST=0x354
+[TRACE]TRACE_NORMAL[0x86]_KILLTEST_KILLTEST_DUP01=0x355
+[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL=0x38a
+[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP01=0x38b
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES=0x3ad
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01=0x3ae
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02=0x3af
+[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE=0x3ac
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL=0x3b0
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP01=0x3b1
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP02=0x3b2
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP03=0x3b3
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP04=0x3b4
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP05=0x3b5
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP06=0x3b6
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP07=0x3b7
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP08=0x3b8
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP09=0x3b9
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP10=0x3ba
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP11=0x3bb
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP12=0x3bc
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP13=0x3bd
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP14=0x3be
+[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR=0x46e
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED=0x3f1
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_ADDINTERFACE=0x3da
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_CLOSE=0x3c0
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_CLOSE_DUP01=0x3c1
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL=0x3c2
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP01=0x3c3
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP02=0x3c4
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP03=0x3c5
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP04=0x3c6
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP05=0x3c7
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP06=0x3c8
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP07=0x3c9
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP08=0x3ca
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP09=0x3cb
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP10=0x3cc
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL=0x3e2
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP01=0x3e3
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP02=0x3e4
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP03=0x3e5
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP04=0x3e6
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP05=0x3e7
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP06=0x3e8
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP07=0x3ea
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP08=0x3eb
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP09=0x3ec
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP10=0x3ed
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP56=0x3e9
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REMOTEWAKEUP=0x3e0
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REMOTEWAKEUP_DUP01=0x3e1
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REPORTERROR=0x3f2
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REPORTERROR_DUP01=0x3f3
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_RUSBTESTDEVICE=0x3bf
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETCLASSCODE=0x3cd
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETCLASSCODE_DUP01=0x3ce
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETCONFIGURATIONSTRING=0x3d9
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT=0x3d3
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP01=0x3d4
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP02=0x3d5
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP03=0x3d6
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP04=0x3d7
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP05=0x3d8
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETUSBSPECIFICATION=0x3cf
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETUSBSPECIFICATION_DUP01=0x3d0
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETVENDOR=0x3d1
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETVENDOR_DUP01=0x3d2
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWARECONNECT=0x3db
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWARECONNECT_DUP01=0x3dc
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWARECONNECT_DUP02=0x3dd
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWAREDISCONNECT=0x3de
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWAREDISCONNECT_DUP01=0x3df
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_STATECHANGEL=0x3ee
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_STATECHANGEL_DUP01=0x3ef
+[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_STATECHANGEL_DUP02=0x3f0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/OstTraceDefinitions.h	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 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:
+//
+// Description:
+// 
+//
+
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/fixed_id.definitions	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,40 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x1
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x2
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0x3
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP03=0x4
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP04=0x5
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP05=0x6
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP06=0x7
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP07=0x8
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP08=0x9
+[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP09=0xa
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS=0xb
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP01=0xc
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP02=0xd
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP03=0xe
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP04=0xf
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP05=0x10
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP06=0x11
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP07=0x12
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP08=0x13
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP09=0x14
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP10=0x15
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP11=0x16
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP12=0x17
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP13=0x18
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP14=0x19
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP15=0x1a
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP16=0x1b
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP17=0x1c
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP18=0x1d
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP19=0x1e
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP20=0x1f
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP21=0x20
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP22=0x21
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP23=0x22
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP24=0x23
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP25=0x24
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP26=0x25
+[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP27=0x26
--- a/kerneltest/f32test/bench/t_fcachebm.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/bench/t_fcachebm.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -68,7 +68,6 @@
 TBuf16<25> gFileA;
 TBuf16<25> gFileB;
 TBuf16<25> gStreamFile;
-TInt64 gMediaSize;
 
 HBufC8* gBuf = NULL;
 TPtr8 gBufReadPtr(NULL, 0);	
@@ -1456,8 +1455,6 @@
 	r = TheFs.Volume(volInfo, drive);
 	FailIfError(r);
 	
-	gMediaSize = volInfo.iSize;
-	
 	FormatFat(gSessionPath[0]-'A');
 	TheFs.MkDirAll(gSessionPath);
 
--- a/kerneltest/f32test/filesystem/fat/t_checkdisk.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_checkdisk.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -562,7 +562,7 @@
 	TInt r = TheFs.Volume(volInfo, gDrive);
 	test_KErrNone(r);
 
-	gMediaSize = volInfo.iSize;
+	gMediaSize = volInfo.iFree;
 	gSmallFileSize = KBlockSize;
 	gBigFileSize = KBlockSize*20;
 	while(((2*gBigFileSize)+KOneMeg) > gMediaSize )
--- a/kerneltest/f32test/fileutils/inc/f32_test_utils.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/fileutils/inc/f32_test_utils.h	Thu Sep 02 21:54:16 2010 +0300
@@ -59,6 +59,13 @@
 
 TInt FormatDrive(RFs &aFs, TInt aDrive, TBool aQuickFormat); 
 
+//-----------------------------------------------------------------------------
+
+TBool CompareBuffers(const TDesC8& aBuf1, const TDesC8& aBuf2);
+TBool CompareBuffers(const TAny* apBuf1, TUint aBuf1Len, const TAny* apBuf2, TUint aBuf2Len);
+
+void  HexDump(const TDesC8& aBuf);
+void  HexDump(const TAny* apBuf, TUint aBufLen);
 
 //-----------------------------------------------------------------------------
 /** 
@@ -155,6 +162,8 @@
 
 
 
+
+
 //#############################################################################
 //#  some  private helper functions  
 //#############################################################################
--- a/kerneltest/f32test/fileutils/src/f32_test_utils.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/fileutils/src/f32_test_utils.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -36,6 +36,196 @@
 static CConsoleBase* pConsole = NULL;   //-- pointer to the text console for printing out data
 static TBool  bPrintOutEnabled = ETrue; //-- global flag, if EFalse, all printing out is disabled
 
+
+
+//-------------------------------------------------------------------------------------------------------------------
+
+/**
+    Prints out a hex dump of a descriptor contents
+    @param  aBuf data descriptor to dump
+*/
+void  F32_Test_Utils::HexDump(const TDesC8& aBuf)
+{
+    HexDump(aBuf.Ptr(), aBuf.Size());
+}
+
+//-------------------------------------------------------------------------------------------------------------------
+/**
+    Prints out a hex dump of a buffer
+    @param  apBuf   pointer to the data to dump
+    @param  aBufLen buffer length
+*/
+void  F32_Test_Utils::HexDump(const TAny* apBuf, TUint aBufLen)
+{
+    DoPrintf(_L("~ F32_Test_Utils::HexDump() size:%u\n"), aBufLen);
+  
+    ASSERT(apBuf);
+    
+    if(!aBufLen)
+        return;
+
+    const TUint colDmpWidth = 16;
+    const TUint8* pBuf = (const TUint8*)apBuf;
+    TBuf<256> buf1;
+    TBuf<64>  buf2;
+
+    TUint dumpPos;
+    
+    for(dumpPos=0; dumpPos < aBufLen-1; )
+    {
+        buf1.Format(_L("%06X: "), dumpPos);
+        buf2.Zero();
+
+        for(TUint i=0; i<colDmpWidth; ++i)
+        {
+            buf1.AppendFormat(_L("%02x "), pBuf[dumpPos+i]);
+        
+            const TChar ch = pBuf[dumpPos+i];
+            if(ch.IsPrint())
+                buf2.Append(ch);
+            else    
+                buf2.Append(_L("."));
+            
+
+            if(++dumpPos >= aBufLen)
+            {    
+                while(++i < colDmpWidth)
+                {
+                    buf1.Append(_L("   "));
+                    buf2.Append(_L(" "));
+                }
+
+                break;
+            }
+        }
+
+        buf1.Append(buf2);
+        DoPrintf(buf1);
+    
+    }
+
+    DoPrintf(_L("\n"));
+
+}
+
+
+//-------------------------------------------------------------------------------------------------------------------
+/**
+    Compare 2 buffers and print out the difference if there is any.
+    Buffer sizes must be the same and non-0
+
+    @param  aBuf1   buffer 1 descriptor
+    @param  aBuf2   buffer 2 descriptor
+    
+    @return ETrue if buffers are the same, EFalse otherwise
+*/
+TBool F32_Test_Utils::CompareBuffers(const TDesC8& aBuf1, const TDesC8& aBuf2)
+{
+    return CompareBuffers(aBuf1.Ptr(), aBuf1.Size(), aBuf2.Ptr(), aBuf2.Size());
+}
+
+//-------------------------------------------------------------------------------------------------------------------
+/**
+    Compare 2 buffers and print out the difference if there is any.
+    Buffer sizes must be the same and non-0
+
+    @param  apBuf1   pointer to the buffer 1 
+    @param  aBuf1Len buffer1 length
+    @param  apBuf2   pointer to the buffer 2 
+    @param  aBuf2Len buffer2 length
+
+    @return ETrue if buffers are the same, EFalse otherwise
+*/
+TBool F32_Test_Utils::CompareBuffers(const TAny* apBuf1, TUint aBuf1Len, const TAny* apBuf2, TUint aBuf2Len)
+{
+    ASSERT(apBuf1 && apBuf2);
+    
+    if(aBuf1Len != aBuf2Len)
+    {
+        DoPrintf(_L("~ F32_Test_Utils::CompareBuffers() different sizes! %u:%u\n"), aBuf1Len, aBuf2Len);
+        ASSERT(0);
+        return EFalse;
+    }
+
+    if(!aBuf1Len)
+    {//-- empty buffers to compare
+        return ETrue;
+    }
+
+
+    const TUint8* pBuf1 = (const TUint8*)apBuf1;
+    const TUint8* pBuf2 = (const TUint8*)apBuf2;   
+        
+    if(!Mem::Compare(pBuf1, aBuf1Len, pBuf2, aBuf2Len))
+        return ETrue; //-- buffers are the same. 
+
+
+    //-- the buffers' contents are different
+    TUint diffpos;
+    TBuf<256> buf1;
+    TBuf<100> buf2;
+
+    const TUint colDmpWidth = 16;
+    TBool bBannerPrinted = EFalse;
+
+    //-- dump chunks of the buffer with differences only
+    for(diffpos=0; diffpos<aBuf1Len-1; )
+    {
+        if(pBuf1[diffpos] == pBuf2[diffpos])
+            {
+            ++diffpos;
+            continue;
+            }
+
+        if(!bBannerPrinted)
+        {
+            bBannerPrinted = ETrue;
+            DoPrintf(_L("~ F32_Test_Utils::CompareBuffers() buffers' contents are different starting at pos:%u (0x%x). Hexdump:\n"), diffpos, diffpos);
+
+        }
+
+        //-- difference found, dump chunks of the buffer with differences only
+        TUint dumpPos = (diffpos >> 4) << 4; //-- round down to 16
+
+        buf1.Format(_L("%06X: "), dumpPos);
+        buf2.Format(_L("|"));
+        
+        for(TUint i=0; i<colDmpWidth; ++i)
+        {
+            buf1.AppendFormat(_L("%02x"), pBuf1[dumpPos+i]);
+            buf2.AppendFormat(_L("%02x"), pBuf2[dumpPos+i]);
+
+            if(i < colDmpWidth-1)
+            {
+                buf1.Append(_L(" "));
+                buf2.Append(_L(" "));
+            }
+
+        
+            if(++diffpos >= aBuf1Len)
+            {//-- pad the dump with spaces
+                while(++i < colDmpWidth)
+                {
+                    buf1.Append(_L("   "));
+                    buf2.Append(_L("   "));
+                }
+            
+                break;
+            }
+
+        }
+
+        buf1.Append(buf2);
+        DoPrintf(buf1);
+    }
+    
+    DoPrintf(_L("\n"));
+
+    return EFalse;
+}
+
+
+//-------------------------------------------------------------------------------------------------------------------
 /**
     Set the console where the ouput will go.
     @param  apConsole pointer to the console. if NULL, the print out will be debug port only.
--- a/kerneltest/f32test/group/bld.inf	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/group/bld.inf	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -26,9 +26,9 @@
 
 PRJ_TESTEXPORTS
 
-../../../userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmslogicalunit.h        /epoc32/include/
+../../../userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmslogicalunit.h        OS_LAYER_PLATFORM_EXPORT_PATH(rusbhostmslogicalunit.h)
 
-../../../userlibandfileserver/fileserver/inc/runtests.h                         /epoc32/include/
+../../../userlibandfileserver/fileserver/inc/runtests.h                         OS_LAYER_PLATFORM_EXPORT_PATH(runtests.h)
 
 PRJ_TESTMMPFILES
 ../../e32test/mediaext/t_nfe
@@ -156,7 +156,7 @@
 //t_scndr1    manual //-- obsolte; replaced by t_scn32dr1
 //t_scndr2    manual //-- obsolte; replaced by t_scn32dr2
 //T_MMC     manual
-t_pwstr manual
+t_pwstr
 
 
 t_fsys
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/rofs/rofs_tests.mrp	Thu Sep 02 21:54:16 2010 +0300
@@ -0,0 +1,1 @@
+# Dummy MRP to keep the package_defintion.xml file happy - f32test\rofs is still part of the base_f32test.mrp but is built separately.
\ No newline at end of file
--- a/kerneltest/f32test/server/t_dcallcaps.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dcallcaps.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -77,9 +77,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-//	TDriveInfo adriveInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_dcallfiles.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dcallfiles.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -89,9 +89,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-//	TDriveInfo adriveInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_dcdiskadmin.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dcdiskadmin.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -76,9 +76,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-//	TDriveInfo adriveInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_dcdiskadminallfiles.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dcdiskadminallfiles.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -84,9 +84,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-//	TDriveInfo adriveInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_dcnone.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dcnone.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -95,9 +95,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-//	TDriveInfo adriveInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_dctcb.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dctcb.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -88,8 +88,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_dctcballfiles.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dctcballfiles.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -77,9 +77,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-//	TDriveInfo adriveInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_dctcbdiskadmin.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_dctcbdiskadmin.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -76,9 +76,6 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
-TVolumeInfo aVolInfo;
-//	TDriveInfo adriveInfo;
-
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
--- a/kerneltest/f32test/server/t_file.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_file.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -190,25 +190,40 @@
 
 	test.Start(_L("Test read file"));
 	RFile f,ZFile;
-	TInt r=f.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText);
+	
+    TInt r=f.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText);
 	test_KErrNone(r);
-	TFileName fn = _L("Z:\\TEST\\T_FILE.CPP");
+	
+    TFileName fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
-	r=ZFile.Open(TheFs,fn,EFileStreamText);
+	
+    r=ZFile.Open(TheFs,fn,EFileStreamText);
 	test_KErrNone(r);
 
+	// check the file on the Z: drive his read-only
+	TEntry fileAtt;
+	r=TheFs.Entry(fn,fileAtt);
+	test_KErrNone(r);
+	test((fileAtt.iAtt & KEntryAttReadOnly) == KEntryAttReadOnly);
+
+
 	test.Next(_L("Read file"));
 	TBuf8<0x100> a,b;
-	FOREVER
+	
+    for(;;)
 		{
 		r=f.Read(b);
 		test_KErrNone(r);
-		r=ZFile.Read(a);
+		
+        r=ZFile.Read(a);
 		test_KErrNone(r);
-		test(a==b);
-		if (b.Length()<b.MaxLength())
+		
+        test(CompareBuffers(a, b));
+		
+        if (b.Length()<b.MaxLength())
 			break;
 		}
+
 	b.SetLength(10);
 	r=f.Read(b);
 	test_KErrNone(r);
@@ -240,23 +255,30 @@
 	{
 
 	test.Start(_L("Test multiple read file"));
-	RFile f1;
+	
+    RFile f1;
 	TInt r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
 	test_KErrNone(r);
-	RFile f2;
+	
+    RFile f2;
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
 	test_KErrNone(r);
 
 	test.Next(_L("Read file"));
-	FOREVER
+	
+    TBuf8<0x100> b1;
+    TBuf8<0x100> b2;
+    
+    for(;;)
 		{
-		TBuf8<0x100> b1;
-		r=f1.Read(b1);
+        r=f1.Read(b1);
 		test_KErrNone(r);
-		TBuf8<0x100> b2;
+        
 		r=f2.Read(b2);
 		test_KErrNone(r);
-		test(b1==b2);
+		
+        test(CompareBuffers(b1, b2));
+
 		if (b1.Length()<b1.MaxLength())
 			break;
 		}
@@ -953,6 +975,44 @@
 	test_KErrNone(r);
 	f.Close();
 
+
+	test.Next(_L("Internal attribute can't be read"));
+
+	r=TheFs.SetAtt(fname,0,KEntryAttReadOnly);
+	test_KErrNone(r);
+
+	r=f.Open(TheFs,fname,EFileWrite);
+	test_KErrNone(r);
+
+	r=f.SetAtt(KEntryAttReadOnly, 0);	// this will set internal attribut KEntryAttModified
+	test_KErrNone(r);
+
+	// copied \sf\os\kernelhwsrv\userlibandfileserver\fileserver\inc\common.h
+	const TUint KEntryAttModified=0x20000000;	
+
+	TUint att;
+	r = f.Att(att);
+	test_KErrNone(r);
+    test.Printf(_L("att %x"), att);
+	test_Value(att & KEntryAttModified, (att & KEntryAttModified) == 0);
+
+	r=f.SetAtt(att | KEntryAttModified, 0);
+	test_KErrNone(r);
+
+	r = f.Att(att);
+	test_KErrNone(r);
+    test.Printf(_L("att %x"), att);
+	test_Value(att & KEntryAttModified, (att & KEntryAttModified) == 0);
+
+	test.Next(_L("file time is set"));
+	r = f.Modified(time);
+	test(time.Int64() != 0);
+
+    r = f.Flush(); //-- this will flush attributes to the media
+    test_KErrNone(r);
+	f.Close();
+
+
 	// Tidy up
 	r=TheFs.SetAtt(fname,0,KEntryAttReadOnly);
 	test_KErrNone(r);
@@ -2888,8 +2948,6 @@
 {
     test.Next(_L("test maximal file size on FAT32\n"));
 
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
     if(!Is_Fat32(TheFs, gDriveNum))
     {
         test.Printf(_L("This test requires FAT32! skipping.\n"));
@@ -3009,11 +3067,8 @@
     nRes = TheFs.Delete(KFileName);
     test_KErrNone(nRes);
 
-#else
-
     test.Printf(_L("RFile64 is not supported! Skipping.\n"));
 
-#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 
 }
 
--- a/kerneltest/f32test/server/t_fman.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_fman.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -601,7 +601,7 @@
 	test_KErrNone(r);
 	test(entry.iName.MatchF(_L("T_FSRV.CPP"))!=KErrNotFound);
 #if defined (__WINS__)
-	test_Equal(KEntryAttArchive, entry.iAtt);
+	test_Equal(KEntryAttArchive | KEntryAttReadOnly, entry.iAtt);
 #else
 	if (!IsTestingLFFS())
 		{
@@ -4415,9 +4415,9 @@
          if(r!=KErrNone) //correct behaviour
              {
              TFileManError error = gFileMan->GetMoreInfoAboutError();
-             test_Equal(error,(TFileManError)ENoFilesProcessed);
+             test_Equal((TFileManError)ENoFilesProcessed,error);
              }
-         else { test_Equal(r,!KErrNone); }
+         else { test_Equal(!KErrNone,r); }
          }
      else
          {
@@ -4425,9 +4425,9 @@
          if(r!=KErrNone) //correct behaviour
              {
              TFileManError error = gFileMan->GetMoreInfoAboutError();
-             test_Equal(error,(TFileManError)ENoFilesProcessed);
+             test_Equal((TFileManError)ENoFilesProcessed,error);
              }
-         else { test_Equal(r,!KErrNone); }
+         else { test_Equal(!KErrNone,r); }
          }
     CleanupStack::PopAndDestroy();
     }
--- a/kerneltest/f32test/server/t_fsched.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_fsched.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1399,7 +1399,7 @@
 	TInt r = TheFs.Volume(volInfo, gDrive);
 	TESTERROR(r);
 	
-	gMediaSize = volInfo.iSize;
+	gMediaSize = volInfo.iFree;
 	gSmallFileSize = KBlockSize;
 	gBigFileSize = KBlockSize*20;
 	
--- a/kerneltest/f32test/server/t_pwstr.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_pwstr.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -101,6 +101,7 @@
 							// integrator, TBLDNum should be set to 3.
 
 LOCAL_D TInt RFsDNum = -1;	// File Server Drive number
+LOCAL_D TBool gManual = EFalse; // Manual Tests enabled
 
 struct TTestMapping
 	{
@@ -1231,25 +1232,41 @@
 	test.Next(_L("open connection"));
 	RFs theFs;
 	test(theFs.Connect() == KErrNone);
-
 	
+	// So that we are in a consistant state lets
+	// Remove the password file first. i.e. could be passwords left over from previous test failures
+    test.Next(_L("tidy up"));
+    TEntry theEntry;
+    TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
+    mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
+    test.Printf(_L("password file : %S\n"),&mediaPWrdFile);
+    error = theFs.Delete(mediaPWrdFile);
+    // Should be either KErrNone, KErrPathNotFound or KErrNotFound
+    test.Printf(_L("password file deleted: %d\n"),error);
 	
 	// Now set the first password that we will use
 	test.Next(_L("lock the media card"));	
 	TMediaPassword& nulPWrd = *PWDs[0];
 	TMediaPassword& oldPWrd = *PWDs[1];
 	error = theFs.LockDrive(KDriveNum, nulPWrd, oldPWrd, ETrue);
-	test(KErrNone == error);
 
+	if (KErrNotSupported == error)
+	    {
+        // Appears that passwords aren't supported on this drive config (i.e. NFE)
+        theFs.Close();
+        test.End();
+        return;
+	    }
+	test_KErrNone(error);
 
 	// Verify that the password file does exist and is in the correct place
 	test.Next(_L("check password file exists"));
-	TEntry theEntry;
-	TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
-	mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
 	error = theFs.Entry(mediaPWrdFile, theEntry);
-	test (KErrNone == error);
-
+	test.Printf(_L("password file exists: %d\n"),error);
+	if (error != KErrNone && error != KErrNotFound)
+	    {
+        test(0);
+	    }	
 	
 	// Attempt to set a new password without specifying the current one
 	test.Next(_L("change password failure"));	
@@ -1261,27 +1278,44 @@
 	// Change the password for a new one...
 	test.Next(_L("change password success"));	
 	error = theFs.LockDrive(KDriveNum, oldPWrd, newPWrd, ETrue);
-	test(KErrNone == error);
+	test_KErrNone(error);
 
 	
 	// Clear the password
+	// NB The file server uses a separate thread to write to the password file,
+	// so we may need to wait a short while to see any change...
 	test.Next(_L("clear the password"));	
 	error = theFs.ClearPassword(KDriveNum, newPWrd);
-	test(KErrNone == error);
+	test_KErrNone(error);
 
 
 	// Check that the password has been removed from the file
 	// (KMediaPWrdFile should now be zero bytes in size)
 	test.Next(_L("check password removal"));
-	error = theFs.Entry(mediaPWrdFile, theEntry);
-	test (KErrNone == error);
-	test (0 == theEntry.iSize);
+	theEntry.iSize = KMaxTInt;
+	TInt n;
+	for (n=0; theEntry.iSize > 0 && n<10; n++)
+		{
+		error = theFs.Entry(mediaPWrdFile, theEntry);
+	test_KErrNone(error);
+		test.Printf(_L("Password file size is %d\n"), theEntry.iSize);
+		if (theEntry.iSize > 0)
+			User::After(1000000);
+		}
+	test (theEntry.iSize == 0);
 
 	
 	// Remove the password file
 	test.Next(_L("tidy up"));
-	error = theFs.Delete(mediaPWrdFile);
-	test (KErrNone == error);
+	error = KErrInUse;
+	for (n=0; error == KErrInUse && n<10; n++)
+		{
+		error = theFs.Delete(mediaPWrdFile);
+		test.Printf(_L("Deleting %S, Iter %d, r %d\n"), &mediaPWrdFile, n, error);
+		if (error == KErrInUse)
+			User::After(1000000);
+		}
+	test_KErrNone(error);
 
 
 	theFs.Close();
@@ -1466,15 +1500,18 @@
 	UserHal::DriveInfo(diBuf);
 	TDriveInfoV1 &di=diBuf();
 
-	test.Printf(_L(" iRegisteredDriveBitmask 0x%08X"), di.iRegisteredDriveBitmask);
+	test.Printf(_L(" iRegisteredDriveBitmask 0x%08X\n"), di.iRegisteredDriveBitmask);
 
 	aDrive  = -1;
 	
 	TLocalDriveCapsV5Buf capsBuf;
 	TBusLocalDrive TBLD;
 	TLocalDriveCapsV5& caps = capsBuf();
+	
 	TPtrC8 localSerialNum;
 	TInt registeredDriveNum = 0;
+		
+	// Find a Drive that has Password support.
 	for(aDrive=0; aDrive < KMaxLocalDrives; aDrive++)
 		{
 		TInt driveNumberMask = 1 << aDrive;
@@ -1483,27 +1520,29 @@
 
 		test.Printf(_L(" Drive %d -  %S\r\n"), aDrive, &di.iDriveName[registeredDriveNum]);
 
-		// check that the card is readable (so we can ignore for empty card slots)
-		if ((di.iDriveName[registeredDriveNum].MatchF(_L("MultiMediaCard0")) == KErrNone) ||
-		    (di.iDriveName[registeredDriveNum].MatchF(_L("SDIOCard0")) == KErrNone))
-			{
-			
-			TBool TBLDChangedFlag;
-			TInt r = TBLD.Connect(aDrive, TBLDChangedFlag);
+        TBool TBLDChangedFlag;
+        TInt r = TBLD.Connect(aDrive, TBLDChangedFlag);
 //test.Printf(_L(" Connect returned %d\n"), r);
-			if (r == KErrNone)
-				{
-				r = TBLD.Caps(capsBuf);
-				localSerialNum.Set(caps.iSerialNum, caps.iSerialNumLength);
-				const TInt KSectSize = 512;
-				TBuf8<KSectSize> sect;
-				r = TBLD.Read(0, KSectSize, sect);
+        if (r == KErrNone)
+            {
+            r = TBLD.Caps(capsBuf);
+            
+            //Check media is lockable if not carry on			
+            if (caps.iMediaAtt & KMediaAttLockable)
+                {
+                test.Printf(_L("Drive %d is Lockable\n"),aDrive);
+                localSerialNum.Set(caps.iSerialNum, caps.iSerialNumLength);
+                const TInt KSectSize = 512;
+                TBuf8<KSectSize> sect;
+                r = TBLD.Read(0, KSectSize, sect);
 //test.Printf(_L(" Read returned %d\n"), r);
 				
 				TBLD.Disconnect();
 				if (r == KErrNone)
 					break;
 				}
+
+			TBLD.Disconnect();				
 			}
 		registeredDriveNum++;
 		}
@@ -1625,7 +1664,9 @@
 	for (n=0; n<30 && !TestLocked(aFs, aTheMemoryCardDrive); n++)
 		{
 		User::After(1000000);
+		test.Printf(_L("."));
 		}
+	test.Printf(_L("\n"));
 	test(n < 30);
 	test(TestLocked(aFs, aTheMemoryCardDrive));	// should now be locked
 	}
@@ -1941,7 +1982,6 @@
 	fs.Close();
 	}
 
-
 LOCAL_C void RunTests()
 //
 // Main test routine.  Calls other test functions.
@@ -1964,34 +2004,47 @@
 	test.Next(_L("Allocating test data"));
 	AllocateTestData();
 
-	test.Next(_L("Testing locking / unlocking using file server APIs"));
-	TestFsLockUnlock();
+    if (gManual)
+        {
+		test.Next(_L("Testing locking / unlocking using file server APIs"));
+		TestFsLockUnlock();
 	
-	test.Next(_L("Testing Power Down Status Reporting using file server APIs"));
-	TestPowerDownStatus();
+		test.Next(_L("Testing Power Down Status Reporting using file server APIs"));
+		TestPowerDownStatus();
 
-    test.Next(_L("Testing RFs::NotifyChange() with RFs::UnlockDrive()"));
-	TestUnlockDriveNotifyChange();
+	    test.Next(_L("Testing RFs::NotifyChange() with RFs::UnlockDrive()"));
+		TestUnlockDriveNotifyChange();
 
-	test.Next(_L("Forced Erase"));
-	TestFormatErase();
+		test.Next(_L("Forced Erase"));
+		TestFormatErase();
+		}
+		
 	test.Next(_L("Testing store management"));
 	TestStaticStore();
-	test.Next(_L("Testing locking functions"));
-	TestLockUnlock();
-	test.Next(_L("Testing Elide Passwords"));
-	TestElidePasswords();
-	test.Next(_L("Testing Null Passwords"));
-	TestNullPasswords();
-	test.Next(_L("Testing controller store"));
-	TestControllerStore();
-	test.Next(_L("Testing auto unlock"));
-	TestAutoUnlock();
+
+    if (gManual)
+        {		
+		test.Next(_L("Testing locking functions"));
+		TestLockUnlock();
+		test.Next(_L("Testing Elide Passwords"));
+		TestElidePasswords();		
+		test.Next(_L("Testing Null Passwords"));
+		TestNullPasswords();
+		test.Next(_L("Testing controller store"));
+		TestControllerStore();
+		test.Next(_L("Testing auto unlock"));
+		TestAutoUnlock();
+		}
+		
 	test.Next(_L("Testing password file"));
 	TestPasswordFile();
-	test.Next(_L("Testing writing a valid password to store unlocks card"));
-	TestWriteToPasswordStoreUnlocksCard();
-
+	
+    if (gManual)
+        {		
+		test.Next(_L("Testing writing a valid password to store unlocks card"));
+		TestWriteToPasswordStoreUnlocksCard();
+		}
+    
 	test.Next(_L("Disconnecting TBLD"));
 	TBLD.Disconnect();
 
@@ -2001,15 +2054,43 @@
 	__UHEAP_MARKEND;
 	}
 
+LOCAL_D void ParseCommandLineArgs()
+    {
+    
+    TBuf<0x100> cmd;
+    User::CommandLine(cmd);
+    TLex lex(cmd);
+
+    for (TPtrC token=lex.NextToken(); token.Length() != 0;token.Set(lex.NextToken()))
+        {
+        if (token.CompareF(_L("-m"))== 0)
+            {
+            gManual = ETrue;
+            continue;
+            }
+        }
+    }
 
 TInt E32Main()
 	{
 	
 	test.Title();
-	test.Start(_L("E32Main"));
+	test.Start(_L("T_PWSTR"));
+
+#if defined(__WINS__)
+	if (!gManual)
+	    {
+        test.Printf(_L("Automated T_PWSTR not supported on emulated devices\n"));
+	    }
+	else
+#endif
+	    {
+        ParseCommandLineArgs();	
+        
+        RunTests();
+	    }
+
 	
-	RunTests();
-
 	test.End();
 	test.Close();
 
--- a/kerneltest/f32test/server/t_rcache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_rcache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1684,7 +1684,7 @@
 	TVolumeInfo volInfo;
 	TInt r = TheFs.Volume(volInfo, gDrive);
 	test_KErrNone(r);
-	gMediaSize = volInfo.iSize;
+	gMediaSize = volInfo.iFree;
 	gSecondFileSize = KBlockSize*92;
 	gFirstFileSize = KBlockSize*(256);
 	while(((2*gFirstFileSize)+KOneMeg) > gMediaSize )
--- a/kerneltest/f32test/server/t_sysbin.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_sysbin.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -344,6 +344,14 @@
 
 		test.End();
 
+	// All files on the emulator's Z: drive have the KEntryAttReadOnly flag set
+	// This flag will have been copied to the C: drive, so we need to remove this before calling CFileMan::RmDir()
+#ifdef __WINS__
+	r = TheFs.SetAtt(KDllCInCTest, 0, KEntryAttReadOnly);
+	test_KErrNone(r);
+#endif
+
+
 	_LIT(KCTestPath,"c:\\sysbin_test\\");
 	r = TheFileMan->RmDir(KCTestPath);
 	test_KErrNone(r);
@@ -381,6 +389,14 @@
 
 		test.End();
 
+	// All files on the emulator's Z: drive have the KEntryAttReadOnly flag set
+	// This flag will have been copied to the C: drive, so we need to remove this before calling CFileMan::RmDir()
+#ifdef __WINS__
+	r = TheFs.SetAtt(KDllDInCSysBinTest, 0, KEntryAttReadOnly);
+	test_KErrNone(r);
+#endif
+
+
 	_LIT(KCTestPath2,"c:\\sys\\bin\\test\\");
 	r = TheFileMan->RmDir(KCTestPath2);
 	test_KErrNone(r);
--- a/kerneltest/f32test/server/t_wcache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/f32test/server/t_wcache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1355,10 +1355,8 @@
 	TVolumeInfo volInfo;
 	TInt r = gTheFs.Volume(volInfo, gDrive);
 	test_KErrNone(r);
-	gMediaSize = volInfo.iSize;
-	
-	test.Printf(_L("\nMedia size: %d MB\n"), gMediaSize/KOneMeg  );
-	
+	gMediaSize = volInfo.iFree;	
+	test.Printf(_L("\nMedia free space: %d MB\n"), gMediaSize/KOneMeg);
 	return ETrue;
 	}
 
--- a/package_definition.xml	Wed Aug 18 11:08:29 2010 +0300
+++ b/package_definition.xml	Thu Sep 02 21:54:16 2010 +0300
@@ -26,6 +26,12 @@
       <component id="f32test" name="File Server Tests" purpose="development">
         <unit bldFile="kerneltest/f32test/group" mrp="kerneltest/f32test/group/base_f32test.mrp"/>
       </component>
+      <component id="rofstests" name="Read Only File System Tests" purpose="development">
+        <unit bldFile="kerneltest/f32test/rofs" mrp="kerneltest/f32test/rofs/rofs_tests.mrp"/>
+      </component>
+      <component id="loadertest" name="Loader Tests" purpose="development">
+        <unit bldFile="kerneltest/f32test/loader" mrp="kerneltest/f32test/loader/base_loader.mrp"/>
+      </component>
     </collection>
     <collection id="ldds" name="Logical Device Drivers" level="adaptation">
       <component id="ethernetldd" name="Ethernet Drivers" purpose="optional">
@@ -44,7 +50,7 @@
         <!-- these are LDDs for storage media-->
         <unit bldFile="kernel/eka/drivers/locmedia" mrp="kernel/eka/drivers/locmedia/base_e32_drivers_locmedia.mrp"/>
       </component>
-      <component id="runmodedebugger" name="Run Mode Debugger" purpose="mandatory">
+      <component id="stopmodedebugdriver" name="Stop Mode Debug Driver" purpose="mandatory">
 		<unit bldFile="kernel/eka/drivers/debug/group" mrp="kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp"/>	    
       </component>
       <component id="btrace" name="Kernel Trace Tool" purpose="mandatory">
--- a/userlibandfileserver/fileserver/group/release.txt	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/group/release.txt	Thu Sep 02 21:54:16 2010 +0300
@@ -1,3 +1,48 @@
+Version 2.00.3058
+=================
+(Made by fadhliM 30/07/2010)
+
+1.	niccox
+	1.	ou1cimx1#393936 Incorrect update of progress bar with format of Usb Mass Storage 
+	2.	ou1cimx1#500789 ENV : F32Test T_WCACHE - Incorrect Check for Disk Size
+
+
+Version 2.00.3057
+=================
+(Made by fadhliM 27/07/2010)
+
+1.	niccox
+	1.	ou1cimx1#393936 Incorrect update of progress bar with format of Usb Mass Storage 
+	2.	ou1cimx1#493805 USB Host MS does not recognise NTFS partition info
+
+2.	h14jiang
+	1.	ou1cimx1#495683 FileServer - Bad usage of RArray::Append() and RPointerArray::Append()
+
+
+Version 2.00.3056
+=================
+(Made by fadhliM 26/07/2010)
+
+1.	dlyokhin
+	1.	ou1cimx1#481268 ENV: F32TEST T_FILE Fails during testMultipleReadFile()
+
+2.	necliffo
+	1.	ou1cimx1#456106 [DEV] Improve MedMMC and PBus Coverage
+
+3.	martai
+	1.	ou1cimx1#493927 ENV : E32TEST T_SHADOW Fails during testMultipleReadFile()
+
+4.	migubarr
+	1.	ou1cimx1#469293 t_pwstr failures
+	2.	ou1cimx1#488785 SD stack: formatting a card on a multiple-card stack can fail with KErrNotReady
+	3.	ou1cimx1#485015 Internal file server attribute (KEntryAttModified) can be returned to the client
+	4.	ou1cimx1#459805 Querying the attributes of an open file on the emulator's Z: drive returns incorrect attributes
+
+5.	michcox
+	1.	ou1cimx1#455757 MINOR_CHANGE - t_fman test fail error code print out
+	2.	MINOR_CHANGE MCL change includes from <F32Plugin.h> to <f32plugin.h> (i.e. case correction)
+
+
 Version 2.00.3055
 =================
 (Made by fadhliM 23/07/2010)
--- a/userlibandfileserver/fileserver/inc/f32ver.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/f32ver.h	Thu Sep 02 21:54:16 2010 +0300
@@ -58,6 +58,6 @@
 
 @see TVersion
 */
-const TInt KF32BuildVersionNumber=3055;
+const TInt KF32BuildVersionNumber=3058;
 //
 #endif
--- a/userlibandfileserver/fileserver/sfat/sl_cache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat/sl_cache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -135,7 +135,7 @@
     for(TUint cnt=0; cnt<aNumPages; ++cnt)
         {
         CWTCachePage* pPage = CWTCachePage::NewL(aPageSizeLog2);
-        iPages.Append(pPage);
+        iPages.AppendL(pPage);
         }
 
     InvalidateCache();  
--- a/userlibandfileserver/fileserver/sfat/sl_fatcache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat/sl_fatcache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -358,7 +358,7 @@
 
     //-- prepare pointer array for pages. NULL entry in the array means that the page at this index isn't allocated.
     for(TUint i=0; i<numPages; ++i)
-        iPages.Append(NULL);
+        iPages.AppendL(NULL);
     
     }
 
--- a/userlibandfileserver/fileserver/sfat/sl_leafdir_cache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat/sl_leafdir_cache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -756,8 +756,8 @@
             else
                 {
                 iLruList.Remove(i);
-                iLruList.Insert(aNodeUsed, 0);
-                return KErrNone;
+                TInt r = iLruList.Insert(aNodeUsed, 0);
+                return r;
                 }
             }
         }
--- a/userlibandfileserver/fileserver/sfat32/sl_cache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_cache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -119,7 +119,7 @@
     for(TUint cnt=0; cnt<aNumPages; ++cnt)
         {
         CWTCachePage* pPage = CWTCachePage::NewL(aPageSizeLog2);
-        iPages.Append(pPage);
+        iPages.AppendL(pPage);
         }
 
     InvalidateCache();  
--- a/userlibandfileserver/fileserver/sfat32/sl_fatcache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_fatcache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -349,7 +349,7 @@
 
     //-- prepare pointer array for pages. NULL entry in the array means that the page at this index isn't allocated.
     for(TUint i=0; i<numPages; ++i)
-        iPages.Append(NULL);
+        iPages.AppendL(NULL);
     
     }
 
--- a/userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -750,8 +750,8 @@
 			else
 				{
 				iLruList.Remove(i);
-				iLruList.Insert(aNodeUsed, 0);
-				return KErrNone;
+				TInt r = iLruList.Insert(aNodeUsed, 0);
+				return r;
 				}
 			}
 		}
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -4213,7 +4213,7 @@
     if(bProblemsFound && chkDskRes == CScanDrive::ENoErrors)
         {//-- ScanDrive in this mode can leave unexpectedly without setting an error code that is returned by ProblemsDiscovered();
          //-- leave itself means a problem
-        chkDskRes = CScanDrive::EUnknownError;
+        chkDskRes = nScnDrvRes == KErrNone ? CScanDrive::EUnknownError : (CScanDrive::TGenericError) nScnDrvRes;
         }
 
     delete pScnDrv;
--- a/userlibandfileserver/fileserver/sfile/sf_drv.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_drv.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -90,17 +90,13 @@
 // Do not allow the entry type to be changed
 //
 	{
-	const TUint KReadOnlySetAtts = KEntryAttVolume | 
-								   KEntryAttDir    | 
-								   KEntryAttRemote;
+	const TUint KReadOnlyAtts = KEntryAttVolume	| 
+								KEntryAttDir	| 
+								KEntryAttRemote	|
+								KEntryAttModified;
 
-	const TUint KReadOnlyClrAtts = KEntryAttVolume | 
-								   KEntryAttDir    | 
-								   KEntryAttRemote | 
-								   KEntryAttModified;
-
-	aSetAttMask   &= ~KReadOnlySetAtts;
-	aClearAttMask &= ~KReadOnlyClrAtts;
+	aSetAttMask   &= ~KReadOnlyAtts;
+	aClearAttMask &= ~KReadOnlyAtts;
 	}
 
 void CheckForLeaveAfterOpenL(TInt leaveError, CFsRequest* aRequest, TInt aHandle)
@@ -1235,6 +1231,33 @@
 	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSETENTRYL_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
 	TRAP(r,CurrentMount().SetEntryL(entryName,aTime,aSetAttMask,aClearAttMask))
 	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSETENTRYLRET, "r %d", r);
+
+	// If the file is already open then write the file attributes directly to the file
+	TFileName foldedName;
+	TUint32 nameHash=0;
+	foldedName.CopyF(aName);
+	nameHash=CalcNameHash(foldedName);
+
+	__CHECK_DRIVETHREAD(iDriveNumber);
+	TDblQueIter<CFileCB> q(CurrentMount().iMountQ);
+	CMountCB* currentMount = &CurrentMount();
+	CFileCB* file;
+	while ((file=q++)!=NULL)
+		{
+		if ((&file->Drive()==this) && 
+			&file->Mount() == currentMount &&
+			nameHash == file->NameHash() && 
+			file->FileNameF().Match(foldedName)==KErrNone)
+			{
+			TUint att = file->Att();
+			att |= aSetAttMask;
+			att &= ~aClearAttMask;
+			file->SetAtt(att | KEntryAttModified);
+			file->SetModified(aTime);
+			break;
+			}
+		}
+
 	return(r);
 	}
 
--- a/userlibandfileserver/fileserver/sfile/sf_file.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_file.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1641,6 +1641,7 @@
 	CFileShare* share=(CFileShare*)aRequest->ScratchValue();
 //	TInt att=(TInt)aRequest->FileShare()->File().Att()&KEntryAttMaskSupported;
 	TInt att=(TInt)share->File().Att();	// DRM: let ROM XIP attribute through
+	att&= ~KEntryAttModified;	// this is an internal attribute and should not be returned to the client
 	TPtrC8 pA((TUint8*)&att,sizeof(TInt));
 	aRequest->WriteL(KMsgPtr0,pA);
 	
@@ -1679,7 +1680,7 @@
 	TUint clearAttMask=(TUint)aRequest->Message().Int1();
 	ValidateAtts(setAttMask,clearAttMask);
 	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask);
-	TRAP(r,share->File().SetEntryL(TTime(0),setAttMask,clearAttMask))
+	TRAP(r,share->File().SetEntryL(share->File().Modified(),setAttMask,clearAttMask))
 	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1RET, "r %d", r);
 	return(r);
 	}
@@ -1785,12 +1786,12 @@
     TTime time;
 	TPtr8 t((TUint8*)&time,sizeof(TTime));
 	aRequest->ReadL(KMsgPtr0,t);
-	TUint setAttMask=(TUint)(aRequest->Message().Int1()|KEntryAttModified);
+	TUint setAttMask=(TUint)(aRequest->Message().Int1());
 	TUint clearAttMask=(TUint)aRequest->Message().Int2();
 	ValidateAtts(setAttMask,clearAttMask);//	Validate attributes
 
 	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask);
-	TRAP(r,share->File().SetEntryL(time,setAttMask,clearAttMask))
+	TRAP(r,share->File().SetEntryL(time,setAttMask|KEntryAttModified,clearAttMask))
 	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3RET, "r %d", r);
 	return(r);
 	}
--- a/userlibandfileserver/fileserver/sfile/sf_memory_client.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_memory_client.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -144,7 +144,11 @@
 
 	iTouchedRegionFlag = 0;
 	iReusablePagePool.Close();
-	iReusablePagePool.Reserve(iReservedRegionMarkInSegs);
+	r = iReusablePagePool.Reserve(iReservedRegionMarkInSegs);
+    if (r != KErrNone)
+        {
+        ASSERT(0);
+        }
 	}
 
 /**
@@ -229,7 +233,9 @@
 	ASSERT(err == KErrNone);
 	if (err != KErrNone)
 		return err;
-	iReusablePagePool.Append(aStartRamAddr);
+	err = iReusablePagePool.Append(aStartRamAddr);
+    if (err != KErrNone)
+        return err;
 	return KErrNone;
 	}
 
--- a/userlibandfileserver/fileserver/sfile/sf_pool.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_pool.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -64,7 +64,11 @@
 			{
 			return KErrNoMemory;
 			}
-		iFreeList.Append(t);	
+		r = iFreeList.Append(t);
+        if(r !=  KErrNone)
+            {
+            return r;
+            }
 		i++;
 		}
 	
--- a/userlibandfileserver/fileserver/sfile/sf_std.h	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_std.h	Thu Sep 02 21:54:16 2010 +0300
@@ -32,7 +32,7 @@
 #include <e32const_private.h>
 #include "sf_plugin.h"
 #include "sf_func.h"
-#include <F32plugin.h>
+#include <f32plugin.h>
 #include "f32trace.h"
 
 #define __PRINT1TEMP_ALWAYS(t,a) {{TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}}
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -55,10 +55,10 @@
         partitionInfo.Close();
 		return r;
         }
-	TUint8 *iIntBuf = (TUint8 *) partitionInfo.Ptr();
+	TUint8* buffer = const_cast<TUint8*>(partitionInfo.Ptr());
 
 	// Read of the first sector successful so check for a Master Boot Record
-	if (*(TUint16*)(&iIntBuf[KMBRSignatureOffset])!= KMBRSignature)
+	if (*(reinterpret_cast<TUint16*>(&buffer[KMBRSignatureOffset]))!= KMBRSignature)
 		{
 		__PXYPRINT(_L("MBR not present"));
         iMsDataMemMap.Reset();
@@ -66,16 +66,16 @@
 	else
 		{
 		// Move the partition entries to a 4 byte boundary
-		memcpy(&iIntBuf[0],&iIntBuf[KMBRFirstPartitionOffset],(sizeof(TMBRPartitionEntry)<<2));
+		memcpy(&buffer[0],&buffer[KMBRFirstPartitionOffset],(sizeof(TMBRPartitionEntry)<<2));
 		// Search for a x86 default boot partition - let this be the first
-		TMBRPartitionEntry* pe = (TMBRPartitionEntry*)(&iIntBuf[0]);
+		TMBRPartitionEntry* pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
 
 		TInt firstValidPartitionCount = -1;
 		TInt defaultPartitionNumber = -1;
 		TInt partitionCount = 0;
 		for (TInt i = 0; i < KMBRMaxPrimaryPartitions; i++, pe++)
 			{
-			if (pe->IsValidDosPartition() || pe->IsValidFAT32Partition())
+			if (pe->IsValidDosPartition() || pe->IsValidFAT32Partition() || pe->IsValidExFATPartition())
 				{
 				__PXYPRINT(_L("Found a Valid Partition"));
 				partitionCount++;
@@ -99,7 +99,7 @@
 	    if (partitionCount > 0)
 		    {
             __PXYPRINT1(_L("Using Partition %d"), partitionCount);
-			pe = (TMBRPartitionEntry*)(&iIntBuf[0]);
+			pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
             TInt partitionIndex = firstValidPartitionCount;
             if (defaultPartitionNumber > 0)
                 {
@@ -604,7 +604,7 @@
         }
 	else if (KErrGeneral == r)
         {
-        RDebug::Print(_L("<<< HOST Caps Unable to communicate with media"));
+        __HOSTPRINT(_L("<<< HOST Caps Unable to communicate with media"));
 		c.iType = EMediaUnknown;		
         }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.inl	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.inl	Thu Sep 02 21:54:16 2010 +0300
@@ -42,11 +42,11 @@
 	iSectorSize = aSectorSize;
 
 	iFormatSectorShift = 0;
-	while(aSectorSize)
-		{
-		++iFormatSectorShift;
-		aSectorSize >>= 1;
-		}
+
+    while(aSectorSize >>= 1)
+        {
+        ++iFormatSectorShift;
+        }
 
 	iDataOffset = static_cast<TInt64>(aFirstDataSector) * iSectorSize;
 	iSize = static_cast<TInt64>(aNumSectors) * iSectorSize;
--- a/userlibandfileserver/fileserver/swins/elocal.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/userlibandfileserver/fileserver/swins/elocal.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -855,8 +855,8 @@
     file.SetSize64(fileSize, EFalse);
 	file.SetAtt(info.dwFileAttributes&KEntryAttMaskSupported);
 
-//	if (IsRomDrive())
-//		file.iAtt|=KEntryAttReadOnly;
+	if (IsRomDrive())
+		file.SetAtt(file.Att() | KEntryAttReadOnly);
 	TTime tempTime=file.Modified();
 	fileTimeToTime(&info.ftLastWriteTime,tempTime);
 	file.SetModified(tempTime);