| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 return true; | 1437 return true; |
| 1438 } else { | 1438 } else { |
| 1439 PrintError(js, "Unrecognized subcommand '%s'", sub_command); | 1439 PrintError(js, "Unrecognized subcommand '%s'", sub_command); |
| 1440 return true; | 1440 return true; |
| 1441 } | 1441 } |
| 1442 } | 1442 } |
| 1443 // A full profile includes disassembly of all Dart code objects. | 1443 // A full profile includes disassembly of all Dart code objects. |
| 1444 // TODO(johnmccutchan): Add sub command to trigger full code dump. | 1444 // TODO(johnmccutchan): Add sub command to trigger full code dump. |
| 1445 bool full_profile = false; | 1445 bool full_profile = false; |
| 1446 const char* tags_option = js->LookupOption("tags"); | 1446 const char* tags_option = js->LookupOption("tags"); |
| 1447 bool use_tags = true; | 1447 Profiler::TagOrder tag_order = Profiler::kUserVM; |
| 1448 if (tags_option != NULL) { | 1448 if (js->HasOption("tags")) { |
| 1449 if (strcmp("hide", tags_option) != 0) { | 1449 if (js->OptionIs("tags", "hide")) { |
| 1450 tag_order = Profiler::kNoTags; |
| 1451 } else if (js->OptionIs("tags", "uv")) { |
| 1452 tag_order = Profiler::kUserVM; |
| 1453 } else if (js->OptionIs("tags", "u")) { |
| 1454 tag_order = Profiler::kUser; |
| 1455 } else if (js->OptionIs("tags", "vu")) { |
| 1456 tag_order = Profiler::kVMUser; |
| 1457 } else if (js->OptionIs("tags", "v")) { |
| 1458 tag_order = Profiler::kVM; |
| 1459 } else { |
| 1450 PrintError(js, "Invalid tags option value: %s\n", tags_option); | 1460 PrintError(js, "Invalid tags option value: %s\n", tags_option); |
| 1451 return true; | 1461 return true; |
| 1452 } | 1462 } |
| 1453 use_tags = false; | |
| 1454 } | 1463 } |
| 1455 Profiler::PrintToJSONStream(isolate, js, full_profile, use_tags); | 1464 Profiler::PrintToJSONStream(isolate, js, full_profile, tag_order); |
| 1456 return true; | 1465 return true; |
| 1457 } | 1466 } |
| 1458 | 1467 |
| 1459 static bool HandleCoverage(Isolate* isolate, JSONStream* js) { | 1468 static bool HandleCoverage(Isolate* isolate, JSONStream* js) { |
| 1460 CodeCoverage::PrintToJSONStream(isolate, js); | 1469 CodeCoverage::PrintToJSONStream(isolate, js); |
| 1461 return true; | 1470 return true; |
| 1462 } | 1471 } |
| 1463 | 1472 |
| 1464 | 1473 |
| 1465 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { | 1474 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 while (current != NULL) { | 1908 while (current != NULL) { |
| 1900 if (strcmp(name, current->name()) == 0) { | 1909 if (strcmp(name, current->name()) == 0) { |
| 1901 return current; | 1910 return current; |
| 1902 } | 1911 } |
| 1903 current = current->next(); | 1912 current = current->next(); |
| 1904 } | 1913 } |
| 1905 return NULL; | 1914 return NULL; |
| 1906 } | 1915 } |
| 1907 | 1916 |
| 1908 } // namespace dart | 1917 } // namespace dart |
| OLD | NEW |