blob: 166586f2f6d56881bba899d81190e40351ddac38 [file] [log] [blame]
The Android Open Source Project52d4c302009-03-03 19:29:09 -08001#include <stdio.h>
2#include <stdlib.h>
3#include <inttypes.h>
4#include "trace_reader_base.h"
5
6int main(int argc, char **argv) {
7 if (argc != 2) {
8 fprintf(stderr, "Usage: %s trace_file\n", argv[0]);
9 exit(1);
10 }
11
12 char *trace_filename = argv[1];
13 TraceReaderBase *trace = new TraceReaderBase;
14 trace->Open(trace_filename);
15
16 while (1) {
17 uint64_t time, recnum, bb_num, bb_start_time;
18 uint32_t pc, target_pc;
19 int num_insns;
20
21 if (trace->ReadExc(&time, &pc, &recnum, &target_pc, &bb_num,
22 &bb_start_time, &num_insns))
23 break;
24 printf("time: %lld rec: %llu pc: %08x target: %08x bb: %llu bb_start: %llu insns: %d\n",
25 time, recnum, pc, target_pc, bb_num, bb_start_time, num_insns);
26 }
27 return 0;
28}