Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: src/log.cc

Issue 1872203005: Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unused param found by GC mole Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.h ('k') | src/log-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index 93111a2e7eba008c025ccc141026cf38e7caf2c5..e77799802156726b0630ce26452afc8b47ff53a1 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -284,12 +284,11 @@ void PerfBasicLogger::LogRecordedBuffer(AbstractCode* code, SharedFunctionInfo*,
return;
}
- base::OS::FPrint(perf_output_handle_, "%llx %x %.*s\n",
- reinterpret_cast<uint64_t>(code->instruction_start()),
- code->instruction_size(), length, name);
+ base::OS::FPrint(perf_output_handle_, "%p %x %.*s\n",
+ code->instruction_start(), code->instruction_size(), length,
+ name);
}
-
// Low-level logging support.
#define LL_LOG(Call) if (ll_logger_) ll_logger_->Call;
@@ -789,7 +788,7 @@ void Logger::UncheckedIntEvent(const char* name, int value) {
void Logger::UncheckedIntPtrTEvent(const char* name, intptr_t value) {
if (!log_->IsEnabled()) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,%" V8_PTR_PREFIX "d", name, value);
+ msg.Append("%s,%" V8PRIdPTR, name, value);
msg.WriteToLogFile();
}
@@ -797,7 +796,7 @@ void Logger::UncheckedIntPtrTEvent(const char* name, intptr_t value) {
void Logger::HandleEvent(const char* name, Object** location) {
if (!log_->IsEnabled() || !FLAG_log_handles) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,0x%" V8PRIxPTR, name, location);
+ msg.Append("%s,%p", name, location);
msg.WriteToLogFile();
}
@@ -838,7 +837,7 @@ void Logger::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) {
if (!log_->IsEnabled() || !FLAG_log_internal_timer_events) return;
Log::MessageBuilder msg(log_);
int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
- msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize());
+ msg.Append("code-deopt,%d,%d", since_epoch, code->CodeSize());
msg.WriteToLogFile();
}
@@ -848,7 +847,7 @@ void Logger::CurrentTimeEvent() {
DCHECK(FLAG_log_timer_events || FLAG_prof_cpp);
Log::MessageBuilder msg(log_);
int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
- msg.Append("current-time,%ld", since_epoch);
+ msg.Append("current-time,%d", since_epoch);
msg.WriteToLogFile();
}
@@ -1008,8 +1007,7 @@ void Logger::ApiEntryCall(const char* name) {
void Logger::NewEvent(const char* name, void* object, size_t size) {
if (!log_->IsEnabled() || !FLAG_log) return;
Log::MessageBuilder msg(log_);
- msg.Append("new,%s,0x%" V8PRIxPTR ",%u", name, object,
- static_cast<unsigned int>(size));
+ msg.Append("new,%s,%p,%u", name, object, static_cast<unsigned int>(size));
msg.WriteToLogFile();
}
@@ -1017,7 +1015,7 @@ void Logger::NewEvent(const char* name, void* object, size_t size) {
void Logger::DeleteEvent(const char* name, void* object) {
if (!log_->IsEnabled() || !FLAG_log) return;
Log::MessageBuilder msg(log_);
- msg.Append("delete,%s,0x%" V8PRIxPTR, name, object);
+ msg.Append("delete,%s,%p", name, object);
msg.WriteToLogFile();
}
@@ -1037,12 +1035,12 @@ void Logger::CallbackEventInternal(const char* prefix, Name* name,
} else {
Symbol* symbol = Symbol::cast(name);
if (symbol->name()->IsUndefined()) {
- msg.Append(",1,symbol(hash %x)", prefix, symbol->Hash());
+ msg.Append(",1,symbol(hash %x)", symbol->Hash());
} else {
base::SmartArrayPointer<char> str =
String::cast(symbol->name())
->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- msg.Append(",1,symbol(\"%s\" hash %x)", prefix, str.get(),
+ msg.Append(",1,symbol(\"%s%s\" hash %x)", prefix, str.get(),
symbol->Hash());
}
}
@@ -1386,7 +1384,7 @@ void Logger::TickEvent(TickSample* sample, bool overflow) {
Log::MessageBuilder msg(log_);
msg.Append("%s,", kLogEventsNames[TICK_EVENT]);
msg.AppendAddress(sample->pc);
- msg.Append(",%ld", static_cast<int>(timer_.Elapsed().InMicroseconds()));
+ msg.Append(",%d", static_cast<int>(timer_.Elapsed().InMicroseconds()));
if (sample->has_external_callback) {
msg.Append(",1,");
msg.AppendAddress(sample->external_callback_entry);
« no previous file with comments | « src/log.h ('k') | src/log-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698