Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: crash_sender

Issue 5814001: crash-reporter: Capture and send recent update_engine logs when it crashes (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git@master
Patch Set: Respond to petkov review Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 set -e 7 set -e
8 8
9 # Product ID in crash report 9 # Product ID in crash report
10 CHROMEOS_PRODUCT=ChromeOS 10 CHROMEOS_PRODUCT=ChromeOS
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 local meta_path="$1" 202 local meta_path="$1"
203 local report_payload="$(get_key_value "${meta_path}" "payload")" 203 local report_payload="$(get_key_value "${meta_path}" "payload")"
204 local kind="$(get_kind "${meta_path}")" 204 local kind="$(get_kind "${meta_path}")"
205 local exec_name="$(get_key_value "${meta_path}" "exec_name")" 205 local exec_name="$(get_key_value "${meta_path}" "exec_name")"
206 local sleep_time=$(generate_uniform_random $SECONDS_SEND_SPREAD) 206 local sleep_time=$(generate_uniform_random $SECONDS_SEND_SPREAD)
207 local url="${REPORT_UPLOAD_PROD_URL}" 207 local url="${REPORT_UPLOAD_PROD_URL}"
208 local chromeos_version="$(get_key_value "${meta_path}" "ver")" 208 local chromeos_version="$(get_key_value "${meta_path}" "ver")"
209 local board="$(get_board)" 209 local board="$(get_board)"
210 local hwclass="$(get_hardware_class)" 210 local hwclass="$(get_hardware_class)"
211 local write_payload_size="$(get_key_value "${meta_path}" "payload_size")" 211 local write_payload_size="$(get_key_value "${meta_path}" "payload_size")"
212 local log="$(get_key_value "${meta_path}" "log")"
212 local sig="$(get_key_value "${meta_path}" "sig")" 213 local sig="$(get_key_value "${meta_path}" "sig")"
213 local send_payload_size="$(stat --printf=%s "${report_payload}" 2>/dev/null)" 214 local send_payload_size="$(stat --printf=%s "${report_payload}" 2>/dev/null)"
214 215
215 local extra_key1="write_payload_size" 216 local extra_key1="write_payload_size"
216 local extra_value1="${write_payload_size}" 217 local extra_value1="${write_payload_size}"
217 local extra_key2="send_payload_size" 218 local extra_key2="send_payload_size"
218 local extra_value2="${send_payload_size}" 219 local extra_value2="${send_payload_size}"
219 if [ "${sig}" != "undefined" ]; then 220 if [ "${sig}" != "undefined" ]; then
220 extra_key1="sig" 221 extra_key1="sig"
221 extra_value1="${sig}" 222 extra_value1="${sig}"
222 extra_key2="sig2" 223 extra_key2="sig2"
223 extra_value2="${sig}" 224 extra_value2="${sig}"
225 elif [ "${log}" != "undefined" ]; then
226 # Upload a log file if it was specified.
227 extra_key1="log"
228 extra_value1="@${log}"
224 fi 229 fi
225 230
226 lecho "Sending crash:" 231 lecho "Sending crash:"
227 lecho " Scheduled to send in ${sleep_time}s" 232 lecho " Scheduled to send in ${sleep_time}s"
228 lecho " Metadata: ${meta_path} (${kind})" 233 lecho " Metadata: ${meta_path} (${kind})"
229 lecho " Payload: ${report_payload}" 234 lecho " Payload: ${report_payload}"
230 lecho " Version: ${chromeos_version}" 235 lecho " Version: ${chromeos_version}"
231 if is_mock; then 236 if is_mock; then
232 lecho " Product: ${CHROMEOS_PRODUCT}" 237 lecho " Product: ${CHROMEOS_PRODUCT}"
233 lecho " URL: ${url}" 238 lecho " URL: ${url}"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)" 403 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)"
399 404
400 # Send system-wide crashes 405 # Send system-wide crashes
401 send_crashes "/var/spool/crash" 406 send_crashes "/var/spool/crash"
402 407
403 # Send user-specific crashes 408 # Send user-specific crashes
404 send_crashes "/home/chronos/user/crash" 409 send_crashes "/home/chronos/user/crash"
405 } 410 }
406 411
407 main 412 main
OLDNEW
« no previous file with comments | « crash_reporter_logs.conf ('k') | user_collector.h » ('j') | user_collector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698