Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Add shim to data collection script #680

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 37 additions & 16 deletions data/cc-collect-data.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ script_version="@VERSION@ (commit @COMMIT@)"
PROBLEM_LIMIT=${PROBLEM_LIMIT:-50}

problem_pattern="("
problem_pattern+="\<warn\>"
problem_pattern+="\<abort\>|"
problem_pattern+="\<cannot\>|"
problem_pattern+="\<critical\>|"
problem_pattern+="\<does.*not.*exist\>|"
problem_pattern+="\<error\>|"
problem_pattern+="\<fail\>|"
problem_pattern+="\<failure\>|"
problem_pattern+="\<failed\>|"
problem_pattern+="\<fatal\>|"
problem_pattern+="\<impossible\>|"
problem_pattern+="\<missing\>|"
problem_pattern+="\<no.*such.*file\>|"
problem_pattern+="\<not.*found\>|"
problem_pattern+="\<warn\>|"
problem_pattern+="\<warning\>"
problem_pattern+="|\<error\>"
problem_pattern+="|\<fail\>"
problem_pattern+="|\<failed\>"
problem_pattern+="|\<fatal\>"
problem_pattern+="|\<impossible\>"
problem_pattern+="|\<missing\>"
problem_pattern+="|\<does.*not.*exist\>"
problem_pattern+="|\<not.*found\>"
problem_pattern+="|\<no.*such.*file\>"
problem_pattern+="|\<cannot\>"
problem_pattern+=")"

usage()
Expand Down Expand Up @@ -161,6 +164,7 @@ show_log_details()

show_runtime_log_details
show_proxy_log_details
show_shim_log_details
Copy link
Contributor

Choose a reason for hiding this comment

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

A query - did you manage to get shim debug/details into the logs? I recently saw we have a debug ability in the shim:
https://github.com/clearcontainers/shim/blob/5da156955ebb4c001b5f89f1de11db3ca916228e/src/shim.c#L992
but could find no way for us to invoke that through the runtime/proxy code. If there is a way, we should add it to the debugging docs that we are building.
/cc @amshinde

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh - I've just realised the code here is wrong for the shim. I'll raise a follow-up to resolve that.

Regarding enabling debug for cc-shim, I've just raised containers/virtcontainers#402. Once that lands we can re-vendor the runtime and add a new option in the config file for shim debug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed on #682.


separator
}
Expand Down Expand Up @@ -194,23 +198,40 @@ show_runtime_log_details()
fi
}

show_proxy_log_details()
find_system_journal_problems()
{
subheading "Proxy logs"
name="$1"
program="$2"

local problems=$(journalctl -q -o cat -lau "cc-proxy" |\
data_source="system journal"

local problems=$(journalctl -q -o cat -au "$program" |\
grep "time=" |\
egrep -i "$problem_pattern" |\
tail -n ${PROBLEM_LIMIT})

if [ -n "$problems" ]; then
msg "Recent proxy problems found in system journal:"
msg "Recent $name problems found in $data_source:"
show_quoted_text "$problems"
else
msg "No recent proxy problems found in system journal."
msg "No recent $name problems found in $data_source."
fi
}

show_proxy_log_details()
{
subheading "Proxy logs"

find_system_journal_problems "proxy" "cc-proxy"
}

show_shim_log_details()
{
subheading "Shim logs"

find_system_journal_problems "shim" "cc-shim"
}

show_package_versions()
{
heading "Packages"
Expand Down