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

Side by Side Diff: src/api.cc

Issue 12919002: Allow recording individual samples in addition to the aggregated CPU profiles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed indentation Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8-profiler.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6436 matching lines...) Expand 10 before | Expand all | Expand 10 after
6447 } 6447 }
6448 6448
6449 6449
6450 unsigned CpuProfileNode::GetCallUid() const { 6450 unsigned CpuProfileNode::GetCallUid() const {
6451 i::Isolate* isolate = i::Isolate::Current(); 6451 i::Isolate* isolate = i::Isolate::Current();
6452 IsDeadCheck(isolate, "v8::CpuProfileNode::GetCallUid"); 6452 IsDeadCheck(isolate, "v8::CpuProfileNode::GetCallUid");
6453 return reinterpret_cast<const i::ProfileNode*>(this)->entry()->GetCallUid(); 6453 return reinterpret_cast<const i::ProfileNode*>(this)->entry()->GetCallUid();
6454 } 6454 }
6455 6455
6456 6456
6457 unsigned CpuProfileNode::GetNodeId() const {
6458 return reinterpret_cast<const i::ProfileNode*>(this)->id();
6459 }
6460
6461
6457 int CpuProfileNode::GetChildrenCount() const { 6462 int CpuProfileNode::GetChildrenCount() const {
6458 i::Isolate* isolate = i::Isolate::Current(); 6463 i::Isolate* isolate = i::Isolate::Current();
6459 IsDeadCheck(isolate, "v8::CpuProfileNode::GetChildrenCount"); 6464 IsDeadCheck(isolate, "v8::CpuProfileNode::GetChildrenCount");
6460 return reinterpret_cast<const i::ProfileNode*>(this)->children()->length(); 6465 return reinterpret_cast<const i::ProfileNode*>(this)->children()->length();
6461 } 6466 }
6462 6467
6463 6468
6464 const CpuProfileNode* CpuProfileNode::GetChild(int index) const { 6469 const CpuProfileNode* CpuProfileNode::GetChild(int index) const {
6465 i::Isolate* isolate = i::Isolate::Current(); 6470 i::Isolate* isolate = i::Isolate::Current();
6466 IsDeadCheck(isolate, "v8::CpuProfileNode::GetChild"); 6471 IsDeadCheck(isolate, "v8::CpuProfileNode::GetChild");
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
6499 6504
6500 6505
6501 const CpuProfileNode* CpuProfile::GetTopDownRoot() const { 6506 const CpuProfileNode* CpuProfile::GetTopDownRoot() const {
6502 i::Isolate* isolate = i::Isolate::Current(); 6507 i::Isolate* isolate = i::Isolate::Current();
6503 IsDeadCheck(isolate, "v8::CpuProfile::GetTopDownRoot"); 6508 IsDeadCheck(isolate, "v8::CpuProfile::GetTopDownRoot");
6504 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); 6509 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
6505 return reinterpret_cast<const CpuProfileNode*>(profile->top_down()->root()); 6510 return reinterpret_cast<const CpuProfileNode*>(profile->top_down()->root());
6506 } 6511 }
6507 6512
6508 6513
6514 const CpuProfileNode* CpuProfile::GetSample(int index) const {
6515 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
6516 return reinterpret_cast<const CpuProfileNode*>(profile->sample(index));
6517 }
6518
6519
6520 int CpuProfile::GetSamplesCount() const {
6521 return reinterpret_cast<const i::CpuProfile*>(this)->samples_count();
6522 }
6523
6524
6509 int CpuProfiler::GetProfilesCount() { 6525 int CpuProfiler::GetProfilesCount() {
6510 i::Isolate* isolate = i::Isolate::Current(); 6526 i::Isolate* isolate = i::Isolate::Current();
6511 IsDeadCheck(isolate, "v8::CpuProfiler::GetProfilesCount"); 6527 IsDeadCheck(isolate, "v8::CpuProfiler::GetProfilesCount");
6512 return i::CpuProfiler::GetProfilesCount(); 6528 return i::CpuProfiler::GetProfilesCount();
6513 } 6529 }
6514 6530
6515 6531
6516 const CpuProfile* CpuProfiler::GetProfile(int index, 6532 const CpuProfile* CpuProfiler::GetProfile(int index,
6517 Handle<Value> security_token) { 6533 Handle<Value> security_token) {
6518 i::Isolate* isolate = i::Isolate::Current(); 6534 i::Isolate* isolate = i::Isolate::Current();
6519 IsDeadCheck(isolate, "v8::CpuProfiler::GetProfile"); 6535 IsDeadCheck(isolate, "v8::CpuProfiler::GetProfile");
6520 return reinterpret_cast<const CpuProfile*>( 6536 return reinterpret_cast<const CpuProfile*>(
6521 i::CpuProfiler::GetProfile( 6537 i::CpuProfiler::GetProfile(
6522 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token), 6538 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
6523 index)); 6539 index));
6524 } 6540 }
6525 6541
6526 6542
6527 const CpuProfile* CpuProfiler::FindProfile(unsigned uid, 6543 const CpuProfile* CpuProfiler::FindProfile(unsigned uid,
6528 Handle<Value> security_token) { 6544 Handle<Value> security_token) {
6529 i::Isolate* isolate = i::Isolate::Current(); 6545 i::Isolate* isolate = i::Isolate::Current();
6530 IsDeadCheck(isolate, "v8::CpuProfiler::FindProfile"); 6546 IsDeadCheck(isolate, "v8::CpuProfiler::FindProfile");
6531 return reinterpret_cast<const CpuProfile*>( 6547 return reinterpret_cast<const CpuProfile*>(
6532 i::CpuProfiler::FindProfile( 6548 i::CpuProfiler::FindProfile(
6533 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token), 6549 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
6534 uid)); 6550 uid));
6535 } 6551 }
6536 6552
6537 6553
6538 void CpuProfiler::StartProfiling(Handle<String> title) { 6554 void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) {
6539 i::Isolate* isolate = i::Isolate::Current(); 6555 i::Isolate* isolate = i::Isolate::Current();
6540 IsDeadCheck(isolate, "v8::CpuProfiler::StartProfiling"); 6556 IsDeadCheck(isolate, "v8::CpuProfiler::StartProfiling");
6541 i::CpuProfiler::StartProfiling(*Utils::OpenHandle(*title)); 6557 i::CpuProfiler::StartProfiling(*Utils::OpenHandle(*title), record_samples);
6542 } 6558 }
6543 6559
6544 6560
6545 const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title, 6561 const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title,
6546 Handle<Value> security_token) { 6562 Handle<Value> security_token) {
6547 i::Isolate* isolate = i::Isolate::Current(); 6563 i::Isolate* isolate = i::Isolate::Current();
6548 IsDeadCheck(isolate, "v8::CpuProfiler::StopProfiling"); 6564 IsDeadCheck(isolate, "v8::CpuProfiler::StopProfiling");
6549 return reinterpret_cast<const CpuProfile*>( 6565 return reinterpret_cast<const CpuProfile*>(
6550 i::CpuProfiler::StopProfiling( 6566 i::CpuProfiler::StopProfiling(
6551 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token), 6567 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
7069 7085
7070 v->VisitPointers(blocks_.first(), first_block_limit_); 7086 v->VisitPointers(blocks_.first(), first_block_limit_);
7071 7087
7072 for (int i = 1; i < blocks_.length(); i++) { 7088 for (int i = 1; i < blocks_.length(); i++) {
7073 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7089 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7074 } 7090 }
7075 } 7091 }
7076 7092
7077 7093
7078 } } // namespace v8::internal 7094 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698