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

Side by Side Diff: src/cpu-profiler.h

Issue 1138004: Add multithreading test for SamplingCircularQueue, fix implementation. (Closed)
Patch Set: Created 10 years, 9 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/circular-queue-inl.h ('k') | src/cpu-profiler.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 Address start, unsigned size); 147 Address start, unsigned size);
148 void CodeCreateEvent(Logger::LogEventsAndTags tag, 148 void CodeCreateEvent(Logger::LogEventsAndTags tag,
149 int args_count, 149 int args_count,
150 Address start, unsigned size); 150 Address start, unsigned size);
151 void CodeMoveEvent(Address from, Address to); 151 void CodeMoveEvent(Address from, Address to);
152 void CodeDeleteEvent(Address from); 152 void CodeDeleteEvent(Address from);
153 void FunctionCreateEvent(Address alias, Address start); 153 void FunctionCreateEvent(Address alias, Address start);
154 void FunctionMoveEvent(Address from, Address to); 154 void FunctionMoveEvent(Address from, Address to);
155 void FunctionDeleteEvent(Address from); 155 void FunctionDeleteEvent(Address from);
156 156
157 // Tick sampler registration. Called by sampler thread or signal handler.
158 inline void SetUpSamplesProducer() { ticks_buffer_.SetUpProducer(); }
159 // Tick sample events are filled directly in the buffer of the circular 157 // Tick sample events are filled directly in the buffer of the circular
160 // queue (because the structure is of fixed width, but usually not all 158 // queue (because the structure is of fixed width, but usually not all
161 // stack frame entries are filled.) This method returns a pointer to the 159 // stack frame entries are filled.) This method returns a pointer to the
162 // next record of the buffer. 160 // next record of the buffer.
163 INLINE(TickSample* TickSampleEvent()); 161 INLINE(TickSample* TickSampleEvent());
164 inline void TearDownSamplesProducer() { ticks_buffer_.TearDownProducer(); }
165 162
166 private: 163 private:
167 union CodeEventsContainer { 164 union CodeEventsContainer {
168 CodeEventRecord generic; 165 CodeEventRecord generic;
169 #define DECLARE_CLASS(ignore, type) type type##_; 166 #define DECLARE_CLASS(ignore, type) type type##_;
170 CODE_EVENTS_TYPE_LIST(DECLARE_CLASS) 167 CODE_EVENTS_TYPE_LIST(DECLARE_CLASS)
171 #undef DECLARE_TYPE 168 #undef DECLARE_TYPE
172 }; 169 };
173 170
174 // Called from events processing thread (Run() method.) 171 // Called from events processing thread (Run() method.)
175 bool ProcessCodeEvent(unsigned* dequeue_order); 172 bool ProcessCodeEvent(unsigned* dequeue_order);
176 bool ProcessTicks(unsigned dequeue_order); 173 bool ProcessTicks(unsigned dequeue_order);
177 174
178 ProfileGenerator* generator_; 175 ProfileGenerator* generator_;
179 bool running_; 176 bool running_;
180 CircularQueue<CodeEventsContainer> events_buffer_; 177 CircularQueue<CodeEventsContainer> events_buffer_;
181 SamplingCircularQueue ticks_buffer_; 178 SamplingCircularQueue ticks_buffer_;
182 unsigned enqueue_order_; 179 unsigned enqueue_order_;
183 }; 180 };
184 181
185 182
186 } } // namespace v8::internal 183 } } // namespace v8::internal
187 184
188 #endif // V8_CPU_PROFILER_H_ 185 #endif // V8_CPU_PROFILER_H_
OLDNEW
« no previous file with comments | « src/circular-queue-inl.h ('k') | src/cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698