[PATCH v2 i-g-t 2/6] tests: Add core_debugfs

Michal Wajdeczko michal.wajdeczko at intel.com
Fri Jun 13 13:49:42 UTC 2025


Hi,

some drive-by comments...

On 13.06.2025 12:51, Peter Senna Tschudin wrote:
> Introduce core_debugfs that is expected to work with any GPU, not
> limited to i915 and Xe. The test attempts to open every file in debugfs
> associated with the GPU.
> 

...

> --- /dev/null
> +++ b/tests/core_debugfs.c
> @@ -0,0 +1,54 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2025 Intel Corporation
> + */
> +
> +#include "igt.h"
> +#include "igt_debugfs.h"
> +#include "igt_dir.h"
> +
> +/**
> + * TEST: debugfs test
> + * Description: Read entries from debugfs
> + * Category: Core
> + * Mega feature: General Core features
> + * Sub-category: uapi
> + * Functionality: debugfs
> + * Feature: core
> + * Test category: uapi
> + *
> + * SUBTEST: debugfs-read-all-entries
> + * Description: Read all entries from debugfs path validating debugfs entries
> + */
> +
> +IGT_TEST_DESCRIPTION("Read entries from debugfs");
> +
> +igt_main
> +{
> +	int debugfs = -1;
> +	int fd = -1;
> +	igt_dir_t *igt_dir = NULL;
> +
> +	igt_fixture {
> +		fd = drm_open_driver_master(DRIVER_ANY);
> +		debugfs = igt_debugfs_dir(fd);
> +		igt_require(debugfs >= 0);
> +
> +		igt_dir = igt_dir_create(debugfs);
> +		igt_require(igt_dir);
> +
> +		kmstest_set_vt_graphics_mode();
> +	}
> +
> +	igt_describe("Read all entries from debugfs path.");
> +	igt_subtest("debugfs-read-all-entries") {

since this test is named "core_debugfs" then there is no need to repeat
"debugfs" in the subtest/case name, and this could be just:

	igt at core_debugfs@read-all-entries


> +		igt_dir_scan_dirfd(igt_dir, -1);
> +		igt_dir_process_files(igt_dir, NULL, NULL);
> +	}
> +
> +	igt_fixture {
> +		igt_dir_destroy(igt_dir);
> +		close(debugfs);
> +		drm_close_driver(fd);
> +	}
> +}


More information about the igt-dev mailing list