OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/libsampler/sampler.h" | 5 #include "src/libsampler/sampler.h" |
6 | 6 |
7 #if V8_OS_POSIX && !V8_OS_CYGWIN | 7 #if V8_OS_POSIX && !V8_OS_CYGWIN |
8 | 8 |
9 #define USE_SIGNALS | 9 #define USE_SIGNALS |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 bool is_success_; | 186 bool is_success_; |
187 }; | 187 }; |
188 | 188 |
189 // Returns key for hash map. | 189 // Returns key for hash map. |
190 void* ThreadKey(pthread_t thread_id) { | 190 void* ThreadKey(pthread_t thread_id) { |
191 return reinterpret_cast<void*>(thread_id); | 191 return reinterpret_cast<void*>(thread_id); |
192 } | 192 } |
193 | 193 |
194 // Returns hash value for hash map. | 194 // Returns hash value for hash map. |
195 uint32_t ThreadHash(pthread_t thread_id) { | 195 uint32_t ThreadHash(pthread_t thread_id) { |
196 #if V8_OS_MACOSX | 196 #if V8_OS_BSD |
197 return static_cast<uint32_t>(reinterpret_cast<intptr_t>(thread_id)); | 197 return static_cast<uint32_t>(reinterpret_cast<intptr_t>(thread_id)); |
198 #else | 198 #else |
199 return static_cast<uint32_t>(thread_id); | 199 return static_cast<uint32_t>(thread_id); |
200 #endif | 200 #endif |
201 } | 201 } |
202 | 202 |
203 #endif // USE_SIGNALS | 203 #endif // USE_SIGNALS |
204 | 204 |
205 } // namespace | 205 } // namespace |
206 | 206 |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 #endif | 654 #endif |
655 SampleStack(state); | 655 SampleStack(state); |
656 } | 656 } |
657 ResumeThread(profiled_thread); | 657 ResumeThread(profiled_thread); |
658 } | 658 } |
659 | 659 |
660 #endif // USE_SIGNALS | 660 #endif // USE_SIGNALS |
661 | 661 |
662 } // namespace sampler | 662 } // namespace sampler |
663 } // namespace v8 | 663 } // namespace v8 |
OLD | NEW |