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

Side by Side Diff: crash_sender

Issue 3820004: crash-reporter: send payload sizes to help diagnose corruption (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: Created 10 years, 2 months 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
« no previous file with comments | « crash_collector.cc ('k') | kernel_collector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 send_crash() { 185 send_crash() {
186 local meta_path="$1" 186 local meta_path="$1"
187 local kind="$(get_kind "${meta_path}")" 187 local kind="$(get_kind "${meta_path}")"
188 local exec_name="$(get_key_value "${meta_path}" "exec_name")" 188 local exec_name="$(get_key_value "${meta_path}" "exec_name")"
189 local sleep_time=$(generate_uniform_random $SECONDS_SEND_SPREAD) 189 local sleep_time=$(generate_uniform_random $SECONDS_SEND_SPREAD)
190 local url="${REPORT_UPLOAD_PROD_URL}" 190 local url="${REPORT_UPLOAD_PROD_URL}"
191 local chromeos_version="$(get_key_value "${meta_path}" "ver")" 191 local chromeos_version="$(get_key_value "${meta_path}" "ver")"
192 local board="$(get_board)" 192 local board="$(get_board)"
193 local hwclass="$(get_hardware_class)" 193 local hwclass="$(get_hardware_class)"
194 local payload_extension="${kind}" 194 local payload_extension="${kind}"
195 local write_payload_size="$(get_key_value "${meta_path}" "payload_size")"
195 [ "${kind}" = "minidump" ] && payload_extension="dmp" 196 [ "${kind}" = "minidump" ] && payload_extension="dmp"
196 local report_payload="$(get_base "${meta_path}").${payload_extension}" 197 local report_payload="$(get_base "${meta_path}").${payload_extension}"
198 local send_payload_size="$(stat --printf=%s "${report_payload}")"
197 lecho "Sending crash:" 199 lecho "Sending crash:"
198 lecho " Scheduled to send in ${sleep_time}s" 200 lecho " Scheduled to send in ${sleep_time}s"
199 lecho " Metadata: ${meta_path} (${kind})" 201 lecho " Metadata: ${meta_path} (${kind})"
200 lecho " Payload: ${report_payload}" 202 lecho " Payload: ${report_payload}"
201 lecho " Version: ${chromeos_version}" 203 lecho " Version: ${chromeos_version}"
202 if is_mock; then 204 if is_mock; then
203 lecho " Product: ${CHROMEOS_PRODUCT}" 205 lecho " Product: ${CHROMEOS_PRODUCT}"
204 lecho " URL: ${url}" 206 lecho " URL: ${url}"
205 lecho " Board: ${board}" 207 lecho " Board: ${board}"
206 lecho " HWClass: ${hwclass}" 208 lecho " HWClass: ${hwclass}"
(...skipping 19 matching lines...) Expand all
226 local curl_stderr="${TMP_DIR}/curl_stderr" 228 local curl_stderr="${TMP_DIR}/curl_stderr"
227 229
228 set +e 230 set +e
229 curl "${url}" \ 231 curl "${url}" \
230 -F "prod=${CHROMEOS_PRODUCT}" \ 232 -F "prod=${CHROMEOS_PRODUCT}" \
231 -F "ver=${chromeos_version}" \ 233 -F "ver=${chromeos_version}" \
232 -F "upload_file_${kind}=@${report_payload}" \ 234 -F "upload_file_${kind}=@${report_payload}" \
233 -F "board=${board}" \ 235 -F "board=${board}" \
234 -F "hwclass=${hwclass}" \ 236 -F "hwclass=${hwclass}" \
235 -F "exec_name=${exec_name}" \ 237 -F "exec_name=${exec_name}" \
238 -F "write_payload_size=${write_payload_size}" \
239 -F "send_payload_size=${send_payload_size}" \
236 -F "guid=<${CONSENT_ID}" -o "${report_id}" 2>"${curl_stderr}" 240 -F "guid=<${CONSENT_ID}" -o "${report_id}" 2>"${curl_stderr}"
237 curl_result=$? 241 curl_result=$?
238 set -e 242 set -e
239 243
240 if [ ${curl_result} -eq 0 ]; then 244 if [ ${curl_result} -eq 0 ]; then
241 lecho "Crash report receipt ID $(cat ${report_id})" 245 lecho "Crash report receipt ID $(cat ${report_id})"
242 else 246 else
243 lecho "Crash sending failed with: $(cat ${curl_stderr})" 247 lecho "Crash sending failed with: $(cat ${curl_stderr})"
244 fi 248 fi
245 249
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)" 364 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)"
361 365
362 # Send system-wide crashes 366 # Send system-wide crashes
363 send_crashes "/var/spool/crash" 367 send_crashes "/var/spool/crash"
364 368
365 # Send user-specific crashes 369 # Send user-specific crashes
366 send_crashes "/home/chronos/user/crash" 370 send_crashes "/home/chronos/user/crash"
367 } 371 }
368 372
369 main 373 main
OLDNEW
« no previous file with comments | « crash_collector.cc ('k') | kernel_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698