runner/resultgen: Add a new field to carry overall runtimes
PATCH 1/2 runner/resultgen: Add a new field to carry overall runtimes
Previously, the total runtime of binary foo with subtests bar and quz was accumulated to the tests field under 'igt@foo' with just a TimeAttribute field. This confuses piglit-derived scripts deep down the CI pipeline, so move the overall binary runtime to a new field 'runtimes', with TimeAttribute fields for 'igt@foo'.
--- runner/resultgen.c | 73 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 26 deletions(-)
runner/resultgen.c +47 -26
@@ -29,6 +29,13 @@ struct subtestssize_t size; }; +struct results +{ +struct json_object *tests; +struct json_object *totals; +struct json_object *runtimes; +}; +/* * A lot of string handling here operates on an mmapped buffer, and * thus we can't assume null-terminated strings. Buffers will be
@@ -725,7 +732,7 @@ static void add_subtest(struct subtests *subtests, char *subtest)static void fill_from_journal (int fd,struct job_list_entry *entry,struct subtests *subtests, -struct json_object *tests) +struct results *results) {FILE *f =fdopen (fd,"r" );char *line =NULL ;
@@ -735,6 +742,8 @@ static void fill_from_journal(int fd,char timeoutline[] ="timeout:" ;int exitcode =INCOMPLETE_EXITCODE ;bool has_timeout = false; +struct json_object *tests = results->tests; +struct json_object *runtimes = results->runtimes;while ((read =getline (&line, &linelen, f)) >0 ) {if (read >=strlen (exitline) && !memcmp (line, exitline,strlen (exitline))) {
@@ -743,15 +752,20 @@ static void fill_from_journal(int fd,double time =0.0 ;struct json_object *obj; -generate_piglit_name (entry->binary,NULL , piglit_name,sizeof (piglit_name)); - obj =get_or_create_json_object (tests, piglit_name); - exitcode =atoi (line +strlen (exitline));if (p) time =strtod (p +1 ,NULL ); +generate_piglit_name (entry->binary,NULL , piglit_name,sizeof (piglit_name)); + obj =get_or_create_json_object (runtimes, piglit_name);add_runtime (obj, time); + +/* If no subtests, the test result node also gets the runtime */ +if (subtests->size ==0 ) { + obj =get_or_create_json_object (tests, piglit_name); +add_runtime (obj, time); + } }else if (read >=strlen (timeoutline) && !memcmp (line, timeoutline,strlen (timeoutline))) { has_timeout = true;
@@ -776,7 +790,7 @@ static void fill_from_journal(int fd,/* ... and also for the binary */ generate_piglit_name (entry->binary,NULL , piglit_name,sizeof (piglit_name)); - obj =get_or_create_json_object (tests, piglit_name); + obj =get_or_create_json_object (runtimes, piglit_name);add_runtime (obj, time); } }else {
@@ -900,8 +914,7 @@ static void add_result_to_totals(struct json_object *totals,static void add_to_totals (char *binary,struct subtests *subtests, -struct json_object *tests, -struct json_object *totals) +struct results *results) {struct json_object *test, *resultobj, *roottotal, *binarytotal;char piglit_name[256 ];
@@ -909,11 +922,11 @@ static void add_to_totals(char *binary,size_t i;generate_piglit_name (binary,NULL , piglit_name,sizeof (piglit_name)); - roottotal =get_totals_object (totals,"" ); - binarytotal =get_totals_object (totals, piglit_name); + roottotal =get_totals_object (results->totals,"" ); + binarytotal =get_totals_object (results->totals, piglit_name);if (subtests->size ==0 ) { - test =get_or_create_json_object (tests, piglit_name); + test =get_or_create_json_object (results->tests, piglit_name);if (!json_object_object_get_ex (test,"result" , &resultobj)) {fprintf (stderr,"Warning: No results set for %s\n" , piglit_name);return ;
@@ -926,7 +939,7 @@ static void add_to_totals(char *binary,for (i =0 ; i < subtests->size; i++) {generate_piglit_name (binary, subtests->names[i], piglit_name,sizeof (piglit_name)); - test =get_or_create_json_object (tests, piglit_name); + test =get_or_create_json_object (results->tests, piglit_name);if (!json_object_object_get_ex (test,"result" , &resultobj)) {fprintf (stderr,"Warning: No results set for %s\n" , piglit_name);return ;
@@ -939,8 +952,7 @@ static void add_to_totals(char *binary,static bool parse_test_directory (int dirfd,struct job_list_entry *entry, -struct json_object *tests, -struct json_object *totals) +struct results *results) {int fds[_F_LAST];struct subtests subtests = {};
@@ -954,28 +966,40 @@ static bool parse_test_directory(int dirfd,* fill_from_journal fills the subtests struct and adds * timeout results where applicable. */ -fill_from_journal (fds[_F_JOURNAL], entry, &subtests, tests); +fill_from_journal (fds[_F_JOURNAL], entry, &subtests, results); -if (!fill_from_output (fds[_F_OUT], entry->binary,"out" , &subtests, tests) || - !fill_from_output (fds[_F_ERR], entry->binary,"err" , &subtests, tests) || - !fill_from_dmesg (fds[_F_DMESG], entry->binary, &subtests, tests)) { +if (!fill_from_output (fds[_F_OUT], entry->binary,"out" , &subtests, results->tests) || + !fill_from_output (fds[_F_ERR], entry->binary,"err" , &subtests, results->tests) || + !fill_from_dmesg (fds[_F_DMESG], entry->binary, &subtests, results->tests)) {fprintf (stderr,"Error parsing output files\n" );return false; } -override_results (entry->binary, &subtests, tests); -add_to_totals (entry->binary, &subtests, tests, totals); +override_results (entry->binary, &subtests, results->tests); +add_to_totals (entry->binary, &subtests, results);close_outputs (fds);return true; } +static void create_result_root_nodes (struct json_object *root, +struct results *results) +{ + results->tests =json_object_new_object (); +json_object_object_add (root,"tests" , results->tests); + results->totals =json_object_new_object (); +json_object_object_add (root,"totals" , results->totals); + results->runtimes =json_object_new_object (); +json_object_object_add (root,"runtimes" , results->runtimes); +} +bool generate_results (int dirfd) {struct settings settings;struct job_list job_list; -struct json_object *obj, *tests, *totals; +struct json_object *obj; +struct results results;int resultsfd, testdirfd, unamefd;const char *json_string;size_t i;
@@ -1019,6 +1043,8 @@ bool generate_results(int dirfd)close (unamefd); } +create_result_root_nodes (obj, &results); +/* * Result fields that won't be added: *
@@ -1033,11 +1059,6 @@ bool generate_results(int dirfd)* - time_elapsed */ - tests =json_object_new_object (); -json_object_object_add (obj,"tests" , tests); - totals =json_object_new_object (); -json_object_object_add (obj,"totals" , totals); -for (i =0 ; i < job_list.size; i++) {char name[16 ];
@@ -1047,7 +1068,7 @@ bool generate_results(int dirfd)break ; } -if (!parse_test_directory (testdirfd, &job_list.entries[i], tests, totals)) { +if (!parse_test_directory (testdirfd, &job_list.entries[i], &results)) {close (resultsfd);return false; }
Signature · 6 lines
2.14.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 2/2 runner: Introduce --piglit-style-dmesg
With the flag, dmesg handling is done exactly as piglit does it: Level 5 (info) and higher dmesg lines, if they match a regexp, cause test result to change to dmesg-*.
The default is false (use new method).
--- runner/resultgen.c | 37 +++++++++++++++++++++++++++---------- runner/runner_tests.c | 21 +++++++++++++++++++++ runner/settings.c | 13 +++++++++++++ runner/settings.h | 1 + 4 files changed, 62 insertions(+), 10 deletions(-)
runner/resultgen.c +27 -10
@@ -525,15 +525,22 @@ static const char igt_dmesg_whitelist[] = ;#undef _ +static const char igt_piglit_style_dmesg_blacklist[] = +"(\\[drm:|drm_|intel_|i915_)" ; +static regex_t re; -static int init_regex_whitelist (void ) +static int init_regex_whitelist (struct settings *settings) {static int status =-1 ;if (status ==-1 ) { -if (regcomp (&re, igt_dmesg_whitelist,REG_EXTENDED |REG_NOSUB ) !=0 ) { -fprintf (stderr,"Cannot compile dmesg whitelist regexp\n" ); +const char *regex = settings->piglit_style_dmesg ? + igt_piglit_style_dmesg_blacklist : + igt_dmesg_whitelist; + +if (regcomp (&re, regex,REG_EXTENDED |REG_NOSUB ) !=0 ) { +fprintf (stderr,"Cannot compile dmesg regexp\n" ); status =1 ;return false; }
@@ -604,7 +611,9 @@ static void add_empty_dmesgs_where_missing(struct json_object *tests, } -static bool fill_from_dmesg (int fd,char *binary, +static bool fill_from_dmesg (int fd, +struct settings *settings, +char *binary,struct subtests *subtests,struct json_object *tests) {
@@ -620,7 +629,7 @@ static bool fill_from_dmesg(int fd, char *binary,return false; } -if (init_regex_whitelist ()) { +if (init_regex_whitelist (settings)) {fclose (f);return false; }
@@ -654,9 +663,16 @@ static bool fill_from_dmesg(int fd, char *binary, current_test =get_or_create_json_object (tests, piglit_name); } -if ((flags &0x07 ) <=4 && continuation !='c' && -regexec (&re, message, (size_t )0 ,NULL ,0 ) ==REG_NOMATCH ) { -append_line (&warnings, &warningslen, formatted); +if (settings->piglit_style_dmesg) { +if ((flags &0x07 ) <=5 && continuation !='c' && +regexec (&re, message, (size_t )0 ,NULL ,0 ) !=REG_NOMATCH ) { +append_line (&warnings, &warningslen, formatted); + } + }else { +if ((flags &0x07 ) <=4 && continuation !='c' && +regexec (&re, message, (size_t )0 ,NULL ,0 ) ==REG_NOMATCH ) { +append_line (&warnings, &warningslen, formatted); + } }append_line (&dmesg, &dmesglen, formatted);free (formatted);
@@ -952,6 +968,7 @@ static void add_to_totals(char *binary,static bool parse_test_directory (int dirfd,struct job_list_entry *entry, +struct settings *settings,struct results *results) {int fds[_F_LAST];
@@ -970,7 +987,7 @@ static bool parse_test_directory(int dirfd,if (!fill_from_output (fds[_F_OUT], entry->binary,"out" , &subtests, results->tests) || !fill_from_output (fds[_F_ERR], entry->binary,"err" , &subtests, results->tests) || - !fill_from_dmesg (fds[_F_DMESG], entry->binary, &subtests, results->tests)) { + !fill_from_dmesg (fds[_F_DMESG], settings, entry->binary, &subtests, results->tests)) {fprintf (stderr,"Error parsing output files\n" );return false; }
@@ -1068,7 +1085,7 @@ bool generate_results(int dirfd)break ; } -if (!parse_test_directory (testdirfd, &job_list.entries[i], &results)) { +if (!parse_test_directory (testdirfd, &job_list.entries[i], &settings, &results)) {close (resultsfd);return false; }
runner/runner_tests.c +21 -0
@@ -152,6 +152,7 @@ static void assert_settings_equal(struct settings *one, struct settings *two)igt_assert_eq (one->use_watchdog, two->use_watchdog);igt_assert_eqstr (one->test_root, two->test_root);igt_assert_eqstr (one->results_path, two->results_path); +igt_assert_eq (one->piglit_style_dmesg, two->piglit_style_dmesg); }static void assert_job_list_equal (struct job_list *one,struct job_list *two)
@@ -219,6 +220,7 @@ igt_mainigt_assert (!settings.use_watchdog);igt_assert (strstr (settings.test_root,"test-root-dir" ) !=NULL );igt_assert (strstr (settings.results_path,"path-to-results" ) !=NULL ); +igt_assert (!settings.piglit_style_dmesg); } igt_subtest_group {
@@ -332,6 +334,7 @@ igt_mainigt_assert (!settings.use_watchdog);igt_assert (strstr (settings.test_root, testdatadir) !=NULL );igt_assert (strstr (settings.results_path,"path-to-results" ) !=NULL ); +igt_assert (!settings.piglit_style_dmesg); } igt_fixture {
@@ -355,6 +358,7 @@ igt_main"--multiple-mode" ,"--inactivity-timeout" ,"27" ,"--use-watchdog" , +"--piglit-style-dmesg" ,"test-root-dir" , "path-to-results", };
@@ -379,6 +383,7 @@ igt_mainigt_assert (settings.use_watchdog);igt_assert (strstr (settings.test_root,"test-root-dir" ) !=NULL );igt_assert (strstr (settings.results_path,"path-to-results" ) !=NULL ); +igt_assert (settings.piglit_style_dmesg); } igt_subtest("invalid-option") {
@@ -578,6 +583,22 @@ igt_main igt_subtest("settings-serialize") {char *argv[] = {"runner" , +"-n" ,"foo" , +"--abort-on-monitored-error" , +"--test-list" ,"path-to-test-list" , +"--ignore-missing" , +"--dry-run" , +"-t" ,"pattern1" , +"-t" ,"pattern2" , +"-x" ,"xpattern1" , +"-x" ,"xpattern2" , +"-s" , +"-l" ,"verbose" , +"--overwrite" , +"--multiple-mode" , +"--inactivity-timeout" ,"27" , +"--use-watchdog" , +"--piglit-style-dmesg" , testdatadir, dirname, };
runner/settings.c +13 -0
@@ -16,6 +16,7 @@ enum {OPT_ABORT_ON_ERROR ,OPT_TEST_LIST ,OPT_IGNORE_MISSING , +OPT_PIGLIT_DMESG ,OPT_HELP ='h' ,OPT_NAME ='n' , OPT_DRY_RUN = 'd',
@@ -89,6 +90,12 @@ static const char *usage_str =" --use-watchdog Use hardware watchdog for lethal enforcement of the\n" " above timeout. Killing the test process is still\n" " attempted at timeout trigger.\n" +" --piglit-style-dmesg Filter dmesg like piglit does. Piglit considers matches\n" +" against a short filter list to mean the test result\n" +" should be changed to dmesg-warn/dmesg-fail. Without\n" +" this option everything except matches against a\n" +" (longer) filter list means the test result should\n" +" change.\n" " [test_root] Directory that contains the IGT tests. The environment\n" " variable IGT_TEST_ROOT will be used if set, overriding\n" " this option if given.\n"
@@ -192,6 +199,7 @@ bool parse_options(int argc, char **argv, {"multiple-mode", no_argument, NULL, OPT_MULTIPLE}, {"inactivity-timeout", required_argument, NULL, OPT_TIMEOUT}, {"use-watchdog", no_argument, NULL, OPT_WATCHDOG}, + {"piglit-style-dmesg", no_argument, NULL, OPT_PIGLIT_DMESG}, { 0, 0, 0, 0}, };
@@ -248,6 +256,9 @@ bool parse_options(int argc, char **argv,case OPT_WATCHDOG : settings->use_watchdog = true;break ; +case OPT_PIGLIT_DMESG : + settings->piglit_style_dmesg = true; +break ;case '?' :usage (NULL , stderr); goto error;
@@ -438,6 +449,7 @@ bool serialize_settings(struct settings *settings)SERIALIZE_LINE (f, settings, multiple_mode,"%d" );SERIALIZE_LINE (f, settings, inactivity_timeout,"%d" );SERIALIZE_LINE (f, settings, use_watchdog,"%d" ); +SERIALIZE_LINE (f, settings, piglit_style_dmesg,"%d" );SERIALIZE_LINE (f, settings, test_root,"%s" );SERIALIZE_LINE (f, settings, results_path,"%s" );
@@ -491,6 +503,7 @@ bool read_settings(struct settings *settings, int dirfd)PARSE_LINE (settings, name, val, multiple_mode, numval);PARSE_LINE (settings, name, val, inactivity_timeout, numval);PARSE_LINE (settings, name, val, use_watchdog, numval); +PARSE_LINE (settings, name, val, piglit_style_dmesg, numval);PARSE_LINE (settings, name, val, test_root, val ?strdup (val) :NULL );PARSE_LINE (settings, name, val, results_path, val ?strdup (val) :NULL );
runner/settings.h +1 -0
@@ -33,6 +33,7 @@ struct settings {bool use_watchdog;char *test_root;char *results_path; +bool piglit_style_dmesg; };/**
Signature · 6 lines
2.14.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 2/2] runner: Introduce --piglit-style-dmesg
Quoted 9 lines · Petri Latvala
With the flag, dmesg handling is done exactly as piglit does it: Level 5 (info) and higher dmesg lines, if they match a regexp, cause test result to change to dmesg-*.
The default is false (use new method).
Signed-off-by Petri Latvala <[email protected]>Cc Arkadiusz Hiler <[email protected]>Cc Martin Peres <[email protected]>
Both patches are:
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] runner/resultgen: Add a new field to carry overall runtimes
In reply to Petri Latvala== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,1/2] runner/resultgen: Add a new field to carry overall runtimes
URL : https://patchwork.freedesktop.org/series/48949/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4737 -> IGTPW_1760 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/48949/revisions/1/mbox/
== Known issues ==
Here are the changes found in IGTPW_1760 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
{fi-byt-clapper}: PASS -> FAIL (fdo#103191, fdo#107362)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-snb-2520m: PASS -> INCOMPLETE (fdo#103713)
fi-blb-e6850: PASS -> INCOMPLETE (fdo#107718)
==== Possible fixes ====
igt@kms_pipe_crc_basic@read-crc-pipe-a:
{fi-byt-clapper}: FAIL (fdo#107362) -> PASS {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
== Participating hosts (53 -> 49) ==
Missing (4): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan
== Build changes ==
* IGT: IGT_4611 -> IGTPW_1760
CI_DRM_4737: c8fe77635992b1f6b32102657faced7c9165c942 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1760: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1760/
IGT_4611: b966dd93a30f41581fe1dbf9bc1c4a29b552ca05 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1760/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] runner/resultgen: Add a new field to carry overall runtimes
In reply to Petri Latvala== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,1/2] runner/resultgen: Add a new field to carry overall runtimes
URL : https://patchwork.freedesktop.org/series/48949/
State : success
== Summary ==
= CI Bug Log - changes from IGT_4611_full -> IGTPW_1760_full =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/48949/revisions/1/mbox/
== Known issues ==
Here are the changes found in IGTPW_1760_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_hangman@error-state-capture-bsd2:
shard-snb: SKIP -> INCOMPLETE (fdo#105411)
igt@drv_suspend@shrink:
shard-apl: PASS -> INCOMPLETE (fdo#103927, fdo#106886)
igt@gem_exec_big:
shard-hsw: PASS -> INCOMPLETE (fdo#103540)
{igt@gem_render_copy@linear}:
shard-kbl: PASS -> INCOMPLETE (fdo#103665)
igt@kms_setmode@basic:
shard-apl: PASS -> FAIL (fdo#99912)
igt@perf@blocking:
shard-hsw: PASS -> FAIL (fdo#102252)
==== Possible fixes ====
igt@drv_selftest@live_hangcheck:
shard-kbl: DMESG-FAIL (fdo#106560, fdo#106947) -> PASS
igt@gem_render_copy_redux@normal:
shard-kbl: INCOMPLETE (fdo#106650, fdo#103665) -> PASS
igt@kms_cursor_crc@cursor-64x64-suspend:
shard-kbl: INCOMPLETE (fdo#107556, fdo#103665) -> PASS
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
shard-snb: INCOMPLETE (fdo#105411) -> PASS {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106650 https://bugs.freedesktop.org/show_bug.cgi?id=106650
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* IGT: IGT_4611 -> IGTPW_1760
* Linux: CI_DRM_4715 -> CI_DRM_4737
CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4737: c8fe77635992b1f6b32102657faced7c9165c942 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1760: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1760/
IGT_4611: b966dd93a30f41581fe1dbf9bc1c4a29b552ca05 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1760/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev