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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 }; | 1053 }; |
1054 | 1054 |
1055 | 1055 |
1056 class SignalSender : public Thread { | 1056 class SignalSender : public Thread { |
1057 public: | 1057 public: |
1058 enum SleepInterval { | 1058 enum SleepInterval { |
1059 HALF_INTERVAL, | 1059 HALF_INTERVAL, |
1060 FULL_INTERVAL | 1060 FULL_INTERVAL |
1061 }; | 1061 }; |
1062 | 1062 |
1063 static const int kSignalSenderStackSize = 32 * KB; | 1063 static const int kSignalSenderStackSize = 64 * KB; |
1064 | 1064 |
1065 explicit SignalSender(int interval) | 1065 explicit SignalSender(int interval) |
1066 : Thread(Thread::Options("SignalSender", kSignalSenderStackSize)), | 1066 : Thread(Thread::Options("SignalSender", kSignalSenderStackSize)), |
1067 vm_tgid_(getpid()), | 1067 vm_tgid_(getpid()), |
1068 interval_(interval) {} | 1068 interval_(interval) {} |
1069 | 1069 |
1070 static void InstallSignalHandler() { | 1070 static void InstallSignalHandler() { |
1071 struct sigaction sa; | 1071 struct sigaction sa; |
1072 sa.sa_sigaction = ProfilerSignalHandler; | 1072 sa.sa_sigaction = ProfilerSignalHandler; |
1073 sigemptyset(&sa.sa_mask); | 1073 sigemptyset(&sa.sa_mask); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 | 1240 |
1241 | 1241 |
1242 void Sampler::Stop() { | 1242 void Sampler::Stop() { |
1243 ASSERT(IsActive()); | 1243 ASSERT(IsActive()); |
1244 SignalSender::RemoveActiveSampler(this); | 1244 SignalSender::RemoveActiveSampler(this); |
1245 SetActive(false); | 1245 SetActive(false); |
1246 } | 1246 } |
1247 | 1247 |
1248 | 1248 |
1249 } } // namespace v8::internal | 1249 } } // namespace v8::internal |
OLD | NEW |