OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 OS::Sleep(interval_); | 489 OS::Sleep(interval_); |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 private: | 493 private: |
494 #if defined(USE_SIGNALS) | 494 #if defined(USE_SIGNALS) |
495 | 495 |
496 void SampleContext(Sampler* sampler) { | 496 void SampleContext(Sampler* sampler) { |
497 if (!SignalHandler::Installed()) return; | 497 if (!SignalHandler::Installed()) return; |
498 pthread_t tid = sampler->platform_data()->vm_tid(); | 498 pthread_t tid = sampler->platform_data()->vm_tid(); |
499 pthread_kill(tid, SIGPROF); | 499 int result = pthread_kill(tid, SIGPROF); |
| 500 USE(result); |
| 501 ASSERT(result == 0); |
500 } | 502 } |
501 | 503 |
502 #elif defined(__MACH__) | 504 #elif defined(__MACH__) |
503 | 505 |
504 void SampleContext(Sampler* sampler) { | 506 void SampleContext(Sampler* sampler) { |
505 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); | 507 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); |
506 Isolate* isolate = sampler->isolate(); | 508 Isolate* isolate = sampler->isolate(); |
507 | 509 |
508 SampleHelper helper; | 510 SampleHelper helper; |
509 TickSample* sample = helper.Init(sampler, isolate); | 511 TickSample* sample = helper.Init(sampler, isolate); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 SamplerThread::RemoveActiveSampler(this); | 685 SamplerThread::RemoveActiveSampler(this); |
684 SetActive(false); | 686 SetActive(false); |
685 } | 687 } |
686 | 688 |
687 void Sampler::SampleStack(TickSample* sample) { | 689 void Sampler::SampleStack(TickSample* sample) { |
688 sample->Trace(isolate_); | 690 sample->Trace(isolate_); |
689 if (++samples_taken_ < 0) samples_taken_ = 0; | 691 if (++samples_taken_ < 0) samples_taken_ = 0; |
690 } | 692 } |
691 | 693 |
692 } } // namespace v8::internal | 694 } } // namespace v8::internal |
OLD | NEW |