(PR14571 partial fix) For dyninst, use TLS for map and stat data.

* runtime/dyninst/tls_data.c: New file.
* runtime/stat.c (struct _Stat): Add a tls_data_container_t structure.
  (_stp_stat_tls_object_init): New function.
  (_stp_stat_tls_object_free): Ditto.
  (_stp_stat_init): Instead of directly allocating percpu data, for
  dyninst set up tls data to be created when accessed by calling
  _stp_tls_data_container_init().
  (_stp_stat_del): For dyninst, call _stp_tls_data_container_cleanup() to
  remove all the tls data.
  (_stp_stat_add): For dyninst, get the proper tls stat object.
  (_stp_stat_get_cpu): Deleted unused function.
  (_stp_stat_get): For dyninst, get the proper tls stat objects.
  (_stp_stat_clear): For dyninst, clear the stat in each thread's tls data.
* runtime/stat.h (struct stat_data): Add a tls_data_object_t structure.
* runtime/map.c (_stp_map_tls_object_init): New function.
  (_stp_map_tls_object_free): Ditto.
  (_stp_pmap_new): Instead of directly allocating percpu data, for dyninst
  set up tls data to be created when accessed by calling
  _stp_tls_data_container_init().
  (_stp_pmap_clear): For dyninst, clear the map in each thread's tls data.
  (_stp_pmap_del): For dyninst, call _stp_tls_data_container_cleanup() to
  remove all the tls data.
  (_stp_pmap_agg): Add dyninst support.
* runtime/map.h (struct map_root): Add a tls_data_object_t structure.
  (struct pmap): Add a tls_data_container_t structure.
* runtime/map-stat.c (_stp_hstat_tls_object_init): New function.
  (_stp_pmap_new_hstat_linear): For dyninst, override the standard tls
  data object init function with _stp_hstat_tls_object_init(), which knows
  how to handle hstats.
  (_stp_pmap_new_hstat_log): Ditto.
* runtime/pmap-gen.c (_stp_pmap_tls_object_init): New function.
  (_stp_pmap_new): For dyninst, override the standard tls
  data object init function with _stp_pmap_tls_object_init(), which knows
  how to handle pmaps.
  (_stp_pmap_set): For dyninst, get the proper tls pmap object.
  (_stp_pmap_add): Ditto.
  (_stp_pmap_get_cpu): Ditto.
  (_stp_pmap_get): Ditto.
  (_stp_pmap_del): Ditto.
* runtime/dyninst/linux_defs.h: Added container_of(), list_entry(),
  list_for_each_entry(), and list_for_each_entry_safe().
common_probe_context cleanup: make probe_type an enum
staplog.c: Use tighter #if / #elif chain for crash/defs ARCH #defines

Just to make doubly triple-sure that no more than one of the macros gets set.
PR14611: enable PR9740 workaround only for kernel 2.6.23 - 2.6.29ish
stapdyn: Enable end/error probes

The dyninst exit hook runs too late for us to still call anything in the
mutatee, so the systemtap_module_exit() call which should run all of the
end/error probes wasn't happening.

Now we use a destructor function in the mutatee, so our exit path always
runs after main() returns or after an exit() call.  Functions like
_exit() are still problematic though.

This now also makes a distinction between initializing process-local vs.
session resources, so we are more ready for operating with multiple
mutatees at once.  See dyninst/runtime.h for design comments.
PR6580: detailed docstrings for updated tapset functions.
PR6580: tweak psyms() et al output format to satisfy exelib.exp.
testsuite: set $SYSTEMTAP_SYNC

For helping diagnose crashes that may occur during a testsuite,
set $SYSTEMTAP_SYNC, which is handled by staprun, just before it
does the module-insertion.  This will make tests slower, sorry.

