From 5edf8bb308889f42daa58732f31bcb47495d29cb Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Fri, 4 May 2012 19:27:29 -0700 Subject: [PATCH] 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 ". 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 Reviewed-by: Mike Frysinger Commit-Ready: Brian Harring --- cros_generate_breakpad_symbols | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cros_generate_breakpad_symbols b/cros_generate_breakpad_symbols index 78fa0417db..ad6352b019 100755 --- a/cros_generate_breakpad_symbols +++ b/cros_generate_breakpad_symbols @@ -36,6 +36,12 @@ function cleanup() { 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 function get_text_for_debug() { 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 if is_32b_elf "${text_file}"; then 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 # Dump symbols as root in order to read all files. if ! sudo "${dump_syms_prog}" "${text_file}" "${debug_directory}" \ @@ -93,10 +99,8 @@ function dump_file() { fi local file_id=$(head -1 ${SYM_FILE} | cut -d' ' -f4) 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 - info "Dumped symbols from ${text_file} for ${module_name}|${file_id}." - fi + # Show file upload success and symbol info for easier lookup + debug "Dumped symbols from ${text_file} for ${module_name}|${file_id}." # 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 # is the same. @@ -125,17 +129,13 @@ function process_file() { if [ -h "${debug_file}" ]; then # Don't follow symbolic links. In particular, we don't want to bother # with the *.debug links in the "debug/.build-id/" directory. - if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then - info "Skipping symbolic link: ${debug_file}" - fi + debug "Skipping symbolic link: ${debug_file}" return 0 fi if [ "${text_file##*.}" == "ko" ]; then # Skip kernel objects. We can't use their symbols and they sometimes # have objects with empty text sections which trigger errors in dump_sym. - if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then - info "Skipping kernel object: ${text_file}" - fi + debug "Skipping kernel object: ${text_file}" return 0 fi if [ ! -f "${text_file}" ]; then