]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
perf intel-pt: Fix premature IPC
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 5 Feb 2021 17:53:48 +0000 (19:53 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 15 Mar 2021 14:09:28 +0000 (15:09 +0100)
commit05e4849d0962ce592765e8ca317d271a6cda07c0
treef110cc9c1d192b3c17e0f79767bae4bfa9bf9c6f
parent4d91fd054647bbca34b2792b320ffe5649ab2abe
perf intel-pt: Fix premature IPC

[ Upstream commit 20aa39708a5999b7921b27482a756766272286ac ]

The code assumed a change in cycle count means accurate IPC. That is not
correct, for example when sampling both branches and instructions, or at
a FUP packet (which is not CYC-eligible) address. Fix by using an explicit
flag to indicate when IPC can be sampled.

Fixes: 5b1dc0fd1da06 ("perf intel-pt: Add support for samples to contain IPC ratio")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20210205175350.23817-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
tools/perf/util/intel-pt.c