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

Side by Side Diff: src/platform-macos.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-linux.cc ('k') | src/platform-win32.cc » ('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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 TickSample sample; 576 TickSample sample;
577 577
578 // If profiling, we extract the current pc and sp. 578 // If profiling, we extract the current pc and sp.
579 if (active_sampler_->IsProfiling()) { 579 if (active_sampler_->IsProfiling()) {
580 // Extracting the sample from the context is extremely machine dependent. 580 // Extracting the sample from the context is extremely machine dependent.
581 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); 581 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
582 mcontext_t& mcontext = ucontext->uc_mcontext; 582 mcontext_t& mcontext = ucontext->uc_mcontext;
583 #if __DARWIN_UNIX03 583 #if __DARWIN_UNIX03
584 sample.pc = mcontext->__ss.__eip; 584 sample.pc = mcontext->__ss.__eip;
585 sample.sp = mcontext->__ss.__esp; 585 sample.sp = mcontext->__ss.__esp;
586 sample.fp = mcontext->__ss.__ebp;
586 #else // !__DARWIN_UNIX03 587 #else // !__DARWIN_UNIX03
587 sample.pc = mcontext->ss.eip; 588 sample.pc = mcontext->ss.eip;
588 sample.sp = mcontext->ss.esp; 589 sample.sp = mcontext->ss.esp;
590 sample.fp = mcontext->ss.ebp;
589 #endif // __DARWIN_UNIX03 591 #endif // __DARWIN_UNIX03
590 } 592 }
591 593
592 // We always sample the VM state. 594 // We always sample the VM state.
593 sample.state = Logger::state(); 595 sample.state = Logger::state();
594 596
595 active_sampler_->Tick(&sample); 597 active_sampler_->Tick(&sample);
596 } 598 }
597 599
598 600
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 657 }
656 658
657 // This sampler is no longer the active sampler. 659 // This sampler is no longer the active sampler.
658 active_sampler_ = NULL; 660 active_sampler_ = NULL;
659 active_ = false; 661 active_ = false;
660 } 662 }
661 663
662 #endif // ENABLE_LOGGING_AND_PROFILING 664 #endif // ENABLE_LOGGING_AND_PROFILING
663 665
664 } } // namespace v8::internal 666 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698