Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable logging of last_kmsg in conductor by default #7

Closed
gurupras opened this issue Aug 15, 2016 · 16 comments
Closed

Enable logging of last_kmsg in conductor by default #7

gurupras opened this issue Aug 15, 2016 · 16 comments
Assignees

Comments

@gurupras
Copy link
Contributor

gurupras commented Aug 15, 2016

/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.

@jhshi
Copy link
Member

jhshi commented Aug 15, 2016

We should do this, but do separate it with tracing related changes, so they can be merged individually.

@jhshi
Copy link
Member

jhshi commented Aug 15, 2016

Actually can you remind me of what tracing related changes do? We might just incorporate them in the main release as well.

@gurupras
Copy link
Contributor Author

gurupras commented Aug 15, 2016

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.

@jhshi
Copy link
Member

jhshi commented Aug 15, 2016

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.

@jhshi
Copy link
Member

jhshi commented Aug 15, 2016

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.

@gurupras
Copy link
Contributor Author

Will do. I will update this thread once that's done.

@jhshi jhshi assigned jhshi and gurupras and unassigned jhshi Aug 15, 2016
@gurupras
Copy link
Contributor Author

gurupras commented Aug 17, 2016

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.

@jhshi
Copy link
Member

jhshi commented Aug 17, 2016

Pull back the changes to external/sepolicy and do it in /device/moto/shamu/sepolicy/system_app.se

@gurupras
Copy link
Contributor Author

Done.

external/sepolicy still contains the branch phonelab/cm-13.0/last_kmsg, but the change has been reverted on this branch

@jhshi
Copy link
Member

jhshi commented Aug 17, 2016

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?

@jhshi
Copy link
Member

jhshi commented Aug 17, 2016

last_kmsg_only, I see. never mind this.

@jhshi
Copy link
Member

jhshi commented Aug 17, 2016

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?

@jhshi
Copy link
Member

jhshi commented Aug 17, 2016

deleted last_kmsg_only branch in conductor.

@gurupras
Copy link
Contributor Author

Finished merging branch phonelab/cm-13.0/last_kmsg into phonelab/cm-13.0/develop in device/moto/shamu and pushed.

@jhshi
Copy link
Member

jhshi commented Aug 17, 2016

OK, building. Will push the OTA soon.

@jhshi
Copy link
Member

jhshi commented Aug 17, 2016

Fixed in 4.1.4

@jhshi jhshi closed this as completed Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants