OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Tests of logging functions from log.h | 3 // Tests of logging functions from log.h |
4 | 4 |
5 #ifdef ENABLE_LOGGING_AND_PROFILING | 5 #ifdef ENABLE_LOGGING_AND_PROFILING |
6 | 6 |
7 #ifdef __linux__ | 7 #ifdef __linux__ |
8 #include <math.h> | 8 #include <math.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <signal.h> | 10 #include <signal.h> |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 log_pos = GetLogLines(log_pos, &buffer); | 517 log_pos = GetLogLines(log_pos, &buffer); |
518 CHECK_GT(log_pos, 0); | 518 CHECK_GT(log_pos, 0); |
519 buffer[log_pos] = 0; | 519 buffer[log_pos] = 0; |
520 | 520 |
521 const char* callback_rec = "code-creation,Callback,"; | 521 const char* callback_rec = "code-creation,Callback,"; |
522 char* pos = strstr(buffer.start(), callback_rec); | 522 char* pos = strstr(buffer.start(), callback_rec); |
523 CHECK_NE(NULL, pos); | 523 CHECK_NE(NULL, pos); |
524 pos += strlen(callback_rec); | 524 pos += strlen(callback_rec); |
525 EmbeddedVector<char, 100> ref_data; | 525 EmbeddedVector<char, 100> ref_data; |
526 i::OS::SNPrintF(ref_data, | 526 i::OS::SNPrintF(ref_data, |
527 "0x%" V8PRIxPTR ",0,\"method1\"", ObjMethod1); | 527 "0x%" V8PRIxPTR ",1,\"method1\"", ObjMethod1); |
528 *(pos + strlen(ref_data.start())) = '\0'; | 528 *(pos + strlen(ref_data.start())) = '\0'; |
529 CHECK_EQ(ref_data.start(), pos); | 529 CHECK_EQ(ref_data.start(), pos); |
530 | 530 |
531 obj.Dispose(); | 531 obj.Dispose(); |
532 | 532 |
533 env->Exit(); | 533 env->Exit(); |
534 Logger::TearDown(); | 534 Logger::TearDown(); |
535 i::FLAG_prof_lazy = saved_prof_lazy; | 535 i::FLAG_prof_lazy = saved_prof_lazy; |
536 i::FLAG_prof = saved_prof; | 536 i::FLAG_prof = saved_prof; |
537 i::FLAG_prof_auto = saved_prof_auto; | 537 i::FLAG_prof_auto = saved_prof_auto; |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 // Make sure that all log data is written prior crash due to CHECK failure. | 997 // Make sure that all log data is written prior crash due to CHECK failure. |
998 fflush(stdout); | 998 fflush(stdout); |
999 CHECK(results_equal); | 999 CHECK(results_equal); |
1000 | 1000 |
1001 env->Exit(); | 1001 env->Exit(); |
1002 Logger::TearDown(); | 1002 Logger::TearDown(); |
1003 i::FLAG_always_compact = saved_always_compact; | 1003 i::FLAG_always_compact = saved_always_compact; |
1004 } | 1004 } |
1005 | 1005 |
1006 #endif // ENABLE_LOGGING_AND_PROFILING | 1006 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |