Skip to contentSkip to conversation

runner: Handle escaped characters from kmsg

PATCH In review Petri Latvala 3 participants 4 messages Nov 13, 2018 – Dec 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runner: Handle escaped characters from kmsg

Characters in kernel logs, when read from /dev/kmsg, are escaped as \xNN if they are not between 32 and 127 of if they are "\". Decode what we can when creating results.json.

Cc Tvrtko Ursulin <[email protected]>
Cc Arkadiusz Hiler <[email protected]>
---
 .../json_tests_data/dmesg-escapes/0/dmesg.txt | 13 ++++
 .../json_tests_data/dmesg-escapes/0/err.txt   |  2 +
 .../dmesg-escapes/0/journal.txt               |  2 +
 .../json_tests_data/dmesg-escapes/0/out.txt   |  3 +
 .../json_tests_data/dmesg-escapes/README.txt  |  4 ++
 .../json_tests_data/dmesg-escapes/endtime.txt |  1 +
 .../json_tests_data/dmesg-escapes/joblist.txt |  1 +
 .../dmesg-escapes/metadata.txt                | 12 ++++
 .../dmesg-escapes/reference.json              | 72 +++++++++++++++++++
 .../dmesg-escapes/starttime.txt               |  1 +
 .../json_tests_data/dmesg-escapes/uname.txt   |  1 +
 runner/resultgen.c                            | 47 +++++++++++-
 runner/runner_json_tests.c                    |  1 +
 13 files changed, 158 insertions(+), 2 deletions(-)
 create mode 100644 runner/json_tests_data/dmesg-escapes/0/dmesg.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/0/err.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/0/journal.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/0/out.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/README.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/endtime.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/joblist.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/metadata.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/reference.json
 create mode 100644 runner/json_tests_data/dmesg-escapes/starttime.txt
 create mode 100644 runner/json_tests_data/dmesg-escapes/uname.txt
runner/json_tests_data/dmesg-escapes/0/dmesg.txt new file +13 -0
new file mode 100644
index 00000000..a585c03a
@@ -0,0 +1,13 @@
+6,951,3216186095083,-;Console: switching to colour dummy device 80x25
+14,952,3216186095097,-;[IGT] successtest: executing
+14,953,3216186101115,-;[IGT] successtest: starting subtest first-subtest
+6,954,3216186101159,-;String with a\x0anewline
+6,954,3216186101159,-;String with a\x09tab
+6,954,3216186101159,-;String with an explicit\x00NUL
+6,954,3216186101159,-;The character \x13 should be nonprintable
+6,954,3216186101159,-;Escaped backslash is \x5c
+6,954,3216186101159,-;Kernel shouldn't output this but cutoff escape \x1
+6,954,3216186101159,-;More cutoff \x
+6,954,3216186101159,-;One more \
+14,955,3216186101160,-;[IGT] successtest: exiting, ret=0
+6,956,3216186101299,-;Console: switching to colour frame buffer device 240x75
runner/json_tests_data/dmesg-escapes/0/err.txt new file +2 -0
new file mode 100644
index 00000000..5dc78057
@@ -0,0 +1,2 @@
+Starting subtest: first-subtest
+Subtest first-subtest: SUCCESS (0.000s)
runner/json_tests_data/dmesg-escapes/0/journal.txt new file +2 -0
new file mode 100644
index 00000000..86a30e07
@@ -0,0 +1,2 @@
+first-subtest
+exit:0 (0.014s)
runner/json_tests_data/dmesg-escapes/0/out.txt new file +3 -0
new file mode 100644
index 00000000..5946bf31
@@ -0,0 +1,3 @@
+IGT-Version: 1.23-g0c763bfd (x86_64) (Linux: 4.18.0-1-amd64 x86_64)
+Starting subtest: first-subtest
+Subtest first-subtest: SUCCESS (0.000s)
runner/json_tests_data/dmesg-escapes/README.txt new file +4 -0
new file mode 100644
index 00000000..fbb7c6c4
@@ -0,0 +1,4 @@
+Unprintable characters in kernel logs, when read via /dev/kmsg, are
+escaped as \xNN where NN the character's ascii code in hex. Those are
+expected to be decoded to results, if they really are
+printable. Kernel's idea of nonprintable is "c < 0x20 || c > 127".
runner/json_tests_data/dmesg-escapes/endtime.txt new file +1 -0
new file mode 100644
index 00000000..635f6ae9
@@ -0,0 +1 @@
+1539953735.172373
runner/json_tests_data/dmesg-escapes/joblist.txt new file +1 -0
new file mode 100644
index 00000000..81f914a7
@@ -0,0 +1 @@
+successtest first-subtest
runner/json_tests_data/dmesg-escapes/metadata.txt new file +12 -0
new file mode 100644
index 00000000..1316560d
@@ -0,0 +1,12 @@
+abort_on_error : 0
+name : normal-run
+dry_run : 0
+sync : 0
+log_level : 0
+overwrite : 0
+multiple_mode : 0
+inactivity_timeout : 0
+use_watchdog : 0
+piglit_style_dmesg : 0
+test_root : /path/does/not/exist
+results_path : /path/does/not/exist
runner/json_tests_data/dmesg-escapes/reference.json new file +72 -0

