From 24fca432ab95010d7fd15c8798da96e94d0c1478 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Wed, 8 Mar 2023 14:49:08 +0100 Subject: [PATCH] util/perf: C++-proof util/perf Signed-off-by: Danylo Piliaiev Reviewed-by: Jesse Natalie Part-of: --- src/util/perf/cpu_trace.h | 2 +- src/util/perf/u_trace_priv.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/perf/cpu_trace.h b/src/util/perf/cpu_trace.h index c13a382..bca056a 100644 --- a/src/util/perf/cpu_trace.h +++ b/src/util/perf/cpu_trace.h @@ -77,7 +77,7 @@ static inline void _mesa_trace_scope_end(int *scope) { /* we save the category in the scope variable */ - _MESA_TRACE_END(*scope); + _MESA_TRACE_END((enum util_perfetto_category) *scope); } #else diff --git a/src/util/perf/u_trace_priv.h b/src/util/perf/u_trace_priv.h index 9804fa3..25dc07c 100644 --- a/src/util/perf/u_trace_priv.h +++ b/src/util/perf/u_trace_priv.h @@ -36,6 +36,10 @@ * Internal interface used by generated tracepoints */ +#ifdef __cplusplus +extern "C" { +#endif + /** * Tracepoint descriptor. */ @@ -71,6 +75,8 @@ u_trace_append(struct u_trace *ut, void *cs, const struct u_tracepoint *tp) return u_trace_appendv(ut, cs, tp, 0); } - +#ifdef __cplusplus +} +#endif #endif /* _U_TRACE_PRIV_H */ -- 2.7.4