| 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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 SignalSender* sender = reinterpret_cast<SignalSender*>(raw_sender); | 1201 SignalSender* sender = reinterpret_cast<SignalSender*>(raw_sender); |
| 1202 sender->SendProfilingSignal(sampler->platform_data()->vm_tid()); | 1202 sender->SendProfilingSignal(sampler->platform_data()->vm_tid()); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 void SendProfilingSignal(int tid) { | 1205 void SendProfilingSignal(int tid) { |
| 1206 if (!signal_handler_installed_) return; | 1206 if (!signal_handler_installed_) return; |
| 1207 // Glibc doesn't provide a wrapper for tgkill(2). | 1207 // Glibc doesn't provide a wrapper for tgkill(2). |
| 1208 #if defined(ANDROID) | 1208 #if defined(ANDROID) |
| 1209 syscall(__NR_tgkill, vm_tgid_, tid, SIGPROF); | 1209 syscall(__NR_tgkill, vm_tgid_, tid, SIGPROF); |
| 1210 #else | 1210 #else |
| 1211 syscall(SYS_tgkill, vm_tgid_, tid, SIGPROF); | 1211 int result = syscall(SYS_tgkill, vm_tgid_, tid, SIGPROF); |
| 1212 USE(result); |
| 1213 ASSERT(result == 0); |
| 1212 #endif | 1214 #endif |
| 1213 } | 1215 } |
| 1214 | 1216 |
| 1215 void Sleep() { | 1217 void Sleep() { |
| 1216 // Convert ms to us and subtract 100 us to compensate delays | 1218 // Convert ms to us and subtract 100 us to compensate delays |
| 1217 // occuring during signal delivery. | 1219 // occuring during signal delivery. |
| 1218 useconds_t interval = interval_ * 1000 - 100; | 1220 useconds_t interval = interval_ * 1000 - 100; |
| 1219 #if defined(ANDROID) | 1221 #if defined(ANDROID) |
| 1220 usleep(interval); | 1222 usleep(interval); |
| 1221 #else | 1223 #else |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 | 1313 |
| 1312 | 1314 |
| 1313 void Sampler::Stop() { | 1315 void Sampler::Stop() { |
| 1314 ASSERT(IsActive()); | 1316 ASSERT(IsActive()); |
| 1315 SignalSender::RemoveActiveSampler(this); | 1317 SignalSender::RemoveActiveSampler(this); |
| 1316 SetActive(false); | 1318 SetActive(false); |
| 1317 } | 1319 } |
| 1318 | 1320 |
| 1319 | 1321 |
| 1320 } } // namespace v8::internal | 1322 } } // namespace v8::internal |
| OLD | NEW |