xen/gnttab: print log at level XENLOG_ERR before panic
PATCH 1/1 xen/gnttab: print log at level XENLOG_ERR before panic
Print log at level XENLOG_ERR (instead XENLOG_INFO) as domain_crash() indicates there is fatal error.
--- xen/common/grant_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/grant_table.c +1 -1
@@ -1282,7 +1282,7 @@ unmap_common(if (unlikely ((rd =rcu_lock_domain_by_id (dom)) ==NULL ) ) {/* This can happen when a grant is implicitly unmapped. */ -gdprintk (XENLOG_INFO ,"Could not find domain %d\n" , dom); +gdprintk (XENLOG_ERR ,"Could not find domain %d\n" , dom);domain_crash (ld);/* naughty... */ return ; }
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 13 lines · Dongli Zhang
Print log at level
XENLOG_ERR(insteadXENLOG_INFO) asdomain_crash()indicates there is fatal error.Signed-off-by Dongli Zhang <[email protected]>--- xen/common/grant_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/common/grant_table.c +0
-0
xen/common/grant_table.c unmap_common( · line 1285
Quoted 5 lines
xen/common/grant_table.c +1
-1@@ -1282,7 +1282,7 @@ unmap_common(if (unlikely ((rd =rcu_lock_domain_by_id (dom)) ==NULL ) ) {/* This can happen when a grant is implicitly unmapped. */ -gdprintk (XENLOG_INFO ,"Could not find domain %d\n" , dom); +gdprintk (XENLOG_ERR ,"Could not find domain %d\n" , dom);
While I agree with the change in principle, what does this actually do? The entire printk() is compiled out in release builds, and debug builds log all messages.
~Andrew
xen/common/grant_table.c unmap_common( · line 1288
Quoted 3 lines
xen/common/grant_table.c +0
-0domain_crash (ld);/* naughty... */ return ; }
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
George Dunlap
Acked-byQuoted 9 lines · Andrew Cooper
Quoted 8 lines · Dongli Zhang
Print log at level
XENLOG_ERR(insteadXENLOG_INFO) asdomain_crash()indicates there is fatal error.Signed-off-by Dongli Zhang <[email protected]>--- xen/common/grant_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
xen/common/grant_table.c unmap_common( · line 1285
Quoted 10 lines
xen/common/grant_table.c +1
-1@@ -1282,7 +1282,7 @@ unmap_common(if (unlikely ((rd =rcu_lock_domain_by_id (dom)) ==NULL ) ) {/* This can happen when a grant is implicitly unmapped. */ -gdprintk (XENLOG_INFO ,"Could not find domain %d\n" , dom); +gdprintk (XENLOG_ERR ,"Could not find domain %d\n" , dom);While I agree with the change in principle, what does this actually do? The entire
printk()is compiled out in release builds, and debug builds log all messages.
...by default; but presumably you can turn that down, right?
This also changes the prefix in the log output, right? That would make it easier to identify which message is important for undertanding why your domain just crashed.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 23 lines · George Dunlap
Quoted 9 lines · Andrew Cooper
Quoted 8 lines · Dongli Zhang
Print log at level
XENLOG_ERR(insteadXENLOG_INFO) asdomain_crash()indicates there is fatal error.Signed-off-by Dongli Zhang <[email protected]>--- xen/common/grant_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 13 lines
xen/common/grant_table.c unmap_common( · line 1285
Quoted 10 lines
xen/common/grant_table.c +1
-1@@ -1282,7 +1282,7 @@ unmap_common(if (unlikely ((rd =rcu_lock_domain_by_id (dom)) ==NULL ) ) {/* This can happen when a grant is implicitly unmapped. */ -gdprintk (XENLOG_INFO ,"Could not find domain %d\n" , dom); +gdprintk (XENLOG_ERR ,"Could not find domain %d\n" , dom);While I agree with the change in principle, what does this actually do? The entire
printk()is compiled out in release builds, and debug builds log all messages.
Quoted 1 line
...by default; but presumably you can turn that down, right?
Yes you can, but a) noone does, because these are debug builds and b) that isn't the point. If we care about this message being printed, it mustn’t be a gdprintk().
It either wants to turn into a gprintk() at XENLOG_INFO, or wants deleting entirely, but simply shuffling the exact level for a gdprintk() is tantamount to useless.
Quoted 4 lines
This also changes the prefix in the log output, right? That would make it easier to identify which message is important for undertanding why your domain just crashed.
The prefix is completely internal to Xen. By the time it ends up in the console ring, the data is lost.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 27 lines
Quoted 1 line
Quoted 1 line · On 23.04.19 at 18:00, <[email protected]> wrote:
Quoted 23 lines · George Dunlap
Quoted 9 lines · Andrew Cooper
Quoted 8 lines · Dongli Zhang
Print log at level
XENLOG_ERR(insteadXENLOG_INFO) asdomain_crash()indicates there is fatal error.Signed-off-by Dongli Zhang <[email protected]>--- xen/common/grant_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 13 lines
xen/common/grant_table.c unmap_common( · line 1285
Quoted 10 lines
xen/common/grant_table.c +1
-1@@ -1282,7 +1282,7 @@ unmap_common(if (unlikely ((rd =rcu_lock_domain_by_id (dom)) ==NULL ) ) {/* This can happen when a grant is implicitly unmapped. */ -gdprintk (XENLOG_INFO ,"Could not find domain %d\n" , dom); +gdprintk (XENLOG_ERR ,"Could not find domain %d\n" , dom);While I agree with the change in principle, what does this actually do? The entire
printk()is compiled out in release builds, and debug builds log all messages.Quoted 1 line
...by default; but presumably you can turn that down, right?
Quoted 7 lines
Yes you can, but a) noone does, because these are debug builds and b) that isn't the point. If we care about this message being printed, it mustn’t be a
gdprintk().It either wants to turn into a
gprintk()atXENLOG_INFO, or wants deleting entirely, but simply shuffling the exact level for agdprintk()is tantamount to useless.
FWIW I agree, and I think there are quite a few more candidates of debug messages that would better go away, and should probably have been stripped off before the original commit introducing them.
The one reason not to drop the message here, but to switch to gprintk(), is the adjacent domain_crash(). This, however, then is a reason to give it a log level above INFO.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 33 lines · Jan Beulich
Quoted 25 lines
Quoted 1 line
Quoted 1 line · On 23.04.19 at 18:00, <[email protected]> wrote:
Quoted 23 lines · George Dunlap
Quoted 22 lines · Andrew Cooper
Quoted 13 lines · Dongli Zhang
Print log at level
XENLOG_ERR(insteadXENLOG_INFO) asdomain_crash()indicates there is fatal error.Signed-off-by Dongli Zhang <[email protected]>--- xen/common/grant_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/common/grant_table.c +0
-0xen/common/grant_table.c unmap_common( · line 1285
Quoted 5 lines
xen/common/grant_table.c +1
-1@@ -1282,7 +1282,7 @@ unmap_common(if (unlikely ((rd =rcu_lock_domain_by_id (dom)) ==NULL ) ) {/* This can happen when a grant is implicitly unmapped. */ -gdprintk (XENLOG_INFO ,"Could not find domain %d\n" , dom); +gdprintk (XENLOG_ERR ,"Could not find domain %d\n" , dom);While I agree with the change in principle, what does this actually do? The entire
printk()is compiled out in release builds, and debug builds log all messages.Quoted 8 lines
Quoted 1 line
...by default; but presumably you can turn that down, right?
Yes you can, but a) noone does, because these are debug builds and b) that isn't the point. If we care about this message being printed, it mustn’t be a
gdprintk().It either wants to turn into a
gprintk()atXENLOG_INFO, or wants deleting entirely, but simply shuffling the exact level for agdprintk()is tantamount to useless.
Quoted 7 lines
FWIW I agree, and I think there are quite a few more candidates of debug messages that would better go away, and should probably have been stripped off before the original commit introducing them.
The one reason not to drop the message here, but to switch to
gprintk(), is the adjacentdomain_crash(). This, however, then is a reason to give it a log level above INFO.
I still have a series I need to refresh and repost which causes domain_crash() to take a XENLOG_G_ERR print message, specifically so it is not possible to ever get a domain_crash() without at least a hint of what went wrong.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi Andrew,
Quoted 9 lines · Andrew Cooper
Quoted 8 lines · Dongli Zhang
Print log at level
XENLOG_ERR(insteadXENLOG_INFO) asdomain_crash()indicates there is fatal error.Signed-off-by Dongli Zhang <[email protected]>--- xen/common/grant_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
xen/common/grant_table.c unmap_common( · line 1285
Quoted 10 lines
xen/common/grant_table.c +1
-1@@ -1282,7 +1282,7 @@ unmap_common(if (unlikely ((rd =rcu_lock_domain_by_id (dom)) ==NULL ) ) {/* This can happen when a grant is implicitly unmapped. */ -gdprintk (XENLOG_INFO ,"Could not find domain %d\n" , dom); +gdprintk (XENLOG_ERR ,"Could not find domain %d\n" , dom);While I agree with the change in principle, what does this actually do? The entire
printk()is compiled out in release builds, and debug builds log all messages.
The objective is for below case.
If user sets "guest_loglvl=err", this line would not be printed. Once xen panic by domain_crash, it would take effort to know the domid leading to the panic.
To verify if the vmcore analysis is correct, the user needs to set "guest_loglvl=all" and wait for another panic again.
I agree it would be better to turn it into something like gprintk. If xen always panic after a log, we should guarantee that the log is always printed to the console in order to help analyze the root cause.
Dongli Zhang
Quoted 8 lines
~Andrew
xen/common/grant_table.c unmap_common( · line 1288
Quoted 3 lines
xen/common/grant_table.c +0
-0domain_crash (ld);/* naughty... */ return ; }
Quoted 5 lines
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel