Commit Graph

242 Commits

Author SHA1 Message Date
johnmccutchan@google.com 52022c23fd Do not register service isolate descendants for debugging
BUG=
R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45304 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 01:10:54 +00:00
turnidge@google.com ca5de9eac9 Kill service_test.cc tests in favor of dart tests for the service protocol.
Associated cleanups and fixes that I noticed as I rewrote the tests.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45257 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 21:08:02 +00:00
turnidge@google.com 0edd5aae1e Some cleanups in the code that posts results to service clients.
- Remove the notion of event families and masks.  This wasn't really used.

- Change "response" to "result" in our response map to be more json-rpc-like.

- Pass events to the service isolate as Strings.

- Add more type declarations around raw data (Uint8List) responses.

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45034 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 21:08:38 +00:00
turnidge@google.com fb591fc36a Continue improving the documentation for the vm service protocol.
Clean up the protocol a bit as I go.

---

Addendum:

Clean up inconsistencies between field and function ownership in the protocol.

Change the names of implicit closure functions (!)

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44923 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-06 19:24:47 +00:00
turnidge@google.com 52538c5315 Tidy up the service protocol. Begin improving the documentation.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44865 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-02 19:16:35 +00:00
johnmccutchan@google.com d2f5d87c96 Shutdown the service isolate when shutting down the VM
- Add a service control message to initiate service isolate shutdown.
- Provide a callback for the embedder to do any service isolate cleanup.
- Dart_Cleanup will now block until the service isolate shuts down.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44685 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 15:50:19 +00:00
turnidge@google.com 1f851c718c Implement 'print', 'up', 'down', and 'frame' commands in the Observatory debugger.
Implement in-frame evaluation in the vm service.

Add a notion of 'current frame' and use it across the debugger,
particularly in source-location based commands (break, clear).

Change the expansion logic for frames, so that by default only the
current frame is shown.  When a user expands a frame it is now pinned.

Change command line parsing so that internal whitespace is preserved.  We need this to properly evaluate expressions with internal whitespace.

Fix a deadlock in the debugger message loop.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44353 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 00:07:45 +00:00
turnidge@google.com f9f2d9c017 Major rework of vm service events
--------
VM

Add a new ServiceEvent class in the vm.  Rework the event type names.

Add BreakpointAdded, BreakpointResolved, and BreakpointRemoved
service events.

Record the top frame for kIsolateInterrupted and kExceptionThrown
debugger events.

Send a top frame in more Pause* events.

Send breakpoint list with the Isolate response.  Remove the
getBreakpoints method from the vm service.

Move Resume events into debugger.cc.

Rework MessageHandler a bit so that we can send PauseStart and
PauseExit notifications.

--------
Observatory

Move some event handler from Application to Isolate.

Rewrite breakpoint tracking code to use the new breakpoint events.

Change run state tracking in Isolate.

Change getFromMap so that it applies updates if the map isn't a ref.

Use getFromMap instead of new ServiceObject in invokeRpc.  This
fixes some duplicate ServiceObject problems.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44268 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-05 19:02:42 +00:00
johnmccutchan@google.com 65bab52df5 Fix HTTP support in vm-service
- Add back Message.fromUri constructor.
- Fix 'root' isolateId alias.
- FATAL on missing source files when starting up the service isolate.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43814 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 16:36:36 +00:00
turnidge@google.com ace003886c Implement function entry breakpoints in Observatory debugger.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43782 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-13 22:37:39 +00:00
rmacnak@google.com 446137ff5e Add getCallSiteData to the VM service.
Review URL: https://codereview.chromium.org//920113002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43740 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 20:55:33 +00:00
turnidge@google.com d554f4fbfe Finish moving service protocol to json rpc.
Service

- Remove support for old-style service requests.

- Drop 'arguments' from JsonStream and ServiceRequestHandler.

- Json-rpc inspired renaming: command->method, options->params all over.

- Implement getFlagList, setFlag, getObjectByAddress.

- Add helpers PrintMissingParamError and PrintInvalidParamError
  to make our error messages more regular.

- Update tests.

- Service_SetSource removed for now.  John will resurrect.

