Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#include "tracy_noop.h"

#if RNCXX_WITH_PROFILING_PROVIDER
HZT_DEFINE_STATIC_STORAGE(facebook::react);
#endif
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,30 @@
#endif

#if RNCXX_WITH_PROFILING_PROVIDER
#include <hz_tracing/TracingMacros.h>

#define SCOPED_TRACE_CPU_AUTO() \
HZT_TRACE_SCOPE_AUTO( \
::horizon::tracing::TraceLevel::Important, \
::horizon::tracing::EventCategory::Update, \
"react_native", \
::horizon::tracing::DestinationFlag::Default);

#define SCOPED_TRACE_CPU(name) \
HZT_TRACE_SCOPE( \
name, \
::horizon::tracing::TraceLevel::Important, \
::horizon::tracing::EventCategory::Update, \
"react_native", \
::horizon::tracing::DestinationFlag::Default);
#include <hz_tracing/v2/TracingMacros.h>

#ifndef TRACE_FUNCTION
#if defined(__GNUC__) || defined(__clang__)
#define TRACE_FUNCTION __PRETTY_FUNCTION__
#else
#define TRACE_FUNCTION __FUNCTION__
#endif
#endif // TRACE_FUNCTION

static inline constexpr char kTraceCategory[] = "react_native";

HZT_DEFINE_TRACING_CATEGORIES(
facebook::react,
horizon::tracing::v2::Category(
kTraceCategory,
"react_native",
horizon::tracing::v2::StrippingLevel::Important));

#define SCOPED_TRACE_CPU_AUTO() \
HZT_TRACE_SCOPE_NS_V2(::facebook::react, kTraceCategory, TRACE_FUNCTION);

#define SCOPED_TRACE_CPU(name) \
HZT_TRACE_SCOPE_NS_V2(::facebook::react, kTraceCategory, name);

#else
#ifndef SCOPED_TRACE_CPU_AUTO
Expand Down