/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCxxPlatform/react/profiling/perfetto.h
38 строк
928 B
Pieter De Baets
Namespace Perfetto usage (#53424)
25 авг 2025, 21:16
25 авг 2025, 21:16
870836f
Код
Авторство
О чём код?
/* * 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. */ #pragma once #include <react/profiling/tracy_noop.h> #include <cstdint> #ifndef WITH_PERFETTO #define WITH_PERFETTO 0 #endif #if WITH_PERFETTO #include <perfetto.h> PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE( facebook::react, perfetto::Category("rncxx").SetDescription("Events from RN/Granite")); void initializePerfetto(); inline uint64_t getCurrentPerfettoTimestamp() { return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch()) .count(); } #else #define TRACE_EVENT(category, name, ...) SCOPED_TRACE_CPU((category "_" name)) #define TRACE_COUNTER(category, name, value, ...) inline void initializePerfetto() {} #endif // WITH_PERFETTO