* testsuite/Makefile.am (RUNTEST): Add env SYSTEMTAP_SYNC=yes.
* testsuite/Makefile.in: Regenerated with love.
Typo fix for earlier probe_type enum commit (commit cda141c).
(PR14574 partial fix) Make the systemtap.pass1-4/*.exp tests use dyninst also.

* testsuite/lib/systemtap.exp (print_systemtap_version): New function.
  (get_runtime_list): Ditto.
  (setup_systemtap_environment): Remember whether we've got dyninst
  support.
  (stap_run_batch): Allow passing args and the filename.
* testsuite/systemtap.pass1-4/buildok-dyninst.exp: New test.
* testsuite/systemtap.pass1-4/buildko.exp: Add dyninst support.
* testsuite/systemtap.pass1-4/parseko.exp: Ditto.
* testsuite/systemtap.pass1-4/parseok.exp: Ditto.
* testsuite/systemtap.pass1-4/semko.exp: Ditto.
* testsuite/systemtap.pass1-4/semok.exp: Ditto.
* testsuite/systemtap.pass1-4/transko.exp: Ditto.
* testsuite/systemtap.pass1-4/transok.exp: Ditto.
* testsuite/buildok/cmdline01.stp: Allow extra args to be passed in.
* testsuite/buildok/fortytwo.stp: Ditto.
* testsuite/buildok/oldlocals01.stp: Ditto.
* testsuite/buildok/scsi-detailed.stp: Ditto.
* testsuite/buildok/thirtythree.stp: Ditto.
* testsuite/buildok/thirtytwo.stp: Ditto.
* testsuite/parseko/bad_tapset.stp: Ditto.
* testsuite/parseko/cmdline02.stp: Ditto.
* testsuite/parseko/cmdline03.stp: Ditto.
* testsuite/parseko/cmdline04.stp: Ditto.
* testsuite/parseko/cmdline06.stp: Ditto.
* testsuite/parseko/cmdline07.stp: Ditto.
* testsuite/parseko/cmdline08.stp: Ditto.
* testsuite/parseko/cmdline15.stp: Ditto.
* testsuite/parseko/cmdline22.stp: Ditto.
* testsuite/parseko/deprecated01.stp: Ditto.
* testsuite/parseko/preprocess13.stp: Ditto.
* testsuite/parseko/preprocess16.stp: Ditto.
* testsuite/parseko/preprocess17.stp: Ditto.
* testsuite/parseko/twentyseven.stp: Ditto.
* testsuite/parseko/twentythree.stp: Ditto.
* testsuite/parseok/all_tapsets.stp: Ditto.
* testsuite/parseok/bad_tapset.stp: Ditto.
* testsuite/parseok/cmdline01.stp: Ditto.
* testsuite/parseok/cmdline02.stp: Ditto.
* testsuite/parseok/deprecated01.stp: Ditto.
* testsuite/parseok/fourteen.stp: Ditto.
* testsuite/parseok/macros05.stp: Ditto.
* testsuite/parseok/macros08.stp: Ditto.
* testsuite/parseok/nineteen.stp: Ditto.
* testsuite/parseok/semko.stp: Ditto.
* testsuite/parseok/unparser.stp: Ditto.
* testsuite/semko/fifty.stp: Ditto.
* testsuite/semko/nodwf01.stp: Ditto.
* testsuite/semko/nodwf02.stp: Ditto.
* testsuite/semko/nodwf03.stp: Ditto.
* testsuite/semko/nodwf04.stp: Ditto.
* testsuite/semko/nodwf05.stp: Ditto.
* testsuite/semko/nodwf06.stp: Ditto.
* testsuite/semko/nodwf07.stp: Ditto.
* testsuite/semko/nodwf08.stp: Ditto.
* testsuite/semko/nodwf09.stp: Ditto.
* testsuite/semko/plt2.stp: Ditto.
* testsuite/semko/target_lvalue.stp: Ditto.
* testsuite/semok/args.stp: Ditto.
* testsuite/semok/badvar.stp: Ditto.
* testsuite/semok/badvar_undefined.stp: Ditto.
* testsuite/semok/bz11911.stp: Ditto.
* testsuite/semok/defined_list_vars.stp: Ditto.
* testsuite/semok/eight.stp: Ditto.
* testsuite/semok/nine.stp: Ditto.
* testsuite/semok/nodwf01.stp: Ditto.
* testsuite/semok/nodwf02.stp: Ditto.
* testsuite/semok/nodwf03.stp: Ditto.
* testsuite/semok/nodwf04.stp: Ditto.
* testsuite/semok/nodwf05.stp: Ditto.
* testsuite/semok/nodwf06.stp: Ditto.
* testsuite/semok/nodwf07.stp: Ditto.
* testsuite/semok/plt2.stp: Ditto.
* testsuite/semok/pr11808.stp: Ditto.
* testsuite/semok/pr11809.stp: Ditto.
* testsuite/semok/syscall_return.stp: Ditto.
* testsuite/semok/transko.stp: Ditto.
* testsuite/semok/twenty.stp: Ditto.
* testsuite/semok/twentyfive.stp: Ditto.
* testsuite/transok/buildko.stp: Ditto.
* testsuite/transok/eleven.stp: Ditto.
PR13693 groundwork: rewrite probefunc() solely in terms of [u]symname([u]stack(0)).
PR13693: typofix previous commit (yes, the change is tested).
Merge branch 'master' of github.com:flipreverse/systemtap-android-src
Replaced hardcoded kernel symbol "_stext" by a macro defined in runtime/k_syms.h
The macro is used by the runtime as well as the compilation components.
It is not guaranteed that this symbol is always called "_stext" on all archtitectures.
On powerpc64 for example its name is ".__start". Stap will not run on other architectures where this symbol has a different name because the lookup for "_stext" will fail.
Merge branch 'master' of git://sources.redhat.com/git/systemtap