| 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 }; | 697 }; |
| 698 | 698 |
| 699 | 699 |
| 700 class SignalSender : public Thread { | 700 class SignalSender : public Thread { |
| 701 public: | 701 public: |
| 702 enum SleepInterval { | 702 enum SleepInterval { |
| 703 HALF_INTERVAL, | 703 HALF_INTERVAL, |
| 704 FULL_INTERVAL | 704 FULL_INTERVAL |
| 705 }; | 705 }; |
| 706 | 706 |
| 707 static const int kSignalSenderStackSize = 32 * KB; | 707 static const int kSignalSenderStackSize = 64 * KB; |
| 708 | 708 |
| 709 explicit SignalSender(int interval) | 709 explicit SignalSender(int interval) |
| 710 : Thread(Thread::Options("SignalSender", kSignalSenderStackSize)), | 710 : Thread(Thread::Options("SignalSender", kSignalSenderStackSize)), |
| 711 interval_(interval) {} | 711 interval_(interval) {} |
| 712 | 712 |
| 713 static void InstallSignalHandler() { | 713 static void InstallSignalHandler() { |
| 714 struct sigaction sa; | 714 struct sigaction sa; |
| 715 sa.sa_sigaction = ProfilerSignalHandler; | 715 sa.sa_sigaction = ProfilerSignalHandler; |
| 716 sigemptyset(&sa.sa_mask); | 716 sigemptyset(&sa.sa_mask); |
| 717 sa.sa_flags = SA_RESTART | SA_SIGINFO; | 717 sa.sa_flags = SA_RESTART | SA_SIGINFO; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 } | 872 } |
| 873 | 873 |
| 874 | 874 |
| 875 void Sampler::Stop() { | 875 void Sampler::Stop() { |
| 876 ASSERT(IsActive()); | 876 ASSERT(IsActive()); |
| 877 SignalSender::RemoveActiveSampler(this); | 877 SignalSender::RemoveActiveSampler(this); |
| 878 SetActive(false); | 878 SetActive(false); |
| 879 } | 879 } |
| 880 | 880 |
| 881 } } // namespace v8::internal | 881 } } // namespace v8::internal |
| OLD | NEW |