• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package ohos.devtools.views.trace.bean;
17 
18 import ohos.devtools.views.trace.DField;
19 
20 /**
21  * Wake up data
22  *
23  * @since 2021/04/22 12:25
24  */
25 public class WakeupBean {
26     private long wakeupTime;
27     @DField(name = "cpu")
28     private int wakeupCpu;
29     @DField(name = "process")
30     private String wakeupProcess;
31     @DField(name = "pid")
32     private Integer wakeupPid;
33     @DField(name = "thread")
34     private String wakeupThread;
35     @DField(name = "tid")
36     private Integer wakeupTid;
37     private long schedulingLatency;
38     private String schedulingDesc;
39 
40     /**
41      * get wakeup time.
42      *
43      * @return wakeup time
44      */
getWakeupTime()45     public long getWakeupTime() {
46         return wakeupTime;
47     }
48 
49     /**
50      * set wakeup time.
51      *
52      * @param wt wt
53      */
setWakeupTime(final long wt)54     public void setWakeupTime(final long wt) {
55         this.wakeupTime = wt;
56     }
57 
58     /**
59      * get wakeup cpu.
60      *
61      * @return wakeup cpu
62      */
getWakeupCpu()63     public int getWakeupCpu() {
64         return wakeupCpu;
65     }
66 
67     /**
68      * set wakeup cpu.
69      *
70      * @param cpu cpu
71      */
setWakeupCpu(final int cpu)72     public void setWakeupCpu(final int cpu) {
73         this.wakeupCpu = cpu;
74     }
75 
76     /**
77      * get wakeup process.
78      *
79      * @return wakeup process
80      */
getWakeupProcess()81     public String getWakeupProcess() {
82         if (wakeupProcess == null || wakeupProcess.isBlank()) {
83             return wakeupThread;
84         } else {
85             return wakeupProcess;
86         }
87     }
88 
89     /**
90      * set wakeup process.
91      *
92      * @param process process
93      */
setWakeupProcess(final String process)94     public void setWakeupProcess(final String process) {
95         this.wakeupProcess = process;
96     }
97 
98     /**
99      * get wakeup pId.
100      *
101      * @return wakeup pId
102      */
getWakeupPid()103     public Integer getWakeupPid() {
104         return wakeupPid;
105     }
106 
107     /**
108      * set wakeup pId.
109      *
110      * @param pid pid
111      */
setWakeupPid(final Integer pid)112     public void setWakeupPid(final Integer pid) {
113         this.wakeupPid = pid;
114     }
115 
116     /**
117      * get wakeup thread.
118      *
119      * @return wakeup thread
120      */
getWakeupThread()121     public String getWakeupThread() {
122         return wakeupThread;
123     }
124 
125     /**
126      * set wakeup thread.
127      *
128      * @param thread thread
129      */
setWakeupThread(final String thread)130     public void setWakeupThread(final String thread) {
131         this.wakeupThread = thread;
132     }
133 
134     /**
135      * get wakeup tId.
136      *
137      * @return wakeup thread id
138      */
getWakeupTid()139     public Integer getWakeupTid() {
140         return wakeupTid;
141     }
142 
143     /**
144      * set wakeup tId.
145      *
146      * @param tid tid
147      */
setWakeupTid(final Integer tid)148     public void setWakeupTid(final Integer tid) {
149         this.wakeupTid = tid;
150     }
151 
152     /**
153      * get scheduling Latency.
154      *
155      * @return scheduling Latency
156      */
getSchedulingLatency()157     public long getSchedulingLatency() {
158         return schedulingLatency;
159     }
160 
161     /**
162      * set scheduling Latency.
163      *
164      * @param latency latency
165      */
setSchedulingLatency(final long latency)166     public void setSchedulingLatency(final long latency) {
167         this.schedulingLatency = latency;
168     }
169 
170     /**
171      * get scheduling Desc.
172      *
173      * @return scheduling Desc
174      */
getSchedulingDesc()175     public String getSchedulingDesc() {
176         return schedulingDesc;
177     }
178 
179     /**
180      * set scheduling Desc.
181      *
182      * @param desc desc
183      */
setSchedulingDesc(final String desc)184     public void setSchedulingDesc(final String desc) {
185         this.schedulingDesc = desc;
186     }
187 }
188