Skip to content

Generate machine-readable output

Daniel Wagner linux-rt-users 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 2 repliesIn review
  2. v513 patches 13 repliesSuperseded
  3. v412 patches 3 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v3 RFC19 patches6 repliesSuperseded
v2 RFC6 patches0 repliesSuperseded
v1 RFC4 patches0 repliesSuperseded

Changes in v6 from the cover letter

- signaltest rebased
- sigwaittest rebases

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2signaltest: Add JSON output featuresrc/signaltest/signaltest.c+86 -201 reply
2/2sigwaittest: Add JSON output featuresrc/sigwaittest/sigwaittest.c+99 -181 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH rt-tests v6 0/2] Generate machine-readable output

v6:
- signaltest rebased
- sigwaittest rebases

v5:
- add 'realtime' to common header
- add timestamp to common header
- oslat add quiet option
- oslat fix JSON formatting
- rt-migrate fix JSON formatting

v4:
- rebased on top of '[rt-tests v3 00/16] rt-numa.h cleanups' series
- dropped applied patches
- dropped RFC label

v3:
- A number of bug fixes added at the beginning of the series.
- Add --output option to all tests which have a numeric results, not just failed/passed

v2:
- Moved the common JSON parts into rt-util.[ch]
- Add --output option to signaltest

The current output of cyclictest is optimized for humans to read. This is all good when working directly with the tools. But for CI integration it's a bit of pain. Furthermore, not all rt-tests use the same output format.

By using some easy to parse existing machine-readable format we can use standard libraries to parse the data. For example in jitterdebug there is a short Python program[1] to visualize either the histogram[2] or all samples[3].

The implementation for JSON output for this is very simple. The last patch adds a version of jitterdebugs's JSON output, which looks like

{
"file_version": 1,
"version:": "cyclictest V 1.90",
"num_threads": 2,
"resolution_in_ns": 0,
"cmdline:": "./cyclictest --affinity=1-2 --duration=1s --output=dump.json -h 1000 -p 80",

  "sysinfo": {
    "sysname": "Linux",
    "nodename": "beryllium",
    "release": "5.9.14-1-default",
    "version": "#1 SMP Sat Dec 12 06:57:32 UTC 2020 (c648a46)",
    "machine": "x86_64"
  },
  "thread": {
    "0": {
      "histogram": {
        "0": 16,
        "1": 853,
        "2": 80,
        "3": 50,
        "4": 1
      },
      "cycles": 1000,
      "min": 0,
      "max": 4,
      "avg": 1.17,
      "cpu": 1,
      "node": 0
    },
    "1": {
      "histogram": {
        "0": 14,
        "1": 833,
        "2": 93,
        "3": 56,
        "4": 4
      },
      "cycles": 1000,
      "min": 0,
      "max": 4,
      "avg": 1.20,
      "cpu": 2,
      "node": 0
    }

}
}

It's just a rough version. I didn't try to make it generic for the other rt-tests or make it as plugin as John was suggesting. I'd think we could make this feature as compile option, if you want to keep the program small. Obviously, we could also make the terminal output a compile option, to keep it small.

Anyway, what do you think about it?

Thanks,
Daniel

Daniel Wagner (2):
signaltest: Add JSON output feature
sigwaittest: Add JSON output feature

 src/signaltest/signaltest.c   | 106 ++++++++++++++++++++++++------
 src/sigwaittest/sigwaittest.c | 117 ++++++++++++++++++++++++++++------
 2 files changed, 185 insertions(+), 38 deletions(-)
Signature · 1 line
2.30.0