This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

earlyprintk

Hi,

How can I switch on option similar to earlyprintk for Android? Should I make some changes in kernel config?

Best regards,

Anton 

  • This is the information I have.

    http://developer.android.com/guide/developing/debugging/index.html
    http://developer.android.com/guide/developing/tools/logcat.html
    and one important point logcat can provide different log sources
    http://developer.android.com/guide/developing/debugging/debugging-log.html

    some links about logcat and log related
    Android Zygote Startup - eLinux.orgZygote
    http://elinux.org/Android_Zygote_Startup
    http://elinux.org/Android_Logging_System

    the next comment i found in main_runtime.cpp not sure where it could go, init.rc or other system file you can read next link for Android boot sequence, but all must be covered by logwrappers to use in init.rc described in previous link.

    I tried to find this file in JB or ICS but it is not there only up to GB.

    /mydroid/frameworks/base/cmds/runtime/main_runtime.cpp

    static void usage(const char* argv0)
    {
        fprintf(stderr,
            "Usage: runtime [-g gamma] [-l logfile] [-n] [-s]\n"
            "               [-j app-component] [-v app-verb] [-d app-data]\n"
            "\n"
            "-l: File to send log messages to\n"
            "-n: Don't print to stdout/stderr\n"
            "-s: Force single-process mode\n"
            "-j: Custom home app component name\n"
            "-v: Custom home app intent verb\n"
            "-d: Custom home app intent data\n"
        );
        exit(1);
    }

  • Anton Skornyakob said:

    How can I switch on option similar to earlyprintk for Android? Should I make some changes in kernel config?

    Not sure I completely understand your question. Do you just want to see early console messages from the kernel or are you looking for android debug messages?

    Earlyprintk works in the same way for Android as any other Linux distro. Otherwise you can use "logcat" to see Android debug information on startup. Just execute "logcat" from the console after the kernel has booted.

    Cheers
    Jon

  • Just to complement my previous post.

    You can use loggers or logcat to send the output of a binary to logcat, it is needed to run logcat from inside init.rc.

    One thing about init files is that they have debug logs but they are disabled, it is needed to open the file and enable the debug flag.

    for example,

    /GB/mydroid/frameworks/base/services/jni/com_android_server_InputManager.cpp

    to enable debug it can be selected at the beginning of first file and recompiling, uncomment it or set to 1, try using logcat *:* to enable all options
    there are other options

    #define LOG_TAG "InputManager-JNI"
    //#define LOG_NDEBUG 0
    // Log debug messages about InputReaderPolicy
    #define DEBUG_INPUT_READER_POLICY 0
    // Log debug messages about InputDispatcherPolicy
    #define DEBUG_INPUT_DISPATCHER_POLICY 0