• Stars
    star
    165
  • Rank 224,108 (Top 5 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extended Android Tools is a place to host and maintain a build environment and makefiles cross compiling Linux tools we all love for Android.

ExtendedAndroidTools

Extended Android Tools is a set of makefiles and build environment cross compiling Linux tools we all love for Android. All tools are built using their native build systems (autotools, cmake, etc) and Android NDK. Reference build environment is provided via Vagrant and Docker.

List of supported software

Sysroots

When projects are built the resulting binaries/libraries are placed in bin and lib subdirectories of out/android/$ARCH/ directory. To run a particular tool on an Android device it needs to be pushed together with all the libraries it depends on to the device. In addition the shell environment needs to be configured appropriately for the runtime loader to be able to locate and load those libraries when the tool is executed. To help automate these steps ExtendedAndroidTools provides helper targets preparing sysroot archives consisting of selected executables and libraries, together with scripts setting up the environment. Those archives can be pushed to a device, extracted, and used without any further setup.

# build bpftools, sysroot containing bpftrace, python and bcc
# see the 'Build environment' section for more details on building
make bpftools

adb push bpftools-arm64.tar.gz /data/local/tmp
adb shell "cd /data/local/tmp && tar xf bpftools-arm64.tar.gz"

# enjoy new tools
adb shell /data/local/tmp/bpftools/bpftrace -e 'uprobe:/system/lib64/libc.so:malloc { @ = hist(arg0); }'

Build environment

Checked in Vagrantfile provides a reference build environment for cross compiling all the projects. To access it run the following commands:

# Startup (potentially provision new) VM
vagrant up

# ssh into a running VM
vagrant ssh

Once you ssh into the VM you can build projects of your choice

# Go to the shared directory
cd /vagrant

# build the project of your choise
make python

# or build entire sysroot
make bpftools

In addition, ExtendedAndroidTools maintains a Dockerfile providing Docker based build environment. You can access it using the following commands:

# Build the image
./scripts/build-docker-image.sh

# Run the environment
./scripts/run-docker-build-env.sh

# Build a target of your choice from within the container
make bpftools

Android device requirements

Some of the tools require root privileges to run. In addition BPF tools require Linux kernel to provide BPF capabilities: BPF, Kprobes and Uprobes. Most of Android kernels are based on Linux versions that are either too old, or have some or all of the necessary features disabled. The most straigtforward way to access Android environment providing root access and some BPF capabilities (BPF + Uprobes) is to use API 30 Android emulator without Google Play Store. To read more on preparing other devices see dedicated documentation.

Variables impacting build process

  • THREADS - number of jobs to run simultaneously. This value is passed to nested make invocations via -j option. The default value is 4.
  • NDK_ARCH - x86_64 or arm64. Architecture to cross compile for. The default value is arm64
  • BUILD_TYPE - Release or Debug, controlls amount of debug info to be included in resulting libs and binaries. The default value is Release.
# The following builds debug version of bpftools sysroot for x86_64
# Warning: this takes very long and resulting binaries are big, prepare ~100GB of disk space

make bpftools NDK_ARCH=x86_64 BUILD_TYPE=Debug THREADS=1

Variables impacting execution of tools

  • BPFTRACE_KERNEL_SOURCE - if set indicates directory bpftrace should read kernel headers from
  • BCC_KERNEL_SOURCE - if set indicates directory bcc should read kernel headers from
  • BCC_SYMFS - if set indicates directory containing unstripped elf binaries for better stack symbolication

Contributing

See the CONTRIBUTING.md file.

License

See the LICENSE file.

More Repositories

1

Recoil

Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
JavaScript
19,454
star
2

libunifex

Unified Executors
C++
1,373
star
3

hermit

Hermit launches linux x86_64 programs in a special, hermetically isolated sandbox to control their execution. Hermit translates normal, nondeterministic behavior, into deterministic, repeatable behavior. This can be used for various applications, including replay-debugging, reproducible artifacts, chaos mode concurrency testing and bug analysis.
Rust
1,126
star
4

Robyn

Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.
Jupyter Notebook
1,059
star
5

MIRAI

Rust mid-level IR Abstract Interpreter
Rust
963
star
6

reverie

An ergonomic and safe syscall interception framework for Linux.
Rust
531
star
7

object-introspection

Object Introspection (OI) enables on-demand, hierarchical profiling of objects in arbitrary C/C++ programs with no recompilation.
C++
145
star
8

resctl-demo

Demonstrate and benchmark various features of Linux resource control in a self-contained package.
Rust
141
star
9

allocative

Library and proc macro to analyze memory usage of data structures in rust.
Rust
120
star
10

rust-shed

Repository containing Rust crates common between other Facebook open source projects (like Mononoke or Eden).
Rust
99
star
11

go-media-webtransport-server

WebTransport media server that enables ultra low latency live streaming over QUIC (also VOD and rewind)
Go
82
star
12

webcodecs-capture-play

Live streaming low latency experimentation platform in the browser (using WebCodecs)
JavaScript
78
star
13

siMMMulator

siMMMulator is an open source R-package that helps users to generate simulated data to plug into Marketing Mix Models (MMMs). The package features a variety of functions to help users build a data set from scratch.
R
35
star
14

MemorySnapshotAnalyzer

Analysis tooling for memory snapshots of managed code runtimes, specifically, Unity Memory Snapshots.
C#
29
star
15

moq-encoder-player

This project is provides a minimal implementation (inside the browser) of a live video and audio encoder and video / audio player creating and consuming IETF MOQ stream. The goal is to provide a minimal live platform components that helps testing IETF MOQ interop
JavaScript
26
star
16

protoquant

Prototype routines for GPU quantization written using PyTorch.
Python
19
star
17

moq-go-server

This is an experimental relay (optimized for low latency media transfers) that implements IETF MOQ protocol
Go
16
star
18

edencommon

Shared library for Watchman and Eden projects.
C++
9
star
19

kperf

TCP and TLS performance testing tool.
C
7
star
20

propellint

A tool joining profile information with static analysis.
C++
5
star
21

r8

Customized version of the D8 dexer and R8 shrinker
Java
4
star
22

iot-session-manager

The IoT Session Manager is an application that provides a reliable and scalable device to device messaging network with simple setup. The system is deployable locally on a machine or on a cloud server and provides extensible methods for device authentication and control automation.
Python
3
star
23

fnob

Open source Fnob (Command-line Dynamic Random Generator) package;
SystemVerilog
2
star
24

Rmdkernel

This is a very simple fork of https//github.com/IRkernel/IRkernel to provide an rmarkdown (rather than R) jupyter kernel.
Jupyter Notebook
2
star
25

xrpa

Xrpa (pronounced "sherpa") is a platform architecture framework for building experimental XR experiences.
C++
2
star
26

CARL

Classical Action Recognition Library
C++
1
star
27

csproj_benchmark

A tool that generates Visual Studio C# projects and measures IDE startup performance
C#
1
star
28

ndctl

A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics. Forked from https://github.com/pmem/ndctl
C
1
star