OLD | NEW |
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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 return; | 671 return; |
672 } | 672 } |
673 if (v8::Locker::IsActive() && | 673 if (v8::Locker::IsActive() && |
674 !isolate->thread_manager()->IsLockedByCurrentThread()) { | 674 !isolate->thread_manager()->IsLockedByCurrentThread()) { |
675 return; | 675 return; |
676 } | 676 } |
677 | 677 |
678 Sampler* sampler = isolate->logger()->sampler(); | 678 Sampler* sampler = isolate->logger()->sampler(); |
679 if (sampler == NULL || !sampler->IsActive()) return; | 679 if (sampler == NULL || !sampler->IsActive()) return; |
680 | 680 |
| 681 TickSample sample_obj; |
681 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); | 682 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); |
682 if (sample == NULL) return; | 683 if (sample == NULL) sample = &sample_obj; |
683 | 684 |
684 // Extracting the sample from the context is extremely machine dependent. | 685 // Extracting the sample from the context is extremely machine dependent. |
685 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 686 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
686 mcontext_t& mcontext = ucontext->uc_mcontext; | 687 mcontext_t& mcontext = ucontext->uc_mcontext; |
687 sample->state = isolate->current_vm_state(); | 688 sample->state = isolate->current_vm_state(); |
688 #if V8_HOST_ARCH_IA32 | 689 #if V8_HOST_ARCH_IA32 |
689 sample->pc = reinterpret_cast<Address>(mcontext.mc_eip); | 690 sample->pc = reinterpret_cast<Address>(mcontext.mc_eip); |
690 sample->sp = reinterpret_cast<Address>(mcontext.mc_esp); | 691 sample->sp = reinterpret_cast<Address>(mcontext.mc_esp); |
691 sample->fp = reinterpret_cast<Address>(mcontext.mc_ebp); | 692 sample->fp = reinterpret_cast<Address>(mcontext.mc_ebp); |
692 #elif V8_HOST_ARCH_X64 | 693 #elif V8_HOST_ARCH_X64 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 } | 897 } |
897 | 898 |
898 | 899 |
899 void Sampler::Stop() { | 900 void Sampler::Stop() { |
900 ASSERT(IsActive()); | 901 ASSERT(IsActive()); |
901 SignalSender::RemoveActiveSampler(this); | 902 SignalSender::RemoveActiveSampler(this); |
902 SetActive(false); | 903 SetActive(false); |
903 } | 904 } |
904 | 905 |
905 | 906 |
| 907 void Sampler::StartSampling() { |
| 908 } |
| 909 |
| 910 |
| 911 void Sampler::StopSampling() { |
| 912 } |
| 913 |
| 914 |
906 } } // namespace v8::internal | 915 } } // namespace v8::internal |
OLD | NEW |