Re: [Intel-gfx] [PATCH igt] lib: Dump /sys/kernel/debug/suspend_stats after suspend failure
Quoting Arkadiusz Hiler (2017-11-16 14:31:03) > On Tue, Nov 14, 2017 at 01:19:01PM +, Chris Wilson wrote: > > I noticed that dpm was storing some information about which phase of > > suspend failed inside suspend_stats. That will be useful to help debug > > such failures, so automatically dump it after suspend fails. > > > > Signed-off-by: Chris Wilson > > --- > > lib/igt_aux.c | 22 ++ > > 1 file changed, 18 insertions(+), 4 deletions(-) > > > > diff --git a/lib/igt_aux.c b/lib/igt_aux.c > > index ee53559c..0bcf792c 100644 > > --- a/lib/igt_aux.c > > +++ b/lib/igt_aux.c > > @@ -803,10 +803,24 @@ static void suspend_via_rtcwake(enum > > igt_suspend_state state) > > snprintf(cmd, sizeof(cmd), "rtcwake -s %d -m %s ", > >delay, suspend_state_name[state]); > > ret = igt_system(cmd); > > - igt_assert_f(ret == 0, > > - "rtcwake failed with %i\n" > > - "Check dmesg for further details.\n", > > - ret); > > + if (ret) { > > + const char *path = "suspend_stats"; > > + char *info; > > + int dir; > > + > > + igt_warn("rtcwake failed with %i\n" > > + "Check dmesg for further details.\n", > > + ret); > > + > > + dir = open(igt_debugfs_mount(), O_RDONLY); > > + info = igt_sysfs_get(dir, path); > > + close(dir); > > + if (info) { > > + igt_debug("%s:\n%s\n", path, info); > > + free(info); > > + } > > + } > > + igt_assert_eq(ret, 0); > > } > > > > static void suspend_via_sysfs(int power_dir, enum igt_suspend_state state) > > We can see it in action here: > https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_496/shard-apl3/igt@gem_...@in-flight-suspend.html > > (gem_eio:7686) igt-aux-DEBUG: suspend_stats: > success: 10 > fail: 1 > failed_freeze: 0 > failed_prepare: 0 > failed_suspend: 1 > failed_suspend_late: 0 > failed_suspend_noirq: 0 > failed_resume: 0 > failed_resume_early: 0 > failed_resume_noirq: 0 > failures: > last_failed_dev: > > last_failed_errno:-16 > 0 > last_failed_step: suspend > > > Reviewed-by: Arkadiusz Hiler > and pushed Now we just need dpm to actually record the device. I about 95% certain we did not report -EBUSY; if i915_pm_suspend returns an error it gets printed. -Chris ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH igt] lib: Dump /sys/kernel/debug/suspend_stats after suspend failure
On Tue, Nov 14, 2017 at 01:19:01PM +, Chris Wilson wrote: > I noticed that dpm was storing some information about which phase of > suspend failed inside suspend_stats. That will be useful to help debug > such failures, so automatically dump it after suspend fails. > > Signed-off-by: Chris Wilson > --- > lib/igt_aux.c | 22 ++ > 1 file changed, 18 insertions(+), 4 deletions(-) > > diff --git a/lib/igt_aux.c b/lib/igt_aux.c > index ee53559c..0bcf792c 100644 > --- a/lib/igt_aux.c > +++ b/lib/igt_aux.c > @@ -803,10 +803,24 @@ static void suspend_via_rtcwake(enum igt_suspend_state > state) > snprintf(cmd, sizeof(cmd), "rtcwake -s %d -m %s ", >delay, suspend_state_name[state]); > ret = igt_system(cmd); > - igt_assert_f(ret == 0, > - "rtcwake failed with %i\n" > - "Check dmesg for further details.\n", > - ret); > + if (ret) { > + const char *path = "suspend_stats"; > + char *info; > + int dir; > + > + igt_warn("rtcwake failed with %i\n" > + "Check dmesg for further details.\n", > + ret); > + > + dir = open(igt_debugfs_mount(), O_RDONLY); > + info = igt_sysfs_get(dir, path); > + close(dir); > + if (info) { > + igt_debug("%s:\n%s\n", path, info); > + free(info); > + } > + } > + igt_assert_eq(ret, 0); > } > > static void suspend_via_sysfs(int power_dir, enum igt_suspend_state state) We can see it in action here: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_496/shard-apl3/igt@gem_...@in-flight-suspend.html (gem_eio:7686) igt-aux-DEBUG: suspend_stats: success: 10 fail: 1 failed_freeze: 0 failed_prepare: 0 failed_suspend: 1 failed_suspend_late: 0 failed_suspend_noirq: 0 failed_resume: 0 failed_resume_early: 0 failed_resume_noirq: 0 failures: last_failed_dev: last_failed_errno:-16 0 last_failed_step: suspend Reviewed-by: Arkadiusz Hiler and pushed -- Cheers, Arek ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH igt] lib: Dump /sys/kernel/debug/suspend_stats after suspend failure
I noticed that dpm was storing some information about which phase of suspend failed inside suspend_stats. That will be useful to help debug such failures, so automatically dump it after suspend fails. Signed-off-by: Chris Wilson --- lib/igt_aux.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/igt_aux.c b/lib/igt_aux.c index ee53559c..0bcf792c 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -803,10 +803,24 @@ static void suspend_via_rtcwake(enum igt_suspend_state state) snprintf(cmd, sizeof(cmd), "rtcwake -s %d -m %s ", delay, suspend_state_name[state]); ret = igt_system(cmd); - igt_assert_f(ret == 0, -"rtcwake failed with %i\n" -"Check dmesg for further details.\n", -ret); + if (ret) { + const char *path = "suspend_stats"; + char *info; + int dir; + + igt_warn("rtcwake failed with %i\n" +"Check dmesg for further details.\n", +ret); + + dir = open(igt_debugfs_mount(), O_RDONLY); + info = igt_sysfs_get(dir, path); + close(dir); + if (info) { + igt_debug("%s:\n%s\n", path, info); + free(info); + } + } + igt_assert_eq(ret, 0); } static void suspend_via_sysfs(int power_dir, enum igt_suspend_state state) -- 2.15.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH igt] lib: Dump /sys/kernel/debug/suspend_stats after suspend failure
I noticed that dpm was storing some information about which phase of suspend failed inside suspend_stats. That will be useful to help debug such failures, so automatically dump it after suspend fails. Signed-off-by: Chris Wilson --- lib/igt_aux.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/igt_aux.c b/lib/igt_aux.c index ee53559c..0bcf792c 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -803,10 +803,24 @@ static void suspend_via_rtcwake(enum igt_suspend_state state) snprintf(cmd, sizeof(cmd), "rtcwake -s %d -m %s ", delay, suspend_state_name[state]); ret = igt_system(cmd); - igt_assert_f(ret == 0, -"rtcwake failed with %i\n" -"Check dmesg for further details.\n", -ret); + if (ret) { + const char *path = "suspend_stats"; + char *info; + int dir; + + igt_warn("rtcwake failed with %i\n" +"Check dmesg for further details.\n", +ret); + + dir = open(igt_debugfs_mount(), O_RDONLY); + info = igt_sysfs_get(dir, path); + close(dir); + if (info) { + igt_debug("%s:\n%s\n", path, info); + free(info); + } + } + igt_assert_eq(ret, 0); } static void suspend_via_sysfs(int power_dir, enum igt_suspend_state state) -- 2.15.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx