tcg: distribute tcg_time into TCG contexts

When we implemented per-vCPU TCG contexts, we forgot to also
distribute the tcg_time counter, which has remained as a global
accessed without any serialization, leading to potentially missed
counts.

Fix it by distributing the field over the TCG contexts, embedding
it into TCGProfile with a field called "cpu_exec_time", which is more
descriptive than "tcg_time". Add a function to query this value
directly, and for completeness, fill in the field in
tcg_profile_snapshot, even though its callers do not use it.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <20181010144853.13005-5-cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Emilio G. Cota 2018-10-10 10:48:53 -04:00 committed by Richard Henderson
parent dd1d7da23b
commit 72fd2efbbd
5 changed files with 37 additions and 5 deletions

View file

@ -1046,7 +1046,6 @@ static inline int64_t profile_getclock(void)
return get_clock();
}
extern int64_t tcg_time;
extern int64_t dev_time;
#endif