Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 extern void ProcessAllTrace(unsigned (*aInput)(void* aBuffer, unsigned aMaxSize),int aReportLevel);
23 unsigned GetTraceData(void* aBuffer, unsigned aMaxSize)
25 return fread(aBuffer, 1, aMaxSize, InFile);
28 char* ThisProgram = "BTRACE";
32 printf("Usage: %s [options] file\n",ThisProgram);
34 printf(" -a<level> Set analysis level, 0 = brief summary, 1 = full summary,\n");
35 printf(" 2 = condensed trace dump, 3 = full trace dump (DEFAULT)\n");
36 printf("\nTHIS TOOL IS UNOFFICIAL, UNSUPPORTED AND SUBJECT TO CHANGE WITHOUT NOTICE!\n");
40 int main(int argc, char** argv)
45 ThisProgram = argv[0];
52 fprintf(stderr,"Missing input file\n");
55 if(argv[nextArg][0]!='-')
57 if(argv[nextArg][1]=='a')
59 reportLevel = strtoul(argv[nextArg]+2,0,10);
62 fprintf(stderr,"Unknown option: %s\n",argv[nextArg]);
66 InFile = fopen(argv[nextArg],"rb");
69 fprintf(stderr,"Can't open input file '%s'\n",argv[nextArg]);
73 ProcessAllTrace(GetTraceData,reportLevel);