tools/testing/selftests/powerpc/benchmarks/mmap_bench.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/benchmarks/mmap_bench.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/powerpc/benchmarks/mmap_bench.c
Extension
.c
Size
1678 bytes
Lines
91
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

if (pg_fault) {
			int count;
			for (count = 0; count < CHUNK_COUNT; count++)
				c[count << 16] = 'c';
		}
		munmap(c, MEMSIZE);
	}

	clock_gettime(CLOCK_MONOTONIC, &ts_end);

	printf("time = %.6f\n", ts_end.tv_sec - ts_start.tv_sec + (ts_end.tv_nsec - ts_start.tv_nsec) / 1e9);

	return 0;
}

int main(int argc, char *argv[])
{
	signed char c;
	while (1) {
		int option_index = 0;

		c = getopt_long(argc, argv, "", options, &option_index);

		if (c == -1)
			break;

		switch (c) {
		case 0:
			if (options[option_index].flag != 0)
				break;

			usage();
			exit(1);
			break;
		case 'i':
			iterations = atoi(optarg);
			break;
		default:
			usage();
			exit(1);
		}
	}

	test_harness_set_timeout(300);
	return test_harness(test_mmap, "mmap_bench");
}

Annotation

Implementation Notes