/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCxxPlatform/react/profiling/perfetto.cpp
30 строк
751 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. */ #include <react/profiling/perfetto.h> #if WITH_PERFETTO #include <mutex> void initializePerfetto() { static std::once_flag s_PerfettoIsInitialized; std::call_once(s_PerfettoIsInitialized, []() { perfetto::TracingInitArgs args; args.shmem_size_hint_kb = 20 * 1024; #ifdef ANDROID args.backends |= perfetto::kSystemBackend; #else args.backends |= perfetto::kInProcessBackend; #endif args.use_monotonic_clock = true; perfetto::Tracing::Initialize(args); facebook::react::TrackEvent::Register(); }); } #endif // WITH_PERFETTO