72 lines not on this page · raw message

runner/json_tests_data/dmesg-escapes/starttime.txt new file +1 -0
new file mode 100644
index 00000000..ae038f18
@@ -0,0 +1 @@
+1539953735.111039
runner/json_tests_data/dmesg-escapes/uname.txt new file +1 -0
new file mode 100644
index 00000000..a7aef6f7
@@ -0,0 +1 @@
+Linux hostname 4.18.0-1-amd64 #1 SMP Debian 4.18.6-1 (2018-09-06) x86_64
runner/resultgen.c +45 -2

59 lines not on this page · raw message

runner/runner_json_tests.c +1 -0
index 758700d4..6c15b617 100644
@@ -154,6 +154,7 @@ static const char *dirnames[] = {
 	"piglit-style-dmesg",
 	"incomplete-before-any-subtests",
 	"dmesg-results",
+	"dmesg-escapes",
 };
 
 igt_main
Signature · 6 lines
2.18.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/1] runner: Handle escaped characters from kmsg

== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/1] runner: Handle escaped characters from kmsg
URL : https://patchwork.freedesktop.org/series/52415/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4714 -> IGTPW_2053 =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_2053 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_2053, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/52415/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_2053:

=== IGT changes ===

    ==== Warnings ====

    igt@kms_flip@basic-flip-vs-modeset:
      fi-kbl-x1275:       SKIP -> PASS +36

== Known issues ==

Here are the changes found in IGTPW_2053 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_ctx_switch@basic-default:
      fi-icl-u:           NOTRUN -> INCOMPLETE (fdo#108315)

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-WARN (fdo#102614)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-byt-clapper:     FAIL (fdo#107362, fdo#103191) -> PASS

fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#108315 https://bugs.freedesktop.org/show_bug.cgi?id=108315

== Participating hosts (53 -> 46) ==

Additional (1): fi-icl-u
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-snb-2520m fi-ctg-p8600

== Build changes ==

* IGT: IGT_4714 -> IGTPW_2053

CI_DRM_5106: 852b9329fbb6ea8bdbb3dac78328aae73d919305 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2053: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2053/
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2053/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/1] runner: Handle escaped characters from kmsg

In reply to Petri Latvala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/1] runner: Handle escaped characters from kmsg
URL : https://patchwork.freedesktop.org/series/52415/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4714_full -> IGTPW_2053_full =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_2053_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_2053_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/52415/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_2053_full:

=== IGT changes ===

    ==== Warnings ====

    igt@perf_pmu@rc6:
      shard-kbl:          PASS -> SKIP

    igt@pm_rc6_residency@rc6-accuracy:
      shard-snb:          SKIP -> PASS

== Known issues ==

