Remove {PerfBasicLogger} on non-linux
This is a follow-up to https://crrev.com/c/1993969. --perf-basic-prof is only supported on linux platforms, thus the {PerfBasicLogger} class does not need to be compiled on other platforms. R=ahaas@chromium.org Bug: chromium:1035233 Change-Id: Ic84fb6922f6c4ea5147ba7b54fbf43e557d6d792 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1993978 Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/master@{#65703}
This commit is contained in:
parent
d67a44bf74
commit
d987e45d57
@ -262,7 +262,8 @@ void CodeEventLogger::RegExpCodeCreateEvent(Handle<AbstractCode> code,
|
||||
name_buffer_->get(), name_buffer_->size());
|
||||
}
|
||||
|
||||
// Linux perf tool logging support
|
||||
// Linux perf tool logging support.
|
||||
#if V8_OS_LINUX
|
||||
class PerfBasicLogger : public CodeEventLogger {
|
||||
public:
|
||||
explicit PerfBasicLogger(Isolate* isolate);
|
||||
@ -343,6 +344,7 @@ void PerfBasicLogger::LogRecordedBuffer(const wasm::WasmCode* code,
|
||||
WriteLogRecordedBuffer(static_cast<uintptr_t>(code->instruction_start()),
|
||||
code->instructions().length(), name, length);
|
||||
}
|
||||
#endif // V8_OS_LINUX
|
||||
|
||||
// External CodeEventListener
|
||||
ExternalCodeEventListener::ExternalCodeEventListener(Isolate* isolate)
|
||||
@ -1911,12 +1913,12 @@ bool Logger::SetUp(Isolate* isolate) {
|
||||
PrepareLogFileName(log_file_name, isolate, FLAG_logfile);
|
||||
log_ = std::make_unique<Log>(this, log_file_name.str().c_str());
|
||||
|
||||
#if V8_OS_LINUX
|
||||
if (FLAG_perf_basic_prof) {
|
||||
perf_basic_logger_ = std::make_unique<PerfBasicLogger>(isolate);
|
||||
AddCodeEventListener(perf_basic_logger_.get());
|
||||
}
|
||||
|
||||
#if V8_OS_LINUX
|
||||
if (FLAG_perf_prof) {
|
||||
perf_jit_logger_ = std::make_unique<PerfJitLogger>(isolate);
|
||||
AddCodeEventListener(perf_jit_logger_.get());
|
||||
@ -1925,6 +1927,9 @@ bool Logger::SetUp(Isolate* isolate) {
|
||||
static_assert(
|
||||
!FLAG_perf_prof,
|
||||
"--perf-prof should be statically disabled on non-Linux platforms");
|
||||
static_assert(
|
||||
!FLAG_perf_basic_prof,
|
||||
"--perf-basic-prof should be statically disabled on non-Linux platforms");
|
||||
#endif
|
||||
|
||||
if (FLAG_ll_prof) {
|
||||
@ -1993,12 +1998,12 @@ FILE* Logger::TearDown() {
|
||||
|
||||
ticker_.reset();
|
||||
|
||||
#if V8_OS_LINUX
|
||||
if (perf_basic_logger_) {
|
||||
RemoveCodeEventListener(perf_basic_logger_.get());
|
||||
perf_basic_logger_.reset();
|
||||
}
|
||||
|
||||
#if V8_OS_LINUX
|
||||
if (perf_jit_logger_) {
|
||||
RemoveCodeEventListener(perf_jit_logger_.get());
|
||||
perf_jit_logger_.reset();
|
||||
|
@ -316,8 +316,8 @@ class Logger : public CodeEventListener {
|
||||
|
||||
bool is_logging_;
|
||||
std::unique_ptr<Log> log_;
|
||||
std::unique_ptr<PerfBasicLogger> perf_basic_logger_;
|
||||
#if V8_OS_LINUX
|
||||
std::unique_ptr<PerfBasicLogger> perf_basic_logger_;
|
||||
std::unique_ptr<PerfJitLogger> perf_jit_logger_;
|
||||
#endif
|
||||
std::unique_ptr<LowLevelLogger> ll_logger_;
|
||||
|
Loading…
Reference in New Issue
Block a user