Skip to content

Commit

Permalink
Merge branch 'trim-auto'
Browse files Browse the repository at this point in the history
Conflicts:
	cli/CMakeLists.txt
  • Loading branch information
jrfonseca committed Dec 11, 2012
2 parents 4f74cc6 + 55bbe59 commit 9db16b3
Show file tree
Hide file tree
Showing 8 changed files with 1,131 additions and 55 deletions.
1 change: 1 addition & 0 deletions cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ add_executable (apitrace
cli_trace.cpp
cli_trim.cpp
cli_resources.cpp
trace_analyzer.cpp
)

target_link_libraries (apitrace
Expand Down
23 changes: 17 additions & 6 deletions cli/cli_dump_images.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,20 @@ usage(void)
std::cout << "usage apitrace dump-images [OPTIONS] TRACE_FILE\n"
<< synopsis << "\n"
"\n"
" -h, --help show this help message and exit\n"
" --calls=CALLSET dump images only for specified calls\n"
" (default value is \"*/frame\" which\n"
" which dumps an image for each frame)\n"
" -o, --output=PREFIX prefix to use in naming output files\n"
" (default is trace filename without extension)\n"
" -h, --help show this help message and exit\n"
" --calls=CALLSET dump images only for specified calls\n"
" (default value is \"*/frame\" which\n"
" which dumps an image for each frame)\n"
" --call-nos[=BOOL] use call numbers in image filenames,\n"
" otherwise use sequental numbers (default=yes)\n"
" -o, --output=PREFIX prefix to use in naming output files\n"
" (default is trace filename without extension)\n"
"\n";
}

enum {
CALLS_OPT = CHAR_MAX + 1,
CALL_NOS_OPT,
};

const static char *
Expand All @@ -64,6 +67,7 @@ const static struct option
longOptions[] = {
{"help", no_argument, 0, 'h'},
{"calls", required_argument, 0, CALLS_OPT},
{"call-nos", optional_argument, 0, CALL_NOS_OPT},
{"output", required_argument, 0, 'o'},
{0, 0, 0, 0}
};
Expand All @@ -75,6 +79,7 @@ command(int argc, char *argv[])
const char *calls = NULL;
const char *traceName = NULL;
const char *output = NULL;
std::string call_nos;

int opt;
while ((opt = getopt_long(argc, argv, shortOptions, longOptions, NULL)) != -1) {
Expand All @@ -85,6 +90,9 @@ command(int argc, char *argv[])
case CALLS_OPT:
calls = optarg;
break;
case CALL_NOS_OPT:
call_nos = std::string("--call-nos=") + optarg;
break;
case 'o':
output = optarg;
break;
Expand Down Expand Up @@ -126,6 +134,9 @@ command(int argc, char *argv[])
opts.push_back(calls);
else
opts.push_back("*/frame");
if (!call_nos.empty()) {
opts.push_back(call_nos.c_str());
}

return executeRetrace(opts, traceName);
}
Expand Down
Loading

0 comments on commit 9db16b3

Please sign in to comment.