mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Instead, we can just concatenate the records together, which means you can view the generated trace file without post-processing. Also, I've made the trace file world-readable, so that you can trace a device without needing root access.
33 lines
947 B
C++
33 lines
947 B
C++
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "sky/shell/android/tracing_controller.h"
|
|
|
|
#include "base/android/jni_android.h"
|
|
#include "base/android/jni_string.h"
|
|
#include "base/files/file_path.h"
|
|
#include "base/macros.h"
|
|
#include "jni/TracingController_jni.h"
|
|
#include "sky/shell/shell.h"
|
|
#include "sky/shell/tracing_controller.h"
|
|
|
|
namespace sky {
|
|
namespace shell {
|
|
|
|
static void StartTracing(JNIEnv* env, jclass clazz) {
|
|
Shell::Shared().tracing_controller().StartTracing();
|
|
}
|
|
|
|
static void StopTracing(JNIEnv* env, jclass clazz, jstring path) {
|
|
base::FilePath file_path(base::android::ConvertJavaStringToUTF8(env, path));
|
|
Shell::Shared().tracing_controller().StopTracing(file_path);
|
|
}
|
|
|
|
bool RegisterTracingController(JNIEnv* env) {
|
|
return RegisterNativesImpl(env);
|
|
}
|
|
|
|
} // namespace shell
|
|
} // namespace sky
|