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

Side by Side Diff: src/platform-linux.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-freebsd.cc ('k') | src/platform-macos.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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 TickSample sample; 610 TickSample sample;
611 611
612 // If profiling, we extract the current pc and sp. 612 // If profiling, we extract the current pc and sp.
613 if (active_sampler_->IsProfiling()) { 613 if (active_sampler_->IsProfiling()) {
614 // Extracting the sample from the context is extremely machine dependent. 614 // Extracting the sample from the context is extremely machine dependent.
615 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); 615 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
616 mcontext_t& mcontext = ucontext->uc_mcontext; 616 mcontext_t& mcontext = ucontext->uc_mcontext;
617 #if defined (__arm__) || defined(__thumb__) 617 #if defined (__arm__) || defined(__thumb__)
618 sample.pc = mcontext.gregs[R15]; 618 sample.pc = mcontext.gregs[R15];
619 sample.sp = mcontext.gregs[R13]; 619 sample.sp = mcontext.gregs[R13];
620 sample.fp = mcontext.gregs[R11];
620 #else 621 #else
621 sample.pc = mcontext.gregs[REG_EIP]; 622 sample.pc = mcontext.gregs[REG_EIP];
622 sample.sp = mcontext.gregs[REG_ESP]; 623 sample.sp = mcontext.gregs[REG_ESP];
624 sample.fp = mcontext.gregs[REG_EBP];
623 #endif 625 #endif
624 } 626 }
625 627
626 // We always sample the VM state. 628 // We always sample the VM state.
627 sample.state = Logger::state(); 629 sample.state = Logger::state();
628 630
629 active_sampler_->Tick(&sample); 631 active_sampler_->Tick(&sample);
630 } 632 }
631 633
632 634
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 } 691 }
690 692
691 // This sampler is no longer the active sampler. 693 // This sampler is no longer the active sampler.
692 active_sampler_ = NULL; 694 active_sampler_ = NULL;
693 active_ = false; 695 active_ = false;
694 } 696 }
695 697
696 #endif // ENABLE_LOGGING_AND_PROFILING 698 #endif // ENABLE_LOGGING_AND_PROFILING
697 699
698 } } // namespace v8::internal 700 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698