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

Unified Diff: src/log.cc

Issue 1867383002: Revert of Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 e77799802156726b0630ce26452afc8b47ff53a1..93111a2e7eba008c025ccc141026cf38e7caf2c5 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -284,10 +284,11 @@
return;
}
- base::OS::FPrint(perf_output_handle_, "%p %x %.*s\n",
- code->instruction_start(), code->instruction_size(), length,
- name);
-}
+ base::OS::FPrint(perf_output_handle_, "%llx %x %.*s\n",
+ reinterpret_cast<uint64_t>(code->instruction_start()),
+ code->instruction_size(), length, name);
+}
+
// Low-level logging support.
#define LL_LOG(Call) if (ll_logger_) ll_logger_->Call;
@@ -788,7 +789,7 @@
void Logger::UncheckedIntPtrTEvent(const char* name, intptr_t value) {
if (!log_->IsEnabled()) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,%" V8PRIdPTR, name, value);
+ msg.Append("%s,%" V8_PTR_PREFIX "d", name, value);
msg.WriteToLogFile();
}
@@ -796,7 +797,7 @@
void Logger::HandleEvent(const char* name, Object** location) {
if (!log_->IsEnabled() || !FLAG_log_handles) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,%p", name, location);
+ msg.Append("%s,0x%" V8PRIxPTR, name, location);
msg.WriteToLogFile();
}
@@ -837,7 +838,7 @@
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,%d,%d", since_epoch, code->CodeSize());
+ msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize());
msg.WriteToLogFile();
}
@@ -847,7 +848,7 @@
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,%d", since_epoch);
+ msg.Append("current-time,%ld", since_epoch);
msg.WriteToLogFile();
}
@@ -1007,7 +1008,8 @@
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,%p,%u", name, object, static_cast<unsigned int>(size));
+ msg.Append("new,%s,0x%" V8PRIxPTR ",%u", name, object,
+ static_cast<unsigned int>(size));
msg.WriteToLogFile();
}
@@ -1015,7 +1017,7 @@
void Logger::DeleteEvent(const char* name, void* object) {
if (!log_->IsEnabled() || !FLAG_log) return;
Log::MessageBuilder msg(log_);
- msg.Append("delete,%s,%p", name, object);
+ msg.Append("delete,%s,0x%" V8PRIxPTR, name, object);
msg.WriteToLogFile();
}
@@ -1035,12 +1037,12 @@
} else {
Symbol* symbol = Symbol::cast(name);
if (symbol->name()->IsUndefined()) {
- msg.Append(",1,symbol(hash %x)", symbol->Hash());
+ msg.Append(",1,symbol(hash %x)", prefix, symbol->Hash());
} else {
base::SmartArrayPointer<char> str =
String::cast(symbol->name())
->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- msg.Append(",1,symbol(\"%s%s\" hash %x)", prefix, str.get(),
+ msg.Append(",1,symbol(\"%s\" hash %x)", prefix, str.get(),
symbol->Hash());
}
}
@@ -1384,7 +1386,7 @@
Log::MessageBuilder msg(log_);
msg.Append("%s,", kLogEventsNames[TICK_EVENT]);
msg.AppendAddress(sample->pc);
- msg.Append(",%d", static_cast<int>(timer_.Elapsed().InMicroseconds()));
+ msg.Append(",%ld", 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