public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 02/12] include/tst_safe_clocks.h: Make use of tst_clock_name()
Date: Wed,  4 Mar 2020 16:24:01 +0100	[thread overview]
Message-ID: <20200304152401.7432-2-chrubis@suse.cz> (raw)
In-Reply-To: <20200304152401.7432-1-chrubis@suse.cz>

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 include/tst_safe_clocks.h | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/include/tst_safe_clocks.h b/include/tst_safe_clocks.h
index 34ed953b4..27e8bda45 100644
--- a/include/tst_safe_clocks.h
+++ b/include/tst_safe_clocks.h
@@ -11,6 +11,7 @@
 #include <time.h>
 #include <sys/timex.h>
 #include "tst_test.h"
+#include "tst_clocks.h"
 #include "lapi/syscalls.h"
 #include "lapi/posix_clocks.h"
 
@@ -20,10 +21,11 @@ static inline void safe_clock_getres(const char *file, const int lineno,
 	int rval;
 
 	rval = clock_getres(clk_id, res);
-	if (rval != 0)
+	if (rval != 0) {
 		tst_brk(TBROK | TERRNO,
-			"%s:%d clock_getres() failed", file, lineno);
-
+			"%s:%d clock_getres(%s) failed",
+			file, lineno, tst_clock_name(clk_id));
+	}
 }
 
 static inline void safe_clock_gettime(const char *file, const int lineno,
@@ -32,9 +34,11 @@ static inline void safe_clock_gettime(const char *file, const int lineno,
 	int rval;
 
 	rval = clock_gettime(clk_id, tp);
-	if (rval != 0)
+	if (rval != 0) {
 		tst_brk(TBROK | TERRNO,
-			"%s:%d clock_gettime() failed", file, lineno);
+			"%s:%d clock_gettime(%s) failed",
+			file, lineno, tst_clock_name(clk_id));
+	}
 }
 
 
@@ -44,9 +48,11 @@ static inline void safe_clock_settime(const char *file, const int lineno,
 	int rval;
 
 	rval = clock_settime(clk_id, tp);
-	if (rval != 0)
+	if (rval != 0) {
 		tst_brk(TBROK | TERRNO,
-			"%s:%d clock_gettime() failed", file, lineno);
+			"%s:%d clock_gettime(%s) failed",
+			file, lineno, tst_clock_name(clk_id));
+	}
 }
 
 static inline int safe_clock_adjtime(const char *file, const int lineno,
@@ -55,9 +61,11 @@ static inline int safe_clock_adjtime(const char *file, const int lineno,
 	int rval;
 
 	rval = tst_syscall(__NR_clock_adjtime, clk_id, txc);
-	if (rval < 0)
+	if (rval < 0) {
 		tst_brk(TBROK | TERRNO,
-			"%s:%d clock_adjtime() failed %i", file, lineno, rval);
+			"%s:%d clock_adjtime(%s) failed %i",
+			file, lineno, tst_clock_name(clk_id), rval);
+	}
 
 	return rval;
 }
-- 
2.24.1


  reply	other threads:[~2020-03-04 15:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04 15:24 [LTP] [PATCH 01/12] lib: Move tst_clock_name() to tst_clock.c Cyril Hrubis
2020-03-04 15:24 ` Cyril Hrubis [this message]
2020-03-04 18:47   ` [LTP] [PATCH 02/12] include/tst_safe_clocks.h: Make use of tst_clock_name() Petr Vorel
2020-03-05 10:23     ` Cyril Hrubis
2020-03-04 18:46 ` [LTP] [PATCH 01/12] lib: Move tst_clock_name() to tst_clock.c Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200304152401.7432-2-chrubis@suse.cz \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox