Skip to content

Commit 872f05c

Browse files
committed
dmatest: replace stored results mechanism, with uniform messages
For long running tests the tracking results in a memory leak for the "ok" results, and for the failures the kernel log should be sufficient. Provide a uniform format for error messages so they can be easily parsed and remove the debugfs file. Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 7b61017 commit 872f05c

File tree

2 files changed

+46
-221
lines changed

2 files changed

+46
-221
lines changed

Documentation/dmatest.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ be built as module or inside kernel. Let's consider those cases.
1616
Part 2 - When dmatest is built as a module...
1717

1818
After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
19-
folder with nodes will be created. There are two important files located. First
20-
is the 'run' node that controls run and stop phases of the test, and the second
21-
one, 'results', is used to get the test case results.
19+
folder with a file named 'run' nodes will be created. 'run' controls run and
20+
stop phases of the test.
2221

2322
Note that in this case test will not run on load automatically.
2423

@@ -32,8 +31,9 @@ Hint: available channel list could be extracted by running the following
3231
command:
3332
% ls -1 /sys/class/dma/
3433

35-
After a while you will start to get messages about current status or error like
36-
in the original code.
34+
Once started a message like "dmatest: Started 1 threads using dma0chan0" is
35+
emitted. After that only test failure messages are reported until the test
36+
stops.
3737

3838
Note that running a new test will not stop any in progress test.
3939

@@ -62,19 +62,18 @@ case. You always could check them at run-time by running
6262

6363
Part 4 - Gathering the test results
6464

65-
The module provides a storage for the test results in the memory. The gathered
66-
data could be used after test is done.
65+
Test results are printed to the kernel log buffer with the format:
6766

68-
The special file 'results' in the debugfs represents gathered data of the in
69-
progress test. The messages collected are printed to the kernel log as well.
67+
"dmatest: result <channel>: <test id>: '<error msg>' with src_off=<val> dst_off=<val> len=<val> (<err code>)"
7068

7169
Example of output:
72-
% cat /sys/kernel/debug/dmatest/results
73-
dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
70+
% dmesg | tail -n 1
71+
dmatest: result dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
7472

7573
The message format is unified across the different types of errors. A number in
7674
the parens represents additional information, e.g. error code, error counter,
77-
or status.
75+
or status. A test thread also emits a summary line at completion listing the
76+
number of tests executed, number that failed, and a result code.
7877

79-
Note that the buffer comparison is done in the old way, i.e. data is not
80-
collected and just printed out.
78+
The details of a data miscompare error are also emitted, but do not follow the
79+
above format.

0 commit comments

Comments
 (0)