Home | History | Annotate | Download | only in proto
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 //
      5 // Performance metrics collected via Chrome's built-in profiler.
      6 
      7 syntax = "proto2";
      8 
      9 option optimize_for = LITE_RUNTIME;
     10 
     11 package metrics;
     12 
     13 
     14 // Next tag: 4
     15 message ProfilerEventProto {
     16   // The type of this profile.
     17   enum ProfileType {
     18     UNKNOWN_PROFILE = 0;  // Unknown type (should not reach here).
     19     STARTUP_PROFILE = 1;  // Startup profile, logged approximately 60 seconds
     20                           // after launch.
     21   }
     22   optional ProfileType profile_type = 1;
     23 
     24   // The source based upon which "time" measurements are made.
     25   // We currently only measure wall clock time; but we are exploring other
     26   // measurement sources as well, such as CPU time or TCMalloc statistics.
     27   enum TimeSource {
     28     UNKNOWN_TIME_SOURCE = 0;  // Unknown source (should not reach here).
     29     WALL_CLOCK_TIME = 1;      // Total time elapsed between the start and end of
     30                               // the task's execution.
     31   }
     32   optional TimeSource time_source = 2;
     33 
     34   // Data for a single tracked object (typically, a Task).
     35   message TrackedObject {
     36     // The name of the thread from which this task was posted, hashed.
     37     optional fixed64 birth_thread_name_hash = 1;
     38 
     39     // The name of the thread on which this task was executed, hashed.
     40     optional fixed64 exec_thread_name_hash = 2;
     41 
     42     // The source file name from which this task was posted, hashed.
     43     optional fixed64 source_file_name_hash = 3;
     44 
     45     // Function name from which this task was posted, hashed.
     46     optional fixed64 source_function_name_hash = 4;
     47 
     48     // The line number within the source file from which this task was posted.
     49     optional int32 source_line_number = 5;
     50 
     51     // The number of times this task was executed.
     52     optional int32 exec_count = 6;
     53 
     54     // The total execution time for instances this task.
     55     optional int32 exec_time_total = 7;
     56 
     57     // The execution time for a uniformly randomly sampled instance of this
     58     // task.
     59     optional int32 exec_time_sampled = 8;
     60 
     61     // The total time instances this task spent waiting (e.g. in a message loop)
     62     // before they were run.
     63     optional int32 queue_time_total = 9;
     64 
     65     // The time that a uniformly randomly sampled instance of this task spent
     66     // waiting (e.g.  in a message loop) before it was run.
     67     optional int32 queue_time_sampled = 10;
     68 
     69     // The type of process within which this task was executed.
     70     enum ProcessType {
     71       UNKNOWN = 0;  // Should not reach here
     72       BROWSER = 1;
     73       RENDERER = 2;
     74       PLUGIN = 3;
     75       WORKER = 4;
     76       NACL_LOADER = 5;
     77       UTILITY = 6;
     78       PROFILE_IMPORT = 7;
     79       ZYGOTE = 8;
     80       SANDBOX_HELPER = 9;
     81       NACL_BROKER = 10;
     82       GPU = 11;
     83       PPAPI_PLUGIN = 12;
     84       PPAPI_BROKER = 13;
     85     }
     86     optional ProcessType process_type = 11;
     87 
     88     // The local PID for the process within which this task was executed.
     89     optional uint32 process_id = 12;
     90   }
     91   repeated TrackedObject tracked_object = 3;
     92 }
     93