1 #ifndef DALI_INTERNAL_ADAPTOR_PERFORMANCE_MARKER_H
2 #define DALI_INTERNAL_ADAPTOR_PERFORMANCE_MARKER_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/internal/system/common/frame-time-stamp.h>
23 #include <dali/internal/system/common/performance-interface.h>
32 * Marker used to record an event with a time stamp in Dali
34 class PerformanceMarker
38 * Bitmask used to filter different types of markers based
39 * on what group they belong to.
43 FILTERING_DISABLED = 0, ///< disabled
44 V_SYNC_EVENTS = 1 << 0, ///< v-sync
45 UPDATE = 1 << 1, ///< update start / end
46 RENDER = 1 << 2, ///< render start / end
47 EVENT_PROCESS = 1 << 3, ///< process events start / end
48 SWAP_BUFFERS = 1 << 4, ///< swap buffers start / end
49 LIFE_CYCLE_EVENTS = 1 << 5, ///< pause / resume
50 RESOURCE_EVENTS = 1 << 6, ///< resource events
51 CUSTOM_EVENTS = 1 << 7
59 SINGLE_EVENT, ///< event is something that has no duration associated with it
60 START_TIMED_EVENT, ///< start of a timed event
61 END_TIMED_EVENT ///< end of a timed event
67 * @param[in] type marker type
69 PerformanceMarker(PerformanceInterface::MarkerType type);
73 * @param[in] type marker type
74 * @param[in] time time stamp
76 PerformanceMarker(PerformanceInterface::MarkerType type, FrameTimeStamp time);
79 * @return the time stamp
81 const FrameTimeStamp& GetTimeStamp() const
87 * @return the type of marker
89 PerformanceInterface::MarkerType GetType() const
95 * @return the event type of marker
97 MarkerEventType GetEventType() const;
100 * @return the filter type of marker
102 MarkerFilter GetFilterType() const;
105 * @return marker name
107 const char* GetName() const;
110 * @param start the start marker
111 * @param end the end marker
112 * @return difference in microseconds between two markers
114 static unsigned int MicrosecondDiff(const PerformanceMarker& start, const PerformanceMarker& end);
117 * @return if a marker is enabled as part of a group
119 bool IsFilterEnabled(MarkerFilter filter) const;
122 PerformanceInterface::MarkerType mType; ///< marker type
123 FrameTimeStamp mTimeStamp; ///< frame time stamp
126 } // namespace Adaptor
128 } // namespace Internal
132 #endif // DALI_INTERNAL_ADAPTOR_PERFORMANCE_MARKER_H