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

Side by Side Diff: src/platform-openbsd.cc

Issue 11231002: Perform CPU sampling by CPU sampling thread only iff processing thread is not running. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: fixed crash in tests due to absent sampler Created 8 years, 1 month 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 | « src/platform-nullos.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 return; 730 return;
731 } 731 }
732 if (v8::Locker::IsActive() && 732 if (v8::Locker::IsActive() &&
733 !isolate->thread_manager()->IsLockedByCurrentThread()) { 733 !isolate->thread_manager()->IsLockedByCurrentThread()) {
734 return; 734 return;
735 } 735 }
736 736
737 Sampler* sampler = isolate->logger()->sampler(); 737 Sampler* sampler = isolate->logger()->sampler();
738 if (sampler == NULL || !sampler->IsActive()) return; 738 if (sampler == NULL || !sampler->IsActive()) return;
739 739
740 TickSample sample_obj;
740 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); 741 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate);
741 if (sample == NULL) return; 742 if (sample == NULL) sample = &sample_obj;
742 743
743 // Extracting the sample from the context is extremely machine dependent. 744 // Extracting the sample from the context is extremely machine dependent.
744 sample->state = isolate->current_vm_state(); 745 sample->state = isolate->current_vm_state();
745 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); 746 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
746 #ifdef __NetBSD__ 747 #ifdef __NetBSD__
747 mcontext_t& mcontext = ucontext->uc_mcontext; 748 mcontext_t& mcontext = ucontext->uc_mcontext;
748 #if V8_HOST_ARCH_IA32 749 #if V8_HOST_ARCH_IA32
749 sample->pc = reinterpret_cast<Address>(mcontext.__gregs[_REG_EIP]); 750 sample->pc = reinterpret_cast<Address>(mcontext.__gregs[_REG_EIP]);
750 sample->sp = reinterpret_cast<Address>(mcontext.__gregs[_REG_ESP]); 751 sample->sp = reinterpret_cast<Address>(mcontext.__gregs[_REG_ESP]);
751 sample->fp = reinterpret_cast<Address>(mcontext.__gregs[_REG_EBP]); 752 sample->fp = reinterpret_cast<Address>(mcontext.__gregs[_REG_EBP]);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 } 983 }
983 984
984 985
985 void Sampler::Stop() { 986 void Sampler::Stop() {
986 ASSERT(IsActive()); 987 ASSERT(IsActive());
987 SignalSender::RemoveActiveSampler(this); 988 SignalSender::RemoveActiveSampler(this);
988 SetActive(false); 989 SetActive(false);
989 } 990 }
990 991
991 992
993 void Sampler::StartSampling() {
994 }
995
996
997 void Sampler::StopSampling() {
998 }
999
1000
992 } } // namespace v8::internal 1001 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-nullos.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698