perf stat: Add computation of TopDown formulas

Implement the TopDown formulas in perf stat. The topdown basic metrics
reported by the kernel are collected, and the formulas are computed
and output as normal metrics.

See the kernel commit exporting the events for details on the used
metrics.

v2: Always print all metrics, only use thresholds for coloring.
v3: Mark retiring over threshold green, not red.
v4:
Only print one decimal digit
Fix color printing of one metric
v5: Avoid printing -0.0
Signed-off-by: Andi Kleen <ak@linux.intel.com>
3 files changed