5#ifndef V8_DIAGNOSTICS_CODE_TRACER_H_
6#define V8_DIAGNOSTICS_CODE_TRACER_H_
30 if (
v8_flags.redirect_code_traces_to !=
nullptr) {
31 base::StrNCpy(filename_, v8_flags.redirect_code_traces_to,
33 }
else if (isolate_id >= 0) {
48 FILE*
file()
const {
return tracer_->file(); }
57 FILE* file = this->
file();
59 stdout_stream_.emplace();
61 file_stream_.emplace(file);
66 if (stdout_stream_.has_value())
return stdout_stream_.value();
67 return file_stream_.value();
81 if (
file_ ==
nullptr) {
84 "could not open file. If on Android, try passing "
85 "--redirect-code-traces-to=/sdcard/Download/<file-name>");
static FILE * FOpen(const char *path, const char *mode)
static int GetCurrentProcessId()
constexpr T * begin() const
Scope(CodeTracer *tracer)
StreamScope(CodeTracer *tracer)
std::optional< StdoutStream > stdout_stream_
std::optional< OFStream > file_stream_
CodeTracer(int isolate_id)
static bool ShouldRedirect()
base::EmbeddedVector< char, 128 > filename_
int SNPrintF(Vector< char > str, const char *format,...)
int WriteChars(const char *filename, const char *str, int size, bool verbose)
V8_EXPORT_PRIVATE FlagValues v8_flags
#define CHECK_WITH_MSG(condition, message)
#define DCHECK_NOT_NULL(val)