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

Commit f83543ab authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

dumpstate: add -v printable to logcat

(cherry pick from commit 7831638e)

In the case where binary data lands in an utf-8 log buffer,
ensure that the content is made printable.

Bug: 23517551
Change-Id: I41696372d07228875d01a19f0c7ab2cb7494b7ef
parent 6e361344
Loading
Loading
Loading
Loading
+20 −5
Original line number Original line Diff line number Diff line
@@ -337,17 +337,28 @@ static void dumpstate() {
    if (timeout < 20000) {
    if (timeout < 20000) {
        timeout = 20000;
        timeout = 20000;
    }
    }
    run_command("SYSTEM LOG", timeout / 1000, "logcat", "-v", "threadtime", "-d", "*:v", NULL);
    run_command("SYSTEM LOG", timeout / 1000, "logcat", "-v", "threadtime",
                                                        "-v", "printable",
                                                        "-d",
                                                        "*:v", NULL);
    timeout = logcat_timeout("events");
    timeout = logcat_timeout("events");
    if (timeout < 20000) {
    if (timeout < 20000) {
        timeout = 20000;
        timeout = 20000;
    }
    }
    run_command("EVENT LOG", timeout / 1000, "logcat", "-b", "events", "-v", "threadtime", "-d", "*:v", NULL);
    run_command("EVENT LOG", timeout / 1000, "logcat", "-b", "events",
                                                       "-v", "threadtime",
                                                       "-v", "printable",
                                                       "-d",
                                                       "*:v", NULL);
    timeout = logcat_timeout("radio");
    timeout = logcat_timeout("radio");
    if (timeout < 20000) {
    if (timeout < 20000) {
        timeout = 20000;
        timeout = 20000;
    }
    }
    run_command("RADIO LOG", timeout / 1000, "logcat", "-b", "radio", "-v", "threadtime", "-d", "*:v", NULL);
    run_command("RADIO LOG", timeout / 1000, "logcat", "-b", "radio",
                                                       "-v", "threadtime",
                                                       "-v", "printable",
                                                       "-d",
                                                       "*:v", NULL);


    run_command("LOG STATISTICS", 10, "logcat", "-b", "all", "-S", NULL);
    run_command("LOG STATISTICS", 10, "logcat", "-b", "all", "-S", NULL);


@@ -419,8 +430,12 @@ static void dumpstate() {
    }
    }


    /* kernels must set CONFIG_PSTORE_PMSG, slice up pstore with device tree */
    /* kernels must set CONFIG_PSTORE_PMSG, slice up pstore with device tree */
    run_command("LAST LOGCAT", 10, "logcat", "-L", "-v", "threadtime",
    run_command("LAST LOGCAT", 10, "logcat", "-L",
                                             "-b", "all", "-d", "*:v", NULL);
                                             "-b", "all",
                                             "-v", "threadtime",
                                             "-v", "printable",
                                             "-d",
                                             "*:v", NULL);


    /* The following have a tendency to get wedged when wifi drivers/fw goes belly-up. */
    /* The following have a tendency to get wedged when wifi drivers/fw goes belly-up. */