diff mbox

[igt,03/24] lib: Enable automatic ftrace dumping for suspend failures

Message ID 20170814201848.28216-3-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Aug. 14, 2017, 8:18 p.m. UTC
Supplement dmesg with the function call graph to try and help identify
why the suspend failed. On the other hand, it may be very noisy and
perturb the system due to its overhead...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_aux.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Chris Wilson Aug. 14, 2017, 9 p.m. UTC | #1
Quoting Chris Wilson (2017-08-14 21:18:27)
> Supplement dmesg with the function call graph to try and help identify
> why the suspend failed. On the other hand, it may be very noisy and
> perturb the system due to its overhead...

And it appears ftrace is not stable enough to use across CI.
Interesting.
-Chris
Daniel Vetter Aug. 15, 2017, 8:45 a.m. UTC | #2
On Mon, Aug 14, 2017 at 10:00:24PM +0100, Chris Wilson wrote:
> Quoting Chris Wilson (2017-08-14 21:18:27)
> > Supplement dmesg with the function call graph to try and help identify
> > why the suspend failed. On the other hand, it may be very noisy and
> > perturb the system due to its overhead...
> 
> And it appears ftrace is not stable enough to use across CI.
> Interesting.

Hm, should we instead have an --enable-ftrace flag for igt tests? Means we
need to do a manual run to capture the failures, but might be the better
balance ...
-Daniel
Chris Wilson Aug. 15, 2017, 9:17 a.m. UTC | #3
Quoting Daniel Vetter (2017-08-15 09:45:48)
> On Mon, Aug 14, 2017 at 10:00:24PM +0100, Chris Wilson wrote:
> > Quoting Chris Wilson (2017-08-14 21:18:27)
> > > Supplement dmesg with the function call graph to try and help identify
> > > why the suspend failed. On the other hand, it may be very noisy and
> > > perturb the system due to its overhead...
> > 
> > And it appears ftrace is not stable enough to use across CI.
> > Interesting.
> 
> Hm, should we instead have an --enable-ftrace flag for igt tests? Means we
> need to do a manual run to capture the failures, but might be the better
> balance ...

The infrastructure is fine by itself, so I was just considering sending
it to the farm as required. Improving ftrace would also be sensible, but
likely not an easy task.
-Chris
diff mbox

Patch

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index f428f159..8fa34411 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -56,6 +56,7 @@ 
 #include "intel_chipset.h"
 #include "igt_aux.h"
 #include "igt_debugfs.h"
+#include "igt_ftrace.h"
 #include "igt_gt.h"
 #include "igt_rand.h"
 #include "igt_sysfs.h"
@@ -762,13 +763,19 @@  static void suspend_via_rtcwake(enum igt_suspend_state state)
 		     "the rtcwake tool or how your distro is set up.\n",
 		      ret);
 
+	igt_ftrace_enable();
+
 	snprintf(cmd, sizeof(cmd), "rtcwake -s %d -m %s ",
 		 delay, suspend_state_name[state]);
 	ret = system(cmd);
-	igt_assert_f(ret == 0,
-		     "rtcwake failed with %i\n"
-		     "Check dmesg for further details.\n",
-		     ret);
+
+	igt_ftrace_disable();
+	if (ret) {
+		igt_warn("rtcwake failed with %i\n", ret);
+		igt_ftrace_dump(__func__);
+		igt_assert_f(ret == 0,
+			     "Check dmesg for further details.\n");
+	}
 }
 
 static void suspend_via_sysfs(int power_dir, enum igt_suspend_state state)