Fix PR17055 by reading perf values in a sleepable context.
* tapsets.cxx (common_probe_entryfn_prologue): Add 'declaration_callback'
and 'pre_context_callback' to allow callers to add to output prologue.
(dwarf_derived_probe::emit_probe_local_init): For perf values, instead
of reading the values here, just copy the values from where we stashed
them when we read them before (when we could sleep).
(uprobe_derived_probe::emit_perf_read_handler): New function.
(uprobe_derived_probe_group::emit_module_perf_read_handlers): Ditto.
(udpg_entryfn_prologue_declaration_callback): Ditto.
(udpg_entryfn_prologue_pre_context_callback): Ditto.
(uprobe_derived_probe_group::emit_module_utrace_decls): Call
new function emit_module_perf_read_handlers().
(uprobe_derived_probe_group::emit_module_decls): Figure out the maximun
number of perf counters used per probe.
* tapsets.h: Add new callbacks to common_probe_entryfn_prologue().
* runtime/linux/uprobes-common.h (stap_uprobe_spec): Add
'perf_read_handler' to actually read perf values.
* runtime/linux/uprobes-inode.c (stapiu_consumer): Ditto.
* runtime/linux/runtime.h: After loading the task_finder code, load the
perf code if needed.
* runtime/common_probe_context.h: Add 'perf_read_values' to the context
structure when we're using perf derived probes.
* testsuite/systemtap.base/perf.sh: Change '/usr/bin/cat' to '/bin/cat' so
that systems (like RHEL6) that don't have 'usrmove' will still work.