mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 21:46:58 +02:00
Set a sane signal/noise ratio for cros_generate_breakpad_symbols.
Of the 11713 lines output via this for a mario build, 96% of it is stating "Using dump_syms.32 for 32-bit file <the-path>". At one point that may have been useful; now it just obscures errors, thus only output that info when verbose is turned on. BUG=None TEST=./cros_generate_breakpad_symbols; # enjoy the 438 lines of # output rather than the 11,700 lines of output. Change-Id: Iba9d1af3421c6b377af8388446521d106399ce25 Reviewed-on: https://gerrit.chromium.org/gerrit/21925 Tested-by: Brian Harring <ferringb@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Brian Harring <ferringb@chromium.org>
This commit is contained in:
parent
09c05ecd19
commit
5edf8bb308
@ -36,6 +36,12 @@ function cleanup() {
|
|||||||
rm -f "${SYM_FILE}" "${ERR_FILE}"
|
rm -f "${SYM_FILE}" "${ERR_FILE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function debug() {
|
||||||
|
if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then
|
||||||
|
info "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Given path to a debug file, return its text file
|
# Given path to a debug file, return its text file
|
||||||
function get_text_for_debug() {
|
function get_text_for_debug() {
|
||||||
local debug_file=$1
|
local debug_file=$1
|
||||||
@ -69,7 +75,7 @@ function dump_file() {
|
|||||||
# 32-bit dump_syms must be used to dump a 32-bit ELF file
|
# 32-bit dump_syms must be used to dump a 32-bit ELF file
|
||||||
if is_32b_elf "${text_file}"; then
|
if is_32b_elf "${text_file}"; then
|
||||||
dump_syms_prog="${DUMP_SYMS32}"
|
dump_syms_prog="${DUMP_SYMS32}"
|
||||||
info "Using ${dump_syms_prog} for 32-bit file ${text_file}"
|
debug "Using ${dump_syms_prog} for 32-bit file ${text_file}"
|
||||||
fi
|
fi
|
||||||
# Dump symbols as root in order to read all files.
|
# Dump symbols as root in order to read all files.
|
||||||
if ! sudo "${dump_syms_prog}" "${text_file}" "${debug_directory}" \
|
if ! sudo "${dump_syms_prog}" "${text_file}" "${debug_directory}" \
|
||||||
@ -93,10 +99,8 @@ function dump_file() {
|
|||||||
fi
|
fi
|
||||||
local file_id=$(head -1 ${SYM_FILE} | cut -d' ' -f4)
|
local file_id=$(head -1 ${SYM_FILE} | cut -d' ' -f4)
|
||||||
local module_name=$(head -1 ${SYM_FILE} | cut -d' ' -f5)
|
local module_name=$(head -1 ${SYM_FILE} | cut -d' ' -f5)
|
||||||
if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then
|
# Show file upload success and symbol info for easier lookup
|
||||||
# Show file upload success and symbol info for easier lookup
|
debug "Dumped symbols from ${text_file} for ${module_name}|${file_id}."
|
||||||
info "Dumped symbols from ${text_file} for ${module_name}|${file_id}."
|
|
||||||
fi
|
|
||||||
# Sanity check: if we've created the same named file in the /usr/lib/debug
|
# Sanity check: if we've created the same named file in the /usr/lib/debug
|
||||||
# directory during the src_compile stage of an ebuild, verify our sym file
|
# directory during the src_compile stage of an ebuild, verify our sym file
|
||||||
# is the same.
|
# is the same.
|
||||||
@ -125,17 +129,13 @@ function process_file() {
|
|||||||
if [ -h "${debug_file}" ]; then
|
if [ -h "${debug_file}" ]; then
|
||||||
# Don't follow symbolic links. In particular, we don't want to bother
|
# Don't follow symbolic links. In particular, we don't want to bother
|
||||||
# with the *.debug links in the "debug/.build-id/" directory.
|
# with the *.debug links in the "debug/.build-id/" directory.
|
||||||
if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then
|
debug "Skipping symbolic link: ${debug_file}"
|
||||||
info "Skipping symbolic link: ${debug_file}"
|
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if [ "${text_file##*.}" == "ko" ]; then
|
if [ "${text_file##*.}" == "ko" ]; then
|
||||||
# Skip kernel objects. We can't use their symbols and they sometimes
|
# Skip kernel objects. We can't use their symbols and they sometimes
|
||||||
# have objects with empty text sections which trigger errors in dump_sym.
|
# have objects with empty text sections which trigger errors in dump_sym.
|
||||||
if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then
|
debug "Skipping kernel object: ${text_file}"
|
||||||
info "Skipping kernel object: ${text_file}"
|
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if [ ! -f "${text_file}" ]; then
|
if [ ! -f "${text_file}" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user