1 /* 2 * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. 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 #include "hisysevent_stdtype.h" 16 17 namespace SysTuning { 18 namespace TraceStdtype { AppendSysEventSubkey(DataIndex eventSource,DataIndex appName)19uint32_t HiSysEventSubkeys::AppendSysEventSubkey(DataIndex eventSource, DataIndex appName) 20 { 21 sysEventNameIds_.emplace_back(eventSource); 22 subkeyNameIds_.emplace_back(appName); 23 ids_.emplace_back(subkeyNameIds_.size() - 1); 24 return Size() - 1; 25 } SysEventNameId() const26const std::deque<DataIndex> &HiSysEventSubkeys::SysEventNameId() const 27 { 28 return sysEventNameIds_; 29 } SysEventSubkeyId() const30const std::deque<DataIndex> &HiSysEventSubkeys::SysEventSubkeyId() const 31 { 32 return subkeyNameIds_; 33 } 34 AppendData(const HiSysEventMeasureDataRow & context)35void HiSysEventMeasureData::AppendData(const HiSysEventMeasureDataRow &context) 36 { 37 serial_.emplace_back(context.serial); 38 ts_.emplace_back(context.ts); 39 nameFilterIds_.emplace_back(context.nameId); 40 appKeyFilterIds_.emplace_back(context.keyId); 41 types_.emplace_back(context.type); 42 numValues_.emplace_back(context.numericValue); 43 stringValues_.emplace_back(context.stringValue); 44 ids_.emplace_back(rowCount_); 45 rowCount_++; 46 } Serial() const47const std::deque<uint64_t> &HiSysEventMeasureData::Serial() const 48 { 49 return serial_; 50 } Ts() const51const std::deque<uint64_t> &HiSysEventMeasureData::Ts() const 52 { 53 return ts_; 54 } NameFilterId() const55const std::deque<uint32_t> &HiSysEventMeasureData::NameFilterId() const 56 { 57 return nameFilterIds_; 58 } AppKeyFilterId() const59const std::deque<uint32_t> &HiSysEventMeasureData::AppKeyFilterId() const 60 { 61 return appKeyFilterIds_; 62 } Type() const63const std::deque<int32_t> &HiSysEventMeasureData::Type() const 64 { 65 return types_; 66 } NumValue() const67const std::deque<double> &HiSysEventMeasureData::NumValue() const 68 { 69 return numValues_; 70 } StringValue() const71const std::deque<DataIndex> &HiSysEventMeasureData::StringValue() const 72 { 73 return stringValues_; 74 } AppendNewData(const HiSysEventDeviceStateDataRow & context)75void HiSysEventDeviceStateData::AppendNewData(const HiSysEventDeviceStateDataRow &context) 76 { 77 brightness_.emplace_back(context.brightness); 78 btStates_.emplace_back(context.btState); 79 locations_.emplace_back(context.location); 80 wifis_.emplace_back(context.wifi); 81 streamDefaults_.emplace_back(context.streamDefault); 82 voiceCalls_.emplace_back(context.voiceCall); 83 musics_.emplace_back(context.music); 84 streamRings_.emplace_back(context.streamRing); 85 medias_.emplace_back(context.media); 86 voiceAssistants_.emplace_back(context.voiceAssistant); 87 systems_.emplace_back(context.system); 88 alarms_.emplace_back(context.alarm); 89 notifications_.emplace_back(context.notification); 90 btScos_.emplace_back(context.btSco); 91 enforcedAudibles_.emplace_back(context.enforcedAudible); 92 streamDtmfs_.emplace_back(context.streamDtmf); 93 streamTts_.emplace_back(context.streamTts); 94 accessibilitys_.emplace_back(context.accessibility); 95 recordings_.emplace_back(context.recording); 96 streamAlls_.emplace_back(context.streamAll); 97 ids_.emplace_back(rowCounts_); 98 rowCounts_++; 99 } Brightness() const100const std::deque<int32_t> &HiSysEventDeviceStateData::Brightness() const 101 { 102 return brightness_; 103 } BtState() const104const std::deque<int32_t> &HiSysEventDeviceStateData::BtState() const 105 { 106 return btStates_; 107 } Location() const108const std::deque<int32_t> &HiSysEventDeviceStateData::Location() const 109 { 110 return locations_; 111 } Wifi() const112const std::deque<int32_t> &HiSysEventDeviceStateData::Wifi() const 113 { 114 return wifis_; 115 } StreamDefault() const116const std::deque<int32_t> &HiSysEventDeviceStateData::StreamDefault() const 117 { 118 return streamDefaults_; 119 } VoiceCall() const120const std::deque<int32_t> &HiSysEventDeviceStateData::VoiceCall() const 121 { 122 return voiceCalls_; 123 } Music() const124const std::deque<int32_t> &HiSysEventDeviceStateData::Music() const 125 { 126 return musics_; 127 } StreamRing() const128const std::deque<int32_t> &HiSysEventDeviceStateData::StreamRing() const 129 { 130 return streamRings_; 131 } Media() const132const std::deque<int32_t> &HiSysEventDeviceStateData::Media() const 133 { 134 return medias_; 135 } VoiceAssistant() const136const std::deque<int32_t> &HiSysEventDeviceStateData::VoiceAssistant() const 137 { 138 return voiceAssistants_; 139 } System() const140const std::deque<int32_t> &HiSysEventDeviceStateData::System() const 141 { 142 return systems_; 143 } Alarm() const144const std::deque<int32_t> &HiSysEventDeviceStateData::Alarm() const 145 { 146 return alarms_; 147 } Notification() const148const std::deque<int32_t> &HiSysEventDeviceStateData::Notification() const 149 { 150 return notifications_; 151 } BtSco() const152const std::deque<int32_t> &HiSysEventDeviceStateData::BtSco() const 153 { 154 return btScos_; 155 } EnforcedAudible() const156const std::deque<int32_t> &HiSysEventDeviceStateData::EnforcedAudible() const 157 { 158 return enforcedAudibles_; 159 } StreamDtmf() const160const std::deque<int32_t> &HiSysEventDeviceStateData::StreamDtmf() const 161 { 162 return streamDtmfs_; 163 } StreamTts() const164const std::deque<int32_t> &HiSysEventDeviceStateData::StreamTts() const 165 { 166 return streamTts_; 167 } Accessibility() const168const std::deque<int32_t> &HiSysEventDeviceStateData::Accessibility() const 169 { 170 return accessibilitys_; 171 } Recordings() const172const std::deque<int32_t> &HiSysEventDeviceStateData::Recordings() const 173 { 174 return recordings_; 175 } StreamAll() const176const std::deque<int32_t> &HiSysEventDeviceStateData::StreamAll() const 177 { 178 return streamAlls_; 179 } 180 AppendHiSysEventData(const HiSysEventAllEventDataRow & hiSysEventAllEventDataRow)181uint32_t HiSysEventAllEventData::AppendHiSysEventData(const HiSysEventAllEventDataRow &hiSysEventAllEventDataRow) 182 { 183 domainIds_.emplace_back(hiSysEventAllEventDataRow.domainId); 184 eventNameIds_.emplace_back(hiSysEventAllEventDataRow.eventNameId); 185 timeStamps_.emplace_back(hiSysEventAllEventDataRow.timeStamp); 186 types_.emplace_back(hiSysEventAllEventDataRow.type); 187 timeZones_.emplace_back(hiSysEventAllEventDataRow.timeZone); 188 pids_.emplace_back(hiSysEventAllEventDataRow.pid); 189 tids_.emplace_back(hiSysEventAllEventDataRow.tid); 190 uids_.emplace_back(hiSysEventAllEventDataRow.uid); 191 levels_.emplace_back(hiSysEventAllEventDataRow.level); 192 tags_.emplace_back(hiSysEventAllEventDataRow.tag); 193 eventIds_.emplace_back(hiSysEventAllEventDataRow.eventId); 194 seqs_.emplace_back(hiSysEventAllEventDataRow.seq); 195 infos_.emplace_back(hiSysEventAllEventDataRow.info); 196 contents_.emplace_back(hiSysEventAllEventDataRow.content); 197 ids_.emplace_back(Size()); 198 return Size() - 1; 199 } DomainIds() const200const std::deque<DataIndex> &HiSysEventAllEventData::DomainIds() const 201 { 202 return domainIds_; 203 } EventNameIds() const204const std::deque<DataIndex> &HiSysEventAllEventData::EventNameIds() const 205 { 206 return eventNameIds_; 207 } Types() const208const std::deque<uint32_t> &HiSysEventAllEventData::Types() const 209 { 210 return types_; 211 } TimeZones() const212const std::deque<std::string> &HiSysEventAllEventData::TimeZones() const 213 { 214 return timeZones_; 215 } Pids() const216const std::deque<uint32_t> &HiSysEventAllEventData::Pids() const 217 { 218 return pids_; 219 } Tids() const220const std::deque<uint32_t> &HiSysEventAllEventData::Tids() const 221 { 222 return tids_; 223 } Uids() const224const std::deque<uint32_t> &HiSysEventAllEventData::Uids() const 225 { 226 return uids_; 227 } Levels() const228const std::deque<std::string> &HiSysEventAllEventData::Levels() const 229 { 230 return levels_; 231 } Tags() const232const std::deque<std::string> &HiSysEventAllEventData::Tags() const 233 { 234 return tags_; 235 } EventIds() const236const std::deque<std::string> &HiSysEventAllEventData::EventIds() const 237 { 238 return eventIds_; 239 } Seqs() const240const std::deque<uint64_t> &HiSysEventAllEventData::Seqs() const 241 { 242 return seqs_; 243 } Infos() const244const std::deque<std::string> &HiSysEventAllEventData::Infos() const 245 { 246 return infos_; 247 } Contents() const248const std::deque<std::string> &HiSysEventAllEventData::Contents() const 249 { 250 return contents_; 251 } 252 } // namespace TraceStdtype 253 } // namespace SysTuning 254