* [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log
@ 2017-08-21 9:06 Petr Vorel
2017-08-21 12:12 ` Jan Stancek
0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2017-08-21 9:06 UTC (permalink / raw)
To: ltp
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
I know ltp-pan is deprecated, but add kernel stamping can be useful for debugging.
---
pan/ltp-pan.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c
index 1614c70ff..fc058d1fb 100644
--- a/pan/ltp-pan.c
+++ b/pan/ltp-pan.c
@@ -53,6 +53,7 @@
#include <sys/param.h>
#include <sys/stat.h>
+#include <stdarg.h>
#include <sys/times.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -1352,6 +1353,23 @@ static void copy_buffered_output(struct tag_pgrp *running)
}
}
+static void write_kmsg(const char *fmt, ...)
+{
+ FILE *kmsg;
+ va_list ap;
+
+ if ((kmsg = fopen("/dev/kmsg", "r+")) == NULL) {
+ fprintf(stderr, "Error %s: (%d) opening /dev/kmsg\n",
+ strerror(errno), errno);
+ exit(1);
+ }
+
+ va_start(ap, fmt);
+ vfprintf(kmsg, fmt, ap);
+ va_end(ap);
+ fclose(kmsg);
+}
+
static void write_test_start(struct tag_pgrp *running)
{
if (!strcmp(reporttype, "rts")) {
@@ -1362,6 +1380,12 @@ static void write_test_start(struct tag_pgrp *running)
running->cmd->cmdline, "", "exit", "<<<test_output>>>");
}
fflush(stdout);
+
+ if (strcmp(running->cmd->name, running->cmd->cmdline))
+ write_kmsg("LTP: starting %s (%s)\n", running->cmd->name,
+ running->cmd->cmdline);
+ else
+ write_kmsg("LTP: starting %s\n", running->cmd->name);
}
static void
--
2.14.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log
2017-08-21 9:06 [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log Petr Vorel
@ 2017-08-21 12:12 ` Jan Stancek
2017-08-21 12:17 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Jan Stancek @ 2017-08-21 12:12 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: "Petr Vorel" <pvorel@suse.cz>
> To: ltp@lists.linux.it
> Sent: Monday, 21 August, 2017 11:06:52 AM
> Subject: [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> I know ltp-pan is deprecated, but add kernel stamping can be useful for
> debugging.
+1, it proved to be useful. It has also been mentioned couple weeks ago here:
https://lists.linux.it/pipermail/ltp/2017-June/004893.html
As I recall Cyril suggested an option to enable/disable this output,
but I wouldn't mind if it was always-on.
Regards,
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log
2017-08-21 12:12 ` Jan Stancek
@ 2017-08-21 12:17 ` Cyril Hrubis
2017-08-21 12:30 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2017-08-21 12:17 UTC (permalink / raw)
To: ltp
Hi!
> > I know ltp-pan is deprecated, but add kernel stamping can be useful for
> > debugging.
>
> +1, it proved to be useful. It has also been mentioned couple weeks ago here:
> https://lists.linux.it/pipermail/ltp/2017-June/004893.html
>
> As I recall Cyril suggested an option to enable/disable this output,
> but I wouldn't mind if it was always-on.
Maybe we should add an option to turn it off then, but apart from that
I'm for making this change.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log
2017-08-21 12:17 ` Cyril Hrubis
@ 2017-08-21 12:30 ` Petr Vorel
2017-08-21 12:49 ` Jan Stancek
0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2017-08-21 12:30 UTC (permalink / raw)
To: ltp
Hi Jan, Cyril,
thanks for your comments.
> > > I know ltp-pan is deprecated, but add kernel stamping can be useful for
> > > debugging.
> > +1, it proved to be useful. It has also been mentioned couple weeks ago here:
> > https://lists.linux.it/pipermail/ltp/2017-June/004893.html
> > As I recall Cyril suggested an option to enable/disable this output,
> > but I wouldn't mind if it was always-on.
> Maybe we should add an option to turn it off then, but apart from that
> I'm for making this change.
Jan, would you like to push your change?
If not, I'll add version with option to turn it off (default turn on).
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log
2017-08-21 12:30 ` Petr Vorel
@ 2017-08-21 12:49 ` Jan Stancek
0 siblings, 0 replies; 5+ messages in thread
From: Jan Stancek @ 2017-08-21 12:49 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: "Petr Vorel" <pvorel@suse.cz>
> To: "Cyril Hrubis" <chrubis@suse.cz>, jstancek@redhat.com
> Cc: ltp@lists.linux.it, "Li Wang" <liwang@redhat.com>
> Sent: Monday, 21 August, 2017 2:30:25 PM
> Subject: Re: [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log
>
> Hi Jan, Cyril,
>
> thanks for your comments.
>
> > > > I know ltp-pan is deprecated, but add kernel stamping can be useful for
> > > > debugging.
>
> > > +1, it proved to be useful. It has also been mentioned couple weeks ago
> > > here:
> > > https://lists.linux.it/pipermail/ltp/2017-June/004893.html
>
> > > As I recall Cyril suggested an option to enable/disable this output,
> > > but I wouldn't mind if it was always-on.
>
> > Maybe we should add an option to turn it off then, but apart from that
> > I'm for making this change.
>
> Jan, would you like to push your change?
> If not, I'll add version with option to turn it off (default turn on).
I prefer you add the option to this patch, as it looks better.
Regards,
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-21 12:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21 9:06 [LTP] [PATCH 1/1] ltp-pan: Log start of test in kernel log Petr Vorel
2017-08-21 12:12 ` Jan Stancek
2017-08-21 12:17 ` Cyril Hrubis
2017-08-21 12:30 ` Petr Vorel
2017-08-21 12:49 ` Jan Stancek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.