summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2020-08-20 11:13:32 -0700
committerMarge Bot <eric+marge@anholt.net>2020-08-20 19:01:52 +0000
commit4de027d6bf018912747d37316fe7521bd36c1ac8 (patch)
treeeaf2f58e7a8ced003609807b51baa9dc06013598
parentb440c28b78fc5e6f319f988f21a7470254b00f06 (diff)
freedreno/cffdump: add arg to filter by process name
Usueful when you have a cmdstream trace which consists of multiple different processes. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6409>
-rw-r--r--src/freedreno/decode/cffdump.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/freedreno/decode/cffdump.c b/src/freedreno/decode/cffdump.c
index a9ceacdee4e..cd787fb43a3 100644
--- a/src/freedreno/decode/cffdump.c
+++ b/src/freedreno/decode/cffdump.c
@@ -58,6 +58,7 @@ static bool is_blob = false;
static int show_comp = false;
static int interactive;
static int vertices;
+static const char *exename;
static int handle_file(const char *filename, int start, int end, int draw);
@@ -81,6 +82,7 @@ static void print_usage(const char *name)
"\t-E, --end=N - stop decoding after frame N\n"
"\t-F, --frame=N - decode only frame N\n"
"\t-D, --draw=N - decode only draw N\n"
+ "\t-e, --exe=NAME - only decode cmdstream from named process\n"
"\t--textures - dump texture contents (if possible)\n"
"\t-L, --script=LUA - run specified lua script to analyze state\n"
"\t-q, --query=REG - query mode, dump only specified query registers on\n"
@@ -132,6 +134,7 @@ static const struct option opts[] = {
{ "end", required_argument, 0, 'E' },
{ "frame", required_argument, 0, 'F' },
{ "draw", required_argument, 0, 'D' },
+ { "exe", required_argument, 0, 'e' },
{ "script", required_argument, 0, 'L' },
{ "query", required_argument, 0, 'q' },
{ "help", no_argument, 0, 'h' },
@@ -148,7 +151,7 @@ int main(int argc, char **argv)
options.color = interactive;
- while ((c = getopt_long(argc, argv, "vsaS:E:F:D:L:q:h", opts, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "vsaS:E:F:D:e:L:q:h", opts, NULL)) != -1) {
switch (c) {
case 0:
/* option that set a flag, nothing to do */
@@ -174,6 +177,9 @@ int main(int argc, char **argv)
case 'D':
draw = atoi(optarg);
break;
+ case 'e':
+ exename = optarg;
+ break;
case 'L':
options.script = optarg;
if (script_load(options.script)) {
@@ -306,7 +312,9 @@ static int handle_file(const char *filename, int start, int end, int draw)
is_blob = true;
printl(2, "cmd: %s\n", (char *)buf);
skip = false;
- if (!show_comp) {
+ if (exename) {
+ skip |= (strstr(buf, exename) != buf);
+ } else if (!show_comp) {
skip |= (strstr(buf, "fdperf") == buf);
skip |= (strstr(buf, "chrome") == buf);
skip |= (strstr(buf, "surfaceflinger") == buf);