Observatory

- Drop all Deprecated 'get' functions.  We now use json rpc for everything.

- Drop 'link' and 'relativeLink' from ServiceObject -- they were
  ui-specific and they are no longer meaningful anyways.  Use 'id' instead.

- New pages: VMPage, FlagsPage, InspectPage, ErrorPage.  All urls
  used by Observatory are now 'new school' and have a proper
  prefix.  ErrorPage is the new catch-all.

- Pages now use a Uri instead of a url String.  This lets them
  grab query parameters more easily.

- SimplePage replaces IsolateSuffixPage.

- We now use gotoLink() or makeLink() to make our navigation
  links.  gotoLink gets some optional parameters to make it
  easier to construct links to ServiceObjects.

- Rework mouse clicks on the heap map to use getObjectByAddress.

- Remove the breakpoint_list.  It wasn't working.  I'll add it back later.

- Silence logging of getIsolateMetric/getVMMetric.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43514 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 17:45:52 +00:00
johnmccutchan@google.com 1426cfc03b Port metrics to RPC
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43486 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 21:27:49 +00:00
johnmccutchan@google.com d9e951d5a3 Port _echo, etc commands to RPC
BUG=
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43447 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 23:17:05 +00:00
johnmccutchan@google.com 9d1bb3aa6b Port type arguments to new RPC protocol
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43428 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 21:26:19 +00:00
johnmccutchan@google.com 57ea35671c Add getClassList RPC
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43414 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 17:59:45 +00:00
turnidge@google.com e65e6fab9d Begin migrating the vm service from a rest-style interface to a json-rpc style interface.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43370 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 23:15:40 +00:00
johnmccutchan@google.com 172baa03ff Service isolate rework take 2
Review URL: https://codereview.chromium.org//889443002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43306 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 18:31:27 +00:00
johnmccutchan@google.com db271b0477 Revert r43217, r43215, r43208, r43207, and r43202.
Reverting because of some isolate spawn issues (on Windows, and pub bots).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43219 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 22:56:18 +00:00
johnmccutchan@google.com 66aa470fc6 * Create vm-service isolate at Dart_Initialize time.
* Remove Service create callback.
* Simplify creation of service isolate.
* Creation is done on thread pool.
* Use vm-service isolate for loading in standalone embedder.
* Remove import of dart:io from builtin library.

performance changes:

no service isolate:

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

always start service isolate (as a thread pool task):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:45 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:44 | 100% | +12363 | -    0]

service does I/O (calls to Dart_LoadScript block until service is running):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43202 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 19:45:48 +00:00
johnmccutchan@google.com 435c6ad7ac Reduce service isolate startup time from ~80ms to ~30ms
- Get access to dart:io internal signal listening function using API instead of mirrors.

- Service isolate can start with service deactivated.
- Load Observatory front end resources only when service activated.
- Do not execute Dart Service code until service is activated.
- Register live isolates when service is activated.

- Startup refactored to allow for future use of script snapshots.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40124 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 22:38:33 +00:00
turnidge@google.com 320c1bb74d Rework how types work in the VM Service.
We now return a "type" property and an optional "_vmType" property for
each response.  We use this to "hide" vm implementation specifics in
the VM Service protocol.

For example, before we might have returned an integer reference with type
"@Smi".  Now it would have the type "@int" and the _vmType "@Smi".

This also allows us to hide funky vm internal types behind the generic
"Object" type.

Updated the protocol.md file somewhat to describe a notion of "private
properties".

Updated the Observatory and unit tests.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40044 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 17:25:52 +00:00
turnidge@google.com 2503f18081 Don't duplicate reference properties in the protocol.md file.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39704 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 16:37:31 +00:00
turnidge@google.com 8a3c490f6b Add a new Sentinel type for sentinel responses. (They are not Null).
Fix some stray problems.

Silence warnings about stray GC events.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39663 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 16:52:01 +00:00
turnidge@google.com beebba4624 More service api cleanup.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39609 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 17:13:31 +00:00
turnidge@google.com d6e5813104 Add more types to service/protocol.md
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39603 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 16:32:17 +00:00
johnmccutchan@google.com 203b700715 Add many response types
BUG=
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39601 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 16:08:23 +00:00
turnidge@google.com 4d5f3ba638 vmservice protocol cleanup
user_name -> name
name -> vmName

