i915/gem_flink_race.c: Use statistics over list of numbers
PATCH 1/1 i915/gem_flink_race.c: Use statistics over list of numbers
Print median and range instead of a list of numbers in function test_flink_name.
--- tests/i915/gem_flink_race.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-)
tests/i915/gem_flink_race.c +7 -11
@@ -83,14 +83,14 @@ static void test_flink_name(int timeout)struct flink_name *threads;int r, i, num_threads;unsigned long count; -char buf[512 ];void *status; -int len; +igt_stats_t s; num_threads =sysconf (_SC_NPROCESSORS_ONLN) -1 ;if (!num_threads) num_threads =1 ; +igt_stats_init_with_size (&s, num_threads); threads =calloc (num_threads,sizeof (*threads)); fd =drm_open_driver (DRIVER_INTEL );
@@ -114,19 +114,15 @@ static void test_flink_name(int timeout) pls_die =1 ; - len =snprintf (buf,sizeof (buf),"Completed %lu cycles with [" , count); +igt_info ("Completed %lu cycles\n" , count);for (i =0 ; i < num_threads; i++) {pthread_join (threads[i].thread, &status);igt_assert (status ==0 ); -/* Below, constant 11 is 8 digit number, comma, space and null byte */ -if ((len +11 +1 ) <sizeof (buf)) - len +=snprintf (buf + len,sizeof (buf) - len,"%8lu, " , threads[i].count); +igt_stats_push (&s, threads[i].count); } -/* Below, constant 9 is 7 bytes for terminating string plus \n and null byte */ -if (len +9 <sizeof (buf)) -snprintf (buf + len -2 ,sizeof (buf) - len +2 ,"] races" ); -igt_info ("%s\n" , buf); - +igt_info ("Threads %d\n" , num_threads); +igt_info ("Range %ld\n" ,igt_stats_get_range (&s)); +igt_info ("Median %g\n" ,igt_stats_get_median (&s));close (fd); }
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for i915/gem_flink_race.c: Use statistics over list of numbers
== Series Details ==
== Series Details ==
Series: i915/gem_flink_race.c: Use statistics over list of numbers
URL : https://patchwork.freedesktop.org/series/84084/
State : failure
== Summary ==
Applying: i915/gem_flink_race.c: Use statistics over list of numbers
error: sha1 information is lacking or useless (tests/i915/gem_flink_race.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 i915/gem_flink_race.c: Use statistics over list of numbers When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx