- free (stage_name);
-}
-
-void
-metrics_info_init (void)
-{
- unsigned i, j;
- GLuint *group_ids;
- metrics_info_t *info = ¤t_context.metrics_info;
-
- if (info->initialized)
- metrics_info_fini (info);
-
- glGetPerfMonitorGroupsAMD ((int *) &info->num_groups, 0, NULL);
-
- group_ids = xmalloc (info->num_groups * sizeof (GLuint));
-
- glGetPerfMonitorGroupsAMD (NULL, info->num_groups, group_ids);
-
- info->groups = xmalloc (info->num_groups * sizeof (metrics_group_info_t));
-
- for (i = 0; i < info->num_groups; i++)
- metrics_group_info_init (&info->groups[i], group_ids[i]);
-
- free (group_ids);
-
- /* Identify each shader stage (by looking at
- * performance-counter names for specific patterns) and
- * initialize structures referring to the corresponding
- * counter numbers for each stage. */
- info->num_shader_stages = 0;
- info->stages = NULL;
-
- for (i = 0; i < info->num_groups; i++) {
- metrics_group_info_t *group = &info->groups[i];
- for (j = 0; j < group->num_counters; j++) {
- char *name = group->counter_names[j];
- if (strstr (name, "Shader Active Time")) {
- _add_shader_stage (info, name, i, j,
- SHADER_ACTIVE);
- }
- if (strstr (name, "Shader Stall Time")) {
- _add_shader_stage (info, name, i, j,
- SHADER_STALL);
- }
- }
+ for (monitor = metrics->monitor_head;
+ monitor;
+ monitor = monitor_next)
+ {
+ glDeletePerfMonitorsAMD (1, &monitor->id);
+ monitor_next = monitor->next;
+ free (monitor);