Also, vmName is now only provided when it differs from name.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39525 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-25 18:53:43 +00:00
turnidge@google.com afb008d480 Edits to protocol.md.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39433 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 22:09:58 +00:00
turnidge@google.com 23bed26ecb Initial commit of service/protocol.md
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39425 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 20:12:18 +00:00
koda@google.com 5d5deec4e6 Optional binary payloads in VM service events.
Allow an event to send a binary blob in addition to its JSON message.
For testing, add _Echo event type that is triggered by an _echo/event request.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39332 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 15:35:03 +00:00
koda@google.com 6312736130 Add a new event family for GC-related events, and generate an event after each garbage collection with basic stats.
One reason for this is to provide a structured alternative to the ad hoc logging format of --verbose_gc, and to move some functionality currently provided by standalone one-off scripts into the observatory.

Add first unit test for events.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39014 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-07 23:52:18 +00:00
turnidge@google.com f849afc751 Add support for asynchronous event notification to the observatory.
Implement "isolate pause" notifications.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37841 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 22:46:27 +00:00
iposva@google.com 651ded192e - Add possibility to redirect messages if they were not delivered.
- Prepare OOB handling for more than service messages.
- Do not use growable arrays when growing is not necessary.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36772 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 21:58:33 +00:00
johnmccutchan@google.com c3a88f02c0 Register existing isolates when service isolate is started
BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35227 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-21 22:16:34 +00:00
johnmccutchan@google.com 182fcd0921 Add isolate tag-profile model and UI.
Distinction between a Dart Error and a ServiceError/ServiceException.
Better Observatory behaviour when a ServiceError/ServiceExceptions occurs.
Display isolate's sticky error.

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34377 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-25 18:09:02 +00:00
turnidge@google.com 9c5c7040dc Add a VM page to the observatory.
Make the VM a ServiceObject.  Some refactoring in the ServiceObject
implementation.

IsolateList is no longer a ServiceObject.  It should eventually become more like our caches.

Support the /vm request in the vm.  Remove isolate list request.

Improvements to Isolate::PrintToJSONStream: always provide a
reasonable name.  Use the same code to produce isolate refs and
non-refs.

Improve isolate status message when the isolate is paused at
start/exit.  Add a resume link to the isolate view.

Add a navbar to the error page so that dartium users are less likely
to get stuck.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34204 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-20 21:00:10 +00:00
johnmccutchan@google.com 6edd276df8 Switch Observatory to use only ServiceObject instances.
All fetched objects are upgraded to a ServiceObject.
ServiceObjectCache.
Uniform updating / refreshing.
Fix UTF8 string escaping in TextBuffer (should fix invalid character bug https://code.google.com/p/dart/issues/detail?id=16590)

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33541 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 17:48:09 +00:00
turnidge@google.com b891e78325 Post-meetup feature extravaganza.
Remodel the top-level isolate summary page.

Add variables to stack frames in the stack trace.

Stop putting small integers and bools in the object id ring.

Rework how we pass down null references (and null-like references like
uninitialized values).

Collect all isolate timers by default.

Change the lifetime of IsolateSpawnState so that we can refer to it
later to know how an isolate started up.  Stop pretending that
IsolateSpawnState is a void*.  Clean up vestigial IsolateStartData.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32128 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-29 18:40:12 +00:00
johnmccutchan@google.com 9ca09b50e7 Track live instance and allocation counts for classes.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31978 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-22 19:21:22 +00:00
turnidge@google.com 12f8555b19 Allow root level requests in the vm service.
Move /cpu to the root level.

Move PostReply to the command handlers.  This will allow command
handlers to reply asynchronously (by delegating elsewhere) if they
need to.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31849 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 20:45:39 +00:00
johnmccutchan@google.com c76b6eb1c2 Split service into VM and embedder specific bits.
Move most service sources into the VM.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31809 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-14 22:34:43 +00:00