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