trace: add some tcg tracing support

This adds a couple of tcg specific trace-events which are useful for
tracing execution though tcg generated blocks. It's been tested with
lttng user space tracing but is generic enough for all systems. The tcg
events are:

  * translate_block - when a subject block is translated
  * exec_tb - when a translated block is entered
  * exec_tb_exit - when we exit the translated code
  * exec_tb_nocache - special case translations

Of course we can only trace the entrance to the first block of a chain
as each block will jump directly to the next when it can. See the -d
nochain patch to allow more complete tracing at the expense of
performance.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2
  - rebase

v3:
  - checkpatch clean-ups
  - add sign-off
  - disable exec_tb by default
trace: instrument and trace tcg tb flush activity

The tb_find_fast path is important to quickly moving from one block to
the next. However we need to flush it when tlb changes occur so it's
important to know how well we are doing with the cache.

This patch adds some basic hit/miss profiling to the tb_find_fast
tracepoint as well as a number of other tb_ related areas. I've also
added a trace_inc_counter() helper which gets inlined away when tracing
is disabled.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2:
 - fix braces around trace_inc_counter
 - direct in-place increment
 - only one def of inline function
 - fix column overflow
trace: instrument and trace tcg tb flush activity

The tb_find_fast path is important to quickly moving from one block to
the next. However we need to flush it when tlb changes occur so it's
important to know how well we are doing with the cache.

This patch adds some basic hit/miss profiling to the tb_find_fast
tracepoint as well as a number of other tb_ related areas. I've also
added a trace_inc_counter() helper which gets inlined away when tracing
is disabled.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2:
 - fix braces around trace_inc_counter
 - direct in-place increment
 - only one def of inline function
 - fix column overflow
 - use unsigned ints for counters
trace: tcg: instrument tb_find_slow()

This adds a trace-event (disabled by default) to tb_find_slow() that
will trace the event and instrument the number of searches it took to
get to the final TB.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
translate-all.c: add aarch64 CONTEXTIDR to perf.map (!UPSTREAM)

This makes it easier to identify the user space PID in question.