drivers/gpu/drm/xe/xe_gt_stats.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_gt_stats.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/xe/xe_gt_stats.c
Extension
.c
Size
6914 bytes
Lines
204
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

for_each_possible_cpu(cpu) {
			struct xe_gt_stats *s = per_cpu_ptr(gt->stats, cpu);

			total += s->counters[id];
		}

		drm_printf(p, "%s: %lld\n", stat_description[id], total);
	}

	return 0;
}

/**
 * xe_gt_stats_clear() - Clear the GT stats
 * @gt: GT structure
 *
 * Clear (zero) all available GT stats. Note that if the stats are being
 * updated while this function is running, the results may be unpredictable.
 * Intended to be called on an idle GPU.
 */
void xe_gt_stats_clear(struct xe_gt *gt)
{
	int cpu;

	for_each_possible_cpu(cpu) {
		struct xe_gt_stats *s = per_cpu_ptr(gt->stats, cpu);

		memset(s, 0, sizeof(*s));
	}
}

Annotation

Implementation Notes