| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_TRACKED_OBJECTS_H_ | 5 #ifndef BASE_TRACKED_OBJECTS_H_ |
| 6 #define BASE_TRACKED_OBJECTS_H_ | 6 #define BASE_TRACKED_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <stack> | 10 #include <stack> |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 int birth_count_; | 251 int birth_count_; |
| 252 | 252 |
| 253 DISALLOW_COPY_AND_ASSIGN(Births); | 253 DISALLOW_COPY_AND_ASSIGN(Births); |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 //------------------------------------------------------------------------------ | 256 //------------------------------------------------------------------------------ |
| 257 // Basic info summarizing multiple destructions of a tracked object with a | 257 // Basic info summarizing multiple destructions of a tracked object with a |
| 258 // single birthplace (fixed Location). Used both on specific threads, and also | 258 // single birthplace (fixed Location). Used both on specific threads, and also |
| 259 // in snapshots when integrating assembled data. | 259 // in snapshots when integrating assembled data. |
| 260 | 260 |
| 261 struct DeathDataPhaseSnapshot; |
| 262 |
| 261 class BASE_EXPORT DeathData { | 263 class BASE_EXPORT DeathData { |
| 264 // Access to members of this class is never protected by the lock. The fields |
| 265 // are accessed in such a way that corruptions resulting from race conditions |
| 266 // are not significant, and don't accumulate as a result of multiple accesses. |
| 267 // All fields except sample_probability_count_ can be snapshotted, and |
| 268 // snapshotting happens only from the main thread. |
| 262 public: | 269 public: |
| 263 // Default initializer. | 270 // Default initializer. |
| 264 DeathData(); | 271 DeathData(); |
| 265 | 272 |
| 266 // When deaths have not yet taken place, and we gather data from all the | 273 // When deaths have not yet taken place, and we gather data from all the |
| 267 // threads, we create DeathData stats that tally the number of births without | 274 // threads, we create DeathData stats that tally the number of births without |
| 268 // a corresponding death. | 275 // a corresponding death. |
| 269 explicit DeathData(int count); | 276 explicit DeathData(int count); |
| 270 | 277 |
| 278 ~DeathData(); |
| 279 |
| 271 // Update stats for a task destruction (death) that had a Run() time of | 280 // Update stats for a task destruction (death) that had a Run() time of |
| 272 // |duration|, and has had a queueing delay of |queue_duration|. | 281 // |duration|, and has had a queueing delay of |queue_duration|. |
| 273 void RecordDeath(const int32 queue_duration, | 282 void RecordDeath(const int32 queue_duration, |
| 274 const int32 run_duration, | 283 const int32 run_duration, |
| 275 const uint32 random_number); | 284 const uint32 random_number); |
| 276 | 285 |
| 277 // Metrics accessors, used only for serialization and in tests. | 286 // Metrics and past snapshots accessors, used only for serialization and in |
| 287 // tests. |
| 278 int count() const; | 288 int count() const; |
| 279 int32 run_duration_sum() const; | 289 int32 run_duration_sum() const; |
| 280 int32 run_duration_max() const; | 290 int32 run_duration_max() const; |
| 281 int32 run_duration_sample() const; | 291 int32 run_duration_sample() const; |
| 282 int32 queue_duration_sum() const; | 292 int32 queue_duration_sum() const; |
| 283 int32 queue_duration_max() const; | 293 int32 queue_duration_max() const; |
| 284 int32 queue_duration_sample() const; | 294 int32 queue_duration_sample() const; |
| 295 DeathDataPhaseSnapshot* last_phase_snapshot() const; |
| 285 | 296 |
| 286 // Reset all tallies to zero. This is used as a hack on realtime data. | 297 // Called when the current profiling phase, identified by |profiling_phase|, |
| 287 void Clear(); | 298 // ends. |
| 299 // Called only in the main thread. |
| 300 void OnProfilingPhaseCompletion(int profiling_phase); |
| 288 | 301 |
| 289 private: | 302 private: |
| 290 // Members are ordered from most regularly read and updated, to least | 303 // Members are ordered from most regularly read and updated, to least |
| 291 // frequently used. This might help a bit with cache lines. | 304 // frequently used. This might help a bit with cache lines. |
| 292 // Number of runs seen (divisor for calculating averages). | 305 // Number of runs seen (divisor for calculating averages). |
| 306 // Can be incremented only from the death thread. |
| 293 int count_; | 307 int count_; |
| 294 // Basic tallies, used to compute averages. | 308 |
| 309 // Count used in determining probability of selecting exec/queue times from a |
| 310 // recorded death as samples. |
| 311 // Gets incremented only in the death thread, but can be set to 0 by |
| 312 // OnProfilingPhaseCompletion() from the main thread. |
| 313 int sample_probability_count_; |
| 314 |
| 315 // Basic tallies, used to compute averages. Can be incremented only in the |
| 316 // death thread. |
| 295 int32 run_duration_sum_; | 317 int32 run_duration_sum_; |
| 296 int32 queue_duration_sum_; | 318 int32 queue_duration_sum_; |
| 297 // Max values, used by local visualization routines. These are often read, | 319 // Max values, used by local visualization routines. These are often read, |
| 298 // but rarely updated. | 320 // but rarely updated. The max values get assigned only in the death thread, |
| 321 // but these fields can be set to 0 by OnProfilingPhaseCompletion() from the |
| 322 // main thread. |
| 299 int32 run_duration_max_; | 323 int32 run_duration_max_; |
| 300 int32 queue_duration_max_; | 324 int32 queue_duration_max_; |
| 301 // Samples, used by crowd sourcing gatherers. These are almost never read, | 325 // Samples, used by crowd sourcing gatherers. These are almost never read, |
| 302 // and rarely updated. | 326 // and rarely updated. They can be modified only from the death thread. |
| 303 int32 run_duration_sample_; | 327 int32 run_duration_sample_; |
| 304 int32 queue_duration_sample_; | 328 int32 queue_duration_sample_; |
| 329 |
| 330 // Snapshot of this death data made at the last profiling phase completion, if |
| 331 // any. DeathData owns the whole list starting with this pointer. |
| 332 // Can be accessed only from the main thread. |
| 333 DeathDataPhaseSnapshot* last_phase_snapshot_; |
| 334 |
| 335 DISALLOW_COPY_AND_ASSIGN(DeathData); |
| 305 }; | 336 }; |
| 306 | 337 |
| 307 //------------------------------------------------------------------------------ | 338 //------------------------------------------------------------------------------ |
| 308 // A "snapshotted" representation of the DeathData class. | 339 // A "snapshotted" representation of the DeathData class. |
| 309 | 340 |
| 310 struct BASE_EXPORT DeathDataSnapshot { | 341 struct BASE_EXPORT DeathDataSnapshot { |
| 311 DeathDataSnapshot(); | 342 DeathDataSnapshot(); |
| 312 explicit DeathDataSnapshot(const DeathData& death_data); | 343 explicit DeathDataSnapshot(const DeathData& death_data); |
| 313 ~DeathDataSnapshot(); | 344 ~DeathDataSnapshot(); |
| 314 | 345 |
| 346 // Calculates delta between this snapshot and an earlier snapshot of the same |
| 347 // task |older| and assigns it back to this object. |
| 348 void CalculateDelta(const DeathDataSnapshot& older); |
| 349 |
| 315 int count; | 350 int count; |
| 316 int32 run_duration_sum; | 351 int32 run_duration_sum; |
| 317 int32 run_duration_max; | 352 int32 run_duration_max; |
| 318 int32 run_duration_sample; | 353 int32 run_duration_sample; |
| 319 int32 queue_duration_sum; | 354 int32 queue_duration_sum; |
| 320 int32 queue_duration_max; | 355 int32 queue_duration_max; |
| 321 int32 queue_duration_sample; | 356 int32 queue_duration_sample; |
| 322 }; | 357 }; |
| 323 | 358 |
| 324 //------------------------------------------------------------------------------ | 359 //------------------------------------------------------------------------------ |
| 360 // A "snapshotted" representation of the DeathData for a particular profiling |
| 361 // phase. |
| 362 |
| 363 struct DeathDataPhaseSnapshot { |
| 364 DeathDataPhaseSnapshot(int profiling_phase, const DeathData& death_data); |
| 365 |
| 366 // Profiling phase at which completion this snapshot was taken. |
| 367 int profiling_phase; |
| 368 // Death data snapshot. |
| 369 DeathDataSnapshot death_data; |
| 370 // Pointer to a snapshot from the previous phase. This object doesn't own the |
| 371 // pointed object. |
| 372 DeathDataPhaseSnapshot* prev; |
| 373 }; |
| 374 |
| 375 //------------------------------------------------------------------------------ |
| 325 // A temporary collection of data that can be sorted and summarized. It is | 376 // A temporary collection of data that can be sorted and summarized. It is |
| 326 // gathered (carefully) from many threads. Instances are held in arrays and | 377 // gathered (carefully) from many threads. Instances are held in arrays and |
| 327 // processed, filtered, and rendered. | 378 // processed, filtered, and rendered. |
| 328 // The source of this data was collected on many threads, and is asynchronously | 379 // The source of this data was collected on many threads, and is asynchronously |
| 329 // changing. The data in this instance is not asynchronously changing. | 380 // changing. The data in this instance is not asynchronously changing. |
| 330 | 381 |
| 331 struct BASE_EXPORT TaskSnapshot { | 382 struct BASE_EXPORT TaskSnapshot { |
| 332 TaskSnapshot(); | 383 TaskSnapshot(); |
| 333 TaskSnapshot(const BirthOnThread& birth, | 384 TaskSnapshot(const BirthOnThreadSnapshot& birth, |
| 334 const DeathData& death_data, | 385 const DeathDataSnapshot& death_data, |
| 335 const std::string& death_thread_name); | 386 const std::string& death_thread_name); |
| 336 ~TaskSnapshot(); | 387 ~TaskSnapshot(); |
| 337 | 388 |
| 338 BirthOnThreadSnapshot birth; | 389 BirthOnThreadSnapshot birth; |
| 390 // Delta between death data for a thread for a certain profiling phase and the |
| 391 // snapshot for the pervious phase, if any. Otherwise, just a snapshot. |
| 339 DeathDataSnapshot death_data; | 392 DeathDataSnapshot death_data; |
| 340 std::string death_thread_name; | 393 std::string death_thread_name; |
| 341 }; | 394 }; |
| 342 | 395 |
| 343 //------------------------------------------------------------------------------ | 396 //------------------------------------------------------------------------------ |
| 344 // For each thread, we have a ThreadData that stores all tracking info generated | 397 // For each thread, we have a ThreadData that stores all tracking info generated |
| 345 // on this thread. This prevents the need for locking as data accumulates. | 398 // on this thread. This prevents the need for locking as data accumulates. |
| 346 // We use ThreadLocalStorage to quickly identfy the current ThreadData context. | 399 // We use ThreadLocalStorage to quickly identfy the current ThreadData context. |
| 347 // We also have a linked list of ThreadData instances, and that list is used to | 400 // We also have a linked list of ThreadData instances, and that list is used to |
| 348 // harvest data from all existing instances. | 401 // harvest data from all existing instances. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // only used by the message loop, which has a well defined thread name. | 434 // only used by the message loop, which has a well defined thread name. |
| 382 static void InitializeThreadContext(const std::string& suggested_name); | 435 static void InitializeThreadContext(const std::string& suggested_name); |
| 383 | 436 |
| 384 // Using Thread Local Store, find the current instance for collecting data. | 437 // Using Thread Local Store, find the current instance for collecting data. |
| 385 // If an instance does not exist, construct one (and remember it for use on | 438 // If an instance does not exist, construct one (and remember it for use on |
| 386 // this thread. | 439 // this thread. |
| 387 // This may return NULL if the system is disabled for any reason. | 440 // This may return NULL if the system is disabled for any reason. |
| 388 static ThreadData* Get(); | 441 static ThreadData* Get(); |
| 389 | 442 |
| 390 // Fills |process_data_snapshot| with phased snapshots of all profiling | 443 // Fills |process_data_snapshot| with phased snapshots of all profiling |
| 391 // phases, including the current one. | 444 // phases, including the current one, identified by |current_profiling_phase|. |
| 392 static void Snapshot(ProcessDataSnapshot* process_data_snapshot); | 445 // |current_profiling_phase| is necessary because a child process can start |
| 446 // after several phase-changing events, so it needs to receive the current |
| 447 // phase number from the browser process to fill the correct entry for the |
| 448 // current phase in the |process_data_snapshot| map. |
| 449 static void Snapshot(int current_profiling_phase, |
| 450 ProcessDataSnapshot* process_data_snapshot); |
| 451 |
| 452 // Called when the current profiling phase, identified by |profiling_phase|, |
| 453 // ends. |
| 454 // |profiling_phase| is necessary because a child process can start after |
| 455 // several phase-changing events, so it needs to receive the phase number from |
| 456 // the browser process to fill the correct entry in the |
| 457 // completed_phases_snapshots_ map. |
| 458 static void OnProfilingPhaseCompletion(int profiling_phase); |
| 393 | 459 |
| 394 // Finds (or creates) a place to count births from the given location in this | 460 // Finds (or creates) a place to count births from the given location in this |
| 395 // thread, and increment that tally. | 461 // thread, and increment that tally. |
| 396 // TallyABirthIfActive will returns NULL if the birth cannot be tallied. | 462 // TallyABirthIfActive will returns NULL if the birth cannot be tallied. |
| 397 static Births* TallyABirthIfActive(const Location& location); | 463 static Births* TallyABirthIfActive(const Location& location); |
| 398 | 464 |
| 399 // Records the end of a timed run of an object. The |completed_task| contains | 465 // Records the end of a timed run of an object. The |completed_task| contains |
| 400 // a pointer to a Births, the time_posted, and a delayed_start_time if any. | 466 // a pointer to a Births, the time_posted, and a delayed_start_time if any. |
| 401 // The |start_of_run| indicates when we started to perform the run of the | 467 // The |start_of_run| indicates when we started to perform the run of the |
| 402 // task. The delayed_start_time is non-null for tasks that were posted as | 468 // task. The delayed_start_time is non-null for tasks that were posted as |
| 403 // delayed tasks, and it indicates when the task should have run (i.e., when | 469 // delayed tasks, and it indicates when the task should have run (i.e., when |
| 404 // it should have posted out of the timer queue, and into the work queue. | 470 // it should have posted out of the timer queue, and into the work queue. |
| 405 // The |end_of_run| was just obtained by a call to Now() (just after the task | 471 // The |end_of_run| was just obtained by a call to Now() (just after the task |
| 406 // finished). It is provided as an argument to help with testing. | 472 // finished). It is provided as an argument to help with testing. |
| 407 static void TallyRunOnNamedThreadIfTracking( | 473 static void TallyRunOnNamedThreadIfTracking( |
| 408 const base::TrackingInfo& completed_task, | 474 const base::TrackingInfo& completed_task, |
| 409 const TaskStopwatch& stopwatch); | 475 const TaskStopwatch& stopwatch); |
| 410 | 476 |
| 411 // Record the end of a timed run of an object. The |birth| is the record for | 477 // Record the end of a timed run of an object. The |birth| is the record for |
| 412 // the instance, the |time_posted| records that instant, which is presumed to | 478 // the instance, the |time_posted| records that instant, which is presumed to |
| 413 // be when the task was posted into a queue to run on a worker thread. | 479 // be when the task was posted into a queue to run on a worker thread. |
| 414 // The |start_of_run| is when the worker thread started to perform the run of | 480 // The |start_of_run| is when the worker thread started to perform the run of |
| 415 // the task. | 481 // the task. |
| 416 // The |end_of_run| was just obtained by a call to Now() (just after the task | 482 // The |end_of_run| was just obtained by a call to Now() (just after the task |
| 417 // finished). | 483 // finished). |
| 418 static void TallyRunOnWorkerThreadIfTracking(const Births* birth, | 484 static void TallyRunOnWorkerThreadIfTracking(const Births* births, |
| 419 const TrackedTime& time_posted, | 485 const TrackedTime& time_posted, |
| 420 const TaskStopwatch& stopwatch); | 486 const TaskStopwatch& stopwatch); |
| 421 | 487 |
| 422 // Record the end of execution in region, generally corresponding to a scope | 488 // Record the end of execution in region, generally corresponding to a scope |
| 423 // being exited. | 489 // being exited. |
| 424 static void TallyRunInAScopedRegionIfTracking(const Births* birth, | 490 static void TallyRunInAScopedRegionIfTracking(const Births* births, |
| 425 const TaskStopwatch& stopwatch); | 491 const TaskStopwatch& stopwatch); |
| 426 | 492 |
| 427 const std::string& thread_name() const { return thread_name_; } | 493 const std::string& thread_name() const { return thread_name_; } |
| 428 | 494 |
| 429 // Initializes all statics if needed (this initialization call should be made | 495 // Initializes all statics if needed (this initialization call should be made |
| 430 // while we are single threaded). Returns false if unable to initialize. | 496 // while we are single threaded). Returns false if unable to initialize. |
| 431 static bool Initialize(); | 497 static bool Initialize(); |
| 432 | 498 |
| 433 // Sets internal status_. | 499 // Sets internal status_. |
| 434 // If |status| is false, then status_ is set to DEACTIVATED. | 500 // If |status| is false, then status_ is set to DEACTIVATED. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 // TODO(jar): Make this a friend in DEBUG only, so that the optimizer has a | 552 // TODO(jar): Make this a friend in DEBUG only, so that the optimizer has a |
| 487 // better change of optimizing (inlining? etc.) private methods (knowing that | 553 // better change of optimizing (inlining? etc.) private methods (knowing that |
| 488 // there will be no need for an external entry point). | 554 // there will be no need for an external entry point). |
| 489 friend class TrackedObjectsTest; | 555 friend class TrackedObjectsTest; |
| 490 FRIEND_TEST_ALL_PREFIXES(TrackedObjectsTest, MinimalStartupShutdown); | 556 FRIEND_TEST_ALL_PREFIXES(TrackedObjectsTest, MinimalStartupShutdown); |
| 491 FRIEND_TEST_ALL_PREFIXES(TrackedObjectsTest, TinyStartupShutdown); | 557 FRIEND_TEST_ALL_PREFIXES(TrackedObjectsTest, TinyStartupShutdown); |
| 492 FRIEND_TEST_ALL_PREFIXES(TrackedObjectsTest, ParentChildTest); | 558 FRIEND_TEST_ALL_PREFIXES(TrackedObjectsTest, ParentChildTest); |
| 493 | 559 |
| 494 typedef std::map<const BirthOnThread*, int> BirthCountMap; | 560 typedef std::map<const BirthOnThread*, int> BirthCountMap; |
| 495 | 561 |
| 562 typedef std::vector<std::pair<const Births*, DeathDataPhaseSnapshot>> |
| 563 DeathsSnapshot; |
| 564 |
| 496 // Worker thread construction creates a name since there is none. | 565 // Worker thread construction creates a name since there is none. |
| 497 explicit ThreadData(int thread_number); | 566 explicit ThreadData(int thread_number); |
| 498 | 567 |
| 499 // Message loop based construction should provide a name. | 568 // Message loop based construction should provide a name. |
| 500 explicit ThreadData(const std::string& suggested_name); | 569 explicit ThreadData(const std::string& suggested_name); |
| 501 | 570 |
| 502 ~ThreadData(); | 571 ~ThreadData(); |
| 503 | 572 |
| 504 // Push this instance to the head of all_thread_data_list_head_, linking it to | 573 // Push this instance to the head of all_thread_data_list_head_, linking it to |
| 505 // the previous head. This is performed after each construction, and leaves | 574 // the previous head. This is performed after each construction, and leaves |
| 506 // the instance permanently on that list. | 575 // the instance permanently on that list. |
| 507 void PushToHeadOfList(); | 576 void PushToHeadOfList(); |
| 508 | 577 |
| 509 // (Thread safe) Get start of list of all ThreadData instances using the lock. | 578 // (Thread safe) Get start of list of all ThreadData instances using the lock. |
| 510 static ThreadData* first(); | 579 static ThreadData* first(); |
| 511 | 580 |
| 512 // Iterate through the null terminated list of ThreadData instances. | 581 // Iterate through the null terminated list of ThreadData instances. |
| 513 ThreadData* next() const; | 582 ThreadData* next() const; |
| 514 | 583 |
| 515 | 584 |
| 516 // In this thread's data, record a new birth. | 585 // In this thread's data, record a new birth. |
| 517 Births* TallyABirth(const Location& location); | 586 Births* TallyABirth(const Location& location); |
| 518 | 587 |
| 519 // Find a place to record a death on this thread. | 588 // Find a place to record a death on this thread. |
| 520 void TallyADeath(const Births& birth, | 589 void TallyADeath(const Births& births, |
| 521 int32 queue_duration, | 590 int32 queue_duration, |
| 522 const TaskStopwatch& stopwatch); | 591 const TaskStopwatch& stopwatch); |
| 523 | 592 |
| 524 // Snapshot (under a lock) the profiled data for the tasks in each ThreadData | 593 // Snapshots (under a lock) the profiled data for the tasks for this thread |
| 525 // instance. Also updates the |birth_counts| tally for each task to keep | 594 // and writes all of the executed tasks' data -- i.e. the data for all |
| 526 // track of the number of living instances of the task. | 595 // profiling phases (including the current one: |current_profiling_phase|) for |
| 527 static void SnapshotAllExecutedTasks( | 596 // the tasks with with entries in the death_map_ -- into |
| 528 ProcessDataPhaseSnapshot* process_data_phase, | 597 // |return_of_snapshot_hrenina|. Also updates the |birth_counts| tally for |
| 598 // each task to keep track of the number of living instances of the task -- |
| 599 // that is, each task maps to the number of births for the task that have not |
| 600 // yet been balanced by a death. |
| 601 void SnapshotExecutedTasks( |
| 602 int current_profiling_phase, |
| 603 PhasedProcessDataSnapshotMap* phased_process_data_snapshots, |
| 529 BirthCountMap* birth_counts); | 604 BirthCountMap* birth_counts); |
| 530 | 605 |
| 531 // Fills |process_data_phase| with all the recursive results in our process. | |
| 532 static void SnapshotCurrentPhase( | |
| 533 ProcessDataPhaseSnapshot* process_data_phase); | |
| 534 | |
| 535 // Snapshots (under a lock) the profiled data for the tasks for this thread | |
| 536 // and writes all of the executed tasks' data -- i.e. the data for the tasks | |
| 537 // with with entries in the death_map_ -- into |process_data_phase|. Also | |
| 538 // updates the |birth_counts| tally for each task to keep track of the number | |
| 539 // of living instances of the task -- that is, each task maps to the number of | |
| 540 // births for the task that have not yet been balanced by a death. | |
| 541 void SnapshotExecutedTasks(ProcessDataPhaseSnapshot* process_data_phase, | |
| 542 BirthCountMap* birth_counts); | |
| 543 | |
| 544 // Using our lock, make a copy of the specified maps. This call may be made | 606 // Using our lock, make a copy of the specified maps. This call may be made |
| 545 // on non-local threads, which necessitate the use of the lock to prevent | 607 // on non-local threads, which necessitate the use of the lock to prevent |
| 546 // the map(s) from being reallocated while they are copied. | 608 // the map(s) from being reallocated while they are copied. |
| 547 void SnapshotMaps(BirthMap* birth_map, | 609 void SnapshotMaps(int profiling_phase, |
| 548 DeathMap* death_map, | 610 BirthMap* birth_map, |
| 611 DeathsSnapshot* deaths, |
| 549 ParentChildSet* parent_child_set); | 612 ParentChildSet* parent_child_set); |
| 550 | 613 |
| 614 // Called for this thread when the current profiling phase, identified by |
| 615 // |profiling_phase|, ends. |
| 616 void OnProfilingPhaseCompletionOnThread(int profiling_phase); |
| 617 |
| 551 // This method is called by the TLS system when a thread terminates. | 618 // This method is called by the TLS system when a thread terminates. |
| 552 // The argument may be NULL if this thread has never tracked a birth or death. | 619 // The argument may be NULL if this thread has never tracked a birth or death. |
| 553 static void OnThreadTermination(void* thread_data); | 620 static void OnThreadTermination(void* thread_data); |
| 554 | 621 |
| 555 // This method should be called when a worker thread terminates, so that we | 622 // This method should be called when a worker thread terminates, so that we |
| 556 // can save all the thread data into a cache of reusable ThreadData instances. | 623 // can save all the thread data into a cache of reusable ThreadData instances. |
| 557 void OnThreadTerminationCleanup(); | 624 void OnThreadTerminationCleanup(); |
| 558 | 625 |
| 559 // Cleans up data structures, and returns statics to near pristine (mostly | 626 // Cleans up data structures, and returns statics to near pristine (mostly |
| 560 // uninitialized) state. If there is any chance that other threads are still | 627 // uninitialized) state. If there is any chance that other threads are still |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 ProcessDataSnapshot(); | 850 ProcessDataSnapshot(); |
| 784 ~ProcessDataSnapshot(); | 851 ~ProcessDataSnapshot(); |
| 785 | 852 |
| 786 PhasedProcessDataSnapshotMap phased_process_data_snapshots; | 853 PhasedProcessDataSnapshotMap phased_process_data_snapshots; |
| 787 base::ProcessId process_id; | 854 base::ProcessId process_id; |
| 788 }; | 855 }; |
| 789 | 856 |
| 790 } // namespace tracked_objects | 857 } // namespace tracked_objects |
| 791 | 858 |
| 792 #endif // BASE_TRACKED_OBJECTS_H_ | 859 #endif // BASE_TRACKED_OBJECTS_H_ |
| OLD | NEW |