Commit Graph

20 Commits

Author SHA1 Message Date
John McCutchan f6b570aa2a Include thread CPU time in Timeline.
- [x] Refactor old OSThread interface for querying thread CPU time into OS::GetCurrentThreadCPUMicros.
- [x] Add data to TimelineEvent to track thread CPU time.
- [x] Include "tts" and "tdur" properties when converting the timeline to JSON

Fixes #26396

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1960483002 .
2016-05-05 16:34:09 -07:00
John McCutchan 4dee1c71c2 Fix Windows build
BUG=

Review URL: https://codereview.chromium.org/1960443003 .
2016-05-05 15:18:21 -07:00
John McCutchan 5d02929fa0 Fix the profiler for threads spawned from the Linux eventhandler
Fixes #26416

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1953143002 .
2016-05-05 14:45:37 -07:00
Siva Annamalai e83151cc77 - Add assertions in MutexLocker/MonitorLocker to ensure that the code enclosed
in these blocks will not have a safepoint operation
- changed boxed_field_list_monitor_ to boxed_field_list_mutex_ as we only
  need a mutex for guarding access to boxed_field_list_ as changed the
  lock to use SafepointMutexLocker as the list addition code could potentially
  allocate and result in GC (safepoint operation)
- Added a SafepointMonitorLocker as we have a function Isolate::VisitIsolates
  which could potentially have safepoints in the enclosed block.
- Make the lock around MegamorphicCacheTable::Lookup a SafepointMutexLocker
  as the look up code seems to be allocating memory while the lock is held.
- Changed the ThreadPool and MessageHandler code to account for the new
  MonitorLocker usage standard
- Fixed PortMap::PrintPortsForMessageHandler to use SafepointMutexLocker as
  the code it encloses calls into Dart
- Removed profiler_ field in class Profiler as it doesn't seem to be used.

R=johnmccutchan@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org/1748953003 .
2016-03-01 12:33:50 -08:00
Siva Annamalai b40775549f Fix for issue 25236
- Ensure that no new OSThreads are created once the VM is in shutdown mode
- Do not query thread_list_head_ without a lock (this leads to the race which causes two threads to delete the lock and TLS at the same time)

BUG=25236
R=zra@google.com

Review URL: https://codereview.chromium.org/1537543002 .
2015-12-18 10:16:28 -08:00
Florian Schneider 59fd6c8397 VM: Small clean up and const-ness fix for Thread/OSThread constants.
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1482243006 .
2015-12-02 12:30:12 +01:00
John McCutchan aaf37ad035 Landing patch set 7 from https://codereview.chromium.org/1450113003/
Review URL: https://codereview.chromium.org/1466523002 .
2015-11-19 14:18:52 -08:00
Siva Annamalai 9e19d236ca - Add an OSThread structure which is the generic TLS structure for all C++
fields in a thread (i.e fields that are not Dart VM related)
- Split the Thread structure to be a pure Dart per thread structure and add
  a pointer to os_thread which points to the OSThread structure
- Change Schedule/UnSchedule to set the Dart Thread structure as the TLS of
  the thread when it is inside the Dart world and reset the TLS back to the
  OSThread strcuture when is exits the Dart World.
- Moved the stack_base and few stack size related functions to OSThread from Isolate

R=johnmccutchan@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1439483003 .
2015-11-19 13:45:10 -08:00
John McCutchan 28e416b1f4 Revert "Avoid strerror_r portability issues"
This reverts commit ca81c1732b.
2015-11-17 16:34:25 -08:00
John McCutchan ca81c1732b Avoid strerror_r portability issues
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1450113003 .
2015-11-17 15:23:47 -08:00
Siva Annamalai 1a038d5030 Add lock owner information for class Monitor and add assertions for wait/notify/notifyall.
R=johnmccutchan@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org/1426743002 .
2015-10-27 13:47:10 -07:00
John McCutchan 6fc0af49dd Build fixes for fnl/musl
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1406253005 .
2015-10-21 09:17:55 -07:00
Zachary Anderson cc0a9c3e7e Fix calls to pthread_join
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1412343002 .
2015-10-19 15:10:46 -07:00
John McCutchan 8685d2ebf5 Add OSThread::GetCurrentThreadTraceId and use it in the timeline implementation
- This ensures our trace-event thread ids match the thread ids used in Chromium's base.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1368793002 .
2015-09-24 14:57:30 -07:00
Zachary Anderson 7093f2996b VM thread shutdown.
BUG=
R=iposva@google.com, turnidge@google.com

Review URL: https://codereview.chromium.org//1275353005 .
2015-09-15 12:49:52 -07:00
John McCutchan 0ae89cf980 Fix MacOS build
BUG=

Review URL: https://codereview.chromium.org//1286093005 .
2015-08-12 15:01:21 -07:00
Daniel Andersson 868d2c6c3e The sweeper must not be running during isolate shutdown.
In release mode, there seems to be nothing to prevent this.
In debug mode, the "Verify" call waits for the sweeper, but there is still a race between the task count update and the ExitIsolateAsHelper call, which could cause problems.

Fix both of these, and add more assertions and verbose error messages.

- make sweeper task cleanly exit isolate *before* notifying
- wait for sweeper before shutting down isolate
- verbose pthread failures

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1233563004 .
2015-07-13 17:49:49 -07:00
koda@google.com 1e3b00d72e Automatic thread cleanup on non-Windows platforms.
Issue 23474 is tracking Windows support (use Chromium's method).

BUG=23474
R=iposva@google.com

Review URL: https://codereview.chromium.org//1134003005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45817 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 17:30:33 +00:00
koda@google.com b1634f7c30 Isolate -> Thread for tracking owner of mutex and simulator's exclusive access.
Prepares for multiple threads referencing the same isolate (in particular, the mutator and sweeper).

R=asiva@google.com

Review URL: https://codereview.chromium.org//999983004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44762 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 20:33:36 +00:00
koda@google.com c7e9e048ed Rename Thread -> OSThread.
It's a collection of static utility methods for primitive operations on OS threads.

Make room in the namespace for upcoming class that will represent all the complex state of a VM thread.

Review URL: https://codereview.chromium.org//796063006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42895 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 02:30:07 +00:00