Mesa (master): intel/perf: split load_oa_metrics
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 10 14:00:44 UTC 2020
Module: Mesa
Branch: master
Commit: 59716e40b0f198e19b8baae2d9952f8e8e76428c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=59716e40b0f198e19b8baae2d9952f8e8e76428c
Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date: Thu Jul 9 19:49:55 2020 +0200
intel/perf: split load_oa_metrics
Move oa_metrics_available out of load_oa_metrics and call
build_unique_counter_list outside.
This change is a preparation for the next patch. It should
not have any functional impact.
Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
---
src/intel/perf/gen_perf.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c
index e6a18a3a8d5..4f95b0a84af 100644
--- a/src/intel/perf/gen_perf.c
+++ b/src/intel/perf/gen_perf.c
@@ -662,8 +662,8 @@ build_unique_counter_list(struct gen_perf_config *perf)
}
static bool
-load_oa_metrics(struct gen_perf_config *perf, int fd,
- const struct gen_device_info *devinfo)
+oa_metrics_available(struct gen_perf_config *perf, int fd,
+ const struct gen_device_info *devinfo)
{
perf_register_oa_queries_t oa_register = get_register_queries_function(devinfo);
bool i915_perf_oa_available = false;
@@ -697,11 +697,17 @@ load_oa_metrics(struct gen_perf_config *perf, int fd,
perf->platform_supported = oa_register != NULL;
}
- if (!i915_perf_oa_available ||
- !oa_register ||
- !get_sysfs_dev_dir(perf, fd) ||
- !init_oa_sys_vars(perf, devinfo))
- return false;
+ return i915_perf_oa_available &&
+ oa_register &&
+ get_sysfs_dev_dir(perf, fd) &&
+ init_oa_sys_vars(perf, devinfo);
+}
+
+static void
+load_oa_metrics(struct gen_perf_config *perf, int fd,
+ const struct gen_device_info *devinfo)
+{
+ perf_register_oa_queries_t oa_register = get_register_queries_function(devinfo);
perf->oa_metrics_table =
_mesa_hash_table_create(perf, _mesa_hash_string,
@@ -720,10 +726,6 @@ load_oa_metrics(struct gen_perf_config *perf, int fd,
} else {
add_all_metrics(perf, devinfo);
}
-
- build_unique_counter_list(perf);
-
- return true;
}
struct gen_perf_registers *
@@ -1048,6 +1050,10 @@ gen_perf_init_metrics(struct gen_perf_config *perf_cfg,
load_pipeline_statistic_metrics(perf_cfg, devinfo);
gen_perf_register_mdapi_statistic_query(perf_cfg, devinfo);
}
- if (load_oa_metrics(perf_cfg, drm_fd, devinfo))
+
+ if (oa_metrics_available(perf_cfg, drm_fd, devinfo)) {
+ load_oa_metrics(perf_cfg, drm_fd, devinfo);
+ build_unique_counter_list(perf_cfg);
gen_perf_register_mdapi_oa_query(perf_cfg, devinfo);
+ }
}
More information about the mesa-commit
mailing list