Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: src/platform-linux.cc

Issue 11961037: Add assertion to check that CPU profiling actually works. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698