#define FILE_DEBUG_FLAG DEBUG_PERFMON
 
 static bool
-get_sysfs_dev_dir(struct gen_perf *perf, int fd)
+get_sysfs_dev_dir(struct gen_perf_config *perf, int fd)
 {
    struct stat sb;
    int min, maj;
 }
 
 static bool
-read_sysfs_drm_device_file_uint64(struct gen_perf *perf,
+read_sysfs_drm_device_file_uint64(struct gen_perf_config *perf,
                                   const char *file,
                                   uint64_t *value)
 {
 }
 
 static void
-register_oa_config(struct gen_perf *perf,
+register_oa_config(struct gen_perf_config *perf,
                    const struct gen_perf_query_info *query,
                    uint64_t config_id)
 {
 }
 
 static void
-enumerate_sysfs_metrics(struct gen_perf *perf)
+enumerate_sysfs_metrics(struct gen_perf_config *perf)
 {
    DIR *metricsdir = NULL;
    struct dirent *metric_entry;
 }
 
 static bool
-kernel_has_dynamic_config_support(struct gen_perf *perf, int fd)
+kernel_has_dynamic_config_support(struct gen_perf_config *perf, int fd)
 {
    uint64_t invalid_config_id = UINT64_MAX;
 
 }
 
 bool
-gen_perf_load_metric_id(struct gen_perf *perf, const char *guid,
+gen_perf_load_metric_id(struct gen_perf_config *perf, const char *guid,
                         uint64_t *metric_id)
 {
    char config_path[280];
 }
 
 static void
-init_oa_configs(struct gen_perf *perf, int fd)
+init_oa_configs(struct gen_perf_config *perf, int fd)
 {
    hash_table_foreach(perf->oa_metrics_table, entry) {
       const struct gen_perf_query_info *query = entry->data;
 }
 
 static void
-compute_topology_builtins(struct gen_perf *perf,
+compute_topology_builtins(struct gen_perf_config *perf,
                           const struct gen_device_info *devinfo)
 {
    perf->sys_vars.slice_mask = devinfo->slice_masks;
 }
 
 static bool
-init_oa_sys_vars(struct gen_perf *perf, const struct gen_device_info *devinfo)
+init_oa_sys_vars(struct gen_perf_config *perf, const struct gen_device_info *devinfo)
 {
    uint64_t min_freq_mhz = 0, max_freq_mhz = 0;
 
    return true;
 }
 
-typedef void (*perf_register_oa_queries_t)(struct gen_perf *);
+typedef void (*perf_register_oa_queries_t)(struct gen_perf_config *);
 
 static perf_register_oa_queries_t
 get_register_queries_function(const struct gen_device_info *devinfo)
 }
 
 bool
-gen_perf_load_oa_metrics(struct gen_perf *perf, int fd,
+gen_perf_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);
 
 
 struct gen_device_info;
 
-struct gen_perf;
+struct gen_perf_config;
 struct gen_perf_query_info;
 
 enum gen_perf_counter_type {
    size_t offset;
 
    union {
-      uint64_t (*oa_counter_read_uint64)(struct gen_perf *perf,
+      uint64_t (*oa_counter_read_uint64)(struct gen_perf_config *perf,
                                          const struct gen_perf_query_info *query,
                                          const uint64_t *accumulator);
-      float (*oa_counter_read_float)(struct gen_perf *perf,
+      float (*oa_counter_read_float)(struct gen_perf_config *perf,
                                      const struct gen_perf_query_info *query,
                                      const uint64_t *accumulator);
       struct gen_pipeline_stat pipeline_stat;
    uint32_t n_b_counter_regs;
 };
 
-struct gen_perf {
+struct gen_perf_config {
    struct gen_perf_query_info *queries;
    int n_queries;
 
 }
 
 static inline struct gen_perf_query_info *
-gen_perf_query_append_query_info(struct gen_perf *perf, int max_counters)
+gen_perf_query_append_query_info(struct gen_perf_config *perf, int max_counters)
 {
    struct gen_perf_query_info *query;
 
    gen_perf_query_info_add_stat_reg(query, reg, 1, 1, name, name);
 }
 
-static inline struct gen_perf *
+static inline struct gen_perf_config *
 gen_perf_new(void *ctx, int (*ioctl_cb)(int, unsigned long, void *))
 {
-   struct gen_perf *perf = rzalloc(ctx, struct gen_perf);
+   struct gen_perf_config *perf = rzalloc(ctx, struct gen_perf_config);
 
    perf->ioctl = ioctl_cb;
 
    return perf;
 }
 
-bool gen_perf_load_oa_metrics(struct gen_perf *perf, int fd,
+bool gen_perf_load_oa_metrics(struct gen_perf_config *perf, int fd,
                               const struct gen_device_info *devinfo);
-bool gen_perf_load_metric_id(struct gen_perf *perf, const char *guid,
+bool gen_perf_load_metric_id(struct gen_perf_config *perf, const char *guid,
                              uint64_t *metric_id);
 
 void gen_perf_query_result_read_frequencies(struct gen_perf_query_result *result,
 
         read_eq = counter.get('equation')
 
         c("static " + ret_type)
-        c(counter.read_sym + "(UNUSED struct gen_perf *perf,\n")
+        c(counter.read_sym + "(UNUSED struct gen_perf_config *perf,\n")
         c_indent(len(counter.read_sym) + 1)
         c("const struct gen_perf_query_info *query,\n")
         c("const uint64_t *accumulator)\n")
             ret_type = "uint64_t"
 
         c("static " + ret_type)
-        c(counter.max_sym() + "(struct gen_perf *perf)\n")
+        c(counter.max_sym() + "(struct gen_perf_config *perf)\n")
         c("{")
         c_indent(3)
         output_rpn_equation_code(set, counter, max_eq)
     h(textwrap.dedent("""\
         #pragma once
 
-        struct gen_perf;
+        struct gen_perf_config;
 
         """))
 
             c("};\n")
 
             c("\nstatic void\n")
-            c("{0}_register_{1}_counter_query(struct gen_perf *perf)\n".format(gen.chipset, set.underscore_name))
+            c("{0}_register_{1}_counter_query(struct gen_perf_config *perf)\n".format(gen.chipset, set.underscore_name))
             c("{\n")
             c_indent(3)
 
             c_outdent(3)
             c("}\n")
 
-        h("void gen_oa_register_queries_" + gen.chipset + "(struct gen_perf *perf);\n")
+        h("void gen_oa_register_queries_" + gen.chipset + "(struct gen_perf_config *perf);\n")
 
         c("\nvoid")
-        c("gen_oa_register_queries_" + gen.chipset + "(struct gen_perf *perf)")
+        c("gen_oa_register_queries_" + gen.chipset + "(struct gen_perf_config *perf)")
         c("{")
         c_indent(3)
 
 
    } predicate;
 
    struct {
-      struct gen_perf *perf;
+      struct gen_perf_config *perf;
 
       /* The i915 perf stream we open to setup + enable the OA counters */
       int oa_stream_fd;
 
                     size_t data_size,
                     uint8_t *data)
 {
-   struct gen_perf *perf = brw->perfquery.perf;
+   struct gen_perf_config *perf = brw->perfquery.perf;
    const struct gen_perf_query_info *query = obj->query;
    int n_counters = query->n_counters;
    int written = 0;
 init_pipeline_statistic_query_registers(struct brw_context *brw)
 {
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
-   struct gen_perf *perf = brw->perfquery.perf;
+   struct gen_perf_config *perf = brw->perfquery.perf;
    struct gen_perf_query_info *query =
       gen_perf_query_append_query_info(perf, MAX_STAT_COUNTERS);
 
 
 brw_perf_query_register_mdapi_oa_query(struct brw_context *brw)
 {
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
-   struct gen_perf *perf = brw->perfquery.perf;
+   struct gen_perf_config *perf = brw->perfquery.perf;
    struct gen_perf_query_info *query = NULL;
 
    /* MDAPI requires different structures for pretty much every generation