drm/i915: Print error state times relative to capture
Subsystems (2)
PATCH 1/1 drm/i915: Print error state times relative to capture
Using plain jiffies in error state output makes the output time differences relative to the current system time. This is wrong as it makes output time differences dependent of when the error state is printed rather than when it is captured.
Store capture jiffies into error state and use it when outputting the state to fix time differences output.
--- drivers/gpu/drm/i915/i915_gpu_error.c | 20 +++++++++++++------- drivers/gpu/drm/i915/i915_gpu_error.h | 1 + 2 files changed, 14 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_gpu_error.c +13 -7
@@ -404,7 +404,8 @@ static const char *bannable(const struct drm_i915_error_context *ctx)static void error_print_request (struct drm_i915_error_state_buf *m,const char *prefix, -const struct drm_i915_error_request *erq) +const struct drm_i915_error_request *erq, +const unsigned long timestamp) {if (!erq->seqno)return ;
@@ -412,7 +413,7 @@ static void error_print_request(struct drm_i915_error_state_buf *m,err_printf (m,"%s pid %d, ban score %d, seqno %8x:%08x, prio %d, emitted %dms ago, head %08x, tail %08x\n" , prefix, erq->pid, erq->ban_score, erq->context, erq->seqno, erq->priority, -jiffies_to_msecs (jiffies - erq->jiffies), +jiffies_to_msecs (timestamp - erq->jiffies), erq->head, erq->tail); }
@@ -427,7 +428,8 @@ static void error_print_context(struct drm_i915_error_state_buf *m, }static void error_print_engine (struct drm_i915_error_state_buf *m, -const struct drm_i915_error_engine *ee) +const struct drm_i915_error_engine *ee, +const unsigned long timestamp) {int n;
@@ -499,12 +501,12 @@ static void error_print_engine(struct drm_i915_error_state_buf *m, hangcheck_action_to_str(ee->hangcheck_action));err_printf (m," hangcheck action timestamp: %lu, %u ms ago\n" , ee->hangcheck_timestamp, -jiffies_to_msecs (jiffies - ee->hangcheck_timestamp)); +jiffies_to_msecs (timestamp - ee->hangcheck_timestamp));err_printf (m," engine reset count: %u\n" , ee->reset_count);for (n =0 ; n < ee->num_ports; n++) {err_printf (m," ELSP[%d]:" , n); -error_print_request (m," " , &ee->execlist[n]); +error_print_request (m," " , &ee->execlist[n], timestamp); }error_print_context (m," Active context: " , &ee->context);
@@ -650,6 +652,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, ts =ktime_to_timespec64 (error->uptime);err_printf (m,"Uptime: %lld s %ld us\n" , (s64 )ts.tv_sec, ts.tv_nsec /NSEC_PER_USEC ); +err_printf (m,"Jiffies: %lu (now %lu)\n" , error->timestamp, jiffies);for (i =0 ; i <ARRAY_SIZE (error->engine); i++) { if (error->engine[i].hangcheck_stalled &&
@@ -710,7 +713,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,for (i =0 ; i <ARRAY_SIZE (error->engine); i++) {if (error->engine[i].engine_id !=-1 ) -error_print_engine (m, &error->engine[i]); +error_print_engine (m, &error->engine[i], + error->timestamp); }for (i =0 ; i <ARRAY_SIZE (error->active_vm); i++) {
@@ -769,7 +773,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, dev_priv->engine[i]->name, ee->num_requests);for (j =0 ; j < ee->num_requests; j++) -error_print_request (m," " , &ee->requests[j]); +error_print_request (m," " , &ee->requests[j], + error->timestamp); }if (IS_ERR (ee->waiters)) {
@@ -1743,6 +1748,7 @@ static int capture(void *data) error->boottime =ktime_get_boottime (); error->uptime =ktime_sub (ktime_get (), error->i915->gt.last_init_time); + error->timestamp = jiffies;capture_params (error);capture_gen_state (error);
drivers/gpu/drm/i915/i915_gpu_error.h +1 -0
@@ -30,6 +30,7 @@ struct i915_gpu_state {ktime_t time;ktime_t boottime;ktime_t uptime; +unsigned long timestamp;/* jiffies */ struct drm_i915_private *i915;
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Mika Kuoppala (2018-04-16 14:40:52)
Quoted 8 lines
Using plain jiffies in error state output makes the output time differences relative to the current system time. This is wrong as it makes output time differences dependent of when the error state is printed rather than when it is captured.
Store capture jiffies into error state and use it when outputting the state to fix time differences output.
Good point. It was always confusing to see "several hours ago", when what we wanted to know was how long before the hanging request. Hmm, do we want to use that as our reference point rather than the capture timestamp? Do we even need to see the jiffies? (Yes, we probably do want the raw value to check, but I think it's secondary.)
Quoted 2 lines
Cc Chris Wilson <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>
Please do consider using the (earliest) guilty timestamp as time 0 and print before/after. If no guilty then use capture?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Print error state times relative to capture
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: drm/i915: Print error state times relative to capture
URL : https://patchwork.freedesktop.org/series/41749/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4054 -> Patchwork_8695 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/41749/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_8695 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_module_reload@basic-no-display:
fi-cnl-psr: NOTRUN -> DMESG-WARN (fdo#105395) +2
igt@kms_chamelium@dp-crc-fast:
fi-kbl-7500u: PASS -> DMESG-FAIL (fdo#103841)
==== Possible fixes ====
igt@prime_vgem@basic-fence-flip:
fi-ilk-650: FAIL (fdo#104008) -> PASS fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#105395 https://bugs.freedesktop.org/show_bug.cgi?id=105395
== Participating hosts (35 -> 21) ==
Additional (1): fi-cnl-psr
Missing (15): fi-ilk-m540 fi-bxt-dsi fi-skl-gvtdvm fi-bsw-n3050 fi-byt-j1900 fi-skl-6770hq fi-bdw-gvtdvm fi-skl-6260u fi-bwr-2160 fi-cfl-s3 fi-bxt-j4205 fi-gdg-551 fi-pnv-d510 fi-skl-6700hq fi-skl-6600u
== Build changes ==
* Linux: CI_DRM_4054 -> Patchwork_8695
CI_DRM_4054: a0e39233b88795009de32094efa8a2135f34338f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4430: 8b77704db49167f7ebfd1c470d9c129d3b862cb6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8695: 927090130dd55839f57c9b76a6dd87cf53e119c9 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4430: 93b35926a150e318439d2505901288594b3548f5 @ git://anongit.freedesktop.org/piglit
== Linux commits ==
927090130dd5 drm/i915: Print error state times relative to capture
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8695/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: Print error state times relative to capture
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: drm/i915: Print error state times relative to capture
URL : https://patchwork.freedesktop.org/series/41749/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4054_full -> Patchwork_8695_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8695_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8695_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/41749/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8695_full:
=== IGT changes ===
==== Warnings ====
igt@gem_mocs_settings@mocs-rc6-ctx-dirty-render:
shard-kbl: SKIP -> PASS +1
igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-untiled:
shard-snb: PASS -> SKIP== Known issues ==
Here are the changes found in Patchwork_8695_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_suspend@debugfs-reader:
shard-snb: PASS -> DMESG-WARN (fdo#102365)
igt@gem_render_copy_redux@normal:
shard-kbl: PASS -> INCOMPLETE (fdo#103665)
igt@kms_rotation_crc@sprite-rotation-180:
shard-snb: PASS -> FAIL (fdo#103925)
igt@kms_setmode@basic:
shard-apl: PASS -> FAIL (fdo#99912)
igt@kms_sysfs_edid_timing:
shard-apl: PASS -> WARN (fdo#100047)
==== Possible fixes ====
igt@kms_cursor_legacy@flip-vs-cursor-toggle:
shard-hsw: FAIL (fdo#102670) -> PASS
igt@kms_flip@2x-plain-flip-ts-check:
shard-hsw: FAIL (fdo#100368) -> PASS
igt@kms_flip@wf_vblank-ts-check:
shard-hsw: FAIL (fdo#103928) -> PASS fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (6 -> 4) ==
Missing (2): shard-glk shard-glkb
== Build changes ==
* Linux: CI_DRM_4054 -> Patchwork_8695
CI_DRM_4054: a0e39233b88795009de32094efa8a2135f34338f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4430: 8b77704db49167f7ebfd1c470d9c129d3b862cb6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8695: 927090130dd55839f57c9b76a6dd87cf53e119c9 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4430: 93b35926a150e318439d2505901288594b3548f5 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8695/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx