Commit 04ddd8f2 authored by Changpeng Liu's avatar Changpeng Liu Committed by Daniel Verkamp
Browse files

examples/ioat: fix the stop flag issue for kernel test tool



The "idle" status has 2 meanings for IOAT kernel performace
test module dmaperf: performance test task has finished or
no performance task at all. For the lastest kernel(4.8), the
userland tool will get the "idle" status before the kernel
changed to "running", but for some older kernels(3.17,4.0)
the test tool run correctly. So add a sleep syscall before
to get the status will fix it.

Change-Id: Ia236416607c77b3b8689933fe71ce53a783a04cc
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 200217a4
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -313,18 +313,20 @@ int main(int argc, char *argv[])

	fprintf(stdout, "Running I/O ");
	fflush(stdout);
	memset(buf, 0, BUFSIZ);
	/* wait all the channels to be idle */
	while (!get_str_from_file("/sys/kernel/debug/dmaperf/dmaperf/status", buf, BUFSIZ)) {
	do {
		fprintf(stdout, ". ");
		fflush(stdout);
		sleep(1);

		if (strstr(buf, "idle") != NULL) {
			fprintf(stdout, "\n");
			fflush(stdout);
			sleep(1);
			break;
		}
		fprintf(stdout, ". ");
		fflush(stdout);
		sleep(1);
	}
	} while (!get_str_from_file("/sys/kernel/debug/dmaperf/dmaperf/status", buf, BUFSIZ));

	/* collect each channel performance data */