From: Michael Neuling Date: Mon, 13 May 2013 18:44:58 +0000 (+0000) Subject: powerpc/perf: Fix setting of "to" addresses for BHRB X-Git-Tag: v3.10-rc2~31^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=691231846cebfe1fbbcf898c8af17a569dbb5463;p=pandora-kernel.git powerpc/perf: Fix setting of "to" addresses for BHRB Currently we only set the "to" address in the branch stack when the CPU explicitly gives us a value. Unfortunately it only does this for XL form branches (eg blr, bctr, bctar) and not I and B form branches (eg b, bc). Fortunately if we read the instruction from memory we can extract the offset of a branch and calculate the target address. This adds a function power_pmu_bhrb_to() to calculate the target/to address of the corresponding I and B form branches. It handles branches in both user and kernel spaces. It also plumbs this into the perf brhb reading code. Signed-off-by: Michael Neuling Signed-off-by: Benjamin Herrenschmidt --- Reading git-diff-tree failed