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

Side by Side Diff: include/v8-profiler.h

Issue 983833006: Remove uid and title from HeapSnapshot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@cpu-profiling
Patch Set: Addressed review comments Created 5 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
« no previous file with comments | « no previous file | src/api.cc » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_V8_PROFILER_H_ 5 #ifndef V8_V8_PROFILER_H_
6 #define V8_V8_PROFILER_H_ 6 #define V8_V8_PROFILER_H_
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 /** 10 /**
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 /** 307 /**
308 * HeapSnapshots record the state of the JS heap at some moment. 308 * HeapSnapshots record the state of the JS heap at some moment.
309 */ 309 */
310 class V8_EXPORT HeapSnapshot { 310 class V8_EXPORT HeapSnapshot {
311 public: 311 public:
312 enum SerializationFormat { 312 enum SerializationFormat {
313 kJSON = 0 // See format description near 'Serialize' method. 313 kJSON = 0 // See format description near 'Serialize' method.
314 }; 314 };
315 315
316 /** Returns heap snapshot UID (assigned by the profiler.) */
317 unsigned GetUid() const;
318
319 /** Returns heap snapshot title. */
320 Handle<String> GetTitle() const;
321
322 /** Returns the root node of the heap graph. */ 316 /** Returns the root node of the heap graph. */
323 const HeapGraphNode* GetRoot() const; 317 const HeapGraphNode* GetRoot() const;
324 318
325 /** Returns a node by its id. */ 319 /** Returns a node by its id. */
326 const HeapGraphNode* GetNodeById(SnapshotObjectId id) const; 320 const HeapGraphNode* GetNodeById(SnapshotObjectId id) const;
327 321
328 /** Returns total nodes count in the snapshot. */ 322 /** Returns total nodes count in the snapshot. */
329 int GetNodesCount() const; 323 int GetNodesCount() const;
330 324
331 /** Returns a node by index. */ 325 /** Returns a node by index. */
(...skipping 28 matching lines...) Expand all
360 * edge_count: nnn 354 * edge_count: nnn
361 * }, 355 * },
362 * nodes: [nodes array], 356 * nodes: [nodes array],
363 * edges: [edges array], 357 * edges: [edges array],
364 * strings: [strings array] 358 * strings: [strings array]
365 * } 359 * }
366 * 360 *
367 * Nodes reference strings, other nodes, and edges by their indexes 361 * Nodes reference strings, other nodes, and edges by their indexes
368 * in corresponding arrays. 362 * in corresponding arrays.
369 */ 363 */
370 void Serialize(OutputStream* stream, SerializationFormat format) const; 364 void Serialize(OutputStream* stream,
365 SerializationFormat format = kJSON) const;
371 }; 366 };
372 367
373 368
374 /** 369 /**
375 * An interface for reporting progress and controlling long-running 370 * An interface for reporting progress and controlling long-running
376 * activities. 371 * activities.
377 */ 372 */
378 class V8_EXPORT ActivityControl { // NOLINT 373 class V8_EXPORT ActivityControl { // NOLINT
379 public: 374 public:
380 enum ControlOption { 375 enum ControlOption {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 /** 440 /**
446 * Returns name to be used in the heap snapshot for given node. Returned 441 * Returns name to be used in the heap snapshot for given node. Returned
447 * string must stay alive until snapshot collection is completed. 442 * string must stay alive until snapshot collection is completed.
448 */ 443 */
449 virtual const char* GetName(Handle<Object> object) = 0; 444 virtual const char* GetName(Handle<Object> object) = 0;
450 protected: 445 protected:
451 virtual ~ObjectNameResolver() {} 446 virtual ~ObjectNameResolver() {}
452 }; 447 };
453 448
454 /** 449 /**
455 * Takes a heap snapshot and returns it. Title may be an empty string. 450 * Takes a heap snapshot and returns it. Title parameter is deprecated and
451 * should be an empty string.
452 * TODO: deprecate this method.
456 */ 453 */
457 const HeapSnapshot* TakeHeapSnapshot( 454 const HeapSnapshot* TakeHeapSnapshot(
458 Handle<String> title, 455 Handle<String> title,
459 ActivityControl* control = NULL, 456 ActivityControl* control = NULL,
460 ObjectNameResolver* global_object_name_resolver = NULL); 457 ObjectNameResolver* global_object_name_resolver = NULL);
461 458
459 const HeapSnapshot* TakeHeapSnapshot(
460 ActivityControl* control = NULL,
461 ObjectNameResolver* global_object_name_resolver = NULL);
462
462 /** 463 /**
463 * Starts tracking of heap objects population statistics. After calling 464 * Starts tracking of heap objects population statistics. After calling
464 * this method, all heap objects relocations done by the garbage collector 465 * this method, all heap objects relocations done by the garbage collector
465 * are being registered. 466 * are being registered.
466 * 467 *
467 * |track_allocations| parameter controls whether stack trace of each 468 * |track_allocations| parameter controls whether stack trace of each
468 * allocation in the heap will be recorded and reported as part of 469 * allocation in the heap will be recorded and reported as part of
469 * HeapSnapshot. 470 * HeapSnapshot.
470 */ 471 */
471 void StartTrackingHeapObjects(bool track_allocations = false); 472 void StartTrackingHeapObjects(bool track_allocations = false);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 uint32_t index; // Index of the time interval that was changed. 610 uint32_t index; // Index of the time interval that was changed.
610 uint32_t count; // New value of count field for the interval with this index. 611 uint32_t count; // New value of count field for the interval with this index.
611 uint32_t size; // New value of size field for the interval with this index. 612 uint32_t size; // New value of size field for the interval with this index.
612 }; 613 };
613 614
614 615
615 } // namespace v8 616 } // namespace v8
616 617
617 618
618 #endif // V8_V8_PROFILER_H_ 619 #endif // V8_V8_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698