Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | #include "tools/trace_to_text/ftrace_event_formatter.h" |
| 18 | |
| 19 | #include <inttypes.h> |
Lalit Maganti | 910852d | 2018-03-28 13:16:45 +0100 | [diff] [blame] | 20 | #include <algorithm> |
| 21 | #include <string> |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 22 | |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 23 | #include "perfetto/base/build_config.h" |
| 24 | |
| 25 | #if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ |
| 26 | PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) |
| 27 | #include <sys/sysmacros.h> // For major() / minor() |
| 28 | #endif |
| 29 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 30 | // Not worth doing casts for printfs in this translation unit. |
| 31 | #pragma GCC diagnostic ignored "-Wformat" |
| 32 | #pragma GCC diagnostic ignored "-Wunused-parameter" |
| 33 | |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 34 | namespace perfetto { |
| 35 | namespace { |
| 36 | |
| 37 | using protos::BinderLockFtraceEvent; |
| 38 | using protos::BinderLockedFtraceEvent; |
| 39 | using protos::BinderSetPriorityFtraceEvent; |
| 40 | using protos::BinderTransactionFtraceEvent; |
| 41 | using protos::BinderTransactionReceivedFtraceEvent; |
| 42 | using protos::BinderUnlockFtraceEvent; |
| 43 | using protos::BlockBioBackmergeFtraceEvent; |
| 44 | using protos::BlockBioBounceFtraceEvent; |
| 45 | using protos::BlockBioCompleteFtraceEvent; |
| 46 | using protos::BlockBioFrontmergeFtraceEvent; |
| 47 | using protos::BlockBioQueueFtraceEvent; |
| 48 | using protos::BlockBioRemapFtraceEvent; |
| 49 | using protos::BlockDirtyBufferFtraceEvent; |
| 50 | using protos::BlockGetrqFtraceEvent; |
| 51 | using protos::BlockPlugFtraceEvent; |
| 52 | using protos::BlockRqAbortFtraceEvent; |
| 53 | using protos::BlockRqCompleteFtraceEvent; |
| 54 | using protos::BlockRqInsertFtraceEvent; |
| 55 | using protos::BlockRqIssueFtraceEvent; |
| 56 | using protos::BlockRqRemapFtraceEvent; |
| 57 | using protos::BlockRqRequeueFtraceEvent; |
| 58 | using protos::BlockSleeprqFtraceEvent; |
| 59 | using protos::BlockSplitFtraceEvent; |
| 60 | using protos::BlockTouchBufferFtraceEvent; |
| 61 | using protos::BlockUnplugFtraceEvent; |
| 62 | using protos::CgroupAttachTaskFtraceEvent; |
| 63 | using protos::CgroupDestroyRootFtraceEvent; |
| 64 | using protos::CgroupMkdirFtraceEvent; |
| 65 | using protos::CgroupReleaseFtraceEvent; |
| 66 | using protos::CgroupRemountFtraceEvent; |
| 67 | using protos::CgroupRenameFtraceEvent; |
| 68 | using protos::CgroupRmdirFtraceEvent; |
| 69 | using protos::CgroupSetupRootFtraceEvent; |
| 70 | using protos::CgroupTransferTasksFtraceEvent; |
| 71 | using protos::MmCompactionBeginFtraceEvent; |
| 72 | using protos::MmCompactionDeferCompactionFtraceEvent; |
| 73 | using protos::MmCompactionDeferResetFtraceEvent; |
| 74 | using protos::MmCompactionDeferredFtraceEvent; |
| 75 | using protos::MmCompactionEndFtraceEvent; |
| 76 | using protos::MmCompactionFinishedFtraceEvent; |
| 77 | using protos::MmCompactionIsolateFreepagesFtraceEvent; |
| 78 | using protos::MmCompactionIsolateMigratepagesFtraceEvent; |
| 79 | using protos::MmCompactionKcompactdSleepFtraceEvent; |
| 80 | using protos::MmCompactionKcompactdWakeFtraceEvent; |
| 81 | using protos::MmCompactionMigratepagesFtraceEvent; |
| 82 | using protos::MmCompactionSuitableFtraceEvent; |
| 83 | using protos::MmCompactionTryToCompactPagesFtraceEvent; |
| 84 | using protos::MmCompactionWakeupKcompactdFtraceEvent; |
| 85 | using protos::CpufreqInteractiveAlreadyFtraceEvent; |
| 86 | using protos::CpufreqInteractiveBoostFtraceEvent; |
| 87 | using protos::CpufreqInteractiveNotyetFtraceEvent; |
| 88 | using protos::CpufreqInteractiveSetspeedFtraceEvent; |
| 89 | using protos::CpufreqInteractiveTargetFtraceEvent; |
| 90 | using protos::CpufreqInteractiveUnboostFtraceEvent; |
| 91 | using protos::Ext4AllocDaBlocksFtraceEvent; |
| 92 | using protos::Ext4AllocateBlocksFtraceEvent; |
| 93 | using protos::Ext4AllocateInodeFtraceEvent; |
| 94 | using protos::Ext4BeginOrderedTruncateFtraceEvent; |
| 95 | using protos::Ext4CollapseRangeFtraceEvent; |
| 96 | using protos::Ext4DaReleaseSpaceFtraceEvent; |
| 97 | using protos::Ext4DaReserveSpaceFtraceEvent; |
| 98 | using protos::Ext4DaUpdateReserveSpaceFtraceEvent; |
| 99 | using protos::Ext4DaWriteBeginFtraceEvent; |
| 100 | using protos::Ext4DaWriteEndFtraceEvent; |
| 101 | using protos::Ext4DaWritePagesFtraceEvent; |
| 102 | using protos::Ext4DaWritePagesExtentFtraceEvent; |
| 103 | using protos::Ext4DirectIOEnterFtraceEvent; |
| 104 | using protos::Ext4DirectIOExitFtraceEvent; |
| 105 | using protos::Ext4DiscardBlocksFtraceEvent; |
| 106 | using protos::Ext4DiscardPreallocationsFtraceEvent; |
| 107 | using protos::Ext4DropInodeFtraceEvent; |
| 108 | using protos::Ext4EsCacheExtentFtraceEvent; |
| 109 | using protos::Ext4EsFindDelayedExtentRangeEnterFtraceEvent; |
| 110 | using protos::Ext4EsFindDelayedExtentRangeExitFtraceEvent; |
| 111 | using protos::Ext4EsInsertExtentFtraceEvent; |
| 112 | using protos::Ext4EsLookupExtentEnterFtraceEvent; |
| 113 | using protos::Ext4EsLookupExtentExitFtraceEvent; |
| 114 | using protos::Ext4EsRemoveExtentFtraceEvent; |
| 115 | using protos::Ext4EsShrinkFtraceEvent; |
| 116 | using protos::Ext4EsShrinkCountFtraceEvent; |
| 117 | using protos::Ext4EsShrinkScanEnterFtraceEvent; |
| 118 | using protos::Ext4EsShrinkScanExitFtraceEvent; |
| 119 | using protos::Ext4EvictInodeFtraceEvent; |
| 120 | using protos::Ext4ExtConvertToInitializedEnterFtraceEvent; |
| 121 | using protos::Ext4ExtConvertToInitializedFastpathFtraceEvent; |
| 122 | using protos::Ext4ExtHandleUnwrittenExtentsFtraceEvent; |
| 123 | using protos::Ext4ExtInCacheFtraceEvent; |
| 124 | using protos::Ext4ExtLoadExtentFtraceEvent; |
| 125 | using protos::Ext4ExtMapBlocksEnterFtraceEvent; |
| 126 | using protos::Ext4ExtMapBlocksExitFtraceEvent; |
| 127 | using protos::Ext4ExtPutInCacheFtraceEvent; |
| 128 | using protos::Ext4ExtRemoveSpaceFtraceEvent; |
| 129 | using protos::Ext4ExtRemoveSpaceDoneFtraceEvent; |
| 130 | using protos::Ext4ExtRmIdxFtraceEvent; |
| 131 | using protos::Ext4ExtRmLeafFtraceEvent; |
| 132 | using protos::Ext4ExtShowExtentFtraceEvent; |
| 133 | using protos::Ext4FallocateEnterFtraceEvent; |
| 134 | using protos::Ext4FallocateExitFtraceEvent; |
| 135 | using protos::Ext4FindDelallocRangeFtraceEvent; |
| 136 | using protos::Ext4ForgetFtraceEvent; |
| 137 | using protos::Ext4FreeBlocksFtraceEvent; |
| 138 | using protos::Ext4FreeInodeFtraceEvent; |
| 139 | using protos::Ext4GetImpliedClusterAllocExitFtraceEvent; |
| 140 | using protos::Ext4GetReservedClusterAllocFtraceEvent; |
| 141 | using protos::Ext4IndMapBlocksEnterFtraceEvent; |
| 142 | using protos::Ext4IndMapBlocksExitFtraceEvent; |
| 143 | using protos::Ext4InsertRangeFtraceEvent; |
| 144 | using protos::Ext4InvalidatepageFtraceEvent; |
| 145 | using protos::Ext4JournalStartFtraceEvent; |
| 146 | using protos::Ext4JournalStartReservedFtraceEvent; |
| 147 | using protos::Ext4JournalledInvalidatepageFtraceEvent; |
| 148 | using protos::Ext4JournalledWriteEndFtraceEvent; |
| 149 | using protos::Ext4LoadInodeFtraceEvent; |
| 150 | using protos::Ext4LoadInodeBitmapFtraceEvent; |
| 151 | using protos::Ext4MarkInodeDirtyFtraceEvent; |
| 152 | using protos::Ext4MbBitmapLoadFtraceEvent; |
| 153 | using protos::Ext4MbBuddyBitmapLoadFtraceEvent; |
| 154 | using protos::Ext4MbDiscardPreallocationsFtraceEvent; |
| 155 | using protos::Ext4MbNewGroupPaFtraceEvent; |
| 156 | using protos::Ext4MbNewInodePaFtraceEvent; |
| 157 | using protos::Ext4MbReleaseGroupPaFtraceEvent; |
| 158 | using protos::Ext4MbReleaseInodePaFtraceEvent; |
| 159 | using protos::Ext4MballocAllocFtraceEvent; |
| 160 | using protos::Ext4MballocDiscardFtraceEvent; |
| 161 | using protos::Ext4MballocFreeFtraceEvent; |
| 162 | using protos::Ext4MballocPreallocFtraceEvent; |
| 163 | using protos::Ext4OtherInodeUpdateTimeFtraceEvent; |
| 164 | using protos::Ext4PunchHoleFtraceEvent; |
| 165 | using protos::Ext4ReadBlockBitmapLoadFtraceEvent; |
| 166 | using protos::Ext4ReadpageFtraceEvent; |
| 167 | using protos::Ext4ReleasepageFtraceEvent; |
| 168 | using protos::Ext4RemoveBlocksFtraceEvent; |
| 169 | using protos::Ext4RequestBlocksFtraceEvent; |
| 170 | using protos::Ext4RequestInodeFtraceEvent; |
| 171 | using protos::Ext4SyncFileEnterFtraceEvent; |
| 172 | using protos::Ext4SyncFileExitFtraceEvent; |
| 173 | using protos::Ext4SyncFsFtraceEvent; |
| 174 | using protos::Ext4TrimAllFreeFtraceEvent; |
| 175 | using protos::Ext4TrimExtentFtraceEvent; |
| 176 | using protos::Ext4TruncateEnterFtraceEvent; |
| 177 | using protos::Ext4TruncateExitFtraceEvent; |
| 178 | using protos::Ext4UnlinkEnterFtraceEvent; |
| 179 | using protos::Ext4UnlinkExitFtraceEvent; |
| 180 | using protos::Ext4WriteBeginFtraceEvent; |
| 181 | using protos::Ext4WriteEndFtraceEvent; |
| 182 | using protos::Ext4WritepageFtraceEvent; |
| 183 | using protos::Ext4WritepagesFtraceEvent; |
| 184 | using protos::Ext4WritepagesResultFtraceEvent; |
| 185 | using protos::Ext4ZeroRangeFtraceEvent; |
| 186 | using protos::MmFilemapAddToPageCacheFtraceEvent; |
| 187 | using protos::MmFilemapDeleteFromPageCacheFtraceEvent; |
| 188 | using protos::PrintFtraceEvent; |
| 189 | using protos::I2cReadFtraceEvent; |
| 190 | using protos::I2cReplyFtraceEvent; |
| 191 | using protos::I2cResultFtraceEvent; |
| 192 | using protos::I2cWriteFtraceEvent; |
| 193 | using protos::SmbusReadFtraceEvent; |
| 194 | using protos::SmbusReplyFtraceEvent; |
| 195 | using protos::SmbusResultFtraceEvent; |
| 196 | using protos::SmbusWriteFtraceEvent; |
| 197 | using protos::IpiEntryFtraceEvent; |
| 198 | using protos::IpiExitFtraceEvent; |
| 199 | using protos::IpiRaiseFtraceEvent; |
| 200 | using protos::IrqHandlerEntryFtraceEvent; |
| 201 | using protos::IrqHandlerExitFtraceEvent; |
| 202 | using protos::SoftirqEntryFtraceEvent; |
| 203 | using protos::SoftirqExitFtraceEvent; |
| 204 | using protos::SoftirqRaiseFtraceEvent; |
| 205 | using protos::LowmemoryKillFtraceEvent; |
| 206 | using protos::MdpCmdKickoffFtraceEvent; |
| 207 | using protos::MdpCmdPingpongDoneFtraceEvent; |
| 208 | using protos::MdpCmdReadptrDoneFtraceEvent; |
| 209 | using protos::MdpCmdReleaseBwFtraceEvent; |
| 210 | using protos::MdpCmdWaitPingpongFtraceEvent; |
| 211 | using protos::MdpCommitFtraceEvent; |
| 212 | using protos::MdpCompareBwFtraceEvent; |
| 213 | using protos::MdpMisrCrcFtraceEvent; |
| 214 | using protos::MdpMixerUpdateFtraceEvent; |
| 215 | using protos::MdpPerfPrefillCalcFtraceEvent; |
| 216 | using protos::MdpPerfSetOtFtraceEvent; |
| 217 | using protos::MdpPerfSetPanicLutsFtraceEvent; |
| 218 | using protos::MdpPerfSetQosLutsFtraceEvent; |
| 219 | using protos::MdpPerfSetWmLevelsFtraceEvent; |
| 220 | using protos::MdpPerfUpdateBusFtraceEvent; |
| 221 | using protos::MdpSsppChangeFtraceEvent; |
| 222 | using protos::MdpSsppSetFtraceEvent; |
| 223 | using protos::MdpTraceCounterFtraceEvent; |
| 224 | using protos::MdpVideoUnderrunDoneFtraceEvent; |
| 225 | using protos::RotatorBwAoAsContextFtraceEvent; |
| 226 | using protos::TracingMarkWriteFtraceEvent; |
| 227 | using protos::ClockDisableFtraceEvent; |
| 228 | using protos::ClockEnableFtraceEvent; |
| 229 | using protos::ClockSetRateFtraceEvent; |
| 230 | using protos::CpuFrequencyFtraceEvent; |
| 231 | using protos::CpuFrequencyLimitsFtraceEvent; |
| 232 | using protos::CpuIdleFtraceEvent; |
| 233 | using protos::SuspendResumeFtraceEvent; |
| 234 | using protos::RegulatorDisableFtraceEvent; |
| 235 | using protos::RegulatorDisableCompleteFtraceEvent; |
| 236 | using protos::RegulatorEnableFtraceEvent; |
| 237 | using protos::RegulatorEnableCompleteFtraceEvent; |
| 238 | using protos::RegulatorEnableDelayFtraceEvent; |
| 239 | using protos::RegulatorSetVoltageFtraceEvent; |
| 240 | using protos::RegulatorSetVoltageCompleteFtraceEvent; |
| 241 | using protos::SchedBlockedReasonFtraceEvent; |
| 242 | using protos::SchedCpuHotplugFtraceEvent; |
| 243 | using protos::SchedProcessExecFtraceEvent; |
| 244 | using protos::SchedProcessExitFtraceEvent; |
| 245 | using protos::SchedProcessForkFtraceEvent; |
| 246 | using protos::SchedProcessFreeFtraceEvent; |
| 247 | using protos::SchedProcessHangFtraceEvent; |
| 248 | using protos::SchedProcessWaitFtraceEvent; |
| 249 | using protos::SchedSwitchFtraceEvent; |
| 250 | using protos::SchedWakeupFtraceEvent; |
| 251 | using protos::SchedWakeupNewFtraceEvent; |
| 252 | using protos::SchedWakingFtraceEvent; |
| 253 | using protos::SyncPtFtraceEvent; |
| 254 | using protos::SyncTimelineFtraceEvent; |
| 255 | using protos::SyncWaitFtraceEvent; |
| 256 | using protos::MmVmscanDirectReclaimBeginFtraceEvent; |
| 257 | using protos::MmVmscanDirectReclaimEndFtraceEvent; |
| 258 | using protos::MmVmscanKswapdSleepFtraceEvent; |
| 259 | using protos::MmVmscanKswapdWakeFtraceEvent; |
| 260 | using protos::WorkqueueActivateWorkFtraceEvent; |
| 261 | using protos::WorkqueueExecuteEndFtraceEvent; |
| 262 | using protos::WorkqueueExecuteStartFtraceEvent; |
| 263 | using protos::WorkqueueQueueWorkFtraceEvent; |
| 264 | using protos::TaskNewtaskFtraceEvent; |
| 265 | using protos::TaskRenameFtraceEvent; |
Florian Mayer | 1d8956a | 2018-04-10 13:59:19 +0100 | [diff] [blame] | 266 | using protos::F2fsDoSubmitBioFtraceEvent; |
| 267 | using protos::F2fsEvictInodeFtraceEvent; |
| 268 | using protos::F2fsFallocateFtraceEvent; |
| 269 | using protos::F2fsGetDataBlockFtraceEvent; |
| 270 | using protos::F2fsGetVictimFtraceEvent; |
| 271 | using protos::F2fsIgetFtraceEvent; |
| 272 | using protos::F2fsIgetExitFtraceEvent; |
| 273 | using protos::F2fsNewInodeFtraceEvent; |
| 274 | using protos::F2fsReadpageFtraceEvent; |
| 275 | using protos::F2fsReserveNewBlockFtraceEvent; |
| 276 | using protos::F2fsSetPageDirtyFtraceEvent; |
| 277 | using protos::F2fsSubmitWritePageFtraceEvent; |
| 278 | using protos::F2fsSyncFileEnterFtraceEvent; |
| 279 | using protos::F2fsSyncFileExitFtraceEvent; |
| 280 | using protos::F2fsSyncFsFtraceEvent; |
| 281 | using protos::F2fsTruncateFtraceEvent; |
| 282 | using protos::F2fsTruncateBlocksEnterFtraceEvent; |
| 283 | using protos::F2fsTruncateBlocksExitFtraceEvent; |
| 284 | using protos::F2fsTruncateDataBlocksRangeFtraceEvent; |
| 285 | using protos::F2fsTruncateInodeBlocksEnterFtraceEvent; |
| 286 | using protos::F2fsTruncateInodeBlocksExitFtraceEvent; |
| 287 | using protos::F2fsTruncateNodeFtraceEvent; |
| 288 | using protos::F2fsTruncateNodesEnterFtraceEvent; |
| 289 | using protos::F2fsTruncateNodesExitFtraceEvent; |
| 290 | using protos::F2fsTruncatePartialNodesFtraceEvent; |
| 291 | using protos::F2fsUnlinkEnterFtraceEvent; |
| 292 | using protos::F2fsUnlinkExitFtraceEvent; |
| 293 | using protos::F2fsVmPageMkwriteFtraceEvent; |
| 294 | using protos::F2fsWriteBeginFtraceEvent; |
| 295 | using protos::F2fsWriteCheckpointFtraceEvent; |
| 296 | using protos::F2fsWriteEndFtraceEvent; |
Isabelle Taylor | 4ce4997 | 2018-10-19 18:53:15 +0100 | [diff] [blame^] | 297 | using protos::AllocPagesIommuEndFtraceEvent; |
| 298 | using protos::AllocPagesIommuFailFtraceEvent; |
| 299 | using protos::AllocPagesIommuStartFtraceEvent; |
| 300 | using protos::AllocPagesSysEndFtraceEvent; |
| 301 | using protos::AllocPagesSysFailFtraceEvent; |
| 302 | using protos::AllocPagesSysStartFtraceEvent; |
| 303 | using protos::DmaAllocContiguousRetryFtraceEvent; |
| 304 | using protos::IommuMapRangeFtraceEvent; |
| 305 | using protos::IommuSecPtblMapRangeEndFtraceEvent; |
| 306 | using protos::IommuSecPtblMapRangeStartFtraceEvent; |
| 307 | using protos::IonAllocBufferEndFtraceEvent; |
| 308 | using protos::IonAllocBufferFailFtraceEvent; |
| 309 | using protos::IonAllocBufferFallbackFtraceEvent; |
| 310 | using protos::IonAllocBufferStartFtraceEvent; |
| 311 | using protos::IonCpAllocRetryFtraceEvent; |
| 312 | using protos::IonCpSecureBufferEndFtraceEvent; |
| 313 | using protos::IonCpSecureBufferStartFtraceEvent; |
| 314 | using protos::IonHeapGrowFtraceEvent; |
| 315 | using protos::IonHeapShrinkFtraceEvent; |
| 316 | using protos::IonPrefetchingFtraceEvent; |
| 317 | using protos::IonSecureCmaAddToPoolEndFtraceEvent; |
| 318 | using protos::IonSecureCmaAddToPoolStartFtraceEvent; |
| 319 | using protos::IonSecureCmaAllocateEndFtraceEvent; |
| 320 | using protos::IonSecureCmaAllocateStartFtraceEvent; |
| 321 | using protos::IonSecureCmaShrinkPoolEndFtraceEvent; |
| 322 | using protos::IonSecureCmaShrinkPoolStartFtraceEvent; |
| 323 | using protos::KfreeFtraceEvent; |
| 324 | using protos::KmallocFtraceEvent; |
| 325 | using protos::KmallocNodeFtraceEvent; |
| 326 | using protos::KmemCacheAllocFtraceEvent; |
| 327 | using protos::KmemCacheAllocNodeFtraceEvent; |
| 328 | using protos::KmemCacheFreeFtraceEvent; |
| 329 | using protos::MigratePagesEndFtraceEvent; |
| 330 | using protos::MigratePagesStartFtraceEvent; |
| 331 | using protos::MigrateRetryFtraceEvent; |
| 332 | using protos::MmPageAllocFtraceEvent; |
| 333 | using protos::MmPageAllocExtfragFtraceEvent; |
| 334 | using protos::MmPageAllocZoneLockedFtraceEvent; |
| 335 | using protos::MmPageFreeFtraceEvent; |
| 336 | using protos::MmPageFreeBatchedFtraceEvent; |
| 337 | using protos::MmPagePcpuDrainFtraceEvent; |
| 338 | using protos::RssStatFtraceEvent; |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 339 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 340 | const char* GetSchedSwitchFlag(int64_t state) { |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 341 | state &= 511; |
| 342 | if (state & 1) |
| 343 | return "S"; |
| 344 | if (state & 2) |
| 345 | return "D"; |
| 346 | if (state & 4) |
| 347 | return "T"; |
| 348 | if (state & 8) |
| 349 | return "t"; |
| 350 | if (state & 16) |
| 351 | return "Z"; |
| 352 | if (state & 32) |
| 353 | return "X"; |
| 354 | if (state & 64) |
| 355 | return "x"; |
| 356 | if (state & 128) |
| 357 | return "W"; |
| 358 | return "R"; |
| 359 | } |
| 360 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 361 | const char* GetExt4HintFlag(int64_t state) { |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 362 | if (state & 0x0001) |
| 363 | return "HINT_MERGE"; |
| 364 | if (state & 0x0002) |
| 365 | return "HINT_RESV"; |
| 366 | if (state & 0x0004) |
| 367 | return "HINT_MDATA"; |
| 368 | if (state & 0x0008) |
| 369 | return "HINT_FIRST"; |
| 370 | if (state & 0x0010) |
| 371 | return "HINT_BEST"; |
| 372 | if (state & 0x0020) |
| 373 | return "HINT_DATA"; |
| 374 | if (state & 0x0040) |
| 375 | return "HINT_NOPREALLOC"; |
| 376 | if (state & 0x0080) |
| 377 | return "HINT_GRP_ALLOCE"; |
| 378 | if (state & 0x0100) |
| 379 | return "HINT_GOAL_ONLY"; |
| 380 | if (state & 0x0200) |
| 381 | return "HINT_DATA"; |
| 382 | if (state & 0x0400) |
| 383 | return "HINT_NOPREALLOC"; |
| 384 | if (state & 0x0800) |
| 385 | return "HINT_GRP_ALLOCE"; |
| 386 | if (state & 0x2000) |
| 387 | return "HINT_GOAL_ONLY"; |
| 388 | return ""; |
| 389 | } |
| 390 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 391 | const char* GetExt4FreeBlocksFlag(int64_t state) { |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 392 | if (state & 0x0001) |
| 393 | return "METADATA"; |
| 394 | if (state & 0x0002) |
| 395 | return "FORGET"; |
| 396 | if (state & 0x0004) |
| 397 | return "VALIDATED"; |
| 398 | if (state & 0x0008) |
| 399 | return "NO_QUOTA"; |
| 400 | if (state & 0x0010) |
| 401 | return "1ST_CLUSTER"; |
| 402 | if (state & 0x0020) |
| 403 | return "LAST_CLUSTER"; |
| 404 | return ""; |
| 405 | } |
| 406 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 407 | const char* GetExt4ModeFlag(int64_t state) { |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 408 | if (state & 0x01) |
| 409 | return "KEEP_SIZE"; |
| 410 | if (state & 0x02) |
| 411 | return "PUNCH_HOLE"; |
| 412 | if (state & 0x04) |
| 413 | return "NO_HIDE_STALE"; |
| 414 | if (state & 0x08) |
| 415 | return "COLLAPSE_RANGE"; |
| 416 | if (state & 0x10) |
| 417 | return "ZERO_RANGE"; |
| 418 | return ""; |
| 419 | } |
| 420 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 421 | const char* GetExt4ExtFlag(int64_t state) { |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 422 | if (state & 0x0001) |
| 423 | return "CREATE"; |
| 424 | if (state & 0x0002) |
| 425 | return "UNWRIT"; |
| 426 | if (state & 0x0004) |
| 427 | return "DEALLOC"; |
| 428 | if (state & 0x0008) |
| 429 | return "PRE_IO"; |
| 430 | if (state & 0x0010) |
| 431 | return "CONVERT"; |
| 432 | if (state & 0x0020) |
| 433 | return "METADATA_NOFAIL"; |
| 434 | if (state & 0x0040) |
| 435 | return "NO_NORMALIZE"; |
| 436 | if (state & 0x0080) |
| 437 | return "KEEP_SIZE"; |
| 438 | if (state & 0x0100) |
| 439 | return "NO_LOCK"; |
| 440 | return ""; |
| 441 | } |
| 442 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 443 | int BlkMaj(uint64_t n) { |
| 444 | return static_cast<int>(((n >> 32) & 0xfffff000) | ((n >> 8) & 0xfff)); |
| 445 | } |
| 446 | |
| 447 | int BlkMin(uint64_t n) { |
| 448 | return static_cast<int>(((n >> 12) & 0xffffff00) | (n & 0xff)); |
| 449 | } |
| 450 | |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 451 | constexpr const char* MmCompactionRetArray[] = { |
| 452 | "deferred", "skipped", "continue", "partial", |
| 453 | "complete", "no_suitable_page", "not_suitable_zone", "contended"}; |
| 454 | |
| 455 | constexpr const char* MmCompactionSuitableArray[] = {"DMA", "Normal", |
| 456 | "Movable"}; |
| 457 | |
| 458 | constexpr const char* SoftirqArray[] = { |
| 459 | "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", |
| 460 | "BLOCK_IOPOLL", "TASKLET", "SCHED", "HRTIMER", "RCU"}; |
| 461 | |
| 462 | std::string FormatSchedSwitch(const SchedSwitchFtraceEvent& sched_switch) { |
| 463 | char line[2048]; |
| 464 | sprintf(line, |
| 465 | "sched_switch: prev_comm=%s " |
| 466 | "prev_pid=%d prev_prio=%d prev_state=%s ==> next_comm=%s next_pid=%d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 467 | "next_prio=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 468 | sched_switch.prev_comm().c_str(), sched_switch.prev_pid(), |
| 469 | sched_switch.prev_prio(), |
| 470 | GetSchedSwitchFlag(sched_switch.prev_state()), |
| 471 | sched_switch.next_comm().c_str(), sched_switch.next_pid(), |
| 472 | sched_switch.next_prio()); |
| 473 | return std::string(line); |
| 474 | } |
| 475 | |
| 476 | std::string FormatSchedWakeup(const SchedWakeupFtraceEvent& sched_wakeup) { |
| 477 | char line[2048]; |
| 478 | sprintf(line, |
| 479 | "sched_wakeup: comm=%s " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 480 | "pid=%d prio=%d success=%d target_cpu=%03d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 481 | sched_wakeup.comm().c_str(), sched_wakeup.pid(), sched_wakeup.prio(), |
| 482 | sched_wakeup.success(), sched_wakeup.target_cpu()); |
| 483 | return std::string(line); |
| 484 | } |
| 485 | |
| 486 | std::string FormatSchedBlockedReason( |
| 487 | const SchedBlockedReasonFtraceEvent& event) { |
| 488 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 489 | sprintf(line, "sched_blocked_reason: pid=%d iowait=%d caller=%llxS", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 490 | event.pid(), event.io_wait(), event.caller()); |
| 491 | return std::string(line); |
| 492 | } |
| 493 | |
| 494 | std::string FormatPrint(const PrintFtraceEvent& print) { |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 495 | std::string line = "tracing_mark_write: "; |
| 496 | size_t dst = line.size(); |
| 497 | line.resize(2048); |
| 498 | const std::string& msg = print.buf(); |
| 499 | |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 500 | // Remove any newlines in the message. It's not entirely clear what the right |
| 501 | // behaviour is here. Maybe we should escape them instead? |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 502 | for (size_t src = 0; src < msg.size() && dst < line.size() - 1; src++) { |
| 503 | char c = msg[src]; |
| 504 | if (c != '\n') |
| 505 | line[dst++] = c; |
| 506 | } |
| 507 | line.resize(dst); |
| 508 | return line; |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 509 | } |
| 510 | |
| 511 | std::string FormatCpuFrequency(const CpuFrequencyFtraceEvent& event) { |
| 512 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 513 | sprintf(line, "cpu_frequency: state=%" PRIu32 " cpu_id=%" PRIu32, |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 514 | event.state(), event.cpu_id()); |
| 515 | return std::string(line); |
| 516 | } |
| 517 | |
| 518 | std::string FormatCpuFrequencyLimits( |
| 519 | const CpuFrequencyLimitsFtraceEvent& event) { |
| 520 | char line[2048]; |
| 521 | sprintf(line, |
| 522 | "cpu_frequency_limits: min_freq=%" PRIu32 "max_freq=%" PRIu32 |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 523 | " cpu_id=%" PRIu32, |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 524 | event.min_freq(), event.max_freq(), event.cpu_id()); |
| 525 | return std::string(line); |
| 526 | } |
| 527 | |
| 528 | std::string FormatCpuIdle(const CpuIdleFtraceEvent& event) { |
| 529 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 530 | sprintf(line, "cpu_idle: state=%" PRIu32 " cpu_id=%" PRIu32, event.state(), |
| 531 | event.cpu_id()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 532 | return std::string(line); |
| 533 | } |
| 534 | |
| 535 | std::string FormatClockSetRate(const ClockSetRateFtraceEvent& event) { |
| 536 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 537 | sprintf(line, "clock_set_rate: %s state=%llu cpu_id=%llu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 538 | event.name().empty() ? "todo" : event.name().c_str(), event.state(), |
| 539 | event.cpu_id()); |
| 540 | return std::string(line); |
| 541 | } |
| 542 | |
| 543 | std::string FormatClockEnable(const ClockEnableFtraceEvent& event) { |
| 544 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 545 | sprintf(line, "clock_enable: %s state=%llu cpu_id=%llu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 546 | event.name().empty() ? "todo" : event.name().c_str(), event.state(), |
| 547 | event.cpu_id()); |
| 548 | return std::string(line); |
| 549 | } |
| 550 | |
| 551 | std::string FormatClockDisable(const ClockDisableFtraceEvent& event) { |
| 552 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 553 | sprintf(line, "clock_disable: %s state=%llu cpu_id=%llu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 554 | event.name().empty() ? "todo" : event.name().c_str(), event.state(), |
| 555 | event.cpu_id()); |
| 556 | return std::string(line); |
| 557 | } |
| 558 | |
| 559 | std::string FormatTracingMarkWrite(const TracingMarkWriteFtraceEvent& event) { |
| 560 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 561 | sprintf(line, "tracing_mark_write: %s|%d|%s", event.trace_begin() ? "B" : "E", |
| 562 | event.pid(), event.trace_name().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 563 | return std::string(line); |
| 564 | } |
| 565 | |
| 566 | std::string FormatBinderLocked(const BinderLockedFtraceEvent& event) { |
| 567 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 568 | sprintf(line, "binder_locked: tag=%s", event.tag().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 569 | return std::string(line); |
| 570 | } |
| 571 | |
| 572 | std::string FormatBinderUnlock(const BinderUnlockFtraceEvent& event) { |
| 573 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 574 | sprintf(line, "binder_unlock: tag=%s", event.tag().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 575 | return std::string(line); |
| 576 | } |
| 577 | |
| 578 | std::string FormatBinderLock(const BinderLockFtraceEvent& event) { |
| 579 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 580 | sprintf(line, "binder_lock: tag=%s", event.tag().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 581 | return std::string(line); |
| 582 | } |
| 583 | |
| 584 | std::string FormatBinderTransaction(const BinderTransactionFtraceEvent& event) { |
| 585 | char line[2048]; |
| 586 | sprintf(line, |
| 587 | "binder_transaction: transaction=%d dest_node=%d dest_proc=%d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 588 | "dest_thread=%d reply=%d flags=0x%x code=0x%x", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 589 | event.debug_id(), event.target_node(), event.to_proc(), |
| 590 | event.to_thread(), event.reply(), event.flags(), event.code()); |
| 591 | return std::string(line); |
| 592 | } |
| 593 | |
| 594 | std::string FormatBinderTransactionReceived( |
| 595 | const BinderTransactionReceivedFtraceEvent& event) { |
| 596 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 597 | sprintf(line, "binder_transaction_received: transaction=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 598 | event.debug_id()); |
| 599 | return std::string(line); |
| 600 | } |
| 601 | |
| 602 | std::string FormatExt4SyncFileEnter(const Ext4SyncFileEnterFtraceEvent& event) { |
| 603 | char line[2048]; |
| 604 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 605 | "ext4_sync_file_enter: dev %d,%d ino %lu parent %lu datasync %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 606 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.parent(), |
| 607 | event.datasync()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 608 | return std::string(line); |
| 609 | } |
| 610 | |
| 611 | std::string FormatExt4SyncFileExit(const Ext4SyncFileExitFtraceEvent& event) { |
| 612 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 613 | sprintf(line, "ext4_sync_file_exit: dev %d,%d ino %lu ret %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 614 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.ret()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 615 | return std::string(line); |
| 616 | } |
| 617 | |
| 618 | std::string FormatExt4DaWriteBegin(const Ext4DaWriteBeginFtraceEvent& event) { |
| 619 | char line[2048]; |
| 620 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 621 | "ext4_da_write_begin: dev %d,%d ino %lu pos %lld len %u flags %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 622 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.pos(), |
| 623 | event.len(), event.flags()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 624 | return std::string(line); |
| 625 | } |
| 626 | |
| 627 | std::string FormatExt4DaWriteEnd(const Ext4DaWriteEndFtraceEvent& event) { |
| 628 | char line[2048]; |
| 629 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 630 | "ext4_da_write_end: dev %d,%d ino %lu pos %lld len %u copied %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 631 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.pos(), |
| 632 | event.len(), event.copied()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 633 | return std::string(line); |
| 634 | } |
| 635 | |
| 636 | std::string FormatBlockRqIssue(const BlockRqIssueFtraceEvent& event) { |
| 637 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 638 | sprintf(line, "block_rq_issue: %d,%d %s %u (%s) %llu + %u [%s]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 639 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 640 | event.bytes(), event.cmd().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 641 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 642 | event.comm().c_str()); |
| 643 | return std::string(line); |
| 644 | } |
| 645 | |
| 646 | std::string FormatI2cRead(const I2cReadFtraceEvent& event) { |
| 647 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 648 | sprintf(line, "i2c_read: i2c-%d #%u a=%03x f=%04x l=%u", event.adapter_nr(), |
| 649 | event.msg_nr(), event.addr(), event.flags(), event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 650 | return std::string(line); |
| 651 | } |
| 652 | |
| 653 | std::string FormatI2cResult(const I2cResultFtraceEvent& event) { |
| 654 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 655 | sprintf(line, "i2c_result: i2c-%d n=%u ret=%d", event.adapter_nr(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 656 | event.nr_msgs(), event.ret()); |
| 657 | return std::string(line); |
| 658 | } |
| 659 | |
| 660 | std::string FormatIrqHandlerEntry(const IrqHandlerEntryFtraceEvent& event) { |
| 661 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 662 | sprintf(line, "irq_handler_entry: irq=%d name=%s", event.irq(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 663 | event.name().c_str()); |
| 664 | return std::string(line); |
| 665 | } |
| 666 | |
| 667 | std::string FormatIrqHandlerExit(const IrqHandlerExitFtraceEvent& event) { |
| 668 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 669 | sprintf(line, "irq_handler_exit: irq=%d ret=%s", event.irq(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 670 | event.ret() ? "handled" : "unhandled"); |
| 671 | return std::string(line); |
| 672 | } |
| 673 | |
| 674 | std::string FormatMmVmscanKswapdWake( |
| 675 | const MmVmscanKswapdWakeFtraceEvent& event) { |
| 676 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 677 | sprintf(line, "mm_vmscan_kswapd_wake: nid=%d order=%d", event.nid(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 678 | event.order()); |
| 679 | return std::string(line); |
| 680 | } |
| 681 | |
| 682 | std::string FormatMmVmscanKswapdSleep( |
| 683 | const MmVmscanKswapdSleepFtraceEvent& event) { |
| 684 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 685 | sprintf(line, "mm_vmscan_kswapd_sleep: nid=%d", event.nid()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 686 | return std::string(line); |
| 687 | } |
| 688 | |
| 689 | std::string FormatRegulatorEnable(const RegulatorEnableFtraceEvent& event) { |
| 690 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 691 | sprintf(line, "regulator_enable: name=%s", event.name().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 692 | return std::string(line); |
| 693 | } |
| 694 | |
| 695 | std::string FormatRegulatorEnableDelay( |
| 696 | const RegulatorEnableDelayFtraceEvent& event) { |
| 697 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 698 | sprintf(line, "regulator_enable_delay: name=%s", event.name().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 699 | return std::string(line); |
| 700 | } |
| 701 | |
| 702 | std::string FormatRegulatorEnableComplete( |
| 703 | const RegulatorEnableCompleteFtraceEvent& event) { |
| 704 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 705 | sprintf(line, "regulator_enable_complete: name=%s", event.name().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 706 | return std::string(line); |
| 707 | } |
| 708 | |
| 709 | std::string FormatRegulatorDisable(const RegulatorDisableFtraceEvent& event) { |
| 710 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 711 | sprintf(line, "regulator_disable: name=%s", event.name().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 712 | return std::string(line); |
| 713 | } |
| 714 | |
| 715 | std::string FormatRegulatorDisableComplete( |
| 716 | const RegulatorDisableCompleteFtraceEvent& event) { |
| 717 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 718 | sprintf(line, "regulator_disable_complete: name=%s", event.name().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 719 | return std::string(line); |
| 720 | } |
| 721 | |
| 722 | std::string FormatRegulatorSetVoltage( |
| 723 | const RegulatorSetVoltageFtraceEvent& event) { |
| 724 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 725 | sprintf(line, "regulator_set_voltage: name=%s (%d-%d)", event.name().c_str(), |
| 726 | event.min(), event.max()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 727 | return std::string(line); |
| 728 | } |
| 729 | |
| 730 | std::string FormatRegulatorSetVoltageComplete( |
| 731 | const RegulatorSetVoltageCompleteFtraceEvent& event) { |
| 732 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 733 | sprintf(line, "regulator_set_voltage_complete: name=%s, val=%u", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 734 | event.name().c_str(), event.val()); |
| 735 | return std::string(line); |
| 736 | } |
| 737 | |
| 738 | std::string FormatSchedCpuHotplug(const SchedCpuHotplugFtraceEvent& event) { |
| 739 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 740 | sprintf(line, "sched_cpu_hotplug: cpu %d %s error=%d", event.affected_cpu(), |
| 741 | event.status() ? "online" : "offline", event.error()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 742 | return std::string(line); |
| 743 | } |
| 744 | |
| 745 | std::string FormatSyncTimeline(const SyncTimelineFtraceEvent& event) { |
| 746 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 747 | sprintf(line, "sync_timeline: name=%s value=%s", event.name().c_str(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 748 | event.value().c_str()); |
| 749 | return std::string(line); |
| 750 | } |
| 751 | |
| 752 | std::string FormatSyncWait(const SyncWaitFtraceEvent& event) { |
| 753 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 754 | sprintf(line, "sync_wait: %s name=%s state=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 755 | event.begin() ? "begin" : "end", event.name().c_str(), |
| 756 | event.status()); |
| 757 | return std::string(line); |
| 758 | } |
| 759 | |
| 760 | std::string FormatSyncPt(const SyncPtFtraceEvent& event) { |
| 761 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 762 | sprintf(line, "sync_pt: name=%s value=%s", event.timeline().c_str(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 763 | event.value().c_str()); |
| 764 | return std::string(line); |
| 765 | } |
| 766 | |
| 767 | std::string FormatSoftirqRaise(const SoftirqRaiseFtraceEvent& event) { |
| 768 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 769 | sprintf(line, "softirq_raise: vec=%u [action=%s]", event.vec(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 770 | SoftirqArray[event.vec()]); |
| 771 | return std::string(line); |
| 772 | } |
| 773 | |
| 774 | std::string FormatSoftirqEntry(const SoftirqEntryFtraceEvent& event) { |
| 775 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 776 | sprintf(line, "softirq_entry: vec=%u [action=%s]", event.vec(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 777 | SoftirqArray[event.vec()]); |
| 778 | return std::string(line); |
| 779 | } |
| 780 | |
| 781 | std::string FormatSoftirqExit(const SoftirqExitFtraceEvent& event) { |
| 782 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 783 | sprintf(line, "softirq_exit: vec=%u [action=%s]", event.vec(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 784 | SoftirqArray[event.vec()]); |
| 785 | return std::string(line); |
| 786 | } |
| 787 | |
| 788 | std::string FormatI2cWrite(const I2cWriteFtraceEvent& event) { |
| 789 | char line[2048]; |
| 790 | // TODO(hjd): Check event.buf(). |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 791 | sprintf(line, "i2c_write: i2c-%d #%u a=%03x f=%04x l=%u", event.adapter_nr(), |
| 792 | event.msg_nr(), event.addr(), event.flags(), event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 793 | return std::string(line); |
| 794 | } |
| 795 | |
| 796 | std::string FormatI2cReply(const I2cReplyFtraceEvent& event) { |
| 797 | char line[2048]; |
| 798 | // TODO(hjd): Check event.buf(). |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 799 | sprintf(line, "i2c_reply: i2c-%d #%u a=%03x f=%04x l=%u", event.adapter_nr(), |
| 800 | event.msg_nr(), event.addr(), event.flags(), event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 801 | return std::string(line); |
| 802 | } |
| 803 | |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 804 | std::string FormatMmVmscanDirectReclaimBegin( |
| 805 | const MmVmscanDirectReclaimBeginFtraceEvent& event) { |
| 806 | char line[2048]; |
Isabelle Taylor | 4ce4997 | 2018-10-19 18:53:15 +0100 | [diff] [blame^] | 807 | // TODO(b/117966147): Translate binary to gfp_flag |
| 808 | sprintf( |
| 809 | line, |
| 810 | "mm_vmscan_direct_reclaim_begin: order=%d may_writepage=%d gfp_flags=%d", |
| 811 | event.order(), event.may_writepage(), event.gfp_flags()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 812 | return std::string(line); |
| 813 | } |
| 814 | |
| 815 | std::string FormatMmVmscanDirectReclaimEnd( |
| 816 | const MmVmscanDirectReclaimEndFtraceEvent& event) { |
| 817 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 818 | sprintf(line, "mm_vmscan_direct_reclaim_end: nr_reclaimed=%llu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 819 | event.nr_reclaimed()); |
| 820 | return std::string(line); |
| 821 | } |
| 822 | |
| 823 | std::string FormatLowmemoryKill(const LowmemoryKillFtraceEvent& event) { |
| 824 | char line[2048]; |
| 825 | sprintf(line, |
| 826 | "lowmemory_kill: %s (%d), page cache %lldkB (limit %lldkB), free " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 827 | "%lldKb", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 828 | event.comm().c_str(), event.pid(), event.pagecache_size(), |
| 829 | event.pagecache_limit(), event.free()); |
| 830 | return std::string(line); |
| 831 | } |
| 832 | |
| 833 | std::string FormatWorkqueueExecuteStart( |
| 834 | const WorkqueueExecuteStartFtraceEvent& event) { |
| 835 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 836 | sprintf(line, "workqueue_execute_start: work struct %llx: function %llxf", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 837 | event.work(), event.function()); |
| 838 | return std::string(line); |
| 839 | } |
| 840 | |
| 841 | std::string FormatWorkqueueExecuteEnd( |
| 842 | const WorkqueueExecuteEndFtraceEvent& event) { |
| 843 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 844 | sprintf(line, "workqueue_execute_end: work struct %llx", event.work()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 845 | return std::string(line); |
| 846 | } |
| 847 | |
| 848 | std::string FormatWorkqueueQueueWork( |
| 849 | const WorkqueueQueueWorkFtraceEvent& event) { |
| 850 | char line[2048]; |
| 851 | sprintf( |
| 852 | line, |
| 853 | "workqueue_queue_work: work struct=%llx function=%llxf workqueue=%llx " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 854 | "req_cpu=%u cpu=%u", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 855 | event.work(), event.function(), event.workqueue(), event.req_cpu(), |
| 856 | event.cpu()); |
| 857 | return std::string(line); |
| 858 | } |
| 859 | |
| 860 | std::string FormatWorkqueueActivateWork( |
| 861 | const WorkqueueActivateWorkFtraceEvent& event) { |
| 862 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 863 | sprintf(line, "workqueue_activate_work: work struct %llx", event.work()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 864 | return std::string(line); |
| 865 | } |
| 866 | |
| 867 | std::string FormatMmCompactionBegin(const MmCompactionBeginFtraceEvent& event) { |
| 868 | char line[2048]; |
| 869 | sprintf(line, |
| 870 | "mm_compaction_begin: zone_start=0x%llx migrate_pfn=0x%llx " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 871 | "free_pfn=0x%llx zone_end=0x%llx, mode=%s", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 872 | event.zone_start(), event.migrate_pfn(), event.free_pfn(), |
| 873 | event.zone_end(), event.sync() ? "sync" : "async"); |
| 874 | return std::string(line); |
| 875 | } |
| 876 | |
| 877 | std::string FormatMmCompactionDeferCompaction( |
| 878 | const MmCompactionDeferCompactionFtraceEvent& event) { |
| 879 | char line[2048]; |
| 880 | sprintf(line, |
| 881 | "mm_compaction_defer_compaction: node=%d zone=%-8s order=%d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 882 | "order_failed=%d consider=%u limit=%lu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 883 | event.nid(), MmCompactionSuitableArray[event.idx()], event.order(), |
| 884 | event.order_failed(), event.considered(), 1UL << event.defer_shift()); |
| 885 | return std::string(line); |
| 886 | } |
| 887 | |
| 888 | std::string FormatMmCompactionDeferred( |
| 889 | const MmCompactionDeferredFtraceEvent& event) { |
| 890 | char line[2048]; |
| 891 | sprintf(line, |
| 892 | "mm_compaction_deferred: node=%d zone=%-8s order=%d order_failed=%d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 893 | "consider=%u limit=%lu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 894 | event.nid(), MmCompactionSuitableArray[event.idx()], event.order(), |
| 895 | event.order_failed(), event.considered(), 1UL << event.defer_shift()); |
| 896 | return std::string(line); |
| 897 | } |
| 898 | |
| 899 | std::string FormatMmCompactionDeferReset( |
| 900 | const MmCompactionDeferResetFtraceEvent& event) { |
| 901 | char line[2048]; |
| 902 | sprintf(line, |
| 903 | "mm_compaction_defer_reset: node=%d zone=%-8s order=%d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 904 | "order_failed=%d consider=%u limit=%lu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 905 | event.nid(), MmCompactionSuitableArray[event.idx()], event.order(), |
| 906 | event.order_failed(), event.considered(), 1UL << event.defer_shift()); |
| 907 | return std::string(line); |
| 908 | } |
| 909 | |
| 910 | std::string FormatMmCompactionEnd(const MmCompactionEndFtraceEvent& event) { |
| 911 | char line[2048]; |
| 912 | sprintf(line, |
| 913 | "mm_compaction_end: zone_start=0x%llx migrate_pfn=0x%llx " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 914 | "free_pfn=0x%llx zone_end=0x%llx, mode=%s status=%s", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 915 | event.zone_start(), event.migrate_pfn(), event.free_pfn(), |
| 916 | event.zone_end(), event.sync() ? "sync" : "aysnc", |
| 917 | MmCompactionRetArray[event.status()]); |
| 918 | return std::string(line); |
| 919 | } |
| 920 | |
| 921 | std::string FormatMmCompactionFinished( |
| 922 | const MmCompactionFinishedFtraceEvent& event) { |
| 923 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 924 | sprintf(line, "mm_compaction_finished: node=%d zone=%-8s order=%d ret=%s", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 925 | event.nid(), MmCompactionSuitableArray[event.idx()], event.order(), |
| 926 | MmCompactionRetArray[event.ret()]); |
| 927 | return std::string(line); |
| 928 | } |
| 929 | |
| 930 | std::string FormatMmCompactionIsolateFreepages( |
| 931 | const MmCompactionIsolateFreepagesFtraceEvent& event) { |
| 932 | char line[2048]; |
| 933 | sprintf(line, |
| 934 | "mm_compaction_isolate_freepages: range=(0x%llx ~ 0x%llx) " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 935 | "nr_scanned=%llu nr_taken=%llu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 936 | event.start_pfn(), event.end_pfn(), event.nr_scanned(), |
| 937 | event.nr_taken()); |
| 938 | return std::string(line); |
| 939 | } |
| 940 | |
| 941 | std::string FormatMmCompactionIsolateMigratepages( |
| 942 | const MmCompactionIsolateMigratepagesFtraceEvent& event) { |
| 943 | char line[2048]; |
| 944 | sprintf(line, |
| 945 | "mm_compaction_isolate_migratepages: range=(0x%llx ~ 0x%llx) " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 946 | "nr_scanned=%llu nr_taken=%llu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 947 | event.start_pfn(), event.end_pfn(), event.nr_scanned(), |
| 948 | event.nr_taken()); |
| 949 | return std::string(line); |
| 950 | } |
| 951 | |
| 952 | std::string FormatMmCompactionKcompactdSleep( |
| 953 | const MmCompactionKcompactdSleepFtraceEvent& event) { |
| 954 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 955 | sprintf(line, "mm_compaction_kcompactd_sleep: nid=%d", event.nid()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 956 | return std::string(line); |
| 957 | } |
| 958 | |
| 959 | std::string FormatMmCompactionKcompactdWake( |
| 960 | const MmCompactionKcompactdWakeFtraceEvent& event) { |
| 961 | char line[2048]; |
| 962 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 963 | "mm_compaction_kcompactd_wake: nid=%d order=%d classzone_idx=%-8s", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 964 | event.nid(), event.order(), |
| 965 | MmCompactionSuitableArray[event.classzone_idx()]); |
| 966 | return std::string(line); |
| 967 | } |
| 968 | |
| 969 | std::string FormatMmCompactionMigratepages( |
| 970 | const MmCompactionMigratepagesFtraceEvent& event) { |
| 971 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 972 | sprintf(line, "mm_compaction_migratepages: nr_migrated=%llu nr_failed=%llu", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 973 | event.nr_migrated(), event.nr_failed()); |
| 974 | return std::string(line); |
| 975 | } |
| 976 | |
| 977 | std::string FormatMmCompactionSuitable( |
| 978 | const MmCompactionSuitableFtraceEvent& event) { |
| 979 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 980 | sprintf(line, "mm_compaction_suitable: node=%d zone=%-8s order=%d ret=%s", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 981 | event.nid(), MmCompactionSuitableArray[event.idx()], event.order(), |
| 982 | MmCompactionRetArray[event.ret()]); |
| 983 | return std::string(line); |
| 984 | } |
| 985 | |
| 986 | std::string FormatMmCompactionTryToCompactPages( |
| 987 | const MmCompactionTryToCompactPagesFtraceEvent& event) { |
| 988 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 989 | sprintf(line, |
| 990 | "mm_compaction_try_to_compact_pages: order=%d gfp_mask=0x%x mode=%d", |
| 991 | event.order(), event.gfp_mask(), |
| 992 | event.mode()); // convert to int? |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 993 | return std::string(line); |
| 994 | } |
| 995 | |
| 996 | std::string FormatMmCompactionWakeupKcompactd( |
| 997 | const MmCompactionWakeupKcompactdFtraceEvent& event) { |
| 998 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 999 | sprintf(line, |
| 1000 | "mm_compaction_wakeup_kcompactd: nid=%d order=%d classzone_idx=%-8s", |
| 1001 | event.nid(), event.order(), |
| 1002 | MmCompactionSuitableArray[event.classzone_idx()]); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1003 | return std::string(line); |
| 1004 | } |
| 1005 | |
| 1006 | std::string FormatSuspendResume(const SuspendResumeFtraceEvent& event) { |
| 1007 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1008 | sprintf(line, "suspend_resume: %s[%u] %s", event.action().c_str(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1009 | event.val(), event.start() ? "begin" : "end"); |
| 1010 | return std::string(line); |
| 1011 | } |
| 1012 | |
| 1013 | std::string FormatSchedWakeupNew(const SchedWakeupNewFtraceEvent& event) { |
| 1014 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1015 | sprintf(line, "sched_wakeup_new: comm=%s pid=%d prio=%d target_cpu=%03d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1016 | event.comm().c_str(), event.pid(), event.prio(), event.target_cpu()); |
| 1017 | return std::string(line); |
| 1018 | } |
| 1019 | |
| 1020 | std::string FormatSchedProcessExec(const SchedProcessExecFtraceEvent& event) { |
| 1021 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1022 | sprintf(line, "sched_process_exec: filename=%s pid=%d old_pid=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1023 | event.filename().c_str(), event.pid(), event.old_pid()); |
| 1024 | return std::string(line); |
| 1025 | } |
| 1026 | std::string FormatSchedProcessExit(const SchedProcessExitFtraceEvent& event) { |
| 1027 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1028 | sprintf(line, "sched_process_exit: comm=%s pid=%d tgid=%d prio=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1029 | event.comm().c_str(), event.pid(), event.tgid(), event.prio()); |
| 1030 | return std::string(line); |
| 1031 | } |
| 1032 | std::string FormatSchedProcessFork(const SchedProcessForkFtraceEvent& event) { |
| 1033 | char line[2048]; |
| 1034 | sprintf(line, |
| 1035 | "sched_process_fork: parent_comm=%s parent_pid=%d child_comm=%s " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1036 | "child_pid=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1037 | event.parent_comm().c_str(), event.parent_pid(), |
| 1038 | event.child_comm().c_str(), event.child_pid()); |
| 1039 | return std::string(line); |
| 1040 | } |
| 1041 | std::string FormatSchedProcessFree(const SchedProcessFreeFtraceEvent& event) { |
| 1042 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1043 | sprintf(line, "sched_process_free: comm=%s pid=%d prio=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1044 | event.comm().c_str(), event.pid(), event.prio()); |
| 1045 | return std::string(line); |
| 1046 | } |
| 1047 | std::string FormatSchedProcessHang(const SchedProcessHangFtraceEvent& event) { |
| 1048 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1049 | sprintf(line, "sched_process_hang: comm=%s pid=%d", event.comm().c_str(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1050 | event.pid()); |
| 1051 | return std::string(line); |
| 1052 | } |
| 1053 | |
| 1054 | std::string FormatSchedProcessWait(const SchedProcessWaitFtraceEvent& event) { |
| 1055 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1056 | sprintf(line, "sched_process_wait: comm=%s pid=%d", event.comm().c_str(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1057 | event.pid()); |
| 1058 | return std::string(line); |
| 1059 | } |
| 1060 | |
| 1061 | std::string FormatTaskNewtask(const TaskNewtaskFtraceEvent& event) { |
| 1062 | char line[2048]; |
| 1063 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1064 | "task_newtask: comm=%s pid=%d clone_flags=%llu oom_score_adj=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1065 | event.comm().c_str(), event.pid(), event.clone_flags(), |
| 1066 | event.oom_score_adj()); |
| 1067 | return std::string(line); |
| 1068 | } |
| 1069 | |
| 1070 | std::string FormatTaskRename(const TaskRenameFtraceEvent& event) { |
| 1071 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1072 | sprintf(line, "task_rename: pid=%d oldcomm=%s newcomm=%s oom_score_adj=%d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1073 | event.pid(), event.newcomm().c_str(), event.oldcomm().c_str(), |
| 1074 | event.oom_score_adj()); |
| 1075 | return std::string(line); |
| 1076 | } |
| 1077 | |
| 1078 | std::string FormatBlockBioBackmerge(const BlockBioBackmergeFtraceEvent& event) { |
| 1079 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1080 | sprintf(line, "block_bio_backmerge: %d,%d %s %llu + %u [%s]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1081 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1082 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1083 | event.comm().c_str()); |
| 1084 | return std::string(line); |
| 1085 | } |
| 1086 | |
| 1087 | std::string FormatBlockBioBounce(const BlockBioBounceFtraceEvent& event) { |
| 1088 | char line[2048]; |
| 1089 | sprintf(line, |
| 1090 | "block_bio_bounce:" |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1091 | "%d,%d %s %llu + %u [%s]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1092 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1093 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1094 | event.comm().c_str()); |
| 1095 | return std::string(line); |
| 1096 | } |
| 1097 | |
| 1098 | std::string FormatBlockBioComplete(const BlockBioCompleteFtraceEvent& event) { |
| 1099 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1100 | sprintf(line, "block_bio_complete: %d,%d %s %llu + %u [%d]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1101 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1102 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
| 1103 | event.error()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1104 | return std::string(line); |
| 1105 | } |
| 1106 | |
| 1107 | std::string FormatBlockBioFrontmerge( |
| 1108 | const BlockBioFrontmergeFtraceEvent& event) { |
| 1109 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1110 | sprintf(line, "block_bio_frontmerge: %d,%d %s %llu + %u [%s]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1111 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1112 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1113 | event.comm().c_str()); |
| 1114 | return std::string(line); |
| 1115 | } |
| 1116 | |
| 1117 | std::string FormatBlockBioQueue(const BlockBioQueueFtraceEvent& event) { |
| 1118 | char line[2048]; |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1119 | sprintf(line, "block_bio_queue: %d,%d %s %llu + %u [%s]", BlkMaj(event.dev()), |
| 1120 | BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1121 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1122 | event.comm().c_str()); |
| 1123 | return std::string(line); |
| 1124 | } |
| 1125 | |
| 1126 | std::string FormatBlockBioRemap(const BlockBioRemapFtraceEvent& event) { |
| 1127 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1128 | sprintf(line, "block_bio_remap: %d,%d %s %llu + %u <- (%d,%d) %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1129 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1130 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1131 | BlkMaj(event.dev()), BlkMin(event.dev()), event.old_sector()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1132 | return std::string(line); |
| 1133 | } |
| 1134 | |
| 1135 | std::string FormatBlockDirtyBuffer(const BlockDirtyBufferFtraceEvent& event) { |
| 1136 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1137 | sprintf(line, "block_dirty_buffer: %d,%d sector=%llu size=%zu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1138 | BlkMaj(event.dev()), BlkMin(event.dev()), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1139 | static_cast<unsigned long long>(event.sector()), |
| 1140 | static_cast<size_t>(event.size())); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1141 | return std::string(line); |
| 1142 | } |
| 1143 | |
| 1144 | std::string FormatBlockGetrq(const BlockGetrqFtraceEvent& event) { |
| 1145 | char line[2048]; |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1146 | sprintf(line, "block_getrq: %d,%d %s %llu + %u [%s]", BlkMaj(event.dev()), |
| 1147 | BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1148 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1149 | event.comm().c_str()); |
| 1150 | return std::string(line); |
| 1151 | } |
| 1152 | |
| 1153 | std::string FormatBlockPlug(const BlockPlugFtraceEvent& event) { |
| 1154 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1155 | sprintf(line, "block_plug: comm=[%s]", event.comm().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1156 | return std::string(line); |
| 1157 | } |
| 1158 | |
| 1159 | std::string FormatBlockRqAbort(const BlockRqAbortFtraceEvent& event) { |
| 1160 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1161 | sprintf(line, "block_rq_abort: %d,%d %s (%s) %llu + %u [%d]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1162 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1163 | event.cmd().c_str(), static_cast<unsigned long long>(event.sector()), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1164 | event.nr_sector(), event.errors()); |
| 1165 | return std::string(line); |
| 1166 | } |
| 1167 | |
| 1168 | std::string FormatBlockRqComplete(const BlockRqCompleteFtraceEvent& event) { |
| 1169 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1170 | sprintf(line, "block_rq_complete: %d,%d %s (%s) %llu + %u [%d]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1171 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1172 | event.cmd().c_str(), static_cast<unsigned long long>(event.sector()), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1173 | event.nr_sector(), event.errors()); |
| 1174 | return std::string(line); |
| 1175 | } |
| 1176 | |
| 1177 | std::string FormatBlockRqInsert(const BlockRqInsertFtraceEvent& event) { |
| 1178 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1179 | sprintf(line, "block_rq_insert: %d,%d %s %u (%s) %llu + %u [%s]", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1180 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1181 | event.bytes(), event.cmd().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1182 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1183 | event.comm().c_str()); |
| 1184 | return std::string(line); |
| 1185 | } |
| 1186 | |
| 1187 | std::string FormatBlockRqRemap(const BlockRqRemapFtraceEvent& event) { |
| 1188 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1189 | sprintf(line, "block_rq_remap: %d,%d %s %llu + %u <- (%d,%d) %llu %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1190 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1191 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1192 | BlkMaj(event.dev()), BlkMin(event.dev()), event.old_sector(), |
| 1193 | event.nr_bios()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1194 | return std::string(line); |
| 1195 | } |
| 1196 | |
| 1197 | std::string FormatBlockRqRequeue(const BlockRqRequeueFtraceEvent& event) { |
| 1198 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1199 | sprintf(line, "block_rq_requeue: %d,%d %s (%s) %llu + %u [%d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1200 | BlkMaj(event.dev()), BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1201 | event.cmd().c_str(), static_cast<unsigned long long>(event.sector()), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1202 | event.nr_sector(), event.errors()); |
| 1203 | return std::string(line); |
| 1204 | } |
| 1205 | |
| 1206 | std::string FormatBlockSleeprq(const BlockSleeprqFtraceEvent& event) { |
| 1207 | char line[2048]; |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1208 | sprintf(line, "block_sleeprq: %d,%d %s %llu + %u [%s]", BlkMaj(event.dev()), |
| 1209 | BlkMin(event.dev()), event.rwbs().c_str(), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1210 | static_cast<unsigned long long>(event.sector()), event.nr_sector(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1211 | event.comm().c_str()); |
| 1212 | return std::string(line); |
| 1213 | } |
| 1214 | |
| 1215 | std::string FormatBlockSplit(const BlockSplitFtraceEvent& event) { |
| 1216 | char line[2048]; |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1217 | sprintf(line, "block_split: %d,%d %s %llu / %llu [%s]", BlkMaj(event.dev()), |
| 1218 | BlkMin(event.dev()), event.rwbs().c_str(), |
| 1219 | static_cast<unsigned long long>(event.sector()), event.new_sector(), |
| 1220 | event.comm().c_str()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1221 | return std::string(line); |
| 1222 | } |
| 1223 | |
| 1224 | std::string FormatBlockTouchBuffer(const BlockTouchBufferFtraceEvent& event) { |
| 1225 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1226 | sprintf(line, "block_touch_buffer: %d,%d sector=%llu size=%zu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1227 | BlkMaj(event.dev()), BlkMin(event.dev()), |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 1228 | static_cast<unsigned long long>(event.sector()), |
| 1229 | static_cast<size_t>(event.size())); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1230 | return std::string(line); |
| 1231 | } |
| 1232 | |
| 1233 | std::string FormatBlockUnplug(const BlockUnplugFtraceEvent& event) { |
| 1234 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1235 | sprintf(line, "block_unplug: [%s] %d", event.comm().c_str(), event.nr_rq()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1236 | return std::string(line); |
| 1237 | } |
| 1238 | |
| 1239 | std::string FormatExt4AllocDaBlocks(const Ext4AllocDaBlocksFtraceEvent& event) { |
| 1240 | char line[2048]; |
| 1241 | sprintf(line, |
| 1242 | "ext4_alloc_da_blocks: dev %d,%d ino %lu data_blocks %u meta_blocks " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1243 | "%u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1244 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1245 | event.data_blocks(), event.meta_blocks()); |
| 1246 | return std::string(line); |
| 1247 | } |
| 1248 | |
| 1249 | std::string FormatExt4AllocateBlocks( |
| 1250 | const Ext4AllocateBlocksFtraceEvent& event) { |
| 1251 | char line[2048]; |
| 1252 | sprintf(line, |
| 1253 | "ext4_allocate_blocks: dev %d,%d ino %lu flags %s len %u block %llu " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1254 | "lblk %u goal %llu lleft %u lright %u pleft %llu pright %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1255 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1256 | GetExt4HintFlag(event.flags()), event.len(), event.block(), |
| 1257 | event.logical(), event.goal(), event.lleft(), event.lright(), |
| 1258 | event.pleft(), event.pright()); |
| 1259 | return std::string(line); |
| 1260 | } |
| 1261 | |
| 1262 | std::string FormatExt4AllocateInode(const Ext4AllocateInodeFtraceEvent& event) { |
| 1263 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1264 | sprintf(line, "ext4_allocate_inode: dev %d,%d ino %lu dir %lu mode 0%o", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1265 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.dir(), |
| 1266 | event.mode()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1267 | return std::string(line); |
| 1268 | } |
| 1269 | |
| 1270 | std::string FormatExt4BeginOrderedTruncate( |
| 1271 | const Ext4BeginOrderedTruncateFtraceEvent& event) { |
| 1272 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1273 | sprintf(line, "ext4_begin_ordered_truncate: dev %d,%d ino %lu new_size %lld", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1274 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1275 | event.new_size()); |
| 1276 | return std::string(line); |
| 1277 | } |
| 1278 | |
| 1279 | std::string FormatExt4CollapseRange(const Ext4CollapseRangeFtraceEvent& event) { |
| 1280 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1281 | sprintf(line, "ext4_collapse_range: dev %d,%d ino %lu offset %lld len %lld", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1282 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.offset(), |
| 1283 | event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1284 | return std::string(line); |
| 1285 | } |
| 1286 | |
| 1287 | std::string FormatExt4DaReleaseSpace( |
| 1288 | const Ext4DaReleaseSpaceFtraceEvent& event) { |
| 1289 | char line[2048]; |
| 1290 | sprintf(line, |
| 1291 | "ext4_da_release_space: dev %d,%d ino %lu mode 0%o i_blocks %llu " |
| 1292 | "freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1293 | "allocated_meta_blocks %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1294 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.mode(), |
| 1295 | event.i_blocks(), event.freed_blocks(), event.reserved_data_blocks(), |
| 1296 | event.reserved_meta_blocks(), event.allocated_meta_blocks()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1297 | return std::string(line); |
| 1298 | } |
| 1299 | |
| 1300 | std::string FormatExt4DaReserveSpace( |
| 1301 | const Ext4DaReserveSpaceFtraceEvent& event) { |
| 1302 | char line[2048]; |
| 1303 | sprintf(line, |
| 1304 | "ext4_da_reserve_space:dev %d,%d ino %lu mode 0%o i_blocks %llu " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1305 | "reserved_data_blocks %d reserved_meta_blocks %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1306 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.mode(), |
| 1307 | event.i_blocks(), event.reserved_data_blocks(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1308 | event.reserved_meta_blocks()); |
| 1309 | return std::string(line); |
| 1310 | } |
| 1311 | |
| 1312 | std::string FormatExt4DaUpdateReserveSpace( |
| 1313 | const Ext4DaUpdateReserveSpaceFtraceEvent& event) { |
| 1314 | char line[2048]; |
| 1315 | sprintf(line, |
| 1316 | "ext4_da_update_reserve_space: dev %d,%d ino %lu mode 0%o i_blocks " |
| 1317 | "%llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1318 | "allocated_meta_blocks %d quota_claim %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1319 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.mode(), |
| 1320 | event.i_blocks(), event.used_blocks(), event.reserved_data_blocks(), |
| 1321 | event.reserved_meta_blocks(), event.allocated_meta_blocks(), |
| 1322 | event.quota_claim()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1323 | return std::string(line); |
| 1324 | } |
| 1325 | |
| 1326 | std::string FormatExt4DaWritePages(const Ext4DaWritePagesFtraceEvent& event) { |
| 1327 | char line[2048]; |
| 1328 | sprintf(line, |
| 1329 | "ext4_da_write_pages: dev %d,%d ino %lu first_page %lu nr_to_write " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1330 | "%ld sync_mode %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1331 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
| 1332 | event.first_page(), event.nr_to_write(), event.sync_mode()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1333 | return std::string(line); |
| 1334 | } |
| 1335 | |
| 1336 | // TODO(hjd): Check flags |
| 1337 | std::string FormatExt4DaWritePagesExtent( |
| 1338 | const Ext4DaWritePagesExtentFtraceEvent& event) { |
| 1339 | char line[2048]; |
| 1340 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1341 | "ext4_da_write_pages_extent: dev %d,%d ino %lu lblk %llu len %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1342 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1343 | event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1344 | return std::string(line); |
| 1345 | } |
| 1346 | |
| 1347 | std::string FormatExt4DiscardBlocks(const Ext4DiscardBlocksFtraceEvent& event) { |
| 1348 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1349 | sprintf(line, "ext4_discard_blocks: dev %d,%d blk %llu count %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1350 | BlkMaj(event.dev()), BlkMin(event.dev()), event.blk(), event.count()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1351 | return std::string(line); |
| 1352 | } |
| 1353 | |
| 1354 | std::string FormatExt4DiscardPreallocations( |
| 1355 | const Ext4DiscardPreallocationsFtraceEvent& event) { |
| 1356 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1357 | sprintf(line, "ext4_discard_preallocations: dev %d,%d ino %lu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1358 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1359 | return std::string(line); |
| 1360 | } |
| 1361 | |
| 1362 | std::string FormatExt4DropInode(const Ext4DropInodeFtraceEvent& event) { |
| 1363 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1364 | sprintf(line, "ext4_drop_inode: dev %d,%d ino %lu drop %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1365 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.drop()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1366 | return std::string(line); |
| 1367 | } |
| 1368 | |
| 1369 | // TODO(hjd): Check Es status flags |
| 1370 | std::string FormatExt4EsCacheExtent(const Ext4EsCacheExtentFtraceEvent& event) { |
| 1371 | char line[2048]; |
| 1372 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1373 | "ext4_es_cache_extent: dev %d,%d ino %lu es [%u/%u) mapped %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1374 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1375 | event.len(), event.pblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1376 | return std::string(line); |
| 1377 | } |
| 1378 | |
| 1379 | std::string FormatExt4EsFindDelayedExtentRangeEnter( |
| 1380 | const Ext4EsFindDelayedExtentRangeEnterFtraceEvent& event) { |
| 1381 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1382 | sprintf(line, |
| 1383 | "ext4_es_find_delayed_extent_range_enter: dev %d,%d ino %lu lblk %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1384 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1385 | return std::string(line); |
| 1386 | } |
| 1387 | |
| 1388 | // TODO(hjd): Check Es status flags |
| 1389 | std::string FormatExt4EsFindDelayedExtentRangeExit( |
| 1390 | const Ext4EsFindDelayedExtentRangeExitFtraceEvent& event) { |
| 1391 | char line[2048]; |
| 1392 | sprintf(line, |
| 1393 | "ext4_es_find_delayed_extent_range_exit: dev %d,%d ino %lu es " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1394 | "[%u/%u) mapped %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1395 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1396 | event.len(), event.pblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1397 | return std::string(line); |
| 1398 | } |
| 1399 | |
| 1400 | // TODO(hjd): Check Es status flags |
| 1401 | std::string FormatExt4EsInsertExtent( |
| 1402 | const Ext4EsInsertExtentFtraceEvent& event) { |
| 1403 | char line[2048]; |
| 1404 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1405 | "ext4_es_insert_extent: dev %d,%d ino %lu es [%u/%u) mapped %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1406 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1407 | event.len(), event.pblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1408 | return std::string(line); |
| 1409 | } |
| 1410 | |
| 1411 | std::string FormatExt4EsLookupExtentEnter( |
| 1412 | const Ext4EsLookupExtentEnterFtraceEvent& event) { |
| 1413 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1414 | sprintf(line, "ext4_es_lookup_extent_enter: dev %d,%d ino %lu lblk %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1415 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1416 | return std::string(line); |
| 1417 | } |
| 1418 | |
| 1419 | // TODO(hjd): Check Es status flags |
| 1420 | std::string FormatExt4EsLookupExtentExit( |
| 1421 | const Ext4EsLookupExtentExitFtraceEvent& event) { |
| 1422 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1423 | sprintf(line, |
| 1424 | "ext4_es_lookup_extent_exit: dev %d,%d ino %lu found %d [%u/%u) %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1425 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.found(), |
| 1426 | event.lblk(), event.len(), event.found() ? event.pblk() : 0); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1427 | return std::string(line); |
| 1428 | } |
| 1429 | |
| 1430 | std::string FormatExt4EsRemoveExtent( |
| 1431 | const Ext4EsRemoveExtentFtraceEvent& event) { |
| 1432 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1433 | sprintf(line, "ext4_es_remove_extent: dev %d,%d ino %lu es [%lld/%lld)", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1434 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1435 | event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1436 | return std::string(line); |
| 1437 | } |
| 1438 | |
| 1439 | std::string FormatExt4EsShrink(const Ext4EsShrinkFtraceEvent& event) { |
| 1440 | char line[2048]; |
| 1441 | sprintf(line, |
| 1442 | "ext4_es_shrink: dev %d,%d nr_shrunk %d, scan_time %llu nr_skipped " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1443 | "%d retried %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1444 | BlkMaj(event.dev()), BlkMin(event.dev()), event.nr_shrunk(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1445 | event.scan_time(), event.nr_skipped(), event.retried()); |
| 1446 | return std::string(line); |
| 1447 | } |
| 1448 | |
| 1449 | std::string FormatExt4EsShrinkCount(const Ext4EsShrinkCountFtraceEvent& event) { |
| 1450 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1451 | sprintf(line, "ext4_es_shrink_count: dev %d,%d nr_to_scan %d cache_cnt %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1452 | BlkMaj(event.dev()), BlkMin(event.dev()), event.nr_to_scan(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1453 | event.cache_cnt()); |
| 1454 | return std::string(line); |
| 1455 | } |
| 1456 | |
| 1457 | std::string FormatExt4EsShrinkScanEnter( |
| 1458 | const Ext4EsShrinkScanEnterFtraceEvent& event) { |
| 1459 | char line[2048]; |
| 1460 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1461 | "ext4_es_shrink_scan_enter: dev %d,%d nr_to_scan %d cache_cnt %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1462 | BlkMaj(event.dev()), BlkMin(event.dev()), event.nr_to_scan(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1463 | event.cache_cnt()); |
| 1464 | return std::string(line); |
| 1465 | } |
| 1466 | |
| 1467 | std::string FormatExt4EsShrinkScanExit( |
| 1468 | const Ext4EsShrinkScanExitFtraceEvent& event) { |
| 1469 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1470 | sprintf(line, "ext4_es_shrink_scan_exit: dev %d,%d nr_shrunk %d cache_cnt %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1471 | BlkMaj(event.dev()), BlkMin(event.dev()), event.nr_shrunk(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1472 | event.cache_cnt()); |
| 1473 | return std::string(line); |
| 1474 | } |
| 1475 | |
| 1476 | std::string FormatExt4EvictInode(const Ext4EvictInodeFtraceEvent& event) { |
| 1477 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1478 | sprintf(line, "ext4_evict_inode: dev %d,%d ino %lu nlink %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1479 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.nlink()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1480 | return std::string(line); |
| 1481 | } |
| 1482 | |
| 1483 | std::string FormatExt4ExtConvertToInitializedEnter( |
| 1484 | const Ext4ExtConvertToInitializedEnterFtraceEvent& event) { |
| 1485 | char line[2048]; |
| 1486 | sprintf(line, |
| 1487 | "ext4_ext_convert_to_initialized_enter: dev %d,%d ino %lu m_lblk %u " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1488 | "m_len %u u_lblk %u u_len %u u_pblk %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1489 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.m_lblk(), |
| 1490 | event.m_len(), event.u_lblk(), event.u_len(), event.u_pblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1491 | return std::string(line); |
| 1492 | } |
| 1493 | |
| 1494 | std::string FormatExt4ExtConvertToInitializedFastpath( |
| 1495 | const Ext4ExtConvertToInitializedFastpathFtraceEvent& event) { |
| 1496 | char line[2048]; |
| 1497 | sprintf(line, |
| 1498 | "ext4_ext_convert_to_initialized_fastpath: dev %d,%d ino %lu m_lblk " |
| 1499 | "%u m_len %u u_lblk %u u_len %u u_pblk %llu i_lblk %u i_len %u " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1500 | "i_pblk %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1501 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.m_lblk(), |
| 1502 | event.m_len(), event.u_lblk(), event.u_len(), event.u_pblk(), |
| 1503 | event.i_lblk(), event.i_len(), event.i_pblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1504 | return std::string(line); |
| 1505 | } |
| 1506 | |
| 1507 | std::string FormatExt4ExtHandleUnwrittenExtents( |
| 1508 | const Ext4ExtHandleUnwrittenExtentsFtraceEvent& event) { |
| 1509 | char line[2048]; |
| 1510 | sprintf(line, |
| 1511 | "ext4_ext_handle_unwritten_extents: dev %d,%d ino %lu m_lblk %u " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1512 | "m_pblk %llu m_len %u flags %s allocated %d newblock %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1513 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1514 | event.pblk(), event.len(), GetExt4ExtFlag(event.flags()), |
| 1515 | event.allocated(), event.newblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1516 | return std::string(line); |
| 1517 | } |
| 1518 | |
| 1519 | std::string FormatExt4ExtInCache(const Ext4ExtInCacheFtraceEvent& event) { |
| 1520 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1521 | sprintf(line, "ext4_ext_in_cache: dev %d,%d ino %lu lblk %u ret %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1522 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1523 | event.ret()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1524 | return std::string(line); |
| 1525 | } |
| 1526 | |
| 1527 | std::string FormatExt4ExtLoadExtent(const Ext4ExtLoadExtentFtraceEvent& event) { |
| 1528 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1529 | sprintf(line, "ext4_ext_load_extent: dev %d,%d ino %lu lblk %u pblk %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1530 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1531 | event.pblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1532 | return std::string(line); |
| 1533 | } |
| 1534 | |
| 1535 | std::string FormatExt4ExtMapBlocksEnter( |
| 1536 | const Ext4ExtMapBlocksEnterFtraceEvent& event) { |
| 1537 | char line[2048]; |
| 1538 | sprintf( |
| 1539 | line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1540 | "ext4_ext_map_blocks_enter: dev %d,%d ino %lu lblk %u len %u flags %s", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1541 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
| 1542 | static_cast<unsigned>(event.lblk()), event.len(), |
| 1543 | GetExt4ExtFlag(event.flags())); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1544 | return std::string(line); |
| 1545 | } |
| 1546 | |
| 1547 | std::string FormatExt4ExtMapBlocksExit( |
| 1548 | const Ext4ExtMapBlocksExitFtraceEvent& event) { |
| 1549 | char line[2048]; |
| 1550 | sprintf(line, |
| 1551 | "ext4_ext_map_blocks_exit: dev %d,%d ino %lu lblk %u pblk %llu len " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1552 | "%u flags %x ret %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1553 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1554 | event.pblk(), event.len(), event.flags(), event.ret()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1555 | return std::string(line); |
| 1556 | } |
| 1557 | |
| 1558 | std::string FormatExt4ExtPutInCache(const Ext4ExtPutInCacheFtraceEvent& event) { |
| 1559 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1560 | sprintf(line, |
| 1561 | "ext4_ext_put_in_cache: dev %d,%d ino %lu lblk %u len %u start %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1562 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1563 | event.len(), event.start()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1564 | return std::string(line); |
| 1565 | } |
| 1566 | |
| 1567 | std::string FormatExt4ExtRemoveSpace( |
| 1568 | const Ext4ExtRemoveSpaceFtraceEvent& event) { |
| 1569 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1570 | sprintf(line, |
| 1571 | "ext4_ext_remove_space: dev %d,%d ino %lu since %u end %u depth %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1572 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.start(), |
| 1573 | event.end(), event.depth()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1574 | return std::string(line); |
| 1575 | } |
| 1576 | |
| 1577 | std::string FormatExt4ExtRemoveSpaceDone( |
| 1578 | const Ext4ExtRemoveSpaceDoneFtraceEvent& event) { |
| 1579 | char line[2048]; |
| 1580 | sprintf(line, |
| 1581 | "ext4_ext_remove_space_done: dev %d,%d ino %lu since %u end %u depth " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1582 | "%d partial %lld remaining_entries %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1583 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.start(), |
| 1584 | event.end(), event.depth(), event.partial(), event.eh_entries()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1585 | return std::string(line); |
| 1586 | } |
| 1587 | |
| 1588 | std::string FormatExt4ExtRmIdx(const Ext4ExtRmIdxFtraceEvent& event) { |
| 1589 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1590 | sprintf(line, "ext4_ext_rm_idx: dev %d,%d ino %lu index_pblk %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1591 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.pblk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1592 | return std::string(line); |
| 1593 | } |
| 1594 | |
| 1595 | std::string FormatExt4ExtRmLeaf(const Ext4ExtRmLeafFtraceEvent& event) { |
| 1596 | char line[2048]; |
| 1597 | sprintf(line, |
| 1598 | "ext4_ext_rm_leaf: dev %d,%d ino %lu start_lblk %u last_extent " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1599 | "[%u(%llu), %u]partial_cluster %lld", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1600 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.start(), |
| 1601 | event.ee_lblk(), event.ee_pblk(), event.ee_len(), event.partial()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1602 | return std::string(line); |
| 1603 | } |
| 1604 | |
| 1605 | std::string FormatExt4ExtShowExtent(const Ext4ExtShowExtentFtraceEvent& event) { |
| 1606 | char line[2048]; |
| 1607 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1608 | "ext4_ext_show_extent: dev %d,%d ino %lu lblk %u pblk %llu len %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1609 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1610 | event.pblk(), event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1611 | return std::string(line); |
| 1612 | } |
| 1613 | |
| 1614 | std::string FormatExt4FallocateEnter( |
| 1615 | const Ext4FallocateEnterFtraceEvent& event) { |
| 1616 | char line[2048]; |
| 1617 | sprintf( |
| 1618 | line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1619 | "ext4_fallocate_enter: dev %d,%d ino %lu offset %lld len %lld mode %s", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1620 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.offset(), |
| 1621 | event.len(), GetExt4ModeFlag(event.mode())); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1622 | return std::string(line); |
| 1623 | } |
| 1624 | |
| 1625 | std::string FormatExt4FallocateExit(const Ext4FallocateExitFtraceEvent& event) { |
| 1626 | char line[2048]; |
| 1627 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1628 | "ext4_fallocate_exit: dev %d,%d ino %lu pos %lld blocks %u ret %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1629 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.pos(), |
| 1630 | event.blocks(), event.ret()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1631 | return std::string(line); |
| 1632 | } |
| 1633 | |
| 1634 | std::string FormatExt4FindDelallocRange( |
| 1635 | const Ext4FindDelallocRangeFtraceEvent& event) { |
| 1636 | char line[2048]; |
| 1637 | sprintf(line, |
| 1638 | "ext4_find_delalloc_range: dev %d,%d ino %lu from %u to %u reverse " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1639 | "%d found %d (blk = %u)", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1640 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.from(), |
| 1641 | event.to(), event.reverse(), event.found(), event.found_blk()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1642 | return std::string(line); |
| 1643 | } |
| 1644 | |
| 1645 | std::string FormatExt4Forget(const Ext4ForgetFtraceEvent& event) { |
| 1646 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1647 | sprintf(line, |
| 1648 | "ext4_forget: dev %d,%d ino %lu mode 0%o is_metadata %d block %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1649 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.mode(), |
| 1650 | event.is_metadata(), event.block()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1651 | return std::string(line); |
| 1652 | } |
| 1653 | |
| 1654 | std::string FormatExt4FreeBlocks(const Ext4FreeBlocksFtraceEvent& event) { |
| 1655 | char line[2048]; |
| 1656 | sprintf(line, |
| 1657 | "ext4_free_blocks: dev %d,%d ino %lu mode 0%o block %llu count %lu " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1658 | "flags %s", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1659 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.mode(), |
| 1660 | event.block(), event.count(), GetExt4FreeBlocksFlag(event.flags())); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1661 | return std::string(line); |
| 1662 | } |
| 1663 | |
| 1664 | std::string FormatExt4FreeInode(const Ext4FreeInodeFtraceEvent& event) { |
| 1665 | char line[2048]; |
| 1666 | sprintf(line, |
| 1667 | "ext4_free_inode: dev %d,%d ino %lu mode 0%o uid %u gid %u blocks " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1668 | "%llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1669 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.mode(), |
| 1670 | event.uid(), event.gid(), event.blocks()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1671 | return std::string(line); |
| 1672 | } |
| 1673 | |
| 1674 | std::string FormatExt4GetImpliedClusterAllocExit( |
| 1675 | const Ext4GetImpliedClusterAllocExitFtraceEvent& event) { |
| 1676 | char line[2048]; |
| 1677 | sprintf(line, |
| 1678 | "ext4_get_implied_cluster_alloc_exit: dev %d,%d m_lblk %u m_pblk " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1679 | "%llu m_len %u m_flags %u ret %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1680 | BlkMaj(event.dev()), BlkMin(event.dev()), event.lblk(), event.pblk(), |
| 1681 | event.len(), event.flags(), event.ret()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1682 | return std::string(line); |
| 1683 | } |
| 1684 | |
| 1685 | std::string FormatExt4GetReservedClusterAlloc( |
| 1686 | const Ext4GetReservedClusterAllocFtraceEvent& event) { |
| 1687 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1688 | sprintf(line, |
| 1689 | "ext4_get_reserved_cluster_alloc: dev %d,%d ino %lu lblk %u len %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1690 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1691 | event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1692 | return std::string(line); |
| 1693 | } |
| 1694 | |
| 1695 | std::string FormatExt4IndMapBlocksEnter( |
| 1696 | const Ext4IndMapBlocksEnterFtraceEvent& event) { |
| 1697 | char line[2048]; |
| 1698 | sprintf( |
| 1699 | line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1700 | "ext4_ind_map_blocks_enter: dev %d,%d ino %lu lblk %u len %u flags %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1701 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1702 | event.len(), event.flags()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1703 | return std::string(line); |
| 1704 | } |
| 1705 | |
| 1706 | std::string FormatExt4IndMapBlocksExit( |
| 1707 | const Ext4IndMapBlocksExitFtraceEvent& event) { |
| 1708 | char line[2048]; |
| 1709 | sprintf(line, |
| 1710 | "ext4_ind_map_blocks_exit: dev %d,%d ino %lu lblk %u pblk %llu len " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1711 | "%u flags %x ret %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1712 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.lblk(), |
| 1713 | event.pblk(), event.len(), event.flags(), event.ret()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1714 | return std::string(line); |
| 1715 | } |
| 1716 | |
| 1717 | std::string FormatExt4InsertRange(const Ext4InsertRangeFtraceEvent& event) { |
| 1718 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1719 | sprintf(line, "ext4_insert_range: dev %d,%d ino %lu offset %lld len %lld", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1720 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.offset(), |
| 1721 | event.len()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1722 | return std::string(line); |
| 1723 | } |
| 1724 | |
| 1725 | std::string FormatExt4Invalidatepage( |
| 1726 | const Ext4InvalidatepageFtraceEvent& event) { |
| 1727 | char line[2048]; |
| 1728 | sprintf(line, |
| 1729 | "ext4_invalidatepage: dev %d,%d ino %lu page_index %lu offset %u " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1730 | "length %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1731 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.index(), |
| 1732 | event.offset(), event.length()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1733 | return std::string(line); |
| 1734 | } |
| 1735 | |
| 1736 | std::string FormatExt4JournalStart(const Ext4JournalStartFtraceEvent& event) { |
| 1737 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1738 | sprintf(line, |
| 1739 | "ext4_journal_start: dev %d,%d blocks, %d rsv_blocks, %d caller %pS", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1740 | BlkMaj(event.dev()), BlkMin(event.dev()), event.blocks(), |
| 1741 | event.rsv_blocks(), event.ip()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1742 | return std::string(line); |
| 1743 | } |
| 1744 | |
| 1745 | std::string FormatExt4JournalStartReserved( |
| 1746 | const Ext4JournalStartReservedFtraceEvent& event) { |
| 1747 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1748 | sprintf(line, "ext4_journal_start_reserved: dev %d,%d blocks, %d caller %pS", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1749 | BlkMaj(event.dev()), BlkMin(event.dev()), event.blocks(), event.ip()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1750 | return std::string(line); |
| 1751 | } |
| 1752 | |
| 1753 | std::string FormatExt4JournalledInvalidatepage( |
| 1754 | const Ext4JournalledInvalidatepageFtraceEvent& event) { |
| 1755 | char line[2048]; |
| 1756 | sprintf(line, |
| 1757 | "ext4_journalled_invalidatepage: dev %d,%d ino %lu page_index %lu " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1758 | "offset %u length %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1759 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.index(), |
| 1760 | event.offset(), event.length()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1761 | return std::string(line); |
| 1762 | } |
| 1763 | |
| 1764 | std::string FormatExt4JournalledWriteEnd( |
| 1765 | const Ext4JournalledWriteEndFtraceEvent& event) { |
| 1766 | char line[2048]; |
| 1767 | sprintf(line, |
| 1768 | "ext4_journalled_write_end: dev %d,%d ino %lu pos %lld len %u copied " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1769 | "%u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1770 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.pos(), |
| 1771 | event.len(), event.copied()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1772 | return std::string(line); |
| 1773 | } |
| 1774 | |
| 1775 | std::string FormatExt4LoadInode(const Ext4LoadInodeFtraceEvent& event) { |
| 1776 | char line[2048]; |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1777 | sprintf(line, "ext4_load_inode: dev %d,%d ino %ld", BlkMaj(event.dev()), |
| 1778 | BlkMin(event.dev()), event.ino()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1779 | return std::string(line); |
| 1780 | } |
| 1781 | |
| 1782 | std::string FormatExt4LoadInodeBitmap( |
| 1783 | const Ext4LoadInodeBitmapFtraceEvent& event) { |
| 1784 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1785 | sprintf(line, "ext4_load_inode_bitmap: dev %d,%d group %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1786 | BlkMaj(event.dev()), BlkMin(event.dev()), event.group()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1787 | return std::string(line); |
| 1788 | } |
| 1789 | |
| 1790 | std::string FormatExt4MarkInodeDirty( |
| 1791 | const Ext4MarkInodeDirtyFtraceEvent& event) { |
| 1792 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1793 | sprintf(line, "ext4_mark_inode_dirty: dev %d,%d ino %lu caller %pS", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1794 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.ip()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1795 | return std::string(line); |
| 1796 | } |
| 1797 | |
| 1798 | std::string FormatExt4MbBitmapLoad(const Ext4MbBitmapLoadFtraceEvent& event) { |
| 1799 | char line[2048]; |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1800 | sprintf(line, "ext4_mb_bitmap_load: dev %d,%d group %u", BlkMaj(event.dev()), |
| 1801 | BlkMin(event.dev()), event.group()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1802 | return std::string(line); |
| 1803 | } |
| 1804 | |
| 1805 | std::string FormatExt4MbBuddyBitmapLoad( |
| 1806 | const Ext4MbBuddyBitmapLoadFtraceEvent& event) { |
| 1807 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1808 | sprintf(line, "ext4_mb_buddy_bitmap_load: dev %d,%d group %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1809 | BlkMaj(event.dev()), BlkMin(event.dev()), event.group()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1810 | return std::string(line); |
| 1811 | } |
| 1812 | |
| 1813 | std::string FormatExt4MbDiscardPreallocations( |
| 1814 | const Ext4MbDiscardPreallocationsFtraceEvent& event) { |
| 1815 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1816 | sprintf(line, "ext4_mb_discard_preallocations: dev %d,%d needed %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1817 | BlkMaj(event.dev()), BlkMin(event.dev()), event.needed()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1818 | return std::string(line); |
| 1819 | } |
| 1820 | |
| 1821 | std::string FormatExt4MbNewGroupPa(const Ext4MbNewGroupPaFtraceEvent& event) { |
| 1822 | char line[2048]; |
| 1823 | sprintf(line, |
| 1824 | "ext4_mb_new_group_pa: dev %d,%d ino %lu pstart %llu len %u lstart " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1825 | "%llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1826 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1827 | event.pa_pstart(), event.pa_len(), event.pa_lstart()); |
| 1828 | return std::string(line); |
| 1829 | } |
| 1830 | |
| 1831 | std::string FormatExt4MbNewInodePa(const Ext4MbNewInodePaFtraceEvent& event) { |
| 1832 | char line[2048]; |
| 1833 | sprintf(line, |
| 1834 | "ext4_mb_new_inode_pa: dev %d,%d ino %lu pstart %llu len %u lstart " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1835 | "%llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1836 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1837 | event.pa_pstart(), event.pa_len(), event.pa_lstart()); |
| 1838 | return std::string(line); |
| 1839 | } |
| 1840 | |
| 1841 | std::string FormatExt4MbReleaseGroupPa( |
| 1842 | const Ext4MbReleaseGroupPaFtraceEvent& event) { |
| 1843 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1844 | sprintf(line, "ext4_mb_release_group_pa: dev %d,%d pstart %llu len %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1845 | BlkMaj(event.dev()), BlkMin(event.dev()), event.pa_pstart(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1846 | event.pa_len()); |
| 1847 | return std::string(line); |
| 1848 | } |
| 1849 | |
| 1850 | std::string FormatExt4MbReleaseInodePa( |
| 1851 | const Ext4MbReleaseInodePaFtraceEvent& event) { |
| 1852 | char line[2048]; |
| 1853 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1854 | "ext4_mb_release_inode_pa: dev %d,%d ino %lu block %llu count %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1855 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.block(), |
| 1856 | event.count()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1857 | return std::string(line); |
| 1858 | } |
| 1859 | |
| 1860 | std::string FormatExt4MballocAlloc(const Ext4MballocAllocFtraceEvent& event) { |
| 1861 | char line[2048]; |
| 1862 | sprintf(line, |
| 1863 | "ext4_mballoc_alloc: dev %d,%d inode %lu orig %u/%d/%u@%u goal " |
| 1864 | "%u/%d/%u@%u result %u/%d/%u@%u blks %u grps %u cr %u flags %s tail " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1865 | "%u broken %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1866 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1867 | event.orig_group(), event.orig_start(), event.orig_len(), |
| 1868 | event.orig_logical(), event.goal_group(), event.goal_start(), |
| 1869 | event.goal_len(), event.goal_logical(), event.result_group(), |
| 1870 | event.result_start(), event.result_len(), event.result_logical(), |
| 1871 | event.found(), event.groups(), event.cr(), |
| 1872 | GetExt4HintFlag(event.flags()), event.tail(), |
| 1873 | event.buddy() ? 1 << event.buddy() : 0); |
| 1874 | return std::string(line); |
| 1875 | } |
| 1876 | |
| 1877 | std::string FormatExt4MballocDiscard( |
| 1878 | const Ext4MballocDiscardFtraceEvent& event) { |
| 1879 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1880 | sprintf(line, "ext4_mballoc_discard: dev %d,%d inode %lu extent %u/%d/%d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1881 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1882 | event.result_group(), event.result_start(), event.result_len()); |
| 1883 | return std::string(line); |
| 1884 | } |
| 1885 | |
| 1886 | std::string FormatExt4MballocFree(const Ext4MballocFreeFtraceEvent& event) { |
| 1887 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1888 | sprintf(line, "ext4_mballoc_free: dev %d,%d inode %lu extent %u/%d/%d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1889 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1890 | event.result_group(), event.result_start(), event.result_len()); |
| 1891 | return std::string(line); |
| 1892 | } |
| 1893 | |
| 1894 | std::string FormatExt4MballocPrealloc( |
| 1895 | const Ext4MballocPreallocFtraceEvent& event) { |
| 1896 | char line[2048]; |
| 1897 | sprintf(line, |
| 1898 | "ext4_mballoc_prealloc: dev %d,%d inode %lu orig %u/%d/%u@%u result " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1899 | "%u/%d/%u@%u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1900 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1901 | event.orig_group(), event.orig_start(), event.orig_len(), |
| 1902 | event.orig_logical(), event.result_group(), event.result_start(), |
| 1903 | event.result_len(), event.result_logical()); |
| 1904 | return std::string(line); |
| 1905 | } |
| 1906 | |
| 1907 | std::string FormatExt4OtherInodeUpdateTime( |
| 1908 | const Ext4OtherInodeUpdateTimeFtraceEvent& event) { |
| 1909 | char line[2048]; |
| 1910 | sprintf(line, |
| 1911 | "ext4_other_inode_update_time: dev %d,%d orig_ino %lu ino %lu mode " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1912 | "0%o uid %u gid %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1913 | BlkMaj(event.dev()), BlkMin(event.dev()), event.orig_ino(), |
| 1914 | event.ino(), event.mode(), event.uid(), event.gid()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1915 | return std::string(line); |
| 1916 | } |
| 1917 | |
| 1918 | std::string FormatExt4PunchHole(const Ext4PunchHoleFtraceEvent& event) { |
| 1919 | char line[2048]; |
| 1920 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1921 | "ext4_punch_hole: dev %d,%d ino %lu offset %lld len %lld mode %s", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1922 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.offset(), |
| 1923 | event.len(), GetExt4ModeFlag(event.mode())); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1924 | return std::string(line); |
| 1925 | } |
| 1926 | |
| 1927 | std::string FormatExt4ReadBlockBitmapLoad( |
| 1928 | const Ext4ReadBlockBitmapLoadFtraceEvent& event) { |
| 1929 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1930 | sprintf(line, "ext4_read_block_bitmap_load: dev %d,%d group %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1931 | BlkMaj(event.dev()), BlkMin(event.dev()), event.group()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1932 | return std::string(line); |
| 1933 | } |
| 1934 | |
| 1935 | std::string FormatExt4Readpage(const Ext4ReadpageFtraceEvent& event) { |
| 1936 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1937 | sprintf(line, "ext4_readpage: dev %d,%d ino %lu page_index %lu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1938 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.index()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1939 | return std::string(line); |
| 1940 | } |
| 1941 | |
| 1942 | std::string FormatExt4Releasepage(const Ext4ReleasepageFtraceEvent& event) { |
| 1943 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1944 | sprintf(line, "ext4_releasepage: dev %d,%d ino %lu page_index %lu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1945 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.index()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1946 | return std::string(line); |
| 1947 | } |
| 1948 | |
| 1949 | std::string FormatExt4RemoveBlocks(const Ext4RemoveBlocksFtraceEvent& event) { |
| 1950 | char line[2048]; |
| 1951 | sprintf(line, |
| 1952 | "ext4_remove_blocks: dev %d,%d ino %lu extent [%u(%llu), %u]from %u " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1953 | "to %u partial_cluster %lld", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1954 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
| 1955 | event.ee_lblk(), event.ee_pblk(), event.ee_len(), event.from(), |
| 1956 | event.to(), event.partial()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1957 | return std::string(line); |
| 1958 | } |
| 1959 | |
| 1960 | std::string FormatExt4RequestBlocks(const Ext4RequestBlocksFtraceEvent& event) { |
| 1961 | char line[2048]; |
| 1962 | sprintf(line, |
| 1963 | "ext4_request_blocks: dev %d,%d ino %lu flags %s len %u lblk %u goal " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1964 | "%llu lleft %u lright %u pleft %llu pright %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1965 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1966 | GetExt4HintFlag(event.flags()), event.len(), event.logical(), |
| 1967 | event.goal(), event.lleft(), event.lright(), event.pleft(), |
| 1968 | event.pright()); |
| 1969 | return std::string(line); |
| 1970 | } |
| 1971 | |
| 1972 | std::string FormatExt4RequestInode(const Ext4RequestInodeFtraceEvent& event) { |
| 1973 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1974 | sprintf(line, "ext4_request_inode: dev %d,%d dir %lu mode 0%o", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1975 | BlkMaj(event.dev()), BlkMin(event.dev()), event.dir(), event.mode()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1976 | return std::string(line); |
| 1977 | } |
| 1978 | |
| 1979 | std::string FormatExt4SyncFs(const Ext4SyncFsFtraceEvent& event) { |
| 1980 | char line[2048]; |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 1981 | sprintf(line, "ext4_sync_fs: dev %d,%d wait %d", BlkMaj(event.dev()), |
| 1982 | BlkMin(event.dev()), event.wait()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1983 | return std::string(line); |
| 1984 | } |
| 1985 | |
| 1986 | std::string FormatExt4TrimAllFree(const Ext4TrimAllFreeFtraceEvent& event) { |
| 1987 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1988 | sprintf(line, "ext4_trim_all_free: dev %d,%d group %u, start %d, len %d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1989 | event.dev_major(), event.dev_minor(), event.group(), event.start(), |
| 1990 | event.len()); |
| 1991 | return std::string(line); |
| 1992 | } |
| 1993 | |
| 1994 | std::string FormatExt4TrimExtent(const Ext4TrimExtentFtraceEvent& event) { |
| 1995 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 1996 | sprintf(line, "ext4_trim_extent: dev %d,%d group %u, start %d, len %d", |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 1997 | event.dev_major(), event.dev_minor(), event.group(), event.start(), |
| 1998 | event.len()); |
| 1999 | return std::string(line); |
| 2000 | } |
| 2001 | |
| 2002 | std::string FormatExt4TruncateEnter(const Ext4TruncateEnterFtraceEvent& event) { |
| 2003 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2004 | sprintf(line, "ext4_truncate_enter: dev %d,%d ino %lu blocks %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2005 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2006 | event.blocks()); |
| 2007 | return std::string(line); |
| 2008 | } |
| 2009 | |
| 2010 | std::string FormatExt4TruncateExit(const Ext4TruncateExitFtraceEvent& event) { |
| 2011 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2012 | sprintf(line, "ext4_truncate_exit: dev %d,%d ino %lu blocks %llu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2013 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2014 | event.blocks()); |
| 2015 | return std::string(line); |
| 2016 | } |
| 2017 | |
| 2018 | std::string FormatExt4UnlinkEnter(const Ext4UnlinkEnterFtraceEvent& event) { |
| 2019 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2020 | sprintf(line, "ext4_unlink_enter: dev %d,%d ino %lu size %lld parent %lu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2021 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.size(), |
| 2022 | event.parent()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2023 | return std::string(line); |
| 2024 | } |
| 2025 | |
| 2026 | std::string FormatExt4UnlinkExit(const Ext4UnlinkExitFtraceEvent& event) { |
| 2027 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2028 | sprintf(line, "ext4_unlink_exit: dev %d,%d ino %lu ret %d", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2029 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.ret()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2030 | return std::string(line); |
| 2031 | } |
| 2032 | |
| 2033 | std::string FormatExt4WriteBegin(const Ext4WriteBeginFtraceEvent& event) { |
| 2034 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2035 | sprintf(line, "ext4_write_begin: dev %d,%d ino %lu pos %lld len %u flags %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2036 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.pos(), |
| 2037 | event.len(), event.flags()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2038 | return std::string(line); |
| 2039 | } |
| 2040 | |
| 2041 | std::string FormatExt4WriteEnd(const Ext4WriteEndFtraceEvent& event) { |
| 2042 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2043 | sprintf(line, "ext4_write_end: %d,%d ino %lu pos %lld len %u copied %u", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2044 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.pos(), |
| 2045 | event.len(), event.copied()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2046 | return std::string(line); |
| 2047 | } |
| 2048 | |
| 2049 | std::string FormatExt4Writepage(const Ext4WritepageFtraceEvent& event) { |
| 2050 | char line[2048]; |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2051 | sprintf(line, "ext4_writepage: dev %d,%d ino %lu page_index %lu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2052 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.index()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2053 | return std::string(line); |
| 2054 | } |
| 2055 | |
| 2056 | std::string FormatExt4Writepages(const Ext4WritepagesFtraceEvent& event) { |
| 2057 | char line[2048]; |
| 2058 | sprintf(line, |
| 2059 | "ext4_writepages: dev %d,%d ino %lu nr_to_write %ld pages_skipped " |
| 2060 | "%ld range_start %lld range_end %lld sync_mode %d for_kupdate %d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2061 | "range_cyclic %d writeback_index %lu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2062 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), |
| 2063 | event.nr_to_write(), event.pages_skipped(), event.range_start(), |
| 2064 | event.range_end(), event.sync_mode(), event.for_kupdate(), |
| 2065 | event.range_cyclic(), event.writeback_index()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2066 | return std::string(line); |
| 2067 | } |
| 2068 | |
| 2069 | std::string FormatExt4WritepagesResult( |
| 2070 | const Ext4WritepagesResultFtraceEvent& event) { |
| 2071 | char line[2048]; |
| 2072 | sprintf(line, |
| 2073 | "ext4_writepages_result: dev %d,%d ino %lu ret %d pages_written %d " |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2074 | "pages_skipped %ld sync_mode %d writeback_index %lu", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2075 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.ret(), |
| 2076 | event.pages_written(), event.pages_skipped(), event.sync_mode(), |
| 2077 | event.writeback_index()); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2078 | return std::string(line); |
| 2079 | } |
| 2080 | |
| 2081 | std::string FormatExt4ZeroRange(const Ext4ZeroRangeFtraceEvent& event) { |
| 2082 | char line[2048]; |
| 2083 | sprintf(line, |
Primiano Tucci | 45c9b18 | 2018-03-29 14:10:51 +0100 | [diff] [blame] | 2084 | "ext4_zero_range: dev %d,%d ino %lu offset %lld len %lld mode %s", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 2085 | BlkMaj(event.dev()), BlkMin(event.dev()), event.ino(), event.offset(), |
| 2086 | event.len(), GetExt4ModeFlag(event.mode())); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2087 | return std::string(line); |
| 2088 | } |
| 2089 | |
Florian Mayer | 1d8956a | 2018-04-10 13:59:19 +0100 | [diff] [blame] | 2090 | std::string FormatF2fsDoSubmitBio(const F2fsDoSubmitBioFtraceEvent& event) { |
| 2091 | char line[2048]; |
| 2092 | sprintf(line, "f2fs_do_submit_bio: TODO(fmayer): add format"); |
| 2093 | return std::string(line); |
| 2094 | } |
| 2095 | std::string FormatF2fsEvictInode(const F2fsEvictInodeFtraceEvent& event) { |
| 2096 | char line[2048]; |
| 2097 | sprintf(line, "f2fs_evict_inode: TODO(fmayer): add format"); |
| 2098 | return std::string(line); |
| 2099 | } |
| 2100 | std::string FormatF2fsFallocate(const F2fsFallocateFtraceEvent& event) { |
| 2101 | char line[2048]; |
| 2102 | sprintf(line, "f2fs_fallocate: TODO(fmayer): add format"); |
| 2103 | return std::string(line); |
| 2104 | } |
| 2105 | std::string FormatF2fsGetDataBlock(const F2fsGetDataBlockFtraceEvent& event) { |
| 2106 | char line[2048]; |
| 2107 | sprintf(line, "f2fs_get_data_block: TODO(fmayer): add format"); |
| 2108 | return std::string(line); |
| 2109 | } |
| 2110 | std::string FormatF2fsGetVictim(const F2fsGetVictimFtraceEvent& event) { |
| 2111 | char line[2048]; |
| 2112 | sprintf(line, "f2fs_get_victim: TODO(fmayer): add format"); |
| 2113 | return std::string(line); |
| 2114 | } |
| 2115 | std::string FormatF2fsIget(const F2fsIgetFtraceEvent& event) { |
| 2116 | char line[2048]; |
| 2117 | sprintf(line, "f2fs_iget: TODO(fmayer): add format"); |
| 2118 | return std::string(line); |
| 2119 | } |
| 2120 | std::string FormatF2fsIgetExit(const F2fsIgetExitFtraceEvent& event) { |
| 2121 | char line[2048]; |
| 2122 | sprintf(line, "f2fs_iget_exit: TODO(fmayer): add format"); |
| 2123 | return std::string(line); |
| 2124 | } |
| 2125 | std::string FormatF2fsNewInode(const F2fsNewInodeFtraceEvent& event) { |
| 2126 | char line[2048]; |
| 2127 | sprintf(line, "f2fs_new_inode: TODO(fmayer): add format"); |
| 2128 | return std::string(line); |
| 2129 | } |
| 2130 | std::string FormatF2fsReadpage(const F2fsReadpageFtraceEvent& event) { |
| 2131 | char line[2048]; |
| 2132 | sprintf(line, "f2fs_readpage: TODO(fmayer): add format"); |
| 2133 | return std::string(line); |
| 2134 | } |
| 2135 | std::string FormatF2fsReserveNewBlock( |
| 2136 | const F2fsReserveNewBlockFtraceEvent& event) { |
| 2137 | char line[2048]; |
| 2138 | sprintf(line, "f2fs_reserve_new_block: TODO(fmayer): add format"); |
| 2139 | return std::string(line); |
| 2140 | } |
| 2141 | std::string FormatF2fsSetPageDirty(const F2fsSetPageDirtyFtraceEvent& event) { |
| 2142 | char line[2048]; |
| 2143 | sprintf(line, "f2fs_set_page_dirty: TODO(fmayer): add format"); |
| 2144 | return std::string(line); |
| 2145 | } |
| 2146 | std::string FormatF2fsSubmitWritePage( |
| 2147 | const F2fsSubmitWritePageFtraceEvent& event) { |
| 2148 | char line[2048]; |
| 2149 | sprintf(line, "f2fs_submit_write_page: TODO(fmayer): add format"); |
| 2150 | return std::string(line); |
| 2151 | } |
| 2152 | std::string FormatF2fsSyncFileEnter(const F2fsSyncFileEnterFtraceEvent& event) { |
| 2153 | char line[2048]; |
| 2154 | sprintf(line, "f2fs_sync_file_enter: TODO(fmayer): add format"); |
| 2155 | return std::string(line); |
| 2156 | } |
| 2157 | std::string FormatF2fsSyncFileExit(const F2fsSyncFileExitFtraceEvent& event) { |
| 2158 | char line[2048]; |
| 2159 | sprintf(line, "f2fs_sync_file_exit: TODO(fmayer): add format"); |
| 2160 | return std::string(line); |
| 2161 | } |
| 2162 | std::string FormatF2fsSyncFs(const F2fsSyncFsFtraceEvent& event) { |
| 2163 | char line[2048]; |
| 2164 | sprintf(line, "f2fs_sync_fs: TODO(fmayer): add format"); |
| 2165 | return std::string(line); |
| 2166 | } |
| 2167 | std::string FormatF2fsTruncate(const F2fsTruncateFtraceEvent& event) { |
| 2168 | char line[2048]; |
| 2169 | sprintf(line, "f2fs_truncate: TODO(fmayer): add format"); |
| 2170 | return std::string(line); |
| 2171 | } |
| 2172 | std::string FormatF2fsTruncateBlocksEnter( |
| 2173 | const F2fsTruncateBlocksEnterFtraceEvent& event) { |
| 2174 | char line[2048]; |
| 2175 | sprintf(line, "f2fs_truncate_blocks_enter: TODO(fmayer): add format"); |
| 2176 | return std::string(line); |
| 2177 | } |
| 2178 | std::string FormatF2fsTruncateBlocksExit( |
| 2179 | const F2fsTruncateBlocksExitFtraceEvent& event) { |
| 2180 | char line[2048]; |
| 2181 | sprintf(line, "f2fs_truncate_blocks_exit: TODO(fmayer): add format"); |
| 2182 | return std::string(line); |
| 2183 | } |
| 2184 | std::string FormatF2fsTruncateDataBlocksRange( |
| 2185 | const F2fsTruncateDataBlocksRangeFtraceEvent& event) { |
| 2186 | char line[2048]; |
| 2187 | sprintf(line, "f2fs_truncate_data_blocks_range: TODO(fmayer): add format"); |
| 2188 | return std::string(line); |
| 2189 | } |
| 2190 | std::string FormatF2fsTruncateInodeBlocksEnter( |
| 2191 | const F2fsTruncateInodeBlocksEnterFtraceEvent& event) { |
| 2192 | char line[2048]; |
| 2193 | sprintf(line, "f2fs_truncate_inode_blocks_enter: TODO(fmayer): add format"); |
| 2194 | return std::string(line); |
| 2195 | } |
| 2196 | std::string FormatF2fsTruncateInodeBlocksExit( |
| 2197 | const F2fsTruncateInodeBlocksExitFtraceEvent& event) { |
| 2198 | char line[2048]; |
| 2199 | sprintf(line, "f2fs_truncate_inode_blocks_exit: TODO(fmayer): add format"); |
| 2200 | return std::string(line); |
| 2201 | } |
| 2202 | std::string FormatF2fsTruncateNode(const F2fsTruncateNodeFtraceEvent& event) { |
| 2203 | char line[2048]; |
| 2204 | sprintf(line, "f2fs_truncate_node: TODO(fmayer): add format"); |
| 2205 | return std::string(line); |
| 2206 | } |
| 2207 | std::string FormatF2fsTruncateNodesEnter( |
| 2208 | const F2fsTruncateNodesEnterFtraceEvent& event) { |
| 2209 | char line[2048]; |
| 2210 | sprintf(line, "f2fs_truncate_nodes_enter: TODO(fmayer): add format"); |
| 2211 | return std::string(line); |
| 2212 | } |
| 2213 | std::string FormatF2fsTruncateNodesExit( |
| 2214 | const F2fsTruncateNodesExitFtraceEvent& event) { |
| 2215 | char line[2048]; |
| 2216 | sprintf(line, "f2fs_truncate_nodes_exit: TODO(fmayer): add format"); |
| 2217 | return std::string(line); |
| 2218 | } |
| 2219 | std::string FormatF2fsTruncatePartialNodes( |
| 2220 | const F2fsTruncatePartialNodesFtraceEvent& event) { |
| 2221 | char line[2048]; |
| 2222 | sprintf(line, "f2fs_truncate_partial_nodes: TODO(fmayer): add format"); |
| 2223 | return std::string(line); |
| 2224 | } |
| 2225 | std::string FormatF2fsUnlinkEnter(const F2fsUnlinkEnterFtraceEvent& event) { |
| 2226 | char line[2048]; |
| 2227 | sprintf(line, "f2fs_unlink_enter: TODO(fmayer): add format"); |
| 2228 | return std::string(line); |
| 2229 | } |
| 2230 | std::string FormatF2fsUnlinkExit(const F2fsUnlinkExitFtraceEvent& event) { |
| 2231 | char line[2048]; |
| 2232 | sprintf(line, "f2fs_unlink_exit: TODO(fmayer): add format"); |
| 2233 | return std::string(line); |
| 2234 | } |
| 2235 | std::string FormatF2fsVmPageMkwrite(const F2fsVmPageMkwriteFtraceEvent& event) { |
| 2236 | char line[2048]; |
| 2237 | sprintf(line, "f2fs_vm_page_mkwrite: TODO(fmayer): add format"); |
| 2238 | return std::string(line); |
| 2239 | } |
| 2240 | std::string FormatF2fsWriteBegin(const F2fsWriteBeginFtraceEvent& event) { |
| 2241 | char line[2048]; |
| 2242 | sprintf(line, "f2fs_write_begin: TODO(fmayer): add format"); |
| 2243 | return std::string(line); |
| 2244 | } |
| 2245 | std::string FormatF2fsWriteCheckpoint( |
| 2246 | const F2fsWriteCheckpointFtraceEvent& event) { |
| 2247 | char line[2048]; |
| 2248 | sprintf(line, "f2fs_write_checkpoint: TODO(fmayer): add format"); |
| 2249 | return std::string(line); |
| 2250 | } |
| 2251 | std::string FormatF2fsWriteEnd(const F2fsWriteEndFtraceEvent& event) { |
| 2252 | char line[2048]; |
| 2253 | sprintf(line, "f2fs_write_end: TODO(fmayer): add format"); |
| 2254 | return std::string(line); |
| 2255 | } |
Isabelle Taylor | 4ce4997 | 2018-10-19 18:53:15 +0100 | [diff] [blame^] | 2256 | std::string FormatAllocPagesIommuEnd( |
| 2257 | const AllocPagesIommuEndFtraceEvent& event) { |
| 2258 | char line[2048]; |
| 2259 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2260 | sprintf(line, "alloc_pages_iommu_end: gfp_flags=%d order=%d", |
| 2261 | event.gfp_flags(), event.order()); |
| 2262 | return std::string(line); |
| 2263 | } |
| 2264 | std::string FormatAllocPagesIommuFail( |
| 2265 | const AllocPagesIommuFailFtraceEvent& event) { |
| 2266 | char line[2048]; |
| 2267 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2268 | sprintf(line, "alloc_pages_iommu_fail: gfp_flags=%d order=%d", |
| 2269 | event.gfp_flags(), event.order()); |
| 2270 | return std::string(line); |
| 2271 | } |
| 2272 | std::string FormatAllocPagesIommuStart( |
| 2273 | const AllocPagesIommuStartFtraceEvent& event) { |
| 2274 | char line[2048]; |
| 2275 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2276 | sprintf(line, "alloc_pages_iommu_start: gfp_flags=%d order=%d", |
| 2277 | event.gfp_flags(), event.order()); |
| 2278 | return std::string(line); |
| 2279 | } |
| 2280 | std::string FormatAllocPagesSysEnd(const AllocPagesSysEndFtraceEvent& event) { |
| 2281 | char line[2048]; |
| 2282 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2283 | sprintf(line, "alloc_pages_sys_end: gfp_flags=%d order=%d", event.gfp_flags(), |
| 2284 | event.order()); |
| 2285 | return std::string(line); |
| 2286 | } |
| 2287 | std::string FormatAllocPagesSysFail(const AllocPagesSysFailFtraceEvent& event) { |
| 2288 | char line[2048]; |
| 2289 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2290 | sprintf(line, "alloc_pages_sys_fail: gfp_flags=%d order=%d", |
| 2291 | event.gfp_flags(), event.order()); |
| 2292 | return std::string(line); |
| 2293 | } |
| 2294 | std::string FormatAllocPagesSysStart( |
| 2295 | const AllocPagesSysStartFtraceEvent& event) { |
| 2296 | char line[2048]; |
| 2297 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2298 | sprintf(line, "alloc_pages_sys_start: gfp_flags=%d order=%d", |
| 2299 | event.gfp_flags(), event.order()); |
| 2300 | return std::string(line); |
| 2301 | } |
| 2302 | std::string FormatDmaAllocContiguousRetry( |
| 2303 | const DmaAllocContiguousRetryFtraceEvent& event) { |
| 2304 | char line[2048]; |
| 2305 | sprintf(line, "dma_alloc_contiguous_retry: tries=%d", event.tries()); |
| 2306 | return std::string(line); |
| 2307 | } |
| 2308 | std::string FormatIommuMapRange(const IommuMapRangeFtraceEvent& event) { |
| 2309 | char line[2048]; |
| 2310 | sprintf(line, |
| 2311 | "iommu_map_range: v_addr=%p p_addr=%pa chunk_size=0x%lu len=%zu", |
| 2312 | event.va(), event.pa(), event.chunk_size(), event.len()); |
| 2313 | return std::string(line); |
| 2314 | } |
| 2315 | std::string FormatIommuSecPtblMapRangeEnd( |
| 2316 | const IommuSecPtblMapRangeEndFtraceEvent& event) { |
| 2317 | char line[2048]; |
| 2318 | sprintf(line, |
| 2319 | "iommu_sec_ptbl_map_range_end: sec_id=%d num=%d va=%lx pa=%u len=%zu", |
| 2320 | event.sec_id(), event.num(), event.va(), event.pa(), event.len()); |
| 2321 | return std::string(line); |
| 2322 | } |
| 2323 | std::string FormatIommuSecPtblMapRangeStart( |
| 2324 | const IommuSecPtblMapRangeStartFtraceEvent& event) { |
| 2325 | char line[2048]; |
| 2326 | sprintf( |
| 2327 | line, |
| 2328 | "iommu_sec_ptbl_map_range_start: sec_id=%d num=%d va=%lx pa=%u len=%zu", |
| 2329 | event.sec_id(), event.num(), event.va(), event.pa(), event.len()); |
| 2330 | return std::string(line); |
| 2331 | } |
| 2332 | std::string FormatIonAllocBufferEnd(const IonAllocBufferEndFtraceEvent& event) { |
| 2333 | char line[2048]; |
| 2334 | sprintf(line, |
| 2335 | "ion_alloc_buffer_end: client_name=%s heap_name=%s len=%zu mask=0x%x " |
| 2336 | "flags=0x%x", |
| 2337 | event.client_name().c_str(), event.heap_name().c_str(), event.len(), |
| 2338 | event.mask(), event.flags()); |
| 2339 | return std::string(line); |
| 2340 | } |
| 2341 | std::string FormatIonAllocBufferFail( |
| 2342 | const IonAllocBufferFailFtraceEvent& event) { |
| 2343 | char line[2048]; |
| 2344 | sprintf(line, |
| 2345 | "ion_alloc_buffer_fail: client_name=%s heap_name=%s len=%zu " |
| 2346 | "mask=0x%x flags=0x%x error=%ld", |
| 2347 | event.client_name().c_str(), event.heap_name().c_str(), event.len(), |
| 2348 | event.mask(), event.flags(), event.error()); |
| 2349 | return std::string(line); |
| 2350 | } |
| 2351 | std::string FormatIonAllocBufferFallback( |
| 2352 | const IonAllocBufferFallbackFtraceEvent& event) { |
| 2353 | char line[2048]; |
| 2354 | sprintf(line, |
| 2355 | "ion_alloc_buffer_fallback: client_name=%s heap_name=%s len=%zu " |
| 2356 | "mask=0x%x flags=0x%x error=%ld", |
| 2357 | event.client_name().c_str(), event.heap_name().c_str(), event.len(), |
| 2358 | event.mask(), event.flags(), event.error()); |
| 2359 | return std::string(line); |
| 2360 | } |
| 2361 | std::string FormatIonAllocBufferStart( |
| 2362 | const IonAllocBufferStartFtraceEvent& event) { |
| 2363 | char line[2048]; |
| 2364 | sprintf(line, |
| 2365 | "ion_alloc_buffer_start: client_name=%s heap_name=%s len=%zu " |
| 2366 | "mask=0x%x flags=0x%x", |
| 2367 | event.client_name().c_str(), event.heap_name().c_str(), event.len(), |
| 2368 | event.mask(), event.flags()); |
| 2369 | return std::string(line); |
| 2370 | } |
| 2371 | std::string FormatIonCpAllocRetry(const IonCpAllocRetryFtraceEvent& event) { |
| 2372 | char line[2048]; |
| 2373 | sprintf(line, "ion_cp_alloc_retry: tries=%d", event.tries()); |
| 2374 | return std::string(line); |
| 2375 | } |
| 2376 | std::string FormatIonCpSecureBufferEnd( |
| 2377 | const IonCpSecureBufferEndFtraceEvent& event) { |
| 2378 | char line[2048]; |
| 2379 | sprintf(line, |
| 2380 | "ion_cp_secure_buffer_end: heap_name=%s len=%lx align=%lx flags=%lx", |
| 2381 | event.heap_name().c_str(), event.len(), event.align(), event.flags()); |
| 2382 | return std::string(line); |
| 2383 | } |
| 2384 | std::string FormatIonCpSecureBufferStart( |
| 2385 | const IonCpSecureBufferStartFtraceEvent& event) { |
| 2386 | char line[2048]; |
| 2387 | sprintf( |
| 2388 | line, |
| 2389 | "ion_cp_secure_buffer_start: heap_name=%s len=%lx align=%lx flags=%lx", |
| 2390 | event.heap_name().c_str(), event.len(), event.align(), event.flags()); |
| 2391 | return std::string(line); |
| 2392 | } |
| 2393 | std::string FormatIonHeapGrow(const IonHeapGrowFtraceEvent& event) { |
| 2394 | char line[2048]; |
| 2395 | sprintf(line, "ion_heap_grow: heap_name=%s, len=%zu, total_allocated=%ld", |
| 2396 | event.heap_name().c_str(), event.len(), event.total_allocated()); |
| 2397 | return std::string(line); |
| 2398 | } |
| 2399 | std::string FormatIonHeapShrink(const IonHeapShrinkFtraceEvent& event) { |
| 2400 | char line[2048]; |
| 2401 | sprintf(line, "ion_heap_shrink: heap_name=%s, len=%zu, total_allocated=%ld", |
| 2402 | event.heap_name().c_str(), event.len(), event.total_allocated()); |
| 2403 | return std::string(line); |
| 2404 | } |
| 2405 | std::string FormatIonPrefetching(const IonPrefetchingFtraceEvent& event) { |
| 2406 | char line[2048]; |
| 2407 | sprintf(line, "ion_prefetching: prefetch size %lx", event.len()); |
| 2408 | return std::string(line); |
| 2409 | } |
| 2410 | std::string FormatIonSecureCmaAddToPoolEnd( |
| 2411 | const IonSecureCmaAddToPoolEndFtraceEvent& event) { |
| 2412 | char line[2048]; |
| 2413 | sprintf( |
| 2414 | line, |
| 2415 | "ion_secure_cma_add_to_pool_end: len %lx, pool total %x is_prefetch %d", |
| 2416 | event.len(), event.pool_total(), event.is_prefetch()); |
| 2417 | return std::string(line); |
| 2418 | } |
| 2419 | std::string FormatIonSecureCmaAddToPoolStart( |
| 2420 | const IonSecureCmaAddToPoolStartFtraceEvent& event) { |
| 2421 | char line[2048]; |
| 2422 | sprintf( |
| 2423 | line, |
| 2424 | "ion_secure_cma_add_to_pool_start: len %lx, pool total %x is_prefetch %d", |
| 2425 | event.len(), event.pool_total(), event.is_prefetch()); |
| 2426 | return std::string(line); |
| 2427 | } |
| 2428 | std::string FormatIonSecureCmaAllocateEnd( |
| 2429 | const IonSecureCmaAllocateEndFtraceEvent& event) { |
| 2430 | char line[2048]; |
| 2431 | sprintf( |
| 2432 | line, |
| 2433 | "ion_secure_cma_allocate_end: heap_name=%s len=%lx align=%lx flags=%lx", |
| 2434 | event.heap_name().c_str(), event.len(), event.align(), event.flags()); |
| 2435 | return std::string(line); |
| 2436 | } |
| 2437 | std::string FormatIonSecureCmaAllocateStart( |
| 2438 | const IonSecureCmaAllocateStartFtraceEvent& event) { |
| 2439 | char line[2048]; |
| 2440 | sprintf( |
| 2441 | line, |
| 2442 | "ion_secure_cma_allocate_start: heap_name=%s len=%lx align=%lx flags=%lx", |
| 2443 | event.heap_name().c_str(), event.len(), event.align(), event.flags()); |
| 2444 | return std::string(line); |
| 2445 | } |
| 2446 | std::string FormatIonSecureCmaShrinkPoolEnd( |
| 2447 | const IonSecureCmaShrinkPoolEndFtraceEvent& event) { |
| 2448 | char line[2048]; |
| 2449 | sprintf(line, |
| 2450 | "ion_secure_cma_shrink_pool_end: drained size %lx, skipped size %lx", |
| 2451 | event.drained_size(), event.skipped_size()); |
| 2452 | return std::string(line); |
| 2453 | } |
| 2454 | std::string FormatIonSecureCmaShrinkPoolStart( |
| 2455 | const IonSecureCmaShrinkPoolStartFtraceEvent& event) { |
| 2456 | char line[2048]; |
| 2457 | sprintf( |
| 2458 | line, |
| 2459 | "ion_secure_cma_shrink_pool_start: drained size %lx, skipped size %lx", |
| 2460 | event.drained_size(), event.skipped_size()); |
| 2461 | return std::string(line); |
| 2462 | } |
| 2463 | std::string FormatKfree(const KfreeFtraceEvent& event) { |
| 2464 | char line[2048]; |
| 2465 | sprintf(line, "kfree: call_site=%lx ptr=%p", event.call_site(), event.ptr()); |
| 2466 | return std::string(line); |
| 2467 | } |
| 2468 | std::string FormatKmalloc(const KmallocFtraceEvent& event) { |
| 2469 | char line[2048]; |
| 2470 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2471 | sprintf(line, |
| 2472 | "kmalloc: call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu " |
| 2473 | "gfp_flags=%d", |
| 2474 | event.call_site(), event.ptr(), event.bytes_req(), |
| 2475 | event.bytes_alloc(), event.gfp_flags()); |
| 2476 | return std::string(line); |
| 2477 | } |
| 2478 | std::string FormatKmallocNode(const KmallocNodeFtraceEvent& event) { |
| 2479 | char line[2048]; |
| 2480 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2481 | sprintf(line, |
| 2482 | "kmalloc_node: call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu " |
| 2483 | "gfp_flags=%d node=%d", |
| 2484 | event.call_site(), event.ptr(), event.bytes_req(), |
| 2485 | event.bytes_alloc(), event.gfp_flags(), event.node()); |
| 2486 | return std::string(line); |
| 2487 | } |
| 2488 | std::string FormatKmemCacheAlloc(const KmemCacheAllocFtraceEvent& event) { |
| 2489 | char line[2048]; |
| 2490 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2491 | sprintf(line, |
| 2492 | "kmem_cache_alloc: call_site=%lx ptr=%p bytes_req=%zu " |
| 2493 | "bytes_alloc=%zu gfp_flags=%d", |
| 2494 | event.call_site(), event.ptr(), event.bytes_req(), |
| 2495 | event.bytes_alloc(), event.gfp_flags()); |
| 2496 | return std::string(line); |
| 2497 | } |
| 2498 | std::string FormatKmemCacheAllocNode( |
| 2499 | const KmemCacheAllocNodeFtraceEvent& event) { |
| 2500 | char line[2048]; |
| 2501 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2502 | sprintf(line, |
| 2503 | "kmem_cache_alloc_node: call_site=%lx ptr=%p bytes_req=%zu " |
| 2504 | "bytes_alloc=%zu gfp_flags=%d node=%d", |
| 2505 | event.call_site(), event.ptr(), event.bytes_req(), |
| 2506 | event.bytes_alloc(), event.gfp_flags(), event.node()); |
| 2507 | return std::string(line); |
| 2508 | } |
| 2509 | std::string FormatKmemCacheFree(const KmemCacheFreeFtraceEvent& event) { |
| 2510 | char line[2048]; |
| 2511 | sprintf(line, "kmem_cache_free: call_site=%lx ptr=%p", event.call_site(), |
| 2512 | event.ptr()); |
| 2513 | return std::string(line); |
| 2514 | } |
| 2515 | std::string FormatMigratePagesEnd(const MigratePagesEndFtraceEvent& event) { |
| 2516 | char line[2048]; |
| 2517 | sprintf(line, "migrate_pages_end: mode=%d", event.mode()); |
| 2518 | return std::string(line); |
| 2519 | } |
| 2520 | std::string FormatMigratePagesStart(const MigratePagesStartFtraceEvent& event) { |
| 2521 | char line[2048]; |
| 2522 | sprintf(line, "migrate_pages_start: mode=%d", event.mode()); |
| 2523 | return std::string(line); |
| 2524 | } |
| 2525 | std::string FormatMigrateRetry(const MigrateRetryFtraceEvent& event) { |
| 2526 | char line[2048]; |
| 2527 | sprintf(line, "migrate_retry: tries=%d", event.tries()); |
| 2528 | return std::string(line); |
| 2529 | } |
| 2530 | std::string FormatMmPageAlloc(const MmPageAllocFtraceEvent& event) { |
| 2531 | char line[2048]; |
| 2532 | // TODO(b/117966147): Translate binary to gfp_flag |
| 2533 | // TODO(taylori): Figure out pfn correctly |
| 2534 | sprintf(line, |
| 2535 | "mm_page_alloc: page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%d", |
| 2536 | event.page(), 0, event.order(), event.migratetype(), |
| 2537 | event.gfp_flags()); |
| 2538 | return std::string(line); |
| 2539 | } |
| 2540 | std::string FormatMmPageAllocExtfrag( |
| 2541 | const MmPageAllocExtfragFtraceEvent& event) { |
| 2542 | char line[2048]; |
| 2543 | // TODO(taylori): Figure out pfn correctly |
| 2544 | sprintf(line, |
| 2545 | "mm_page_alloc_extfrag: page=%p pfn=%lu alloc_order=%d " |
| 2546 | "fallback_order=%d pageblock_order=%d alloc_migratetype=%d " |
| 2547 | "fallback_migratetype=%d fragmenting=%d change_ownership=%d", |
| 2548 | event.page(), 0, event.alloc_order(), event.fallback_order(), 11 - 1, |
| 2549 | event.alloc_migratetype(), event.fallback_migratetype(), |
| 2550 | event.fallback_order() < (11 - 1), event.change_ownership()); |
| 2551 | return std::string(line); |
| 2552 | } |
| 2553 | std::string FormatMmPageAllocZoneLocked( |
| 2554 | const MmPageAllocZoneLockedFtraceEvent& event) { |
| 2555 | char line[2048]; |
| 2556 | // TODO(taylori): Figure out pfn correctly |
| 2557 | sprintf(line, |
| 2558 | "mm_page_alloc_zone_locked: page=%p pfn=%lu order=%u migratetype=%d " |
| 2559 | "percpu_refill=%d", |
| 2560 | event.page(), 0, event.order(), event.migratetype(), |
| 2561 | event.order() == 0); |
| 2562 | return std::string(line); |
| 2563 | } |
| 2564 | std::string FormatMmPageFree(const MmPageFreeFtraceEvent& event) { |
| 2565 | char line[2048]; |
| 2566 | // TODO(taylori): Figure out pfn correctly |
| 2567 | sprintf(line, "mm_page_free: page=%p pfn=%lu order=%d", event.page(), 0, |
| 2568 | event.order()); |
| 2569 | return std::string(line); |
| 2570 | } |
| 2571 | std::string FormatMmPageFreeBatched(const MmPageFreeBatchedFtraceEvent& event) { |
| 2572 | char line[2048]; |
| 2573 | // TODO(taylori): Figure out pfn correctly |
| 2574 | sprintf(line, "mm_page_free_batched: page=%p pfn=%lu order=0 cold=%d", |
| 2575 | event.page(), 0, event.cold()); |
| 2576 | return std::string(line); |
| 2577 | } |
| 2578 | std::string FormatMmPagePcpuDrain(const MmPagePcpuDrainFtraceEvent& event) { |
| 2579 | char line[2048]; |
| 2580 | // TODO(taylori): Figure out pfn correctly |
| 2581 | sprintf(line, "mm_page_pcpu_drain: page=%p pfn=%lu order=%d migratetype=%d", |
| 2582 | event.page(), 0, event.order(), event.migratetype()); |
| 2583 | return std::string(line); |
| 2584 | } |
| 2585 | std::string FormatRssStat(const RssStatFtraceEvent& event) { |
| 2586 | char line[2048]; |
| 2587 | sprintf(line, "rss_stat: member=%d size=%ldKB", event.member(), event.size()); |
| 2588 | return std::string(line); |
| 2589 | } |
Florian Mayer | 1d8956a | 2018-04-10 13:59:19 +0100 | [diff] [blame] | 2590 | |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 2591 | std::string FormatEventText(const protos::FtraceEvent& event) { |
| 2592 | if (event.has_binder_lock()) { |
| 2593 | const auto& inner = event.binder_lock(); |
| 2594 | return FormatBinderLock(inner); |
| 2595 | } else if (event.has_binder_locked()) { |
| 2596 | const auto& inner = event.binder_locked(); |
| 2597 | return FormatBinderLocked(inner); |
| 2598 | } else if (event.has_binder_transaction()) { |
| 2599 | const auto& inner = event.binder_transaction(); |
| 2600 | return FormatBinderTransaction(inner); |
| 2601 | } else if (event.has_binder_transaction_received()) { |
| 2602 | const auto& inner = event.binder_transaction_received(); |
| 2603 | return FormatBinderTransactionReceived(inner); |
| 2604 | } else if (event.has_binder_unlock()) { |
| 2605 | const auto& inner = event.binder_unlock(); |
| 2606 | return FormatBinderUnlock(inner); |
| 2607 | } else if (event.has_block_bio_backmerge()) { |
| 2608 | const auto& inner = event.block_bio_backmerge(); |
| 2609 | return FormatBlockBioBackmerge(inner); |
| 2610 | } else if (event.has_block_bio_bounce()) { |
| 2611 | const auto& inner = event.block_bio_bounce(); |
| 2612 | return FormatBlockBioBounce(inner); |
| 2613 | } else if (event.has_block_bio_complete()) { |
| 2614 | const auto& inner = event.block_bio_complete(); |
| 2615 | return FormatBlockBioComplete(inner); |
| 2616 | } else if (event.has_block_bio_frontmerge()) { |
| 2617 | const auto& inner = event.block_bio_frontmerge(); |
| 2618 | return FormatBlockBioFrontmerge(inner); |
| 2619 | } else if (event.has_block_bio_queue()) { |
| 2620 | const auto& inner = event.block_bio_queue(); |
| 2621 | return FormatBlockBioQueue(inner); |
| 2622 | } else if (event.has_block_bio_remap()) { |
| 2623 | const auto& inner = event.block_bio_remap(); |
| 2624 | return FormatBlockBioRemap(inner); |
| 2625 | } else if (event.has_block_dirty_buffer()) { |
| 2626 | const auto& inner = event.block_dirty_buffer(); |
| 2627 | return FormatBlockDirtyBuffer(inner); |
| 2628 | } else if (event.has_block_getrq()) { |
| 2629 | const auto& inner = event.block_getrq(); |
| 2630 | return FormatBlockGetrq(inner); |
| 2631 | } else if (event.has_block_plug()) { |
| 2632 | const auto& inner = event.block_plug(); |
| 2633 | return FormatBlockPlug(inner); |
| 2634 | } else if (event.has_block_rq_abort()) { |
| 2635 | const auto& inner = event.block_rq_abort(); |
| 2636 | return FormatBlockRqAbort(inner); |
| 2637 | } else if (event.has_block_rq_complete()) { |
| 2638 | const auto& inner = event.block_rq_complete(); |
| 2639 | return FormatBlockRqComplete(inner); |
| 2640 | } else if (event.has_block_rq_insert()) { |
| 2641 | const auto& inner = event.block_rq_insert(); |
| 2642 | return FormatBlockRqInsert(inner); |
| 2643 | } else if (event.has_block_rq_issue()) { |
| 2644 | const auto& inner = event.block_rq_issue(); |
| 2645 | return FormatBlockRqIssue(inner); |
| 2646 | } else if (event.has_block_rq_remap()) { |
| 2647 | const auto& inner = event.block_rq_remap(); |
| 2648 | return FormatBlockRqRemap(inner); |
| 2649 | } else if (event.has_block_rq_requeue()) { |
| 2650 | const auto& inner = event.block_rq_requeue(); |
| 2651 | return FormatBlockRqRequeue(inner); |
| 2652 | } else if (event.has_block_sleeprq()) { |
| 2653 | const auto& inner = event.block_sleeprq(); |
| 2654 | return FormatBlockSleeprq(inner); |
| 2655 | } else if (event.has_block_split()) { |
| 2656 | const auto& inner = event.block_split(); |
| 2657 | return FormatBlockSplit(inner); |
| 2658 | } else if (event.has_block_touch_buffer()) { |
| 2659 | const auto& inner = event.block_touch_buffer(); |
| 2660 | return FormatBlockTouchBuffer(inner); |
| 2661 | } else if (event.has_block_unplug()) { |
| 2662 | const auto& inner = event.block_unplug(); |
| 2663 | return FormatBlockUnplug(inner); |
| 2664 | } else if (event.has_mm_compaction_begin()) { |
| 2665 | const auto& inner = event.mm_compaction_begin(); |
| 2666 | return FormatMmCompactionBegin(inner); |
| 2667 | } else if (event.has_mm_compaction_defer_compaction()) { |
| 2668 | const auto& inner = event.mm_compaction_defer_compaction(); |
| 2669 | return FormatMmCompactionDeferCompaction(inner); |
| 2670 | } else if (event.has_mm_compaction_defer_reset()) { |
| 2671 | const auto& inner = event.mm_compaction_defer_reset(); |
| 2672 | return FormatMmCompactionDeferReset(inner); |
| 2673 | } else if (event.has_mm_compaction_deferred()) { |
| 2674 | const auto& inner = event.mm_compaction_deferred(); |
| 2675 | return FormatMmCompactionDeferred(inner); |
| 2676 | } else if (event.has_mm_compaction_end()) { |
| 2677 | const auto& inner = event.mm_compaction_end(); |
| 2678 | return FormatMmCompactionEnd(inner); |
| 2679 | } else if (event.has_mm_compaction_finished()) { |
| 2680 | const auto& inner = event.mm_compaction_finished(); |
| 2681 | return FormatMmCompactionFinished(inner); |
| 2682 | } else if (event.has_mm_compaction_isolate_freepages()) { |
| 2683 | const auto& inner = event.mm_compaction_isolate_freepages(); |
| 2684 | return FormatMmCompactionIsolateFreepages(inner); |
| 2685 | } else if (event.has_mm_compaction_isolate_migratepages()) { |
| 2686 | const auto& inner = event.mm_compaction_isolate_migratepages(); |
| 2687 | return FormatMmCompactionIsolateMigratepages(inner); |
| 2688 | } else if (event.has_mm_compaction_kcompactd_sleep()) { |
| 2689 | const auto& inner = event.mm_compaction_kcompactd_sleep(); |
| 2690 | return FormatMmCompactionKcompactdSleep(inner); |
| 2691 | } else if (event.has_mm_compaction_kcompactd_wake()) { |
| 2692 | const auto& inner = event.mm_compaction_kcompactd_wake(); |
| 2693 | return FormatMmCompactionKcompactdWake(inner); |
| 2694 | } else if (event.has_mm_compaction_migratepages()) { |
| 2695 | const auto& inner = event.mm_compaction_migratepages(); |
| 2696 | return FormatMmCompactionMigratepages(inner); |
| 2697 | } else if (event.has_mm_compaction_suitable()) { |
| 2698 | const auto& inner = event.mm_compaction_suitable(); |
| 2699 | return FormatMmCompactionSuitable(inner); |
| 2700 | } else if (event.has_mm_compaction_try_to_compact_pages()) { |
| 2701 | const auto& inner = event.mm_compaction_try_to_compact_pages(); |
| 2702 | return FormatMmCompactionTryToCompactPages(inner); |
| 2703 | } else if (event.has_mm_compaction_wakeup_kcompactd()) { |
| 2704 | const auto& inner = event.mm_compaction_wakeup_kcompactd(); |
| 2705 | return FormatMmCompactionWakeupKcompactd(inner); |
| 2706 | } else if (event.has_ext4_alloc_da_blocks()) { |
| 2707 | const auto& inner = event.ext4_alloc_da_blocks(); |
| 2708 | return FormatExt4AllocDaBlocks(inner); |
| 2709 | } else if (event.has_ext4_allocate_blocks()) { |
| 2710 | const auto& inner = event.ext4_allocate_blocks(); |
| 2711 | return FormatExt4AllocateBlocks(inner); |
| 2712 | } else if (event.has_ext4_allocate_inode()) { |
| 2713 | const auto& inner = event.ext4_allocate_inode(); |
| 2714 | return FormatExt4AllocateInode(inner); |
| 2715 | } else if (event.has_ext4_begin_ordered_truncate()) { |
| 2716 | const auto& inner = event.ext4_begin_ordered_truncate(); |
| 2717 | return FormatExt4BeginOrderedTruncate(inner); |
| 2718 | } else if (event.has_ext4_collapse_range()) { |
| 2719 | const auto& inner = event.ext4_collapse_range(); |
| 2720 | return FormatExt4CollapseRange(inner); |
| 2721 | } else if (event.has_ext4_da_release_space()) { |
| 2722 | const auto& inner = event.ext4_da_release_space(); |
| 2723 | return FormatExt4DaReleaseSpace(inner); |
| 2724 | } else if (event.has_ext4_da_reserve_space()) { |
| 2725 | const auto& inner = event.ext4_da_reserve_space(); |
| 2726 | return FormatExt4DaReserveSpace(inner); |
| 2727 | } else if (event.has_ext4_da_update_reserve_space()) { |
| 2728 | const auto& inner = event.ext4_da_update_reserve_space(); |
| 2729 | return FormatExt4DaUpdateReserveSpace(inner); |
| 2730 | } else if (event.has_ext4_da_write_begin()) { |
| 2731 | const auto& inner = event.ext4_da_write_begin(); |
| 2732 | return FormatExt4DaWriteBegin(inner); |
| 2733 | } else if (event.has_ext4_da_write_end()) { |
| 2734 | const auto& inner = event.ext4_da_write_end(); |
| 2735 | return FormatExt4DaWriteEnd(inner); |
| 2736 | } else if (event.has_ext4_da_write_pages()) { |
| 2737 | const auto& inner = event.ext4_da_write_pages(); |
| 2738 | return FormatExt4DaWritePages(inner); |
| 2739 | } else if (event.has_ext4_da_write_pages_extent()) { |
| 2740 | const auto& inner = event.ext4_da_write_pages_extent(); |
| 2741 | return FormatExt4DaWritePagesExtent(inner); |
| 2742 | } else if (event.has_ext4_discard_blocks()) { |
| 2743 | const auto& inner = event.ext4_discard_blocks(); |
| 2744 | return FormatExt4DiscardBlocks(inner); |
| 2745 | } else if (event.has_ext4_discard_preallocations()) { |
| 2746 | const auto& inner = event.ext4_discard_preallocations(); |
| 2747 | return FormatExt4DiscardPreallocations(inner); |
| 2748 | } else if (event.has_ext4_drop_inode()) { |
| 2749 | const auto& inner = event.ext4_drop_inode(); |
| 2750 | return FormatExt4DropInode(inner); |
| 2751 | } else if (event.has_ext4_es_cache_extent()) { |
| 2752 | const auto& inner = event.ext4_es_cache_extent(); |
| 2753 | return FormatExt4EsCacheExtent(inner); |
| 2754 | } else if (event.has_ext4_es_find_delayed_extent_range_enter()) { |
| 2755 | const auto& inner = event.ext4_es_find_delayed_extent_range_enter(); |
| 2756 | return FormatExt4EsFindDelayedExtentRangeEnter(inner); |
| 2757 | } else if (event.has_ext4_es_find_delayed_extent_range_exit()) { |
| 2758 | const auto& inner = event.ext4_es_find_delayed_extent_range_exit(); |
| 2759 | return FormatExt4EsFindDelayedExtentRangeExit(inner); |
| 2760 | } else if (event.has_ext4_es_insert_extent()) { |
| 2761 | const auto& inner = event.ext4_es_insert_extent(); |
| 2762 | return FormatExt4EsInsertExtent(inner); |
| 2763 | } else if (event.has_ext4_es_lookup_extent_enter()) { |
| 2764 | const auto& inner = event.ext4_es_lookup_extent_enter(); |
| 2765 | return FormatExt4EsLookupExtentEnter(inner); |
| 2766 | } else if (event.has_ext4_es_lookup_extent_exit()) { |
| 2767 | const auto& inner = event.ext4_es_lookup_extent_exit(); |
| 2768 | return FormatExt4EsLookupExtentExit(inner); |
| 2769 | } else if (event.has_ext4_es_remove_extent()) { |
| 2770 | const auto& inner = event.ext4_es_remove_extent(); |
| 2771 | return FormatExt4EsRemoveExtent(inner); |
| 2772 | } else if (event.has_ext4_es_shrink()) { |
| 2773 | const auto& inner = event.ext4_es_shrink(); |
| 2774 | return FormatExt4EsShrink(inner); |
| 2775 | } else if (event.has_ext4_es_shrink_count()) { |
| 2776 | const auto& inner = event.ext4_es_shrink_count(); |
| 2777 | return FormatExt4EsShrinkCount(inner); |
| 2778 | } else if (event.has_ext4_es_shrink_scan_enter()) { |
| 2779 | const auto& inner = event.ext4_es_shrink_scan_enter(); |
| 2780 | return FormatExt4EsShrinkScanEnter(inner); |
| 2781 | } else if (event.has_ext4_es_shrink_scan_exit()) { |
| 2782 | const auto& inner = event.ext4_es_shrink_scan_exit(); |
| 2783 | return FormatExt4EsShrinkScanExit(inner); |
| 2784 | } else if (event.has_ext4_evict_inode()) { |
| 2785 | const auto& inner = event.ext4_evict_inode(); |
| 2786 | return FormatExt4EvictInode(inner); |
| 2787 | } else if (event.has_ext4_ext_convert_to_initialized_enter()) { |
| 2788 | const auto& inner = event.ext4_ext_convert_to_initialized_enter(); |
| 2789 | return FormatExt4ExtConvertToInitializedEnter(inner); |
| 2790 | } else if (event.has_ext4_ext_convert_to_initialized_fastpath()) { |
| 2791 | const auto& inner = event.ext4_ext_convert_to_initialized_fastpath(); |
| 2792 | return FormatExt4ExtConvertToInitializedFastpath(inner); |
| 2793 | } else if (event.has_ext4_ext_handle_unwritten_extents()) { |
| 2794 | const auto& inner = event.ext4_ext_handle_unwritten_extents(); |
| 2795 | return FormatExt4ExtHandleUnwrittenExtents(inner); |
| 2796 | } else if (event.has_ext4_ext_in_cache()) { |
| 2797 | const auto& inner = event.ext4_ext_in_cache(); |
| 2798 | return FormatExt4ExtInCache(inner); |
| 2799 | } else if (event.has_ext4_ext_load_extent()) { |
| 2800 | const auto& inner = event.ext4_ext_load_extent(); |
| 2801 | return FormatExt4ExtLoadExtent(inner); |
| 2802 | } else if (event.has_ext4_ext_map_blocks_enter()) { |
| 2803 | const auto& inner = event.ext4_ext_map_blocks_enter(); |
| 2804 | return FormatExt4ExtMapBlocksEnter(inner); |
| 2805 | } else if (event.has_ext4_ext_map_blocks_exit()) { |
| 2806 | const auto& inner = event.ext4_ext_map_blocks_exit(); |
| 2807 | return FormatExt4ExtMapBlocksExit(inner); |
| 2808 | } else if (event.has_ext4_ext_put_in_cache()) { |
| 2809 | const auto& inner = event.ext4_ext_put_in_cache(); |
| 2810 | return FormatExt4ExtPutInCache(inner); |
| 2811 | } else if (event.has_ext4_ext_remove_space()) { |
| 2812 | const auto& inner = event.ext4_ext_remove_space(); |
| 2813 | return FormatExt4ExtRemoveSpace(inner); |
| 2814 | } else if (event.has_ext4_ext_remove_space_done()) { |
| 2815 | const auto& inner = event.ext4_ext_remove_space_done(); |
| 2816 | return FormatExt4ExtRemoveSpaceDone(inner); |
| 2817 | } else if (event.has_ext4_ext_rm_idx()) { |
| 2818 | const auto& inner = event.ext4_ext_rm_idx(); |
| 2819 | return FormatExt4ExtRmIdx(inner); |
| 2820 | } else if (event.has_ext4_ext_rm_leaf()) { |
| 2821 | const auto& inner = event.ext4_ext_rm_leaf(); |
| 2822 | return FormatExt4ExtRmLeaf(inner); |
| 2823 | } else if (event.has_ext4_ext_show_extent()) { |
| 2824 | const auto& inner = event.ext4_ext_show_extent(); |
| 2825 | return FormatExt4ExtShowExtent(inner); |
| 2826 | } else if (event.has_ext4_fallocate_enter()) { |
| 2827 | const auto& inner = event.ext4_fallocate_enter(); |
| 2828 | return FormatExt4FallocateEnter(inner); |
| 2829 | } else if (event.has_ext4_fallocate_exit()) { |
| 2830 | const auto& inner = event.ext4_fallocate_exit(); |
| 2831 | return FormatExt4FallocateExit(inner); |
| 2832 | } else if (event.has_ext4_find_delalloc_range()) { |
| 2833 | const auto& inner = event.ext4_find_delalloc_range(); |
| 2834 | return FormatExt4FindDelallocRange(inner); |
| 2835 | } else if (event.has_ext4_forget()) { |
| 2836 | const auto& inner = event.ext4_forget(); |
| 2837 | return FormatExt4Forget(inner); |
| 2838 | } else if (event.has_ext4_free_blocks()) { |
| 2839 | const auto& inner = event.ext4_free_blocks(); |
| 2840 | return FormatExt4FreeBlocks(inner); |
| 2841 | } else if (event.has_ext4_free_inode()) { |
| 2842 | const auto& inner = event.ext4_free_inode(); |
| 2843 | return FormatExt4FreeInode(inner); |
| 2844 | } else if (event.has_ext4_get_implied_cluster_alloc_exit()) { |
| 2845 | const auto& inner = event.ext4_get_implied_cluster_alloc_exit(); |
| 2846 | return FormatExt4GetImpliedClusterAllocExit(inner); |
| 2847 | } else if (event.has_ext4_get_reserved_cluster_alloc()) { |
| 2848 | const auto& inner = event.ext4_get_reserved_cluster_alloc(); |
| 2849 | return FormatExt4GetReservedClusterAlloc(inner); |
| 2850 | } else if (event.has_ext4_ind_map_blocks_enter()) { |
| 2851 | const auto& inner = event.ext4_ind_map_blocks_enter(); |
| 2852 | return FormatExt4IndMapBlocksEnter(inner); |
| 2853 | } else if (event.has_ext4_ind_map_blocks_exit()) { |
| 2854 | const auto& inner = event.ext4_ind_map_blocks_exit(); |
| 2855 | return FormatExt4IndMapBlocksExit(inner); |
| 2856 | } else if (event.has_ext4_insert_range()) { |
| 2857 | const auto& inner = event.ext4_insert_range(); |
| 2858 | return FormatExt4InsertRange(inner); |
| 2859 | } else if (event.has_ext4_invalidatepage()) { |
| 2860 | const auto& inner = event.ext4_invalidatepage(); |
| 2861 | return FormatExt4Invalidatepage(inner); |
| 2862 | } else if (event.has_ext4_journal_start()) { |
| 2863 | const auto& inner = event.ext4_journal_start(); |
| 2864 | return FormatExt4JournalStart(inner); |
| 2865 | } else if (event.has_ext4_journal_start_reserved()) { |
| 2866 | const auto& inner = event.ext4_journal_start_reserved(); |
| 2867 | return FormatExt4JournalStartReserved(inner); |
| 2868 | } else if (event.has_ext4_journalled_invalidatepage()) { |
| 2869 | const auto& inner = event.ext4_journalled_invalidatepage(); |
| 2870 | return FormatExt4JournalledInvalidatepage(inner); |
| 2871 | } else if (event.has_ext4_journalled_write_end()) { |
| 2872 | const auto& inner = event.ext4_journalled_write_end(); |
| 2873 | return FormatExt4JournalledWriteEnd(inner); |
| 2874 | } else if (event.has_ext4_load_inode()) { |
| 2875 | const auto& inner = event.ext4_load_inode(); |
| 2876 | return FormatExt4LoadInode(inner); |
| 2877 | } else if (event.has_ext4_load_inode_bitmap()) { |
| 2878 | const auto& inner = event.ext4_load_inode_bitmap(); |
| 2879 | return FormatExt4LoadInodeBitmap(inner); |
| 2880 | } else if (event.has_ext4_mark_inode_dirty()) { |
| 2881 | const auto& inner = event.ext4_mark_inode_dirty(); |
| 2882 | return FormatExt4MarkInodeDirty(inner); |
| 2883 | } else if (event.has_ext4_mb_bitmap_load()) { |
| 2884 | const auto& inner = event.ext4_mb_bitmap_load(); |
| 2885 | return FormatExt4MbBitmapLoad(inner); |
| 2886 | } else if (event.has_ext4_mb_buddy_bitmap_load()) { |
| 2887 | const auto& inner = event.ext4_mb_buddy_bitmap_load(); |
| 2888 | return FormatExt4MbBuddyBitmapLoad(inner); |
| 2889 | } else if (event.has_ext4_mb_discard_preallocations()) { |
| 2890 | const auto& inner = event.ext4_mb_discard_preallocations(); |
| 2891 | return FormatExt4MbDiscardPreallocations(inner); |
| 2892 | } else if (event.has_ext4_mb_new_group_pa()) { |
| 2893 | const auto& inner = event.ext4_mb_new_group_pa(); |
| 2894 | return FormatExt4MbNewGroupPa(inner); |
| 2895 | } else if (event.has_ext4_mb_new_inode_pa()) { |
| 2896 | const auto& inner = event.ext4_mb_new_inode_pa(); |
| 2897 | return FormatExt4MbNewInodePa(inner); |
| 2898 | } else if (event.has_ext4_mb_release_group_pa()) { |
| 2899 | const auto& inner = event.ext4_mb_release_group_pa(); |
| 2900 | return FormatExt4MbReleaseGroupPa(inner); |
| 2901 | } else if (event.has_ext4_mb_release_inode_pa()) { |
| 2902 | const auto& inner = event.ext4_mb_release_inode_pa(); |
| 2903 | return FormatExt4MbReleaseInodePa(inner); |
| 2904 | } else if (event.has_ext4_mballoc_alloc()) { |
| 2905 | const auto& inner = event.ext4_mballoc_alloc(); |
| 2906 | return FormatExt4MballocAlloc(inner); |
| 2907 | } else if (event.has_ext4_mballoc_discard()) { |
| 2908 | const auto& inner = event.ext4_mballoc_discard(); |
| 2909 | return FormatExt4MballocDiscard(inner); |
| 2910 | } else if (event.has_ext4_mballoc_free()) { |
| 2911 | const auto& inner = event.ext4_mballoc_free(); |
| 2912 | return FormatExt4MballocFree(inner); |
| 2913 | } else if (event.has_ext4_mballoc_prealloc()) { |
| 2914 | const auto& inner = event.ext4_mballoc_prealloc(); |
| 2915 | return FormatExt4MballocPrealloc(inner); |
| 2916 | } else if (event.has_ext4_other_inode_update_time()) { |
| 2917 | const auto& inner = event.ext4_other_inode_update_time(); |
| 2918 | return FormatExt4OtherInodeUpdateTime(inner); |
| 2919 | } else if (event.has_ext4_punch_hole()) { |
| 2920 | const auto& inner = event.ext4_punch_hole(); |
| 2921 | return FormatExt4PunchHole(inner); |
| 2922 | } else if (event.has_ext4_read_block_bitmap_load()) { |
| 2923 | const auto& inner = event.ext4_read_block_bitmap_load(); |
| 2924 | return FormatExt4ReadBlockBitmapLoad(inner); |
| 2925 | } else if (event.has_ext4_readpage()) { |
| 2926 | const auto& inner = event.ext4_readpage(); |
| 2927 | return FormatExt4Readpage(inner); |
| 2928 | } else if (event.has_ext4_releasepage()) { |
| 2929 | const auto& inner = event.ext4_releasepage(); |
| 2930 | return FormatExt4Releasepage(inner); |
| 2931 | } else if (event.has_ext4_remove_blocks()) { |
| 2932 | const auto& inner = event.ext4_remove_blocks(); |
| 2933 | return FormatExt4RemoveBlocks(inner); |
| 2934 | } else if (event.has_ext4_request_blocks()) { |
| 2935 | const auto& inner = event.ext4_request_blocks(); |
| 2936 | return FormatExt4RequestBlocks(inner); |
| 2937 | } else if (event.has_ext4_request_inode()) { |
| 2938 | const auto& inner = event.ext4_request_inode(); |
| 2939 | return FormatExt4RequestInode(inner); |
| 2940 | } else if (event.has_ext4_sync_file_enter()) { |
| 2941 | const auto& inner = event.ext4_sync_file_enter(); |
| 2942 | return FormatExt4SyncFileEnter(inner); |
| 2943 | } else if (event.has_ext4_sync_file_exit()) { |
| 2944 | const auto& inner = event.ext4_sync_file_exit(); |
| 2945 | return FormatExt4SyncFileExit(inner); |
| 2946 | } else if (event.has_ext4_sync_fs()) { |
| 2947 | const auto& inner = event.ext4_sync_fs(); |
| 2948 | return FormatExt4SyncFs(inner); |
| 2949 | } else if (event.has_ext4_trim_all_free()) { |
| 2950 | const auto& inner = event.ext4_trim_all_free(); |
| 2951 | return FormatExt4TrimAllFree(inner); |
| 2952 | } else if (event.has_ext4_trim_extent()) { |
| 2953 | const auto& inner = event.ext4_trim_extent(); |
| 2954 | return FormatExt4TrimExtent(inner); |
| 2955 | } else if (event.has_ext4_truncate_enter()) { |
| 2956 | const auto& inner = event.ext4_truncate_enter(); |
| 2957 | return FormatExt4TruncateEnter(inner); |
| 2958 | } else if (event.has_ext4_truncate_exit()) { |
| 2959 | const auto& inner = event.ext4_truncate_exit(); |
| 2960 | return FormatExt4TruncateExit(inner); |
| 2961 | } else if (event.has_ext4_unlink_enter()) { |
| 2962 | const auto& inner = event.ext4_unlink_enter(); |
| 2963 | return FormatExt4UnlinkEnter(inner); |
| 2964 | } else if (event.has_ext4_unlink_exit()) { |
| 2965 | const auto& inner = event.ext4_unlink_exit(); |
| 2966 | return FormatExt4UnlinkExit(inner); |
| 2967 | } else if (event.has_ext4_write_begin()) { |
| 2968 | const auto& inner = event.ext4_write_begin(); |
| 2969 | return FormatExt4WriteBegin(inner); |
| 2970 | } else if (event.has_ext4_write_end()) { |
| 2971 | const auto& inner = event.ext4_write_end(); |
| 2972 | return FormatExt4WriteEnd(inner); |
| 2973 | } else if (event.has_ext4_writepage()) { |
| 2974 | const auto& inner = event.ext4_writepage(); |
| 2975 | return FormatExt4Writepage(inner); |
| 2976 | } else if (event.has_ext4_writepages()) { |
| 2977 | const auto& inner = event.ext4_writepages(); |
| 2978 | return FormatExt4Writepages(inner); |
| 2979 | } else if (event.has_ext4_writepages_result()) { |
| 2980 | const auto& inner = event.ext4_writepages_result(); |
| 2981 | return FormatExt4WritepagesResult(inner); |
| 2982 | } else if (event.has_ext4_zero_range()) { |
| 2983 | const auto& inner = event.ext4_zero_range(); |
| 2984 | return FormatExt4ZeroRange(inner); |
| 2985 | } else if (event.has_print()) { |
| 2986 | const auto& inner = event.print(); |
| 2987 | return FormatPrint(inner); |
| 2988 | } else if (event.has_i2c_read()) { |
| 2989 | const auto& inner = event.i2c_read(); |
| 2990 | return FormatI2cRead(inner); |
| 2991 | } else if (event.has_i2c_reply()) { |
| 2992 | const auto& inner = event.i2c_reply(); |
| 2993 | return FormatI2cReply(inner); |
| 2994 | } else if (event.has_i2c_result()) { |
| 2995 | const auto& inner = event.i2c_result(); |
| 2996 | return FormatI2cResult(inner); |
| 2997 | } else if (event.has_i2c_write()) { |
| 2998 | const auto& inner = event.i2c_write(); |
| 2999 | return FormatI2cWrite(inner); |
| 3000 | } else if (event.has_irq_handler_entry()) { |
| 3001 | const auto& inner = event.irq_handler_entry(); |
| 3002 | return FormatIrqHandlerEntry(inner); |
| 3003 | } else if (event.has_irq_handler_exit()) { |
| 3004 | const auto& inner = event.irq_handler_exit(); |
| 3005 | return FormatIrqHandlerExit(inner); |
| 3006 | } else if (event.has_softirq_entry()) { |
| 3007 | const auto& inner = event.softirq_entry(); |
| 3008 | return FormatSoftirqEntry(inner); |
| 3009 | } else if (event.has_softirq_exit()) { |
| 3010 | const auto& inner = event.softirq_exit(); |
| 3011 | return FormatSoftirqExit(inner); |
| 3012 | } else if (event.has_softirq_raise()) { |
| 3013 | const auto& inner = event.softirq_raise(); |
| 3014 | return FormatSoftirqRaise(inner); |
| 3015 | } else if (event.has_lowmemory_kill()) { |
| 3016 | const auto& inner = event.lowmemory_kill(); |
| 3017 | return FormatLowmemoryKill(inner); |
| 3018 | } else if (event.has_tracing_mark_write()) { |
| 3019 | const auto& inner = event.tracing_mark_write(); |
| 3020 | return FormatTracingMarkWrite(inner); |
| 3021 | } else if (event.has_clock_disable()) { |
| 3022 | const auto& inner = event.clock_disable(); |
| 3023 | return FormatClockDisable(inner); |
| 3024 | } else if (event.has_clock_enable()) { |
| 3025 | const auto& inner = event.clock_enable(); |
| 3026 | return FormatClockEnable(inner); |
| 3027 | } else if (event.has_clock_set_rate()) { |
| 3028 | const auto& inner = event.clock_set_rate(); |
| 3029 | return FormatClockSetRate(inner); |
| 3030 | } else if (event.has_cpu_frequency()) { |
| 3031 | const auto& inner = event.cpu_frequency(); |
| 3032 | return FormatCpuFrequency(inner); |
| 3033 | } else if (event.has_cpu_frequency_limits()) { |
| 3034 | const auto& inner = event.cpu_frequency_limits(); |
| 3035 | return FormatCpuFrequencyLimits(inner); |
| 3036 | } else if (event.has_cpu_idle()) { |
| 3037 | const auto& inner = event.cpu_idle(); |
| 3038 | return FormatCpuIdle(inner); |
| 3039 | } else if (event.has_suspend_resume()) { |
| 3040 | const auto& inner = event.suspend_resume(); |
| 3041 | return FormatSuspendResume(inner); |
| 3042 | } else if (event.has_regulator_disable()) { |
| 3043 | const auto& inner = event.regulator_disable(); |
| 3044 | return FormatRegulatorDisable(inner); |
| 3045 | } else if (event.has_regulator_disable_complete()) { |
| 3046 | const auto& inner = event.regulator_disable_complete(); |
| 3047 | return FormatRegulatorDisableComplete(inner); |
| 3048 | } else if (event.has_regulator_enable()) { |
| 3049 | const auto& inner = event.regulator_enable(); |
| 3050 | return FormatRegulatorEnable(inner); |
| 3051 | } else if (event.has_regulator_enable_complete()) { |
| 3052 | const auto& inner = event.regulator_enable_complete(); |
| 3053 | return FormatRegulatorEnableComplete(inner); |
| 3054 | } else if (event.has_regulator_enable_delay()) { |
| 3055 | const auto& inner = event.regulator_enable_delay(); |
| 3056 | return FormatRegulatorEnableDelay(inner); |
| 3057 | } else if (event.has_regulator_set_voltage()) { |
| 3058 | const auto& inner = event.regulator_set_voltage(); |
| 3059 | return FormatRegulatorSetVoltage(inner); |
| 3060 | } else if (event.has_regulator_set_voltage_complete()) { |
| 3061 | const auto& inner = event.regulator_set_voltage_complete(); |
| 3062 | return FormatRegulatorSetVoltageComplete(inner); |
| 3063 | } else if (event.has_sched_blocked_reason()) { |
| 3064 | const auto& inner = event.sched_blocked_reason(); |
| 3065 | return FormatSchedBlockedReason(inner); |
| 3066 | } else if (event.has_sched_cpu_hotplug()) { |
| 3067 | const auto& inner = event.sched_cpu_hotplug(); |
| 3068 | return FormatSchedCpuHotplug(inner); |
| 3069 | } else if (event.has_sched_switch()) { |
| 3070 | const auto& inner = event.sched_switch(); |
| 3071 | return FormatSchedSwitch(inner); |
| 3072 | } else if (event.has_sched_wakeup()) { |
| 3073 | const auto& inner = event.sched_wakeup(); |
| 3074 | return FormatSchedWakeup(inner); |
| 3075 | } else if (event.has_sched_wakeup_new()) { |
| 3076 | const auto& inner = event.sched_wakeup_new(); |
| 3077 | return FormatSchedWakeupNew(inner); |
| 3078 | } else if (event.has_sync_pt()) { |
| 3079 | const auto& inner = event.sync_pt(); |
| 3080 | return FormatSyncPt(inner); |
| 3081 | } else if (event.has_sync_timeline()) { |
| 3082 | const auto& inner = event.sync_timeline(); |
| 3083 | return FormatSyncTimeline(inner); |
| 3084 | } else if (event.has_sync_wait()) { |
| 3085 | const auto& inner = event.sync_wait(); |
| 3086 | return FormatSyncWait(inner); |
| 3087 | } else if (event.has_mm_vmscan_direct_reclaim_begin()) { |
| 3088 | const auto& inner = event.mm_vmscan_direct_reclaim_begin(); |
| 3089 | return FormatMmVmscanDirectReclaimBegin(inner); |
| 3090 | } else if (event.has_mm_vmscan_direct_reclaim_end()) { |
| 3091 | const auto& inner = event.mm_vmscan_direct_reclaim_end(); |
| 3092 | return FormatMmVmscanDirectReclaimEnd(inner); |
| 3093 | } else if (event.has_mm_vmscan_kswapd_sleep()) { |
| 3094 | const auto& inner = event.mm_vmscan_kswapd_sleep(); |
| 3095 | return FormatMmVmscanKswapdSleep(inner); |
| 3096 | } else if (event.has_mm_vmscan_kswapd_wake()) { |
| 3097 | const auto& inner = event.mm_vmscan_kswapd_wake(); |
| 3098 | return FormatMmVmscanKswapdWake(inner); |
| 3099 | } else if (event.has_workqueue_activate_work()) { |
| 3100 | const auto& inner = event.workqueue_activate_work(); |
| 3101 | return FormatWorkqueueActivateWork(inner); |
| 3102 | } else if (event.has_workqueue_execute_end()) { |
| 3103 | const auto& inner = event.workqueue_execute_end(); |
| 3104 | return FormatWorkqueueExecuteEnd(inner); |
| 3105 | } else if (event.has_workqueue_execute_start()) { |
| 3106 | const auto& inner = event.workqueue_execute_start(); |
| 3107 | return FormatWorkqueueExecuteStart(inner); |
| 3108 | } else if (event.has_workqueue_queue_work()) { |
| 3109 | const auto& inner = event.workqueue_queue_work(); |
| 3110 | return FormatWorkqueueQueueWork(inner); |
| 3111 | } else if (event.has_sched_process_fork()) { |
| 3112 | const auto& inner = event.sched_process_fork(); |
| 3113 | return FormatSchedProcessFork(inner); |
| 3114 | } else if (event.has_sched_process_hang()) { |
| 3115 | const auto& inner = event.sched_process_hang(); |
| 3116 | return FormatSchedProcessHang(inner); |
| 3117 | } else if (event.has_sched_process_free()) { |
| 3118 | const auto& inner = event.sched_process_free(); |
| 3119 | return FormatSchedProcessFree(inner); |
| 3120 | } else if (event.has_sched_process_exec()) { |
| 3121 | const auto& inner = event.sched_process_exec(); |
| 3122 | return FormatSchedProcessExec(inner); |
| 3123 | } else if (event.has_sched_process_exit()) { |
| 3124 | const auto& inner = event.sched_process_exit(); |
| 3125 | return FormatSchedProcessExit(inner); |
| 3126 | } else if (event.has_sched_process_wait()) { |
| 3127 | const auto& inner = event.sched_process_wait(); |
| 3128 | return FormatSchedProcessWait(inner); |
| 3129 | } else if (event.has_task_rename()) { |
| 3130 | const auto& inner = event.task_rename(); |
| 3131 | return FormatTaskRename(inner); |
| 3132 | } else if (event.has_task_newtask()) { |
| 3133 | const auto& inner = event.task_newtask(); |
| 3134 | return FormatTaskNewtask(inner); |
Florian Mayer | 1d8956a | 2018-04-10 13:59:19 +0100 | [diff] [blame] | 3135 | } else if (event.has_f2fs_do_submit_bio()) { |
| 3136 | const auto& inner = event.f2fs_do_submit_bio(); |
| 3137 | return FormatF2fsDoSubmitBio(inner); |
| 3138 | } else if (event.has_f2fs_evict_inode()) { |
| 3139 | const auto& inner = event.f2fs_evict_inode(); |
| 3140 | return FormatF2fsEvictInode(inner); |
| 3141 | } else if (event.has_f2fs_fallocate()) { |
| 3142 | const auto& inner = event.f2fs_fallocate(); |
| 3143 | return FormatF2fsFallocate(inner); |
| 3144 | } else if (event.has_f2fs_get_data_block()) { |
| 3145 | const auto& inner = event.f2fs_get_data_block(); |
| 3146 | return FormatF2fsGetDataBlock(inner); |
| 3147 | } else if (event.has_f2fs_get_victim()) { |
| 3148 | const auto& inner = event.f2fs_get_victim(); |
| 3149 | return FormatF2fsGetVictim(inner); |
| 3150 | } else if (event.has_f2fs_iget()) { |
| 3151 | const auto& inner = event.f2fs_iget(); |
| 3152 | return FormatF2fsIget(inner); |
| 3153 | } else if (event.has_f2fs_iget_exit()) { |
| 3154 | const auto& inner = event.f2fs_iget_exit(); |
| 3155 | return FormatF2fsIgetExit(inner); |
| 3156 | } else if (event.has_f2fs_new_inode()) { |
| 3157 | const auto& inner = event.f2fs_new_inode(); |
| 3158 | return FormatF2fsNewInode(inner); |
| 3159 | } else if (event.has_f2fs_readpage()) { |
| 3160 | const auto& inner = event.f2fs_readpage(); |
| 3161 | return FormatF2fsReadpage(inner); |
| 3162 | } else if (event.has_f2fs_reserve_new_block()) { |
| 3163 | const auto& inner = event.f2fs_reserve_new_block(); |
| 3164 | return FormatF2fsReserveNewBlock(inner); |
| 3165 | } else if (event.has_f2fs_set_page_dirty()) { |
| 3166 | const auto& inner = event.f2fs_set_page_dirty(); |
| 3167 | return FormatF2fsSetPageDirty(inner); |
| 3168 | } else if (event.has_f2fs_submit_write_page()) { |
| 3169 | const auto& inner = event.f2fs_submit_write_page(); |
| 3170 | return FormatF2fsSubmitWritePage(inner); |
| 3171 | } else if (event.has_f2fs_sync_file_enter()) { |
| 3172 | const auto& inner = event.f2fs_sync_file_enter(); |
| 3173 | return FormatF2fsSyncFileEnter(inner); |
| 3174 | } else if (event.has_f2fs_sync_file_exit()) { |
| 3175 | const auto& inner = event.f2fs_sync_file_exit(); |
| 3176 | return FormatF2fsSyncFileExit(inner); |
| 3177 | } else if (event.has_f2fs_sync_fs()) { |
| 3178 | const auto& inner = event.f2fs_sync_fs(); |
| 3179 | return FormatF2fsSyncFs(inner); |
| 3180 | } else if (event.has_f2fs_truncate()) { |
| 3181 | const auto& inner = event.f2fs_truncate(); |
| 3182 | return FormatF2fsTruncate(inner); |
| 3183 | } else if (event.has_f2fs_truncate_blocks_enter()) { |
| 3184 | const auto& inner = event.f2fs_truncate_blocks_enter(); |
| 3185 | return FormatF2fsTruncateBlocksEnter(inner); |
| 3186 | } else if (event.has_f2fs_truncate_blocks_exit()) { |
| 3187 | const auto& inner = event.f2fs_truncate_blocks_exit(); |
| 3188 | return FormatF2fsTruncateBlocksExit(inner); |
| 3189 | } else if (event.has_f2fs_truncate_data_blocks_range()) { |
| 3190 | const auto& inner = event.f2fs_truncate_data_blocks_range(); |
| 3191 | return FormatF2fsTruncateDataBlocksRange(inner); |
| 3192 | } else if (event.has_f2fs_truncate_inode_blocks_enter()) { |
| 3193 | const auto& inner = event.f2fs_truncate_inode_blocks_enter(); |
| 3194 | return FormatF2fsTruncateInodeBlocksEnter(inner); |
| 3195 | } else if (event.has_f2fs_truncate_inode_blocks_exit()) { |
| 3196 | const auto& inner = event.f2fs_truncate_inode_blocks_exit(); |
| 3197 | return FormatF2fsTruncateInodeBlocksExit(inner); |
| 3198 | } else if (event.has_f2fs_truncate_node()) { |
| 3199 | const auto& inner = event.f2fs_truncate_node(); |
| 3200 | return FormatF2fsTruncateNode(inner); |
| 3201 | } else if (event.has_f2fs_truncate_nodes_enter()) { |
| 3202 | const auto& inner = event.f2fs_truncate_nodes_enter(); |
| 3203 | return FormatF2fsTruncateNodesEnter(inner); |
| 3204 | } else if (event.has_f2fs_truncate_nodes_exit()) { |
| 3205 | const auto& inner = event.f2fs_truncate_nodes_exit(); |
| 3206 | return FormatF2fsTruncateNodesExit(inner); |
| 3207 | } else if (event.has_f2fs_truncate_partial_nodes()) { |
| 3208 | const auto& inner = event.f2fs_truncate_partial_nodes(); |
| 3209 | return FormatF2fsTruncatePartialNodes(inner); |
| 3210 | } else if (event.has_f2fs_unlink_enter()) { |
| 3211 | const auto& inner = event.f2fs_unlink_enter(); |
| 3212 | return FormatF2fsUnlinkEnter(inner); |
| 3213 | } else if (event.has_f2fs_unlink_exit()) { |
| 3214 | const auto& inner = event.f2fs_unlink_exit(); |
| 3215 | return FormatF2fsUnlinkExit(inner); |
| 3216 | } else if (event.has_f2fs_vm_page_mkwrite()) { |
| 3217 | const auto& inner = event.f2fs_vm_page_mkwrite(); |
| 3218 | return FormatF2fsVmPageMkwrite(inner); |
| 3219 | } else if (event.has_f2fs_write_begin()) { |
| 3220 | const auto& inner = event.f2fs_write_begin(); |
| 3221 | return FormatF2fsWriteBegin(inner); |
| 3222 | } else if (event.has_f2fs_write_checkpoint()) { |
| 3223 | const auto& inner = event.f2fs_write_checkpoint(); |
| 3224 | return FormatF2fsWriteCheckpoint(inner); |
| 3225 | } else if (event.has_f2fs_write_end()) { |
| 3226 | const auto& inner = event.f2fs_write_end(); |
| 3227 | return FormatF2fsWriteEnd(inner); |
Isabelle Taylor | 4ce4997 | 2018-10-19 18:53:15 +0100 | [diff] [blame^] | 3228 | } else if (event.has_alloc_pages_iommu_end()) { |
| 3229 | const auto& inner = event.alloc_pages_iommu_end(); |
| 3230 | return FormatAllocPagesIommuEnd(inner); |
| 3231 | } else if (event.has_alloc_pages_iommu_end()) { |
| 3232 | const auto& inner = event.alloc_pages_iommu_end(); |
| 3233 | return FormatAllocPagesIommuEnd(inner); |
| 3234 | } else if (event.has_alloc_pages_iommu_fail()) { |
| 3235 | const auto& inner = event.alloc_pages_iommu_fail(); |
| 3236 | return FormatAllocPagesIommuFail(inner); |
| 3237 | } else if (event.has_alloc_pages_iommu_start()) { |
| 3238 | const auto& inner = event.alloc_pages_iommu_start(); |
| 3239 | return FormatAllocPagesIommuStart(inner); |
| 3240 | } else if (event.has_alloc_pages_sys_end()) { |
| 3241 | const auto& inner = event.alloc_pages_sys_end(); |
| 3242 | return FormatAllocPagesSysEnd(inner); |
| 3243 | } else if (event.has_alloc_pages_sys_fail()) { |
| 3244 | const auto& inner = event.alloc_pages_sys_fail(); |
| 3245 | return FormatAllocPagesSysFail(inner); |
| 3246 | } else if (event.has_alloc_pages_sys_start()) { |
| 3247 | const auto& inner = event.alloc_pages_sys_start(); |
| 3248 | return FormatAllocPagesSysStart(inner); |
| 3249 | } else if (event.has_dma_alloc_contiguous_retry()) { |
| 3250 | const auto& inner = event.dma_alloc_contiguous_retry(); |
| 3251 | return FormatDmaAllocContiguousRetry(inner); |
| 3252 | } else if (event.has_iommu_map_range()) { |
| 3253 | const auto& inner = event.iommu_map_range(); |
| 3254 | return FormatIommuMapRange(inner); |
| 3255 | } else if (event.has_iommu_sec_ptbl_map_range_end()) { |
| 3256 | const auto& inner = event.iommu_sec_ptbl_map_range_end(); |
| 3257 | return FormatIommuSecPtblMapRangeEnd(inner); |
| 3258 | } else if (event.has_iommu_sec_ptbl_map_range_start()) { |
| 3259 | const auto& inner = event.iommu_sec_ptbl_map_range_start(); |
| 3260 | return FormatIommuSecPtblMapRangeStart(inner); |
| 3261 | } else if (event.has_ion_alloc_buffer_end()) { |
| 3262 | const auto& inner = event.ion_alloc_buffer_end(); |
| 3263 | return FormatIonAllocBufferEnd(inner); |
| 3264 | } else if (event.has_ion_alloc_buffer_fail()) { |
| 3265 | const auto& inner = event.ion_alloc_buffer_fail(); |
| 3266 | return FormatIonAllocBufferFail(inner); |
| 3267 | } else if (event.has_ion_alloc_buffer_fallback()) { |
| 3268 | const auto& inner = event.ion_alloc_buffer_fallback(); |
| 3269 | return FormatIonAllocBufferFallback(inner); |
| 3270 | } else if (event.has_ion_alloc_buffer_start()) { |
| 3271 | const auto& inner = event.ion_alloc_buffer_start(); |
| 3272 | return FormatIonAllocBufferStart(inner); |
| 3273 | } else if (event.has_ion_cp_alloc_retry()) { |
| 3274 | const auto& inner = event.ion_cp_alloc_retry(); |
| 3275 | return FormatIonCpAllocRetry(inner); |
| 3276 | } else if (event.has_ion_cp_secure_buffer_end()) { |
| 3277 | const auto& inner = event.ion_cp_secure_buffer_end(); |
| 3278 | return FormatIonCpSecureBufferEnd(inner); |
| 3279 | } else if (event.has_ion_cp_secure_buffer_start()) { |
| 3280 | const auto& inner = event.ion_cp_secure_buffer_start(); |
| 3281 | return FormatIonCpSecureBufferStart(inner); |
| 3282 | } else if (event.has_ion_heap_grow()) { |
| 3283 | const auto& inner = event.ion_heap_grow(); |
| 3284 | return FormatIonHeapGrow(inner); |
| 3285 | } else if (event.has_ion_heap_shrink()) { |
| 3286 | const auto& inner = event.ion_heap_shrink(); |
| 3287 | return FormatIonHeapShrink(inner); |
| 3288 | } else if (event.has_ion_prefetching()) { |
| 3289 | const auto& inner = event.ion_prefetching(); |
| 3290 | return FormatIonPrefetching(inner); |
| 3291 | } else if (event.has_ion_secure_cma_add_to_pool_end()) { |
| 3292 | const auto& inner = event.ion_secure_cma_add_to_pool_end(); |
| 3293 | return FormatIonSecureCmaAddToPoolEnd(inner); |
| 3294 | } else if (event.has_ion_secure_cma_add_to_pool_start()) { |
| 3295 | const auto& inner = event.ion_secure_cma_add_to_pool_start(); |
| 3296 | return FormatIonSecureCmaAddToPoolStart(inner); |
| 3297 | } else if (event.has_ion_secure_cma_allocate_end()) { |
| 3298 | const auto& inner = event.ion_secure_cma_allocate_end(); |
| 3299 | return FormatIonSecureCmaAllocateEnd(inner); |
| 3300 | } else if (event.has_ion_secure_cma_allocate_start()) { |
| 3301 | const auto& inner = event.ion_secure_cma_allocate_start(); |
| 3302 | return FormatIonSecureCmaAllocateStart(inner); |
| 3303 | } else if (event.has_ion_secure_cma_shrink_pool_end()) { |
| 3304 | const auto& inner = event.ion_secure_cma_shrink_pool_end(); |
| 3305 | return FormatIonSecureCmaShrinkPoolEnd(inner); |
| 3306 | } else if (event.has_ion_secure_cma_shrink_pool_start()) { |
| 3307 | const auto& inner = event.ion_secure_cma_shrink_pool_start(); |
| 3308 | return FormatIonSecureCmaShrinkPoolStart(inner); |
| 3309 | } else if (event.has_kfree()) { |
| 3310 | const auto& inner = event.kfree(); |
| 3311 | return FormatKfree(inner); |
| 3312 | } else if (event.has_kmalloc()) { |
| 3313 | const auto& inner = event.kmalloc(); |
| 3314 | return FormatKmalloc(inner); |
| 3315 | } else if (event.has_kmalloc_node()) { |
| 3316 | const auto& inner = event.kmalloc_node(); |
| 3317 | return FormatKmallocNode(inner); |
| 3318 | } else if (event.has_kmem_cache_alloc()) { |
| 3319 | const auto& inner = event.kmem_cache_alloc(); |
| 3320 | return FormatKmemCacheAlloc(inner); |
| 3321 | } else if (event.has_kmem_cache_alloc_node()) { |
| 3322 | const auto& inner = event.kmem_cache_alloc_node(); |
| 3323 | return FormatKmemCacheAllocNode(inner); |
| 3324 | } else if (event.has_kmem_cache_free()) { |
| 3325 | const auto& inner = event.kmem_cache_free(); |
| 3326 | return FormatKmemCacheFree(inner); |
| 3327 | } else if (event.has_migrate_pages_end()) { |
| 3328 | const auto& inner = event.migrate_pages_end(); |
| 3329 | return FormatMigratePagesEnd(inner); |
| 3330 | } else if (event.has_migrate_pages_start()) { |
| 3331 | const auto& inner = event.migrate_pages_start(); |
| 3332 | return FormatMigratePagesStart(inner); |
| 3333 | } else if (event.has_migrate_retry()) { |
| 3334 | const auto& inner = event.migrate_retry(); |
| 3335 | return FormatMigrateRetry(inner); |
| 3336 | } else if (event.has_mm_page_alloc()) { |
| 3337 | const auto& inner = event.mm_page_alloc(); |
| 3338 | return FormatMmPageAlloc(inner); |
| 3339 | } else if (event.has_mm_page_alloc_extfrag()) { |
| 3340 | const auto& inner = event.mm_page_alloc_extfrag(); |
| 3341 | return FormatMmPageAllocExtfrag(inner); |
| 3342 | } else if (event.has_mm_page_alloc_zone_locked()) { |
| 3343 | const auto& inner = event.mm_page_alloc_zone_locked(); |
| 3344 | return FormatMmPageAllocZoneLocked(inner); |
| 3345 | } else if (event.has_mm_page_free()) { |
| 3346 | const auto& inner = event.mm_page_free(); |
| 3347 | return FormatMmPageFree(inner); |
| 3348 | } else if (event.has_mm_page_free_batched()) { |
| 3349 | const auto& inner = event.mm_page_free_batched(); |
| 3350 | return FormatMmPageFreeBatched(inner); |
| 3351 | } else if (event.has_mm_page_pcpu_drain()) { |
| 3352 | const auto& inner = event.mm_page_pcpu_drain(); |
| 3353 | return FormatMmPagePcpuDrain(inner); |
| 3354 | } else if (event.has_rss_stat()) { |
| 3355 | const auto& inner = event.rss_stat(); |
| 3356 | return FormatRssStat(inner); |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 3357 | } |
Isabelle Taylor | 4ce4997 | 2018-10-19 18:53:15 +0100 | [diff] [blame^] | 3358 | |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 3359 | return ""; |
| 3360 | } |
| 3361 | |
| 3362 | uint64_t TimestampToSeconds(uint64_t timestamp) { |
| 3363 | return timestamp / 1000000000ul; |
| 3364 | } |
| 3365 | |
| 3366 | uint64_t TimestampToMicroseconds(uint64_t timestamp) { |
| 3367 | return (timestamp / 1000) % 1000000ul; |
| 3368 | } |
| 3369 | |
Isabelle Taylor | 0a6b4c7 | 2018-10-15 11:30:52 +0100 | [diff] [blame] | 3370 | std::string FormatPrefix(uint64_t timestamp, |
| 3371 | uint64_t cpu, |
| 3372 | uint32_t pid, |
| 3373 | uint32_t tgid, |
| 3374 | std::string name) { |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 3375 | char line[2048]; |
| 3376 | uint64_t seconds = TimestampToSeconds(timestamp); |
| 3377 | uint64_t useconds = TimestampToMicroseconds(timestamp); |
Isabelle Taylor | 0a6b4c7 | 2018-10-15 11:30:52 +0100 | [diff] [blame] | 3378 | if (pid == 0) { |
| 3379 | name = "<idle>"; |
| 3380 | } |
| 3381 | if (tgid == 0) { |
| 3382 | sprintf(line, |
| 3383 | "%s-%" PRIu32 " (-----) [%03" PRIu32 "] d..3 %" PRIu64 |
| 3384 | ".%.6" PRIu64 ": ", |
| 3385 | name.c_str(), pid, cpu, seconds, useconds); |
| 3386 | } else { |
| 3387 | sprintf(line, |
| 3388 | "%s-%" PRIu32 " (%5" PRIu32 ") [%03" PRIu32 "] d..3 %" PRIu64 |
| 3389 | ".%.6" PRIu64 ": ", |
| 3390 | name.c_str(), pid, tgid, cpu, seconds, useconds); |
| 3391 | } |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 3392 | return std::string(line); |
| 3393 | } |
| 3394 | |
| 3395 | } // namespace |
| 3396 | |
Isabelle Taylor | 0a6b4c7 | 2018-10-15 11:30:52 +0100 | [diff] [blame] | 3397 | std::string FormatFtraceEvent( |
| 3398 | uint64_t timestamp, |
| 3399 | size_t cpu, |
| 3400 | const protos::FtraceEvent& event, |
| 3401 | const std::unordered_map<uint32_t /*tid*/, uint32_t /*tgid*/>& thread_map) { |
| 3402 | // Sched_switch events contain the thread name so use that in the prefix. |
| 3403 | std::string name; |
| 3404 | if (event.has_sched_switch()) { |
| 3405 | name = event.sched_switch().prev_comm(); |
| 3406 | } else { |
| 3407 | name = "<...>"; |
| 3408 | } |
| 3409 | |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 3410 | std::string line = FormatEventText(event); |
| 3411 | if (line == "") |
| 3412 | return ""; |
Isabelle Taylor | 0a6b4c7 | 2018-10-15 11:30:52 +0100 | [diff] [blame] | 3413 | |
| 3414 | // Retrieve the tgid if it exists for the current event pid. |
| 3415 | uint32_t pid = event.pid(); |
| 3416 | uint32_t tgid = 0; |
| 3417 | auto it = thread_map.find(pid); |
| 3418 | if (it != thread_map.end()) { |
| 3419 | tgid = it->second; |
| 3420 | } |
| 3421 | return FormatPrefix(timestamp, cpu, pid, tgid, name) + line; |
Hector Dearman | 85ef536 | 2018-03-27 14:48:47 +0100 | [diff] [blame] | 3422 | } |
| 3423 | |
| 3424 | } // namespace perfetto |