diff mbox

[ovs-dev,2/2] ovs-bugtool: Run the 'dmesg' command without condition.

Message ID 1500967431-23967-2-git-send-email-guru@ovn.org
State Accepted
Headers show

Commit Message

Gurucharan Shetty July 25, 2017, 7:23 a.m. UTC
Currently we look for files with the name of "dmesg"
in "/var/log". If it exists, we don't run the command
"dmesg". This is unreliable as the file does not always
contain the latest dmesg information.

Since OVS kernel module emits information to dmesg,
we need this information to debug bugs. So always
run the "dmesg" command and collect its output.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
---
 utilities/bugtool/ovs-bugtool.in | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Gregory Rose July 26, 2017, 10:26 p.m. UTC | #1
On 07/25/2017 12:23 AM, Gurucharan Shetty wrote:
> Currently we look for files with the name of "dmesg"
> in "/var/log". If it exists, we don't run the command
> "dmesg". This is unreliable as the file does not always
> contain the latest dmesg information.
>
> Since OVS kernel module emits information to dmesg,
> we need this information to debug bugs. So always
> run the "dmesg" command and collect its output.
>
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
> ---
>   utilities/bugtool/ovs-bugtool.in | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
> index b47d9a4..e886844 100755
> --- a/utilities/bugtool/ovs-bugtool.in
> +++ b/utilities/bugtool/ovs-bugtool.in
> @@ -637,9 +637,7 @@ exclude those logs from the archive.
>           prefix_output(CAP_OPENVSWITCH_LOGS, log,
>                         last_mod_time=log_last_mod_time)
>
> -    if not os.path.exists('/var/log/dmesg') and \
> -       not os.path.exists('/var/log/boot'):
> -        cmd_output(CAP_SYSTEM_LOGS, [DMESG])
> +    cmd_output(CAP_SYSTEM_LOGS, [DMESG])
>
>       cmd_output(CAP_SYSTEM_SERVICES, [CHKCONFIG, '--list'])
>
>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Ben Pfaff Aug. 3, 2017, 7:27 p.m. UTC | #2
On Tue, Jul 25, 2017 at 12:23:51AM -0700, Gurucharan Shetty wrote:
> Currently we look for files with the name of "dmesg"
> in "/var/log". If it exists, we don't run the command
> "dmesg". This is unreliable as the file does not always
> contain the latest dmesg information.
> 
> Since OVS kernel module emits information to dmesg,
> we need this information to debug bugs. So always
> run the "dmesg" command and collect its output.
> 
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>

Good catch.

Acked-by: Ben Pfaff <blp@ovn.org>
diff mbox

Patch

diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
index b47d9a4..e886844 100755
--- a/utilities/bugtool/ovs-bugtool.in
+++ b/utilities/bugtool/ovs-bugtool.in
@@ -637,9 +637,7 @@  exclude those logs from the archive.
         prefix_output(CAP_OPENVSWITCH_LOGS, log,
                       last_mod_time=log_last_mod_time)
 
-    if not os.path.exists('/var/log/dmesg') and \
-       not os.path.exists('/var/log/boot'):
-        cmd_output(CAP_SYSTEM_LOGS, [DMESG])
+    cmd_output(CAP_SYSTEM_LOGS, [DMESG])
 
     cmd_output(CAP_SYSTEM_SERVICES, [CHKCONFIG, '--list'])