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

Side by Side Diff: src/log.h

Issue 186163002: Add support for allowing an embedder to get the V8 profile timer event logs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Renamings Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } while (false) 92 } while (false)
93 93
94 #define LOG_CODE_EVENT(isolate, Call) \ 94 #define LOG_CODE_EVENT(isolate, Call) \
95 do { \ 95 do { \
96 v8::internal::Logger* logger = \ 96 v8::internal::Logger* logger = \
97 (isolate)->logger(); \ 97 (isolate)->logger(); \
98 if (logger->is_logging_code_events()) \ 98 if (logger->is_logging_code_events()) \
99 logger->Call; \ 99 logger->Call; \
100 } while (false) 100 } while (false)
101 101
102 #define LOG_EVENT_BEGIN(isolate, name) \
103 if ((isolate)->event_logger()) \
104 (isolate)->event_logger()(name, 0)
Sven Panne 2014/03/05 07:47:29 Parenthesize "name" and never ever use unbalanced
Yang 2014/03/05 08:18:31 Agree.
fmeawad 2014/03/06 00:24:46 Moved to an inlined function in Patch 5, and total
105
106 #define LOG_EVENT_END(isolate, name) \
107 if ((isolate)->event_logger()) \
108 (isolate)->event_logger()(name, 1)
102 109
103 #define LOG_EVENTS_AND_TAGS_LIST(V) \ 110 #define LOG_EVENTS_AND_TAGS_LIST(V) \
104 V(CODE_CREATION_EVENT, "code-creation") \ 111 V(CODE_CREATION_EVENT, "code-creation") \
105 V(CODE_MOVE_EVENT, "code-move") \ 112 V(CODE_MOVE_EVENT, "code-move") \
106 V(CODE_DELETE_EVENT, "code-delete") \ 113 V(CODE_DELETE_EVENT, "code-delete") \
107 V(CODE_MOVING_GC, "code-moving-gc") \ 114 V(CODE_MOVING_GC, "code-moving-gc") \
108 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ 115 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \
109 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ 116 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \
110 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \ 117 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \
111 V(TICK_EVENT, "tick") \ 118 V(TICK_EVENT, "tick") \
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 320
314 void TimerEvent(StartEnd se, const char* name); 321 void TimerEvent(StartEnd se, const char* name);
315 322
316 static void EnterExternal(Isolate* isolate); 323 static void EnterExternal(Isolate* isolate);
317 static void LeaveExternal(Isolate* isolate); 324 static void LeaveExternal(Isolate* isolate);
318 325
319 class TimerEventScope { 326 class TimerEventScope {
320 public: 327 public:
321 TimerEventScope(Isolate* isolate, const char* name) 328 TimerEventScope(Isolate* isolate, const char* name)
322 : isolate_(isolate), name_(name) { 329 : isolate_(isolate), name_(name) {
323 if (FLAG_log_internal_timer_events) LogTimerEvent(START); 330 LogTimerEvent(START);
Yang 2014/03/05 08:18:31 I'm concerned that this may regress performance si
fmeawad 2014/03/06 00:24:46 As you mentioned, I am only including those for th
324 } 331 }
325 332
326 ~TimerEventScope() { 333 ~TimerEventScope() {
327 if (FLAG_log_internal_timer_events) LogTimerEvent(END); 334 LogTimerEvent(END);
328 } 335 }
329 336
330 void LogTimerEvent(StartEnd se); 337 void LogTimerEvent(StartEnd se);
331 338
332 static const char* v8_recompile_synchronous; 339 static const char* v8_recompile_synchronous;
333 static const char* v8_recompile_concurrent; 340 static const char* v8_recompile_concurrent;
334 static const char* v8_compile_full_code; 341 static const char* v8_compile_full_code;
335 static const char* v8_execute; 342 static const char* v8_execute;
336 static const char* v8_external; 343 static const char* v8_external;
337 344
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 int length) = 0; 544 int length) = 0;
538 545
539 NameBuffer* name_buffer_; 546 NameBuffer* name_buffer_;
540 }; 547 };
541 548
542 549
543 } } // namespace v8::internal 550 } } // namespace v8::internal
544 551
545 552
546 #endif // V8_LOG_H_ 553 #endif // V8_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698