28int main(
int argc,
char* argv[])
31 show_help(argv[0], stderr);
35 char const* perf_path =
nullptr;
36 char const* vcd_path =
nullptr;
39 for(
int i = 1; i < argc; ++i) {
40 if(options && strcmp(argv[i],
"--") == 0) {
43 options && (strcmp(argv[i],
"-h") == 0 || strcmp(argv[i],
"--help") == 0)) {
46 }
else if(!perf_path) {
48 }
else if(!vcd_path) {
51 fprintf(stderr,
"Unexpected argument: %s\n", argv[i]);
52 show_help(argv[0], stderr);
58 fprintf(stderr,
"Error: <perf-file> is required\n");
59 show_help(argv[0], stderr);
63 FILE* fperf = fopen(perf_path,
"rb");
65 fprintf(stderr,
"Error opening perf file '%s': %s\n", perf_path, strerror(errno));
71 fvcd = fopen(vcd_path,
"wb");
73 fprintf(stderr,
"Error opening VCD file '%s': %s\n", vcd_path,
86 fprintf(stderr,
"Error converting perf to VCD: %s\n", strerror(res));