Enable logging of last_kmsg in conductor by default
Closed this issue · 16 comments
/proc/last_kmsg
is very useful information to obtain to understand reboot reasons and find rare bugs in stock sources as well as experiments.
We should add functionality to the conductor to log this on startup.
Solution
The conductor repo has a branch last_kmsg
which enables these changes.
This branch is up-to-date with jinghaos@buffalo.edu/develop
. The version numbers are the same as they are on jinghaos@buffalo.edu/develop
. I can bump these up if needed.
Unfortunately, this branch also contains tracing changes. If this change is approved, I will separate these out and create a new branch containing only changes required to run log /proc/last_kmsg
.
We should do this, but do separate it with tracing related changes, so they can be merged individually.
Actually can you remind me of what tracing related changes do? We might just incorporate them in the main release as well.
In the conductor, the tracing changes only add new classes to the conductor that check for certain tags in the manifest.xml
file. By default, they do not enable any tracing.
When the manifest contains the specific tag - <EventTracingService>
, the conductor's tracing task kicks in and enables the specified events.
This functionality depends on changes in the platform. The repos that will (probably) be modified are:
platform/build
device/moto/shamu
platform/external/sepolicy
platform/frameworks/base
platform/frameworks/native
kernel/moto/shamu
platform/system/core
@shaseley can probably give you a better idea of what these changes will involve.
I'm ok with adding EventTraceTask to the mainstream of conductor. I just checked, the last_kmsg branch is actually not up-to-date with master. Can you update it with the tip of master (2.0.2)? After that, we can merge the changes of both EventTraceTask and /proc/kmsg changes to master.
The bottom line is, we want to separate logging infrastructure with actual logging. As long as that's the case, I'm ok to also merge the changes you listed in the repo to phonelab develop branch. Just make sure you test them thoroughly before push.
Will do. I will update this thread once that's done.
I've tested and pushed all changes required for this to work.
On the Nexus 6, /proc/last_kmsg
has been removed and replaced with /sys/fs/pstore/*
. The conductor now has logic to log all files under this directory.
Unfortunately, this required giving system_apps
permissions to read /sys/fs/pstore
. The relevant changes have been made to external/sepolicy
.
Branches:
conductor: last_kmsg_only
external/sepolicy: phonelab/cm-13.0/last_kmsg
Let me know if you want me to build a release apk of the conductor and push it to vendor/phonelab
.
Pull back the changes to external/sepolicy and do it in /device/moto/shamu/sepolicy/system_app.se
Done.
external/sepolicy
still contains the branch phonelab/cm-13.0/last_kmsg
, but the change has been reverted on this branch
If you think the changes are stable, please merge them to phonelab/../develop branch. I'll pull and merge the branch in conductor. What's the branch name? And what changes in the manifest need to be updated?
last_kmsg_only
, I see. never mind this.
I merged last_kmsg_only
in conductor, and updated the conductor apk (2.0.3) in /vendor/phonelab. Changes pushed. Can you also update the develop branch of /device/moto/shamu?
deleted last_kmsg_only
branch in conductor.
Finished merging branch phonelab/cm-13.0/last_kmsg
into phonelab/cm-13.0/develop
in device/moto/shamu
and pushed.
OK, building. Will push the OTA soon.
Fixed in 4.1.4