summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2020-10-06 11:38:54 +0300
committerEric Engestrom <eric@engestrom.ch>2020-10-14 19:29:29 +0200
commitfe747abc7c799cee752de9cf007266c26ec26644 (patch)
tree67a51e0ab8cc7f0ea09975086a7426ff561f893a
parentbd5400ce988357a69479c1a888d4fed977beee13 (diff)
intel/perf: fix crash when no perf queries are supported
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes: ec1fa1d51ff614 ("intel/perf: fix raw query kernel metric selection") Reviewed-by: Marcin Ĺšlusarz <marcin.slusarz@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7024> (cherry picked from commit 79f354441262622ea9b56d47dcbdc284f0eed6ad)
-rw-r--r--.pick_status.json2
-rw-r--r--src/intel/perf/gen_perf.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index b7976a7bb78..32aa971e72c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -8257,7 +8257,7 @@
"description": "intel/perf: fix crash when no perf queries are supported",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "ec1fa1d51ff614c19d08c949482b40c060de48c9"
},
diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c
index 77b7f4d8188..6e99042637e 100644
--- a/src/intel/perf/gen_perf.c
+++ b/src/intel/perf/gen_perf.c
@@ -631,7 +631,7 @@ load_oa_metrics(struct gen_perf_config *perf, int fd,
break;
}
}
- if (perf->fallback_raw_oa_metric == 0)
+ if (perf->fallback_raw_oa_metric == 0 && perf->n_queries > 0)
perf->fallback_raw_oa_metric = perf->queries[perf->n_queries - 1].oa_metrics_set_id;
return true;