Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f64ee2db authored by Peter Collingbourne's avatar Peter Collingbourne Committed by Automerger Merge Worker
Browse files

Merge "Move crash_dump into the runtime APEX." am: e2b76c5b

Change-Id: Ie235a852fff89beaca3f09c3ec58a7ad4c453e3b
parents f1e8da1b e2b76c5b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -317,6 +317,10 @@ cc_binary {
        "libprocinfo",
        "libunwindstack",
    ],

    apex_available: [
        "com.android.runtime",
    ],
}

cc_binary {
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ using unique_fd = android::base::unique_fd_impl<FdsanBypassCloser>;
#define CRASH_DUMP_NAME "crash_dump32"
#endif

#define CRASH_DUMP_PATH "/system/bin/" CRASH_DUMP_NAME
#define CRASH_DUMP_PATH "/apex/com.android.runtime/bin/" CRASH_DUMP_NAME

// Wrappers that directly invoke the respective syscalls, in case the cached values are invalid.
#pragma GCC poison getpid gettid
+0 −17
Original line number Diff line number Diff line
@@ -447,8 +447,6 @@ static bool dump_thread(log_t* log, unwindstack::Unwinder* unwinder, const Threa
// that don't match the specified pid, and writes them to the tombstone file.
//
// If "tail" is non-zero, log the last "tail" number of lines.
static EventTagMap* g_eventTagMap = NULL;

static void dump_log_file(log_t* log, pid_t pid, const char* filename, unsigned int tail) {
  bool first = true;
  logger_list* logger_list;
@@ -507,21 +505,6 @@ static void dump_log_file(log_t* log, pid_t pid, const char* filename, unsigned
    ptm = localtime_r(&sec, &tmBuf);
    strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", ptm);

    if (log_entry.id() == LOG_ID_EVENTS) {
      if (!g_eventTagMap) {
        g_eventTagMap = android_openEventTagMap(nullptr);
      }
      AndroidLogEntry e;
      char buf[512];
      if (android_log_processBinaryLogBuffer(&log_entry.entry, &e, g_eventTagMap, buf,
                                             sizeof(buf)) == 0) {
        _LOG(log, logtype::LOGS, "%s.%03d %5d %5d %c %-8.*s: %s\n", timeBuf,
             log_entry.entry.nsec / 1000000, log_entry.entry.pid, log_entry.entry.tid, 'I',
             (int)e.tagLen, e.tag, e.message);
      }
      continue;
    }

    char* msg = log_entry.msg();
    if (msg == nullptr) {
      continue;
+2 −2
Original line number Diff line number Diff line
LIBLOG {
  global:
    android_name_to_log_id; # llndk
    android_name_to_log_id; # apex llndk
    android_log_id_to_name; # llndk
    __android_log_assert;
    __android_log_buf_print;
@@ -22,7 +22,7 @@ LIBLOG_L {
    android_logger_list_alloc; # apex llndk
    android_logger_list_alloc_time; # apex llndk
    android_logger_list_free; # apex llndk
    android_logger_list_open; # llndk
    android_logger_list_open; # apex llndk
    android_logger_list_read; # apex llndk
    android_logger_open; # apex llndk
    android_logger_set_log_size; # llndk