Merge pull request #9188 from SenRamakri/sen_ErrorUrlEnhance

Add more information to error url to enhance error analytics
pull/9302/head
Cruz Monrreal 2019-01-10 00:12:46 -06:00 committed by GitHub
commit f8d7c31a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 6 deletions

View File

@ -25,6 +25,7 @@
#include "platform/mbed_error_hist.h"
#include "platform/mbed_interface.h"
#include "platform/mbed_power_mgmt.h"
#include "platform/mbed_stats.h"
#ifdef MBED_CONF_RTOS_PRESENT
#include "rtx_os.h"
#endif
@ -454,6 +455,8 @@ static void print_threads_info(const osRtxThread_t *threads)
#endif
#ifndef NDEBUG
#define GET_TARGET_NAME_STR(tgt_name) #tgt_name
#define GET_TARGET_NAME(tgt_name) GET_TARGET_NAME_STR(tgt_name)
static void print_error_report(const mbed_error_ctx *ctx, const char *error_msg, const char *error_filename, int error_line)
{
int error_code = MBED_GET_ERROR_CODE(ctx->error_status);
@ -539,11 +542,18 @@ static void print_error_report(const mbed_error_ctx *ctx, const char *error_msg,
mbed_error_printf("\nDelay:");
print_threads_info(osRtxInfo.thread.delay_list);
#endif
mbed_error_printf(MBED_CONF_PLATFORM_ERROR_DECODE_HTTP_URL_STR, ctx->error_status);
#if !defined(MBED_SYS_STATS_ENABLED)
mbed_error_printf("\nFor more info, visit: https://mbed.com/s/error?error=0x%08X&tgt=" GET_TARGET_NAME(TARGET_NAME), ctx->error_status);
#else
mbed_stats_sys_t sys_stats;
mbed_stats_sys_get(&sys_stats);
mbed_error_printf("\nFor more info, visit: https://mbed.com/s/error?error=0x%08X&osver=%d&core=0x%08X&comp=%d&ver=%d&tgt=" GET_TARGET_NAME(TARGET_NAME), ctx->error_status, sys_stats.os_version, sys_stats.cpu_id, sys_stats.compiler_id, sys_stats.compiler_version);
#endif
mbed_error_printf("\n-- MbedOS Error Info --\n");
}
#endif //ifndef NDEBUG
#if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED
//Retrieve the error context from error log at the specified index
mbed_error_status_t mbed_get_error_hist_info(int index, mbed_error_ctx *error_info)

View File

@ -108,11 +108,6 @@
"value": null
},
"error-decode-http-url-str": {
"help": "HTTP URL string for ARM Mbed-OS Error Decode microsite",
"value": "\"\\nFor more info, visit: https://armmbed.github.io/mbedos-error/?error=0x%08X\""
},
"cthunk_count_max": {
"help": "The maximum CThunk objects used at the same time. This must be greater than 0 and less 256",
"value": 8

View File

@ -201,6 +201,8 @@ class mbedToolchain:
if MBED_ORG_USER:
self.cxx_symbols.append('MBED_USERNAME=' + MBED_ORG_USER)
# Add target's name
self.cxx_symbols += ["TARGET_NAME=" + self.target.name]
# Add target's symbols
self.cxx_symbols += self.target.macros
# Add target's hardware