hacks/profiling/startupprofiling.cpp
author markw <markw@symbian.org>
Wed, 20 Oct 2010 10:26:40 +0100
changeset 70 6b078b83b04a
parent 37 b8aae0a088d8
permissions -rw-r--r--
Add original MMP files to build the OpenVG reference implementation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     7
//
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    10
//
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    11
// Contributors:
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    12
//
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    13
// Description:
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    14
//
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    15
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    16
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    17
//#include <bautils.h>
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    18
#include <profiler.h>
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    19
#include <e32debug.h>
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    20
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    21
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    22
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    23
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    24
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    25
//------------------------------------------------------------------------------------------------------------
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    26
void startProfilerServer()
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    27
   {
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    28
	RDebug::Print(_L("Startup Profiling - startProfilerServer()"));
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    29
	_LIT(KParam,"");
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    30
	RProcess p;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    31
	TInt err;   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    32
	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    33
	// Run the Sampling Profiler
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    34
	err=p.Create(KProfilerName,KParam);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    35
	if (err == KErrNone)
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    36
		{
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    37
		p.Resume();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    38
		p.Close();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    39
		User::After(1000000);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    40
		}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    41
	else
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    42
		{
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    43
		RDebug::Print(_L("Startup Profiling - ERROR %d: Unable to execute Sampling Profiler\n"), err);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    44
		}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    45
	}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    46
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    47
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    48
	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    49
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    50
// PARSE PARAMETER
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    51
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    52
TInt parseNumberL(TDes &aArgs, const TDesC &aParam)
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    53
   {
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    54
   TInt     pos, num, ret;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    55
	TBuf<100> argsTmp;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    56
   TLex     lexArgs;	   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    57
   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    58
   pos = aArgs.Find(aParam);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    59
   if (pos == KErrNotFound)
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    60
      User::Leave(KErrArgument);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    61
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    62
   argsTmp.Insert(0,aArgs);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    63
   argsTmp.Delete(0,pos + aParam.Length());
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    64
   lexArgs=argsTmp;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    65
   ret=lexArgs.Val(num);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    66
   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    67
   if (ret != KErrNone)
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    68
      User::Leave(KErrArgument);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    69
   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    70
   return num;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    71
   }
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    72
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    73
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    74
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    75
   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    76
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    77
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    78
//  MAIN
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    79
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    80
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    81
void doMainL()
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    82
	{
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    83
	RDebug::Print(_L("Startup Profiling - doMainL"));
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    84
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    85
	TBuf<100>       buf, args;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    86
	TInt            waittime(300000000), err;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    87
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    88
   _LIT(KParamTime,	"time=");
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    89
		
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    90
   // Get and prepare Command Line
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    91
#ifndef __SECURE_API__
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    92
   RProcess().CommandLine(args);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    93
#else
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    94
   User::CommandLine(args);   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    95
#endif
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    96
   args.LowerCase();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    97
   
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    98
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    99
   // Parse param and decide what to do  
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   100
   if (args.Find(KParamTime) != KErrNotFound) 
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   101
		{
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   102
		waittime  = parseNumberL(args, KParamTime);  
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   103
		RDebug::Print(_L("Starting Profiler - Wait time requested: %d"), waittime);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   104
		}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   105
/*		
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   106
	// ECOM should be already running on a real phone. Does not in testshell mode
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   107
	REComSession ecom;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   108
	ecom.OpenL();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   109
	User::After(2000000);	      
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   110
*/
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   111
	// Start the profiler server
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   112
	startProfilerServer();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   113
	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   114
	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   115
	err=Profiler::Start();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   116
	if (err != KErrNone)
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   117
		{
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   118
		RDebug::Print(_L("Startup Profiling - ERROR %d : Unable to start Sampling Profiler.\n"),err);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   119
		User::Leave(err);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   120
		}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   121
	else
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   122
		{
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   123
		RDebug::Print(_L("Startup Profiling - Profiler Started OK"));
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   124
		}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   125
		
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   126
	// Now go to sleep until the alloted time (ie until we think boot-up should be complete)	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   127
	User::After(waittime);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   128
	RDebug::Print(_L("Startup Profiling - Time's Up, going to stop profiling now"));
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   129
	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   130
	// Stop, close and unload the profiler properly
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   131
	err=Profiler::Stop();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   132
	User::After(300000);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   133
	err=err | Profiler::Close();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   134
	User::After(300000);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   135
	err=err | Profiler::Unload();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   136
	User::After(300000);         
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   137
	if (err != KErrNone)
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   138
		{
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   139
		RDebug::Print(_L("Startup Profiling - ERROR %d : Unable to Stop/Close/Unload Sampling Profiler\n"),err);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   140
		User::Leave(err);            
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   141
		}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   142
	}
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   143
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   144
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   145
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   146
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   147
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   148
// Program Entry
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   149
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   150
//************************************************************************************************************
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   151
GLDEF_C TInt E32Main()
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   152
	{	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   153
	__UHEAP_MARK;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   154
	CActiveScheduler* rootScheduler = new CActiveScheduler;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   155
	CActiveScheduler::Install(rootScheduler);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   156
	CTrapCleanup* theCleanup=CTrapCleanup::New();
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   157
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   158
	TRAPD(ret,doMainL());	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   159
	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   160
	delete theCleanup;	
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   161
	delete rootScheduler;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   162
	__UHEAP_MARKEND;
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   163
	return(KErrNone);
b8aae0a088d8 Adding "Profiling Starter" app so we can see what's going on during boot
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   164
	}