analyzetool/commandlineengine/src/helps.cpp
branchRCL_3
changeset 13 da2cedce4920
equal deleted inserted replaced
12:d27dfa8884ad 13:da2cedce4920
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Contains help texts for CLE.
       
    15 *
       
    16 */
       
    17 #include "../inc/ATCommonDefines.h"
       
    18 
       
    19 //Function declarations
       
    20 void print_help( void );
       
    21 void print_syntax_examples( void );
       
    22 
       
    23 /**
       
    24 * Print help info.
       
    25 */
       
    26 void print_help( void )
       
    27 {
       
    28 	cout<< "AnalyzeTool v";
       
    29 	cout<< ATOOL_VERSION;
       
    30 	cout<< " - ";
       
    31 	cout<< ATOOL_DATE;
       
    32 	cout<< "\n";
       
    33 	cout<< "Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).\nAll rights reserved.\n\n";
       
    34 	cout<< "Usage:\n";
       
    35 	cout<< "atool -e [optional parameters] abld [abld parameters]\n";
       
    36 	cout<< "      -me [optional parameters] abld [abld parameters]\n";
       
    37 	cout<< "      -mi [optional parameters] [-f data-file] sbs [sbs parameters]\n";
       
    38 	cout<< "      -a data-file [output-file] [-s symbol-file] [-l#]\n";
       
    39 	cout<< "      -p data-file output-file\n";
       
    40 	cout<< "      -c\n";
       
    41 	cout<< "      -v\n";
       
    42 	cout<< "      -help\n";
       
    43 	cout<< "\n";
       
    44 	cout<< "Mandatory parameter to choose:\n";
       
    45 	cout<< " -e              Build project for analysis using external data gathering.\n";
       
    46 	cout<< " -me             Build project for analysis using monitored external\n";
       
    47 	cout<< "                 data gathering.\n";
       
    48 	cout<< " -mi             Build project for analysis using monitored internal\n";
       
    49 	cout<< "                 data gathering.\n";
       
    50 	cout<< " abld...         Use SBS v.1 build system with defined build command,\n";
       
    51 	cout<< "                 which includes supported platform and build type.\n";
       
    52 	cout<< " sbs...          Use SBS v.2 (Raptor) build system with defined sbs build\n";
       
    53 	cout<< "                 command, which includes supported platform and build type.\n";
       
    54 	cout<< " -a              Analyze report file.\n";
       
    55 	cout<< " -c              Clear AnalyzeTool changes, temporary files and releasable(s).\n";
       
    56 	cout<< " -p              Parse trace file to data file.\n";
       
    57 	cout<< " -help           Show full help including syntax examples.\n";
       
    58 	cout<< " -v              Print version info.\n";
       
    59 	cout<< "\n";
       
    60 
       
    61 	cout<< "Optional parameters:\n";
       
    62 	cout<< " -acs size       Specifies the call stack size gathered when memory\n";
       
    63 	cout<< "                 is allocated. Size can be between 0-256.\n";
       
    64 	cout<< " -fcs size       Specifies the call stack size gathered when memory is freed.\n";
       
    65 	cout<< "                 Size can be between 0-256.\n";
       
    66 	cout<< " -f data file    Specifies the filename for monitored internal data gathering\n";
       
    67 	cout<< "                 (50 chars max). Cannot contain path.\n";
       
    68 	cout<< " output-file     Specifies the results data file name.\n";
       
    69 	cout<< " -l              Logging level of analyze report(0,1,2,3), default 3.\n";
       
    70 	cout<< " -s symbol-file  Specifies rom/rofs symbol file(s) to be used in analyze.\n";
       
    71 	cout<< "                 Multiple -s options can be given.\n";
       
    72 	cout<< " -nobuild        Instruments the project.\n";
       
    73 	//cout<< "  -show_debug       Print debug messages to console.\n";
       
    74 	//cout<< "  -show_debug_all	  Print debug messages to console (all).\n";
       
    75 	//cout<< "  -show_dbgview     Print debug messages to windows debug api.\n";
       
    76 	//cout<< "  -show_dbgview_all Print debug messages to windows debug api (all).\n";
       
    77 
       
    78 	/*
       
    79 	* Old style parameters, just for notes.
       
    80 	printf("Usage:\n");
       
    81 	printf("atool -m [mmp-file] [mode] [data-file] [-variant variant-name] [build] [-sbs2] [-e]\n");
       
    82 	printf("      -i [mmp-file] [mode] [data-file] [-variant variant-name] [build] [-sbs2] [-e]\n");
       
    83 	printf("      -a [mmp-file | target-name] data-file [-s symbol-file]\n");
       
    84 	printf("         [output-file] [-l#]\n");
       
    85 	printf("      -p data-file [output-file]\n");
       
    86 	printf("      -c\n");
       
    87 	//printf("      -u\n");
       
    88 	printf("      -v\n");
       
    89 	printf("      -help\n");
       
    90 	printf("\n");
       
    91 	printf("Mandatory option to choose:\n");
       
    92 	printf("  -m           Build project for analysis.\n");
       
    93 	printf("  -i           Instrument project.\n");
       
    94 	printf("  -a           Analyze report file.\n");
       
    95 	//printf("  -u           Create listing & map files.\n");
       
    96 	printf("  -c           Clear AnalyzeTool changes and temporary files.\n");
       
    97 	printf("  -p           Parse trace file.\n");
       
    98 	printf("  -help        Show full help including syntax examples.\n");
       
    99 	printf("\n");
       
   100 
       
   101 	printf("Optional options:\n");
       
   102 	printf("  mmp-file     Specifies one of the component from bld.inf which is used.\n");
       
   103 	printf("  target-name  Specifies the target name of binary to which create\n");
       
   104 	printf("               analyze report.\n");
       
   105 	printf("  mode         Logging mode (trace or S60), default trace.\n");
       
   106 	printf("  data-file    Specifies the user defined data file name (50 chars max).\n");
       
   107 	printf("  build        Build target (udeb or urel), default udeb.\n");
       
   108 	printf("  output-file  Specifies the results data file name.\n");
       
   109 	printf("  -l           Logging level of analyze report(0,1,2,3), default 3.\n");
       
   110 	printf("  -variant     Specifies Symbian binary variant to be used.\n");
       
   111 	printf("  variant-name Specifies the variant name to be used.\n");
       
   112 	printf("  -s           Specifies rom symbol file be used in analyze.\n");
       
   113 	printf("  symbol-file  Full path to rom symbol file used in analyze.\n");
       
   114 	printf("  -sbs2        Use Symbian Build System v.2.\n");
       
   115 	printf("  -winscw      Build project for emulator (winscw platform).\n");
       
   116 	printf("  -v           Print version info.\n");
       
   117 	*/
       
   118 }
       
   119 
       
   120 void print_syntax_examples( void )
       
   121 {
       
   122 //Helper line showing width of 80 chars.
       
   123 //80cout<< "12345678901234567890123456789012345678901234567890123456789012345678901234567890";
       
   124 	cout<< endl;
       
   125 	cout<< "Building syntax examples:" << endl;
       
   126 	cout<< "Cmd   Description" << endl;
       
   127 	
       
   128 	cout<< "atool -e abld build armv5 udeb" << endl;
       
   129 	cout<< "      Hooks every component from bld.inf. Using external data gathering," << endl;
       
   130 	cout<< "      udeb build type and armv5 platform." << endl;
       
   131 
       
   132 	cout<< "atool -mi -acs 5 sbs -c winscw_udeb" << endl;
       
   133 	cout<< "      Hooks every component from bld.inf. Using Symbian Build System v.2" << endl;
       
   134 	cout<< "      Using monitored internal data gathering, call stack size of 5" << endl;
       
   135 	cout<< "      in allocations, udeb build type and winscw platform." << endl;
       
   136 	
       
   137 	cout<< "atool -me abld build armv5 udeb foobar" << endl;
       
   138 	cout<< "      Hooks only foobar.mmp component from bld.inf. Using monitored" << endl;
       
   139 	cout<< "      external data gathering, udeb build type and armv5 platform." << endl;
       
   140 	
       
   141 	cout<< "atool -e -acs 0 -fcs 0 abld build armv5.default udeb" << endl;
       
   142 	cout<< "      Hooks every component from bld.inf. Using default binary variant," << endl;
       
   143 	cout<< "      external data gathering, 0 sized callstacks in allocation(s)/free(s)," << endl;
       
   144 	cout<< "      udeb build type and armv5 platform." << endl;
       
   145 	
       
   146 	cout<< "atool -e sbs -b bld.inf -c armv5_udeb" << endl;
       
   147 	cout<< "      Hooks every component from bld.inf. Using Symbian Build System v.2" << endl;
       
   148 	cout<< "      , external data gathering, udeb build type and armv5 platform." << endl;
       
   149 	
       
   150 	cout<< "atool -me sbs -s system.xml --config=winscw_udeb" << endl;
       
   151 	cout<< "      Hooks every layer defined in system.xml system model. Using Symbian Build" << endl;
       
   152 	cout<< "      System v.2, external data gathering, udeb build type and winscw platform." << endl;
       
   153 
       
   154 	cout<< endl;
       
   155 	cout<< "Instrumenting syntax examples:" << endl;
       
   156 	cout<< "Cmd   Description" << endl;
       
   157 	cout<< "atool -e -nobuild abld build winscw udeb" << endl;
       
   158 	cout<< "      Instruments every component from bld.inf. Using external data gathering,"<<endl;
       
   159 	cout<< "      udeb build target and winscw platform." << endl;
       
   160     cout<< "   After project is instrumented, it needs to compiled using same platform and" << endl;
       
   161 	cout<< "   build type as given to instrumenting. Use -c parameter to remove changes." << endl;
       
   162 
       
   163 	cout<< endl;
       
   164 	cout<< "Analyzing syntax examples:" << endl;
       
   165 	cout<< "Cmd   Description" << endl;
       
   166 	cout<< "atool -a foo.dat" << endl;
       
   167 	cout<< "      Create analyze report from foo.dat device data file." << endl;
       
   168 	cout<< "atool -a foo.trace" << endl;
       
   169 	cout<< "      Create analyze report from foo.trace raw data file." << endl;
       
   170 	cout<< "atool -a foo.dat -s my_rom.symbol -s my_rofs1.symbol" << endl;
       
   171 	cout<< "      Create analyze report from foo.dat using also rom and rofs symbol files." << endl;
       
   172 	
       
   173 	cout<< endl;
       
   174 	cout<< "Parsing syntax examples:" << endl;
       
   175 	cout<< "Cmd   Description" << endl;
       
   176 	cout<< "atool -p foo.trace foo.dat" << endl;
       
   177 	cout<< "      Parse foo.trace raw data file to foo.dat device data file." << endl;
       
   178 	}
       
   179 
       
   180 //EOF