#ifndef CHROMECAST_TRACING_SYSTEM_TRACER_H_
#define CHROMECAST_TRACING_SYSTEM_TRACER_H_
#include <memory>
#include <string>
#include <string_view>
#include "base/files/file_descriptor_watcher_posix.h"
#include "base/files/scoped_file.h"
#include "base/functional/callback.h"
namespace chromecast {
class SystemTracer {
public:
static std::unique_ptr<SystemTracer> Create();
SystemTracer(const SystemTracer&) = delete;
SystemTracer& operator=(const SystemTracer&) = delete;
virtual ~SystemTracer() = default;
enum class Status {
OK,
KEEP_GOING,
FAIL,
};
using StartTracingCallback = base::OnceCallback<void(Status)>;
using StopTracingCallback =
base::RepeatingCallback<void(Status status, std::string trace_data)>;
virtual void StartTracing(std::string_view categories,
StartTracingCallback callback) = 0;
virtual void StopTracing(const StopTracingCallback& callback) = 0;
protected:
SystemTracer() = default;
};
}
#endif