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

Commit 1e9f56cf authored by Colin Cross's avatar Colin Cross
Browse files

Allow BoardConfig.mk to define an extension to dumpstate

If BoardConfig.mk defines BOARD_LIB_DUMPSTATE, link to that library
and call dumpstate_board(), which can dump debugging information that
only make senses on one device.

Change-Id: I2c5006a1a04b02cf26fd73575047ac176f222616
parent 3ad4d3ce
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -11,4 +11,9 @@ LOCAL_MODULE := dumpstate

LOCAL_SHARED_LIBRARIES := libcutils

ifdef BOARD_LIB_DUMPSTATE
LOCAL_STATIC_LIBRARIES := $(BOARD_LIB_DUMPSTATE)
LOCAL_CFLAGS += -DBOARD_HAS_DUMPSTATE
endif

include $(BUILD_EXECUTABLE)
+12 −0
Original line number Diff line number Diff line
@@ -197,6 +197,15 @@ static void dumpstate() {
    dump_file(NULL, "/sys/class/leds/lcd-backlight/registers");
    printf("\n");

#ifdef BOARD_HAS_DUMPSTATE
    printf("========================================================\n");
    printf("== Board\n");
    printf("========================================================\n");

    dumpstate_board();
    printf("\n");
#endif

    printf("========================================================\n");
    printf("== Android Framework Services\n");
    printf("========================================================\n");
@@ -218,6 +227,9 @@ static void dumpstate() {

    run_command("APP SERVICES", 30, "dumpsys", "activity", "service", "all", NULL);

    printf("========================================================\n");
    printf("== dumpstate: done\n");
    printf("========================================================\n");
}

static void usage() {
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

#include <time.h>
#include <unistd.h>
#include <stdio.h>

/* prints the contents of a file */
int dump_file(const char *title, const char* path);
@@ -47,4 +48,7 @@ void show_wchan(int pid, const char *name);
/* Play a sound via Stagefright */
void play_sound(const char* path);

/* Implemented by libdumpstate_board to dump board-specific info */
void dumpstate_board();

#endif /* _DUMPSTATE_H_ */