Lines Matching full:drm

76 	struct drm_pmu *drm;
110 zfree(&drm);
111 pr_err("Unable to encode DRM PMU type for %s\n", name);
115 drm = zalloc(sizeof(*drm));
116 if (!drm)
119 if (perf_pmu__init(&drm->pmu, type, name) != 0) {
120 perf_pmu__delete(&drm->pmu);
124 drm->pmu.cpus = perf_cpu_map__new_int(0);
125 if (!drm->pmu.cpus) {
126 perf_pmu__delete(&drm->pmu);
129 return drm;
162 struct drm_pmu *drm = NULL;
173 if (strstarts(line, "drm-driver:")) {
174 drm = add_drm_pmu(pmus, line, line_len);
175 if (!drm)
183 if (strstarts(line, "drm-active-")) {
188 if (strstarts(line, "drm-cycles-")) {
193 if (strstarts(line, "drm-engine-capacity-")) {
198 if (strstarts(line, "drm-engine-")) {
203 if (strstarts(line, "drm-maxfreq-")) {
208 if (strstarts(line, "drm-purgeable-")) {
213 if (strstarts(line, "drm-resident-")) {
218 if (strstarts(line, "drm-shared-")) {
223 if (strstarts(line, "drm-total-cycles-")) {
228 if (strstarts(line, "drm-total-")) {
233 if (verbose > 1 && strstarts(line, "drm-") &&
234 !strstarts(line, "drm-client-id:") &&
235 !strstarts(line, "drm-pdev:"))
236 pr_debug("Unhandled DRM PMU fdinfo line match '%s'\n", line);
238 if (drm) {
239 drm->events = events;
240 drm->num_events = num_events;
241 list_add_tail(&drm->pmu.list, pmus);
251 struct drm_pmu *drm = container_of(pmu, struct drm_pmu, pmu);
253 free(drm->events);
258 struct drm_pmu *drm = container_of(pmu, struct drm_pmu, pmu);
260 if (!strstarts(name, "drm-"))
263 for (int i = 0; i < drm->num_events; i++) {
264 if (!strcasecmp(drm->events[i].name, name))
272 struct drm_pmu *drm = container_of(pmu, struct drm_pmu, pmu);
274 for (int i = 0; i < drm->num_events; i++) {
278 .name = drm->events[i].name,
280 .scale_unit = drm_pmu_scale_unit_strs[drm->events[i].unit],
281 .desc = drm->events[i].desc,
284 .topic = "drm",
286 .event_type_desc = "DRM event",
301 const struct drm_pmu *drm = container_of(pmu, struct drm_pmu, pmu);
303 return drm->num_events;
306 static int drm_pmu__index_for_event(const struct drm_pmu *drm, const char *name)
308 for (int i = 0; i < drm->num_events; i++) {
309 if (!strcmp(drm->events[i].name, name))
315 static int drm_pmu__config_term(const struct drm_pmu *drm,
321 int i = drm_pmu__index_for_event(drm, term->config);
333 "unexpected drm event term (%s) %s",
336 ? strdup("unexpected drm event term")
348 struct drm_pmu *drm = container_of(pmu, struct drm_pmu, pmu);
352 if (drm_pmu__config_term(drm, attr, term, err))
362 struct drm_pmu *drm = container_of(pmu, struct drm_pmu, pmu);
367 int i = drm_pmu__index_for_event(drm, term->config);
370 info->unit = drm_pmu_unit_strs[drm->events[i].unit];
380 "unexpected drm event term (%s) %s",
383 ? strdup("unexpected drm event term")
450 /* Open fdinfo dir if we have a DRM fd. */
476 * minors maintains an array of DRM minor device numbers seen for a pid,
621 static uint64_t drm_pmu__read_system_wide(struct drm_pmu *drm, struct evsel *evsel)
625 .match = drm->events[evsel->core.attr.config].name,
626 .unit = drm->events[evsel->core.attr.config].unit,
633 static uint64_t drm_pmu__read_for_pid(struct drm_pmu *drm, struct evsel *evsel, int pid)
637 .match = drm->events[evsel->core.attr.config].name,
638 .unit = drm->events[evsel->core.attr.config].unit,
661 struct drm_pmu *drm = container_of(evsel->pmu, struct drm_pmu, pmu);
667 counter = drm_pmu__read_for_pid(drm, evsel, pid);
669 counter = drm_pmu__read_system_wide(drm, evsel);