-
Notifications
You must be signed in to change notification settings - Fork 44
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
lib.sh: disable logging with SOF_LOGGING=none env or missing .ldc #813
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ fake_kern_error() | |
|
||
} | ||
|
||
# Prints the .ldc file found on stdout, errors on stderr. | ||
find_ldc_file() | ||
{ | ||
local ldcFile | ||
|
@@ -87,6 +88,7 @@ find_ldc_file() | |
# and then on the standard location. | ||
if [ -n "$SOFLDC" ]; then | ||
ldcFile="$SOFLDC" | ||
>&2 dlogi "SOFLDC=${SOFLDC} overriding default locations" | ||
else | ||
local platf; platf=$(sof-dump-status.py -p) || { | ||
>&2 dloge "Failed to query platform with sof-dump-status.py" | ||
|
@@ -98,7 +100,7 @@ find_ldc_file() | |
fi | ||
|
||
[[ -e "$ldcFile" ]] || { | ||
>&2 dloge "LDC file $ldcFile not found, check the SOFLDC environment variable or copy your sof-*.ldc to /etc/sof" | ||
>&2 dlogi "LDC file $ldcFile not found" | ||
return 1 | ||
} | ||
printf '%s' "$ldcFile" | ||
|
@@ -397,7 +399,27 @@ is_zephyr() | |
|
||
logger_disabled() | ||
{ | ||
[[ ${OPT_VAL['s']} -eq 0 ]] | ||
local ldcFile | ||
# Some firmware/OS configurations do not support logging. | ||
ldcFile=$(find_ldc_file) || { | ||
dlogi '.ldc dictionary file not found, SOF logs collection disabled' | ||
return 0 # 0 is 'true' | ||
} | ||
|
||
# Disable logging when available... | ||
if [ ${OPT_VAL['s']} -eq 0 ]; then | ||
return 0 | ||
fi | ||
|
||
# ... across all tests at once. | ||
# In the future we should support SOF_LOGGING=etrace (only), see | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need more clarification. In future we will support only etrace? why? slogger seems useful to me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #726 referenced on the next line. |
||
# sof-test#726 | ||
if [ "x$SOF_LOGGING" == 'xnone' ]; then | ||
dlogi 'SOF logs collection globally disabled by SOF_LOGGING=none' | ||
return 0 | ||
fi | ||
|
||
return 1 | ||
} | ||
|
||
print_module_params() | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this comment is needed, as the script self documents on the line before. Or the comment can be on the line before the function definition, to clarify the outputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's overkill. I will remove but only if someone requests some other changes because it does do not much harm either and uses very little real estate.