Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hijack.sh: don't start a second logger in the exit handler #386

Closed
wants to merge 1 commit into from

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Sep 19, 2020

... because it makes no sense.

When a test using the logger fails it produces a confusing error
message like this:

2020-09-18 10:17:25 UTC [REMOTE_INFO] Starting /usr/bin/sof-logger
   -l /etc/sof/sof-byt.ldc -o
    /home/ubuntu/sof-test/logs/check-alsabat/<date>/etrace.txt
error: in logger_read(), fread(..., /sys/kernel/debug/sof/etrace)
    failed:  Inappropriate ioctl for device(25)

Reported by Pierre in #384

This mistake seems to have been there since the dawn of time however no
one noticed because most things logger-related (and others) have been
silenced so far - which is changing now with #297.

The problem this fixes can be reproduced trivially with this one-line
patch:

--- a/case-lib/lib.sh
+++ b/case-lib/lib.sh
@@ -125,6 +125,7 @@ func_lib_start_log_collect()
     dlogi "Starting $loggerCmd"
     # Cleaned up by func_exit_handler() in hijack.sh
     sudo "$loggerCmd" &
+    exit 1
 }

Signed-off-by: Marc Herbert [email protected]

... because it makes no sense.

When a test using the logger fails it produces a confusing error
message like this:

2020-09-18 10:17:25 UTC [REMOTE_INFO] Starting /usr/bin/sof-logger
   -l /etc/sof/sof-byt.ldc -o
    /home/ubuntu/sof-test/logs/check-alsabat/<date>/etrace.txt
error: in logger_read(), fread(..., /sys/kernel/debug/sof/etrace)
    failed:  Inappropriate ioctl for device(25)

Reported by Pierre in #384

This mistake seems to have been there since the dawn of time however no
one noticed because most things logger-related (and others) have been
silenced so far - which is changing now with thesofproject#297.

The problem this fixes can be reproduced trivially with this one-line
patch:

--- a/case-lib/lib.sh
+++ b/case-lib/lib.sh
@@ -125,6 +125,7 @@ func_lib_start_log_collect()
     dlogi "Starting $loggerCmd"
     # Cleaned up by func_exit_handler() in hijack.sh
     sudo "$loggerCmd" &
+    exit 1
 }

Signed-off-by: Marc Herbert <[email protected]>
[[ $exit_status -eq 1 ]] && {
func_lib_start_log_collect 1
sleep 1s
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb Not sure about this. This is not the normal logger run, but capture the separate etrace log in case of output (etrace.txt). Is this already covered somewhere else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kv2019i for the catch, really appreciated. I've been looking for information about the difference between debug/trace and debug/etrace but didn't find much, any good reference? @ktrzcinx ? I didn't expect both could be used simultaneously, in fact I now realize this PR is (was) an attempt to avoid a failure to use both simultaneously.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found something here: thesofproject/sof#3265 (comment)

thanks a lot for your information about traces. This is the kind of information we need to write it in sof-docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:logs Log and results collection, storage, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants