chenxiaolong / DualBootPatcher

Patches Android ROMs for dual boot support
https://dbp.noobdev.io
Other
527 stars 466 forks source link

Add new libmbsystrace library #1347

Closed chenxiaolong closed 5 years ago

chenxiaolong commented 5 years ago

libmbsystrace is a library for tracing and manipulating kernel interactions of a process. This includes things like making system calls and delivery of signals. Tracing of mixed ABI programs is supported. Thus, libmbsystrace supports tracing:

Userspace tracing, like stepping through assembly instructions are not supported by the library.


This will be useful in manipulating the behavior of ROM installers and init binaries without DBP having special knowledge of them. For example, instead of explicitly parsing fstab files or removing mount commands from init.*.rc, we can hook mount syscalls as init is executing them. The same applies to installers as well, where we're currently hacking edify files and other installer scripts to hook mount/umount calls.

Before we start using libmbsystrace in DBP, we'll need to implement the ability to use eBPF for filtering syscalls we care about. Otherwise, the current pure-ptrace solution may cause a large performance hit during ROM installation and bootup. This will come in a future PR.

This PR also adds the ability to run all the gtest/gmock tests for android-system targets inside QEMU. This has been enabled for CI builds so failing tests will block publishing of a release. Support for the android-app targets may be added later.


Closes #1344