Here are the changes found in IGTPW_2053_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@shrink:
      shard-glk:          NOTRUN -> INCOMPLETE (k.org#198133, fdo#103359, fdo#106886)

    igt@drv_suspend@sysfs-reader:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@gem_exec_reuse@baggage:
      shard-apl:          PASS -> DMESG-WARN (fdo#108691)

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-kbl:          PASS -> INCOMPLETE (fdo#106023, fdo#103665, fdo#106887)

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
      shard-kbl:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
      shard-apl:          PASS -> DMESG-WARN (fdo#107956)

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
      shard-glk:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_chv_cursor_fail@pipe-a-128x128-bottom-edge:
      shard-glk:          PASS -> DMESG-WARN (fdo#105763, fdo#106538) +2

    igt@kms_color@pipe-a-ctm-max:
      shard-apl:          PASS -> FAIL (fdo#108147)

    igt@kms_color@pipe-a-legacy-gamma:
      shard-apl:          PASS -> FAIL (fdo#108145, fdo#104782)

    igt@kms_color@pipe-b-ctm-blue-to-red:
      shard-apl:          PASS -> DMESG-WARN (fdo#105602, fdo#103558) +15

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-apl:          PASS -> FAIL (fdo#103232) +9

    igt@kms_cursor_crc@cursor-64x64-dpms:
      shard-kbl:          PASS -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-64x64-sliding:
      shard-glk:          PASS -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-64x64-suspend:
      shard-apl:          PASS -> FAIL (fdo#103191, fdo#103232)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu:
      shard-apl:          PASS -> FAIL (fdo#103167) +1

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
      shard-glk:          NOTRUN -> FAIL (fdo#103167) +2

    igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-pwrite:
      shard-glk:          PASS -> DMESG-FAIL (fdo#106538)

    igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
      shard-glk:          NOTRUN -> FAIL (fdo#108145) +7

    igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
      shard-glk:          PASS -> FAIL (fdo#103166) +2

    igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
      shard-glk:          NOTRUN -> FAIL (fdo#103166) +1
      shard-kbl:          PASS -> FAIL (fdo#103166)

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          PASS -> FAIL (fdo#103166) +7

    igt@kms_properties@connector-properties-atomic:
      shard-glk:          NOTRUN -> FAIL (fdo#108642)
      shard-hsw:          NOTRUN -> FAIL (fdo#108642)

    igt@kms_vblank@pipe-b-query-forked-hang:
      shard-glk:          NOTRUN -> DMESG-WARN (fdo#105763, fdo#106538)

    
    ==== Possible fixes ====

    igt@drv_suspend@forcewake:
      shard-kbl:          INCOMPLETE (fdo#103665) -> PASS

    igt@drv_suspend@shrink:
      shard-snb:          INCOMPLETE (fdo#105411, fdo#106886) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#106023, fdo#103665, fdo#106887) -> PASS

    igt@kms_cursor_crc@cursor-128x42-sliding:
      shard-kbl:          FAIL (fdo#103232) -> PASS +3

    igt@kms_cursor_crc@cursor-256x85-random:
      shard-glk:          FAIL (fdo#103232) -> PASS +1

    igt@kms_cursor_crc@cursor-64x21-sliding:
      shard-apl:          FAIL (fdo#103232) -> PASS +1

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
      shard-apl:          FAIL (fdo#103167) -> PASS +1

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
      shard-glk:          FAIL (fdo#103167) -> PASS +3

    igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
      shard-kbl:          FAIL (fdo#103166) -> PASS

    igt@kms_universal_plane@universal-plane-pipe-a-functional:
      shard-glk:          FAIL (fdo#103166) -> PASS +3

    igt@kms_vblank@pipe-a-query-busy:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@perf_pmu@busy-start-vcs0:
      shard-apl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS

fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147
fdo#108642 https://bugs.freedesktop.org/show_bug.cgi?id=108642
fdo#108691 https://bugs.freedesktop.org/show_bug.cgi?id=108691
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (6 -> 5) ==

Missing (1): shard-skl

== Build changes ==

* IGT: IGT_4714 -> IGTPW_2053

CI_DRM_5106: 852b9329fbb6ea8bdbb3dac78328aae73d919305 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2053: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2053/
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2053/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v1 1/1
#3 lore raw
In reply to Petri Latvala
Quoted 7 lines · Petri Latvala

Characters in kernel logs, when read from /dev/kmsg, are escaped as \xNN if they are not between 32 and 127 of if they are "\". Decode what we can when creating results.json.

Cc Tvrtko Ursulin <[email protected]>
Cc Arkadiusz Hiler <[email protected]>

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev