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

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

Issue 21403: Added the simplest call stack sampling and call profile in tick processor output. (Closed)
Patch Set: Merged after Soren's changes to logging Created 11 years, 10 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 | « src/platform-macos.cc ('k') | tools/tickprocessor.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 // If profiling, we record the pc and sp of the profiled thread. 1578 // If profiling, we record the pc and sp of the profiled thread.
1579 if (sampler_->IsProfiling()) { 1579 if (sampler_->IsProfiling()) {
1580 // Pause the profiled thread and get its context. 1580 // Pause the profiled thread and get its context.
1581 SuspendThread(profiled_thread_); 1581 SuspendThread(profiled_thread_);
1582 context.ContextFlags = CONTEXT_FULL; 1582 context.ContextFlags = CONTEXT_FULL;
1583 GetThreadContext(profiled_thread_, &context); 1583 GetThreadContext(profiled_thread_, &context);
1584 ResumeThread(profiled_thread_); 1584 ResumeThread(profiled_thread_);
1585 // Invoke tick handler with program counter and stack pointer. 1585 // Invoke tick handler with program counter and stack pointer.
1586 sample.pc = context.Eip; 1586 sample.pc = context.Eip;
1587 sample.sp = context.Esp; 1587 sample.sp = context.Esp;
1588 sample.fp = context.Ebp;
1588 } 1589 }
1589 1590
1590 // We always sample the VM state. 1591 // We always sample the VM state.
1591 sample.state = Logger::state(); 1592 sample.state = Logger::state();
1592 sampler_->Tick(&sample); 1593 sampler_->Tick(&sample);
1593 1594
1594 // Wait until next sampling. 1595 // Wait until next sampling.
1595 Sleep(sampler_->interval_); 1596 Sleep(sampler_->interval_);
1596 } 1597 }
1597 } 1598 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 1657
1657 // Release the thread handles 1658 // Release the thread handles
1658 CloseHandle(data_->sampler_thread_); 1659 CloseHandle(data_->sampler_thread_);
1659 CloseHandle(data_->profiled_thread_); 1660 CloseHandle(data_->profiled_thread_);
1660 } 1661 }
1661 1662
1662 1663
1663 #endif // ENABLE_LOGGING_AND_PROFILING 1664 #endif // ENABLE_LOGGING_AND_PROFILING
1664 1665
1665 } } // namespace v8::internal 1666 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-macos.cc ('k') | tools/tickprocessor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698