The perf compilation fails with following error:
...
CC arch/x86/util/tsc.o
arch/x86/util/tsc.c: In function âperf_time_to_tscâ:
arch/x86/util/tsc.c:13:6: error: declaration of âtimeâ shadows a global declaration [-Werror=shadow]
cc1: all warnings being treated as errors
Renaming the 'time' variable to prevent this.
Signed-off-by: Jiri Olsa<jolsa@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo<acme@xxxxxxxxxx>
Cc: Corey Ashford<cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: Ingo Molnar<mingo@xxxxxxx>
Cc: Paul Mackerras<paulus@xxxxxxxxx>
Cc: Peter Zijlstra<a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo<acme@xxxxxxxxxx>
Cc: David Ahern<dsahern@xxxxxxxxx>
Cc: Adrian Hunter<adrian.hunter@xxxxxxxxx>
---
tools/perf/arch/x86/util/tsc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
index f111744..9570c2b 100644
--- a/tools/perf/arch/x86/util/tsc.c
+++ b/tools/perf/arch/x86/util/tsc.c
@@ -10,11 +10,11 @@
u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
{
- u64 time, quot, rem;
+ u64 t, quot, rem;
- time = ns - tc->time_zero;
- quot = time / tc->time_mult;
- rem = time % tc->time_mult;
+ t = ns - tc->time_zero;
+ quot = t / tc->time_mult;
+ rem = t % tc->time_mult;
return (quot<< tc->time_shift) +
(rem<< tc->time_shift) / tc->time_mult;
}