Skip to content

Commit

Permalink
dmatest: replace stored results mechanism, with uniform messages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Williams committed Nov 14, 2013
1 parent 7b61017 commit 872f05c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 221 deletions.
27 changes: 13 additions & 14 deletions Documentation/dmatest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ be built as module or inside kernel. Let's consider those cases.
Part 2 - When dmatest is built as a module...

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

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

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

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

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

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

Part 4 - Gathering the test results

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

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

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

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

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

0 comments on commit 872f05c

Please sign in to comment.