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

Side by Side Diff: src/platform.h

Issue 10857035: Moving cpu profiling into its own thread. (Closed) Base URL: http://git.chromium.org/external/v8.git@master
Patch Set: added a flag to set sampling rate Created 8 years, 3 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
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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 virtual ~Sampler(); 712 virtual ~Sampler();
713 713
714 int interval() const { return interval_; } 714 int interval() const { return interval_; }
715 715
716 // Performs stack sampling. 716 // Performs stack sampling.
717 void SampleStack(TickSample* sample) { 717 void SampleStack(TickSample* sample) {
718 DoSampleStack(sample); 718 DoSampleStack(sample);
719 IncSamplesTaken(); 719 IncSamplesTaken();
720 } 720 }
721 721
722 // Performs platform-specific stack sampling.
723 void DoSample();
724
722 // This method is called for each sampling period with the current 725 // This method is called for each sampling period with the current
723 // program counter. 726 // program counter.
724 virtual void Tick(TickSample* sample) = 0; 727 virtual void Tick(TickSample* sample) = 0;
725 728
726 // Start and stop sampler. 729 // Start and stop sampler.
727 void Start(); 730 void Start();
728 void Stop(); 731 void Stop();
729 732
730 // Is the sampler used for profiling? 733 // Is the sampler used for profiling?
731 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } 734 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; }
(...skipping 27 matching lines...) Expand all
759 Atomic32 active_; 762 Atomic32 active_;
760 PlatformData* data_; // Platform specific data. 763 PlatformData* data_; // Platform specific data.
761 int samples_taken_; // Counts stack samples taken. 764 int samples_taken_; // Counts stack samples taken.
762 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 765 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
763 }; 766 };
764 767
765 768
766 } } // namespace v8::internal 769 } } // namespace v8::internal
767 770
768 #endif // V8_PLATFORM_H_ 771 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/platform-cygwin.cc » ('j') | src/platform-linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698