stapify: a script to easily run stap scripts on Android

Author: Negreanu Marius Adrian <adrian.m.negreanu@intel.com>
Author: Dragos Tatulea <dragos.tatulea@intel.com>
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
make search.h, locale.h and libint.h optional

Some environments (like Android) don't have them.

Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
android: disable unsupported function using ifdef__ANDROID__

Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
android: Android.mk and specific fixes for build

There are some limitations for android:
- can't use funky exceptions or code that pulls them in
- don't use .. paths in includes for config files because
it makes it impossible to find them under android/host &
android/target
- added git_version.sh in the build

Author: Negreanu Marius Adrian <adrian.m.negreanu@intel.com>
Author: Dragos Tatulea <dragos.tatulea@intel.com>
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
android: fix invalid install of staprun in output dir

Use 2 Android.mk's:
- One in src root for stap
- One in staprun for staprun & stapio

We do this to avoid a bug in the build system that triggers when some sources
are located in a directory that has the same name as the module to be built.
In this case staprun object output dir and staprun linked binary were confusing
the build system.

Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
android: Fixed race condition in git_version.h generation

The stap and staprun targets were based on generation of a
git_version.h file. The generation is being done based on running the
git_version.sh script. However, there were two glitches in the code:
1. The generation script was being run with an output file that didn't
have the full path specified, using the current ($PWD) directory as
output file. And that's because the script itself was not "ready" to
be used with full path.
2. When building Android, all scripts are being run with current
directory, the topmost Android root directory. The git_version.sh
script was usnig the current directory to store the git_version.h,
just before copying it in the *intermediates* target directory. If two
or more instances of the git_version.sh script were being run, they
were using the very same git_version.h file from the Android tree
root. This leads to a race condition.

This patch solves both of these problems, even though it basically
addresses only the first one.

The git_version.sh script was modified to accept a full path when
specifying an output file. So, now, the script can be called directly
with the *intermediates* git_version.h file as parameter. Also, the
two Android.mk files were modified to call the git_version.sh script
properly.

Signed-off-by: Alin Dobre <alin.m.dobre@intel.com>
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
android: switch from static to shared elfutils

Needed to use ebl backend.

Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
android: update Android.mk

Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
add support for aarapovs' uretprobes

Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>