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

Issue 9242035: Give isolates names to be used during debugging. (Closed)

Created:
8 years, 11 months ago by turnidge
Modified:
8 years, 11 months ago
Reviewers:
siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Give isolates names to be used during debugging. Implement --trace_isolates. ------------- Sample output of --trace_isolates for the CrossIsolateMessageTest: [+] Starting isolate: isolate: CrossIsolateMessageTest.dart/main-7112 [+] Starting isolate: isolate: CrossIsolateMessageTest.dart/CrossIsolate1.main-7114 [+] Starting isolate: isolate: CrossIsolateMessageTest.dart/CrossIsolate2.main-7115 [>] Posting message: source: CrossIsolateMessageTest.dart/main-7112 reply_port: 7117 dest: CrossIsolateMessageTest.dart/CrossIsolate2.main-7115 dest_port: 7115 [>] Posting message: source: CrossIsolateMessageTest.dart/CrossIsolate2.main-7115 reply_port: 7118 dest: CrossIsolateMessageTest.dart/main-7112 dest_port: 7117 [>] Posting message: source: CrossIsolateMessageTest.dart/main-7112 reply_port: 7119 dest: CrossIsolateMessageTest.dart/CrossIsolate1.main-7114 dest_port: 7114 [>] Posting message: source: CrossIsolateMessageTest.dart/CrossIsolate1.main-7114 reply_port: 7120 dest: CrossIsolateMessageTest.dart/main-7112 dest_port: 7119 [>] Posting message: source: CrossIsolateMessageTest.dart/main-7112 reply_port: 0 dest: CrossIsolateMessageTest.dart/CrossIsolate1.main-7114 dest_port: 7120 [>] Posting message: source: CrossIsolateMessageTest.dart/CrossIsolate1.main-7114 reply_port: 0 dest: CrossIsolateMessageTest.dart/CrossIsolate2.main-7115 dest_port: 7118 [>] Posting message: source: CrossIsolateMessageTest.dart/CrossIsolate2.main-7115 reply_port: 0 dest: CrossIsolateMessageTest.dart/main-7112 dest_port: 7116 [>] Posting message: source: CrossIsolateMessageTest.dart/main-7112 reply_port: 0 dest: CrossIsolateMessageTest.dart/main-7112 dest_port: 7113 [-] Stopping isolate: isolate: CrossIsolateMessageTest.dart/CrossIsolate2.main-7115 [-] Stopping isolate: isolate: CrossIsolateMessageTest.dart/CrossIsolate1.main-7114 [-] Stopping isolate: isolate: CrossIsolateMessageTest.dart/main-7112 Committed: https://code.google.com/p/dart/source/detail?r=3416

Patch Set 1 #

Total comments: 18

Patch Set 2 : '' #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -33 lines) Patch
M runtime/bin/gen_snapshot.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/main.cc View 1 5 chunks +27 lines, -6 lines 0 comments Download
M runtime/include/dart_api.h View 2 chunks +5 lines, -2 lines 3 comments Download
M runtime/lib/isolate.cc View 2 chunks +21 lines, -1 line 0 comments Download
M runtime/vm/dart.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/dart.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M runtime/vm/isolate.h View 4 chunks +5 lines, -1 line 0 comments Download
M runtime/vm/isolate.cc View 1 6 chunks +29 lines, -4 lines 0 comments Download
M runtime/vm/isolate_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/message_queue_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/port.cc View 2 chunks +14 lines, -1 line 0 comments Download
M runtime/vm/port_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/thread_test.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/unit_test.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/zone_test.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
turnidge
8 years, 11 months ago (2012-01-18 00:33:13 UTC) #1
siva
lgtm https://chromiumcodereview.appspot.com/9242035/diff/1/runtime/bin/main.cc File runtime/bin/main.cc (right): https://chromiumcodereview.appspot.com/9242035/diff/1/runtime/bin/main.cc#newcode370 runtime/bin/main.cc:370: } Would skipping past slashes cause the name ...
8 years, 11 months ago (2012-01-18 06:26:03 UTC) #2
turnidge
https://chromiumcodereview.appspot.com/9242035/diff/1/runtime/bin/main.cc File runtime/bin/main.cc (right): https://chromiumcodereview.appspot.com/9242035/diff/1/runtime/bin/main.cc#newcode370 runtime/bin/main.cc:370: } On 2012/01/18 06:26:03, asiva wrote: > Would skipping ...
8 years, 11 months ago (2012-01-18 21:29:20 UTC) #3
siva
lgtm https://chromiumcodereview.appspot.com/9242035/diff/1/runtime/vm/isolate.cc File runtime/vm/isolate.cc (right): https://chromiumcodereview.appspot.com/9242035/diff/1/runtime/vm/isolate.cc#newcode140 runtime/vm/isolate.cc:140: result->BuildName(name_prefix); Can this be done lazily when it ...
8 years, 11 months ago (2012-01-18 22:06:08 UTC) #4
Ivan Posva
https://chromiumcodereview.appspot.com/9242035/diff/9001/runtime/include/dart_api.h File runtime/include/dart_api.h (right): https://chromiumcodereview.appspot.com/9242035/diff/9001/runtime/include/dart_api.h#newcode248 runtime/include/dart_api.h:248: typedef bool (*Dart_IsolateCreateCallback)(const char* name_prefix, name_prefix and callback_data are ...
8 years, 11 months ago (2012-01-20 16:28:29 UTC) #5
turnidge
8 years, 11 months ago (2012-01-26 18:07:11 UTC) #6
I thought I had published these earlier.  This has been checked in at this
point.  Let me know if you want me to go back and change things.

:-/

Todd

http://codereview.chromium.org/9242035/diff/1/runtime/vm/isolate.cc
File runtime/vm/isolate.cc (right):

http://codereview.chromium.org/9242035/diff/1/runtime/vm/isolate.cc#newcode140
runtime/vm/isolate.cc:140: result->BuildName(name_prefix);
Well, the information being passed to this function, the name prefix, is
somewhat ephemeral.  I can't rely on it living past this function call.  So I
would have to copy it in any case, right?

On 2012/01/18 22:06:08, asiva wrote:
> Can this be done lazily when it is actually needed?
> It would be nice to keep isolate creation and init times low in order to have
> fast startup times.
> 
> On 2012/01/18 21:29:21, turnidge wrote:
> > On 2012/01/18 06:26:03, asiva wrote:
> > > Should the name be built only if tracing is enabled?
> > 
> > I plan to also use it when reporting top-level uncaught exceptions and the
> like.
>

http://codereview.chromium.org/9242035/diff/1/runtime/vm/isolate.cc#newcode162
runtime/vm/isolate.cc:162: const char* kFormat = "%s-%lld";
I do not believe that we reuse port numbers currently.

On 2012/01/18 22:06:08, asiva wrote:
> i.e if an isolate dies and another isolate is created and it happens to get
the
> same main port number. In the trace the name would be same but it is actually
a
> new isolate.
> 
> On 2012/01/18 21:29:21, turnidge wrote:
> > On 2012/01/18 06:26:03, asiva wrote:
> > > Maybe add a TODO here that generation issues in the name will be addressed
> > > later.
> > 
> > What generation issues?
>

Powered by Google App Engine
This is Rietveld 408576698