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

Side by Side Diff: src/log.cc

Issue 1885033005: Portable Linux perf map formatting. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Mac OS X fix (cinttypes is in tr1 there). 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/log.h" 5 #include "src/log.h"
6 6
7 #include <inttypes.h>
7 #include <cstdarg> 8 #include <cstdarg>
8 #include <sstream> 9 #include <sstream>
9 10
10 #include "src/bailout-reason.h" 11 #include "src/bailout-reason.h"
11 #include "src/base/platform/platform.h" 12 #include "src/base/platform/platform.h"
12 #include "src/bootstrapper.h" 13 #include "src/bootstrapper.h"
13 #include "src/code-stubs.h" 14 #include "src/code-stubs.h"
14 #include "src/deoptimizer.h" 15 #include "src/deoptimizer.h"
15 #include "src/global-handles.h" 16 #include "src/global-handles.h"
16 #include "src/interpreter/bytecodes.h" 17 #include "src/interpreter/bytecodes.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 278
278 void PerfBasicLogger::LogRecordedBuffer(AbstractCode* code, SharedFunctionInfo*, 279 void PerfBasicLogger::LogRecordedBuffer(AbstractCode* code, SharedFunctionInfo*,
279 const char* name, int length) { 280 const char* name, int length) {
280 if (FLAG_perf_basic_prof_only_functions && 281 if (FLAG_perf_basic_prof_only_functions &&
281 (code->kind() != AbstractCode::FUNCTION && 282 (code->kind() != AbstractCode::FUNCTION &&
282 code->kind() != AbstractCode::INTERPRETED_FUNCTION && 283 code->kind() != AbstractCode::INTERPRETED_FUNCTION &&
283 code->kind() != AbstractCode::OPTIMIZED_FUNCTION)) { 284 code->kind() != AbstractCode::OPTIMIZED_FUNCTION)) {
284 return; 285 return;
285 } 286 }
286 287
287 base::OS::FPrint(perf_output_handle_, "%p %x %.*s\n", 288 base::OS::FPrint(perf_output_handle_, "%" PRIxPTR " %x %.*s\n",
Jarin 2016/04/14 12:16:53 Couldn't you use V8PRIxPTR?
Stefano Sanfilippo 2016/04/14 12:31:54 Done.
288 code->instruction_start(), code->instruction_size(), length, 289 reinterpret_cast<uintptr_t>(code->instruction_start()),
289 name); 290 code->instruction_size(), length, name);
290 } 291 }
291 292
292 // Low-level logging support. 293 // Low-level logging support.
293 #define LL_LOG(Call) if (ll_logger_) ll_logger_->Call; 294 #define LL_LOG(Call) if (ll_logger_) ll_logger_->Call;
294 295
295 class LowLevelLogger : public CodeEventLogger { 296 class LowLevelLogger : public CodeEventLogger {
296 public: 297 public:
297 explicit LowLevelLogger(const char* file_name); 298 explicit LowLevelLogger(const char* file_name);
298 ~LowLevelLogger() override; 299 ~LowLevelLogger() override;
299 300
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1848 removeCodeEventListener(jit_logger_); 1849 removeCodeEventListener(jit_logger_);
1849 delete jit_logger_; 1850 delete jit_logger_;
1850 jit_logger_ = NULL; 1851 jit_logger_ = NULL;
1851 } 1852 }
1852 1853
1853 return log_->Close(); 1854 return log_->Close();
1854 } 1855 }
1855 1856
1856 } // namespace internal 1857 } // namespace internal
1857 } // namespace v8 1858 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698