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

Side by Side Diff: syzygy/agent/asan/runtime.h

Issue 2576003002: Add the ability to defer the initialization of the SyzyAsan crash reporter. (Closed)
Patch Set: x64 def file. Created 3 years, 11 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 Google Inc. All Rights Reserved. 1 // Copyright 2012 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 // Sets the allocation-filter flag to the specified value. 143 // Sets the allocation-filter flag to the specified value.
144 // @param value the new value for the flag. 144 // @param value the new value for the flag.
145 // @note The flag is stored per-thread using TLS. Multiple threads do not 145 // @note The flag is stored per-thread using TLS. Multiple threads do not
146 // share the same flag. 146 // share the same flag.
147 void set_allocation_filter_flag(bool value); 147 void set_allocation_filter_flag(bool value);
148 148
149 // @names Accessors. 149 // @names Accessors.
150 // { 150 // {
151 uint64_t random_key() const { return random_key_; } 151 uint64_t random_key() const { return random_key_; }
152 bool crash_reporter_initialized() const {
153 return crash_reporter_initialized_;
154 }
152 // @} 155 // @}
153 156
154 // Observes a given thread ID, adding it to thread ID set. 157 // Observes a given thread ID, adding it to thread ID set.
155 // @param thread_id The thread ID that has been observed. 158 // @param thread_id The thread ID that has been observed.
156 void AddThreadId(uint32_t thread_id); 159 void AddThreadId(uint32_t thread_id);
157 160
158 // Determines if a thread ID has already been seen. 161 // Determines if a thread ID has already been seen.
159 // @param thread_id The thread ID to be queried. 162 // @param thread_id The thread ID to be queried.
160 // @returns true if a given thread ID is valid for this process. 163 // @returns true if a given thread ID is valid for this process.
161 bool ThreadIdIsValid(uint32_t thread_id); 164 bool ThreadIdIsValid(uint32_t thread_id);
(...skipping 25 matching lines...) Expand all
187 190
188 // Enables the deferred free thread. 191 // Enables the deferred free thread.
189 void EnableDeferredFreeThread(); 192 void EnableDeferredFreeThread();
190 193
191 // Disables the deferred free thread. 194 // Disables the deferred free thread.
192 void DisableDeferredFreeThread(); 195 void DisableDeferredFreeThread();
193 196
194 // @returns the list of enabled features. 197 // @returns the list of enabled features.
195 AsanFeatureSet GetEnabledFeatureSet(); 198 AsanFeatureSet GetEnabledFeatureSet();
196 199
200 // Initialize the crash reporter used by the runtime.
chrisha 2017/01/11 18:57:28 More comments about how this is related to the def
Sébastien Marchand 2017/01/11 21:38:08 Done.
201 void InitializeCrashReporter();
202
197 protected: 203 protected:
198 // Propagate the values of the flags to the target modules. 204 // Propagate the values of the flags to the target modules.
199 void PropagateParams(); 205 void PropagateParams();
200 206
201 // @returns the space required to write the provided corrupt heap info. 207 // @returns the space required to write the provided corrupt heap info.
202 // @param corrupt_ranges The corrupt range info. 208 // @param corrupt_ranges The corrupt range info.
203 size_t CalculateCorruptHeapInfoSize( 209 size_t CalculateCorruptHeapInfoSize(
204 const HeapChecker::CorruptRangesVector& corrupt_ranges); 210 const HeapChecker::CorruptRangesVector& corrupt_ranges);
205 211
206 // Writes corrupt heap information to the provided buffer. This will write 212 // Writes corrupt heap information to the provided buffer. This will write
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 std::unordered_set<uint32_t> thread_ids_; // Under thread_ids_lock_. 326 std::unordered_set<uint32_t> thread_ids_; // Under thread_ids_lock_.
321 327
322 // A random key that is generated on object creation. This is used for 328 // A random key that is generated on object creation. This is used for
323 // correlating duplicate crash reports on the back-end. 329 // correlating duplicate crash reports on the back-end.
324 const uint64_t random_key_; 330 const uint64_t random_key_;
325 331
326 // The crash reporter in use. This will be left null if no crash reporter 332 // The crash reporter in use. This will be left null if no crash reporter
327 // is available. 333 // is available.
328 std::unique_ptr<ReporterInterface> crash_reporter_; 334 std::unique_ptr<ReporterInterface> crash_reporter_;
329 335
336 // Indicates if the crash reporter has been initialized.
337 bool crash_reporter_initialized_;
338
330 DISALLOW_COPY_AND_ASSIGN(AsanRuntime); 339 DISALLOW_COPY_AND_ASSIGN(AsanRuntime);
331 }; 340 };
332 341
333 } // namespace asan 342 } // namespace asan
334 } // namespace agent 343 } // namespace agent
335 344
336 #endif // SYZYGY_AGENT_ASAN_RUNTIME_H_ 345 #endif // SYZYGY_AGENT_ASAN_RUNTIME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698