• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef SRC_TRACE_PROCESSOR_IMPORTERS_FTRACE_MALI_GPU_EVENT_TRACKER_H_
18 #define SRC_TRACE_PROCESSOR_IMPORTERS_FTRACE_MALI_GPU_EVENT_TRACKER_H_
19 
20 #include "src/trace_processor/storage/trace_storage.h"
21 #include "src/trace_processor/util/descriptors.h"
22 
23 namespace perfetto {
24 namespace trace_processor {
25 
26 class TraceProcessorContext;
27 
28 class MaliGpuEventTracker {
29  public:
30   explicit MaliGpuEventTracker(TraceProcessorContext*);
31   void ParseMaliGpuEvent(int64_t timestamp, int32_t field_id, uint32_t pid);
32   void ParseMaliGpuIrqEvent(int64_t timestamp,
33                             int32_t field_id,
34                             uint32_t cpu,
35                             protozero::ConstBytes blob);
36 
37  private:
38   TraceProcessorContext* context_;
39   StringId mali_KCPU_CQS_SET_id_;
40   StringId mali_KCPU_CQS_WAIT_id_;
41   StringId mali_KCPU_FENCE_SIGNAL_id_;
42   StringId mali_KCPU_FENCE_WAIT_id_;
43   StringId mali_CSF_INTERRUPT_id_;
44   StringId mali_CSF_INTERRUPT_info_val_id_;
45   void ParseMaliKcpuFenceSignal(int64_t timestamp, TrackId track_id);
46   void ParseMaliKcpuFenceWaitStart(int64_t timestamp, TrackId track_id);
47   void ParseMaliKcpuFenceWaitEnd(int64_t timestamp, TrackId track_id);
48   void ParseMaliKcpuCqsSet(int64_t timestamp, TrackId track_id);
49   void ParseMaliKcpuCqsWaitStart(int64_t timestamp, TrackId track_id);
50   void ParseMaliKcpuCqsWaitEnd(int64_t timestamp, TrackId track_id);
51   void ParseMaliCSFInterruptStart(int64_t timestamp,
52                                   TrackId track_id,
53                                   protozero::ConstBytes blob);
54   void ParseMaliCSFInterruptEnd(int64_t timestamp,
55                                 TrackId track_id,
56                                 protozero::ConstBytes blob);
57 };
58 
59 }  // namespace trace_processor
60 }  // namespace perfetto
61 
62 #endif  // SRC_TRACE_PROCESSOR_IMPORTERS_FTRACE_MALI_GPU_EVENT_TRACKER_H_
63