|
12 | 12 | #endif
|
13 | 13 |
|
14 | 14 | #if RNCXX_WITH_PROFILING_PROVIDER
|
15 |
| -#include <hz_tracing/TracingMacros.h> |
16 |
| - |
17 |
| -#define SCOPED_TRACE_CPU_AUTO() \ |
18 |
| - HZT_TRACE_SCOPE_AUTO( \ |
19 |
| - ::horizon::tracing::TraceLevel::Important, \ |
20 |
| - ::horizon::tracing::EventCategory::Update, \ |
21 |
| - "react_native", \ |
22 |
| - ::horizon::tracing::DestinationFlag::Default); |
23 |
| - |
24 |
| -#define SCOPED_TRACE_CPU(name) \ |
25 |
| - HZT_TRACE_SCOPE( \ |
26 |
| - name, \ |
27 |
| - ::horizon::tracing::TraceLevel::Important, \ |
28 |
| - ::horizon::tracing::EventCategory::Update, \ |
29 |
| - "react_native", \ |
30 |
| - ::horizon::tracing::DestinationFlag::Default); |
| 15 | +#include <hz_tracing/v2/TracingMacros.h> |
| 16 | + |
| 17 | +#ifndef TRACE_FUNCTION |
| 18 | +#if defined(__GNUC__) || defined(__clang__) |
| 19 | +#define TRACE_FUNCTION __PRETTY_FUNCTION__ |
| 20 | +#else |
| 21 | +#define TRACE_FUNCTION __FUNCTION__ |
| 22 | +#endif |
| 23 | +#endif // TRACE_FUNCTION |
| 24 | + |
| 25 | +static inline constexpr char kTraceCategory[] = "react_native"; |
| 26 | + |
| 27 | +HZT_DEFINE_TRACING_CATEGORIES( |
| 28 | + facebook::react, |
| 29 | + horizon::tracing::v2::Category( |
| 30 | + kTraceCategory, |
| 31 | + "react_native", |
| 32 | + horizon::tracing::v2::StrippingLevel::Important)); |
| 33 | + |
| 34 | +#define SCOPED_TRACE_CPU_AUTO() \ |
| 35 | + HZT_TRACE_SCOPE_NS_V2(::facebook::react, kTraceCategory, TRACE_FUNCTION); |
| 36 | + |
| 37 | +#define SCOPED_TRACE_CPU(name) \ |
| 38 | + HZT_TRACE_SCOPE_NS_V2(::facebook::react, kTraceCategory, name); |
31 | 39 |
|
32 | 40 | #else
|
33 | 41 | #ifndef SCOPED_TRACE_CPU_AUTO
|
|
0 commit comments