[PATCH i-g-t 3/8] slabinfo
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Mon Jul 11 06:27:21 UTC 2022
---
tests/i915/gem_ppgtt.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index d8a448da25..df5bdb4dac 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -45,16 +45,16 @@
#define HEIGHT 512
#define SIZE (HEIGHT*STRIDE)
-static void dump_meminfo(const char *info, int lines)
+static void dump_file(const char *info, const char *filename, int lines)
{
FILE *file;
size_t n = 0;
char *line = NULL;
- file = fopen("/proc/meminfo", "r");
+ file = fopen(filename, "r");
igt_assert(file);
- igt_info("[meminfo - %s]\n", info);
+ igt_info("[info - %s]\n", info);
while (getline(&line, &n, file) >= 0 && lines--)
igt_info("%s", line);
@@ -303,14 +303,11 @@ static bool has_contexts(void)
igt_main
{
const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
- bool is_sandybridge = true;
igt_fixture {
int fd = drm_open_driver(DRIVER_INTEL);
uint32_t devid = intel_get_drm_devid(fd);
- if (IS_SANDYBRIDGE(devid))
- is_sandybridge = true;
igt_require_gem(fd);
gem_require_blitter(fd);
@@ -322,16 +319,16 @@ igt_main
int nchild = ncpus + 1;
uint64_t mem_per_test;
- /* Temporary meminfo dump for SNB */
- if (is_sandybridge)
- dump_meminfo("before drop-caches", 16);
+ /* Temporary meminfo dump*/
+ dump_file("meminfo before drop-caches", "/proc/meminfo", 16);
+ dump_file("slabinfo before drop-caches", "/proc/slabinfo", 1 << 30);
mem_per_test = SIZE;
igt_require_memory(nchild + 1, mem_per_test, CHECK_RAM);
/* SNB */
- if (is_sandybridge)
- dump_meminfo("after drop-caches", 16);
+ dump_file("meminfo after drop-caches", "/proc/meminfo", 16);
+ dump_file("slabinfo after drop-caches", "/proc/slabinfo", 1 << 30);
rcs = calloc(sizeof(*rcs), nchild);
igt_assert(rcs);
@@ -349,8 +346,8 @@ igt_main
free(rcs);
/* SNB */
- if (is_sandybridge)
- dump_meminfo("finish", 16);
+ dump_file("meminfo finish", "/proc/meminfo", 16);
+ dump_file("slabinfo finish", "/proc/slabinfo", 1 << 30);
}
igt_subtest("blt-vs-render-ctxN") {
--
2.34.1
More information about the Intel-gfx-trybot
mailing list