mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
pan/perf: Add derived counter prerequisites
This commit is contained in:
parent
2951770119
commit
7887f4e7b5
2 changed files with 24 additions and 1 deletions
|
|
@ -88,6 +88,15 @@ pan_perf_init(struct pan_perf *perf, int fd)
|
|||
UNREACHABLE("Performance counters missing!");
|
||||
|
||||
pan_kmod_perf_query_layout(perf->session, &perf->mem_layout);
|
||||
|
||||
unsigned unused;
|
||||
|
||||
perf->derived_configs[PAN_PERF_DERIVED_CONFIG_SHADER_CORE_COUNT] =
|
||||
pan_query_core_count(&props, &unused);
|
||||
perf->derived_configs[PAN_PERF_DERIVED_CONFIG_L2_CACHE_COUNT] =
|
||||
pan_query_l2_slices(&props);
|
||||
perf->derived_configs[PAN_PERF_DERIVED_CONFIG_EXT_BUS_BYTE_SIZE] =
|
||||
pan_query_bus_width(&props);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PAN_PERF_MAX_COUNTERS 128
|
||||
/* 128 hardware counters, but there can be more derived ones. */
|
||||
#define PAN_PERF_MAX_COUNTERS 190
|
||||
|
||||
enum pan_perf_counter_categories {
|
||||
PAN_PERF_COUNTER_CAT_FRONTEND,
|
||||
|
|
@ -50,6 +51,15 @@ enum pan_perf_counter_units {
|
|||
PAN_PERF_COUNTER_UNITS_BYTES_PER_SECOND,
|
||||
};
|
||||
|
||||
enum pan_perf_derived_config {
|
||||
PAN_PERF_DERIVED_CONFIG_SHADER_CORE_COUNT,
|
||||
PAN_PERF_DERIVED_CONFIG_EXT_BUS_BYTE_SIZE,
|
||||
PAN_PERF_DERIVED_CONFIG_L2_CACHE_COUNT,
|
||||
PAN_PERF_DERIVED_CONFIG_LAST = PAN_PERF_DERIVED_CONFIG_L2_CACHE_COUNT,
|
||||
};
|
||||
|
||||
struct pan_perf;
|
||||
|
||||
struct pan_perf_counter {
|
||||
const char *name;
|
||||
const char *desc;
|
||||
|
|
@ -58,6 +68,9 @@ struct pan_perf_counter {
|
|||
// Offset of this counter's value within the category
|
||||
uint32_t offset;
|
||||
enum pan_perf_counter_categories category;
|
||||
|
||||
/* Optional, function to compute the derived counters value. */
|
||||
double (*derived)(const struct pan_perf*, const double*, uint8_t);
|
||||
};
|
||||
|
||||
struct pan_perf_category {
|
||||
|
|
@ -82,6 +95,7 @@ struct pan_perf {
|
|||
struct pan_kmod_perf_session *session;
|
||||
const struct pan_perf_config *cfg;
|
||||
struct pan_kmod_perf_buffer_layout mem_layout;
|
||||
double derived_configs[PAN_PERF_DERIVED_CONFIG_LAST + 1];
|
||||
};
|
||||
|
||||
int64_t pan_perf_counter_read(const struct pan_perf *perf,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue