1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
8 #include "base/time/time.h"
12 // Parameters to pass back to the metrics provider.
13 struct CallStackProfileParams {
14 // The process in which the collection occurred.
26 kMax = kNetworkService,
29 // The thread from which the collection occurred.
33 // Each process has a 'main thread'. In the Browser process, the 'main
34 // thread' is also often called the 'UI thread'.
38 // Compositor thread (can be in both renderer and gpu processes).
41 // Service worker thread.
44 kMax = kServiceWorker,
47 // The event that triggered the profile collection.
54 kPeriodicHeapCollection,
55 kLast = kPeriodicHeapCollection
58 // The default constructor is required for mojo and should not be used
59 // otherwise. A valid trigger should always be specified.
60 constexpr CallStackProfileParams() = default;
62 constexpr CallStackProfileParams(
66 base::TimeDelta time_offset = base::TimeDelta())
70 time_offset(time_offset) {}
72 // The collection process.
73 Process process = Process::kUnknown;
75 // The collection thread.
76 Thread thread = Thread::kUnknown;
78 // The triggering event.
79 Trigger trigger = Trigger::kUnknown;
81 // The time of the profile, since roughly the start of the process being
82 // profiled. 0 indicates that the time is not reported.
83 base::TimeDelta time_offset;
86 } // namespace metrics
88 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_