From b7838c163b6cb3a6e22e9f898b6e3dc36cfbd2d4 Mon Sep 17 00:00:00 2001 From: lutao Date: Tue, 10 Dec 2024 19:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80PR=202035?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lutao --- device/plugins/ftrace_plugin/ftrace.gni | 2 +- .../6.6.30/event_formatters/BUILD.gn | 48 - .../6.6.30/event_formatters/autogenerated.gni | 51 - .../ftrace_binder_event_formatter.cpp | 672 ------ .../ftrace_block_event_formatter.cpp | 363 ---- .../ftrace_cgroup_event_formatter.cpp | 277 --- .../ftrace_clk_event_formatter.cpp | 275 --- .../ftrace_compaction_event_formatter.cpp | 72 - .../ftrace_cpuhp_event_formatter.cpp | 104 - .../ftrace_dma_fence_event_formatter.cpp | 163 -- .../ftrace_ext4_event_formatter.cpp | 1851 ----------------- .../ftrace_f2fs_event_formatter.cpp | 118 -- .../ftrace_filelock_event_formatter.cpp | 191 -- .../ftrace_filemap_event_formatter.cpp | 117 -- .../ftrace_ftrace_event_formatter.cpp | 331 --- .../ftrace_gpio_event_formatter.cpp | 60 - .../ftrace_gpu_mem_event_formatter.cpp | 42 - .../ftrace_i2c_event_formatter.cpp | 95 - .../ftrace_ipi_event_formatter.cpp | 74 - .../ftrace_irq_event_formatter.cpp | 122 -- .../ftrace_kmem_event_formatter.cpp | 423 ---- .../ftrace_mmc_event_formatter.cpp | 81 - .../ftrace_net_event_formatter.cpp | 222 -- .../ftrace_oom_event_formatter.cpp | 45 - .../ftrace_pagemap_event_formatter.cpp | 64 - .../ftrace_power_event_formatter.cpp | 444 ---- .../ftrace_printk_event_formatter.cpp | 41 - .../ftrace_raw_syscalls_event_formatter.cpp | 61 - .../ftrace_rcu_event_formatter.cpp | 42 - .../ftrace_regulator_event_formatter.cpp | 241 --- .../ftrace_sched_event_formatter.cpp | 495 ----- .../ftrace_signal_event_formatter.cpp | 63 - .../ftrace_sunrpc_event_formatter.cpp | 553 ----- .../ftrace_task_event_formatter.cpp | 63 - .../ftrace_timer_event_formatter.cpp | 326 --- .../ftrace_v4l2_event_formatter.cpp | 264 --- .../ftrace_vmscan_event_formatter.cpp | 398 ---- .../ftrace_workqueue_event_formatter.cpp | 124 -- .../ftrace_writeback_event_formatter.cpp | 632 ------ .../6.6.30/event_parsers/BUILD.gn | 42 - .../6.6.30/event_parsers/autogenerated.gni | 51 - .../ftrace_binder_event_parser.cpp | 581 ------ .../ftrace_block_event_parser.cpp | 382 ---- .../ftrace_cgroup_event_parser.cpp | 289 --- .../event_parsers/ftrace_clk_event_parser.cpp | 271 --- .../ftrace_compaction_event_parser.cpp | 62 - .../ftrace_cpuhp_event_parser.cpp | 81 - .../ftrace_dma_fence_event_parser.cpp | 165 -- .../ftrace_ext4_event_parser.cpp | 1803 ---------------- .../ftrace_f2fs_event_parser.cpp | 109 - .../ftrace_filelock_event_parser.cpp | 174 -- .../ftrace_filemap_event_parser.cpp | 106 - .../ftrace_ftrace_event_parser.cpp | 265 --- .../ftrace_gpio_event_parser.cpp | 58 - .../ftrace_gpu_mem_event_parser.cpp | 39 - .../event_parsers/ftrace_i2c_event_parser.cpp | 104 - .../event_parsers/ftrace_ipi_event_parser.cpp | 72 - .../event_parsers/ftrace_irq_event_parser.cpp | 109 - .../ftrace_kmem_event_parser.cpp | 243 --- .../event_parsers/ftrace_mmc_event_parser.cpp | 102 - .../event_parsers/ftrace_net_event_parser.cpp | 275 --- .../event_parsers/ftrace_oom_event_parser.cpp | 40 - .../ftrace_pagemap_event_parser.cpp | 59 - .../ftrace_power_event_parser.cpp | 431 ---- .../ftrace_printk_event_parser.cpp | 37 - .../ftrace_raw_syscalls_event_parser.cpp | 59 - .../event_parsers/ftrace_rcu_event_parser.cpp | 37 - .../ftrace_regulator_event_parser.cpp | 221 -- .../ftrace_sched_event_parser.cpp | 498 ----- .../ftrace_signal_event_parser.cpp | 64 - .../ftrace_sunrpc_event_parser.cpp | 433 ---- .../ftrace_task_event_parser.cpp | 60 - .../ftrace_timer_event_parser.cpp | 250 --- .../ftrace_v4l2_event_parser.cpp | 214 -- .../ftrace_vmscan_event_parser.cpp | 221 -- .../ftrace_workqueue_event_parser.cpp | 98 - .../ftrace_writeback_event_parser.cpp | 575 ----- .../6.6.30/ftrace_cpp_generator.py | 918 -------- .../types/plugins/ftrace_data/6.6.30/BUILD.gn | 132 -- .../ftrace_data/6.6.30/autogenerated.gni | 51 - .../plugins/ftrace_data/6.6.30/binder.proto | 209 -- .../plugins/ftrace_data/6.6.30/block.proto | 170 -- .../plugins/ftrace_data/6.6.30/cgroup.proto | 127 -- .../plugins/ftrace_data/6.6.30/clk.proto | 96 - .../ftrace_data/6.6.30/compaction.proto | 36 - .../plugins/ftrace_data/6.6.30/cpuhp.proto | 44 - .../ftrace_data/6.6.30/dma_fence.proto | 76 - .../plugins/ftrace_data/6.6.30/ext4.proto | 760 ------- .../plugins/ftrace_data/6.6.30/f2fs.proto | 58 - .../plugins/ftrace_data/6.6.30/filelock.proto | 97 - .../plugins/ftrace_data/6.6.30/filemap.proto | 54 - .../plugins/ftrace_data/6.6.30/ftrace.proto | 115 - .../ftrace_data/6.6.30/ftrace_event.proto | 439 ---- .../plugins/ftrace_data/6.6.30/gpio.proto | 34 - .../plugins/ftrace_data/6.6.30/i2c.proto | 56 - .../plugins/ftrace_data/6.6.30/ipi.proto | 36 - .../plugins/ftrace_data/6.6.30/irq.proto | 47 - .../plugins/ftrace_data/6.6.30/kmem.proto | 106 - .../plugins/ftrace_data/6.6.30/mmc.proto | 76 - .../plugins/ftrace_data/6.6.30/net.proto | 162 -- .../plugins/ftrace_data/6.6.30/oom.proto | 27 - .../plugins/ftrace_data/6.6.30/pagemap.proto | 34 - .../plugins/ftrace_data/6.6.30/power.proto | 165 -- .../plugins/ftrace_data/6.6.30/printk.proto | 25 - .../ftrace_data/6.6.30/raw_syscalls.proto | 32 - .../plugins/ftrace_data/6.6.30/rcu.proto | 25 - .../ftrace_data/6.6.30/regulator.proto | 78 - .../plugins/ftrace_data/6.6.30/sched.proto | 206 -- .../plugins/ftrace_data/6.6.30/signal.proto | 40 - .../plugins/ftrace_data/6.6.30/sunrpc.proto | 194 -- .../plugins/ftrace_data/6.6.30/task.proto | 36 - .../plugins/ftrace_data/6.6.30/timer.proto | 102 - .../6.6.30/trace_plugin_config.proto | 38 - .../6.6.30/trace_plugin_result.proto | 80 - .../plugins/ftrace_data/6.6.30/v4l2.proto | 140 -- .../plugins/ftrace_data/6.6.30/vmscan.proto | 104 - .../ftrace_data/6.6.30/workqueue.proto | 46 - .../ftrace_data/6.6.30/writeback.proto | 268 --- 118 files changed, 1 insertion(+), 23828 deletions(-) delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/BUILD.gn delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/autogenerated.gni delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_binder_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_block_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cgroup_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_clk_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_compaction_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cpuhp_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_dma_fence_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ext4_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_f2fs_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filelock_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filemap_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ftrace_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpio_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpu_mem_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_i2c_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ipi_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_irq_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_kmem_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_mmc_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_net_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_oom_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_pagemap_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_power_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_printk_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_raw_syscalls_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_rcu_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_regulator_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sched_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_signal_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sunrpc_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_task_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_timer_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_v4l2_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_vmscan_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_workqueue_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_writeback_event_formatter.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/BUILD.gn delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/autogenerated.gni delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_binder_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_block_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cgroup_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_clk_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_compaction_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cpuhp_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_dma_fence_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ext4_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_f2fs_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filelock_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filemap_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ftrace_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpio_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpu_mem_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_i2c_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ipi_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_irq_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_kmem_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_mmc_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_net_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_oom_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_pagemap_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_power_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_printk_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_raw_syscalls_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_rcu_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_regulator_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sched_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_signal_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sunrpc_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_task_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_timer_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_v4l2_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_vmscan_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_workqueue_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_writeback_event_parser.cpp delete mode 100644 device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/ftrace_cpp_generator.py delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/BUILD.gn delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/autogenerated.gni delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/binder.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/block.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/cgroup.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/clk.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/compaction.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/cpuhp.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/dma_fence.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/ext4.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/f2fs.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/filelock.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/filemap.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/ftrace.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/ftrace_event.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/gpio.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/i2c.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/ipi.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/irq.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/kmem.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/mmc.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/net.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/oom.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/pagemap.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/power.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/printk.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/raw_syscalls.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/rcu.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/regulator.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/sched.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/signal.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/sunrpc.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/task.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/timer.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/trace_plugin_config.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/trace_plugin_result.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/v4l2.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/vmscan.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/workqueue.proto delete mode 100644 protos/types/plugins/ftrace_data/6.6.30/writeback.proto diff --git a/device/plugins/ftrace_plugin/ftrace.gni b/device/plugins/ftrace_plugin/ftrace.gni index a4ebe2839..369b729cc 100644 --- a/device/plugins/ftrace_plugin/ftrace.gni +++ b/device/plugins/ftrace_plugin/ftrace.gni @@ -14,5 +14,5 @@ import("../../../build/config.gni") declare_args() { - device_kernel_version = "6.6.30" + device_kernel_version = "default" } diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/BUILD.gn b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/BUILD.gn deleted file mode 100644 index f6459efc0..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/BUILD.gn +++ /dev/null @@ -1,48 +0,0 @@ -# THIS FILE IS GENERATE BY {}, PLEASE DON'T EDIT IT! -# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("../../../../../../base/config.gni") -import("../../../../ftrace.gni") -import("autogenerated.gni") - -ohos_source_set("ftrace_event_formatters") { - sources = auto_generated_cpp_sources - public_configs = [] - include_dirs = [ - ".", - "${OHOS_PROFILER_DIR}/device/plugins/ftrace_plugin/include", - "${OHOS_PROFILER_DIR}/device/plugins/ftrace_plugin/tools/trace_converter/", - "${OHOS_PROFILER_DIR}/device/plugins/ftrace_plugin/tools/trace_converter/include", - "${OHOS_PROFILER_DIR}/device/plugins/ftrace_plugin/tools/trace_converter/include/linux", - "${OHOS_PROFILER_DIR}/device/plugins/ftrace_plugin/tools/trace_converter/include/trace", - "${OHOS_PROFILER_DIR}/device/base/include", - ] - deps = [ "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp_standard" ] - if (!is_mingw) { - if (current_toolchain != host_toolchain) { - defines = [ "HAVE_HILOG" ] - external_deps = [ - "hilog:libhilog_base", - "protobuf:protobuf", - ] - } - public_configs = - [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ] - } else { - public_configs = [ "${OHOS_PROFILER_DIR}/device/plugins/ftrace_plugin/tools/trace_converter:trace_converter_inner_config" ] - } - subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" - part_name = "${OHOS_PROFILER_PART_NAME}" -} diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/autogenerated.gni b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/autogenerated.gni deleted file mode 100644 index b1b31b9b2..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/autogenerated.gni +++ /dev/null @@ -1,51 +0,0 @@ -# THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! -# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -auto_generated_cpp_sources = [ - "ftrace_binder_event_formatter.cpp", - "ftrace_block_event_formatter.cpp", - "ftrace_cgroup_event_formatter.cpp", - "ftrace_clk_event_formatter.cpp", - "ftrace_compaction_event_formatter.cpp", - "ftrace_cpuhp_event_formatter.cpp", - "ftrace_dma_fence_event_formatter.cpp", - "ftrace_ext4_event_formatter.cpp", - "ftrace_f2fs_event_formatter.cpp", - "ftrace_filelock_event_formatter.cpp", - "ftrace_filemap_event_formatter.cpp", - "ftrace_ftrace_event_formatter.cpp", - "ftrace_gpio_event_formatter.cpp", - "ftrace_i2c_event_formatter.cpp", - "ftrace_ipi_event_formatter.cpp", - "ftrace_irq_event_formatter.cpp", - "ftrace_kmem_event_formatter.cpp", - "ftrace_mmc_event_formatter.cpp", - "ftrace_net_event_formatter.cpp", - "ftrace_oom_event_formatter.cpp", - "ftrace_pagemap_event_formatter.cpp", - "ftrace_power_event_formatter.cpp", - "ftrace_printk_event_formatter.cpp", - "ftrace_raw_syscalls_event_formatter.cpp", - "ftrace_rcu_event_formatter.cpp", - "ftrace_regulator_event_formatter.cpp", - "ftrace_sched_event_formatter.cpp", - "ftrace_signal_event_formatter.cpp", - "ftrace_sunrpc_event_formatter.cpp", - "ftrace_task_event_formatter.cpp", - "ftrace_timer_event_formatter.cpp", - "ftrace_v4l2_event_formatter.cpp", - "ftrace_vmscan_event_formatter.cpp", - "ftrace_workqueue_event_formatter.cpp", - "ftrace_writeback_event_formatter.cpp", -] diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_binder_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_binder_event_formatter.cpp deleted file mode 100644 index e30afbd37..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_binder_event_formatter.cpp +++ /dev/null @@ -1,672 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "binder.h" -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_alloc_lru_end, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_alloc_lru_end_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_alloc_lru_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_alloc_lru_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_alloc_lru_end) msg had " - "be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_alloc_lru_end) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_alloc_lru_start, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_alloc_lru_start_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_alloc_lru_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_alloc_lru_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_alloc_lru_start) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_alloc_lru_start) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_alloc_page_end, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_alloc_page_end_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_alloc_page_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_alloc_page_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_alloc_page_end) msg had " - "be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_alloc_page_end) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_alloc_page_start, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_alloc_page_start_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_alloc_page_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_alloc_page_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_alloc_page_start) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_alloc_page_start) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_command, [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_command_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_command_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_command: cmd=0x%x", msg.cmd()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_command) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_command) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_free_lru_end, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_free_lru_end_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_free_lru_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_free_lru_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_free_lru_end) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_free_lru_end) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_free_lru_start, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_free_lru_start_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_free_lru_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_free_lru_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_free_lru_start) msg had " - "be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_free_lru_start) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_ioctl, [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_ioctl_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_ioctl_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_ioctl: cmd=0x%x arg=0x%" PRIx64 "", - msg.cmd(), msg.arg()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_ioctl) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(binder_ioctl) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_ioctl_done, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_ioctl_done_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_ioctl_done_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_ioctl_done: ret=%d", msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_ioctl_done) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_ioctl_done) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_lock, [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_lock_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_lock_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_lock: tag=%s", msg.tag().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_lock) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(binder_lock) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_locked, [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_locked_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_locked_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_locked: tag=%s", msg.tag().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_locked) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_locked) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_read_done, [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_read_done_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_read_done_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_read_done: ret=%d", msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_read_done) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_read_done) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_return, [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_return_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_return_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_return: cmd=0x%x", msg.cmd()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_return) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_return) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_transaction_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_transaction: transaction=%d dest_node=%d dest_proc=%d " - "dest_thread=%d reply=%d flags=0x%x code=0x%x", - msg.debug_id(), msg.target_node(), msg.to_proc(), msg.to_thread(), msg.reply(), - msg.flags(), msg.code()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_transaction) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction_alloc_buf, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_transaction_alloc_buf_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_alloc_buf_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_transaction_alloc_buf: transaction=%d data_size=%" PRIu64 " offsets_size=%" PRIu64 - " extra_buffers_size=%" PRIu64 "", - msg.debug_id(), msg.data_size(), msg.offsets_size(), msg.extra_buffers_size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_transaction_alloc_buf) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction_alloc_buf) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction_buffer_release, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_transaction_buffer_release_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_buffer_release_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_transaction_buffer_release: transaction=%d data_size=%" PRIu64 - " offsets_size=%" PRIu64 " extra_buffers_size=%" PRIu64 "", - msg.debug_id(), msg.data_size(), msg.offsets_size(), msg.extra_buffers_size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print " - "event(binder_transaction_buffer_release) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction_buffer_release) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction_failed_buffer_release, - [](const ForStandard::FtraceEvent &event) -> bool { - return event.has_binder_transaction_failed_buffer_release_format(); - }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_failed_buffer_release_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_transaction_failed_buffer_release: transaction=%d " - "data_size=%" PRIu64 " offsets_size=%" PRIu64 " extra_buffers_size=%" PRIu64 "", - msg.debug_id(), msg.data_size(), msg.offsets_size(), msg.extra_buffers_size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print " - "event(binder_transaction_failed_buffer_" - "release) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction_failed_buffer_release) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction_node_to_ref, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_transaction_node_to_ref_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_node_to_ref_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_transaction_node_to_ref: transaction=%d node=%d " - "src_ptr=0x%016llx ==> dest_ref=%d dest_desc=%d", - msg.debug_id(), msg.node_debug_id(), (u64)msg.node_ptr(), msg.ref_debug_id(), msg.ref_desc()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print " - "event(binder_transaction_node_to_ref) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction_node_to_ref) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction_received, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_transaction_received_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_received_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_transaction_received: transaction=%d", - msg.debug_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_transaction_received) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction_received) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction_ref_to_node, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_transaction_ref_to_node_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_ref_to_node_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_transaction_ref_to_node: transaction=%d node=%d " - "src_ref=%d src_desc=%d ==> dest_ptr=0x%016llx", - msg.debug_id(), msg.node_debug_id(), msg.ref_debug_id(), msg.ref_desc(), (u64)msg.node_ptr()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print " - "event(binder_transaction_ref_to_node) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction_ref_to_node) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_transaction_ref_to_ref, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_transaction_ref_to_ref_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_transaction_ref_to_ref_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_transaction_ref_to_ref: transaction=%d node=%d src_ref=%d " - "src_desc=%d ==> dest_ref=%d dest_desc=%d", - msg.debug_id(), msg.node_debug_id(), msg.src_ref_debug_id(), msg.src_ref_desc(), - msg.dest_ref_debug_id(), msg.dest_ref_desc()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_transaction_ref_to_ref) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_transaction_ref_to_ref) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_unlock, [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_unlock_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_unlock_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_unlock: tag=%s", msg.tag().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_unlock) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_unlock) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_unmap_kernel_end, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_unmap_kernel_end_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_unmap_kernel_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_unmap_kernel_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_unmap_kernel_end) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_unmap_kernel_end) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_unmap_kernel_start, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_unmap_kernel_start_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_unmap_kernel_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_unmap_kernel_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_unmap_kernel_start) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_unmap_kernel_start) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_unmap_user_end, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_unmap_user_end_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_unmap_user_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_unmap_user_end: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_unmap_user_end) msg had " - "be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_unmap_user_end) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_unmap_user_start, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_unmap_user_start_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_unmap_user_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_unmap_user_start: proc=%d page_index=%" PRIu64 "", msg.proc(), msg.page_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_unmap_user_start) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_unmap_user_start) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_update_page_range, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_update_page_range_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_update_page_range_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_update_page_range: proc=%d allocate=%d offset=%" PRIu64 " size=%" PRIu64 "", - msg.proc(), msg.allocate(), msg.offset(), msg.size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_update_page_range) msg " - "had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_update_page_range) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_wait_for_work, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_wait_for_work_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_wait_for_work_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "binder_wait_for_work: proc_work=%d " - "transaction_stack=%d thread_todo=%d", - msg.proc_work(), msg.transaction_stack(), msg.thread_todo()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_wait_for_work) msg had " - "be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_wait_for_work) msg " - "snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - binder_write_done, - [](const ForStandard::FtraceEvent &event) -> bool { return event.has_binder_write_done_format(); }, - [](const ForStandard::FtraceEvent &event) -> std::string { - auto msg = event.binder_write_done_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "binder_write_done: ret=%d", msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(binder_write_done) " - "msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(binder_write_done) " - "msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_block_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_block_event_formatter.cpp deleted file mode 100644 index 2460fb445..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_block_event_formatter.cpp +++ /dev/null @@ -1,363 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - block_bio_backmerge, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_bio_backmerge_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_bio_backmerge_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_bio_backmerge: %d,%d %s %" PRIu64 " + %u [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_bio_backmerge) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_bio_backmerge) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_bio_bounce, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_bio_bounce_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_bio_bounce_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_bio_bounce: %d,%d %s %" PRIu64 " + %u [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_bio_bounce) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_bio_bounce) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_bio_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_bio_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_bio_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_bio_complete: %d,%d %s %" PRIu64 " + %u [%d]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.error()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_bio_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_bio_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_bio_frontmerge, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_bio_frontmerge_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_bio_frontmerge_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_bio_frontmerge: %d,%d %s %" PRIu64 " + %u [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_bio_frontmerge) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_bio_frontmerge) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_bio_queue, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_bio_queue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_bio_queue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_bio_queue: %d,%d %s %" PRIu64 " + %u [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_bio_queue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_bio_queue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_bio_remap, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_bio_remap_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_bio_remap_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "block_bio_remap: %d,%d %s %" PRIu64 " + %u <- (%d,%d) %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), ((unsigned int)((msg.old_dev()) >> 20)), - ((unsigned int)((msg.old_dev()) & ((1U << 20) - 1))), msg.old_sector()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_bio_remap) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_bio_remap) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_dirty_buffer, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_dirty_buffer_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_dirty_buffer_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "block_dirty_buffer: %d,%d sector=%" PRIu64 " size=%" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.sector(), msg.size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_dirty_buffer) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_dirty_buffer) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_getrq, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_getrq_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_getrq_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_getrq: %d,%d %s %" PRIu64 " + %u [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_getrq) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_getrq) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_plug, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_plug_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_plug_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_plug: [%s]", msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(block_plug) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_plug) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_rq_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_rq_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_rq_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_rq_complete: %d,%d %s (%s) %" PRIu64 " + %u [%d]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), msg.error()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_rq_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_rq_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_rq_insert, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_rq_insert_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_rq_insert_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_rq_insert: %d,%d %s %u (%s) %" PRIu64 " + %u [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.rwbs().c_str(), - msg.bytes(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_rq_insert) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_rq_insert) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_rq_issue, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_rq_issue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_rq_issue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_rq_issue: %d,%d %s %u (%s) %" PRIu64 " + %u [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.rwbs().c_str(), - msg.bytes(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_rq_issue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_rq_issue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_rq_remap, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_rq_remap_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_rq_remap_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "block_rq_remap: %d,%d %s %" PRIu64 " + %u <- (%d,%d) %" PRIu64 " %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.nr_sector(), ((unsigned int)((msg.old_dev()) >> 20)), - ((unsigned int)((msg.old_dev()) & ((1U << 20) - 1))), msg.old_sector(), msg.nr_bios()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_rq_remap) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_rq_remap) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_rq_requeue, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_rq_requeue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_rq_requeue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_rq_requeue: %d,%d %s (%s) %" PRIu64 " + %u [%d]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.cmd().c_str(), msg.sector(), msg.nr_sector(), 0); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_rq_requeue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_rq_requeue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_split, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_split_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_split_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_split: %d,%d %s %" PRIu64 " / %" PRIu64 " [%s]", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.rwbs().c_str(), msg.sector(), msg.new_sector(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_split) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_split) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_touch_buffer, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_touch_buffer_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_touch_buffer_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "block_touch_buffer: %d,%d sector=%" PRIu64 " size=%" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.sector(), msg.size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_touch_buffer) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_touch_buffer) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - block_unplug, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_block_unplug_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.block_unplug_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "block_unplug: [%s] %d", msg.comm().c_str(), msg.nr_rq()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(block_unplug) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(block_unplug) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cgroup_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cgroup_event_formatter.cpp deleted file mode 100644 index c7d2e9244..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cgroup_event_formatter.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_attach_task, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_attach_task_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_attach_task_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "cgroup_attach_task: dst_root=%d dst_id=%" PRIu64 " dst_level=%d dst_path=%s pid=%d comm=%s", - msg.dst_root(), msg.dst_id(), msg.dst_level(), msg.dst_path().c_str(), msg.pid(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_attach_task) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_attach_task) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_destroy_root, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_destroy_root_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_destroy_root_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_destroy_root: root=%d ss_mask=%#x name=%s", - msg.root(), msg.ss_mask(), msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_destroy_root) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_destroy_root) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_freeze, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_freeze_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_freeze_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_freeze: root=%d id=%" PRIu64 " level=%d path=%s", - msg.root(), msg.id(), msg.level(), msg.path().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_freeze) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_freeze) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_mkdir, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_mkdir_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_mkdir_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_mkdir: root=%d id=%" PRIu64 " level=%d path=%s", - msg.root(), msg.id(), msg.level(), msg.path().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_mkdir) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_mkdir) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_notify_frozen, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_notify_frozen_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_notify_frozen_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "cgroup_notify_frozen: root=%d id=%" PRIu64 " level=%d path=%s val=%d", msg.root(), - msg.id(), msg.level(), msg.path().c_str(), msg.val()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_notify_frozen) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_notify_frozen) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_notify_populated, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_notify_populated_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_notify_populated_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "cgroup_notify_populated: root=%d id=%" PRIu64 " level=%d path=%s val=%d", msg.root(), - msg.id(), msg.level(), msg.path().c_str(), msg.val()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(cgroup_notify_populated) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_notify_populated) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_release, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_release_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_release_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_release: root=%d id=%" PRIu64 " level=%d path=%s", - msg.root(), msg.id(), msg.level(), msg.path().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_release) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_release) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_remount, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_remount_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_remount_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_remount: root=%d ss_mask=%#x name=%s", - msg.root(), msg.ss_mask(), msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_remount) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_remount) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_rename, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_rename_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_rename_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_rename: root=%d id=%" PRIu64 " level=%d path=%s", - msg.root(), msg.id(), msg.level(), msg.path().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_rename) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_rename) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_rmdir, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_rmdir_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_rmdir_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_rmdir: root=%d id=%" PRIu64 " level=%d path=%s", - msg.root(), msg.id(), msg.level(), msg.path().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_rmdir) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_rmdir) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_setup_root, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_setup_root_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_setup_root_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_setup_root: root=%d ss_mask=%#x name=%s", - msg.root(), msg.ss_mask(), msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_setup_root) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_setup_root) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_transfer_tasks, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_transfer_tasks_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_transfer_tasks_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "cgroup_transfer_tasks: dst_root=%d dst_id=%" PRIu64 " dst_level=%d dst_path=%s pid=%d comm=%s", - msg.dst_root(), msg.dst_id(), msg.dst_level(), msg.dst_path().c_str(), msg.pid(), msg.comm().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(cgroup_transfer_tasks) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_transfer_tasks) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cgroup_unfreeze, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cgroup_unfreeze_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cgroup_unfreeze_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cgroup_unfreeze: root=%d id=%" PRIu64 " level=%d path=%s", - msg.root(), msg.id(), msg.level(), msg.path().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cgroup_unfreeze) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cgroup_unfreeze) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_clk_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_clk_event_formatter.cpp deleted file mode 100644 index 06bb5e556..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_clk_event_formatter.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_disable, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_disable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_disable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_disable: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_disable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_disable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_disable_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_disable_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_disable_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_disable_complete: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_disable_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_disable_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_enable, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_enable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_enable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_enable: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(clk_enable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_enable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_enable_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_enable_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_enable_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_enable_complete: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_enable_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_enable_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_prepare, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_prepare_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_prepare_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_prepare: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_prepare) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_prepare) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_prepare_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_prepare_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_prepare_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_prepare_complete: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_prepare_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_prepare_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_set_parent, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_set_parent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_set_parent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_parent: %s %s", msg.name().c_str(), - msg.pname().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_set_parent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_set_parent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_set_parent_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_set_parent_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_set_parent_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_parent_complete: %s %s", msg.name().c_str(), - msg.pname().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(clk_set_parent_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_set_parent_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_set_phase, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_set_phase_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_set_phase_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_phase: %s %d", msg.name().c_str(), - (int)msg.phase()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_set_phase) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_set_phase) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_set_phase_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_set_phase_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_set_phase_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_phase_complete: %s %d", msg.name().c_str(), - (int)msg.phase()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(clk_set_phase_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_set_phase_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_set_rate, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_set_rate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_set_rate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_rate: %s %lu", msg.name().c_str(), - (unsigned long)msg.rate()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_set_rate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_set_rate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_set_rate_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_set_rate_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_set_rate_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_set_rate_complete: %s %lu", msg.name().c_str(), - (unsigned long)msg.rate()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(clk_set_rate_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_set_rate_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_unprepare, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_unprepare_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_unprepare_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_unprepare: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clk_unprepare) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_unprepare) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clk_unprepare_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clk_unprepare_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clk_unprepare_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clk_unprepare_complete: %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(clk_unprepare_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clk_unprepare_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_compaction_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_compaction_event_formatter.cpp deleted file mode 100644 index 4ac6f9740..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_compaction_event_formatter.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" -#include "type.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_compaction_isolate_freepages, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_compaction_isolate_freepages_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_compaction_isolate_freepages_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_compaction_isolate_freepages: range=(0x%" PRIx64 " ~ 0x%" PRIx64 - ") nr_scanned==0x%" PRIu64 " nr_taken==0x%" PRIu64 "", - msg.start_pfn(), msg.end_pfn(), msg.nr_scanned(), msg.nr_taken()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_compaction_isolate_freepages) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_compaction_isolate_freepages) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_compaction_isolate_migratepages, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_compaction_isolate_migratepages_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_compaction_isolate_migratepages_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_compaction_isolate_migratepages: range=(0x%" PRIx64 " ~ 0x%" PRIx64 - ") nr_scanned==0x%" PRIu64 " nr_taken==0x%" PRIu64 "", - msg.start_pfn(), msg.end_pfn(), msg.nr_scanned(), msg.nr_taken()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_compaction_isolate_migratepages) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_compaction_isolate_migratepages) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cpuhp_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cpuhp_event_formatter.cpp deleted file mode 100644 index 14c2288db..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_cpuhp_event_formatter.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - cpuhp_enter, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cpuhp_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cpuhp_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.fun()) > 0) { - functionStr = kernelSymbols[msg.fun()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpuhp_enter: cpu: %04u target: %3d step: %3d (%s)", - msg.cpu(), msg.target(), msg.idx(), functionStr.c_str()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpuhp_enter: cpu: %04u target: %3d step: %3d (%p)", - msg.cpu(), msg.target(), msg.idx(), msg.fun()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cpuhp_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cpuhp_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cpuhp_exit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cpuhp_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cpuhp_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpuhp_exit: cpu: %04u state: %3d step: %3d ret: %d", - msg.cpu(), msg.state(), msg.idx(), msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(cpuhp_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cpuhp_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cpuhp_multi_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cpuhp_multi_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cpuhp_multi_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.fun()) > 0) { - functionStr = kernelSymbols[msg.fun()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "cpuhp_multi_enter: cpu: %04u target: %3d step: %3d (%s)", msg.cpu(), msg.target(), - msg.idx(), functionStr.c_str()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "cpuhp_multi_enter: cpu: %04u target: %3d step: %3d (%p)", msg.cpu(), msg.target(), - msg.idx(), msg.fun()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cpuhp_multi_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cpuhp_multi_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_dma_fence_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_dma_fence_event_formatter.cpp deleted file mode 100644 index 80ab03c0f..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_dma_fence_event_formatter.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - dma_fence_destroy, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dma_fence_destroy_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dma_fence_destroy_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dma_fence_destroy: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), - msg.timeline().c_str(), msg.context(), msg.seqno()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(dma_fence_destroy) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dma_fence_destroy) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dma_fence_emit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dma_fence_emit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dma_fence_emit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dma_fence_emit: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), - msg.timeline().c_str(), msg.context(), msg.seqno()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(dma_fence_emit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dma_fence_emit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dma_fence_enable_signal, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dma_fence_enable_signal_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dma_fence_enable_signal_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dma_fence_enable_signal: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), - msg.timeline().c_str(), msg.context(), msg.seqno()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(dma_fence_enable_signal) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dma_fence_enable_signal) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dma_fence_init, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dma_fence_init_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dma_fence_init_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dma_fence_init: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), - msg.timeline().c_str(), msg.context(), msg.seqno()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(dma_fence_init) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dma_fence_init) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dma_fence_signaled, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dma_fence_signaled_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dma_fence_signaled_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dma_fence_signaled: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), - msg.timeline().c_str(), msg.context(), msg.seqno()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(dma_fence_signaled) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dma_fence_signaled) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dma_fence_wait_end, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dma_fence_wait_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dma_fence_wait_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dma_fence_wait_end: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), - msg.timeline().c_str(), msg.context(), msg.seqno()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(dma_fence_wait_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dma_fence_wait_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dma_fence_wait_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dma_fence_wait_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dma_fence_wait_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dma_fence_wait_start: driver=%s timeline=%s context=%u seqno=%u", msg.driver().c_str(), - msg.timeline().c_str(), msg.context(), msg.seqno()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(dma_fence_wait_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dma_fence_wait_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ext4_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ext4_event_formatter.cpp deleted file mode 100644 index 3427195c8..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ext4_event_formatter.cpp +++ /dev/null @@ -1,1851 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_alloc_da_blocks, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_alloc_da_blocks_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_alloc_da_blocks_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_alloc_da_blocks: dev %d,%d ino %" PRIu64 " reserved_data_blocks %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.data_blocks()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_alloc_da_blocks) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_alloc_da_blocks) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_allocate_blocks, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_allocate_blocks_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_allocate_blocks_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_allocate_blocks: dev %d,%d ino %" PRIu64 " flags %s len %u block %" PRIu64 " lblk %u goal %" PRIu64 - " lleft %u lright %u pleft %" PRIu64 " pright %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - __print_flags(msg.flags(), "|", {0x0001, "HINT_MERGE"}, {0x0002, "HINT_RESV"}, {0x0004, "HINT_MDATA"}, - {0x0008, "HINT_FIRST"}, {0x0010, "HINT_BEST"}, {0x0020, "HINT_DATA"}, - {0x0040, "HINT_NOPREALLOC"}, {0x0080, "HINT_GRP_ALLOC"}, {0x0100, "HINT_GOAL_ONLY"}, - {0x0200, "HINT_TRY_GOAL"}, {0x0400, "DELALLOC_RESV"}, {0x0800, "STREAM_ALLOC"}, - {0x1000, "USE_ROOT_BLKS"}, {0x2000, "USE_RESV"}, {0x4000, "STRICT_CHECK"}), - msg.len(), msg.block(), msg.logical(), msg.goal(), msg.lleft(), msg.lright(), msg.pleft(), msg.pright()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_allocate_blocks) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_allocate_blocks) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_allocate_inode, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_allocate_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_allocate_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_allocate_inode: dev %d,%d ino %" PRIu64 " dir %" PRIu64 " mode 0%o", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.dir(), msg.mode()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_allocate_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_allocate_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_begin_ordered_truncate, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_begin_ordered_truncate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_begin_ordered_truncate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_begin_ordered_truncate: dev %d,%d ino %" PRIu64 " new_size %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.new_size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_begin_ordered_truncate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_begin_ordered_truncate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_collapse_range, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_collapse_range_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_collapse_range_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_collapse_range: dev %d,%d ino %" PRIu64 " offset %" PRIu64 " len %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.offset(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_collapse_range) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_collapse_range) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_da_release_space, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_da_release_space_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_da_release_space_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_da_release_space: dev %d,%d ino %" PRIu64 " mode 0%o i_blocks %" PRIu64 - " freed_blocks %d reserved_data_blocks %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.mode(), msg.i_blocks(), msg.freed_blocks(), msg.reserved_data_blocks()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_da_release_space) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_da_release_space) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_da_reserve_space, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_da_reserve_space_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_da_reserve_space_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_da_reserve_space: dev %d,%d ino %" PRIu64 " mode 0%o i_blocks %" PRIu64 - " reserved_data_blocks %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.mode(), msg.i_blocks(), msg.reserved_data_blocks()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_da_reserve_space) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_da_reserve_space) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_da_update_reserve_space, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_da_update_reserve_space_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_da_update_reserve_space_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_da_update_reserve_space: dev %d,%d ino %" PRIu64 " mode 0%o i_blocks %" PRIu64 - " used_blocks %d reserved_data_blocks %d quota_claim %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.mode(), msg.i_blocks(), msg.used_blocks(), msg.reserved_data_blocks(), msg.quota_claim()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_da_update_reserve_space) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_da_update_reserve_space) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_da_write_begin, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_da_write_begin_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_da_write_begin_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_da_write_begin: dev %d,%d ino %" PRIu64 " pos %" PRIu64 " len %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.pos(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_da_write_begin) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_da_write_begin) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_da_write_end, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_da_write_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_da_write_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_da_write_end: dev %d,%d ino %" PRIu64 " pos %" PRIu64 " len %u copied %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.pos(), msg.len(), msg.copied()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_da_write_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_da_write_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_da_write_pages, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_da_write_pages_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_da_write_pages_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_da_write_pages: dev %d,%d ino %" PRIu64 " first_page %" PRIu64 - " nr_to_write %" PRIu64 " sync_mode %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.first_page(), msg.nr_to_write(), msg.sync_mode()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_da_write_pages) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_da_write_pages) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_da_write_pages_extent, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_da_write_pages_extent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_da_write_pages_extent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_da_write_pages_extent: dev %d,%d ino %" PRIu64 " lblk %" PRIu64 " len %u flags %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.lblk(), msg.len(), - __print_flags(msg.flags(), "", {((((1UL))) << (5)), "N"}, {((((1UL))) << (4)), "M"}, - {((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_da_write_pages_extent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_da_write_pages_extent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_discard_blocks, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_discard_blocks_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_discard_blocks_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_discard_blocks: dev %d,%d blk %" PRIu64 " count %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.blk(), msg.count()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_discard_blocks) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_discard_blocks) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_discard_preallocations, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_discard_preallocations_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_discard_preallocations_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_discard_preallocations: dev %d,%d ino %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_discard_preallocations) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_discard_preallocations) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_drop_inode, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_drop_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_drop_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_drop_inode: dev %d,%d ino %" PRIu64 " drop %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.drop()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_drop_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_drop_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_cache_extent, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_cache_extent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_cache_extent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_cache_extent: dev %d,%d ino %" PRIu64 " es [%u/%u) mapped %" PRIu64 " status %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.lblk(), msg.len(), msg.pblk(), - __print_flags(msg.status(), "", {(1 << 0), "W"}, {(1 << 1), "U"}, {(1 << 2), "D"}, - {(1 << 3), "H"}, {(1 << 4), "R"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_es_cache_extent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_es_cache_extent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_insert_extent, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_insert_extent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_insert_extent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_insert_extent: dev %d,%d ino %" PRIu64 " es [%u/%u) mapped %" PRIu64 " status %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.lblk(), msg.len(), msg.pblk(), - __print_flags(msg.status(), "", {(1 << 0), "W"}, {(1 << 1), "U"}, {(1 << 2), "D"}, - {(1 << 3), "H"}, {(1 << 4), "R"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_es_insert_extent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_es_insert_extent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_lookup_extent_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_lookup_extent_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_lookup_extent_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_lookup_extent_enter: dev %d,%d ino %" PRIu64 " lblk %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.lblk()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_es_lookup_extent_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_es_lookup_extent_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_lookup_extent_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_lookup_extent_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_lookup_extent_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_lookup_extent_exit: dev %d,%d ino %" PRIu64 " found %d [%u/%u) %" PRIu64 " %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.found(), msg.lblk(), msg.len(), msg.found() ? msg.pblk() : 0, - __print_flags(msg.found() ? msg.status() : 0, "", {(1 << 0), "W"}, {(1 << 1), "U"}, - {(1 << 2), "D"}, {(1 << 3), "H"}, {(1 << 4), "R"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_es_lookup_extent_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_es_lookup_extent_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_remove_extent, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_remove_extent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_remove_extent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_remove_extent: dev %d,%d ino %" PRIu64 " es [%" PRIu64 "/%" PRIu64 ")", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.lblk(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_es_remove_extent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_es_remove_extent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_shrink, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_shrink_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_shrink_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_shrink: dev %d,%d nr_shrunk %d, scan_time %" PRIu64 " nr_skipped %d retried %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.nr_shrunk(), msg.scan_time(), msg.nr_skipped(), msg.retried()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_es_shrink) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_es_shrink) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_shrink_count, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_shrink_count_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_shrink_count_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_shrink_count: dev %d,%d nr_to_scan %d cache_cnt %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.nr_to_scan(), msg.cache_cnt()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_es_shrink_count) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_es_shrink_count) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_shrink_scan_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_shrink_scan_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_shrink_scan_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_shrink_scan_enter: dev %d,%d nr_to_scan %d cache_cnt %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.nr_to_scan(), msg.cache_cnt()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_es_shrink_scan_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_es_shrink_scan_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_es_shrink_scan_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_es_shrink_scan_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_es_shrink_scan_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_es_shrink_scan_exit: dev %d,%d nr_shrunk %d cache_cnt %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.nr_shrunk(), msg.cache_cnt()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_es_shrink_scan_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_es_shrink_scan_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_evict_inode, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_evict_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_evict_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_evict_inode: dev %d,%d ino %" PRIu64 " nlink %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.nlink()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_evict_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_evict_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_convert_to_initialized_enter, - [](const ForStandard::FtraceEvent& event) -> bool { - return event.has_ext4_ext_convert_to_initialized_enter_format(); - }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_convert_to_initialized_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_convert_to_initialized_enter: dev %d,%d ino %" PRIu64 - " m_lblk %u m_len %u u_lblk %u u_len %u u_pblk %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.m_lblk(), msg.m_len(), msg.u_lblk(), msg.u_len(), msg.u_pblk()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_ext_convert_to_initialized_enter) msg had be " - "cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN( - LOG_CORE, "the contents of event(ext4_ext_convert_to_initialized_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_convert_to_initialized_fastpath, - [](const ForStandard::FtraceEvent& event) -> bool { - return event.has_ext4_ext_convert_to_initialized_fastpath_format(); - }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_convert_to_initialized_fastpath_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_convert_to_initialized_fastpath: dev %d,%d ino %" PRIu64 - " m_lblk %u m_len %u u_lblk %u u_len %u u_pblk %" PRIu64 - " i_lblk %u i_len %u i_pblk %" PRIu64 " ", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.m_lblk(), msg.m_len(), msg.u_lblk(), msg.u_len(), msg.u_pblk(), - msg.i_lblk(), msg.i_len(), msg.i_pblk()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_ext_convert_to_initialized_fastpath) msg had be " - "cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN( - LOG_CORE, - "the contents of event(ext4_ext_convert_to_initialized_fastpath) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_handle_unwritten_extents, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_handle_unwritten_extents_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_handle_unwritten_extents_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_handle_unwritten_extents: dev %d,%d ino %" PRIu64 " m_lblk %u m_pblk %" PRIu64 - " m_len %u flags %s allocated %d newblock %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - (unsigned)msg.lblk(), msg.pblk(), msg.len(), - __print_flags(msg.flags(), "|", {0x0001, "CREATE"}, {0x0002, "UNWRIT"}, {0x0004, "DELALLOC"}, - {0x0008, "PRE_IO"}, {0x0010, "CONVERT"}, {0x0020, "METADATA_NOFAIL"}, - {0x0040, "NO_NORMALIZE"}, {0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, - {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"}), - (unsigned int)msg.allocated(), msg.newblk()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_ext_handle_unwritten_extents) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_ext_handle_unwritten_extents) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_load_extent, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_load_extent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_load_extent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_load_extent: dev %d,%d ino %" PRIu64 " lblk %u pblk %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.lblk(), msg.pblk()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_ext_load_extent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_ext_load_extent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_map_blocks_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_map_blocks_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_map_blocks_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_map_blocks_enter: dev %d,%d ino %" PRIu64 " lblk %u len %u flags %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.lblk(), msg.len(), - __print_flags(msg.flags(), "|", {0x0001, "CREATE"}, {0x0002, "UNWRIT"}, {0x0004, "DELALLOC"}, - {0x0008, "PRE_IO"}, {0x0010, "CONVERT"}, {0x0020, "METADATA_NOFAIL"}, - {0x0040, "NO_NORMALIZE"}, {0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, - {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_ext_map_blocks_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_ext_map_blocks_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_map_blocks_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_map_blocks_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_map_blocks_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_map_blocks_exit: dev %d,%d ino %" PRIu64 " flags %s lblk %u pblk %" PRIu64 - " len %u mflags %s ret %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - __print_flags(msg.flags(), "|", {0x0001, "CREATE"}, {0x0002, "UNWRIT"}, {0x0004, "DELALLOC"}, - {0x0008, "PRE_IO"}, {0x0010, "CONVERT"}, {0x0020, "METADATA_NOFAIL"}, - {0x0040, "NO_NORMALIZE"}, {0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, - {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"}), - msg.lblk(), msg.pblk(), msg.len(), - __print_flags(msg.mflags(), "", {((((1UL))) << (5)), "N"}, {((((1UL))) << (4)), "M"}, - {((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"}), - msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_ext_map_blocks_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_ext_map_blocks_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_remove_space, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_remove_space_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_remove_space_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_remove_space: dev %d,%d ino %" PRIu64 " since %u end %u depth %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), (unsigned)msg.start(), (unsigned)msg.end(), msg.depth()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_ext_remove_space) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_ext_remove_space) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_remove_space_done, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_remove_space_done_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_remove_space_done_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_remove_space_done: dev %d,%d ino %" PRIu64 - " since %u end %u depth %d partial%" PRIu64 " remaining_entries %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), (unsigned)msg.start(), (unsigned)msg.end(), msg.depth(), msg.partial(), - (unsigned short)msg.eh_entries()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_ext_remove_space_done) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_ext_remove_space_done) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_rm_idx, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_rm_idx_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_rm_idx_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_rm_idx: dev %d,%d ino %" PRIu64 " index_pblk %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.pblk()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_ext_rm_idx) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_ext_rm_idx) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_rm_leaf, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_rm_leaf_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_rm_leaf_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_rm_leaf: dev %d,%d ino %" PRIu64 " start_lblk %u last_extent [%u(%" PRIu64 - "), %u]partial%" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), (unsigned)msg.start(), (unsigned)msg.ee_lblk(), msg.ee_pblk(), - (unsigned short)msg.ee_len(), msg.partial()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_ext_rm_leaf) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_ext_rm_leaf) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ext_show_extent, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ext_show_extent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ext_show_extent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ext_show_extent: dev %d,%d ino %" PRIu64 " lblk %u pblk %" PRIu64 " len %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), (unsigned)msg.lblk(), msg.pblk(), (unsigned short)msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_ext_show_extent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_ext_show_extent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_fallocate_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_fallocate_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_fallocate_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_fallocate_enter: dev %d,%d ino %" PRIu64 " offset %" PRIu64 " len %" PRIu64 " mode %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.offset(), msg.len(), - __print_flags(msg.mode(), "|", {0x01, "KEEP_SIZE"}, {0x02, "PUNCH_HOLE"}, - {0x04, "NO_HIDE_STALE"}, {0x08, "COLLAPSE_RANGE"}, {0x10, "ZERO_RANGE"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_fallocate_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_fallocate_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_fallocate_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_fallocate_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_fallocate_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_fallocate_exit: dev %d,%d ino %" PRIu64 " pos %" PRIu64 " blocks %u ret %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.pos(), msg.blocks(), msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_fallocate_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_fallocate_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_forget, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_forget_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_forget_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_forget: dev %d,%d ino %" PRIu64 " mode 0%o is_metadata %d block %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.mode(), msg.is_metadata(), msg.block()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_forget) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_forget) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_free_blocks, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_free_blocks_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_free_blocks_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_free_blocks: dev %d,%d ino %" PRIu64 " mode 0%o block %" PRIu64 " count %" PRIu64 " flags %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.mode(), msg.block(), msg.count(), - __print_flags(msg.flags(), "|", {0x0001, "METADATA"}, {0x0002, "FORGET"}, {0x0004, "VALIDATED"}, - {0x0008, "NO_QUOTA"}, {0x0010, "1ST_CLUSTER"}, {0x0020, "LAST_CLUSTER"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_free_blocks) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_free_blocks) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_free_inode, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_free_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_free_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_free_inode: dev %d,%d ino %" PRIu64 " mode 0%o uid %u gid %u blocks %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.mode(), msg.uid(), msg.gid(), msg.blocks()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_free_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_free_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_get_implied_cluster_alloc_exit, - [](const ForStandard::FtraceEvent& event) -> bool { - return event.has_ext4_get_implied_cluster_alloc_exit_format(); - }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_get_implied_cluster_alloc_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_get_implied_cluster_alloc_exit: dev %d,%d m_lblk %u m_pblk %" PRIu64 - " m_len %u m_flags %s ret %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.lblk(), msg.pblk(), msg.len(), - __print_flags(msg.flags(), "", {((((1UL))) << (5)), "N"}, {((((1UL))) << (4)), "M"}, - {((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"}), - msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_get_implied_cluster_alloc_exit) msg had be cut " - "off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN( - LOG_CORE, "the contents of event(ext4_get_implied_cluster_alloc_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ind_map_blocks_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ind_map_blocks_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ind_map_blocks_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ind_map_blocks_enter: dev %d,%d ino %" PRIu64 " lblk %u len %u flags %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.lblk(), msg.len(), - __print_flags(msg.flags(), "|", {0x0001, "CREATE"}, {0x0002, "UNWRIT"}, {0x0004, "DELALLOC"}, - {0x0008, "PRE_IO"}, {0x0010, "CONVERT"}, {0x0020, "METADATA_NOFAIL"}, - {0x0040, "NO_NORMALIZE"}, {0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, - {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_ind_map_blocks_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_ind_map_blocks_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_ind_map_blocks_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_ind_map_blocks_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_ind_map_blocks_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_ind_map_blocks_exit: dev %d,%d ino %" PRIu64 " flags %s lblk %u pblk %" PRIu64 - " len %u mflags %s ret %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - __print_flags(msg.flags(), "|", {0x0001, "CREATE"}, {0x0002, "UNWRIT"}, {0x0004, "DELALLOC"}, - {0x0008, "PRE_IO"}, {0x0010, "CONVERT"}, {0x0020, "METADATA_NOFAIL"}, - {0x0040, "NO_NORMALIZE"}, {0x0100, "CONVERT_UNWRITTEN"}, {0x0200, "ZERO"}, - {0x0400, "IO_SUBMIT"}, {0x40000000, "EX_NOCACHE"}), - msg.lblk(), msg.pblk(), msg.len(), - __print_flags(msg.mflags(), "", {((((1UL))) << (5)), "N"}, {((((1UL))) << (4)), "M"}, - {((((1UL))) << (11)), "U"}, {((((1UL))) << (9)), "B"}), - msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_ind_map_blocks_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_ind_map_blocks_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_insert_range, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_insert_range_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_insert_range_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_insert_range: dev %d,%d ino %" PRIu64 " offset %" PRIu64 " len %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.offset(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_insert_range) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_insert_range) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_journal_start_reserved, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_journal_start_reserved_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_journal_start_reserved_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_journal_start_reserved: dev %d,%d blocks, %d caller %p", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.blocks(), (void*)msg.ip()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_journal_start_reserved) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_journal_start_reserved) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_journalled_write_end, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_journalled_write_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_journalled_write_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_journalled_write_end: dev %d,%d ino %" PRIu64 " pos %" PRIu64 " len %u copied %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.pos(), msg.len(), msg.copied()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_journalled_write_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_journalled_write_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_load_inode, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_load_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_load_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_load_inode: dev %d,%d ino %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_load_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_load_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_load_inode_bitmap, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_load_inode_bitmap_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_load_inode_bitmap_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_load_inode_bitmap: dev %d,%d group %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.group()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_load_inode_bitmap) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_load_inode_bitmap) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mark_inode_dirty, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mark_inode_dirty_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mark_inode_dirty_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mark_inode_dirty: dev %d,%d ino %" PRIu64 " caller %p", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), (void*)msg.ip()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_mark_inode_dirty) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mark_inode_dirty) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mb_bitmap_load, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mb_bitmap_load_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mb_bitmap_load_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_mb_bitmap_load: dev %d,%d group %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.group()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_mb_bitmap_load) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mb_bitmap_load) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mb_buddy_bitmap_load, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mb_buddy_bitmap_load_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mb_buddy_bitmap_load_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_mb_buddy_bitmap_load: dev %d,%d group %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.group()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_mb_buddy_bitmap_load) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_mb_buddy_bitmap_load) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mb_discard_preallocations, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mb_discard_preallocations_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mb_discard_preallocations_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mb_discard_preallocations: dev %d,%d needed %d", ((unsigned int)((msg.dev()) >> 20)), - ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.needed()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_mb_discard_preallocations) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_mb_discard_preallocations) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mb_new_group_pa, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mb_new_group_pa_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mb_new_group_pa_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mb_new_group_pa: dev %d,%d ino %" PRIu64 " pstart %" PRIu64 " len %u lstart %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.pa_pstart(), msg.pa_len(), msg.pa_lstart()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_mb_new_group_pa) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mb_new_group_pa) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mb_new_inode_pa, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mb_new_inode_pa_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mb_new_inode_pa_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mb_new_inode_pa: dev %d,%d ino %" PRIu64 " pstart %" PRIu64 " len %u lstart %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.pa_pstart(), msg.pa_len(), msg.pa_lstart()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_mb_new_inode_pa) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mb_new_inode_pa) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mb_release_group_pa, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mb_release_group_pa_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mb_release_group_pa_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mb_release_group_pa: dev %d,%d pstart %" PRIu64 " len %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.pa_pstart(), msg.pa_len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_mb_release_group_pa) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mb_release_group_pa) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mb_release_inode_pa, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mb_release_inode_pa_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mb_release_inode_pa_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mb_release_inode_pa: dev %d,%d ino %" PRIu64 " block %" PRIu64 " count %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.block(), msg.count()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_mb_release_inode_pa) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mb_release_inode_pa) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mballoc_alloc, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mballoc_alloc_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mballoc_alloc_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mballoc_alloc: dev %d,%d inode %" PRIu64 - " orig %u/%d/%u@%u goal %u/%d/%u@%u result %u/%d/%u@%u blks %u grps %u cr %s flags %s tail %u broken %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.orig_group(), msg.orig_start(), msg.orig_len(), msg.orig_logical(), msg.goal_group(), msg.goal_start(), - msg.goal_len(), msg.goal_logical(), msg.result_group(), msg.result_start(), msg.result_len(), - msg.result_logical(), msg.found(), msg.groups(), - __print_symbolic(msg.cr(), {0, "CR_POWER2_ALIGNED"}, {1, "CR_GOAL_LEN_FAST"}, {2, "CR_BEST_AVAIL_LEN"}, - {3, "CR_GOAL_LEN_SLOW"}, {4, "CR_ANY_FREE"}), - __print_flags(msg.flags(), "|", {0x0001, "HINT_MERGE"}, {0x0002, "HINT_RESV"}, {0x0004, "HINT_MDATA"}, - {0x0008, "HINT_FIRST"}, {0x0010, "HINT_BEST"}, {0x0020, "HINT_DATA"}, - {0x0040, "HINT_NOPREALLOC"}, {0x0080, "HINT_GRP_ALLOC"}, {0x0100, "HINT_GOAL_ONLY"}, - {0x0200, "HINT_TRY_GOAL"}, {0x0400, "DELALLOC_RESV"}, {0x0800, "STREAM_ALLOC"}, - {0x1000, "USE_ROOT_BLKS"}, {0x2000, "USE_RESV"}, {0x4000, "STRICT_CHECK"}), - msg.tail(), msg.buddy() ? 1 << msg.buddy() : 0); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_mballoc_alloc) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mballoc_alloc) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mballoc_discard, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mballoc_discard_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mballoc_discard_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mballoc_discard: dev %d,%d inode %" PRIu64 " extent %u/%d/%d ", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.result_group(), msg.result_start(), msg.result_len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_mballoc_discard) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mballoc_discard) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mballoc_free, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mballoc_free_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mballoc_free_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mballoc_free: dev %d,%d inode %" PRIu64 " extent %u/%d/%d ", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.result_group(), msg.result_start(), msg.result_len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_mballoc_free) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mballoc_free) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_mballoc_prealloc, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_mballoc_prealloc_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_mballoc_prealloc_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_mballoc_prealloc: dev %d,%d inode %" PRIu64 " orig %u/%d/%u@%u result %u/%d/%u@%u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.orig_group(), msg.orig_start(), msg.orig_len(), msg.orig_logical(), - msg.result_group(), msg.result_start(), msg.result_len(), msg.result_logical()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_mballoc_prealloc) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_mballoc_prealloc) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_other_inode_update_time, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_other_inode_update_time_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_other_inode_update_time_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_other_inode_update_time: dev %d,%d orig_ino %" PRIu64 " ino %" PRIu64 - " mode 0%o uid %u gid %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.orig_ino(), msg.ino(), msg.mode(), msg.uid(), msg.gid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_other_inode_update_time) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_other_inode_update_time) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_punch_hole, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_punch_hole_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_punch_hole_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_punch_hole: dev %d,%d ino %" PRIu64 " offset %" PRIu64 " len %" PRIu64 " mode %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.offset(), msg.len(), - __print_flags(msg.mode(), "|", {0x01, "KEEP_SIZE"}, {0x02, "PUNCH_HOLE"}, - {0x04, "NO_HIDE_STALE"}, {0x08, "COLLAPSE_RANGE"}, {0x10, "ZERO_RANGE"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_punch_hole) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_punch_hole) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_read_block_bitmap_load, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_read_block_bitmap_load_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_read_block_bitmap_load_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_read_block_bitmap_load: dev %d,%d group %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.group()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(ext4_read_block_bitmap_load) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(ext4_read_block_bitmap_load) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_remove_blocks, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_remove_blocks_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_remove_blocks_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_remove_blocks: dev %d,%d ino %" PRIu64 " extent [%u(%" PRIu64 - "), %u]from %u to %u partial%" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), (unsigned)msg.ee_lblk(), msg.ee_pblk(), (unsigned short)msg.ee_len(), - (unsigned)msg.from(), (unsigned)msg.to(), msg.partial()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_remove_blocks) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_remove_blocks) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_request_blocks, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_request_blocks_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_request_blocks_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_request_blocks: dev %d,%d ino %" PRIu64 " flags %s len %u lblk %u goal %" PRIu64 - " lleft %u lright %u pleft %" PRIu64 " pright %" PRIu64 " ", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - __print_flags(msg.flags(), "|", {0x0001, "HINT_MERGE"}, {0x0002, "HINT_RESV"}, {0x0004, "HINT_MDATA"}, - {0x0008, "HINT_FIRST"}, {0x0010, "HINT_BEST"}, {0x0020, "HINT_DATA"}, - {0x0040, "HINT_NOPREALLOC"}, {0x0080, "HINT_GRP_ALLOC"}, {0x0100, "HINT_GOAL_ONLY"}, - {0x0200, "HINT_TRY_GOAL"}, {0x0400, "DELALLOC_RESV"}, {0x0800, "STREAM_ALLOC"}, - {0x1000, "USE_ROOT_BLKS"}, {0x2000, "USE_RESV"}, {0x4000, "STRICT_CHECK"}), - msg.len(), msg.logical(), msg.goal(), msg.lleft(), msg.lright(), msg.pleft(), msg.pright()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_request_blocks) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_request_blocks) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_request_inode, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_request_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_request_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_request_inode: dev %d,%d dir %" PRIu64 " mode 0%o", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.dir(), - msg.mode()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_request_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_request_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_sync_file_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_sync_file_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_sync_file_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_sync_file_enter: dev %d,%d ino %" PRIu64 " parent %" PRIu64 " datasync %d ", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.parent(), msg.datasync()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_sync_file_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_sync_file_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_sync_file_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_sync_file_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_sync_file_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_sync_file_exit: dev %d,%d ino %" PRIu64 " ret %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_sync_file_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_sync_file_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_sync_fs, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_sync_fs_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_sync_fs_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_sync_fs: dev %d,%d wait %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.wait()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_sync_fs) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_sync_fs) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_trim_all_free, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_trim_all_free_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_trim_all_free_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_trim_all_free: dev %d,%d group %u, start %d, len %d", - msg.dev_major(), msg.dev_minor(), msg.group(), msg.start(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_trim_all_free) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_trim_all_free) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_trim_extent, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_trim_extent_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_trim_extent_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_trim_extent: dev %d,%d group %u, start %d, len %d", - msg.dev_major(), msg.dev_minor(), msg.group(), msg.start(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_trim_extent) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_trim_extent) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_truncate_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_truncate_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_truncate_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_truncate_enter: dev %d,%d ino %" PRIu64 " blocks %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.blocks()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_truncate_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_truncate_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_truncate_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_truncate_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_truncate_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_truncate_exit: dev %d,%d ino %" PRIu64 " blocks %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.blocks()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_truncate_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_truncate_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_unlink_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_unlink_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_unlink_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_unlink_enter: dev %d,%d ino %" PRIu64 " size %" PRIu64 " parent %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.size(), msg.parent()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_unlink_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_unlink_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_unlink_exit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_unlink_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_unlink_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ext4_unlink_exit: dev %d,%d ino %" PRIu64 " ret %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_unlink_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_unlink_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_write_begin, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_write_begin_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_write_begin_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_write_begin: dev %d,%d ino %" PRIu64 " pos %" PRIu64 " len %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.pos(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_write_begin) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_write_begin) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_write_end, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_write_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_write_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_write_end: dev %d,%d ino %" PRIu64 " pos %" PRIu64 " len %u copied %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.pos(), msg.len(), msg.copied()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_write_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_write_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_writepages, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_writepages_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_writepages_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_writepages: dev %d,%d ino %" PRIu64 " nr_to_write %" PRIu64 " pages_skipped %" PRIu64 - " range_start %" PRIu64 " range_end %" PRIu64 - " sync_mode %d for_kupdate %d range_cyclic %d writeback_index %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.nr_to_write(), msg.pages_skipped(), msg.range_start(), msg.range_end(), - msg.sync_mode(), msg.for_kupdate(), msg.range_cyclic(), msg.writeback_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_writepages) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_writepages) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_writepages_result, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_writepages_result_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_writepages_result_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_writepages_result: dev %d,%d ino %" PRIu64 - " ret %d pages_written %d pages_skipped %" PRIu64 " sync_mode %d writeback_index %" PRIu64 "", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.ret(), msg.pages_written(), msg.pages_skipped(), msg.sync_mode(), msg.writeback_index()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(ext4_writepages_result) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_writepages_result) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ext4_zero_range, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ext4_zero_range_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ext4_zero_range_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "ext4_zero_range: dev %d,%d ino %" PRIu64 " offset %" PRIu64 " len %" PRIu64 " mode %s", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.offset(), msg.len(), - __print_flags(msg.mode(), "|", {0x01, "KEEP_SIZE"}, {0x02, "PUNCH_HOLE"}, - {0x04, "NO_HIDE_STALE"}, {0x08, "COLLAPSE_RANGE"}, {0x10, "ZERO_RANGE"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(ext4_zero_range) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ext4_zero_range) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_f2fs_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_f2fs_event_formatter.cpp deleted file mode 100644 index 275bf895c..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_f2fs_event_formatter.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "f2fs.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - f2fs_sync_file_enter, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_f2fs_sync_file_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.f2fs_sync_file_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "f2fs_sync_file_enter: dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%x, i_size = %" PRIu64 - ", i_nlink = %u, i_blocks = %" PRIu64 ", i_advise = 0x%x", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - (unsigned long)msg.ino(), (unsigned long)msg.pino(), msg.mode(), msg.size(), - (unsigned int)msg.nlink(), msg.blocks(), (unsigned char)msg.advise()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(f2fs_sync_file_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(f2fs_sync_file_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - f2fs_sync_file_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_f2fs_sync_file_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.f2fs_sync_file_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "f2fs_sync_file_exit: dev = (%d,%d), ino = %lu, cp_reason: %s, datasync = %d, ret = %d", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - (unsigned long)msg.ino(), - __print_symbolic(msg.cp_reason(), {CP_NO_NEEDED, "no needed"}, {CP_NON_REGULAR, "non regular"}, - {CP_COMPRESSED, "compressed"}, {CP_HARDLINK, "hardlink"}, {CP_SB_NEED_CP, "sb needs cp"}, - {CP_WRONG_PINO, "wrong pino"}, {CP_NO_SPC_ROLL, "no space roll forward"}, - {CP_NODE_NEED_CP, "node needs cp"}, {CP_FASTBOOT_MODE, "fastboot mode"}, - {CP_SPEC_LOG_NUM, "log type is 2"}, {CP_RECOVER_DIR, "dir needs recovery"}), - msg.datasync(), msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(f2fs_sync_file_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(f2fs_sync_file_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - f2fs_write_begin, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_f2fs_write_begin_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.f2fs_write_begin_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "f2fs_write_begin: dev = (%d,%d), ino = %lu, pos = %" PRIu64 ", len = %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - (unsigned long)msg.ino(), msg.pos(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(f2fs_write_begin) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(f2fs_write_begin) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - f2fs_write_end, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_f2fs_write_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.f2fs_write_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "f2fs_write_end: dev = (%d,%d), ino = %lu, pos = %" PRIu64 ", len = %u, copied = %u", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - (unsigned long)msg.ino(), msg.pos(), msg.len(), msg.copied()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(f2fs_write_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(f2fs_write_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filelock_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filelock_event_formatter.cpp deleted file mode 100644 index af6c1bcb5..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filelock_event_formatter.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - break_lease_block, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_break_lease_block_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.break_lease_block_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "break_lease_block: fl=%p dev=0x%x:0x%x ino=0x%" PRIx64 - " fl_blocker=%p fl_owner=%p fl_flags=%s fl_type=%s fl_break_time=%" PRIu64 " fl_downgrade_time=%" PRIu64 "", - msg.fl(), ((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), - msg.i_ino(), msg.fl_next(), msg.fl_owner(), - __print_flags(msg.fl_flags(), "|", {1, "FL_POSIX"}, {2, "FL_FLOCK"}, {4, "FL_DELEG"}, {8, "FL_ACCESS"}, - {16, "FL_EXISTS"}, {32, "FL_LEASE"}, {64, "FL_CLOSE"}, {128, "FL_SLEEP"}, - {256, "FL_DOWNGRADE_PENDING"}, {512, "FL_UNLOCK_PENDING"}, {1024, "FL_OFDLCK"}), - __print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(), - msg.fl_downgrade_time()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(break_lease_block) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(break_lease_block) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - break_lease_noblock, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_break_lease_noblock_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.break_lease_noblock_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "break_lease_noblock: fl=%p dev=0x%x:0x%x ino=0x%" PRIx64 - " fl_blocker=%p fl_owner=%p fl_flags=%s fl_type=%s fl_break_time=%" PRIu64 " fl_downgrade_time=%" PRIu64 "", - msg.fl(), ((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), - msg.i_ino(), msg.fl_next(), msg.fl_owner(), - __print_flags(msg.fl_flags(), "|", {1, "FL_POSIX"}, {2, "FL_FLOCK"}, {4, "FL_DELEG"}, {8, "FL_ACCESS"}, - {16, "FL_EXISTS"}, {32, "FL_LEASE"}, {64, "FL_CLOSE"}, {128, "FL_SLEEP"}, - {256, "FL_DOWNGRADE_PENDING"}, {512, "FL_UNLOCK_PENDING"}, {1024, "FL_OFDLCK"}), - __print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(), - msg.fl_downgrade_time()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(break_lease_noblock) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(break_lease_noblock) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - break_lease_unblock, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_break_lease_unblock_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.break_lease_unblock_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "break_lease_unblock: fl=%p dev=0x%x:0x%x ino=0x%" PRIx64 - " fl_blocker=%p fl_owner=%p fl_flags=%s fl_type=%s fl_break_time=%" PRIu64 " fl_downgrade_time=%" PRIu64 "", - msg.fl(), ((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), - msg.i_ino(), msg.fl_next(), msg.fl_owner(), - __print_flags(msg.fl_flags(), "|", {1, "FL_POSIX"}, {2, "FL_FLOCK"}, {4, "FL_DELEG"}, {8, "FL_ACCESS"}, - {16, "FL_EXISTS"}, {32, "FL_LEASE"}, {64, "FL_CLOSE"}, {128, "FL_SLEEP"}, - {256, "FL_DOWNGRADE_PENDING"}, {512, "FL_UNLOCK_PENDING"}, {1024, "FL_OFDLCK"}), - __print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(), - msg.fl_downgrade_time()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(break_lease_unblock) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(break_lease_unblock) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - generic_add_lease, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_generic_add_lease_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.generic_add_lease_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "generic_add_lease: dev=0x%x:0x%x ino=0x%" PRIx64 - " wcount=%d rcount=%d icount=%d fl_owner=%p fl_flags=%s fl_type=%s", - ((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(), - msg.wcount(), msg.dcount(), msg.icount(), msg.fl_owner(), - __print_flags(msg.fl_flags(), "|", {1, "FL_POSIX"}, {2, "FL_FLOCK"}, {4, "FL_DELEG"}, {8, "FL_ACCESS"}, - {16, "FL_EXISTS"}, {32, "FL_LEASE"}, {64, "FL_CLOSE"}, {128, "FL_SLEEP"}, - {256, "FL_DOWNGRADE_PENDING"}, {512, "FL_UNLOCK_PENDING"}, {1024, "FL_OFDLCK"}), - __print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(generic_add_lease) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(generic_add_lease) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - generic_delete_lease, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_generic_delete_lease_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.generic_delete_lease_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "generic_delete_lease: fl=%p dev=0x%x:0x%x ino=0x%" PRIx64 - " fl_blocker=%p fl_owner=%p fl_flags=%s fl_type=%s fl_break_time=%" PRIu64 " fl_downgrade_time=%" PRIu64 "", - msg.fl(), ((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), - msg.i_ino(), msg.fl_next(), msg.fl_owner(), - __print_flags(msg.fl_flags(), "|", {1, "FL_POSIX"}, {2, "FL_FLOCK"}, {4, "FL_DELEG"}, {8, "FL_ACCESS"}, - {16, "FL_EXISTS"}, {32, "FL_LEASE"}, {64, "FL_CLOSE"}, {128, "FL_SLEEP"}, - {256, "FL_DOWNGRADE_PENDING"}, {512, "FL_UNLOCK_PENDING"}, {1024, "FL_OFDLCK"}), - __print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(), - msg.fl_downgrade_time()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(generic_delete_lease) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(generic_delete_lease) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - time_out_leases, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_time_out_leases_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.time_out_leases_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "time_out_leases: fl=%p dev=0x%x:0x%x ino=0x%" PRIx64 - " fl_blocker=%p fl_owner=%p fl_flags=%s fl_type=%s fl_break_time=%" PRIu64 " fl_downgrade_time=%" PRIu64 "", - msg.fl(), ((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), - msg.i_ino(), msg.fl_next(), msg.fl_owner(), - __print_flags(msg.fl_flags(), "|", {1, "FL_POSIX"}, {2, "FL_FLOCK"}, {4, "FL_DELEG"}, {8, "FL_ACCESS"}, - {16, "FL_EXISTS"}, {32, "FL_LEASE"}, {64, "FL_CLOSE"}, {128, "FL_SLEEP"}, - {256, "FL_DOWNGRADE_PENDING"}, {512, "FL_UNLOCK_PENDING"}, {1024, "FL_OFDLCK"}), - __print_symbolic(msg.fl_type(), {0, "F_RDLCK"}, {1, "F_WRLCK"}, {2, "F_UNLCK"}), msg.fl_break_time(), - msg.fl_downgrade_time()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(time_out_leases) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(time_out_leases) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filemap_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filemap_event_formatter.cpp deleted file mode 100644 index 5d5e30a36..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_filemap_event_formatter.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - file_check_and_advance_wb_err, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_file_check_and_advance_wb_err_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.file_check_and_advance_wb_err_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "file_check_and_advance_wb_err: file=%p dev=%d:%d ino=0x%" PRIx64 " old=0x%x new=0x%x", - msg.file(), ((unsigned int)((msg.s_dev()) >> 20)), - ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(), msg.old(), msg.seq_new()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(file_check_and_advance_wb_err) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(file_check_and_advance_wb_err) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - filemap_set_wb_err, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_filemap_set_wb_err_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.filemap_set_wb_err_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "filemap_set_wb_err: dev=%d:%d ino=0x%" PRIx64 " errseq=0x%x", - ((unsigned int)((msg.s_dev()) >> 20)), ((unsigned int)((msg.s_dev()) & ((1U << 20) - 1))), - msg.i_ino(), msg.errseq()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(filemap_set_wb_err) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(filemap_set_wb_err) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_filemap_add_to_page_cache, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_filemap_add_to_page_cache_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_filemap_add_to_page_cache_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_filemap_add_to_page_cache: dev %" PRIu64 ":%" PRIu64 " ino %p page=%s pfn=%" PRIu64 - " ofs=%" PRIu64 "", - (((msg.s_dev()) >> 20)), (((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(), - "0000000000000000", msg.pfn(), msg.index() << 12); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_filemap_add_to_page_cache) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_filemap_add_to_page_cache) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_filemap_delete_from_page_cache, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_filemap_delete_from_page_cache_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_filemap_delete_from_page_cache_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_filemap_delete_from_page_cache: dev %" PRIu64 ":%" PRIu64 - " ino %p page=%s pfn=%" PRIu64 " ofs=%" PRIu64 "", - (((msg.s_dev()) >> 20)), (((msg.s_dev()) & ((1U << 20) - 1))), msg.i_ino(), - "0000000000000000", msg.pfn(), msg.index() << 12); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_filemap_delete_from_page_cache) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_filemap_delete_from_page_cache) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ftrace_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ftrace_event_formatter.cpp deleted file mode 100644 index 1065110f5..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ftrace_event_formatter.cpp +++ /dev/null @@ -1,331 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - bputs, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_bputs_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.bputs_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.ip()) > 0) { - functionStr = kernelSymbols[msg.ip()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "bputs: %s: %s", functionStr.c_str(), - msg.str().c_str()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "bputs: %p: %s", (void*)msg.ip(), msg.str().c_str()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(bputs) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(bputs) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - branch, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_branch_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.branch_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "branch: %u:%s:%s (%u)%s", msg.line(), - msg.func().c_str(), msg.file().c_str(), msg.correct(), msg.constant() ? " CONSTANT" : ""); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(branch) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(branch) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - context_switch, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_context_switch_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.context_switch_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "context_switch: %u:%u:%u ==> %u:%u:%u [%03u]", - msg.prev_pid(), msg.prev_prio(), msg.prev_state(), msg.next_pid(), msg.next_prio(), - msg.next_state(), msg.next_cpu()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(context_switch) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(context_switch) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - funcgraph_entry, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_funcgraph_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.funcgraph_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.func()) > 0) { - functionStr = kernelSymbols[msg.func()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "funcgraph_entry: --> %s (%d)", functionStr.c_str(), - msg.depth()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "funcgraph_entry: --> %p (%d)", (void*)msg.func(), - msg.depth()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(funcgraph_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(funcgraph_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - funcgraph_exit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_funcgraph_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.funcgraph_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.func()) > 0) { - functionStr = kernelSymbols[msg.func()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "funcgraph_exit: <-- %s (%d) (start: %" PRIx64 " end: %" PRIx64 ") over: %d", - functionStr.c_str(), msg.depth(), msg.calltime(), msg.rettime(), msg.depth()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "funcgraph_exit: <-- %p (%d) (start: %" PRIx64 " end: %" PRIx64 ") over: %d", - (void*)msg.func(), msg.depth(), msg.calltime(), msg.rettime(), msg.depth()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(funcgraph_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(funcgraph_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - function, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_function_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.function_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.ip()) > 0) { - functionStr = kernelSymbols[msg.ip()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "function: %s <-- %s", functionStr.c_str(), - (void*)msg.parent_ip()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "function: %p <-- %p", (void*)msg.ip(), - (void*)msg.parent_ip()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(function) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(function) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - kernel_stack, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_kernel_stack_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.kernel_stack_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string kernelSymbolsStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.caller()[0]) > 0) { - kernelSymbolsStr = kernelSymbols[msg.caller()[0]]; - } - if (kernelSymbolsStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "kernel_stack: \t=> %s\n\t=> %s\n\t=> %s\n" - "\t=> %s\n\t=> %s\n\t=> %s\n" - "\t=> %s\n\t=> %s\n", - kernelSymbols[msg.caller()[0]].c_str(), kernelSymbols[msg.caller()[1]].c_str(), - kernelSymbols[msg.caller()[2]].c_str(), kernelSymbols[msg.caller()[3]].c_str(), - kernelSymbols[msg.caller()[4]].c_str(), kernelSymbols[msg.caller()[5]].c_str(), - kernelSymbols[msg.caller()[6]].c_str(), kernelSymbols[msg.caller()[7]].c_str()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "kernel_stack: \t=> %p\n\t=> %p\n\t=> %p\n" - "\t=> %p\n\t=> %p\n\t=> %p\n" - "\t=> %p\n\t=> %p\n", - (void*)msg.caller()[0], (void*)msg.caller()[1], (void*)msg.caller()[2], - (void*)msg.caller()[3], (void*)msg.caller()[4], (void*)msg.caller()[5], - (void*)msg.caller()[6], (void*)msg.caller()[7]); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(kernel_stack) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(kernel_stack) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mmiotrace_map, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mmiotrace_map_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mmiotrace_map_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mmiotrace_map: %" PRIx64 " %" PRIx64 " %" PRIx64 " %d %x", - msg.phys(), msg.virt(), msg.len(), msg.map_id(), msg.opcode()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mmiotrace_map) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mmiotrace_map) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mmiotrace_rw, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mmiotrace_rw_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mmiotrace_rw_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mmiotrace_rw: %" PRIx64 " %" PRIx64 " %" PRIx64 " %d %x %x", msg.phys(), msg.value(), - msg.pc(), msg.map_id(), msg.opcode(), msg.width()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mmiotrace_rw) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mmiotrace_rw) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - print, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_print_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.print_format(); - char buffer[BUFFER_SIZE] = {0}; - std::string fieldBuf = msg.buf(); - if (fieldBuf.size() > 1 && fieldBuf[fieldBuf.size() - 1] == '\n') { - fieldBuf = fieldBuf.substr(0, fieldBuf.size() - 1); - } - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "print: %s", fieldBuf.c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(print) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(print) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - user_stack, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_user_stack_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.user_stack_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string kernelSymbolsStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.caller()[0]) > 0) { - kernelSymbolsStr = kernelSymbols[msg.caller()[0]]; - } - if (kernelSymbolsStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "user_stack: \t=> %s\n\t=> %s\n\t=> %s\n" - "\t=> %s\n\t=> %s\n\t=> %s\n" - "\t=> %s\n\t=> %s\n", - kernelSymbols[msg.caller()[0]].c_str(), kernelSymbols[msg.caller()[1]].c_str(), - kernelSymbols[msg.caller()[2]].c_str(), kernelSymbols[msg.caller()[3]].c_str(), - kernelSymbols[msg.caller()[4]].c_str(), kernelSymbols[msg.caller()[5]].c_str(), - kernelSymbols[msg.caller()[6]].c_str(), kernelSymbols[msg.caller()[7]].c_str()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "user_stack: \t=> %p\n\t=> %p\n\t=> %p\n" - "\t=> %p\n\t=> %p\n\t=> %p\n" - "\t=> %p\n\t=> %p\n", - (void*)msg.caller()[0], (void*)msg.caller()[1], (void*)msg.caller()[2], - (void*)msg.caller()[3], (void*)msg.caller()[4], (void*)msg.caller()[5], - (void*)msg.caller()[6], (void*)msg.caller()[7]); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(user_stack) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(user_stack) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - wakeup, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_wakeup_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.wakeup_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "wakeup: %u:%u:%u ==+ %u:%u:%u [%03u]", - msg.prev_pid(), msg.prev_prio(), msg.prev_state(), msg.next_pid(), msg.next_prio(), - msg.next_state(), msg.next_cpu()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(wakeup) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(wakeup) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpio_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpio_event_formatter.cpp deleted file mode 100644 index 733a6f7e1..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpio_event_formatter.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - gpio_direction, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_gpio_direction_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.gpio_direction_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "gpio_direction: %u %3s (%d)", msg.gpio(), - msg.in() ? "in" : "out", msg.err()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(gpio_direction) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(gpio_direction) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - gpio_value, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_gpio_value_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.gpio_value_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "gpio_value: %u %3s %d", msg.gpio(), - msg.get() ? "get" : "set", msg.value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(gpio_value) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(gpio_value) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpu_mem_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpu_mem_event_formatter.cpp deleted file mode 100644 index 444dd7f92..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_gpu_mem_event_formatter.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - gpu_mem_total, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_gpu_mem_total_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.gpu_mem_total_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "gpu_mem_total: gpu_id=%u pid=%u size=%" PRIu64 "", - msg.gpu_id(), msg.pid(), msg.size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(gpu_mem_total) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of print event(gpu_mem_total) snprintf_s error!"); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_i2c_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_i2c_event_formatter.cpp deleted file mode 100644 index bc42034f1..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_i2c_event_formatter.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - i2c_read, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_i2c_read_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.i2c_read_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "i2c_read: i2c-%d #%u a=%03x f=%04x l=%u", - msg.adapter_nr(), msg.msg_nr(), msg.addr(), msg.flags(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_read) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(i2c_read) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - i2c_reply, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_i2c_reply_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.i2c_reply_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "i2c_reply: i2c-%d #%u a=%03x f=%04x l=%" PRId32 " [%" PRId32 "]", msg.adapter_nr(), - msg.msg_nr(), msg.addr(), msg.flags(), msg.len(), msg.buf()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_reply) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(i2c_reply) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - i2c_result, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_i2c_result_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.i2c_result_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "i2c_result: i2c-%d n=%u ret=%d", msg.adapter_nr(), - msg.nr_msgs(), msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_result) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(i2c_result) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - i2c_write, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_i2c_write_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.i2c_write_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "i2c_write: i2c-%d #%u a=%03x f=%04x l=%" PRId32 " [%" PRId32 "]", msg.adapter_nr(), - msg.msg_nr(), msg.addr(), msg.flags(), msg.len(), msg.buf()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(i2c_write) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(i2c_write) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ipi_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ipi_event_formatter.cpp deleted file mode 100644 index 64d65cc08..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_ipi_event_formatter.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - ipi_entry, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ipi_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ipi_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ipi_entry: (%s)", msg.reason().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ipi_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ipi_exit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ipi_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ipi_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ipi_exit: (%s)", msg.reason().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ipi_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - ipi_raise, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_ipi_raise_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.ipi_raise_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "ipi_raise: target_mask=%" PRIu64 " (%s)", - msg.target_cpus(), msg.reason().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(ipi_raise) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(ipi_raise) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_irq_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_irq_event_formatter.cpp deleted file mode 100644 index 7a78fde21..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_irq_event_formatter.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - irq_handler_entry, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_irq_handler_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.irq_handler_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "irq_handler_entry: irq=%d name=%s", msg.irq(), - msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(irq_handler_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(irq_handler_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - irq_handler_exit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_irq_handler_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.irq_handler_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "irq_handler_exit: irq=%d ret=%s", msg.irq(), - msg.ret() ? "handled" : "unhandled"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(irq_handler_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(irq_handler_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - softirq_entry, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_softirq_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.softirq_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "softirq_entry: vec=%u [action=%s]", msg.vec(), - __print_symbolic(msg.vec(), {0, "HI"}, {1, "TIMER"}, {2, "NET_TX"}, {3, "NET_RX"}, {4, "BLOCK"}, - {5, "IRQ_POLL"}, {6, "TASKLET"}, {7, "SCHED"}, {8, "HRTIMER"}, {9, "RCU"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(softirq_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(softirq_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - softirq_exit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_softirq_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.softirq_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "softirq_exit: vec=%u [action=%s]", msg.vec(), - __print_symbolic(msg.vec(), {0, "HI"}, {1, "TIMER"}, {2, "NET_TX"}, {3, "NET_RX"}, {4, "BLOCK"}, - {5, "IRQ_POLL"}, {6, "TASKLET"}, {7, "SCHED"}, {8, "HRTIMER"}, {9, "RCU"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(softirq_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(softirq_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - softirq_raise, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_softirq_raise_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.softirq_raise_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "softirq_raise: vec=%u [action=%s]", msg.vec(), - __print_symbolic(msg.vec(), {0, "HI"}, {1, "TIMER"}, {2, "NET_TX"}, {3, "NET_RX"}, {4, "BLOCK"}, - {5, "IRQ_POLL"}, {6, "TASKLET"}, {7, "SCHED"}, {8, "HRTIMER"}, {9, "RCU"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(softirq_raise) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(softirq_raise) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_kmem_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_kmem_event_formatter.cpp deleted file mode 100644 index c7ffc3b40..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_kmem_event_formatter.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" -#include "type.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - kfree, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_kfree_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.kfree_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "kfree: call_site=%p ptr=%p", msg.call_site(), msg.ptr()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(kfree) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(kfree) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - kmalloc, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_kmalloc_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.kmalloc_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "kmalloc: call_site=%p ptr=%p bytes_req=%" PRIu64 " bytes_alloc=%" PRIu64 - " gfp_flags=%s node=%d accounted=%s", - msg.call_site(), msg.ptr(), msg.bytes_req(), msg.bytes_alloc(), - (msg.gfp_flags()) - ? __print_flags( - msg.gfp_flags(), "|", - {(unsigned long)((((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))) | - ((gfp_t)0x400u)), - "GFP_TRANSHUGE"}, - {(unsigned long)(((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))), - "GFP_TRANSHUGE_LIGHT"}, - {(unsigned long)(((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)), - "GFP_HIGHUSER_MOVABLE"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)), - "GFP_HIGHUSER"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)), - "GFP_USER"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | - ((gfp_t)0x400000u)), - "GFP_KERNEL_ACCOUNT"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)), "GFP_KERNEL"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u)), "GFP_NOFS"}, - {(unsigned long)(((gfp_t)0x20u) | ((gfp_t)0x800u)), "GFP_ATOMIC"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u))), "GFP_NOIO"}, - {(unsigned long)(((gfp_t)0x800u)), "GFP_NOWAIT"}, {(unsigned long)((gfp_t)0x01u), "GFP_DMA"}, - {(unsigned long)((gfp_t)0x02u), "__GFP_HIGHMEM"}, {(unsigned long)((gfp_t)0x04u), "GFP_DMA32"}, - {(unsigned long)((gfp_t)0x20u), "__GFP_HIGH"}, {(unsigned long)((gfp_t)0x40u), "__GFP_IO"}, - {(unsigned long)((gfp_t)0x80u), "__GFP_FS"}, {(unsigned long)((gfp_t)0x2000u), "__GFP_NOWARN"}, - {(unsigned long)((gfp_t)0x4000u), "__GFP_RETRY_MAYFAIL"}, - {(unsigned long)((gfp_t)0x8000u), "__GFP_NOFAIL"}, - {(unsigned long)((gfp_t)0x10000u), "__GFP_NORETRY"}, - {(unsigned long)((gfp_t)0x40000u), "__GFP_COMP"}, {(unsigned long)((gfp_t)0x100u), "__GFP_ZERO"}, - {(unsigned long)((gfp_t)0x80000u), "__GFP_NOMEMALLOC"}, - {(unsigned long)((gfp_t)0x20000u), "__GFP_MEMALLOC"}, - {(unsigned long)((gfp_t)0x100000u), "__GFP_HARDWALL"}, - {(unsigned long)((gfp_t)0x200000u), "__GFP_THISNODE"}, - {(unsigned long)((gfp_t)0x10u), "__GFP_RECLAIMABLE"}, - {(unsigned long)((gfp_t)0x08u), "__GFP_MOVABLE"}, - {(unsigned long)((gfp_t)0x400000u), "__GFP_ACCOUNT"}, - {(unsigned long)((gfp_t)0x1000u), "__GFP_WRITE"}, - {(unsigned long)((gfp_t)(0x400u | 0x800u)), "__GFP_RECLAIM"}, - {(unsigned long)((gfp_t)0x400u), "__GFP_DIRECT_RECLAIM"}, - {(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"}, - {(unsigned long)((gfp_t)0x800000u), "__GFP_ZEROTAGS"}) - : "none", - msg.node(), (1 && (msg.gfp_flags() & (unsigned long)((gfp_t)0x400000u))) ? "true" : "false"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(kmalloc) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(kmalloc) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - kmem_cache_alloc, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_kmem_cache_alloc_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.kmem_cache_alloc_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "kmem_cache_alloc: call_site=%p ptr=%p bytes_req=%" PRIu64 " bytes_alloc=%" PRIu64 - " gfp_flags=%s node=%d accounted=%s", - msg.call_site(), msg.ptr(), msg.bytes_req(), msg.bytes_alloc(), - (msg.gfp_flags()) - ? __print_flags( - msg.gfp_flags(), "|", - {(unsigned long)((((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))) | - ((gfp_t)0x400u)), - "GFP_TRANSHUGE"}, - {(unsigned long)(((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))), - "GFP_TRANSHUGE_LIGHT"}, - {(unsigned long)(((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)), - "GFP_HIGHUSER_MOVABLE"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)), - "GFP_HIGHUSER"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)), - "GFP_USER"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | - ((gfp_t)0x400000u)), - "GFP_KERNEL_ACCOUNT"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)), "GFP_KERNEL"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u)), "GFP_NOFS"}, - {(unsigned long)(((gfp_t)0x20u) | ((gfp_t)0x800u)), "GFP_ATOMIC"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u))), "GFP_NOIO"}, - {(unsigned long)(((gfp_t)0x800u)), "GFP_NOWAIT"}, {(unsigned long)((gfp_t)0x01u), "GFP_DMA"}, - {(unsigned long)((gfp_t)0x02u), "__GFP_HIGHMEM"}, {(unsigned long)((gfp_t)0x04u), "GFP_DMA32"}, - {(unsigned long)((gfp_t)0x20u), "__GFP_HIGH"}, {(unsigned long)((gfp_t)0x40u), "__GFP_IO"}, - {(unsigned long)((gfp_t)0x80u), "__GFP_FS"}, {(unsigned long)((gfp_t)0x2000u), "__GFP_NOWARN"}, - {(unsigned long)((gfp_t)0x4000u), "__GFP_RETRY_MAYFAIL"}, - {(unsigned long)((gfp_t)0x8000u), "__GFP_NOFAIL"}, - {(unsigned long)((gfp_t)0x10000u), "__GFP_NORETRY"}, - {(unsigned long)((gfp_t)0x40000u), "__GFP_COMP"}, {(unsigned long)((gfp_t)0x100u), "__GFP_ZERO"}, - {(unsigned long)((gfp_t)0x80000u), "__GFP_NOMEMALLOC"}, - {(unsigned long)((gfp_t)0x20000u), "__GFP_MEMALLOC"}, - {(unsigned long)((gfp_t)0x100000u), "__GFP_HARDWALL"}, - {(unsigned long)((gfp_t)0x200000u), "__GFP_THISNODE"}, - {(unsigned long)((gfp_t)0x10u), "__GFP_RECLAIMABLE"}, - {(unsigned long)((gfp_t)0x08u), "__GFP_MOVABLE"}, - {(unsigned long)((gfp_t)0x400000u), "__GFP_ACCOUNT"}, - {(unsigned long)((gfp_t)0x1000u), "__GFP_WRITE"}, - {(unsigned long)((gfp_t)(0x400u | 0x800u)), "__GFP_RECLAIM"}, - {(unsigned long)((gfp_t)0x400u), "__GFP_DIRECT_RECLAIM"}, - {(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"}, - {(unsigned long)((gfp_t)0x800000u), "__GFP_ZEROTAGS"}) - : "none", - msg.node(), msg.accounted() ? "true" : "false"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(kmem_cache_alloc) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(kmem_cache_alloc) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - kmem_cache_free, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_kmem_cache_free_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.kmem_cache_free_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "kmem_cache_free: call_site=%p ptr=%p", - msg.call_site(), msg.ptr()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(kmem_cache_free) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(kmem_cache_free) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_page_alloc, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_page_alloc_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_page_alloc_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_page_alloc: page=%s pfn=0x%" PRIx64 " order=%d migratetype=%d gfp_flags=%s", "0000000000000000", - msg.pfn() != -1UL ? msg.pfn() : 0, msg.order(), msg.migratetype(), - (msg.gfp_flags()) - ? __print_flags( - msg.gfp_flags(), "|", - {(unsigned long)((((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))) | - ((gfp_t)0x400u)), - "GFP_TRANSHUGE"}, - {(unsigned long)(((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))), - "GFP_TRANSHUGE_LIGHT"}, - {(unsigned long)(((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)), - "GFP_HIGHUSER_MOVABLE"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)), - "GFP_HIGHUSER"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)), - "GFP_USER"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | - ((gfp_t)0x400000u)), - "GFP_KERNEL_ACCOUNT"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)), "GFP_KERNEL"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u)), "GFP_NOFS"}, - {(unsigned long)(((gfp_t)0x20u) | ((gfp_t)0x800u)), "GFP_ATOMIC"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u))), "GFP_NOIO"}, - {(unsigned long)(((gfp_t)0x800u)), "GFP_NOWAIT"}, {(unsigned long)((gfp_t)0x01u), "GFP_DMA"}, - {(unsigned long)((gfp_t)0x02u), "__GFP_HIGHMEM"}, {(unsigned long)((gfp_t)0x04u), "GFP_DMA32"}, - {(unsigned long)((gfp_t)0x20u), "__GFP_HIGH"}, {(unsigned long)((gfp_t)0x40u), "__GFP_IO"}, - {(unsigned long)((gfp_t)0x80u), "__GFP_FS"}, {(unsigned long)((gfp_t)0x2000u), "__GFP_NOWARN"}, - {(unsigned long)((gfp_t)0x4000u), "__GFP_RETRY_MAYFAIL"}, - {(unsigned long)((gfp_t)0x8000u), "__GFP_NOFAIL"}, - {(unsigned long)((gfp_t)0x10000u), "__GFP_NORETRY"}, - {(unsigned long)((gfp_t)0x40000u), "__GFP_COMP"}, {(unsigned long)((gfp_t)0x100u), "__GFP_ZERO"}, - {(unsigned long)((gfp_t)0x80000u), "__GFP_NOMEMALLOC"}, - {(unsigned long)((gfp_t)0x20000u), "__GFP_MEMALLOC"}, - {(unsigned long)((gfp_t)0x100000u), "__GFP_HARDWALL"}, - {(unsigned long)((gfp_t)0x200000u), "__GFP_THISNODE"}, - {(unsigned long)((gfp_t)0x10u), "__GFP_RECLAIMABLE"}, - {(unsigned long)((gfp_t)0x08u), "__GFP_MOVABLE"}, - {(unsigned long)((gfp_t)0x400000u), "__GFP_ACCOUNT"}, - {(unsigned long)((gfp_t)0x1000u), "__GFP_WRITE"}, - {(unsigned long)((gfp_t)(0x400u | 0x800u)), "__GFP_RECLAIM"}, - {(unsigned long)((gfp_t)0x400u), "__GFP_DIRECT_RECLAIM"}, - {(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"}, - {(unsigned long)((gfp_t)0x800000u), "__GFP_ZEROTAGS"}) - : "none"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_page_alloc) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_page_alloc) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_page_alloc_extfrag, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_page_alloc_extfrag_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_page_alloc_extfrag_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_page_alloc_extfrag: page=%s pfn=0x%" PRIx64 - " alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d " - "fallback_migratetype=%d fragmenting=%d change_ownership=%d", - "0000000000000000", msg.pfn(), msg.alloc_order(), msg.fallback_order(), 10, - msg.alloc_migratetype(), msg.fallback_migratetype(), msg.fallback_order() < 10, - msg.change_ownership()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(mm_page_alloc_extfrag) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_page_alloc_extfrag) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_page_alloc_zone_locked, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_page_alloc_zone_locked_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_page_alloc_zone_locked_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_page_alloc_zone_locked: page=%s pfn=0x%" PRIx64 " order=%u migratetype=%d percpu_refill=%d", - "0000000000000000", msg.pfn() != -1UL ? msg.pfn() : 0, msg.order(), msg.migratetype(), msg.percpu_refill()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_page_alloc_zone_locked) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_page_alloc_zone_locked) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_page_free, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_page_free_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_page_free_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_page_free: page=%s pfn=0x%" PRIx64 " order=%d", - "0000000000000000", msg.pfn(), msg.order()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_page_free) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_page_free) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_page_free_batched, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_page_free_batched_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_page_free_batched_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_page_free_batched: page=%s pfn=0x%" PRIx64 " order=0", "0000000000000000", msg.pfn()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_page_free_batched) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_page_free_batched) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_page_pcpu_drain, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_page_pcpu_drain_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_page_pcpu_drain_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_page_pcpu_drain: page=%s pfn=0x%" PRIx64 " order=%d migratetype=%d", - "0000000000000000", msg.pfn(), msg.order(), msg.migratetype()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_page_pcpu_drain) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_page_pcpu_drain) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rss_stat, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rss_stat_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rss_stat_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rss_stat: mm_id=%u curr=%d type=%s size=%" PRIu64 "B", msg.mm_id(), msg.curr(), - __print_symbolic(msg.member(), {0, "MM_FILEPAGES"}, {1, "MM_ANONPAGES"}, - {2, "MM_SWAPENTS"}, {3, "MM_SHMEMPAGES"}), - msg.size()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(rss_stat) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rss_stat) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_mmc_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_mmc_event_formatter.cpp deleted file mode 100644 index 98ebae717..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_mmc_event_formatter.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - mmc_request_done, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mmc_request_done_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mmc_request_done_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mmc_request_done: %s: end struct mmc_request[%p]: cmd_opcode=%u cmd_err=%d cmd_resp=0x%x 0x%x 0x%x 0x%x " - "cmd_retries=%u stop_opcode=%u stop_err=%d stop_resp=0x%x 0x%x 0x%x 0x%x stop_retries=%u sbc_opcode=%u " - "sbc_err=%d sbc_resp=0x%x 0x%x 0x%x 0x%x sbc_retries=%u bytes_xfered=%u data_err=%d tag=%d can_retune=%u " - "doing_retune=%u retune_now=%u need_retune=%d hold_retune=%d retune_period=%u", - msg.name().c_str(), msg.mrq(), msg.cmd_opcode(), msg.cmd_err(), msg.cmd_resp()[0], msg.cmd_resp()[1], - msg.cmd_resp()[2], msg.cmd_resp()[3], msg.cmd_retries(), msg.stop_opcode(), msg.stop_err(), - msg.stop_resp()[0], msg.stop_resp()[1], msg.stop_resp()[2], msg.stop_resp()[3], msg.stop_retries(), - msg.sbc_opcode(), msg.sbc_err(), msg.sbc_resp()[0], msg.sbc_resp()[1], msg.sbc_resp()[2], msg.sbc_resp()[3], - msg.sbc_retries(), msg.bytes_xfered(), msg.data_err(), msg.tag(), msg.can_retune(), msg.doing_retune(), - msg.retune_now(), msg.need_retune(), msg.hold_retune(), msg.retune_period()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mmc_request_done) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mmc_request_done) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mmc_request_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mmc_request_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mmc_request_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mmc_request_start: %s: start struct mmc_request[%p]: cmd_opcode=%u cmd_arg=0x%x cmd_flags=0x%x " - "cmd_retries=%u stop_opcode=%u stop_arg=0x%x stop_flags=0x%x stop_retries=%u sbc_opcode=%u sbc_arg=0x%x " - "sbc_flags=0x%x sbc_retires=%u blocks=%u block_size=%u blk_addr=%u data_flags=0x%x tag=%d can_retune=%u " - "doing_retune=%u retune_now=%u need_retune=%d hold_retune=%d retune_period=%u", - msg.name().c_str(), msg.mrq(), msg.cmd_opcode(), msg.cmd_arg(), msg.cmd_flags(), msg.cmd_retries(), - msg.stop_opcode(), msg.stop_arg(), msg.stop_flags(), msg.stop_retries(), msg.sbc_opcode(), msg.sbc_arg(), - msg.sbc_flags(), msg.sbc_retries(), msg.blocks(), msg.blksz(), msg.blk_addr(), msg.data_flags(), msg.tag(), - msg.can_retune(), msg.doing_retune(), msg.retune_now(), msg.need_retune(), msg.hold_retune(), - msg.retune_period()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mmc_request_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mmc_request_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_net_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_net_event_formatter.cpp deleted file mode 100644 index de585d267..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_net_event_formatter.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - napi_gro_frags_entry, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_napi_gro_frags_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.napi_gro_frags_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "napi_gro_frags_entry: dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x " - "vlan_tci=0x%04x protocol=0x%04x ip_summed=%d hash=0x%08x l4_hash=%d len=%u data_len=%u truesize=%u " - "mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x", - msg.name().c_str(), msg.napi_id(), msg.queue_mapping(), msg.skbaddr(), msg.vlan_tagged(), msg.vlan_proto(), - msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(), - msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(napi_gro_frags_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(napi_gro_frags_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - napi_gro_receive_entry, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_napi_gro_receive_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.napi_gro_receive_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "napi_gro_receive_entry: dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x " - "vlan_tci=0x%04x protocol=0x%04x ip_summed=%d hash=0x%08x l4_hash=%d len=%u data_len=%u truesize=%u " - "mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x", - msg.name().c_str(), msg.napi_id(), msg.queue_mapping(), msg.skbaddr(), msg.vlan_tagged(), msg.vlan_proto(), - msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(), - msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(napi_gro_receive_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(napi_gro_receive_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - net_dev_queue, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_net_dev_queue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.net_dev_queue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "net_dev_queue: dev=%s skbaddr=%p len=%u", - msg.name().c_str(), msg.skbaddr(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(net_dev_queue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(net_dev_queue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - net_dev_start_xmit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_net_dev_start_xmit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.net_dev_start_xmit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "net_dev_start_xmit: dev=%s queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x " - "vlan_tci=0x%04x protocol=0x%04x ip_summed=%d len=%u data_len=%u network_offset=%d " - "transport_offset_valid=%d transport_offset=%d tx_flags=%d gso_size=%d gso_segs=%d gso_type=%#x", - msg.name().c_str(), msg.queue_mapping(), msg.skbaddr(), msg.vlan_tagged(), msg.vlan_proto(), - msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.len(), msg.data_len(), msg.network_offset(), - msg.transport_offset_valid(), msg.transport_offset(), msg.tx_flags(), msg.gso_size(), - msg.gso_segs(), msg.gso_type()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(net_dev_start_xmit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(net_dev_start_xmit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - net_dev_xmit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_net_dev_xmit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.net_dev_xmit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "net_dev_xmit: dev=%s skbaddr=%p len=%u rc=%d", - msg.name().c_str(), msg.skbaddr(), msg.len(), msg.rc()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(net_dev_xmit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(net_dev_xmit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - netif_receive_skb, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_netif_receive_skb_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.netif_receive_skb_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "netif_receive_skb: dev=%s skbaddr=%p len=%u", - msg.name().c_str(), msg.skbaddr(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(netif_receive_skb) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(netif_receive_skb) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - netif_receive_skb_entry, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_netif_receive_skb_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.netif_receive_skb_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "netif_receive_skb_entry: dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x " - "vlan_tci=0x%04x protocol=0x%04x ip_summed=%d hash=0x%08x l4_hash=%d len=%u data_len=%u truesize=%u " - "mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x", - msg.name().c_str(), msg.napi_id(), msg.queue_mapping(), msg.skbaddr(), msg.vlan_tagged(), msg.vlan_proto(), - msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(), - msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(netif_receive_skb_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(netif_receive_skb_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - netif_rx, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_netif_rx_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.netif_rx_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "netif_rx: dev=%s skbaddr=%p len=%u", - msg.name().c_str(), msg.skbaddr(), msg.len()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(netif_rx) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(netif_rx) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - netif_rx_entry, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_netif_rx_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.netif_rx_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "netif_rx_entry: dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x " - "vlan_tci=0x%04x protocol=0x%04x ip_summed=%d hash=0x%08x l4_hash=%d len=%u data_len=%u truesize=%u " - "mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x", - msg.name().c_str(), msg.napi_id(), msg.queue_mapping(), msg.skbaddr(), msg.vlan_tagged(), msg.vlan_proto(), - msg.vlan_tci(), msg.protocol(), msg.ip_summed(), msg.hash(), msg.l4_hash(), msg.len(), msg.data_len(), - msg.truesize(), msg.mac_header_valid(), msg.mac_header(), msg.nr_frags(), msg.gso_size(), msg.gso_type()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(netif_rx_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(netif_rx_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_oom_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_oom_event_formatter.cpp deleted file mode 100644 index 76d6860f1..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_oom_event_formatter.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - oom_score_adj_update, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_oom_score_adj_update_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.oom_score_adj_update_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "oom_score_adj_update: pid=%d comm=%s oom_score_adj=%" PRId32 "", msg.pid(), - msg.comm().c_str(), msg.oom_score_adj()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(oom_score_adj_update) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(oom_score_adj_update) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_pagemap_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_pagemap_event_formatter.cpp deleted file mode 100644 index 9b7ec1a88..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_pagemap_event_formatter.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_lru_activate, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_lru_activate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_lru_activate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_lru_activate: folio=%p pfn=0x%" PRIx64 "", - msg.folio(), msg.pfn()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_lru_activate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_lru_activate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_lru_insertion, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_lru_insertion_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_lru_insertion_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_lru_insertion: folio=%p pfn=0x%" PRIx64 " lru=%d flags=%s%s%s%s%s%s", msg.folio(), - msg.pfn(), msg.lru(), msg.flags() & 0x0001u ? "M" : " ", msg.flags() & 0x0002u ? "a" : "f", - msg.flags() & 0x0008u ? "s" : " ", msg.flags() & 0x0010u ? "b" : " ", - msg.flags() & 0x0020u ? "d" : " ", msg.flags() & 0x0040u ? "B" : " "); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_lru_insertion) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_lru_insertion) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_power_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_power_event_formatter.cpp deleted file mode 100644 index 76cb2e20f..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_power_event_formatter.cpp +++ /dev/null @@ -1,444 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "pm_qos.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - clock_disable, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clock_disable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clock_disable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clock_disable: %s state=%lu cpu_id=%lu", - msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clock_disable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clock_disable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clock_enable, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clock_enable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clock_enable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clock_enable: %s state=%lu cpu_id=%lu", - msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clock_enable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clock_enable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - clock_set_rate, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_clock_set_rate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.clock_set_rate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "clock_set_rate: %s state=%lu cpu_id=%lu", - msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(clock_set_rate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(clock_set_rate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cpu_frequency, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cpu_frequency_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cpu_frequency_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpu_frequency: state=%lu cpu_id=%lu", - (unsigned long)msg.state(), (unsigned long)msg.cpu_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cpu_frequency) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cpu_frequency) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cpu_frequency_limits, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cpu_frequency_limits_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cpu_frequency_limits_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpu_frequency_limits: min=%lu max=%lu cpu_id=%lu", - (unsigned long)msg.min_freq(), (unsigned long)msg.max_freq(), (unsigned long)msg.cpu_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(cpu_frequency_limits) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cpu_frequency_limits) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - cpu_idle, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_cpu_idle_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.cpu_idle_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "cpu_idle: state=%lu cpu_id=%lu", - (unsigned long)msg.state(), (unsigned long)msg.cpu_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(cpu_idle) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(cpu_idle) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dev_pm_qos_add_request, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dev_pm_qos_add_request_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dev_pm_qos_add_request_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dev_pm_qos_add_request: device=%s type=%s new_value=%d", msg.name().c_str(), - __print_symbolic(msg.type(), {DEV_PM_QOS_RESUME_LATENCY, "DEV_PM_QOS_RESUME_LATENCY"}, - {DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS"}), - msg.new_value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(dev_pm_qos_add_request) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(dev_pm_qos_add_request) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dev_pm_qos_remove_request, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dev_pm_qos_remove_request_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dev_pm_qos_remove_request_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dev_pm_qos_remove_request: device=%s type=%s new_value=%d", msg.name().c_str(), - __print_symbolic(msg.type(), {DEV_PM_QOS_RESUME_LATENCY, "DEV_PM_QOS_RESUME_LATENCY"}, - {DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS"}), - msg.new_value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(dev_pm_qos_remove_request) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(dev_pm_qos_remove_request) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - dev_pm_qos_update_request, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_dev_pm_qos_update_request_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.dev_pm_qos_update_request_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "dev_pm_qos_update_request: device=%s type=%s new_value=%d", msg.name().c_str(), - __print_symbolic(msg.type(), {DEV_PM_QOS_RESUME_LATENCY, "DEV_PM_QOS_RESUME_LATENCY"}, - {DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS"}), - msg.new_value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(dev_pm_qos_update_request) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(dev_pm_qos_update_request) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - device_pm_callback_end, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_device_pm_callback_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.device_pm_callback_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "device_pm_callback_end: %s %s, err=%d", - msg.driver().c_str(), msg.device().c_str(), msg.error()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(device_pm_callback_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(device_pm_callback_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - device_pm_callback_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_device_pm_callback_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.device_pm_callback_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "device_pm_callback_start: %s %s, parent: %s, %s[%s]", - msg.driver().c_str(), msg.device().c_str(), msg.parent().c_str(), msg.pm_ops().c_str(), - __print_symbolic(msg.event(), {0x0002, "suspend"}, {0x0010, "resume"}, {0x0001, "freeze"}, - {0x0008, "quiesce"}, {0x0004, "hibernate"}, {0x0020, "thaw"}, - {0x0040, "restore"}, {0x0080, "recover"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(device_pm_callback_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(device_pm_callback_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - pm_qos_add_request, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_pm_qos_add_request_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.pm_qos_add_request_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "pm_qos_add_request: CPU_DMA_LATENCY value=%d", - msg.value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(pm_qos_add_request) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(pm_qos_add_request) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - pm_qos_remove_request, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_pm_qos_remove_request_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.pm_qos_remove_request_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "pm_qos_remove_request: CPU_DMA_LATENCY value=%d", - msg.value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(pm_qos_remove_request) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(pm_qos_remove_request) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - pm_qos_update_flags, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_pm_qos_update_flags_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.pm_qos_update_flags_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "pm_qos_update_flags: action=%s prev_value=0x%x curr_value=0x%x", - __print_symbolic(msg.action(), {PM_QOS_ADD_REQ, "ADD_REQ"}, - {PM_QOS_UPDATE_REQ, "UPDATE_REQ"}, {PM_QOS_REMOVE_REQ, "REMOVE_REQ"}), - msg.prev_value(), msg.curr_value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(pm_qos_update_flags) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(pm_qos_update_flags) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - pm_qos_update_request, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_pm_qos_update_request_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.pm_qos_update_request_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "pm_qos_update_request: CPU_DMA_LATENCY value=%d", - msg.value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(pm_qos_update_request) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(pm_qos_update_request) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - pm_qos_update_target, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_pm_qos_update_target_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.pm_qos_update_target_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "pm_qos_update_target: action=%s prev_value=%d curr_value=%d", - __print_symbolic(msg.action(), {PM_QOS_ADD_REQ, "ADD_REQ"}, - {PM_QOS_UPDATE_REQ, "UPDATE_REQ"}, {PM_QOS_REMOVE_REQ, "REMOVE_REQ"}), - msg.prev_value(), msg.curr_value()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(pm_qos_update_target) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(pm_qos_update_target) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - power_domain_target, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_power_domain_target_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.power_domain_target_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "power_domain_target: %s state=%lu cpu_id=%lu", - msg.name().c_str(), (unsigned long)msg.state(), (unsigned long)msg.cpu_id()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(power_domain_target) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(power_domain_target) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - pstate_sample, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_pstate_sample_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.pstate_sample_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "pstate_sample: core_busy=%lu scaled=%lu from=%lu to=%lu mperf=%" PRIu64 " aperf=%" PRIu64 - " tsc=%" PRIu64 " freq=%lu io_boost=%lu", - (unsigned long)msg.core_busy(), (unsigned long)msg.scaled_busy(), - (unsigned long)msg.from(), (unsigned long)msg.to(), msg.mperf(), msg.aperf(), msg.tsc(), - (unsigned long)msg.freq(), (unsigned long)msg.io_boost()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(pstate_sample) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(pstate_sample) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - suspend_resume, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_suspend_resume_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.suspend_resume_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "suspend_resume: %s[%u] %s", msg.action().c_str(), - (unsigned int)msg.val(), (msg.start()) ? "begin" : "end"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(suspend_resume) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(suspend_resume) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - wakeup_source_activate, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_wakeup_source_activate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.wakeup_source_activate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "wakeup_source_activate: %s state=0x%" PRIx64 "", - msg.name().c_str(), msg.state()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(wakeup_source_activate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(wakeup_source_activate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - wakeup_source_deactivate, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_wakeup_source_deactivate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.wakeup_source_deactivate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "wakeup_source_deactivate: %s state=0x%" PRIx64 "", - msg.name().c_str(), msg.state()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(wakeup_source_deactivate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(wakeup_source_deactivate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_printk_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_printk_event_formatter.cpp deleted file mode 100644 index e794c8788..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_printk_event_formatter.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - console, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_console_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.console_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "console: %s", msg.msg().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(console) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(console) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_raw_syscalls_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_raw_syscalls_event_formatter.cpp deleted file mode 100644 index c26f1bf91..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_raw_syscalls_event_formatter.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - sys_enter, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sys_enter_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sys_enter_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sys_enter: NR %" PRIu64 " (%" PRIx64 ", %" PRIx64 ", %" PRIx64 ", %" PRIx64 ", %" PRIx64 ", %" PRIx64 ")", - msg.id(), msg.args()[0], msg.args()[1], msg.args()[2], msg.args()[3], msg.args()[4], msg.args()[5]); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(sys_enter) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sys_enter) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sys_exit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sys_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sys_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sys_exit: NR %" PRIu64 " = %" PRIu64 "", msg.id(), - msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(sys_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sys_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_rcu_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_rcu_event_formatter.cpp deleted file mode 100644 index d8921fb40..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_rcu_event_formatter.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - rcu_utilization, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rcu_utilization_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rcu_utilization_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "rcu_utilization: %s", msg.s().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rcu_utilization) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rcu_utilization) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_regulator_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_regulator_event_formatter.cpp deleted file mode 100644 index de43ccec2..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_regulator_event_formatter.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_bypass_disable, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_bypass_disable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_bypass_disable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_disable: name=%s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(regulator_bypass_disable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(regulator_bypass_disable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_bypass_disable_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_bypass_disable_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_bypass_disable_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_disable_complete: name=%s", - msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(regulator_bypass_disable_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(regulator_bypass_disable_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_bypass_enable, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_bypass_enable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_bypass_enable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_enable: name=%s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(regulator_bypass_enable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(regulator_bypass_enable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_bypass_enable_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_bypass_enable_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_bypass_enable_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_bypass_enable_complete: name=%s", - msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(regulator_bypass_enable_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(regulator_bypass_enable_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_disable, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_disable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_disable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_disable: name=%s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(regulator_disable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(regulator_disable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_disable_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_disable_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_disable_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_disable_complete: name=%s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(regulator_disable_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(regulator_disable_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_enable, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_enable_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_enable_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_enable: name=%s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(regulator_enable) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(regulator_enable) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_enable_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_enable_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_enable_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_enable_complete: name=%s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(regulator_enable_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(regulator_enable_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_enable_delay, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_enable_delay_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_enable_delay_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_enable_delay: name=%s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(regulator_enable_delay) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(regulator_enable_delay) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_set_voltage, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_set_voltage_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_set_voltage_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_set_voltage: name=%s (%d-%d)", - msg.name().c_str(), (int)msg.min(), (int)msg.max()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(regulator_set_voltage) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(regulator_set_voltage) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - regulator_set_voltage_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_regulator_set_voltage_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.regulator_set_voltage_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "regulator_set_voltage_complete: name=%s, val=%u", - msg.name().c_str(), (int)msg.val()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(regulator_set_voltage_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(regulator_set_voltage_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sched_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sched_event_formatter.cpp deleted file mode 100644 index 8b284c79f..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sched_event_formatter.cpp +++ /dev/null @@ -1,495 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_kthread_stop, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_kthread_stop_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_kthread_stop_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_kthread_stop: comm=%s pid=%d", - msg.comm().c_str(), msg.pid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_kthread_stop) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_kthread_stop) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_kthread_stop_ret, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_kthread_stop_ret_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_kthread_stop_ret_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_kthread_stop_ret: ret=%d", msg.ret()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(sched_kthread_stop_ret) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_kthread_stop_ret) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_migrate_task, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_migrate_task_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_migrate_task_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_migrate_task: comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d", msg.comm().c_str(), - msg.pid(), msg.prio(), msg.orig_cpu(), msg.dest_cpu()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_migrate_task) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_migrate_task) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_move_numa, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_move_numa_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_move_numa_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_move_numa: pid=%d tgid=%d ngid=%d src_cpu=%d src_nid=%d dst_cpu=%d dst_nid=%d", msg.pid(), - msg.tgid(), msg.ngid(), msg.src_cpu(), msg.src_nid(), msg.dst_cpu(), msg.dst_nid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_move_numa) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_move_numa) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_pi_setprio, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_pi_setprio_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_pi_setprio_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_pi_setprio: comm=%s pid=%d oldprio=%d newprio=%d", - msg.comm().c_str(), msg.pid(), msg.oldprio(), msg.newprio()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_pi_setprio) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_pi_setprio) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_process_exec, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_process_exec_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_process_exec_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_exec: filename=%s pid=%d old_pid=%d", - msg.filename().c_str(), msg.pid(), msg.old_pid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_process_exec) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_process_exec) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_process_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_process_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_process_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_exit: comm=%s pid=%d prio=%d", - msg.comm().c_str(), msg.pid(), msg.prio()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_process_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_process_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_process_fork, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_process_fork_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_process_fork_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_process_fork: comm=%s pid=%d child_comm=%s child_pid=%d", msg.parent_comm().c_str(), - msg.parent_pid(), msg.child_comm().c_str(), msg.child_pid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_process_fork) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_process_fork) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_process_free, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_process_free_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_process_free_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_free: comm=%s pid=%d prio=%d", - msg.comm().c_str(), msg.pid(), msg.prio()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_process_free) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_process_free) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_process_wait, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_process_wait_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_process_wait_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_process_wait: comm=%s pid=%d prio=%d", - msg.comm().c_str(), msg.pid(), msg.prio()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_process_wait) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_process_wait) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_stat_blocked, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_stat_blocked_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_stat_blocked_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_stat_blocked: comm=%s pid=%d delay=%" PRIu64 " [ns]", msg.comm().c_str(), msg.pid(), - msg.delay()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_stat_blocked) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_stat_blocked) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_stat_iowait, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_stat_iowait_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_stat_iowait_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_stat_iowait: comm=%s pid=%d delay=%" PRIu64 " [ns]", - msg.comm().c_str(), msg.pid(), msg.delay()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_stat_iowait) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_stat_iowait) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_stat_runtime, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_stat_runtime_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_stat_runtime_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_stat_runtime: comm=%s pid=%d runtime=%" PRIu64 " [ns] vruntime=%" PRIu64 " [ns]", - msg.comm().c_str(), msg.pid(), msg.runtime(), msg.vruntime()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_stat_runtime) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_stat_runtime) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_stat_sleep, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_stat_sleep_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_stat_sleep_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_stat_sleep: comm=%s pid=%d delay=%" PRIu64 " [ns]", - msg.comm().c_str(), msg.pid(), msg.delay()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_stat_sleep) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_stat_sleep) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_stat_wait, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_stat_wait_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_stat_wait_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_stat_wait: comm=%s pid=%d delay=%" PRIu64 " [ns]", - msg.comm().c_str(), msg.pid(), msg.delay()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_stat_wait) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_stat_wait) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_stick_numa, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_stick_numa_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_stick_numa_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_stick_numa: src_pid=%d src_tgid=%d src_ngid=%d src_cpu=%d src_nid=%d dst_pid=%d " - "dst_tgid=%d dst_ngid=%d dst_cpu=%d dst_nid=%d", - msg.pid(), msg.tgid(), msg.ngid(), msg.src_cpu(), msg.src_nid(), msg.pid(), msg.tgid(), - msg.ngid(), msg.dst_cpu(), msg.dst_nid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_stick_numa) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_stick_numa) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_swap_numa, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_swap_numa_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_swap_numa_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_swap_numa: src_pid=%d src_tgid=%d src_ngid=%d src_cpu=%d src_nid=%d dst_pid=%d " - "dst_tgid=%d dst_ngid=%d dst_cpu=%d dst_nid=%d", - msg.src_pid(), msg.src_tgid(), msg.src_ngid(), msg.src_cpu(), msg.src_nid(), msg.dst_pid(), - msg.dst_tgid(), msg.dst_ngid(), msg.dst_cpu(), msg.dst_nid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_swap_numa) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_swap_numa) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_switch, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_switch_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_switch_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - if (msg.prev_state() > 0x0400) { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_switch: prev_comm=%s prev_pid=%d prev_prio=%d prev_state=? ==> next_comm=%s " - "next_pid=%d next_prio=%d", - msg.prev_comm().c_str(), msg.prev_pid(), msg.prev_prio(), msg.next_comm().c_str(), - msg.next_pid(), msg.next_prio()); - } else { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "sched_switch: prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s%s ==> next_comm=%s next_pid=%d " - "next_prio=%d", - msg.prev_comm().c_str(), msg.prev_pid(), msg.prev_prio(), - (msg.prev_state() & - ((((0x0000 | 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040) + 1) << 1) - 1)) - ? __print_flags( - msg.prev_state() & - ((((0x0000 | 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040) + 1) << 1) - - 1), - "|", {0x0001, "S"}, {0x0002, "D"}, {0x0004, "T"}, {0x0008, "t"}, {0x0010, "X"}, {0x0020, "Z"}, - {0x0040, "I"}, {0x0080, "K"}, {0x0100, "W"}, {0x0200, "P"}, {0x0400, "N"}) - : "R", - msg.prev_state() & (((0x0000 | 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040) + 1) << 1) - ? "+" - : "", - msg.next_comm().c_str(), msg.next_pid(), msg.next_prio()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_switch) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_switch) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_wait_task, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_wait_task_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_wait_task_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wait_task: comm=%s pid=%d prio=%d", - msg.comm().c_str(), msg.pid(), msg.prio()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_wait_task) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_wait_task) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_wake_idle_without_ipi, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_wake_idle_without_ipi_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_wake_idle_without_ipi_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wake_idle_without_ipi: cpu=%d", msg.cpu()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(sched_wake_idle_without_ipi) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(sched_wake_idle_without_ipi) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_wakeup, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_wakeup_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_wakeup_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wakeup: comm=%s pid=%d prio=%d target_cpu=%03d", - msg.comm().c_str(), msg.pid(), msg.prio(), msg.target_cpu()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_wakeup) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_wakeup) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_wakeup_new, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_wakeup_new_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_wakeup_new_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_wakeup_new: comm=%s pid=%d prio=%d target_cpu=%03d", - msg.comm().c_str(), msg.pid(), msg.prio(), msg.target_cpu()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_wakeup_new) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_wakeup_new) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - sched_waking, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_sched_waking_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.sched_waking_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_waking: comm=%s pid=%d prio=%d target_cpu=%03d", - msg.comm().c_str(), msg.pid(), msg.prio(), msg.target_cpu()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(sched_waking) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(sched_waking) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_signal_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_signal_event_formatter.cpp deleted file mode 100644 index 631e11d1f..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_signal_event_formatter.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - signal_deliver, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_signal_deliver_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.signal_deliver_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "signal_deliver: sig=%d errno=%d code=%d sa_handler=%" PRIx64 " sa_flags=%" PRIx64 "", - msg.sig(), msg.error_code(), msg.code(), msg.sig_handler(), msg.sig_flags()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(signal_deliver) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(signal_deliver) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - signal_generate, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_signal_generate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.signal_generate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "signal_generate: sig=%d errno=%d code=%d comm=%s pid=%d grp=%d res=%d", msg.sig(), - msg.error_code(), msg.code(), msg.comm().c_str(), msg.pid(), msg.group(), msg.result()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(signal_generate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(signal_generate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sunrpc_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sunrpc_event_formatter.cpp deleted file mode 100644 index f85c66679..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_sunrpc_event_formatter.cpp +++ /dev/null @@ -1,553 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_call_status, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_call_status_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_call_status_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "rpc_call_status: task:%08x@%08x status=%d", - msg.task_id(), msg.client_id(), msg.status()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_call_status) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_call_status) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_connect_status, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_connect_status_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_connect_status_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "rpc_connect_status: task:%08x@%08x status=%d", - msg.task_id(), msg.client_id(), msg.status()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_connect_status) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_connect_status) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_socket_close, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_socket_close_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_socket_close_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_socket_close: socket:[%" PRIu64 - "] srcaddr=%pISpc dstaddr=%pISpc state=%u (%s) sk_state=%u (%s)", - msg.ino(), msg.saddr(), msg.daddr(), msg.socket_state(), - __print_symbolic(msg.socket_state(), {0, "FREE"}, {1, "UNCONNECTED"}, {2, "CONNECTING"}, - {3, "CONNECTED"}, {4, "DISCONNECTING"}), - msg.sock_state(), - __print_symbolic(msg.sock_state(), {1, "ESTABLISHED"}, {2, "SYN_SENT"}, {3, "SYN_RECV"}, - {4, "FIN_WAIT1"}, {5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, - {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"}, {11, "CLOSING"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_socket_close) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_socket_close) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_socket_connect, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_socket_connect_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_socket_connect_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_socket_connect: error=%d socket:[%" PRIu64 - "] srcaddr=%pISpc dstaddr=%pISpc state=%u (%s) sk_state=%u (%s)", - msg.error(), msg.ino(), msg.saddr(), msg.daddr(), msg.socket_state(), - __print_symbolic(msg.socket_state(), {0, "FREE"}, {1, "UNCONNECTED"}, {2, "CONNECTING"}, - {3, "CONNECTED"}, {4, "DISCONNECTING"}), - msg.sock_state(), - __print_symbolic(msg.sock_state(), {1, "ESTABLISHED"}, {2, "SYN_SENT"}, {3, "SYN_RECV"}, - {4, "FIN_WAIT1"}, {5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, - {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"}, {11, "CLOSING"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_socket_connect) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_socket_connect) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_socket_error, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_socket_error_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_socket_error_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_socket_error: error=%d socket:[%" PRIu64 - "] srcaddr=%pISpc dstaddr=%pISpc state=%u (%s) sk_state=%u (%s)", - msg.error(), msg.ino(), msg.saddr(), msg.daddr(), msg.socket_state(), - __print_symbolic(msg.socket_state(), {0, "FREE"}, {1, "UNCONNECTED"}, {2, "CONNECTING"}, - {3, "CONNECTED"}, {4, "DISCONNECTING"}), - msg.sock_state(), - __print_symbolic(msg.sock_state(), {1, "ESTABLISHED"}, {2, "SYN_SENT"}, {3, "SYN_RECV"}, - {4, "FIN_WAIT1"}, {5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, - {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"}, {11, "CLOSING"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_socket_error) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_socket_error) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_socket_reset_connection, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_socket_reset_connection_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_socket_reset_connection_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_socket_reset_connection: error=%d socket:[%" PRIu64 - "] srcaddr=%pISpc dstaddr=%pISpc state=%u (%s) sk_state=%u (%s)", - msg.error(), msg.ino(), msg.saddr(), msg.daddr(), msg.socket_state(), - __print_symbolic(msg.socket_state(), {0, "FREE"}, {1, "UNCONNECTED"}, {2, "CONNECTING"}, - {3, "CONNECTED"}, {4, "DISCONNECTING"}), - msg.sock_state(), - __print_symbolic(msg.sock_state(), {1, "ESTABLISHED"}, {2, "SYN_SENT"}, {3, "SYN_RECV"}, - {4, "FIN_WAIT1"}, {5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, - {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"}, {11, "CLOSING"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(rpc_socket_reset_connection) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(rpc_socket_reset_connection) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_socket_shutdown, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_socket_shutdown_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_socket_shutdown_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_socket_shutdown: socket:[%" PRIu64 - "] srcaddr=%pISpc dstaddr=%pISpc state=%u (%s) sk_state=%u (%s)", - msg.ino(), msg.saddr(), msg.daddr(), msg.socket_state(), - __print_symbolic(msg.socket_state(), {0, "FREE"}, {1, "UNCONNECTED"}, {2, "CONNECTING"}, - {3, "CONNECTED"}, {4, "DISCONNECTING"}), - msg.sock_state(), - __print_symbolic(msg.sock_state(), {1, "ESTABLISHED"}, {2, "SYN_SENT"}, {3, "SYN_RECV"}, - {4, "FIN_WAIT1"}, {5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, - {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"}, {11, "CLOSING"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_socket_shutdown) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_socket_shutdown) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_socket_state_change, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_socket_state_change_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_socket_state_change_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_socket_state_change: socket:[%" PRIu64 - "] srcaddr=%pISpc dstaddr=%pISpc state=%u (%s) sk_state=%u (%s)", - msg.ino(), msg.saddr(), msg.daddr(), msg.socket_state(), - __print_symbolic(msg.socket_state(), {0, "FREE"}, {1, "UNCONNECTED"}, {2, "CONNECTING"}, - {3, "CONNECTED"}, {4, "DISCONNECTING"}), - msg.sock_state(), - __print_symbolic(msg.sock_state(), {1, "ESTABLISHED"}, {2, "SYN_SENT"}, {3, "SYN_RECV"}, - {4, "FIN_WAIT1"}, {5, "FIN_WAIT2"}, {6, "TIME_WAIT"}, {7, "CLOSE"}, - {8, "CLOSE_WAIT"}, {9, "LAST_ACK"}, {10, "LISTEN"}, {11, "CLOSING"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(rpc_socket_state_change) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_socket_state_change) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_task_begin, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_task_begin_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_task_begin_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.action()) > 0) { - functionStr = kernelSymbols[msg.action()]; - } - if (functionStr != "") { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_begin: task:%08x@%08x flags=%s runstate=%s status=%d action=%s", msg.task_id(), - msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, - {0x0100, "NO_ROUND_ROBIN"}, {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, - {0x1000, "TIMEOUT"}, {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, - {(1UL << 2), "ACTIVE"}, {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, - {(1UL << 5), "MSG_PIN_WAIT"}, {(1UL << 6), "SIGNALLED"}), - msg.status(), functionStr.c_str()); - } else { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_begin: task:%08x@%08x flags=%s runstate=%s status=%d action=%p", msg.task_id(), - msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, - {0x0100, "NO_ROUND_ROBIN"}, {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, - {0x1000, "TIMEOUT"}, {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, - {(1UL << 2), "ACTIVE"}, {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, - {(1UL << 5), "MSG_PIN_WAIT"}, {(1UL << 6), "SIGNALLED"}), - msg.status(), msg.action()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_task_begin) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_task_begin) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_task_complete, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_task_complete_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_task_complete_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.action()) > 0) { - functionStr = kernelSymbols[msg.action()]; - } - if (functionStr != "") { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_complete: task:%08x@%08x flags=%s runstate=%s status=%d action=%s", msg.task_id(), - msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, - {0x0100, "NO_ROUND_ROBIN"}, {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, - {0x1000, "TIMEOUT"}, {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, - {(1UL << 2), "ACTIVE"}, {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, - {(1UL << 5), "MSG_PIN_WAIT"}, {(1UL << 6), "SIGNALLED"}), - msg.status(), functionStr.c_str()); - } else { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_complete: task:%08x@%08x flags=%s runstate=%s status=%d action=%p", msg.task_id(), - msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, - {0x0100, "NO_ROUND_ROBIN"}, {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, - {0x1000, "TIMEOUT"}, {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, - {(1UL << 2), "ACTIVE"}, {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, - {(1UL << 5), "MSG_PIN_WAIT"}, {(1UL << 6), "SIGNALLED"}), - msg.status(), msg.action()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_task_complete) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_task_complete) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_task_run_action, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_task_run_action_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_task_run_action_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.action()) > 0) { - functionStr = kernelSymbols[msg.action()]; - } - if (functionStr != "") { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_run_action: task:%08x@%08x flags=%s runstate=%s status=%d action=%s", msg.task_id(), - msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, - {0x0100, "NO_ROUND_ROBIN"}, {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, - {0x1000, "TIMEOUT"}, {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, - {(1UL << 2), "ACTIVE"}, {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, - {(1UL << 5), "MSG_PIN_WAIT"}, {(1UL << 6), "SIGNALLED"}), - msg.status(), functionStr.c_str()); - } else { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_run_action: task:%08x@%08x flags=%s runstate=%s status=%d action=%p", msg.task_id(), - msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, - {0x0100, "NO_ROUND_ROBIN"}, {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, - {0x1000, "TIMEOUT"}, {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, - {(1UL << 2), "ACTIVE"}, {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, - {(1UL << 5), "MSG_PIN_WAIT"}, {(1UL << 6), "SIGNALLED"}), - msg.status(), msg.action()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_task_run_action) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_task_run_action) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_task_sleep, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_task_sleep_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_task_sleep_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_sleep: task:%08x@%08x flags=%s runstate=%s status=%d timeout=%" PRIu64 " queue=%s", msg.task_id(), - msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, {0x0100, "NO_ROUND_ROBIN"}, - {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, {0x1000, "TIMEOUT"}, - {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, {(1UL << 2), "ACTIVE"}, - {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, {(1UL << 5), "MSG_PIN_WAIT"}, - {(1UL << 6), "SIGNALLED"}), - msg.status(), msg.timeout(), msg.q_name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_task_sleep) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_task_sleep) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - rpc_task_wakeup, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_rpc_task_wakeup_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.rpc_task_wakeup_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "rpc_task_wakeup: task:%08x@%08x flags=%s runstate=%s status=%d timeout=%" PRIu64 " queue=%s", - msg.task_id(), msg.client_id(), - __print_flags(msg.flags(), "|", {0x0001, "ASYNC"}, {0x0002, "SWAPPER"}, {0x0004, "MOVEABLE"}, - {0x0010, "NULLCREDS"}, {0x0020, "MAJORSEEN"}, {0x0080, "DYNAMIC"}, {0x0100, "NO_ROUND_ROBIN"}, - {0x0200, "SOFT"}, {0x0400, "SOFTCONN"}, {0x0800, "SENT"}, {0x1000, "TIMEOUT"}, - {0x2000, "NOCONNECT"}, {0x4000, "NORTO"}, {0x8000, "CRED_NOREF"}), - __print_flags(msg.runstate(), "|", {(1UL << 0), "RUNNING"}, {(1UL << 1), "QUEUED"}, {(1UL << 2), "ACTIVE"}, - {(1UL << 3), "NEED_XMIT"}, {(1UL << 4), "NEED_RECV"}, {(1UL << 5), "MSG_PIN_WAIT"}, - {(1UL << 6), "SIGNALLED"}), - msg.status(), msg.timeout(), msg.q_name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(rpc_task_wakeup) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(rpc_task_wakeup) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - svc_process, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_svc_process_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.svc_process_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "svc_process: addr=%s xid=0x%08x service=%s vers=%u proc=%s", msg.addr().c_str(), - msg.xid(), msg.service().c_str(), msg.vers(), msg.procedure().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(svc_process) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(svc_process) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - svc_send, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_svc_send_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.svc_send_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "svc_send: xid=0x%08x server=%pISpc client=%pISpc status=%d flags=%s", - msg.xid(), __get_sockaddr(server), __get_sockaddr(client), msg.status(), - __print_flags(msg.flags(), "|", {((((1UL))) << (0)), "SECURE"}, {((((1UL))) << (1)), "LOCAL"}, - {((((1UL))) << (2)), "USEDEFERRAL"}, {((((1UL))) << (3)), "DROPME"}, - {((((1UL))) << (4)), "SPLICE_OK"}, {((((1UL))) << (5)), "VICTIM"}, - {((((1UL))) << (6)), "BUSY"}, {((((1UL))) << (7)), "DATA"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(svc_send) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(svc_send) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - svc_wake_up, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_svc_wake_up_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.svc_wake_up_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "svc_wake_up: pid=%d", msg.pid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(svc_wake_up) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(svc_wake_up) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - svc_xprt_dequeue, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_svc_xprt_dequeue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.svc_xprt_dequeue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "svc_xprt_dequeue: server=%pISpc client=%pISpc flags=%s wakeup-us=%" PRIu64 "", __get_sockaddr(server), - __get_sockaddr(client), - __print_flags(msg.flags(), "|", {((((1UL))) << (0)), "BUSY"}, {((((1UL))) << (1)), "CONN"}, - {((((1UL))) << (2)), "CLOSE"}, {((((1UL))) << (3)), "DATA"}, {((((1UL))) << (4)), "TEMP"}, - {((((1UL))) << (5)), "DEAD"}, {((((1UL))) << (6)), "CHNGBUF"}, - {((((1UL))) << (7)), "DEFERRED"}, {((((1UL))) << (8)), "OLD"}, - {((((1UL))) << (9)), "LISTENER"}, {((((1UL))) << (10)), "CACHE_AUTH"}, - {((((1UL))) << (11)), "LOCAL"}, {((((1UL))) << (12)), "KILL_TEMP"}, - {((((1UL))) << (13)), "CONG_CTRL"}, {((((1UL))) << (14)), "HANDSHAKE"}, - {((((1UL))) << (15)), "TLS_SESSION"}, {((((1UL))) << (16)), "PEER_AUTH"}), - msg.wakeup()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(svc_xprt_dequeue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(svc_xprt_dequeue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - xprt_lookup_rqst, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_xprt_lookup_rqst_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.xprt_lookup_rqst_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "xprt_lookup_rqst: peer=[%s]:%s xid=0x%08x status=%d", - msg.addr().c_str(), msg.port().c_str(), msg.xid(), msg.status()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(xprt_lookup_rqst) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(xprt_lookup_rqst) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - xprt_transmit, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_xprt_transmit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.xprt_transmit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "xprt_transmit: xid=0x%08x status=%d", msg.xid(), - msg.status()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(xprt_transmit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(xprt_transmit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_task_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_task_event_formatter.cpp deleted file mode 100644 index d1e09a6f7..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_task_event_formatter.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - task_newtask, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_task_newtask_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.task_newtask_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "task_newtask: pid=%d comm=%s clone_flags=%" PRIx64 " oom_score_adj=%d", msg.pid(), - msg.comm().c_str(), msg.clone_flags(), msg.oom_score_adj()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(task_newtask) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(task_newtask) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - task_rename, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_task_rename_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.task_rename_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "task_rename: pid=%d oldcomm=%s newcomm=%s oom_score_adj=%d", msg.pid(), - msg.oldcomm().c_str(), msg.newcomm().c_str(), msg.oom_score_adj()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(task_rename) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(task_rename) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_timer_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_timer_event_formatter.cpp deleted file mode 100644 index 4ac52b62e..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_timer_event_formatter.cpp +++ /dev/null @@ -1,326 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "hrtimer.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - hrtimer_cancel, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_hrtimer_cancel_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.hrtimer_cancel_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "hrtimer_cancel: hrtimer=%p", msg.hrtimer()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(hrtimer_cancel) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(hrtimer_cancel) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - hrtimer_expire_entry, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_hrtimer_expire_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.hrtimer_expire_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.function()) > 0) { - functionStr = kernelSymbols[msg.function()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "hrtimer_expire_entry: hrtimer=%p function=%s now=%" PRIu64 "", msg.hrtimer(), - functionStr.c_str(), msg.now()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "hrtimer_expire_entry: hrtimer=%p function=%p now=%" PRIu64 "", msg.hrtimer(), - msg.function(), msg.now()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(hrtimer_expire_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(hrtimer_expire_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - hrtimer_expire_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_hrtimer_expire_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.hrtimer_expire_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "hrtimer_expire_exit: hrtimer=%p", msg.hrtimer()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(hrtimer_expire_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(hrtimer_expire_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - hrtimer_init, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_hrtimer_init_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.hrtimer_init_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "hrtimer_init: hrtimer=%p clockid=%s mode=%s", msg.hrtimer(), - __print_symbolic(msg.clockid(), {0, "CLOCK_REALTIME"}, {1, "CLOCK_MONOTONIC"}, {7, "CLOCK_BOOTTIME"}, - {11, "CLOCK_TAI"}), - __print_symbolic(msg.mode(), {HRTIMER_MODE_ABS, "ABS"}, {HRTIMER_MODE_REL, "REL"}, - {HRTIMER_MODE_ABS_PINNED, "ABS|PINNED"}, {HRTIMER_MODE_REL_PINNED, "REL|PINNED"}, - {HRTIMER_MODE_ABS_SOFT, "ABS|SOFT"}, {HRTIMER_MODE_REL_SOFT, "REL|SOFT"}, - {HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT"}, - {HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT"}, {HRTIMER_MODE_ABS_HARD, "ABS|HARD"}, - {HRTIMER_MODE_REL_HARD, "REL|HARD"}, {HRTIMER_MODE_ABS_PINNED_HARD, "ABS|PINNED|HARD"}, - {HRTIMER_MODE_REL_PINNED_HARD, "REL|PINNED|HARD"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(hrtimer_init) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(hrtimer_init) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - hrtimer_start, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_hrtimer_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.hrtimer_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.function()) > 0) { - functionStr = kernelSymbols[msg.function()]; - } - if (functionStr != "") { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "hrtimer_start: hrtimer=%p function=%s expires=%" PRIu64 " softexpires=%" PRIu64 " mode=%s", - msg.hrtimer(), functionStr.c_str(), msg.expires(), msg.softexpires(), - __print_symbolic(msg.mode(), {HRTIMER_MODE_ABS, "ABS"}, {HRTIMER_MODE_REL, "REL"}, - {HRTIMER_MODE_ABS_PINNED, "ABS|PINNED"}, {HRTIMER_MODE_REL_PINNED, "REL|PINNED"}, - {HRTIMER_MODE_ABS_SOFT, "ABS|SOFT"}, {HRTIMER_MODE_REL_SOFT, "REL|SOFT"}, - {HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT"}, - {HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT"}, {HRTIMER_MODE_ABS_HARD, "ABS|HARD"}, - {HRTIMER_MODE_REL_HARD, "REL|HARD"}, {HRTIMER_MODE_ABS_PINNED_HARD, "ABS|PINNED|HARD"}, - {HRTIMER_MODE_REL_PINNED_HARD, "REL|PINNED|HARD"})); - } else { - len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "hrtimer_start: hrtimer=%p function=%p expires=%" PRIu64 " softexpires=%" PRIu64 " mode=%s", - msg.hrtimer(), msg.function(), msg.expires(), msg.softexpires(), - __print_symbolic(msg.mode(), {HRTIMER_MODE_ABS, "ABS"}, {HRTIMER_MODE_REL, "REL"}, - {HRTIMER_MODE_ABS_PINNED, "ABS|PINNED"}, {HRTIMER_MODE_REL_PINNED, "REL|PINNED"}, - {HRTIMER_MODE_ABS_SOFT, "ABS|SOFT"}, {HRTIMER_MODE_REL_SOFT, "REL|SOFT"}, - {HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT"}, - {HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT"}, {HRTIMER_MODE_ABS_HARD, "ABS|HARD"}, - {HRTIMER_MODE_REL_HARD, "REL|HARD"}, {HRTIMER_MODE_ABS_PINNED_HARD, "ABS|PINNED|HARD"}, - {HRTIMER_MODE_REL_PINNED_HARD, "REL|PINNED|HARD"})); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(hrtimer_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(hrtimer_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - itimer_expire, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_itimer_expire_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.itimer_expire_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "itimer_expire: which=%d pid=%d now=%" PRIu64 "", - msg.which(), (int)msg.pid(), msg.now()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(itimer_expire) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(itimer_expire) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - itimer_state, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_itimer_state_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.itimer_state_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "itimer_state: which=%d expires=%" PRIu64 " it_value=%" PRIu64 "it_interval=%" PRIu64 "", - msg.which(), msg.expires(), msg.value_sec(), msg.interval_sec()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(itimer_state) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(itimer_state) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - timer_cancel, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_timer_cancel_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.timer_cancel_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "timer_cancel: timer=%p", msg.timer()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(timer_cancel) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(timer_cancel) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - timer_expire_entry, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_timer_expire_entry_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.timer_expire_entry_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.function()) > 0) { - functionStr = kernelSymbols[msg.function()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "timer_expire_entry: timer=%p function=%s now=%" PRIu64 "", msg.timer(), - functionStr.c_str(), msg.now()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "timer_expire_entry: timer=%p function=%p now=%" PRIu64 "", msg.timer(), msg.function(), - msg.now()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(timer_expire_entry) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(timer_expire_entry) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - timer_expire_exit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_timer_expire_exit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.timer_expire_exit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "timer_expire_exit: timer=%p", msg.timer()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(timer_expire_exit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(timer_expire_exit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - timer_init, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_timer_init_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.timer_init_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "timer_init: timer=%p", msg.timer()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(timer_init) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(timer_init) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - timer_start, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_timer_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.timer_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.function()) > 0) { - functionStr = kernelSymbols[msg.function()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "timer_start: timer=%p function=%s expires=%" PRIu64 " [timeout=%" PRIu64 - "] cpu=%u idx=%u flags=%s", - msg.timer(), functionStr.c_str(), msg.expires(), msg.expires() - msg.now(), - msg.flags() & 0x0003FFFF, msg.flags() >> 22, - __print_flags(msg.flags() & (0x00040000 | 0x00080000 | 0x00100000 | 0x00200000), "|", - {0x00040000, "M"}, {0x00080000, "D"}, {0x00100000, "P"}, {0x00200000, "I"})); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "timer_start: timer=%p function=%p expires=%" PRIu64 " [timeout=%" PRIu64 - "] cpu=%u idx=%u flags=%s", - msg.timer(), msg.function(), msg.expires(), msg.expires() - msg.now(), - msg.flags() & 0x0003FFFF, msg.flags() >> 22, - __print_flags(msg.flags() & (0x00040000 | 0x00080000 | 0x00100000 | 0x00200000), "|", - {0x00040000, "M"}, {0x00080000, "D"}, {0x00100000, "P"}, {0x00200000, "I"})); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(timer_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(timer_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_v4l2_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_v4l2_event_formatter.cpp deleted file mode 100644 index f7c118376..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_v4l2_event_formatter.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - v4l2_dqbuf, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_v4l2_dqbuf_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.v4l2_dqbuf_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "v4l2_dqbuf: minor = %d, index = %u, type = %s, bytesused = %u, flags = %s, field = %s, timestamp = " - "%" PRIu64 - ", timecode = { type = %s, flags = %s, frames = %u, seconds = %u, minutes = %u, hours = %u, userbits = { " - "%u %u %u %u } }, sequence = %u", - msg.minor(), msg.index(), - __print_symbolic(msg.type(), {1, "VIDEO_CAPTURE"}, {2, "VIDEO_OUTPUT"}, {3, "VIDEO_OVERLAY"}, - {4, "VBI_CAPTURE"}, {5, "VBI_OUTPUT"}, {6, "SLICED_VBI_CAPTURE"}, {7, "SLICED_VBI_OUTPUT"}, - {8, "VIDEO_OUTPUT_OVERLAY"}, {9, "VIDEO_CAPTURE_MPLANE"}, {10, "VIDEO_OUTPUT_MPLANE"}, - {11, "SDR_CAPTURE"}, {12, "SDR_OUTPUT"}, {13, "META_CAPTURE"}, {128, "PRIVATE"}), - msg.bytesused(), - __print_flags(msg.flags(), "|", {0x00000001, "MAPPED"}, {0x00000002, "QUEUED"}, {0x00000004, "DONE"}, - {0x00000008, "KEYFRAME"}, {0x00000010, "PFRAME"}, {0x00000020, "BFRAME"}, - {0x00000040, "ERROR"}, {0x00000100, "TIMECODE"}, {0x00000400, "PREPARED"}, - {0x00000800, "NO_CACHE_INVALIDATE"}, {0x00001000, "NO_CACHE_CLEAN"}, - {0x0000e000, "TIMESTAMP_MASK"}, {0x00000000, "TIMESTAMP_UNKNOWN"}, - {0x00002000, "TIMESTAMP_MONOTONIC"}, {0x00004000, "TIMESTAMP_COPY"}, {0x00100000, "LAST"}), - __print_symbolic(msg.field(), {0, "ANY"}, {1, "NONE"}, {2, "TOP"}, {3, "BOTTOM"}, {4, "INTERLACED"}, - {5, "SEQ_TB"}, {6, "SEQ_BT"}, {7, "ALTERNATE"}, {8, "INTERLACED_TB"}, - {9, "INTERLACED_BT"}), - msg.timestamp(), - __print_symbolic(msg.timecode_type(), {1, "24FPS"}, {2, "25FPS"}, {3, "30FPS"}, {4, "50FPS"}, {5, "60FPS"}), - __print_flags(msg.timecode_flags(), "|", {0x0001, "DROPFRAME"}, {0x0002, "COLORFRAME"}, - {0x0000, "USERBITS_USERDEFINED"}, {0x0008, "USERBITS_8BITCHARS"}), - msg.timecode_frames(), msg.timecode_seconds(), msg.timecode_minutes(), msg.timecode_hours(), - msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(), - msg.sequence()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(v4l2_dqbuf) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(v4l2_dqbuf) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - v4l2_qbuf, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_v4l2_qbuf_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.v4l2_qbuf_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "v4l2_qbuf: minor = %d, index = %u, type = %s, bytesused = %u, flags = %s, field = %s, timestamp = %" PRIu64 - ", timecode = { type = %s, flags = %s, frames = %u, seconds = %u, minutes = %u, hours = %u, userbits = { " - "%u %u %u %u } }, sequence = %u", - msg.minor(), msg.index(), - __print_symbolic(msg.type(), {1, "VIDEO_CAPTURE"}, {2, "VIDEO_OUTPUT"}, {3, "VIDEO_OVERLAY"}, - {4, "VBI_CAPTURE"}, {5, "VBI_OUTPUT"}, {6, "SLICED_VBI_CAPTURE"}, {7, "SLICED_VBI_OUTPUT"}, - {8, "VIDEO_OUTPUT_OVERLAY"}, {9, "VIDEO_CAPTURE_MPLANE"}, {10, "VIDEO_OUTPUT_MPLANE"}, - {11, "SDR_CAPTURE"}, {12, "SDR_OUTPUT"}, {13, "META_CAPTURE"}, {128, "PRIVATE"}), - msg.bytesused(), - __print_flags(msg.flags(), "|", {0x00000001, "MAPPED"}, {0x00000002, "QUEUED"}, {0x00000004, "DONE"}, - {0x00000008, "KEYFRAME"}, {0x00000010, "PFRAME"}, {0x00000020, "BFRAME"}, - {0x00000040, "ERROR"}, {0x00000100, "TIMECODE"}, {0x00000400, "PREPARED"}, - {0x00000800, "NO_CACHE_INVALIDATE"}, {0x00001000, "NO_CACHE_CLEAN"}, - {0x0000e000, "TIMESTAMP_MASK"}, {0x00000000, "TIMESTAMP_UNKNOWN"}, - {0x00002000, "TIMESTAMP_MONOTONIC"}, {0x00004000, "TIMESTAMP_COPY"}, {0x00100000, "LAST"}), - __print_symbolic(msg.field(), {0, "ANY"}, {1, "NONE"}, {2, "TOP"}, {3, "BOTTOM"}, {4, "INTERLACED"}, - {5, "SEQ_TB"}, {6, "SEQ_BT"}, {7, "ALTERNATE"}, {8, "INTERLACED_TB"}, - {9, "INTERLACED_BT"}), - msg.timestamp(), - __print_symbolic(msg.timecode_type(), {1, "24FPS"}, {2, "25FPS"}, {3, "30FPS"}, {4, "50FPS"}, {5, "60FPS"}), - __print_flags(msg.timecode_flags(), "|", {0x0001, "DROPFRAME"}, {0x0002, "COLORFRAME"}, - {0x0000, "USERBITS_USERDEFINED"}, {0x0008, "USERBITS_8BITCHARS"}), - msg.timecode_frames(), msg.timecode_seconds(), msg.timecode_minutes(), msg.timecode_hours(), - msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(), - msg.sequence()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event(v4l2_qbuf) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(v4l2_qbuf) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - vb2_v4l2_buf_done, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_vb2_v4l2_buf_done_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.vb2_v4l2_buf_done_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "vb2_v4l2_buf_done: minor=%d flags = %s, field = %s, timestamp = %" PRIu64 - ", timecode = { type = %s, flags = %s, frames = %u, seconds = %u, minutes = %u, hours = %u, userbits = { " - "%u %u %u %u } }, sequence = %u", - msg.minor(), - __print_flags(msg.flags(), "|", {0x00000001, "MAPPED"}, {0x00000002, "QUEUED"}, {0x00000004, "DONE"}, - {0x00000008, "KEYFRAME"}, {0x00000010, "PFRAME"}, {0x00000020, "BFRAME"}, - {0x00000040, "ERROR"}, {0x00000100, "TIMECODE"}, {0x00000400, "PREPARED"}, - {0x00000800, "NO_CACHE_INVALIDATE"}, {0x00001000, "NO_CACHE_CLEAN"}, - {0x0000e000, "TIMESTAMP_MASK"}, {0x00000000, "TIMESTAMP_UNKNOWN"}, - {0x00002000, "TIMESTAMP_MONOTONIC"}, {0x00004000, "TIMESTAMP_COPY"}, {0x00100000, "LAST"}), - __print_symbolic(msg.field(), {0, "ANY"}, {1, "NONE"}, {2, "TOP"}, {3, "BOTTOM"}, {4, "INTERLACED"}, - {5, "SEQ_TB"}, {6, "SEQ_BT"}, {7, "ALTERNATE"}, {8, "INTERLACED_TB"}, - {9, "INTERLACED_BT"}), - msg.timestamp(), - __print_symbolic(msg.timecode_type(), {1, "24FPS"}, {2, "25FPS"}, {3, "30FPS"}, {4, "50FPS"}, {5, "60FPS"}), - __print_flags(msg.timecode_flags(), "|", {0x0001, "DROPFRAME"}, {0x0002, "COLORFRAME"}, - {0x0000, "USERBITS_USERDEFINED"}, {0x0008, "USERBITS_8BITCHARS"}), - msg.timecode_frames(), msg.timecode_seconds(), msg.timecode_minutes(), msg.timecode_hours(), - msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(), - msg.sequence()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(vb2_v4l2_buf_done) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(vb2_v4l2_buf_done) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - vb2_v4l2_buf_queue, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_vb2_v4l2_buf_queue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.vb2_v4l2_buf_queue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "vb2_v4l2_buf_queue: minor=%d flags = %s, field = %s, timestamp = %" PRIu64 - ", timecode = { type = %s, flags = %s, frames = %u, seconds = %u, minutes = %u, hours = %u, userbits = { " - "%u %u %u %u } }, sequence = %u", - msg.minor(), - __print_flags(msg.flags(), "|", {0x00000001, "MAPPED"}, {0x00000002, "QUEUED"}, {0x00000004, "DONE"}, - {0x00000008, "KEYFRAME"}, {0x00000010, "PFRAME"}, {0x00000020, "BFRAME"}, - {0x00000040, "ERROR"}, {0x00000100, "TIMECODE"}, {0x00000400, "PREPARED"}, - {0x00000800, "NO_CACHE_INVALIDATE"}, {0x00001000, "NO_CACHE_CLEAN"}, - {0x0000e000, "TIMESTAMP_MASK"}, {0x00000000, "TIMESTAMP_UNKNOWN"}, - {0x00002000, "TIMESTAMP_MONOTONIC"}, {0x00004000, "TIMESTAMP_COPY"}, {0x00100000, "LAST"}), - __print_symbolic(msg.field(), {0, "ANY"}, {1, "NONE"}, {2, "TOP"}, {3, "BOTTOM"}, {4, "INTERLACED"}, - {5, "SEQ_TB"}, {6, "SEQ_BT"}, {7, "ALTERNATE"}, {8, "INTERLACED_TB"}, - {9, "INTERLACED_BT"}), - msg.timestamp(), - __print_symbolic(msg.timecode_type(), {1, "24FPS"}, {2, "25FPS"}, {3, "30FPS"}, {4, "50FPS"}, {5, "60FPS"}), - __print_flags(msg.timecode_flags(), "|", {0x0001, "DROPFRAME"}, {0x0002, "COLORFRAME"}, - {0x0000, "USERBITS_USERDEFINED"}, {0x0008, "USERBITS_8BITCHARS"}), - msg.timecode_frames(), msg.timecode_seconds(), msg.timecode_minutes(), msg.timecode_hours(), - msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(), - msg.sequence()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(vb2_v4l2_buf_queue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(vb2_v4l2_buf_queue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - vb2_v4l2_dqbuf, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_vb2_v4l2_dqbuf_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.vb2_v4l2_dqbuf_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "vb2_v4l2_dqbuf: minor=%d flags = %s, field = %s, timestamp = %" PRIu64 - ", timecode = { type = %s, flags = %s, frames = %u, seconds = %u, minutes = %u, hours = %u, userbits = { " - "%u %u %u %u } }, sequence = %u", - msg.minor(), - __print_flags(msg.flags(), "|", {0x00000001, "MAPPED"}, {0x00000002, "QUEUED"}, {0x00000004, "DONE"}, - {0x00000008, "KEYFRAME"}, {0x00000010, "PFRAME"}, {0x00000020, "BFRAME"}, - {0x00000040, "ERROR"}, {0x00000100, "TIMECODE"}, {0x00000400, "PREPARED"}, - {0x00000800, "NO_CACHE_INVALIDATE"}, {0x00001000, "NO_CACHE_CLEAN"}, - {0x0000e000, "TIMESTAMP_MASK"}, {0x00000000, "TIMESTAMP_UNKNOWN"}, - {0x00002000, "TIMESTAMP_MONOTONIC"}, {0x00004000, "TIMESTAMP_COPY"}, {0x00100000, "LAST"}), - __print_symbolic(msg.field(), {0, "ANY"}, {1, "NONE"}, {2, "TOP"}, {3, "BOTTOM"}, {4, "INTERLACED"}, - {5, "SEQ_TB"}, {6, "SEQ_BT"}, {7, "ALTERNATE"}, {8, "INTERLACED_TB"}, - {9, "INTERLACED_BT"}), - msg.timestamp(), - __print_symbolic(msg.timecode_type(), {1, "24FPS"}, {2, "25FPS"}, {3, "30FPS"}, {4, "50FPS"}, {5, "60FPS"}), - __print_flags(msg.timecode_flags(), "|", {0x0001, "DROPFRAME"}, {0x0002, "COLORFRAME"}, - {0x0000, "USERBITS_USERDEFINED"}, {0x0008, "USERBITS_8BITCHARS"}), - msg.timecode_frames(), msg.timecode_seconds(), msg.timecode_minutes(), msg.timecode_hours(), - msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(), - msg.sequence()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(vb2_v4l2_dqbuf) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(vb2_v4l2_dqbuf) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - vb2_v4l2_qbuf, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_vb2_v4l2_qbuf_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.vb2_v4l2_qbuf_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "vb2_v4l2_qbuf: minor=%d flags = %s, field = %s, timestamp = %" PRIu64 - ", timecode = { type = %s, flags = %s, frames = %u, seconds = %u, minutes = %u, hours = %u, userbits = { " - "%u %u %u %u } }, sequence = %u", - msg.minor(), - __print_flags(msg.flags(), "|", {0x00000001, "MAPPED"}, {0x00000002, "QUEUED"}, {0x00000004, "DONE"}, - {0x00000008, "KEYFRAME"}, {0x00000010, "PFRAME"}, {0x00000020, "BFRAME"}, - {0x00000040, "ERROR"}, {0x00000100, "TIMECODE"}, {0x00000400, "PREPARED"}, - {0x00000800, "NO_CACHE_INVALIDATE"}, {0x00001000, "NO_CACHE_CLEAN"}, - {0x0000e000, "TIMESTAMP_MASK"}, {0x00000000, "TIMESTAMP_UNKNOWN"}, - {0x00002000, "TIMESTAMP_MONOTONIC"}, {0x00004000, "TIMESTAMP_COPY"}, {0x00100000, "LAST"}), - __print_symbolic(msg.field(), {0, "ANY"}, {1, "NONE"}, {2, "TOP"}, {3, "BOTTOM"}, {4, "INTERLACED"}, - {5, "SEQ_TB"}, {6, "SEQ_BT"}, {7, "ALTERNATE"}, {8, "INTERLACED_TB"}, - {9, "INTERLACED_BT"}), - msg.timestamp(), - __print_symbolic(msg.timecode_type(), {1, "24FPS"}, {2, "25FPS"}, {3, "30FPS"}, {4, "50FPS"}, {5, "60FPS"}), - __print_flags(msg.timecode_flags(), "|", {0x0001, "DROPFRAME"}, {0x0002, "COLORFRAME"}, - {0x0000, "USERBITS_USERDEFINED"}, {0x0008, "USERBITS_8BITCHARS"}), - msg.timecode_frames(), msg.timecode_seconds(), msg.timecode_minutes(), msg.timecode_hours(), - msg.timecode_userbits0(), msg.timecode_userbits1(), msg.timecode_userbits2(), msg.timecode_userbits3(), - msg.sequence()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(vb2_v4l2_qbuf) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(vb2_v4l2_qbuf) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_vmscan_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_vmscan_event_formatter.cpp deleted file mode 100644 index 8f16f6b4d..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_vmscan_event_formatter.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" -#include "type.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_shrink_slab_end, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_shrink_slab_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_shrink_slab_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_shrink_slab_end: %p %p: nid: %d unused scan count %" PRIu64 " new scan count %" PRIu64 - " total_scan %" PRIu64 " last shrinker return val %d", - msg.shrink(), msg.shr(), msg.nid(), msg.unused_scan(), msg.new_scan(), msg.total_scan(), - msg.retval()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_shrink_slab_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_shrink_slab_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_shrink_slab_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_shrink_slab_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_shrink_slab_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_shrink_slab_start: %p %p: nid: %d objects to shrink %" PRIu64 " gfp_flags %s cache items %" PRIu64 - " delta %" PRIu64 " total_scan %" PRIu64 " priority %d", - msg.shrink(), msg.shr(), msg.nid(), msg.nr_objects_to_shrink(), - (msg.gfp_flags()) - ? __print_flags( - msg.gfp_flags(), "|", - {(unsigned long)((((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))) | - ((gfp_t)0x400u)), - "GFP_TRANSHUGE"}, - {(unsigned long)(((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))), - "GFP_TRANSHUGE_LIGHT"}, - {(unsigned long)(((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)), - "GFP_HIGHUSER_MOVABLE"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)), - "GFP_HIGHUSER"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)), - "GFP_USER"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | - ((gfp_t)0x400000u)), - "GFP_KERNEL_ACCOUNT"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)), "GFP_KERNEL"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u)), "GFP_NOFS"}, - {(unsigned long)(((gfp_t)0x20u) | ((gfp_t)0x800u)), "GFP_ATOMIC"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u))), "GFP_NOIO"}, - {(unsigned long)(((gfp_t)0x800u)), "GFP_NOWAIT"}, {(unsigned long)((gfp_t)0x01u), "GFP_DMA"}, - {(unsigned long)((gfp_t)0x02u), "__GFP_HIGHMEM"}, {(unsigned long)((gfp_t)0x04u), "GFP_DMA32"}, - {(unsigned long)((gfp_t)0x20u), "__GFP_HIGH"}, {(unsigned long)((gfp_t)0x40u), "__GFP_IO"}, - {(unsigned long)((gfp_t)0x80u), "__GFP_FS"}, {(unsigned long)((gfp_t)0x2000u), "__GFP_NOWARN"}, - {(unsigned long)((gfp_t)0x4000u), "__GFP_RETRY_MAYFAIL"}, - {(unsigned long)((gfp_t)0x8000u), "__GFP_NOFAIL"}, - {(unsigned long)((gfp_t)0x10000u), "__GFP_NORETRY"}, - {(unsigned long)((gfp_t)0x40000u), "__GFP_COMP"}, {(unsigned long)((gfp_t)0x100u), "__GFP_ZERO"}, - {(unsigned long)((gfp_t)0x80000u), "__GFP_NOMEMALLOC"}, - {(unsigned long)((gfp_t)0x20000u), "__GFP_MEMALLOC"}, - {(unsigned long)((gfp_t)0x100000u), "__GFP_HARDWALL"}, - {(unsigned long)((gfp_t)0x200000u), "__GFP_THISNODE"}, - {(unsigned long)((gfp_t)0x10u), "__GFP_RECLAIMABLE"}, - {(unsigned long)((gfp_t)0x08u), "__GFP_MOVABLE"}, - {(unsigned long)((gfp_t)0x400000u), "__GFP_ACCOUNT"}, - {(unsigned long)((gfp_t)0x1000u), "__GFP_WRITE"}, - {(unsigned long)((gfp_t)(0x400u | 0x800u)), "__GFP_RECLAIM"}, - {(unsigned long)((gfp_t)0x400u), "__GFP_DIRECT_RECLAIM"}, - {(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"}, - {(unsigned long)((gfp_t)0x800000u), "__GFP_ZEROTAGS"}) - : "none", - msg.cache_items(), msg.delta(), msg.total_scan(), msg.priority()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(mm_shrink_slab_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_shrink_slab_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_vmscan_direct_reclaim_begin, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_vmscan_direct_reclaim_begin_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_vmscan_direct_reclaim_begin_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_vmscan_direct_reclaim_begin: order=%d gfp_flags=%s", msg.order(), - (msg.gfp_flags()) - ? __print_flags( - msg.gfp_flags(), "|", - {(unsigned long)((((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))) | - ((gfp_t)0x400u)), - "GFP_TRANSHUGE"}, - {(unsigned long)(((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))), - "GFP_TRANSHUGE_LIGHT"}, - {(unsigned long)(((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)), - "GFP_HIGHUSER_MOVABLE"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)), - "GFP_HIGHUSER"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)), - "GFP_USER"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | - ((gfp_t)0x400000u)), - "GFP_KERNEL_ACCOUNT"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)), "GFP_KERNEL"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u)), "GFP_NOFS"}, - {(unsigned long)(((gfp_t)0x20u) | ((gfp_t)0x800u)), "GFP_ATOMIC"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u))), "GFP_NOIO"}, - {(unsigned long)(((gfp_t)0x800u)), "GFP_NOWAIT"}, {(unsigned long)((gfp_t)0x01u), "GFP_DMA"}, - {(unsigned long)((gfp_t)0x02u), "__GFP_HIGHMEM"}, {(unsigned long)((gfp_t)0x04u), "GFP_DMA32"}, - {(unsigned long)((gfp_t)0x20u), "__GFP_HIGH"}, {(unsigned long)((gfp_t)0x40u), "__GFP_IO"}, - {(unsigned long)((gfp_t)0x80u), "__GFP_FS"}, {(unsigned long)((gfp_t)0x2000u), "__GFP_NOWARN"}, - {(unsigned long)((gfp_t)0x4000u), "__GFP_RETRY_MAYFAIL"}, - {(unsigned long)((gfp_t)0x8000u), "__GFP_NOFAIL"}, - {(unsigned long)((gfp_t)0x10000u), "__GFP_NORETRY"}, - {(unsigned long)((gfp_t)0x40000u), "__GFP_COMP"}, {(unsigned long)((gfp_t)0x100u), "__GFP_ZERO"}, - {(unsigned long)((gfp_t)0x80000u), "__GFP_NOMEMALLOC"}, - {(unsigned long)((gfp_t)0x20000u), "__GFP_MEMALLOC"}, - {(unsigned long)((gfp_t)0x100000u), "__GFP_HARDWALL"}, - {(unsigned long)((gfp_t)0x200000u), "__GFP_THISNODE"}, - {(unsigned long)((gfp_t)0x10u), "__GFP_RECLAIMABLE"}, - {(unsigned long)((gfp_t)0x08u), "__GFP_MOVABLE"}, - {(unsigned long)((gfp_t)0x400000u), "__GFP_ACCOUNT"}, - {(unsigned long)((gfp_t)0x1000u), "__GFP_WRITE"}, - {(unsigned long)((gfp_t)(0x400u | 0x800u)), "__GFP_RECLAIM"}, - {(unsigned long)((gfp_t)0x400u), "__GFP_DIRECT_RECLAIM"}, - {(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"}, - {(unsigned long)((gfp_t)0x800000u), "__GFP_ZEROTAGS"}) - : "none"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_vmscan_direct_reclaim_begin) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_vmscan_direct_reclaim_begin) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_vmscan_direct_reclaim_end, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_vmscan_direct_reclaim_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_vmscan_direct_reclaim_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_vmscan_direct_reclaim_end: nr_reclaimed=%" PRIu64 "", msg.nr_reclaimed()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_vmscan_direct_reclaim_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_vmscan_direct_reclaim_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_vmscan_kswapd_sleep, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_vmscan_kswapd_sleep_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_vmscan_kswapd_sleep_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_vmscan_kswapd_sleep: nid=%d", msg.nid()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(mm_vmscan_kswapd_sleep) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_vmscan_kswapd_sleep) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_vmscan_kswapd_wake, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_vmscan_kswapd_wake_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_vmscan_kswapd_wake_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_vmscan_kswapd_wake: nid=%d order=%d", msg.nid(), - msg.order()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(mm_vmscan_kswapd_wake) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_vmscan_kswapd_wake) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_vmscan_lru_isolate, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_vmscan_lru_isolate_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_vmscan_lru_isolate_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_vmscan_lru_isolate: isolate_mode=%d classzone=%d order=%d nr_requested=%" PRIu64 - " nr_scanned=%" PRIu64 " nr_skipped=%" PRIu64 " nr_taken=%" PRIu64 " lru=%s", - msg.isolate_mode(), msg.classzone_idx(), msg.order(), msg.nr_requested(), msg.nr_scanned(), - msg.nr_skipped(), msg.nr_taken(), - __print_symbolic(msg.lru(), {0, "inactive_anon"}, {1, "active_anon"}, {2, "inactive_file"}, - {3, "active_file"}, {6, "unevictable"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(mm_vmscan_lru_isolate) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_vmscan_lru_isolate) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_vmscan_lru_shrink_inactive, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_vmscan_lru_shrink_inactive_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_vmscan_lru_shrink_inactive_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "mm_vmscan_lru_shrink_inactive: nid=%d nr_scanned=%" PRIu64 " nr_reclaimed=%" PRIu64 " nr_dirty=%" PRIu64 - " nr_writeback=%" PRIu64 " nr_congested=%" PRIu64 " nr_immediate=%" PRIu64 " nr_activate=%" PRIu64 - " nr_ref_keep=%" PRIu64 " nr_unmap_fail=%" PRIu64 " priority=%d flags=%s", - msg.nid(), msg.nr_scanned(), msg.nr_reclaimed(), msg.nr_dirty(), msg.nr_writeback(), msg.nr_congested(), - msg.nr_immediate(), msg.nr_activate(), msg.nr_ref_keep(), msg.nr_unmap_fail(), msg.priority(), - (msg.reclaim_flags()) ? __print_flags(msg.reclaim_flags(), "|", {0x0001u, "RECLAIM_WB_ANON"}, - {0x0002u, "RECLAIM_WB_FILE"}, {0x0010u, "RECLAIM_WB_MIXED"}, - {0x0004u, "RECLAIM_WB_SYNC"}, {0x0008u, "RECLAIM_WB_ASYNC"}) - : "RECLAIM_WB_NONE"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(mm_vmscan_lru_shrink_inactive) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(mm_vmscan_lru_shrink_inactive) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - mm_vmscan_wakeup_kswapd, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_mm_vmscan_wakeup_kswapd_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.mm_vmscan_wakeup_kswapd_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "mm_vmscan_wakeup_kswapd: nid=%d order=%d gfp_flags=%s", msg.nid(), - msg.order(), - (msg.gfp_flags()) - ? __print_flags( - msg.gfp_flags(), "|", - {(unsigned long)((((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))) | - ((gfp_t)0x400u)), - "GFP_TRANSHUGE"}, - {(unsigned long)(((((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)) | - ((gfp_t)0x40000u) | ((gfp_t)0x80000u) | ((gfp_t)0x2000u)) & - ~((gfp_t)(0x400u | 0x800u))), - "GFP_TRANSHUGE_LIGHT"}, - {(unsigned long)(((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)) | - ((gfp_t)0x08u) | ((gfp_t)0)), - "GFP_HIGHUSER_MOVABLE"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)) | - ((gfp_t)0x02u)), - "GFP_HIGHUSER"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u) | - ((gfp_t)0x100000u)), - "GFP_USER"}, - {(unsigned long)((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | - ((gfp_t)0x400000u)), - "GFP_KERNEL_ACCOUNT"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)), "GFP_KERNEL"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u)), "GFP_NOFS"}, - {(unsigned long)(((gfp_t)0x20u) | ((gfp_t)0x800u)), "GFP_ATOMIC"}, - {(unsigned long)(((gfp_t)(0x400u | 0x800u))), "GFP_NOIO"}, - {(unsigned long)(((gfp_t)0x800u)), "GFP_NOWAIT"}, {(unsigned long)((gfp_t)0x01u), "GFP_DMA"}, - {(unsigned long)((gfp_t)0x02u), "__GFP_HIGHMEM"}, {(unsigned long)((gfp_t)0x04u), "GFP_DMA32"}, - {(unsigned long)((gfp_t)0x20u), "__GFP_HIGH"}, {(unsigned long)((gfp_t)0x40u), "__GFP_IO"}, - {(unsigned long)((gfp_t)0x80u), "__GFP_FS"}, {(unsigned long)((gfp_t)0x2000u), "__GFP_NOWARN"}, - {(unsigned long)((gfp_t)0x4000u), "__GFP_RETRY_MAYFAIL"}, - {(unsigned long)((gfp_t)0x8000u), "__GFP_NOFAIL"}, - {(unsigned long)((gfp_t)0x10000u), "__GFP_NORETRY"}, - {(unsigned long)((gfp_t)0x40000u), "__GFP_COMP"}, {(unsigned long)((gfp_t)0x100u), "__GFP_ZERO"}, - {(unsigned long)((gfp_t)0x80000u), "__GFP_NOMEMALLOC"}, - {(unsigned long)((gfp_t)0x20000u), "__GFP_MEMALLOC"}, - {(unsigned long)((gfp_t)0x100000u), "__GFP_HARDWALL"}, - {(unsigned long)((gfp_t)0x200000u), "__GFP_THISNODE"}, - {(unsigned long)((gfp_t)0x10u), "__GFP_RECLAIMABLE"}, - {(unsigned long)((gfp_t)0x08u), "__GFP_MOVABLE"}, - {(unsigned long)((gfp_t)0x400000u), "__GFP_ACCOUNT"}, - {(unsigned long)((gfp_t)0x1000u), "__GFP_WRITE"}, - {(unsigned long)((gfp_t)(0x400u | 0x800u)), "__GFP_RECLAIM"}, - {(unsigned long)((gfp_t)0x400u), "__GFP_DIRECT_RECLAIM"}, - {(unsigned long)((gfp_t)0x800u), "__GFP_KSWAPD_RECLAIM"}, - {(unsigned long)((gfp_t)0x800000u), "__GFP_ZEROTAGS"}) - : "none"); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(mm_vmscan_wakeup_kswapd) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(mm_vmscan_wakeup_kswapd) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_workqueue_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_workqueue_event_formatter.cpp deleted file mode 100644 index 5dd0500c1..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_workqueue_event_formatter.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - workqueue_activate_work, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_workqueue_activate_work_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.workqueue_activate_work_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "workqueue_activate_work: work struct %p", msg.work()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(workqueue_activate_work) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(workqueue_activate_work) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - workqueue_execute_end, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_workqueue_execute_end_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.workqueue_execute_end_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "workqueue_execute_end: work struct %p", msg.work()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(workqueue_execute_end) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(workqueue_execute_end) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - workqueue_execute_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_workqueue_execute_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.workqueue_execute_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.function()) > 0) { - functionStr = kernelSymbols[msg.function()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "workqueue_execute_start: work struct %p: function %s", msg.work(), functionStr.c_str()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "workqueue_execute_start: work struct %p: function %p", msg.work(), msg.function()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(workqueue_execute_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(workqueue_execute_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - workqueue_queue_work, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_workqueue_queue_work_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.workqueue_queue_work_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = 0; - std::string functionStr = ""; - auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_; - if (kernelSymbols.count(msg.function()) > 0) { - functionStr = kernelSymbols[msg.function()]; - } - if (functionStr != "") { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "workqueue_queue_work: work struct=%p function=%s workqueue=%s req_cpu=%d cpu=%d", - msg.work(), functionStr.c_str(), msg.workqueue().c_str(), msg.req_cpu(), msg.cpu()); - } else { - len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "workqueue_queue_work: work struct=%p function=%p workqueue=%s req_cpu=%d cpu=%d", - msg.work(), msg.function(), msg.workqueue().c_str(), msg.req_cpu(), msg.cpu()); - } - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(workqueue_queue_work) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(workqueue_queue_work) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_writeback_event_formatter.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_writeback_event_formatter.cpp deleted file mode 100644 index 2fa07f4f7..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_formatters/ftrace_writeback_event_formatter.cpp +++ /dev/null @@ -1,632 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "event_formatter.h" -#include "logging.h" -#include "pq.h" -#include "trace_events.h" - -FTRACE_NS_BEGIN -namespace { -const int BUFFER_SIZE = 512; - -REGISTER_FTRACE_EVENT_FORMATTER( - balance_dirty_pages, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_balance_dirty_pages_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.balance_dirty_pages_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "balance_dirty_pages: bdi %s: limit=%" PRIu64 " setpoint=%" PRIu64 " dirty=%" PRIu64 - " bdi_setpoint=%" PRIu64 " bdi_dirty=%" PRIu64 " dirty_ratelimit=%" PRIu64 - " task_ratelimit=%" PRIu64 " dirtied=%u dirtied_pause=%u paused=%" PRIu64 " pause=%" PRIu64 - " period=%" PRIu64 " think=%" PRIu64 " cgroup_ino=%" PRId32 "", - msg.bdi().c_str(), msg.limit(), msg.setpoint(), msg.dirty(), msg.bdi_setpoint(), msg.bdi_dirty(), - msg.dirty_ratelimit(), msg.task_ratelimit(), msg.dirtied(), msg.dirtied_pause(), msg.paused(), - msg.pause(), msg.period(), msg.think(), msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(balance_dirty_pages) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(balance_dirty_pages) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - bdi_dirty_ratelimit, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_bdi_dirty_ratelimit_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.bdi_dirty_ratelimit_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "bdi_dirty_ratelimit: bdi %s: write_bw=%" PRIu64 " awrite_bw=%" PRIu64 " dirty_rate=%" PRIu64 - " dirty_ratelimit=%" PRIu64 " task_ratelimit=%" PRIu64 " balanced_dirty_ratelimit=%" PRIu64 - " cgroup_ino=%" PRId32 "", - msg.bdi().c_str(), msg.write_bw(), msg.avg_write_bw(), msg.dirty_rate(), msg.dirty_ratelimit(), - msg.task_ratelimit(), msg.balanced_dirty_ratelimit(), msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(bdi_dirty_ratelimit) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(bdi_dirty_ratelimit) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - global_dirty_state, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_global_dirty_state_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.global_dirty_state_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "global_dirty_state: dirty=%" PRIu64 " writeback=%" PRIu64 " bg_thresh=%" PRIu64 - " thresh=%" PRIu64 " limit=%" PRIu64 " dirtied=%" PRIu64 " written=%" PRIu64 "", - msg.nr_dirty(), msg.nr_writeback(), msg.background_thresh(), msg.dirty_thresh(), - msg.dirty_limit(), msg.nr_dirtied(), msg.nr_written()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(global_dirty_state) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(global_dirty_state) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - wbc_writepage, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_wbc_writepage_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.wbc_writepage_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "wbc_writepage: bdi %s: towrt=%" PRIu64 " skip=%" PRIu64 - " mode=%d kupd=%d bgrd=%d reclm=%d cyclic=%d start=0x%" PRIx64 " end=0x%" PRIx64 - " cgroup_ino=%" PRId32 "", - msg.name().c_str(), msg.nr_to_write(), msg.pages_skipped(), msg.sync_mode(), - msg.for_kupdate(), msg.for_background(), msg.for_reclaim(), msg.range_cyclic(), - msg.range_start(), msg.range_end(), msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(wbc_writepage) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(wbc_writepage) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_bdi_register, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_bdi_register_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_bdi_register_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "writeback_bdi_register: bdi %s", msg.name().c_str()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(writeback_bdi_register) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_bdi_register) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_dirty_inode, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_dirty_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_dirty_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_dirty_inode: bdi %s: ino=%" PRIu64 " state=%s flags=%s", msg.name().c_str(), - msg.ino(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - __print_flags(msg.flags(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(writeback_dirty_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_dirty_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_dirty_inode_enqueue, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_dirty_inode_enqueue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_dirty_inode_enqueue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_dirty_inode_enqueue: dev %d,%d ino %" PRIu64 " dirtied %" PRIu64 " state %s mode 0%o", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), msg.ino(), - msg.dirtied_when(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - msg.mode()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(writeback_dirty_inode_enqueue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(writeback_dirty_inode_enqueue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_dirty_inode_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_dirty_inode_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_dirty_inode_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_dirty_inode_start: bdi %s: ino=%" PRIu64 " state=%s flags=%s", - msg.name().c_str(), msg.ino(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - __print_flags(msg.flags(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(writeback_dirty_inode_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(writeback_dirty_inode_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_exec, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_exec_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_exec_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_exec: bdi %s: sb_dev %d:%d nr_pages=%" PRIu64 - " sync_mode=%d kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%" PRId32 "", - msg.name().c_str(), ((unsigned int)((msg.sb_dev()) >> 20)), - ((unsigned int)((msg.sb_dev()) & ((1U << 20) - 1))), msg.nr_pages(), msg.sync_mode(), msg.for_kupdate(), - msg.range_cyclic(), msg.for_background(), - __print_symbolic(msg.reason(), {0, "background"}, {1, "vmscan"}, {2, "sync"}, {3, "periodic"}, - {4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}, {7, "foreign_flush"}), - msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(writeback_exec) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_exec) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_lazytime, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_lazytime_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_lazytime_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_lazytime: dev %d,%d ino %" PRIu64 " dirtied %" PRIu64 " state %s mode 0%o", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.dirtied_when(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - msg.mode()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(writeback_lazytime) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_lazytime) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_lazytime_iput, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_lazytime_iput_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_lazytime_iput_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_lazytime_iput: dev %d,%d ino %" PRIu64 " dirtied %" PRIu64 " state %s mode 0%o", - ((unsigned int)((msg.dev()) >> 20)), ((unsigned int)((msg.dev()) & ((1U << 20) - 1))), - msg.ino(), msg.dirtied_when(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - msg.mode()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(writeback_lazytime_iput) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_lazytime_iput) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_mark_inode_dirty, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_mark_inode_dirty_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_mark_inode_dirty_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_mark_inode_dirty: bdi %s: ino=%" PRIu64 " state=%s flags=%s", - msg.name().c_str(), msg.ino(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - __print_flags(msg.flags(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"})); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(writeback_mark_inode_dirty) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(writeback_mark_inode_dirty) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_pages_written, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_pages_written_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_pages_written_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "writeback_pages_written: %" PRIu64 "", msg.pages()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(writeback_pages_written) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_pages_written) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_queue, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_queue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_queue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_queue: bdi %s: sb_dev %d:%d nr_pages=%" PRIu64 - " sync_mode=%d kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%" PRId32 "", - msg.name().c_str(), ((unsigned int)((msg.sb_dev()) >> 20)), - ((unsigned int)((msg.sb_dev()) & ((1U << 20) - 1))), msg.nr_pages(), msg.sync_mode(), msg.for_kupdate(), - msg.range_cyclic(), msg.for_background(), - __print_symbolic(msg.reason(), {0, "background"}, {1, "vmscan"}, {2, "sync"}, {3, "periodic"}, - {4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}, {7, "foreign_flush"}), - msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(writeback_queue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_queue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_queue_io, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_queue_io_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_queue_io_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_queue_io: bdi %s: older=%" PRIu64 " age=%" PRIu64 " enqueue=%d reason=%s cgroup_ino=%" PRId32 "", - msg.name().c_str(), msg.older(), msg.age(), msg.moved(), - __print_symbolic(msg.reason(), {0, "background"}, {1, "vmscan"}, {2, "sync"}, {3, "periodic"}, - {4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}, {7, "foreign_flush"}), - msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(writeback_queue_io) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_queue_io) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_sb_inodes_requeue, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_sb_inodes_requeue_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_sb_inodes_requeue_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_sb_inodes_requeue: bdi %s: ino=%" PRIu64 " state=%s dirtied_when=%" PRIu64 - " age=%" PRIu64 " cgroup_ino=%" PRId32 "", - msg.name().c_str(), msg.ino(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - msg.dirtied_when(), (jiffies - msg.dirtied_when()) / 300, msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(writeback_sb_inodes_requeue) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(writeback_sb_inodes_requeue) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_single_inode, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_single_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_single_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = - snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_single_inode: bdi %s: ino=%" PRIu64 " state=%s dirtied_when=%" PRIu64 " age=%" PRIu64 - " index=%" PRIu64 " to_write=%" PRIu64 " wrote=%" PRIu64 " cgroup_ino=%" PRId32 "", - msg.name().c_str(), msg.ino(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - msg.dirtied_when(), (jiffies - msg.dirtied_when()) / 300, msg.writeback_index(), - msg.nr_to_write(), msg.wrote(), msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(writeback_single_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_single_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_single_inode_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_single_inode_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_single_inode_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_single_inode_start: bdi %s: ino=%" PRIu64 " state=%s dirtied_when=%" PRIu64 - " age=%" PRIu64 " index=%" PRIu64 " to_write=%" PRIu64 " wrote=%" PRIu64 - " cgroup_ino=%" PRId32 "", - msg.name().c_str(), msg.ino(), - __print_flags(msg.state(), "|", {(1 << 0), "I_DIRTY_SYNC"}, {(1 << 1), "I_DIRTY_DATASYNC"}, - {(1 << 2), "I_DIRTY_PAGES"}, {(1 << 3), "I_NEW"}, {(1 << 4), "I_WILL_FREE"}, - {(1 << 5), "I_FREEING"}, {(1 << 6), "I_CLEAR"}, {(1 << 7), "I_SYNC"}, - {(1 << 11), "I_DIRTY_TIME"}, {(1 << 8), "I_REFERENCED"}), - msg.dirtied_when(), (jiffies - msg.dirtied_when()) / 300, msg.writeback_index(), - msg.nr_to_write(), msg.wrote(), msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(writeback_single_inode_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(writeback_single_inode_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_start, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_start: bdi %s: sb_dev %d:%d nr_pages=%" PRIu64 - " sync_mode=%d kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%" PRId32 "", - msg.name().c_str(), ((unsigned int)((msg.sb_dev()) >> 20)), - ((unsigned int)((msg.sb_dev()) & ((1U << 20) - 1))), msg.nr_pages(), msg.sync_mode(), msg.for_kupdate(), - msg.range_cyclic(), msg.for_background(), - __print_symbolic(msg.reason(), {0, "background"}, {1, "vmscan"}, {2, "sync"}, {3, "periodic"}, - {4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}, {7, "foreign_flush"}), - msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(writeback_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_wait, [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_wait_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_wait_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_wait: bdi %s: sb_dev %d:%d nr_pages=%" PRIu64 - " sync_mode=%d kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%" PRId32 "", - msg.name().c_str(), ((unsigned int)((msg.sb_dev()) >> 20)), - ((unsigned int)((msg.sb_dev()) & ((1U << 20) - 1))), msg.nr_pages(), msg.sync_mode(), msg.for_kupdate(), - msg.range_cyclic(), msg.for_background(), - __print_symbolic(msg.reason(), {0, "background"}, {1, "vmscan"}, {2, "sync"}, {3, "periodic"}, - {4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}, {7, "foreign_flush"}), - msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(writeback_wait) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_wait) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_wake_background, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_wake_background_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_wake_background_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_wake_background: bdi %s: cgroup_ino=%" PRId32 "", msg.name().c_str(), - msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(writeback_wake_background) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(writeback_wake_background) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_write_inode, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_write_inode_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_write_inode_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_write_inode: bdi %s: ino=%" PRIu64 " sync_mode=%d cgroup_ino=%" PRId32 "", - msg.name().c_str(), msg.ino(), msg.sync_mode(), msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, "maybe, the contents of print event(writeback_write_inode) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_write_inode) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_write_inode_start, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_write_inode_start_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_write_inode_start_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_write_inode_start: bdi %s: ino=%" PRIu64 " sync_mode=%d cgroup_ino=%" PRId32 "", - msg.name().c_str(), msg.ino(), msg.sync_mode(), msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN( - LOG_CORE, - "maybe, the contents of print event(writeback_write_inode_start) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, - "the contents of event(writeback_write_inode_start) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); - -REGISTER_FTRACE_EVENT_FORMATTER( - writeback_written, - [](const ForStandard::FtraceEvent& event) -> bool { return event.has_writeback_written_format(); }, - [](const ForStandard::FtraceEvent& event) -> std::string { - auto msg = event.writeback_written_format(); - char buffer[BUFFER_SIZE] = {0}; - int len = snprintf_s( - buffer, BUFFER_SIZE, BUFFER_SIZE - 1, - "writeback_written: bdi %s: sb_dev %d:%d nr_pages=%" PRIu64 - " sync_mode=%d kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%" PRId32 "", - msg.name().c_str(), ((unsigned int)((msg.sb_dev()) >> 20)), - ((unsigned int)((msg.sb_dev()) & ((1U << 20) - 1))), msg.nr_pages(), msg.sync_mode(), msg.for_kupdate(), - msg.range_cyclic(), msg.for_background(), - __print_symbolic(msg.reason(), {0, "background"}, {1, "vmscan"}, {2, "sync"}, {3, "periodic"}, - {4, "laptop_timer"}, {5, "fs_free_space"}, {6, "forker_thread"}, {7, "foreign_flush"}), - msg.cgroup_ino()); - if (len >= BUFFER_SIZE - 1) { - PROFILER_LOG_WARN(LOG_CORE, - "maybe, the contents of print event(writeback_written) msg had be cut off in outfile"); - } - if (len < 0) { - PROFILER_LOG_WARN(LOG_CORE, "the contents of event(writeback_written) msg snprintf_s format error "); - return ""; - } - return std::string(buffer); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/BUILD.gn b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/BUILD.gn deleted file mode 100644 index 5a4449141..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/BUILD.gn +++ /dev/null @@ -1,42 +0,0 @@ -# THIS FILE IS GENERATE BY {}, PLEASE DON'T EDIT IT! -# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("../../../../../../base/config.gni") -import("../../../../ftrace.gni") -import("autogenerated.gni") -ohos_source_set("ftrace_event_parsers") { - sources = auto_generated_cpp_sources - include_dirs = [ - ".", - "${OHOS_PROFILER_DIR}/device/plugins/ftrace_plugin/include", - "${OHOS_PROFILER_DIR}/device/base/include", - ] - deps = [ - "${OHOS_PROFILER_DIR}/proto_encoder:proto_encoder_source", - "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp", - "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_encoder", - ] - if (current_toolchain != host_toolchain) { - defines = [ "HAVE_HILOG" ] - external_deps = [ - "bounds_checking_function:libsec_shared", - "hilog:libhilog_base", - "protobuf:protobuf_lite", - ] - } - public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ] - subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" - part_name = "${OHOS_PROFILER_PART_NAME}" -} diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/autogenerated.gni b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/autogenerated.gni deleted file mode 100644 index c84fe92eb..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/autogenerated.gni +++ /dev/null @@ -1,51 +0,0 @@ -# THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! -# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -auto_generated_cpp_sources = [ - "ftrace_binder_event_parser.cpp", - "ftrace_block_event_parser.cpp", - "ftrace_cgroup_event_parser.cpp", - "ftrace_clk_event_parser.cpp", - "ftrace_compaction_event_parser.cpp", - "ftrace_cpuhp_event_parser.cpp", - "ftrace_dma_fence_event_parser.cpp", - "ftrace_ext4_event_parser.cpp", - "ftrace_f2fs_event_parser.cpp", - "ftrace_filelock_event_parser.cpp", - "ftrace_filemap_event_parser.cpp", - "ftrace_ftrace_event_parser.cpp", - "ftrace_gpio_event_parser.cpp", - "ftrace_i2c_event_parser.cpp", - "ftrace_ipi_event_parser.cpp", - "ftrace_irq_event_parser.cpp", - "ftrace_kmem_event_parser.cpp", - "ftrace_mmc_event_parser.cpp", - "ftrace_net_event_parser.cpp", - "ftrace_oom_event_parser.cpp", - "ftrace_pagemap_event_parser.cpp", - "ftrace_power_event_parser.cpp", - "ftrace_printk_event_parser.cpp", - "ftrace_raw_syscalls_event_parser.cpp", - "ftrace_rcu_event_parser.cpp", - "ftrace_regulator_event_parser.cpp", - "ftrace_sched_event_parser.cpp", - "ftrace_signal_event_parser.cpp", - "ftrace_sunrpc_event_parser.cpp", - "ftrace_task_event_parser.cpp", - "ftrace_timer_event_parser.cpp", - "ftrace_v4l2_event_parser.cpp", - "ftrace_vmscan_event_parser.cpp", - "ftrace_workqueue_event_parser.cpp", - "ftrace_writeback_event_parser.cpp", -] diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_binder_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_binder_event_parser.cpp deleted file mode 100644 index 0f543ee5f..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_binder_event_parser.cpp +++ /dev/null @@ -1,581 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void binder_alloc_lru_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_alloc_lru_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_lru_end_format(); - binder_alloc_lru_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_alloc_lru_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_lru_end_format(); - binder_alloc_lru_end_func(msg, data, size, format); -}); - -template -void binder_alloc_lru_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_alloc_lru_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_lru_start_format(); - binder_alloc_lru_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_alloc_lru_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_lru_start_format(); - binder_alloc_lru_start_func(msg, data, size, format); - }); - -template -void binder_alloc_page_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_alloc_page_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_page_end_format(); - binder_alloc_page_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_alloc_page_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_page_end_format(); - binder_alloc_page_end_func(msg, data, size, format); - }); - -template -void binder_alloc_page_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_alloc_page_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_page_start_format(); - binder_alloc_page_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_alloc_page_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_alloc_page_start_format(); - binder_alloc_page_start_func(msg, data, size, format); - }); - -template -void binder_command_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cmd(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_command, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_command_format(); - binder_command_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_command, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_command_format(); - binder_command_func(msg, data, size, format); -}); - -template -void binder_free_lru_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_free_lru_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_free_lru_end_format(); - binder_free_lru_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_free_lru_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_free_lru_end_format(); - binder_free_lru_end_func(msg, data, size, format); -}); - -template -void binder_free_lru_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_free_lru_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_free_lru_start_format(); - binder_free_lru_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_free_lru_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_free_lru_start_format(); - binder_free_lru_start_func(msg, data, size, format); -}); - -template -void binder_ioctl_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cmd(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_arg(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_ioctl, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_ioctl_format(); - binder_ioctl_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_ioctl, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_ioctl_format(); - binder_ioctl_func(msg, data, size, format); -}); - -template -void binder_ioctl_done_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_ioctl_done, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_ioctl_done_format(); - binder_ioctl_done_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_ioctl_done, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_ioctl_done_format(); - binder_ioctl_done_func(msg, data, size, format); -}); - -template -void binder_lock_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_tag(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_lock, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_lock_format(); - binder_lock_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_lock, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_lock_format(); - binder_lock_func(msg, data, size, format); -}); - -template -void binder_locked_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_tag(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_locked, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_locked_format(); - binder_locked_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_locked, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_locked_format(); - binder_locked_func(msg, data, size, format); -}); - -template -void binder_read_done_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_read_done, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_read_done_format(); - binder_read_done_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_read_done, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_read_done_format(); - binder_read_done_func(msg, data, size, format); -}); - -template -void binder_return_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cmd(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_return, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_return_format(); - binder_return_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_return, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_return_format(); - binder_return_func(msg, data, size, format); -}); - -template -void binder_transaction_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_target_node(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_to_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_to_thread(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reply(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_code(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_format(); - binder_transaction_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_transaction, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_format(); - binder_transaction_func(msg, data, size, format); -}); - -template -void binder_transaction_alloc_buf_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offsets_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_extra_buffers_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction_alloc_buf, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_alloc_buf_format(); - binder_transaction_alloc_buf_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_transaction_alloc_buf, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_alloc_buf_format(); - binder_transaction_alloc_buf_func(msg, data, size, format); -}); - -template -void binder_transaction_buffer_release_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offsets_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_extra_buffers_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction_buffer_release, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_buffer_release_format(); - binder_transaction_buffer_release_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_transaction_buffer_release, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_buffer_release_format(); - binder_transaction_buffer_release_func(msg, data, size, format); -}); - -template -void binder_transaction_failed_buffer_release_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offsets_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_extra_buffers_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction_failed_buffer_release, [](FtraceEvent &ftraceEvent, - uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_failed_buffer_release_format(); - binder_transaction_failed_buffer_release_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION( - binder_transaction_failed_buffer_release, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_failed_buffer_release_format(); - binder_transaction_failed_buffer_release_func(msg, data, size, format); - }); - -template -void binder_transaction_node_to_ref_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_node_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_node_ptr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ref_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ref_desc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction_node_to_ref, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_node_to_ref_format(); - binder_transaction_node_to_ref_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_transaction_node_to_ref, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_node_to_ref_format(); - binder_transaction_node_to_ref_func(msg, data, size, format); -}); - -template -void binder_transaction_received_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction_received, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_received_format(); - binder_transaction_received_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_transaction_received, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_received_format(); - binder_transaction_received_func(msg, data, size, format); -}); - -template -void binder_transaction_ref_to_node_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ref_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ref_desc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_node_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_node_ptr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction_ref_to_node, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_ref_to_node_format(); - binder_transaction_ref_to_node_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_transaction_ref_to_node, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_ref_to_node_format(); - binder_transaction_ref_to_node_func(msg, data, size, format); - }); - -template -void binder_transaction_ref_to_ref_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_node_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_ref_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_ref_desc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dest_ref_debug_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dest_ref_desc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_transaction_ref_to_ref, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_ref_to_ref_format(); - binder_transaction_ref_to_ref_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_transaction_ref_to_ref, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_transaction_ref_to_ref_format(); - binder_transaction_ref_to_ref_func(msg, data, size, format); -}); - -template -void binder_unlock_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_tag(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_unlock, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unlock_format(); - binder_unlock_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_unlock, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unlock_format(); - binder_unlock_func(msg, data, size, format); -}); - -template -void binder_unmap_kernel_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_unmap_kernel_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_kernel_end_format(); - binder_unmap_kernel_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_unmap_kernel_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_kernel_end_format(); - binder_unmap_kernel_end_func(msg, data, size, format); - }); - -template -void binder_unmap_kernel_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_unmap_kernel_start, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_kernel_start_format(); - binder_unmap_kernel_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_unmap_kernel_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_kernel_start_format(); - binder_unmap_kernel_start_func(msg, data, size, format); - }); - -template -void binder_unmap_user_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_unmap_user_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_user_end_format(); - binder_unmap_user_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_unmap_user_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_user_end_format(); - binder_unmap_user_end_func(msg, data, size, format); - }); - -template -void binder_unmap_user_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_page_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_unmap_user_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_user_start_format(); - binder_unmap_user_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_unmap_user_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_unmap_user_start_format(); - binder_unmap_user_start_func(msg, data, size, format); -}); - -template -void binder_update_page_range_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_allocate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_update_page_range, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_update_page_range_format(); - binder_update_page_range_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_update_page_range, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_update_page_range_format(); - binder_update_page_range_func(msg, data, size, format); -}); - -template -void binder_wait_for_work_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_proc_work(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_transaction_stack(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_thread_todo(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_wait_for_work, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_wait_for_work_format(); - binder_wait_for_work_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_wait_for_work, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_wait_for_work_format(); - binder_wait_for_work_func(msg, data, size, format); -}); - -template -void binder_write_done_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(binder_write_done, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_write_done_format(); - binder_write_done_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(binder_write_done, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_binder_write_done_format(); - binder_write_done_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_block_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_block_event_parser.cpp deleted file mode 100644 index 14da5b8cd..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_block_event_parser.cpp +++ /dev/null @@ -1,382 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void block_bio_backmerge_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_bio_backmerge, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_backmerge_format(); - block_bio_backmerge_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_bio_backmerge, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_backmerge_format(); - block_bio_backmerge_func(msg, data, size, format); - }); - -template -void block_bio_bounce_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_bio_bounce, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_bounce_format(); - block_bio_bounce_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_bio_bounce, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_bounce_format(); - block_bio_bounce_func(msg, data, size, format); - }); - -template -void block_bio_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_error(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_bio_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_complete_format(); - block_bio_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_bio_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_complete_format(); - block_bio_complete_func(msg, data, size, format); - }); - -template -void block_bio_frontmerge_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_bio_frontmerge, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_frontmerge_format(); - block_bio_frontmerge_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_bio_frontmerge, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_frontmerge_format(); - block_bio_frontmerge_func(msg, data, size, format); -}); - -template -void block_bio_queue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_bio_queue, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_queue_format(); - block_bio_queue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_bio_queue, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_queue_format(); - block_bio_queue_func(msg, data, size, format); -}); - -template -void block_bio_remap_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_old_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_old_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_bio_remap, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_remap_format(); - block_bio_remap_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_bio_remap, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_bio_remap_format(); - block_bio_remap_func(msg, data, size, format); -}); - -template -void block_dirty_buffer_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_dirty_buffer, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_dirty_buffer_format(); - block_dirty_buffer_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_dirty_buffer, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_dirty_buffer_format(); - block_dirty_buffer_func(msg, data, size, format); -}); - -template -void block_getrq_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_getrq, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_getrq_format(); - block_getrq_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_getrq, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_getrq_format(); - block_getrq_func(msg, data, size, format); -}); - -template -void block_plug_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_plug, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_plug_format(); - block_plug_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_plug, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_plug_format(); - block_plug_func(msg, data, size, format); -}); - -template -void block_rq_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_error(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_cmd(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_rq_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_complete_format(); - block_rq_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_rq_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_complete_format(); - block_rq_complete_func(msg, data, size, format); - }); - -template -void block_rq_insert_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_cmd(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_rq_insert, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_insert_format(); - block_rq_insert_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_rq_insert, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_insert_format(); - block_rq_insert_func(msg, data, size, format); -}); - -template -void block_rq_issue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_cmd(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_rq_issue, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_issue_format(); - block_rq_issue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_rq_issue, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_issue_format(); - block_rq_issue_func(msg, data, size, format); -}); - -template -void block_rq_remap_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_old_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_old_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_bios(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_rq_remap, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_remap_format(); - block_rq_remap_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_rq_remap, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_remap_format(); - block_rq_remap_func(msg, data, size, format); -}); - -template -void block_rq_requeue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_cmd(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_rq_requeue, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_requeue_format(); - block_rq_requeue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_rq_requeue, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_rq_requeue_format(); - block_rq_requeue_func(msg, data, size, format); -}); - -template -void block_split_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_new_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rwbs(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_split, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_split_format(); - block_split_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_split, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_split_format(); - block_split_func(msg, data, size, format); -}); - -template -void block_touch_buffer_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sector(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_touch_buffer, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_touch_buffer_format(); - block_touch_buffer_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_touch_buffer, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_touch_buffer_format(); - block_touch_buffer_func(msg, data, size, format); -}); - -template -void block_unplug_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_nr_rq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(block_unplug, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_unplug_format(); - block_unplug_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(block_unplug, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_block_unplug_format(); - block_unplug_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cgroup_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cgroup_event_parser.cpp deleted file mode 100644 index c253c9229..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cgroup_event_parser.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void cgroup_attach_task_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dst_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_attach_task, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_attach_task_format(); - cgroup_attach_task_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_attach_task, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_attach_task_format(); - cgroup_attach_task_func(msg, data, size, format); -}); - -template -void cgroup_destroy_root_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ss_mask(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_destroy_root, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_destroy_root_format(); - cgroup_destroy_root_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_destroy_root, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_destroy_root_format(); - cgroup_destroy_root_func(msg, data, size, format); -}); - -template -void cgroup_freeze_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_freeze, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_freeze_format(); - cgroup_freeze_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_freeze, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_freeze_format(); - cgroup_freeze_func(msg, data, size, format); -}); - -template -void cgroup_mkdir_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_mkdir, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_mkdir_format(); - cgroup_mkdir_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_mkdir, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_mkdir_format(); - cgroup_mkdir_func(msg, data, size, format); -}); - -template -void cgroup_notify_frozen_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_val(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_notify_frozen, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_notify_frozen_format(); - cgroup_notify_frozen_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_notify_frozen, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_notify_frozen_format(); - cgroup_notify_frozen_func(msg, data, size, format); -}); - -template -void cgroup_notify_populated_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_val(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_notify_populated, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_notify_populated_format(); - cgroup_notify_populated_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_notify_populated, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_notify_populated_format(); - cgroup_notify_populated_func(msg, data, size, format); - }); - -template -void cgroup_release_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_release, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_release_format(); - cgroup_release_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_release, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_release_format(); - cgroup_release_func(msg, data, size, format); -}); - -template -void cgroup_remount_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ss_mask(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_remount, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_remount_format(); - cgroup_remount_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_remount, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_remount_format(); - cgroup_remount_func(msg, data, size, format); -}); - -template -void cgroup_rename_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_rename, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_rename_format(); - cgroup_rename_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_rename, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_rename_format(); - cgroup_rename_func(msg, data, size, format); -}); - -template -void cgroup_rmdir_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_rmdir, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_rmdir_format(); - cgroup_rmdir_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_rmdir, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_rmdir_format(); - cgroup_rmdir_func(msg, data, size, format); -}); - -template -void cgroup_setup_root_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ss_mask(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_setup_root, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_setup_root_format(); - cgroup_setup_root_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_setup_root, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_setup_root_format(); - cgroup_setup_root_func(msg, data, size, format); -}); - -template -void cgroup_transfer_tasks_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dst_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_transfer_tasks, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_transfer_tasks_format(); - cgroup_transfer_tasks_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_transfer_tasks, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_transfer_tasks_format(); - cgroup_transfer_tasks_func(msg, data, size, format); -}); - -template -void cgroup_unfreeze_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_root(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_level(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_path(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cgroup_unfreeze, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_unfreeze_format(); - cgroup_unfreeze_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cgroup_unfreeze, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cgroup_unfreeze_format(); - cgroup_unfreeze_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_clk_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_clk_event_parser.cpp deleted file mode 100644 index e1de1dba9..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_clk_event_parser.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void clk_disable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_disable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_disable_format(); - clk_disable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_disable, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_disable_format(); - clk_disable_func(msg, data, size, format); -}); - -template -void clk_disable_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_disable_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_disable_complete_format(); - clk_disable_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_disable_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_disable_complete_format(); - clk_disable_complete_func(msg, data, size, format); - }); - -template -void clk_enable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_enable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_enable_format(); - clk_enable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_enable, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_enable_format(); - clk_enable_func(msg, data, size, format); -}); - -template -void clk_enable_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_enable_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_enable_complete_format(); - clk_enable_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_enable_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_enable_complete_format(); - clk_enable_complete_func(msg, data, size, format); - }); - -template -void clk_prepare_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_prepare, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_prepare_format(); - clk_prepare_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_prepare, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_prepare_format(); - clk_prepare_func(msg, data, size, format); -}); - -template -void clk_prepare_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_prepare_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_prepare_complete_format(); - clk_prepare_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_prepare_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_prepare_complete_format(); - clk_prepare_complete_func(msg, data, size, format); - }); - -template -void clk_set_parent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pname(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_set_parent, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_parent_format(); - clk_set_parent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_set_parent, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_parent_format(); - clk_set_parent_func(msg, data, size, format); -}); - -template -void clk_set_parent_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pname(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_set_parent_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_parent_complete_format(); - clk_set_parent_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_set_parent_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_parent_complete_format(); - clk_set_parent_complete_func(msg, data, size, format); -}); - -template -void clk_set_phase_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_phase(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_set_phase, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_phase_format(); - clk_set_phase_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_set_phase, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_phase_format(); - clk_set_phase_func(msg, data, size, format); -}); - -template -void clk_set_phase_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_phase(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_set_phase_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_phase_complete_format(); - clk_set_phase_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_set_phase_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_phase_complete_format(); - clk_set_phase_complete_func(msg, data, size, format); -}); - -template -void clk_set_rate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_rate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_set_rate, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_rate_format(); - clk_set_rate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_set_rate, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_rate_format(); - clk_set_rate_func(msg, data, size, format); -}); - -template -void clk_set_rate_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_rate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_set_rate_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_rate_complete_format(); - clk_set_rate_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_set_rate_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_set_rate_complete_format(); - clk_set_rate_complete_func(msg, data, size, format); -}); - -template -void clk_unprepare_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_unprepare, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_unprepare_format(); - clk_unprepare_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_unprepare, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_unprepare_format(); - clk_unprepare_func(msg, data, size, format); -}); - -template -void clk_unprepare_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clk_unprepare_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_unprepare_complete_format(); - clk_unprepare_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clk_unprepare_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clk_unprepare_complete_format(); - clk_unprepare_complete_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_compaction_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_compaction_event_parser.cpp deleted file mode 100644 index ccdb4c295..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_compaction_event_parser.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void mm_compaction_isolate_freepages_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_start_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_end_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_scanned(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_taken(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_compaction_isolate_freepages, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_compaction_isolate_freepages_format(); - mm_compaction_isolate_freepages_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_compaction_isolate_freepages, [](ProtoEncoder::FtraceEvent &ftraceEvent, - uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_compaction_isolate_freepages_format(); - mm_compaction_isolate_freepages_func(msg, data, size, format); -}); - -template -void mm_compaction_isolate_migratepages_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_start_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_end_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_scanned(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_taken(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_compaction_isolate_migratepages, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_compaction_isolate_migratepages_format(); - mm_compaction_isolate_migratepages_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_compaction_isolate_migratepages, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_compaction_isolate_migratepages_format(); - mm_compaction_isolate_migratepages_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cpuhp_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cpuhp_event_parser.cpp deleted file mode 100644 index 838171745..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_cpuhp_event_parser.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void cpuhp_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_target(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_idx(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fun(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cpuhp_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpuhp_enter_format(); - cpuhp_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cpuhp_enter, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpuhp_enter_format(); - cpuhp_enter_func(msg, data, size, format); -}); - -template -void cpuhp_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_idx(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cpuhp_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpuhp_exit_format(); - cpuhp_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cpuhp_exit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpuhp_exit_format(); - cpuhp_exit_func(msg, data, size, format); -}); - -template -void cpuhp_multi_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_target(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_idx(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fun(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cpuhp_multi_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpuhp_multi_enter_format(); - cpuhp_multi_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cpuhp_multi_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpuhp_multi_enter_format(); - cpuhp_multi_enter_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_dma_fence_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_dma_fence_event_parser.cpp deleted file mode 100644 index ed4644391..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_dma_fence_event_parser.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void dma_fence_destroy_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_timeline(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_context(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dma_fence_destroy, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_destroy_format(); - dma_fence_destroy_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dma_fence_destroy, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_destroy_format(); - dma_fence_destroy_func(msg, data, size, format); - }); - -template -void dma_fence_emit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_timeline(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_context(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dma_fence_emit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_emit_format(); - dma_fence_emit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dma_fence_emit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_emit_format(); - dma_fence_emit_func(msg, data, size, format); -}); - -template -void dma_fence_enable_signal_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_timeline(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_context(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dma_fence_enable_signal, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_enable_signal_format(); - dma_fence_enable_signal_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dma_fence_enable_signal, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_enable_signal_format(); - dma_fence_enable_signal_func(msg, data, size, format); - }); - -template -void dma_fence_init_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_timeline(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_context(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dma_fence_init, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_init_format(); - dma_fence_init_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dma_fence_init, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_init_format(); - dma_fence_init_func(msg, data, size, format); -}); - -template -void dma_fence_signaled_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_timeline(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_context(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dma_fence_signaled, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_signaled_format(); - dma_fence_signaled_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dma_fence_signaled, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_signaled_format(); - dma_fence_signaled_func(msg, data, size, format); - }); - -template -void dma_fence_wait_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_timeline(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_context(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dma_fence_wait_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_wait_end_format(); - dma_fence_wait_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dma_fence_wait_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_wait_end_format(); - dma_fence_wait_end_func(msg, data, size, format); - }); - -template -void dma_fence_wait_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_timeline(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_context(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dma_fence_wait_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_wait_start_format(); - dma_fence_wait_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dma_fence_wait_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dma_fence_wait_start_format(); - dma_fence_wait_start_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ext4_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ext4_event_parser.cpp deleted file mode 100644 index 7b011ce7e..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ext4_event_parser.cpp +++ /dev/null @@ -1,1803 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void ext4_alloc_da_blocks_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_alloc_da_blocks, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_alloc_da_blocks_format(); - ext4_alloc_da_blocks_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_alloc_da_blocks, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_alloc_da_blocks_format(); - ext4_alloc_da_blocks_func(msg, data, size, format); - }); - -template -void ext4_allocate_blocks_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_block(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_logical(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lleft(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lright(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_goal(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pleft(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pright(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_allocate_blocks, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_allocate_blocks_format(); - ext4_allocate_blocks_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_allocate_blocks, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_allocate_blocks_format(); - ext4_allocate_blocks_func(msg, data, size, format); - }); - -template -void ext4_allocate_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dir(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_allocate_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_allocate_inode_format(); - ext4_allocate_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_allocate_inode, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_allocate_inode_format(); - ext4_allocate_inode_func(msg, data, size, format); - }); - -template -void ext4_begin_ordered_truncate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_new_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_begin_ordered_truncate, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_begin_ordered_truncate_format(); - ext4_begin_ordered_truncate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_begin_ordered_truncate, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_begin_ordered_truncate_format(); - ext4_begin_ordered_truncate_func(msg, data, size, format); - }); - -template -void ext4_collapse_range_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_collapse_range, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_collapse_range_format(); - ext4_collapse_range_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_collapse_range, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_collapse_range_format(); - ext4_collapse_range_func(msg, data, size, format); - }); - -template -void ext4_da_release_space_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_freed_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reserved_data_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_da_release_space, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_release_space_format(); - ext4_da_release_space_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_da_release_space, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_release_space_format(); - ext4_da_release_space_func(msg, data, size, format); -}); - -template -void ext4_da_reserve_space_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reserved_data_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_da_reserve_space, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_reserve_space_format(); - ext4_da_reserve_space_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_da_reserve_space, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_reserve_space_format(); - ext4_da_reserve_space_func(msg, data, size, format); -}); - -template -void ext4_da_update_reserve_space_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_used_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reserved_data_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_quota_claim(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_da_update_reserve_space, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_update_reserve_space_format(); - ext4_da_update_reserve_space_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_da_update_reserve_space, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_update_reserve_space_format(); - ext4_da_update_reserve_space_func(msg, data, size, format); -}); - -template -void ext4_da_write_begin_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_da_write_begin, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_begin_format(); - ext4_da_write_begin_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_da_write_begin, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_begin_format(); - ext4_da_write_begin_func(msg, data, size, format); -}); - -template -void ext4_da_write_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_copied(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_da_write_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_end_format(); - ext4_da_write_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_da_write_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_end_format(); - ext4_da_write_end_func(msg, data, size, format); -}); - -template -void ext4_da_write_pages_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_first_page(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_to_write(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_da_write_pages, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_pages_format(); - ext4_da_write_pages_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_da_write_pages, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_pages_format(); - ext4_da_write_pages_func(msg, data, size, format); -}); - -template -void ext4_da_write_pages_extent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_da_write_pages_extent, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_pages_extent_format(); - ext4_da_write_pages_extent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_da_write_pages_extent, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_da_write_pages_extent_format(); - ext4_da_write_pages_extent_func(msg, data, size, format); -}); - -template -void ext4_discard_blocks_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_count(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_discard_blocks, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_discard_blocks_format(); - ext4_discard_blocks_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_discard_blocks, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_discard_blocks_format(); - ext4_discard_blocks_func(msg, data, size, format); -}); - -template -void ext4_discard_preallocations_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_needed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_discard_preallocations, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_discard_preallocations_format(); - ext4_discard_preallocations_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_discard_preallocations, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_discard_preallocations_format(); - ext4_discard_preallocations_func(msg, data, size, format); -}); - -template -void ext4_drop_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_drop(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_drop_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_drop_inode_format(); - ext4_drop_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_drop_inode, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_drop_inode_format(); - ext4_drop_inode_func(msg, data, size, format); -}); - -template -void ext4_es_cache_extent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_cache_extent, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_cache_extent_format(); - ext4_es_cache_extent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_cache_extent, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_cache_extent_format(); - ext4_es_cache_extent_func(msg, data, size, format); -}); - -template -void ext4_es_insert_extent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_insert_extent, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_insert_extent_format(); - ext4_es_insert_extent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_insert_extent, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_insert_extent_format(); - ext4_es_insert_extent_func(msg, data, size, format); -}); - -template -void ext4_es_lookup_extent_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_lookup_extent_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_lookup_extent_enter_format(); - ext4_es_lookup_extent_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_lookup_extent_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_lookup_extent_enter_format(); - ext4_es_lookup_extent_enter_func(msg, data, size, format); -}); - -template -void ext4_es_lookup_extent_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_found(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_lookup_extent_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_lookup_extent_exit_format(); - ext4_es_lookup_extent_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_lookup_extent_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_lookup_extent_exit_format(); - ext4_es_lookup_extent_exit_func(msg, data, size, format); -}); - -template -void ext4_es_remove_extent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_remove_extent, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_remove_extent_format(); - ext4_es_remove_extent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_remove_extent, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_remove_extent_format(); - ext4_es_remove_extent_func(msg, data, size, format); - }); - -template -void ext4_es_shrink_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_shrunk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_scan_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_skipped(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_retried(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_shrink, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_format(); - ext4_es_shrink_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_shrink, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_format(); - ext4_es_shrink_func(msg, data, size, format); -}); - -template -void ext4_es_shrink_count_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_to_scan(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cache_cnt(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_shrink_count, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_count_format(); - ext4_es_shrink_count_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_shrink_count, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_count_format(); - ext4_es_shrink_count_func(msg, data, size, format); - }); - -template -void ext4_es_shrink_scan_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_to_scan(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cache_cnt(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_shrink_scan_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_scan_enter_format(); - ext4_es_shrink_scan_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_shrink_scan_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_scan_enter_format(); - ext4_es_shrink_scan_enter_func(msg, data, size, format); - }); - -template -void ext4_es_shrink_scan_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_shrunk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cache_cnt(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_es_shrink_scan_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_scan_exit_format(); - ext4_es_shrink_scan_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_es_shrink_scan_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_es_shrink_scan_exit_format(); - ext4_es_shrink_scan_exit_func(msg, data, size, format); - }); - -template -void ext4_evict_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nlink(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_evict_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_evict_inode_format(); - ext4_evict_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_evict_inode, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_evict_inode_format(); - ext4_evict_inode_func(msg, data, size, format); - }); - -template -void ext4_ext_convert_to_initialized_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_m_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_m_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_u_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_u_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_u_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_convert_to_initialized_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_convert_to_initialized_enter_format(); - ext4_ext_convert_to_initialized_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_convert_to_initialized_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_convert_to_initialized_enter_format(); - ext4_ext_convert_to_initialized_enter_func(msg, data, size, format); -}); - -template -void ext4_ext_convert_to_initialized_fastpath_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_m_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_m_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_u_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_u_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_u_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_convert_to_initialized_fastpath, [](FtraceEvent &ftraceEvent, - uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_convert_to_initialized_fastpath_format(); - ext4_ext_convert_to_initialized_fastpath_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION( - ext4_ext_convert_to_initialized_fastpath, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_convert_to_initialized_fastpath_format(); - ext4_ext_convert_to_initialized_fastpath_func(msg, data, size, format); - }); - -template -void ext4_ext_handle_unwritten_extents_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_allocated(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_newblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_handle_unwritten_extents, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_handle_unwritten_extents_format(); - ext4_ext_handle_unwritten_extents_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_handle_unwritten_extents, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_handle_unwritten_extents_format(); - ext4_ext_handle_unwritten_extents_func(msg, data, size, format); -}); - -template -void ext4_ext_load_extent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_load_extent, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_load_extent_format(); - ext4_ext_load_extent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_load_extent, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_load_extent_format(); - ext4_ext_load_extent_func(msg, data, size, format); -}); - -template -void ext4_ext_map_blocks_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_map_blocks_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_map_blocks_enter_format(); - ext4_ext_map_blocks_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_map_blocks_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_map_blocks_enter_format(); - ext4_ext_map_blocks_enter_func(msg, data, size, format); -}); - -template -void ext4_ext_map_blocks_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mflags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_map_blocks_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_map_blocks_exit_format(); - ext4_ext_map_blocks_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_map_blocks_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_map_blocks_exit_format(); - ext4_ext_map_blocks_exit_func(msg, data, size, format); - }); - -template -void ext4_ext_remove_space_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_end(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_depth(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_remove_space, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_remove_space_format(); - ext4_ext_remove_space_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_remove_space, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_remove_space_format(); - ext4_ext_remove_space_func(msg, data, size, format); - }); - -template -void ext4_ext_remove_space_done_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_end(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_depth(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_pclu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_eh_entries(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_remove_space_done, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_remove_space_done_format(); - ext4_ext_remove_space_done_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_remove_space_done, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_remove_space_done_format(); - ext4_ext_remove_space_done_func(msg, data, size, format); - }); - -template -void ext4_ext_rm_idx_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_rm_idx, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_rm_idx_format(); - ext4_ext_rm_idx_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_rm_idx, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_rm_idx_format(); - ext4_ext_rm_idx_func(msg, data, size, format); -}); - -template -void ext4_ext_rm_leaf_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ee_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ee_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ee_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_pclu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_rm_leaf, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_rm_leaf_format(); - ext4_ext_rm_leaf_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_rm_leaf, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_rm_leaf_format(); - ext4_ext_rm_leaf_func(msg, data, size, format); - }); - -template -void ext4_ext_show_extent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ext_show_extent, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_show_extent_format(); - ext4_ext_show_extent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ext_show_extent, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ext_show_extent_format(); - ext4_ext_show_extent_func(msg, data, size, format); - }); - -template -void ext4_fallocate_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_fallocate_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_fallocate_enter_format(); - ext4_fallocate_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_fallocate_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_fallocate_enter_format(); - ext4_fallocate_enter_func(msg, data, size, format); - }); - -template -void ext4_fallocate_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_fallocate_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_fallocate_exit_format(); - ext4_fallocate_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_fallocate_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_fallocate_exit_format(); - ext4_fallocate_exit_func(msg, data, size, format); - }); - -template -void ext4_forget_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_block(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_is_metadata(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_forget, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_forget_format(); - ext4_forget_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_forget, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_forget_format(); - ext4_forget_func(msg, data, size, format); -}); - -template -void ext4_free_blocks_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_block(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_count(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_free_blocks, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_free_blocks_format(); - ext4_free_blocks_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_free_blocks, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_free_blocks_format(); - ext4_free_blocks_func(msg, data, size, format); - }); - -template -void ext4_free_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_uid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_free_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_free_inode_format(); - ext4_free_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_free_inode, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_free_inode_format(); - ext4_free_inode_func(msg, data, size, format); -}); - -template -void ext4_get_implied_cluster_alloc_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_get_implied_cluster_alloc_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_get_implied_cluster_alloc_exit_format(); - ext4_get_implied_cluster_alloc_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_get_implied_cluster_alloc_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_get_implied_cluster_alloc_exit_format(); - ext4_get_implied_cluster_alloc_exit_func(msg, data, size, format); -}); - -template -void ext4_ind_map_blocks_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ind_map_blocks_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ind_map_blocks_enter_format(); - ext4_ind_map_blocks_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ind_map_blocks_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ind_map_blocks_enter_format(); - ext4_ind_map_blocks_enter_func(msg, data, size, format); - }); - -template -void ext4_ind_map_blocks_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mflags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_ind_map_blocks_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ind_map_blocks_exit_format(); - ext4_ind_map_blocks_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_ind_map_blocks_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_ind_map_blocks_exit_format(); - ext4_ind_map_blocks_exit_func(msg, data, size, format); - }); - -template -void ext4_insert_range_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_insert_range, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_insert_range_format(); - ext4_insert_range_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_insert_range, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_insert_range_format(); - ext4_insert_range_func(msg, data, size, format); -}); - -template -void ext4_journal_start_reserved_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ip(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_journal_start_reserved, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_journal_start_reserved_format(); - ext4_journal_start_reserved_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_journal_start_reserved, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_journal_start_reserved_format(); - ext4_journal_start_reserved_func(msg, data, size, format); -}); - -template -void ext4_journalled_write_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_copied(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_journalled_write_end, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_journalled_write_end_format(); - ext4_journalled_write_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_journalled_write_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_journalled_write_end_format(); - ext4_journalled_write_end_func(msg, data, size, format); -}); - -template -void ext4_load_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_load_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_load_inode_format(); - ext4_load_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_load_inode, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_load_inode_format(); - ext4_load_inode_func(msg, data, size, format); -}); - -template -void ext4_load_inode_bitmap_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_load_inode_bitmap, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_load_inode_bitmap_format(); - ext4_load_inode_bitmap_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_load_inode_bitmap, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_load_inode_bitmap_format(); - ext4_load_inode_bitmap_func(msg, data, size, format); -}); - -template -void ext4_mark_inode_dirty_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ip(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mark_inode_dirty, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mark_inode_dirty_format(); - ext4_mark_inode_dirty_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mark_inode_dirty, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mark_inode_dirty_format(); - ext4_mark_inode_dirty_func(msg, data, size, format); -}); - -template -void ext4_mb_bitmap_load_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mb_bitmap_load, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_bitmap_load_format(); - ext4_mb_bitmap_load_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mb_bitmap_load, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_bitmap_load_format(); - ext4_mb_bitmap_load_func(msg, data, size, format); -}); - -template -void ext4_mb_buddy_bitmap_load_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mb_buddy_bitmap_load, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_buddy_bitmap_load_format(); - ext4_mb_buddy_bitmap_load_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mb_buddy_bitmap_load, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_buddy_bitmap_load_format(); - ext4_mb_buddy_bitmap_load_func(msg, data, size, format); -}); - -template -void ext4_mb_discard_preallocations_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_needed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mb_discard_preallocations, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_discard_preallocations_format(); - ext4_mb_discard_preallocations_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mb_discard_preallocations, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_discard_preallocations_format(); - ext4_mb_discard_preallocations_func(msg, data, size, format); -}); - -template -void ext4_mb_new_group_pa_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_pstart(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_lstart(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mb_new_group_pa, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_new_group_pa_format(); - ext4_mb_new_group_pa_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mb_new_group_pa, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_new_group_pa_format(); - ext4_mb_new_group_pa_func(msg, data, size, format); -}); - -template -void ext4_mb_new_inode_pa_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_pstart(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_lstart(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mb_new_inode_pa, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_new_inode_pa_format(); - ext4_mb_new_inode_pa_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mb_new_inode_pa, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_new_inode_pa_format(); - ext4_mb_new_inode_pa_func(msg, data, size, format); - }); - -template -void ext4_mb_release_group_pa_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_pstart(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pa_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mb_release_group_pa, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_release_group_pa_format(); - ext4_mb_release_group_pa_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mb_release_group_pa, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_release_group_pa_format(); - ext4_mb_release_group_pa_func(msg, data, size, format); - }); - -template -void ext4_mb_release_inode_pa_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_block(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_count(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mb_release_inode_pa, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_release_inode_pa_format(); - ext4_mb_release_inode_pa_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mb_release_inode_pa, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mb_release_inode_pa_format(); - ext4_mb_release_inode_pa_func(msg, data, size, format); - }); - -template -void ext4_mballoc_alloc_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_logical(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_goal_logical(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_goal_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_goal_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_goal_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_logical(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_found(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_groups(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_buddy(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_tail(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mballoc_alloc, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_alloc_format(); - ext4_mballoc_alloc_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mballoc_alloc, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_alloc_format(); - ext4_mballoc_alloc_func(msg, data, size, format); - }); - -template -void ext4_mballoc_discard_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mballoc_discard, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_discard_format(); - ext4_mballoc_discard_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mballoc_discard, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_discard_format(); - ext4_mballoc_discard_func(msg, data, size, format); - }); - -template -void ext4_mballoc_free_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mballoc_free, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_free_format(); - ext4_mballoc_free_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mballoc_free, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_free_format(); - ext4_mballoc_free_func(msg, data, size, format); -}); - -template -void ext4_mballoc_prealloc_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_logical(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_logical(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_mballoc_prealloc, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_prealloc_format(); - ext4_mballoc_prealloc_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_mballoc_prealloc, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_mballoc_prealloc_format(); - ext4_mballoc_prealloc_func(msg, data, size, format); -}); - -template -void ext4_other_inode_update_time_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_uid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_other_inode_update_time, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_other_inode_update_time_format(); - ext4_other_inode_update_time_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_other_inode_update_time, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_other_inode_update_time_format(); - ext4_other_inode_update_time_func(msg, data, size, format); -}); - -template -void ext4_punch_hole_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_punch_hole, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_punch_hole_format(); - ext4_punch_hole_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_punch_hole, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_punch_hole_format(); - ext4_punch_hole_func(msg, data, size, format); -}); - -template -void ext4_read_block_bitmap_load_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prefetch(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_read_block_bitmap_load, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_read_block_bitmap_load_format(); - ext4_read_block_bitmap_load_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_read_block_bitmap_load, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_read_block_bitmap_load_format(); - ext4_read_block_bitmap_load_func(msg, data, size, format); -}); - -template -void ext4_remove_blocks_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_from(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_to(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ee_pblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ee_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ee_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_pclu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_lblk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_remove_blocks, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_remove_blocks_format(); - ext4_remove_blocks_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_remove_blocks, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_remove_blocks_format(); - ext4_remove_blocks_func(msg, data, size, format); -}); - -template -void ext4_request_blocks_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_logical(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lleft(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lright(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_goal(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pleft(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pright(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_request_blocks, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_request_blocks_format(); - ext4_request_blocks_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_request_blocks, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_request_blocks_format(); - ext4_request_blocks_func(msg, data, size, format); - }); - -template -void ext4_request_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dir(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_request_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_request_inode_format(); - ext4_request_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_request_inode, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_request_inode_format(); - ext4_request_inode_func(msg, data, size, format); - }); - -template -void ext4_sync_file_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_parent(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_datasync(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_sync_file_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_sync_file_enter_format(); - ext4_sync_file_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_sync_file_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_sync_file_enter_format(); - ext4_sync_file_enter_func(msg, data, size, format); - }); - -template -void ext4_sync_file_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_sync_file_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_sync_file_exit_format(); - ext4_sync_file_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_sync_file_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_sync_file_exit_format(); - ext4_sync_file_exit_func(msg, data, size, format); - }); - -template -void ext4_sync_fs_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_wait(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_sync_fs, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_sync_fs_format(); - ext4_sync_fs_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_sync_fs, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_sync_fs_format(); - ext4_sync_fs_func(msg, data, size, format); -}); - -template -void ext4_trim_all_free_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev_major(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dev_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_trim_all_free, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_trim_all_free_format(); - ext4_trim_all_free_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_trim_all_free, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_trim_all_free_format(); - ext4_trim_all_free_func(msg, data, size, format); - }); - -template -void ext4_trim_extent_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev_major(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dev_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_trim_extent, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_trim_extent_format(); - ext4_trim_extent_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_trim_extent, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_trim_extent_format(); - ext4_trim_extent_func(msg, data, size, format); - }); - -template -void ext4_truncate_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_truncate_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_truncate_enter_format(); - ext4_truncate_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_truncate_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_truncate_enter_format(); - ext4_truncate_enter_func(msg, data, size, format); - }); - -template -void ext4_truncate_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_truncate_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_truncate_exit_format(); - ext4_truncate_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_truncate_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_truncate_exit_format(); - ext4_truncate_exit_func(msg, data, size, format); - }); - -template -void ext4_unlink_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_parent(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_unlink_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_unlink_enter_format(); - ext4_unlink_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_unlink_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_unlink_enter_format(); - ext4_unlink_enter_func(msg, data, size, format); - }); - -template -void ext4_unlink_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_unlink_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_unlink_exit_format(); - ext4_unlink_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_unlink_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_unlink_exit_format(); - ext4_unlink_exit_func(msg, data, size, format); - }); - -template -void ext4_write_begin_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_write_begin, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_write_begin_format(); - ext4_write_begin_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_write_begin, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_write_begin_format(); - ext4_write_begin_func(msg, data, size, format); - }); - -template -void ext4_write_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_copied(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_write_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_write_end_format(); - ext4_write_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_write_end, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_write_end_format(); - ext4_write_end_func(msg, data, size, format); -}); - -template -void ext4_writepages_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_to_write(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pages_skipped(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_end(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_writeback_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_kupdate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_cyclic(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_writepages, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_writepages_format(); - ext4_writepages_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_writepages, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_writepages_format(); - ext4_writepages_func(msg, data, size, format); -}); - -template -void ext4_writepages_result_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pages_written(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pages_skipped(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_writeback_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_writepages_result, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_writepages_result_format(); - ext4_writepages_result_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_writepages_result, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_writepages_result_format(); - ext4_writepages_result_func(msg, data, size, format); - }); - -template -void ext4_zero_range_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ext4_zero_range, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_zero_range_format(); - ext4_zero_range_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ext4_zero_range, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ext4_zero_range_format(); - ext4_zero_range_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_f2fs_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_f2fs_event_parser.cpp deleted file mode 100644 index 08cc93c15..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_f2fs_event_parser.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void f2fs_sync_file_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nlink(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_advise(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(f2fs_sync_file_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_sync_file_enter_format(); - f2fs_sync_file_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(f2fs_sync_file_enter, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_sync_file_enter_format(); - f2fs_sync_file_enter_func(msg, data, size, format); -}); - -template -void f2fs_sync_file_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cp_reason(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_datasync(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(f2fs_sync_file_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_sync_file_exit_format(); - f2fs_sync_file_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(f2fs_sync_file_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_sync_file_exit_format(); - f2fs_sync_file_exit_func(msg, data, size, format); - }); - -template -void f2fs_write_begin_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(f2fs_write_begin, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_write_begin_format(); - f2fs_write_begin_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(f2fs_write_begin, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_write_begin_format(); - f2fs_write_begin_func(msg, data, size, format); - }); - -template -void f2fs_write_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pos(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_copied(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(f2fs_write_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_write_end_format(); - f2fs_write_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(f2fs_write_end, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_f2fs_write_end_format(); - f2fs_write_end_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filelock_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filelock_event_parser.cpp deleted file mode 100644 index b1e371906..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filelock_event_parser.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void break_lease_block_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_fl(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_blocker(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_owner(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_break_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_downgrade_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(break_lease_block, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_break_lease_block_format(); - break_lease_block_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(break_lease_block, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_break_lease_block_format(); - break_lease_block_func(msg, data, size, format); -}); - -template -void break_lease_noblock_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_fl(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_blocker(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_owner(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_break_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_downgrade_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(break_lease_noblock, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_break_lease_noblock_format(); - break_lease_noblock_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(break_lease_noblock, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_break_lease_noblock_format(); - break_lease_noblock_func(msg, data, size, format); -}); - -template -void break_lease_unblock_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_fl(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_blocker(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_owner(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_break_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_downgrade_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(break_lease_unblock, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_break_lease_unblock_format(); - break_lease_unblock_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(break_lease_unblock, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_break_lease_unblock_format(); - break_lease_unblock_func(msg, data, size, format); -}); - -template -void generic_add_lease_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_wcount(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rcount(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_icount(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_owner(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(generic_add_lease, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_generic_add_lease_format(); - generic_add_lease_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(generic_add_lease, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_generic_add_lease_format(); - generic_add_lease_func(msg, data, size, format); -}); - -template -void generic_delete_lease_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_fl(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_blocker(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_owner(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_break_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_downgrade_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(generic_delete_lease, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_generic_delete_lease_format(); - generic_delete_lease_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(generic_delete_lease, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_generic_delete_lease_format(); - generic_delete_lease_func(msg, data, size, format); -}); - -template -void time_out_leases_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_fl(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_blocker(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_owner(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_break_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fl_downgrade_time(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(time_out_leases, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_time_out_leases_format(); - time_out_leases_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(time_out_leases, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_time_out_leases_format(); - time_out_leases_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filemap_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filemap_event_parser.cpp deleted file mode 100644 index 34ea0aaf5..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_filemap_event_parser.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void file_check_and_advance_wb_err_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_file(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_old(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seq_new(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(file_check_and_advance_wb_err, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_file_check_and_advance_wb_err_format(); - file_check_and_advance_wb_err_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(file_check_and_advance_wb_err, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_file_check_and_advance_wb_err_format(); - file_check_and_advance_wb_err_func(msg, data, size, format); -}); - -template -void filemap_set_wb_err_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_errseq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(filemap_set_wb_err, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_filemap_set_wb_err_format(); - filemap_set_wb_err_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(filemap_set_wb_err, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_filemap_set_wb_err_format(); - filemap_set_wb_err_func(msg, data, size, format); -}); - -template -void mm_filemap_add_to_page_cache_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_filemap_add_to_page_cache, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_filemap_add_to_page_cache_format(); - mm_filemap_add_to_page_cache_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_filemap_add_to_page_cache, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_filemap_add_to_page_cache_format(); - mm_filemap_add_to_page_cache_func(msg, data, size, format); -}); - -template -void mm_filemap_delete_from_page_cache_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_i_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_s_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_filemap_delete_from_page_cache, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_filemap_delete_from_page_cache_format(); - mm_filemap_delete_from_page_cache_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_filemap_delete_from_page_cache, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_filemap_delete_from_page_cache_format(); - mm_filemap_delete_from_page_cache_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ftrace_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ftrace_event_parser.cpp deleted file mode 100644 index 88ace0c7a..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ftrace_event_parser.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void bputs_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_ip(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_str(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(bputs, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_bputs_format(); - bputs_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(bputs, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_bputs_format(); - bputs_func(msg, data, size, format); -}); - -template -void branch_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_line(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_func(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_file(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_correct(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_constant(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(branch, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_branch_format(); - branch_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(branch, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_branch_format(); - branch_func(msg, data, size, format); -}); - -template -void context_switch_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_prev_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(context_switch, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_context_switch_format(); - context_switch_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(context_switch, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_context_switch_format(); - context_switch_func(msg, data, size, format); -}); - -template -void funcgraph_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_func(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_depth(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(funcgraph_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_funcgraph_entry_format(); - funcgraph_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(funcgraph_entry, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_funcgraph_entry_format(); - funcgraph_entry_func(msg, data, size, format); -}); - -template -void funcgraph_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_func(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_depth(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_overrun(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_calltime(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rettime(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(funcgraph_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_funcgraph_exit_format(); - funcgraph_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(funcgraph_exit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_funcgraph_exit_format(); - funcgraph_exit_func(msg, data, size, format); -}); - -template -void function_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_ip(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_parent_ip(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(function, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_function_format(); - function_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(function, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_function_format(); - function_func(msg, data, size, format); -}); - -template -void kernel_stack_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - std::vector retvalVec = FtraceFieldParser::ParseVectorIntField(format.fields, i++, data, size); - for (size_t i = 0; i < retvalVec.size(); i++) { - msg->add_caller(retvalVec[i]); - } -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(kernel_stack, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_kernel_stack_format(); - kernel_stack_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(kernel_stack, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_kernel_stack_format(); - kernel_stack_func(msg, data, size, format); -}); - -template -void mmiotrace_map_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_phys(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_virt(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_map_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mmiotrace_map, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmiotrace_map_format(); - mmiotrace_map_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mmiotrace_map, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmiotrace_map_format(); - mmiotrace_map_func(msg, data, size, format); -}); - -template -void mmiotrace_rw_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_phys(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_map_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_width(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mmiotrace_rw, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmiotrace_rw_format(); - mmiotrace_rw_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mmiotrace_rw, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmiotrace_rw_format(); - mmiotrace_rw_func(msg, data, size, format); -}); - -template -void print_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_ip(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_buf(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(print, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_print_format(); - print_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(print, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_print_format(); - print_func(msg, data, size, format); -}); - -template -void user_stack_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_tgid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - std::vector retvalVec = FtraceFieldParser::ParseVectorIntField(format.fields, i++, data, size); - for (size_t i = 0; i < retvalVec.size(); i++) { - msg->add_caller(retvalVec[i]); - } -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(user_stack, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_user_stack_format(); - user_stack_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(user_stack, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_user_stack_format(); - user_stack_func(msg, data, size, format); -}); - -template -void wakeup_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_prev_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(wakeup, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_wakeup_format(); - wakeup_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(wakeup, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_wakeup_format(); - wakeup_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpio_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpio_event_parser.cpp deleted file mode 100644 index df83580cd..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpio_event_parser.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void gpio_direction_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_gpio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_in(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_err(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(gpio_direction, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_gpio_direction_format(); - gpio_direction_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(gpio_direction, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_gpio_direction_format(); - gpio_direction_func(msg, data, size, format); -}); - -template -void gpio_value_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_gpio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_get(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(gpio_value, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_gpio_value_format(); - gpio_value_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(gpio_value, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_gpio_value_format(); - gpio_value_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpu_mem_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpu_mem_event_parser.cpp deleted file mode 100644 index 53d241aa0..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_gpu_mem_event_parser.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void gpu_mem_total_func(T& msg, uint8_t data[], size_t size, const EventFormat& format) -{ - int i = 0; - msg->set_gpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(gpu_mem_total, [](FtraceEvent& ftraceEvent, uint8_t data[], size_t size, - const EventFormat& format) { - auto msg = ftraceEvent.mutable_gpu_mem_total_format(); - gpu_mem_total_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(gpu_mem_total, [](ProtoEncoder::FtraceEvent& ftraceEvent, uint8_t data[], - size_t size, const EventFormat& format) { - auto msg = ftraceEvent.mutable_gpu_mem_total_format(); - gpu_mem_total_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_i2c_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_i2c_event_parser.cpp deleted file mode 100644 index 48db937be..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_i2c_event_parser.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void i2c_read_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_adapter_nr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_msg_nr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_addr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(i2c_read, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_read_format(); - i2c_read_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(i2c_read, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_read_format(); - i2c_read_func(msg, data, size, format); -}); - -template -void i2c_reply_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_adapter_nr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_msg_nr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_addr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_buf(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(i2c_reply, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_reply_format(); - i2c_reply_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(i2c_reply, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_reply_format(); - i2c_reply_func(msg, data, size, format); -}); - -template -void i2c_result_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_adapter_nr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_msgs(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(i2c_result, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_result_format(); - i2c_result_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(i2c_result, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_result_format(); - i2c_result_func(msg, data, size, format); -}); - -template -void i2c_write_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_adapter_nr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_msg_nr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_addr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_buf(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(i2c_write, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_write_format(); - i2c_write_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(i2c_write, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_i2c_write_format(); - i2c_write_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ipi_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ipi_event_parser.cpp deleted file mode 100644 index 8ff19fe3d..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_ipi_event_parser.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void ipi_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_reason(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ipi_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ipi_entry_format(); - ipi_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ipi_entry, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ipi_entry_format(); - ipi_entry_func(msg, data, size, format); -}); - -template -void ipi_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_reason(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ipi_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ipi_exit_format(); - ipi_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ipi_exit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ipi_exit_format(); - ipi_exit_func(msg, data, size, format); -}); - -template -void ipi_raise_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_target_cpus(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reason(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(ipi_raise, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_ipi_raise_format(); - ipi_raise_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(ipi_raise, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_ipi_raise_format(); - ipi_raise_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_irq_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_irq_event_parser.cpp deleted file mode 100644 index 30866325e..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_irq_event_parser.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void irq_handler_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_irq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(irq_handler_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_irq_handler_entry_format(); - irq_handler_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(irq_handler_entry, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_irq_handler_entry_format(); - irq_handler_entry_func(msg, data, size, format); - }); - -template -void irq_handler_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_irq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(irq_handler_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_irq_handler_exit_format(); - irq_handler_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(irq_handler_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_irq_handler_exit_format(); - irq_handler_exit_func(msg, data, size, format); - }); - -template -void softirq_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_vec(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(softirq_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_softirq_entry_format(); - softirq_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(softirq_entry, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_softirq_entry_format(); - softirq_entry_func(msg, data, size, format); -}); - -template -void softirq_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_vec(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(softirq_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_softirq_exit_format(); - softirq_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(softirq_exit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_softirq_exit_format(); - softirq_exit_func(msg, data, size, format); -}); - -template -void softirq_raise_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_vec(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(softirq_raise, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_softirq_raise_format(); - softirq_raise_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(softirq_raise, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_softirq_raise_format(); - softirq_raise_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_kmem_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_kmem_event_parser.cpp deleted file mode 100644 index c61c12712..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_kmem_event_parser.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void kfree_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_call_site(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ptr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(kfree, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_kfree_format(); - kfree_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(kfree, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_kfree_format(); - kfree_func(msg, data, size, format); -}); - -template -void kmalloc_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_call_site(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ptr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytes_req(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytes_alloc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gfp_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_node(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(kmalloc, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_kmalloc_format(); - kmalloc_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(kmalloc, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_kmalloc_format(); - kmalloc_func(msg, data, size, format); -}); - -template -void kmem_cache_alloc_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_call_site(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ptr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytes_req(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytes_alloc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gfp_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_node(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_accounted(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(kmem_cache_alloc, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_kmem_cache_alloc_format(); - kmem_cache_alloc_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(kmem_cache_alloc, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_kmem_cache_alloc_format(); - kmem_cache_alloc_func(msg, data, size, format); - }); - -template -void kmem_cache_free_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_call_site(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ptr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(kmem_cache_free, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_kmem_cache_free_format(); - kmem_cache_free_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(kmem_cache_free, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_kmem_cache_free_format(); - kmem_cache_free_func(msg, data, size, format); -}); - -template -void mm_page_alloc_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gfp_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_migratetype(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_page_alloc, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_alloc_format(); - mm_page_alloc_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_page_alloc, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_alloc_format(); - mm_page_alloc_func(msg, data, size, format); -}); - -template -void mm_page_alloc_extfrag_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_alloc_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fallback_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_alloc_migratetype(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_fallback_migratetype(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_change_ownership(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_page_alloc_extfrag, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_alloc_extfrag_format(); - mm_page_alloc_extfrag_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_page_alloc_extfrag, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_alloc_extfrag_format(); - mm_page_alloc_extfrag_func(msg, data, size, format); - }); - -template -void mm_page_alloc_zone_locked_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_migratetype(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_percpu_refill(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_page_alloc_zone_locked, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_alloc_zone_locked_format(); - mm_page_alloc_zone_locked_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_page_alloc_zone_locked, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_alloc_zone_locked_format(); - mm_page_alloc_zone_locked_func(msg, data, size, format); - }); - -template -void mm_page_free_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_page_free, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_free_format(); - mm_page_free_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_page_free, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_free_format(); - mm_page_free_func(msg, data, size, format); -}); - -template -void mm_page_free_batched_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_page_free_batched, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_free_batched_format(); - mm_page_free_batched_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_page_free_batched, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_free_batched_format(); - mm_page_free_batched_func(msg, data, size, format); - }); - -template -void mm_page_pcpu_drain_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_migratetype(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_page_pcpu_drain, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_pcpu_drain_format(); - mm_page_pcpu_drain_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_page_pcpu_drain, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_page_pcpu_drain_format(); - mm_page_pcpu_drain_func(msg, data, size, format); - }); - -template -void rss_stat_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_mm_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_curr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_member(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rss_stat, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rss_stat_format(); - rss_stat_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rss_stat, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_rss_stat_format(); - rss_stat_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_mmc_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_mmc_event_parser.cpp deleted file mode 100644 index 536e240f7..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_mmc_event_parser.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void mmc_request_done_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cmd_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cmd_err(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cmd_resp(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_cmd_retries(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_stop_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_stop_err(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_stop_resp(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_stop_retries(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sbc_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sbc_err(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sbc_resp(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_sbc_retries(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytes_xfered(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_err(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_tag(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_can_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_doing_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_retune_now(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_need_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_hold_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_retune_period(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mrq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mmc_request_done, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmc_request_done_format(); - mmc_request_done_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mmc_request_done, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmc_request_done_format(); - mmc_request_done_func(msg, data, size, format); - }); - -template -void mmc_request_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cmd_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cmd_arg(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cmd_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cmd_retries(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_stop_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_stop_arg(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_stop_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_stop_retries(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sbc_opcode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sbc_arg(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sbc_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sbc_retries(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blocks(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blk_addr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_blksz(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_tag(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_can_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_doing_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_retune_now(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_need_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_hold_retune(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_retune_period(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mrq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mmc_request_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmc_request_start_format(); - mmc_request_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mmc_request_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mmc_request_start_format(); - mmc_request_start_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_net_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_net_event_parser.cpp deleted file mode 100644 index 4ca897755..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_net_event_parser.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void napi_gro_frags_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_napi_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_queue_mapping(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tagged(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_proto(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tci(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_protocol(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ip_summed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_l4_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_truesize(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header_valid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_frags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(napi_gro_frags_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_napi_gro_frags_entry_format(); - napi_gro_frags_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(napi_gro_frags_entry, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_napi_gro_frags_entry_format(); - napi_gro_frags_entry_func(msg, data, size, format); - }); - -template -void napi_gro_receive_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_napi_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_queue_mapping(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tagged(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_proto(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tci(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_protocol(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ip_summed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_l4_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_truesize(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header_valid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_frags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(napi_gro_receive_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_napi_gro_receive_entry_format(); - napi_gro_receive_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(napi_gro_receive_entry, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_napi_gro_receive_entry_format(); - napi_gro_receive_entry_func(msg, data, size, format); - }); - -template -void net_dev_queue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(net_dev_queue, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_net_dev_queue_format(); - net_dev_queue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(net_dev_queue, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_net_dev_queue_format(); - net_dev_queue_func(msg, data, size, format); -}); - -template -void net_dev_start_xmit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_queue_mapping(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tagged(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_proto(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tci(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_protocol(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ip_summed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_network_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_transport_offset_valid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_transport_offset(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_tx_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_segs(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(net_dev_start_xmit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_net_dev_start_xmit_format(); - net_dev_start_xmit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(net_dev_start_xmit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_net_dev_start_xmit_format(); - net_dev_start_xmit_func(msg, data, size, format); - }); - -template -void net_dev_xmit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_rc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(net_dev_xmit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_net_dev_xmit_format(); - net_dev_xmit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(net_dev_xmit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_net_dev_xmit_format(); - net_dev_xmit_func(msg, data, size, format); -}); - -template -void netif_receive_skb_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(netif_receive_skb, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_receive_skb_format(); - netif_receive_skb_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(netif_receive_skb, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_receive_skb_format(); - netif_receive_skb_func(msg, data, size, format); - }); - -template -void netif_receive_skb_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_napi_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_queue_mapping(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tagged(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_proto(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tci(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_protocol(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ip_summed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_l4_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_truesize(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header_valid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_frags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(netif_receive_skb_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_receive_skb_entry_format(); - netif_receive_skb_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(netif_receive_skb_entry, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_receive_skb_entry_format(); - netif_receive_skb_entry_func(msg, data, size, format); - }); - -template -void netif_rx_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(netif_rx, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_rx_format(); - netif_rx_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(netif_rx, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_rx_format(); - netif_rx_func(msg, data, size, format); -}); - -template -void netif_rx_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_napi_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_queue_mapping(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_skbaddr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tagged(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_proto(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vlan_tci(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_protocol(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ip_summed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_l4_hash(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_data_len(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_truesize(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header_valid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mac_header(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_frags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_size(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gso_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(netif_rx_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_rx_entry_format(); - netif_rx_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(netif_rx_entry, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_netif_rx_entry_format(); - netif_rx_entry_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_oom_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_oom_event_parser.cpp deleted file mode 100644 index 7816f4311..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_oom_event_parser.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void oom_score_adj_update_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_oom_score_adj(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(oom_score_adj_update, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_oom_score_adj_update_format(); - oom_score_adj_update_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(oom_score_adj_update, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_oom_score_adj_update_format(); - oom_score_adj_update_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_pagemap_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_pagemap_event_parser.cpp deleted file mode 100644 index a2b7fc6e2..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_pagemap_event_parser.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void mm_lru_activate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_folio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_lru_activate, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_lru_activate_format(); - mm_lru_activate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_lru_activate, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_lru_activate_format(); - mm_lru_activate_func(msg, data, size, format); -}); - -template -void mm_lru_insertion_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_folio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pfn(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lru(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_lru_insertion, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_lru_insertion_format(); - mm_lru_insertion_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_lru_insertion, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_lru_insertion_format(); - mm_lru_insertion_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_power_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_power_event_parser.cpp deleted file mode 100644 index d1c1c9d66..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_power_event_parser.cpp +++ /dev/null @@ -1,431 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void clock_disable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clock_disable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clock_disable_format(); - clock_disable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clock_disable, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clock_disable_format(); - clock_disable_func(msg, data, size, format); -}); - -template -void clock_enable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clock_enable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clock_enable_format(); - clock_enable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clock_enable, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clock_enable_format(); - clock_enable_func(msg, data, size, format); -}); - -template -void clock_set_rate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(clock_set_rate, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_clock_set_rate_format(); - clock_set_rate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(clock_set_rate, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_clock_set_rate_format(); - clock_set_rate_func(msg, data, size, format); -}); - -template -void cpu_frequency_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cpu_frequency, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpu_frequency_format(); - cpu_frequency_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cpu_frequency, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpu_frequency_format(); - cpu_frequency_func(msg, data, size, format); -}); - -template -void cpu_frequency_limits_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_min_freq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_max_freq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cpu_frequency_limits, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpu_frequency_limits_format(); - cpu_frequency_limits_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cpu_frequency_limits, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpu_frequency_limits_format(); - cpu_frequency_limits_func(msg, data, size, format); - }); - -template -void cpu_idle_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(cpu_idle, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpu_idle_format(); - cpu_idle_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(cpu_idle, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_cpu_idle_format(); - cpu_idle_func(msg, data, size, format); -}); - -template -void dev_pm_qos_add_request_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_new_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dev_pm_qos_add_request, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dev_pm_qos_add_request_format(); - dev_pm_qos_add_request_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dev_pm_qos_add_request, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dev_pm_qos_add_request_format(); - dev_pm_qos_add_request_func(msg, data, size, format); - }); - -template -void dev_pm_qos_remove_request_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_new_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dev_pm_qos_remove_request, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_dev_pm_qos_remove_request_format(); - dev_pm_qos_remove_request_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dev_pm_qos_remove_request, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dev_pm_qos_remove_request_format(); - dev_pm_qos_remove_request_func(msg, data, size, format); - }); - -template -void dev_pm_qos_update_request_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_new_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(dev_pm_qos_update_request, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_dev_pm_qos_update_request_format(); - dev_pm_qos_update_request_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(dev_pm_qos_update_request, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_dev_pm_qos_update_request_format(); - dev_pm_qos_update_request_func(msg, data, size, format); -}); - -template -void device_pm_callback_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_device(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_error(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(device_pm_callback_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_device_pm_callback_end_format(); - device_pm_callback_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(device_pm_callback_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_device_pm_callback_end_format(); - device_pm_callback_end_func(msg, data, size, format); - }); - -template -void device_pm_callback_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_device(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_driver(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_parent(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pm_ops(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_event(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(device_pm_callback_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_device_pm_callback_start_format(); - device_pm_callback_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(device_pm_callback_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_device_pm_callback_start_format(); - device_pm_callback_start_func(msg, data, size, format); - }); - -template -void pm_qos_add_request_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(pm_qos_add_request, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_add_request_format(); - pm_qos_add_request_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(pm_qos_add_request, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_add_request_format(); - pm_qos_add_request_func(msg, data, size, format); - }); - -template -void pm_qos_remove_request_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(pm_qos_remove_request, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_remove_request_format(); - pm_qos_remove_request_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(pm_qos_remove_request, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_remove_request_format(); - pm_qos_remove_request_func(msg, data, size, format); - }); - -template -void pm_qos_update_flags_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_action(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_curr_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(pm_qos_update_flags, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_update_flags_format(); - pm_qos_update_flags_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(pm_qos_update_flags, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_update_flags_format(); - pm_qos_update_flags_func(msg, data, size, format); - }); - -template -void pm_qos_update_request_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(pm_qos_update_request, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_update_request_format(); - pm_qos_update_request_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(pm_qos_update_request, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_update_request_format(); - pm_qos_update_request_func(msg, data, size, format); - }); - -template -void pm_qos_update_target_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_action(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_curr_value(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(pm_qos_update_target, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_update_target_format(); - pm_qos_update_target_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(pm_qos_update_target, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pm_qos_update_target_format(); - pm_qos_update_target_func(msg, data, size, format); -}); - -template -void power_domain_target_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(power_domain_target, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_power_domain_target_format(); - power_domain_target_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(power_domain_target, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_power_domain_target_format(); - power_domain_target_func(msg, data, size, format); - }); - -template -void pstate_sample_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_core_busy(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_scaled_busy(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_from(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_to(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mperf(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_aperf(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_tsc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_freq(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_io_boost(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(pstate_sample, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_pstate_sample_format(); - pstate_sample_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(pstate_sample, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_pstate_sample_format(); - pstate_sample_func(msg, data, size, format); -}); - -template -void suspend_resume_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_action(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_val(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(suspend_resume, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_suspend_resume_format(); - suspend_resume_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(suspend_resume, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_suspend_resume_format(); - suspend_resume_func(msg, data, size, format); -}); - -template -void wakeup_source_activate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(wakeup_source_activate, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_wakeup_source_activate_format(); - wakeup_source_activate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(wakeup_source_activate, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_wakeup_source_activate_format(); - wakeup_source_activate_func(msg, data, size, format); - }); - -template -void wakeup_source_deactivate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(wakeup_source_deactivate, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_wakeup_source_deactivate_format(); - wakeup_source_deactivate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(wakeup_source_deactivate, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_wakeup_source_deactivate_format(); - wakeup_source_deactivate_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_printk_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_printk_event_parser.cpp deleted file mode 100644 index a279e2547..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_printk_event_parser.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void console_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_msg(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(console, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_console_format(); - console_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(console, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_console_format(); - console_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_raw_syscalls_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_raw_syscalls_event_parser.cpp deleted file mode 100644 index 799b32ed8..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_raw_syscalls_event_parser.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void sys_enter_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - std::vector retvalVec = FtraceFieldParser::ParseVectorIntField(format.fields, i++, data, size); - for (size_t i = 0; i < retvalVec.size(); i++) { - msg->add_args(retvalVec[i]); - } -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sys_enter, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sys_enter_format(); - sys_enter_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sys_enter, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sys_enter_format(); - sys_enter_func(msg, data, size, format); -}); - -template -void sys_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sys_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sys_exit_format(); - sys_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sys_exit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sys_exit_format(); - sys_exit_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_rcu_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_rcu_event_parser.cpp deleted file mode 100644 index 35579b29c..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_rcu_event_parser.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void rcu_utilization_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_s(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rcu_utilization, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rcu_utilization_format(); - rcu_utilization_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rcu_utilization, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_rcu_utilization_format(); - rcu_utilization_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_regulator_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_regulator_event_parser.cpp deleted file mode 100644 index 22828cc9e..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_regulator_event_parser.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void regulator_bypass_disable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_bypass_disable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_disable_format(); - regulator_bypass_disable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_bypass_disable, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_disable_format(); - regulator_bypass_disable_func(msg, data, size, format); - }); - -template -void regulator_bypass_disable_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_bypass_disable_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_disable_complete_format(); - regulator_bypass_disable_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_bypass_disable_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_disable_complete_format(); - regulator_bypass_disable_complete_func(msg, data, size, format); -}); - -template -void regulator_bypass_enable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_bypass_enable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_enable_format(); - regulator_bypass_enable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_bypass_enable, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_enable_format(); - regulator_bypass_enable_func(msg, data, size, format); - }); - -template -void regulator_bypass_enable_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_bypass_enable_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_enable_complete_format(); - regulator_bypass_enable_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_bypass_enable_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_bypass_enable_complete_format(); - regulator_bypass_enable_complete_func(msg, data, size, format); -}); - -template -void regulator_disable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_disable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_disable_format(); - regulator_disable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_disable, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_disable_format(); - regulator_disable_func(msg, data, size, format); -}); - -template -void regulator_disable_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_disable_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_disable_complete_format(); - regulator_disable_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_disable_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_disable_complete_format(); - regulator_disable_complete_func(msg, data, size, format); -}); - -template -void regulator_enable_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_enable, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_enable_format(); - regulator_enable_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_enable, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_enable_format(); - regulator_enable_func(msg, data, size, format); -}); - -template -void regulator_enable_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_enable_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_enable_complete_format(); - regulator_enable_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_enable_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_enable_complete_format(); - regulator_enable_complete_func(msg, data, size, format); -}); - -template -void regulator_enable_delay_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_enable_delay, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_enable_delay_format(); - regulator_enable_delay_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_enable_delay, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_enable_delay_format(); - regulator_enable_delay_func(msg, data, size, format); - }); - -template -void regulator_set_voltage_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_min(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_max(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_set_voltage, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_set_voltage_format(); - regulator_set_voltage_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_set_voltage, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_set_voltage_format(); - regulator_set_voltage_func(msg, data, size, format); - }); - -template -void regulator_set_voltage_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_val(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(regulator_set_voltage_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_set_voltage_complete_format(); - regulator_set_voltage_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(regulator_set_voltage_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_regulator_set_voltage_complete_format(); - regulator_set_voltage_complete_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sched_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sched_event_parser.cpp deleted file mode 100644 index 2f3de3a1a..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sched_event_parser.cpp +++ /dev/null @@ -1,498 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void sched_kthread_stop_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_kthread_stop, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_kthread_stop_format(); - sched_kthread_stop_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_kthread_stop, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_kthread_stop_format(); - sched_kthread_stop_func(msg, data, size, format); - }); - -template -void sched_kthread_stop_ret_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_ret(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_kthread_stop_ret, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_kthread_stop_ret_format(); - sched_kthread_stop_ret_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_kthread_stop_ret, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_kthread_stop_ret_format(); - sched_kthread_stop_ret_func(msg, data, size, format); - }); - -template -void sched_migrate_task_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_orig_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dest_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_migrate_task, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_migrate_task_format(); - sched_migrate_task_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_migrate_task, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_migrate_task_format(); - sched_migrate_task_func(msg, data, size, format); -}); - -template -void sched_move_numa_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_tgid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ngid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_move_numa, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_move_numa_format(); - sched_move_numa_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_move_numa, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_move_numa_format(); - sched_move_numa_func(msg, data, size, format); -}); - -template -void sched_pi_setprio_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_oldprio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_newprio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_pi_setprio, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_pi_setprio_format(); - sched_pi_setprio_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_pi_setprio, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_pi_setprio_format(); - sched_pi_setprio_func(msg, data, size, format); -}); - -template -void sched_process_exec_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_filename(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_old_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_process_exec, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_exec_format(); - sched_process_exec_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_process_exec, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_exec_format(); - sched_process_exec_func(msg, data, size, format); -}); - -template -void sched_process_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_process_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_exit_format(); - sched_process_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_process_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_exit_format(); - sched_process_exit_func(msg, data, size, format); -}); - -template -void sched_process_fork_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_parent_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_parent_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_child_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_child_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_process_fork, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_fork_format(); - sched_process_fork_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_process_fork, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_fork_format(); - sched_process_fork_func(msg, data, size, format); -}); - -template -void sched_process_free_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_process_free, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_free_format(); - sched_process_free_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_process_free, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_free_format(); - sched_process_free_func(msg, data, size, format); -}); - -template -void sched_process_wait_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_process_wait, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_wait_format(); - sched_process_wait_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_process_wait, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_process_wait_format(); - sched_process_wait_func(msg, data, size, format); -}); - -template -void sched_stat_blocked_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_delay(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_stat_blocked, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_blocked_format(); - sched_stat_blocked_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_stat_blocked, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_blocked_format(); - sched_stat_blocked_func(msg, data, size, format); -}); - -template -void sched_stat_iowait_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_delay(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_stat_iowait, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_iowait_format(); - sched_stat_iowait_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_stat_iowait, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_iowait_format(); - sched_stat_iowait_func(msg, data, size, format); -}); - -template -void sched_stat_runtime_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_runtime(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vruntime(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_stat_runtime, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_runtime_format(); - sched_stat_runtime_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_stat_runtime, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_runtime_format(); - sched_stat_runtime_func(msg, data, size, format); -}); - -template -void sched_stat_sleep_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_delay(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_stat_sleep, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_sleep_format(); - sched_stat_sleep_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_stat_sleep, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_sleep_format(); - sched_stat_sleep_func(msg, data, size, format); -}); - -template -void sched_stat_wait_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_delay(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_stat_wait, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_wait_format(); - sched_stat_wait_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_stat_wait, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stat_wait_format(); - sched_stat_wait_func(msg, data, size, format); -}); - -template -void sched_stick_numa_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_src_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_tgid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_ngid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_tgid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_ngid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_stick_numa, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stick_numa_format(); - sched_stick_numa_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_stick_numa, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_stick_numa_format(); - sched_stick_numa_func(msg, data, size, format); -}); - -template -void sched_swap_numa_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_src_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_tgid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_ngid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_src_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_tgid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_ngid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dst_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_swap_numa, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_swap_numa_format(); - sched_swap_numa_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_swap_numa, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_swap_numa_format(); - sched_swap_numa_func(msg, data, size, format); -}); - -template -void sched_switch_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_prev_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_prev_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prev_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_next_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_next_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_switch, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_switch_format(); - sched_switch_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_switch, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_switch_format(); - sched_switch_func(msg, data, size, format); -}); - -template -void sched_wait_task_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_wait_task, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wait_task_format(); - sched_wait_task_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_wait_task, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wait_task_format(); - sched_wait_task_func(msg, data, size, format); -}); - -template -void sched_wake_idle_without_ipi_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_wake_idle_without_ipi, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wake_idle_without_ipi_format(); - sched_wake_idle_without_ipi_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_wake_idle_without_ipi, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wake_idle_without_ipi_format(); - sched_wake_idle_without_ipi_func(msg, data, size, format); -}); - -template -void sched_wakeup_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_target_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_wakeup, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wakeup_format(); - sched_wakeup_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_wakeup, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wakeup_format(); - sched_wakeup_func(msg, data, size, format); -}); - -template -void sched_wakeup_new_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_target_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_wakeup_new, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wakeup_new_format(); - sched_wakeup_new_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_wakeup_new, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_wakeup_new_format(); - sched_wakeup_new_func(msg, data, size, format); -}); - -template -void sched_waking_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_prio(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_target_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(sched_waking, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_waking_format(); - sched_waking_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(sched_waking, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_sched_waking_format(); - sched_waking_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_signal_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_signal_event_parser.cpp deleted file mode 100644 index e0222ad4d..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_signal_event_parser.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void signal_deliver_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_sig(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_error_code(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_code(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sig_handler(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sig_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(signal_deliver, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_signal_deliver_format(); - signal_deliver_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(signal_deliver, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_signal_deliver_format(); - signal_deliver_func(msg, data, size, format); -}); - -template -void signal_generate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_sig(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_error_code(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_code(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_group(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_result(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(signal_generate, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_signal_generate_format(); - signal_generate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(signal_generate, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_signal_generate_format(); - signal_generate_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sunrpc_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sunrpc_event_parser.cpp deleted file mode 100644 index 77e401d24..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_sunrpc_event_parser.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void rpc_call_status_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_call_status, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_call_status_format(); - rpc_call_status_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_call_status, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_call_status_format(); - rpc_call_status_func(msg, data, size, format); -}); - -template -void rpc_connect_status_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_connect_status, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_connect_status_format(); - rpc_connect_status_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_connect_status, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_connect_status_format(); - rpc_connect_status_func(msg, data, size, format); - }); - -template -void rpc_socket_close_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_socket_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sock_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_saddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_daddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_socket_close, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_close_format(); - rpc_socket_close_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_socket_close, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_close_format(); - rpc_socket_close_func(msg, data, size, format); - }); - -template -void rpc_socket_connect_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_error(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_socket_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sock_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_saddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_daddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_socket_connect, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_connect_format(); - rpc_socket_connect_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_socket_connect, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_connect_format(); - rpc_socket_connect_func(msg, data, size, format); - }); - -template -void rpc_socket_error_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_error(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_socket_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sock_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_saddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_daddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_socket_error, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_error_format(); - rpc_socket_error_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_socket_error, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_error_format(); - rpc_socket_error_func(msg, data, size, format); - }); - -template -void rpc_socket_reset_connection_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_error(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_socket_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sock_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_saddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_daddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_socket_reset_connection, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_reset_connection_format(); - rpc_socket_reset_connection_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_socket_reset_connection, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_reset_connection_format(); - rpc_socket_reset_connection_func(msg, data, size, format); - }); - -template -void rpc_socket_shutdown_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_socket_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sock_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_saddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_daddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_socket_shutdown, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_shutdown_format(); - rpc_socket_shutdown_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_socket_shutdown, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_shutdown_format(); - rpc_socket_shutdown_func(msg, data, size, format); - }); - -template -void rpc_socket_state_change_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_socket_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sock_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_saddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_daddr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_socket_state_change, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_state_change_format(); - rpc_socket_state_change_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_socket_state_change, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_socket_state_change_format(); - rpc_socket_state_change_func(msg, data, size, format); - }); - -template -void rpc_task_begin_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_action(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_runstate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_task_begin, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_begin_format(); - rpc_task_begin_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_task_begin, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_begin_format(); - rpc_task_begin_func(msg, data, size, format); -}); - -template -void rpc_task_complete_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_action(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_runstate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_task_complete, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_complete_format(); - rpc_task_complete_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_task_complete, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_complete_format(); - rpc_task_complete_func(msg, data, size, format); - }); - -template -void rpc_task_run_action_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_action(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_runstate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_task_run_action, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_run_action_format(); - rpc_task_run_action_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_task_run_action, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_run_action_format(); - rpc_task_run_action_func(msg, data, size, format); - }); - -template -void rpc_task_sleep_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timeout(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_runstate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_q_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_task_sleep, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_sleep_format(); - rpc_task_sleep_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_task_sleep, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_sleep_format(); - rpc_task_sleep_func(msg, data, size, format); -}); - -template -void rpc_task_wakeup_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timeout(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_runstate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_q_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(rpc_task_wakeup, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_wakeup_format(); - rpc_task_wakeup_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(rpc_task_wakeup, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_rpc_task_wakeup_format(); - rpc_task_wakeup_func(msg, data, size, format); -}); - -template -void svc_process_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_xid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_vers(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_proc(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_service(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_procedure(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_addr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(svc_process, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_process_format(); - svc_process_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(svc_process, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_process_format(); - svc_process_func(msg, data, size, format); -}); - -template -void svc_send_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_server(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_netns_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_xid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(svc_send, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_send_format(); - svc_send_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(svc_send, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_send_format(); - svc_send_func(msg, data, size, format); -}); - -template -void svc_wake_up_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(svc_wake_up, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_wake_up_format(); - svc_wake_up_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(svc_wake_up, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_wake_up_format(); - svc_wake_up_func(msg, data, size, format); -}); - -template -void svc_xprt_dequeue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_server(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_netns_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_wakeup(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(svc_xprt_dequeue, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_xprt_dequeue_format(); - svc_xprt_dequeue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(svc_xprt_dequeue, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_svc_xprt_dequeue_format(); - svc_xprt_dequeue_func(msg, data, size, format); - }); - -template -void xprt_lookup_rqst_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_xid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_addr(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_port(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(xprt_lookup_rqst, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_xprt_lookup_rqst_format(); - xprt_lookup_rqst_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(xprt_lookup_rqst, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_xprt_lookup_rqst_format(); - xprt_lookup_rqst_func(msg, data, size, format); - }); - -template -void xprt_transmit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_task_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_client_id(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_xid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_seqno(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_status(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(xprt_transmit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_xprt_transmit_format(); - xprt_transmit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(xprt_transmit, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_xprt_transmit_format(); - xprt_transmit_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_task_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_task_event_parser.cpp deleted file mode 100644 index 1537353f7..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_task_event_parser.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void task_newtask_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_comm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_clone_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_oom_score_adj(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(task_newtask, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_task_newtask_format(); - task_newtask_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(task_newtask, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_task_newtask_format(); - task_newtask_func(msg, data, size, format); -}); - -template -void task_rename_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_oldcomm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_newcomm(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_oom_score_adj(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(task_rename, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_task_rename_format(); - task_rename_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(task_rename, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_task_rename_format(); - task_rename_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_timer_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_timer_event_parser.cpp deleted file mode 100644 index 2e65d7367..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_timer_event_parser.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void hrtimer_cancel_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_hrtimer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(hrtimer_cancel, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_cancel_format(); - hrtimer_cancel_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(hrtimer_cancel, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_cancel_format(); - hrtimer_cancel_func(msg, data, size, format); -}); - -template -void hrtimer_expire_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_hrtimer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_now(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_function(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(hrtimer_expire_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_expire_entry_format(); - hrtimer_expire_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(hrtimer_expire_entry, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_expire_entry_format(); - hrtimer_expire_entry_func(msg, data, size, format); - }); - -template -void hrtimer_expire_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_hrtimer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(hrtimer_expire_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_expire_exit_format(); - hrtimer_expire_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(hrtimer_expire_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_expire_exit_format(); - hrtimer_expire_exit_func(msg, data, size, format); - }); - -template -void hrtimer_init_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_hrtimer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_clockid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(hrtimer_init, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_init_format(); - hrtimer_init_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(hrtimer_init, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_init_format(); - hrtimer_init_func(msg, data, size, format); -}); - -template -void hrtimer_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_hrtimer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_function(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_expires(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_softexpires(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(hrtimer_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_start_format(); - hrtimer_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(hrtimer_start, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_hrtimer_start_format(); - hrtimer_start_func(msg, data, size, format); -}); - -template -void itimer_expire_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_which(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_now(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(itimer_expire, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_itimer_expire_format(); - itimer_expire_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(itimer_expire, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_itimer_expire_format(); - itimer_expire_func(msg, data, size, format); -}); - -template -void itimer_state_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_which(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_expires(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_value_sec(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_value_nsec(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_interval_sec(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_interval_nsec(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(itimer_state, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_itimer_state_format(); - itimer_state_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(itimer_state, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_itimer_state_format(); - itimer_state_func(msg, data, size, format); -}); - -template -void timer_cancel_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_timer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(timer_cancel, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_cancel_format(); - timer_cancel_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(timer_cancel, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_cancel_format(); - timer_cancel_func(msg, data, size, format); -}); - -template -void timer_expire_entry_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_timer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_now(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_function(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_baseclk(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(timer_expire_entry, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_expire_entry_format(); - timer_expire_entry_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(timer_expire_entry, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_expire_entry_format(); - timer_expire_entry_func(msg, data, size, format); - }); - -template -void timer_expire_exit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_timer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(timer_expire_exit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_expire_exit_format(); - timer_expire_exit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(timer_expire_exit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_expire_exit_format(); - timer_expire_exit_func(msg, data, size, format); - }); - -template -void timer_init_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_timer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(timer_init, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_init_format(); - timer_init_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(timer_init, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_init_format(); - timer_init_func(msg, data, size, format); -}); - -template -void timer_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_timer(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_function(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_expires(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_now(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(timer_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_start_format(); - timer_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(timer_start, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_timer_start_format(); - timer_start_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_v4l2_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_v4l2_event_parser.cpp deleted file mode 100644 index 671e74858..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_v4l2_event_parser.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void v4l2_dqbuf_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytesused(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_field(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timestamp(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_frames(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_seconds(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_minutes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_hours(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits0(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits1(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits2(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits3(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sequence(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(v4l2_dqbuf, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_v4l2_dqbuf_format(); - v4l2_dqbuf_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(v4l2_dqbuf, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_v4l2_dqbuf_format(); - v4l2_dqbuf_func(msg, data, size, format); -}); - -template -void v4l2_qbuf_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bytesused(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_field(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timestamp(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_frames(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_seconds(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_minutes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_hours(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits0(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits1(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits2(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits3(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sequence(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(v4l2_qbuf, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_v4l2_qbuf_format(); - v4l2_qbuf_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(v4l2_qbuf, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_v4l2_qbuf_format(); - v4l2_qbuf_func(msg, data, size, format); -}); - -template -void vb2_v4l2_buf_done_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_field(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timestamp(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_frames(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_seconds(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_minutes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_hours(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits0(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits1(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits2(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits3(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sequence(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(vb2_v4l2_buf_done, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_buf_done_format(); - vb2_v4l2_buf_done_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(vb2_v4l2_buf_done, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_buf_done_format(); - vb2_v4l2_buf_done_func(msg, data, size, format); - }); - -template -void vb2_v4l2_buf_queue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_field(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timestamp(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_frames(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_seconds(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_minutes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_hours(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits0(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits1(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits2(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits3(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sequence(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(vb2_v4l2_buf_queue, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_buf_queue_format(); - vb2_v4l2_buf_queue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(vb2_v4l2_buf_queue, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_buf_queue_format(); - vb2_v4l2_buf_queue_func(msg, data, size, format); - }); - -template -void vb2_v4l2_dqbuf_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_field(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timestamp(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_frames(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_seconds(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_minutes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_hours(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits0(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits1(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits2(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits3(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sequence(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(vb2_v4l2_dqbuf, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_dqbuf_format(); - vb2_v4l2_dqbuf_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(vb2_v4l2_dqbuf, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_dqbuf_format(); - vb2_v4l2_dqbuf_func(msg, data, size, format); -}); - -template -void vb2_v4l2_qbuf_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_minor(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_field(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timestamp(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_type(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_frames(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_seconds(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_minutes(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_hours(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits0(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits1(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits2(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_timecode_userbits3(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sequence(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(vb2_v4l2_qbuf, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_qbuf_format(); - vb2_v4l2_qbuf_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(vb2_v4l2_qbuf, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_vb2_v4l2_qbuf_format(); - vb2_v4l2_qbuf_func(msg, data, size, format); -}); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_vmscan_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_vmscan_event_parser.cpp deleted file mode 100644 index b7cede9ff..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_vmscan_event_parser.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void mm_shrink_slab_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_shr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_shrink(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_unused_scan(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_new_scan(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_retval(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_total_scan(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_shrink_slab_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_shrink_slab_end_format(); - mm_shrink_slab_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_shrink_slab_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_shrink_slab_end_format(); - mm_shrink_slab_end_func(msg, data, size, format); - }); - -template -void mm_shrink_slab_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_shr(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_shrink(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_objects_to_shrink(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gfp_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cache_items(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_delta(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_total_scan(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_priority(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_shrink_slab_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_shrink_slab_start_format(); - mm_shrink_slab_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_shrink_slab_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_shrink_slab_start_format(); - mm_shrink_slab_start_func(msg, data, size, format); - }); - -template -void mm_vmscan_direct_reclaim_begin_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gfp_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_vmscan_direct_reclaim_begin, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_direct_reclaim_begin_format(); - mm_vmscan_direct_reclaim_begin_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_vmscan_direct_reclaim_begin, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_direct_reclaim_begin_format(); - mm_vmscan_direct_reclaim_begin_func(msg, data, size, format); - }); - -template -void mm_vmscan_direct_reclaim_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_nr_reclaimed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_vmscan_direct_reclaim_end, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_direct_reclaim_end_format(); - mm_vmscan_direct_reclaim_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_vmscan_direct_reclaim_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_direct_reclaim_end_format(); - mm_vmscan_direct_reclaim_end_func(msg, data, size, format); - }); - -template -void mm_vmscan_kswapd_sleep_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_vmscan_kswapd_sleep, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_kswapd_sleep_format(); - mm_vmscan_kswapd_sleep_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_vmscan_kswapd_sleep, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_kswapd_sleep_format(); - mm_vmscan_kswapd_sleep_func(msg, data, size, format); - }); - -template -void mm_vmscan_kswapd_wake_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_zid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_vmscan_kswapd_wake, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_kswapd_wake_format(); - mm_vmscan_kswapd_wake_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_vmscan_kswapd_wake, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_kswapd_wake_format(); - mm_vmscan_kswapd_wake_func(msg, data, size, format); - }); - -template -void mm_vmscan_lru_isolate_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_highest_zoneidx(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_requested(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_scanned(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_skipped(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_taken(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_isolate_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_lru(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_vmscan_lru_isolate, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_lru_isolate_format(); - mm_vmscan_lru_isolate_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_vmscan_lru_isolate, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_lru_isolate_format(); - mm_vmscan_lru_isolate_func(msg, data, size, format); - }); - -template -void mm_vmscan_lru_shrink_inactive_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_scanned(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_reclaimed(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_dirty(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_writeback(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_congested(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_immediate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_activate0(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_activate1(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_ref_keep(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_unmap_fail(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_priority(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reclaim_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_vmscan_lru_shrink_inactive, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_lru_shrink_inactive_format(); - mm_vmscan_lru_shrink_inactive_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_vmscan_lru_shrink_inactive, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_lru_shrink_inactive_format(); - mm_vmscan_lru_shrink_inactive_func(msg, data, size, format); - }); - -template -void mm_vmscan_wakeup_kswapd_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_nid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_zid(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_order(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_gfp_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(mm_vmscan_wakeup_kswapd, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_wakeup_kswapd_format(); - mm_vmscan_wakeup_kswapd_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(mm_vmscan_wakeup_kswapd, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_mm_vmscan_wakeup_kswapd_format(); - mm_vmscan_wakeup_kswapd_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_workqueue_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_workqueue_event_parser.cpp deleted file mode 100644 index 24f1395ca..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_workqueue_event_parser.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void workqueue_activate_work_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_work(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(workqueue_activate_work, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_activate_work_format(); - workqueue_activate_work_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(workqueue_activate_work, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_activate_work_format(); - workqueue_activate_work_func(msg, data, size, format); - }); - -template -void workqueue_execute_end_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_work(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_function(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(workqueue_execute_end, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_execute_end_format(); - workqueue_execute_end_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(workqueue_execute_end, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_execute_end_format(); - workqueue_execute_end_func(msg, data, size, format); - }); - -template -void workqueue_execute_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_work(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_function(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(workqueue_execute_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_execute_start_format(); - workqueue_execute_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(workqueue_execute_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_execute_start_format(); - workqueue_execute_start_func(msg, data, size, format); - }); - -template -void workqueue_queue_work_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_work(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_function(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_workqueue(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_req_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cpu(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(workqueue_queue_work, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_queue_work_format(); - workqueue_queue_work_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(workqueue_queue_work, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_workqueue_queue_work_format(); - workqueue_queue_work_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_writeback_event_parser.cpp b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_writeback_event_parser.cpp deleted file mode 100644 index f865aac39..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/event_parsers/ftrace_writeback_event_parser.cpp +++ /dev/null @@ -1,575 +0,0 @@ -/* THIS FILE IS GENERATE BY ftrace_cpp_generator.py, PLEASE DON'T EDIT IT! - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub_event_parser.h" - -FTRACE_NS_BEGIN -namespace { -using namespace OHOS::Developtools::Profiler; -template -void balance_dirty_pages_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_bdi(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_limit(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_setpoint(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirty(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bdi_setpoint(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_bdi_dirty(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirty_ratelimit(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_task_ratelimit(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied_pause(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_paused(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pause(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_period(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_think(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(balance_dirty_pages, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_balance_dirty_pages_format(); - balance_dirty_pages_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(balance_dirty_pages, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_balance_dirty_pages_format(); - balance_dirty_pages_func(msg, data, size, format); - }); - -template -void bdi_dirty_ratelimit_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_bdi(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_write_bw(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_avg_write_bw(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirty_rate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirty_ratelimit(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_task_ratelimit(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_balanced_dirty_ratelimit(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(bdi_dirty_ratelimit, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_bdi_dirty_ratelimit_format(); - bdi_dirty_ratelimit_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(bdi_dirty_ratelimit, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_bdi_dirty_ratelimit_format(); - bdi_dirty_ratelimit_func(msg, data, size, format); - }); - -template -void global_dirty_state_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_nr_dirty(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_writeback(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_background_thresh(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirty_thresh(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirty_limit(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_dirtied(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_written(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(global_dirty_state, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_global_dirty_state_format(); - global_dirty_state_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(global_dirty_state, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_global_dirty_state_format(); - global_dirty_state_func(msg, data, size, format); - }); - -template -void wbc_writepage_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_nr_to_write(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_pages_skipped(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_kupdate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_background(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_reclaim(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_cyclic(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_start(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_end(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(wbc_writepage, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_wbc_writepage_format(); - wbc_writepage_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(wbc_writepage, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_wbc_writepage_format(); - wbc_writepage_func(msg, data, size, format); -}); - -template -void writeback_bdi_register_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_bdi_register, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_bdi_register_format(); - writeback_bdi_register_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_bdi_register, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_bdi_register_format(); - writeback_bdi_register_func(msg, data, size, format); - }); - -template -void writeback_dirty_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_dirty_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_dirty_inode_format(); - writeback_dirty_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_dirty_inode, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_dirty_inode_format(); - writeback_dirty_inode_func(msg, data, size, format); - }); - -template -void writeback_dirty_inode_enqueue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied_when(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_dirty_inode_enqueue, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_dirty_inode_enqueue_format(); - writeback_dirty_inode_enqueue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_dirty_inode_enqueue, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_dirty_inode_enqueue_format(); - writeback_dirty_inode_enqueue_func(msg, data, size, format); - }); - -template -void writeback_dirty_inode_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_dirty_inode_start, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_dirty_inode_start_format(); - writeback_dirty_inode_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_dirty_inode_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_dirty_inode_start_format(); - writeback_dirty_inode_start_func(msg, data, size, format); - }); - -template -void writeback_exec_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_nr_pages(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sb_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_kupdate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_cyclic(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_background(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reason(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_exec, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_exec_format(); - writeback_exec_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_exec, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_exec_format(); - writeback_exec_func(msg, data, size, format); -}); - -template -void writeback_lazytime_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied_when(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_lazytime, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_lazytime_format(); - writeback_lazytime_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_lazytime, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_lazytime_format(); - writeback_lazytime_func(msg, data, size, format); - }); - -template -void writeback_lazytime_iput_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied_when(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_lazytime_iput, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_lazytime_iput_format(); - writeback_lazytime_iput_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_lazytime_iput, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_lazytime_iput_format(); - writeback_lazytime_iput_func(msg, data, size, format); - }); - -template -void writeback_mark_inode_dirty_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_flags(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_mark_inode_dirty, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_mark_inode_dirty_format(); - writeback_mark_inode_dirty_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_mark_inode_dirty, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_mark_inode_dirty_format(); - writeback_mark_inode_dirty_func(msg, data, size, format); - }); - -template -void writeback_pages_written_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_pages(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_pages_written, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_pages_written_format(); - writeback_pages_written_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_pages_written, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_pages_written_format(); - writeback_pages_written_func(msg, data, size, format); - }); - -template -void writeback_queue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_nr_pages(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sb_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_kupdate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_cyclic(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_background(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reason(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_queue, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_queue_format(); - writeback_queue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_queue, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_queue_format(); - writeback_queue_func(msg, data, size, format); -}); - -template -void writeback_queue_io_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_older(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_age(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_moved(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reason(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_queue_io, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_queue_io_format(); - writeback_queue_io_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_queue_io, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_queue_io_format(); - writeback_queue_io_func(msg, data, size, format); - }); - -template -void writeback_sb_inodes_requeue_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied_when(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_sb_inodes_requeue, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_sb_inodes_requeue_format(); - writeback_sb_inodes_requeue_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_sb_inodes_requeue, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_sb_inodes_requeue_format(); - writeback_sb_inodes_requeue_func(msg, data, size, format); - }); - -template -void writeback_single_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied_when(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_writeback_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_to_write(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_wrote(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_single_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_single_inode_format(); - writeback_single_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_single_inode, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_single_inode_format(); - writeback_single_inode_func(msg, data, size, format); - }); - -template -void writeback_single_inode_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_state(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_dirtied_when(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_writeback_index(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_nr_to_write(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_wrote(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_single_inode_start, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_single_inode_start_format(); - writeback_single_inode_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_single_inode_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_single_inode_start_format(); - writeback_single_inode_start_func(msg, data, size, format); - }); - -template -void writeback_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_nr_pages(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sb_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_kupdate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_cyclic(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_background(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reason(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_start, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_start_format(); - writeback_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_start, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_start_format(); - writeback_start_func(msg, data, size, format); -}); - -template -void writeback_wait_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_nr_pages(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sb_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_kupdate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_cyclic(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_background(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reason(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_wait, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_wait_format(); - writeback_wait_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_wait, [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_wait_format(); - writeback_wait_func(msg, data, size, format); -}); - -template -void writeback_wake_background_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_wake_background, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_wake_background_format(); - writeback_wake_background_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_wake_background, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_wake_background_format(); - writeback_wake_background_func(msg, data, size, format); - }); - -template -void writeback_write_inode_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_write_inode, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_write_inode_format(); - writeback_write_inode_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_write_inode, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_write_inode_format(); - writeback_write_inode_func(msg, data, size, format); - }); - -template -void writeback_write_inode_start_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_write_inode_start, [](FtraceEvent &ftraceEvent, uint8_t data[], - size_t size, const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_write_inode_start_format(); - writeback_write_inode_start_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_write_inode_start, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_write_inode_start_format(); - writeback_write_inode_start_func(msg, data, size, format); - }); - -template -void writeback_written_func(T &msg, uint8_t data[], size_t size, const EventFormat &format) -{ - int i = 0; - msg->set_name(FtraceFieldParser::ParseStrField(format.fields, i++, data, size)); - msg->set_nr_pages(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sb_dev(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_sync_mode(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_kupdate(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_range_cyclic(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_for_background(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_reason(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); - msg->set_cgroup_ino(FtraceFieldParser::ParseIntField(format.fields, i++, data, size)); -} -REGISTER_FTRACE_EVENT_PARSE_FUNCTION(writeback_written, [](FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_written_format(); - writeback_written_func(msg, data, size, format); -}); -REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION(writeback_written, - [](ProtoEncoder::FtraceEvent &ftraceEvent, uint8_t data[], size_t size, - const EventFormat &format) { - auto msg = ftraceEvent.mutable_writeback_written_format(); - writeback_written_func(msg, data, size, format); - }); -} // namespace -FTRACE_NS_END diff --git a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/ftrace_cpp_generator.py b/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/ftrace_cpp_generator.py deleted file mode 100644 index dc0f56547..000000000 --- a/device/plugins/ftrace_plugin/tools/device_kernel_version/6.6.30/ftrace_cpp_generator.py +++ /dev/null @@ -1,918 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import os -import subprocess -import sys -import argparse -import logging -sys.path.append(os.getcwd()) -sys.path.append("../../") -from ftrace_format_parser import FtraceEventCodeGenerator -from ftrace_format_parser import ProtoType - - -class Common: - auto_generated_gni = "autogenerated.gni" - - this_file = os.path.basename(__file__) - logging.basicConfig( - format="%(asctime)s %(levelname)s %(message)s", level=logging.INFO - ) - logger = logging.getLogger(this_file) - - cpp_copyright_header = ( - "" - "/* THIS FILE IS GENERATE BY {}, PLEASE DON'T EDIT IT!\n" - " * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.\n" - ' * Licensed under the Apache License, Version 2.0 (the "License");\n' - " * you may not use this file except in compliance with the License.\n" - " * You may obtain a copy of the License at\n" - " *\n" - " * http://www.apache.org/licenses/LICENSE-2.0\n" - " *\n" - " * Unless required by applicable law or agreed to in writing, software\n" - ' * distributed under the License is distributed on an "AS IS" BASIS,\n' - " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" - " * See the License for the specific language governing permissions and\n" - " * limitations under the License.\n" - " */\n".format(this_file) - ) - - gn_copyright_header = ( - "" - "# THIS FILE IS GENERATE BY {}, PLEASE DON'T EDIT IT!\n" - "# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.\n" - '# Licensed under the Apache License, Version 2.0 (the "License");\n' - "# you may not use this file except in compliance with the License.\n" - "# You may obtain a copy of the License at\n" - "#\n" - "# http://www.apache.org/licenses/LICENSE-2.0\n" - "#\n" - "# Unless required by applicable law or agreed to in writing, software\n" - '# distributed under the License is distributed on an "AS IS" BASIS,\n' - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" - "# See the License for the specific language governing permissions and\n" - "# limitations under the License.\n".format(this_file) - ) - - parse_function_args = "{}, {}, {})".format( - "uint8_t data[]", - "size_t size", - "const EventFormat& format", - ) - parse_register_macro = "REGISTER_FTRACE_EVENT_PARSE_FUNCTION" - parse_register_encoder_macro = "REGISTER_FTRACE_EVENT_PARSE_ENCODER_FUNCTION" - - check_function_args = "(const ForStandard::FtraceEvent& event) -> bool" - format_function_args = "(const ForStandard::FtraceEvent& event) -> std::string" - format_register_macro = "REGISTER_FTRACE_EVENT_FORMATTER" - - -def to_camel_case(name): - return "".join([p.capitalize() for p in name.split("_")]) - - -def fix_field_name(name): - replace_map = { - "errno": "error_code", - "sa_handler": "sig_handler", - "sa_flags": "sig_flags", - "new": "seq_new", - } - if name in replace_map: - name = replace_map.get(name) - return str.lower(name) - - -def ensure_dir_exists(file_path): - file_dir = os.path.dirname(file_path) - if not os.path.exists(file_dir): - os.mkdir(file_dir) - - -class EventParserCodeGenerator(FtraceEventCodeGenerator): - def __init__(self, events_dir, allow_list): - super().__init__(events_dir, allow_list) - - def parser_file_path(self, category): - file_name = "ftrace_{}_event_parser.cpp".format(category) - return os.path.join(self.output_dir, file_name) - - def generate_code(self): - generated_cpp_sources = [] - - for event in self.target_event_formats: - type_name = "{}/{}".format(event.category, event.name) - Common.logger.info('ftrace_events: "{}"'.format(type_name)) - - # generate sub event parser code - for category in self.grouped_event_formats: - parser_src_file = self.parser_file_path(category) - generated_cpp_sources.append(parser_src_file) - - Common.logger.info("Generate {} ...".format(parser_src_file)) - ensure_dir_exists(parser_src_file) - - with open(parser_src_file, "w", encoding="utf-8") as f: - f.write(Common.cpp_copyright_header) - f.write('#include "sub_event_parser.h"\n') - f.write("\n") - f.write("FTRACE_NS_BEGIN\n") - f.write("namespace {\n") - f.write("using namespace OHOS::Developtools::Profiler;\n") - self.generate_parse_functions(category, f) - f.write("} // namespace\n") - f.write("FTRACE_NS_END\n") - f.write("\n") - - # generate .gni - generated_cpp_gni = os.path.join(self.output_dir, Common.auto_generated_gni) - Common.logger.info("Generate {} ...".format(generated_cpp_gni)) - with open(generated_cpp_gni, "w", encoding="utf-8") as f: - f.write(Common.gn_copyright_header) - f.write("\n") - f.write("auto_generated_cpp_sources = [\n") - for path in generated_cpp_sources: - src = "{}".format(os.path.basename(path)) - f.write(' "{}",\n'.format(src)) - f.write("]\n") - - def generate_parse_functions(self, category, f): - count = 0 - if category not in self.grouped_event_formats.keys(): - return - for event in self.grouped_event_formats[category]: - count += 1 - if count > 1: - f.write("\n") - f.write("template \n") - f.write("void {}_func(T& msg, {}\n".format(event.name, Common.parse_function_args)) - f.write("{\n int i = 0;\n") - for i in range(len(event.remain_fields)): - self.generate_parse_field_lines(event, f, i) - f.write("}\n") - f.write("{}({},\n".format(Common.parse_register_macro, event.name)) - f.write("[] (FtraceEvent& ftraceEvent, {} {{\n".format(Common.parse_function_args)) - f.write( - " auto msg = ftraceEvent.mutable_{}_format();\n".format( - str.lower(event.name) - ) - ) - f.write(" {}_func(msg, data, size, format);\n".format(event.name)) - f.write("});\n") - f.write("{}({},\n".format(Common.parse_register_encoder_macro, event.name)) - f.write("[] (ProtoEncoder::FtraceEvent& ftraceEvent, {} {{\n".format(Common.parse_function_args)) - f.write( - " auto msg = ftraceEvent.mutable_{}_format();\n".format( - str.lower(event.name) - ) - ) - f.write(" {}_func(msg, data, size, format);\n".format(event.name)) - f.write("});\n") - - @staticmethod - def generate_parse_field_lines(event, f, i): - field_info = event.remain_fields[i] - field_name = fix_field_name(field_info.name) - type_info = field_info.to_proto_type() - parse_func = None - if type_info.tid == ProtoType.STRING: - parse_func = "ParseStrField" - elif type_info.tid == ProtoType.ARRAY: - parse_func = "ParseVectorIntField" - elif type_info.tid == ProtoType.INTEGER: - if type_info.size in [4, 8]: - c_type = None - if type_info.size == 4: - c_type = "int32_t" if type_info.signed else "uint32_t" - elif type_info.size == 8: - c_type = "int64_t" if type_info.signed else "uint64_t" - parse_func = "ParseIntField<{}>".format(c_type) - elif type_info.tid != ProtoType.INVALID: - Common.logger.warning( - "WARNING: unkown proto type:{} {}".format(event.name, field_name) - ) - if parse_func is not None: - if type_info.tid == ProtoType.ARRAY: - f.write( - " std::vector retvalVec = FtraceFieldParser::ParseVectorIntField" - "(format.fields, i++, data, size);" - ) - f.write(" for (size_t i = 0; i < retvalVec.size(); i++) {") - f.write(" msg->add_{}(retvalVec[i]);".format(field_name)) - f.write(" }") - else: - f.write(" msg->set_{}(FtraceFieldParser::".format(field_name)) - f.write("{}(format.fields, i++, data, size));\n".format(parse_func)) - - -class EventFormatterCodeGenerator(FtraceEventCodeGenerator): - def __init__(self, events_dir, allow_list): - super().__init__(events_dir, allow_list) - - def formatter_file_path(self, category): - file_name = "ftrace_{}_event_formatter.cpp".format(category) - return os.path.join(self.output_dir, file_name) - - def generate_code(self): - generated_cpp_sources = [] - - # generate sub event parser code - for category in self.grouped_event_formats: - formatter_src_file = self.formatter_file_path(category) - generated_cpp_sources.append(formatter_src_file) - - Common.logger.info("Generate {} ...".format(formatter_src_file)) - ensure_dir_exists(formatter_src_file) - - with open(formatter_src_file, "w", encoding="utf-8") as f: - f.write(Common.cpp_copyright_header) - f.write("#include \n") - f.write("\n") - f.write('#include "event_formatter.h"\n') - if category == "binder": - f.write('#include "binder.h"\n') - f.write('#include "logging.h"\n') - if category == "f2fs": - f.write('#include "f2fs.h"\n') - elif category == "power": - f.write('#include "pm_qos.h"\n') - elif category == "writeback": - f.write('#include "pq.h"\n') - elif ( - (category == "compaction") - | (category == "kmem") - | (category == "vmscan") - ): - f.write('#include "type.h"\n') - elif category == "timer": - f.write('#include "hrtimer.h"\n') - f.write('#include "trace_events.h"\n') - f.write("\n") - f.write("FTRACE_NS_BEGIN\n") - f.write("namespace {\n") - f.write("const int BUFFER_SIZE = 512;\n") - f.write("\n") - self.generate_format_functions(category, f) - f.write("} // namespace\n") - f.write("FTRACE_NS_END\n") - f.write("\n") - - # generate .gni - generated_cpp_gni = os.path.join(self.output_dir, Common.auto_generated_gni) - Common.logger.info("Generate {} ...".format(generated_cpp_gni)) - with open(generated_cpp_gni, "w", encoding="utf-8") as f: - f.write(Common.gn_copyright_header) - f.write("\n") - f.write("auto_generated_cpp_sources = [\n") - for path in generated_cpp_sources: - src = "{}".format(os.path.basename(path)) - f.write(' "{}",\n'.format(src)) - f.write("]\n") - - def generate_format_functions(self, category, f): - count = 0 - for event in self.grouped_event_formats.get(category): - count += 1 - if count > 1: - f.write("\n") - f.write( - "{}({},\n".format(Common.format_register_macro, str.lower(event.name)) - ) - f.write( - "[] {} {{\n".format( - Common.check_function_args, - ) - ) - f.write(" return event.has_{}_format();".format(str.lower(event.name))) - f.write("},") # end of check function - f.write("[] {} {{\n".format(Common.format_function_args)) - f.write(" auto msg = event.{}_format();\n".format(str.lower(event.name))) - f.write(" char buffer[BUFFER_SIZE] = {0};\n") - event.print_fmt = '"{}: {}'.format(event.name, event.print_fmt[2:]) - event.print_fmt = str.replace(event.print_fmt, "%zu", '%" PRIu64 "') - event.print_fmt = str.replace(event.print_fmt, "%zd", '%" PRIu64 "') - event.print_fmt = str.replace(event.print_fmt, "%llu", '%" PRIu64 "') - event.print_fmt = str.replace(event.print_fmt, "%lld", '%" PRIu64 "') - event.print_fmt = str.replace(event.print_fmt, "%lx", '%" PRIx64 "') - event.print_fmt = str.replace(event.print_fmt, "%llx", '%" PRIx64 "') - event.print_fmt = str.replace(event.print_fmt, "(unsigned long long)", "") - - if (category == "kmem") | (category == "filemap"): - event.print_fmt = str.replace(event.print_fmt, "page=%p", "page=%s") - event.print_fmt = str.replace( - event.print_fmt, - "REC->pfn != -1UL ? (((struct page *)vmemmap_base) + " - "(REC->pfn)): ((void *)0)", - '"0000000000000000"', - ) - event.print_fmt = str.replace( - event.print_fmt, - "(((struct page *)vmemmap_base) + (REC->pfn))", - "\ - " - '"0000000000000000"', - ) - event.print_fmt = str.replace(event.print_fmt, " (void *)", " ") - event.print_fmt = str.replace(event.print_fmt, ' name=%s"', '"') - event.print_fmt = str.replace( - event.print_fmt, "REC->ptr, __get_str(name)", "REC->ptr" - ) - event.print_fmt = str.replace(event.print_fmt, "%lu", '%" PRIu64 "') - elif category == "filelock": - event.print_fmt = str.replace(event.print_fmt, "=%lu", '=%" PRIu64 "') - event.print_fmt = str.replace( - event.print_fmt, "REC->fl_blocker", "msg.fl_next()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->fl_owner", "msg.fl_owner()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->fl_flags", "msg.fl_flags()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->fl_type", "msg.fl_type()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->fl_break_time", "msg.fl_break_time()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->fl_downgrade_time", "msg.fl_downgrade_time()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->rcount", "msg.dcount()" - ) - elif category == "ext4": - event.print_fmt = str.replace(event.print_fmt, "%lu", '%" PRIu64 "') - event.print_fmt = str.replace(event.print_fmt, ", (unsigned long)", ",") - elif category == "vmscan": - event.print_fmt = str.replace(event.print_fmt, "%ld", '%" PRIu64 "') - event.print_fmt = str.replace(event.print_fmt, "%lu", '%" PRIu64 "') - elif category == "writeback": - event.print_fmt = str.replace( - event.print_fmt, ", (unsigned long)", ", " - ) - event.print_fmt = str.replace( - event.print_fmt, "cgroup_ino=%lu", 'cgroup_ino=%" PRId32 "' - ) - event.print_fmt = str.replace(event.print_fmt, "%lu", '%" PRIu64 "') - event.print_fmt = str.replace(event.print_fmt, "%ld", '%" PRIu64 "') - elif category == "sunrpc": - event.print_fmt = str.replace(event.print_fmt, "=%lu", '=%" PRIu64 "') - elif category == "sched": - event.print_fmt = str.replace(event.print_fmt, "%Lu", '%" PRIu64 "') - elif category == "ftrace": - event.print_fmt = str.replace(event.print_fmt, "(unsigned long)", "") - - page_str = ' "0000000000000000"' - if event.name == "binder_command": - event.print_fmt = '"binder_command: cmd=0x%x", msg.cmd()' - elif event.name == "binder_return": - event.print_fmt = '"binder_return: cmd=0x%x", msg.cmd()' - elif (event.name == "task_newtask") | (event.name == "task_rename"): - event.print_fmt = str.replace( - event.print_fmt, "oom_score_adj=%hd", "oom_score_adj=%d" - ) - elif event.name == "branch_format": - event.print_fmt = ( - '"branch: %u:%s:%s (%u)%s", msg.line(), msg.func().c_str(), msg.file().c_str(), ' - 'msg.correct(), msg.constant() ? " CONSTANT": ""' - ) - elif (event.name == "mm_lru_activate") | (event.name == "mm_lru_insertion"): - event.print_fmt = str.replace( - event.print_fmt, "pfn=%lu", 'pfn=%" PRIu64 "' - ) - elif event.name == "sched_stick_numa": - event.print_fmt = ( - '"sched_stick_numa: src_pid=%d src_tgid=%d src_ngid=%d src_cpu=%d src_nid=%d ' - 'dst_pid=%d dst_tgid=%d dst_ngid=%d dst_cpu=%d dst_nid=%d", msg.pid(), msg.tgid(), msg.ngid(), ' - "msg.src_cpu(), msg.src_nid(), msg.pid(), msg.tgid(), msg.ngid(), msg.dst_cpu(), msg.dst_nid()" - ) - elif event.name == "workqueue_execute_end": - event.print_fmt = '"workqueue_execute_end: work struct 0x%" PRIx64 "", msg.work()' - elif event.name == "workqueue_queue_work": - event.print_fmt = str.replace( - event.print_fmt, "REC->workqueue", "msg.workqueue()" - ) - elif (event.name == "i2c_reply") | (event.name == "i2c_write"): - event.print_fmt = str.replace( - event.print_fmt, "l=%u [%*phD]", 'l=%" PRId32 " [%" PRId32 "]' - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->len, REC->len", "REC->len" - ) - elif ( - (event.name == "mm_compaction_isolate_freepages") - | (event.name == "mm_compaction_isolate_migratepages") - | (event.name == "mm_compaction_begin") - | (event.name == "mm_compaction_end") - | (event.name == "mm_compaction_migratepages") - ): - event.print_fmt = str.replace(event.print_fmt, "%lu", '=0x%" PRIu64 "') - elif ( - (event.name == "mm_compaction_defer_compaction") - | (event.name == "mm_compaction_defer_reset") - | (event.name == "mm_compaction_deferred") - | (event.name == "mm_compaction_end") - | (event.name == "mm_compaction_migratepages") - ): - event.print_fmt = str.replace( - event.print_fmt, "REC->order_failed", "msg.order_failed()" - ) - elif (event.name == "signal_deliver") | (event.name == "signal_generate"): - event.print_fmt = str.replace( - event.print_fmt, "REC->errno", "msg.error_code()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->sa_handler", "msg.sig_handler()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->sa_flags", "msg.sig_flags()" - ) - elif (event.name == "sys_enter") | (event.name == "sys_exit"): - event.print_fmt = str.replace(event.print_fmt, "%ld", '%" PRIu64 "') - elif event.name == "oom_score_adj_update": - event.print_fmt = str.replace( - event.print_fmt, "oom_score_adj=%hd", 'oom_score_adj=%" PRId32 "' - ) - elif event.name == "ext4_da_write_pages": - event.print_fmt = str.replace( - event.print_fmt, - 'first_page %" PRIu64 " nr_to_write %ld', - "first_page " '%" PRIu64 " nr_to_write %" PRIu64 "', - ) - elif event.name == "ext4_discard_preallocations": - event.print_fmt = str.replace( - event.print_fmt, - 'ino %" PRIu64 " len: %u needed %u', - "ino " '%" PRIu64 "', - ) - event.print_fmt = str.replace( - event.print_fmt, " REC->ino, REC->len, REC->needed", " REC->ino" - ) - elif ( - (event.name == "ext4_ext_remove_space_done") - | (event.name == "ext4_ext_rm_leaf") - | (event.name == "ext4_remove_blocks") - ): - event.print_fmt = str.replace( - event.print_fmt, - ' [pclu %" PRIu64 " lblk %u state %d]', - '%" ' 'PRIu64 "', - ) - event.print_fmt = str.replace( - event.print_fmt, - "(long long) REC->pc_pclu, " - "(unsigned int) REC->pc_lblk, (int) REC->pc_state", - "msg.partial()", - ) - elif event.name == "ext4_free_blocks": - event.print_fmt = str.replace( - event.print_fmt, 'count %" PRIu64 "', 'count %" PRIu64 "' - ) - elif event.name == "ext4_journal_start": - event.print_fmt = str.replace( - event.print_fmt, ", revoke_creds %d,", "," - ) - event.print_fmt = str.replace( - event.print_fmt, ", REC->revoke_creds,", "," - ) - elif event.name == "ext4_read_block_bitmap_load": - event.print_fmt = str.replace(event.print_fmt, "%u prefetch %d", "%u") - event.print_fmt = str.replace( - event.print_fmt, "REC->group, REC->prefetch", "msg.group()" - ) - elif event.name == "ext4_writepages": - event.print_fmt = str.replace( - event.print_fmt, "nr_to_write %ld", 'nr_to_write %" PRIu64 "' - ) - event.print_fmt = str.replace( - event.print_fmt, "pages_skipped %ld", 'pages_skipped %" PRIu64 "' - ) - elif event.name == "ext4_writepages_result": - event.print_fmt = str.replace( - event.print_fmt, "pages_skipped %ld", 'pages_skipped %" PRIu64 "' - ) - elif event.name == "ext4_load_inode": - event.print_fmt = str.replace( - event.print_fmt, "ino %ld", 'ino %" PRIu64 "' - ) - elif event.name == "itimer_state": - event.print_fmt = str.replace( - event.print_fmt, - "it_value=%ld.%06ld it_interval=%ld.%06ld", - 'it_value=%" PRIu64 "it_interval=%" PRIu64 "', - ) - event.print_fmt = str.replace( - event.print_fmt, - "REC->value_nsec / 1000L, REC->interval_sec, " - "REC->interval_nsec / 1000L", - "msg.interval_sec()", - ) - elif event.name == "timer_expire_entry": - event.print_fmt = str.replace( - event.print_fmt, "now=%lu baseclk=%lu", 'now=%" PRIu64 "' - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->now, REC->baseclk", "msg.now()" - ) - elif event.name == "timer_start": - event.print_fmt = str.replace( - event.print_fmt, - "expires=%lu [timeout=%ld]", - 'expires=%" PRIu64' ' " [timeout=%" PRIu64 "]', - ) - event.print_fmt = str.replace(event.print_fmt, ", (long)", ",") - elif (event.name == "mm_shrink_slab_end") | ( - event.name == "mm_shrink_slab_start" - ): - event.print_fmt = str.replace( - event.print_fmt, "REC->shrink", "msg.shrink()" - ) - elif event.name == "mm_vmscan_lru_shrink_inactive": - event.print_fmt = str.replace( - event.print_fmt, - "nr_activate_anon=%d nr_activate_file=%d", - 'nr_activate=%" PRIu64 "', - ) - event.print_fmt = str.replace( - event.print_fmt, - "REC->nr_activate0, REC->nr_activate1", - "\ - " - "msg.nr_activate()", - ) - elif event.name == "mm_vmscan_writepage": - event.print_fmt = str.replace(event.print_fmt, "page=%p", "page=%s") - print_fmt = (event.print_fmt[:56], event.print_fmt[3728:]) - event.print_fmt = page_str.join(print_fmt) - elif event.name == "mm_vmscan_lru_isolate": - event.print_fmt = str.replace( - event.print_fmt, "REC->highest_zoneidx", "msg.classzone_idx()" - ) - elif (event.name == "balance_dirty_pages") | ( - event.name == "bdi_dirty_ratelimit" - ): - event.print_fmt = str.replace( - event.print_fmt, "REC->bdi_dirty", "msg.bdi_dirty()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->bdi_setpoint", "msg.bdi_setpoint()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->dirty_ratelimit", "msg.dirty_ratelimit()" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->dirtied_pause", "msg.dirtied_pause()" - ) - elif event.name == "sched_migrate_task": - event.print_fmt = str.replace( - event.print_fmt, "dest_cpu=%d running=%d", "dest_cpu=%d" - ) - event.print_fmt = str.replace( - event.print_fmt, "REC->dest_cpu, REC->running", "msg.dest_cpu()" - ) - elif event.name == "ext4_find_delalloc_range": - event.print_fmt = str.replace( - event.print_fmt, "REC->found_blk", "msg.found_blk()" - ) - elif (event.name == "mm_filemap_add_to_page_cache") | ( - event.name == "mm_filemap_delete_from_page_cache" - ): - event.print_fmt = ( - '"{}: dev %" PRIu64 ":%" PRIu64 " ino 0x%" PRIx64 " page=%s pfn=%" PRIu64 " ' - 'ofs=%" PRIu64 "", (((msg.s_dev()) >> 20)), (((msg.s_dev()) & ((1U << 20) - 1))), ' - 'msg.i_ino(), "0000000000000000", msg.pfn(), msg.index() << 12'.format( - event.name - ) - ) - elif event.name == "ipi_raise": - event.print_fmt = str.replace( - event.print_fmt, "target_mask=%s", 'target_mask=%" PRIu64 "' - ) - event.print_fmt = str.replace( - event.print_fmt, "__get_bitmask(target_cpus)", "msg.target_cpus()" - ) - elif event.name == "mm_page_alloc": - print_fmt = (event.print_fmt[:80], event.print_fmt[630:]) - event.print_fmt = page_str.join(print_fmt) - elif event.name == "mm_page_alloc_extfrag": - print_fmt = (event.print_fmt[:183], event.print_fmt[700:]) - event.print_fmt = page_str.join(print_fmt) - elif event.name == "mm_page_alloc_zone_locked": - print_fmt = (event.print_fmt[:96], event.print_fmt[646:]) - event.print_fmt = page_str.join(print_fmt) - elif event.name == "mm_page_free": - print_fmt = (event.print_fmt[:51], event.print_fmt[568:]) - event.print_fmt = page_str.join(print_fmt) - elif event.name == "mm_page_free_batched": - print_fmt = (event.print_fmt[:58], event.print_fmt[575:]) - event.print_fmt = page_str.join(print_fmt) - elif event.name == "mm_page_pcpu_drain": - print_fmt = (event.print_fmt[:72], event.print_fmt[589:]) - event.print_fmt = page_str.join(print_fmt) - elif event.name == "xprt_transmit": - event.print_fmt = ( - '"xprt_transmit: xid=0x%08x status=%d", msg.xid(), msg.status()' - ) - elif event.name == "rss_stat": - event.print_fmt = str.replace( - event.print_fmt, "size=%ldB", 'size=%" PRIu64 "B' - ) - elif event.name == "file_check_and_advance_wb_err": - event.print_fmt = str.replace( - event.print_fmt, "REC->new", "msg.seq_new()" - ) - elif event.name == "f2fs_sync_file_enter": - event.print_fmt = str.replace( - event.print_fmt, "i_mode = 0x%hx", "i_mode = 0x%x" - ) - elif (event.name == "wakeup_source_activate") | ( - event.name == "wakeup_source_deactivate" - ): - event.print_fmt = str.replace(event.print_fmt, "(unsigned long)", "") - elif event.name == "print": - f.write(" std::string fieldBuf = msg.buf();\n") - f.write( - " if (fieldBuf.size() > 1 && fieldBuf[fieldBuf.size() - 1] == '\\n') {\n" - ) - f.write(" fieldBuf = fieldBuf.substr(0, fieldBuf.size() - 1);\n") - f.write(" }\n") - event.print_fmt = '"print: %s", fieldBuf.c_str()' - - event.print_fmt = str.replace(event.print_fmt, "%pS", "%p") - - if event.print_fmt.find("%ps") == -1: - self.handle_field_name_functions(event, f, False) - else: - if (event.print_fmt.find("%ps") != -1) & ( - event.print_fmt.find("REC->function") != -1 - ): - if event.name != "workqueue_execute_end": - self.handle_format_ps_functions(event, f, "function") - elif (event.print_fmt.find("%ps") != -1) & ( - event.print_fmt.find("REC->ip") != -1 - ): - self.handle_format_ps_functions(event, f, "ip", True) - elif (event.print_fmt.find("%ps") != -1) & ( - event.print_fmt.find("REC->action") != -1 - ): - self.handle_format_ps_functions(event, f, "action") - elif ( - (category == "cpuhp") - & (event.print_fmt.find("%ps") != -1) - & (event.print_fmt.find("REC->fun") != -1) - ): - self.handle_format_ps_functions(event, f, "fun") - elif (event.name == "funcgraph_entry") | ( - event.name == "funcgraph_exit" - ): - self.handle_format_ps_functions(event, f, "func", True) - elif (event.name == "kernel_stack") | (event.name == "user_stack"): - f.write(" int len = 0;\n") - f.write(' std::string kernelSymbolsStr = "";\n') - f.write( - " auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_;\n" - ) - f.write(" if (kernelSymbols.count(msg.caller()[0]) > 0) {\n") - f.write( - " kernelSymbolsStr = kernelSymbols[msg.caller()[0]];\n" - ) - f.write(" }\n") - f.write(' if (kernelSymbolsStr != "") {\n ') - print_fmt = event.print_fmt - event.print_fmt = str.replace(event.print_fmt, "%ps", "%s") - offset = 0 - if event.name == "kernel_stack": - offset = 2 - event.print_fmt = ( - "{}kernelSymbols[msg.caller()[{}]].c_str(), kernelSymbols[msg.caller()[{}]]." - "c_str(), kernelSymbols[msg.caller()[{}]].c_str(), kernelSymbols[msg.caller()[{}]].c_str(), " - "kernelSymbols[msg.caller()[{}]].c_str(), kernelSymbols[msg.caller()[{}]].c_str()," - " kernelSymbols[msg.caller()[{}]].c_str(), kernelSymbols[msg.caller()[{}]].c_str()" - "".format( - event.print_fmt[: 94 + offset], - event.print_fmt[114 + offset], - event.print_fmt[138 + offset], - event.print_fmt[162 + offset], - event.print_fmt[186 + offset], - event.print_fmt[210 + offset], - event.print_fmt[234 + offset], - event.print_fmt[258 + offset], - event.print_fmt[282 + offset], - ) - ) - f.write( - " len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, {});\n".format( - event.print_fmt - ) - ) - f.write(" } else {\n") - event.print_fmt = print_fmt - event.print_fmt = str.replace(event.print_fmt, "%ps", "%p") - self.handle_field_name_functions(event, f) - f.write(" }\n") - - f.write(" if (len >= BUFFER_SIZE - 1) {\n") - f.write( - ' PROFILER_LOG_WARN(LOG_CORE, "maybe, the contents of print event({}) msg had be cut off ' - 'in outfile");\n'.format(event.name) - ) - f.write(" }\n") - f.write(" if (len < 0) {\n") - f.write( - ' PROFILER_LOG_WARN(LOG_CORE, "the contents of event({}) msg snprintf_s format error ' - '");\n'.format(event.name) - ) - f.write(" return \"\";\n") - f.write(" }\n") - f.write(" return std::string(buffer);\n") - f.write("});\n") # end of format function - - def handle_field_name_functions(self, event, f, is_define_len=True): - for field_info in event.remain_fields: - field_name = fix_field_name(field_info.name) - event.print_fmt = str.replace( - event.print_fmt, - "__get_str({})".format(field_name), - "msg.{}().c_str()".format(field_name), - ) - event.print_fmt = str.replace( - event.print_fmt, - "__get_dynamic_array({})".format(field_name), - "msg.{}()".format(field_name), - ) - if ( - field_info.field.startswith("char {}[".format(field_name)) - | field_info.field.startswith("const char {}[".format(field_name)) - | field_info.field.startswith("char *") - | field_info.field.startswith("const char *") - ): - event.print_fmt = str.replace( - event.print_fmt, - "REC->{}".format(field_name), - "msg.{}().c_str()".format(field_name), - ) - else: - event.print_fmt = str.replace( - event.print_fmt, - "REC->{}".format(field_name), - "msg.{}()".format(field_name), - ) - if event.name == "sched_switch": - f.write(" int len = 0;\n") - f.write(" if (msg.prev_state() > 0x0400) {\n") - f.write( - ' len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_switch: prev_comm=%s ' - 'prev_pid=%d prev_prio=%d prev_state=? ==> next_comm=%s next_pid=%d next_prio=%d", msg.prev_comm()' - ".c_str(), msg.prev_pid(), msg.prev_prio(), msg.next_comm().c_str(), msg.next_pid(), " - "msg.next_prio());\n" - ) - f.write(" } else {\n") - f.write( - ' len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, "sched_switch: prev_comm=%s ' - 'prev_pid=%d prev_prio=%d prev_state=%s%s ==> next_comm=%s next_pid=%d next_prio=%d", ' - "msg.prev_comm().c_str(), msg.prev_pid(), msg.prev_prio(), (msg.prev_state() & ((((0x0000 | 0x0001 " - "| 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040) + 1) << 1) - 1)) ? __print_flags(" - "msg.prev_state() & ((((0x0000 | 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040) + 1) " - '<< 1) - 1), "|", { 0x0001, "S" }, { 0x0002, "D" }, { 0x0004, "T" }, { 0x0008, "t" }, ' - '{ 0x0010, "X" }, { 0x0020, "Z" }, { 0x0040, "I" }, { 0x0080, "K" }, { 0x0100, "W" }, { ' - '0x0200, "P" }, { 0x0400, "N" }): "R", msg.prev_state() & (((0x0000 | 0x0001 | 0x0002 | ' - '0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040) + 1) << 1) ? "+": "", msg.next_comm().c_str(), ' - "msg.next_pid(), msg.next_prio());\n" - ) - f.write(" }\n") - elif is_define_len: - f.write( - " len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, {});\n".format( - event.print_fmt - ) - ) - else: - f.write( - " int len = snprintf_s(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, {});\n".format( - event.print_fmt - ) - ) - - def handle_format_ps_functions(self, event, f, filed_name, is_void=False): - f.write(" int len = 0;\n") - f.write(' std::string functionStr = "";\n') - f.write( - " auto& kernelSymbols = EventFormatter::GetInstance().kernelSymbols_;\n" - ) - f.write(" if (kernelSymbols.count(msg.{}()) > 0) ".format(filed_name)) - f.write("{\n") - f.write(" functionStr = kernelSymbols[msg.{}()];\n".format(filed_name)) - f.write(" }\n") - f.write(' if (functionStr != "") {\n ') - print_fmt = event.print_fmt - event.print_fmt = str.replace(event.print_fmt, "%ps", "%s") - if is_void: - event.print_fmt = str.replace( - event.print_fmt, - "(void *)REC->{}".format(filed_name), - "functionStr.c_str()", - ) - else: - event.print_fmt = str.replace( - event.print_fmt, "REC->{}".format(filed_name), "functionStr.c_str()" - ) - self.handle_field_name_functions(event, f) - f.write(" } else {\n") - event.print_fmt = print_fmt - event.print_fmt = str.replace(event.print_fmt, "%ps", "%p") - self.handle_field_name_functions(event, f) - f.write(" }\n") - - -def main(): - parser = argparse.ArgumentParser(description="FTrace C++ code generator.") - parser.add_argument( - "-a", - dest="allow_list", - required=True, - type=str, - help="event allow list file path", - ) - parser.add_argument( - "-e", dest="events_dir", required=True, type=str, help="event formats directory" - ) - parser.add_argument( - "-p", - dest="parser_out", - required=False, - type=str, - help="parser code output directory", - ) - parser.add_argument( - "-f", - dest="formatter_out", - required=False, - type=str, - help="formaater code output directory", - ) - - args = parser.parse_args(sys.argv[1:]) - allow_list = args.allow_list - events_dir = args.events_dir - parser_out = args.parser_out - formatter_out = args.formatter_out - - # check arguments - if not os.path.isfile(allow_list): - parser.print_usage() - exit(1) - if not os.path.isdir(events_dir): - parser.print_usage() - exit(2) - - if parser_out: - if not os.path.isdir(parser_out): - parser.print_usage() - exit(3) - parser_gen = EventParserCodeGenerator(events_dir, allow_list) - parser_gen.generate(os.path.join(parser_out)) - sh_path = "../../../format-code.sh " - if os.getcwd().find("device_kernel_version") != -1: - sh_path = "../../{}".format(sh_path) - parser_sub = subprocess.Popen("{}{}".format(sh_path, parser_out), shell=False) - parser_sub.wait() - parser_sub = subprocess.Popen( - "chmod 775 {}*.cpp".format(parser_out), shell=False - ) - parser_sub.wait() - - if formatter_out: - if not os.path.isdir(formatter_out): - parser.print_usage() - exit(4) - fmtter_gen = EventFormatterCodeGenerator(events_dir, allow_list) - fmtter_gen.generate(formatter_out) - sh_path = "../../../format-code.sh " - if os.getcwd().find("device_kernel_version") != -1: - sh_path = "../../{}".format(sh_path) - formatter_sub = subprocess.Popen( - "{}{}".format(sh_path, formatter_out), shell=False - ) - formatter_sub.wait() - formatter_sub = subprocess.Popen( - "chmod 775 {}*.cpp".format(formatter_out), shell=False - ) - formatter_sub.wait() - - -if __name__ == "__main__": - main() diff --git a/protos/types/plugins/ftrace_data/6.6.30/BUILD.gn b/protos/types/plugins/ftrace_data/6.6.30/BUILD.gn deleted file mode 100644 index cb751d712..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/BUILD.gn +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("../../../../protos.gni") -import("autogenerated.gni") - -all_proto = auto_generated_ftrace_proto_sources + [ - "trace_plugin_config.proto", - "trace_plugin_result.proto", - ] - -####################################################### -proto_out_dir = "$root_gen_dir/cpp/" + rebase_path(".", "//") -proto_rel_out_dir = rebase_path(proto_out_dir, root_build_dir) - -ftrace_data_proto = all_proto -ftrace_data_codegen = [] -ftrace_data_codegen_standard = [] -ftrace_data_codegen_encoder = [] -foreach(proto, ftrace_data_proto) { - dir = get_path_info(proto, "dir") - name = get_path_info(proto, "name") - ftrace_data_codegen += [ - "$proto_out_dir/$dir/$name.pb.h", - "$proto_out_dir/$dir/$name.pb.cc", - ] - ftrace_data_codegen_standard += [ - "$proto_out_dir/$dir/${name}_standard.pb.h", - "$proto_out_dir/$dir/${name}_standard.pb.cc", - ] - ftrace_data_codegen_encoder += [ - "$proto_out_dir/$dir/${name}.pbencoder.h", - "$proto_out_dir/$dir/${name}.pbencoder.cc", - ] -} - -all_proto_codegen = ftrace_data_codegen -all_proto_codegen += ftrace_data_codegen_standard -all_proto_codegen += ftrace_data_codegen_encoder - -ftrace_plugin_config_proto = [ "trace_plugin_config.proto" ] -ftrace_plugin_config_codegen_standard = [] -foreach(proto, ftrace_plugin_config_proto) { - name = get_path_info(proto, "name") - ftrace_plugin_config_codegen_standard += [ - "$proto_out_dir/$dir/${name}_standard.pb.h", - "$proto_out_dir/$dir/${name}_standard.pb.cc", - ] -} - -action("all_proto_gen") { - script = "${OHOS_PROFILER_DIR}/build/protoc.sh" - sources = all_proto - outputs = all_proto_codegen - args = [ - "$libc_dir_proto", - "$root_output_dir_proto", - "$proto_rel_out_dir", - "--cpp_out", - "$proto_rel_out_dir", - "--proto_path", - rebase_path(".", root_build_dir), - ] - args += rebase_path(sources, root_build_dir) - deps = [ "${OHOS_PROFILER_DIR}/device/services/ipc:protoencoder_plugin(${host_toolchain})" ] - external_deps = [ "protobuf:protoc(${host_toolchain})" ] -} - -config("public_configs") { - include_dirs = [ "$proto_out_dir" ] -} - -ohos_source_set("ftrace_data_cpp") { - deps = [ ":all_proto_gen" ] - external_deps = [ - "protobuf:protobuf", - "protobuf:protobuf_lite", - ] - include_dirs = [ "$proto_out_dir" ] - public_configs = [ ":public_configs" ] - sources = ftrace_data_codegen - subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" - part_name = "${OHOS_PROFILER_PART_NAME}" -} - -ohos_source_set("ftrace_data_cpp_standard") { - deps = [ ":all_proto_gen" ] - - external_deps = [ - "protobuf:protobuf", - "protobuf:protobuf_lite", - ] - include_dirs = [ "$proto_out_dir" ] - public_configs = [ ":public_configs" ] - sources = ftrace_data_codegen_standard - subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" - part_name = "${OHOS_PROFILER_PART_NAME}" -} - -ohos_source_set("ftrace_plugin_config_cpp_standard") { - deps = [ ":all_proto_gen" ] - - external_deps = [ - "protobuf:protobuf", - "protobuf:protobuf_lite", - ] - include_dirs = [ "$proto_out_dir" ] - public_configs = [ ":public_configs" ] - sources = ftrace_plugin_config_codegen_standard - subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" - part_name = "${OHOS_PROFILER_PART_NAME}" -} - -ohos_source_set("ftrace_data_encoder") { - deps = [ ":all_proto_gen" ] - include_dirs = [ "$proto_out_dir" ] - public_configs = [ ":public_configs" ] - sources = ftrace_data_codegen_encoder - subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" - part_name = "${OHOS_PROFILER_PART_NAME}" -} diff --git a/protos/types/plugins/ftrace_data/6.6.30/autogenerated.gni b/protos/types/plugins/ftrace_data/6.6.30/autogenerated.gni deleted file mode 100644 index a5c034042..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/autogenerated.gni +++ /dev/null @@ -1,51 +0,0 @@ -# THIS FILE IS GENERATE BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -auto_generated_ftrace_proto_sources = [ - "binder.proto", - "block.proto", - "cgroup.proto", - "clk.proto", - "compaction.proto", - "cpuhp.proto", - "dma_fence.proto", - "ext4.proto", - "f2fs.proto", - "filelock.proto", - "filemap.proto", - "ftrace.proto", - "ftrace_event.proto", - "gpio.proto", - "i2c.proto", - "ipi.proto", - "irq.proto", - "kmem.proto", - "mmc.proto", - "net.proto", - "oom.proto", - "pagemap.proto", - "power.proto", - "printk.proto", - "raw_syscalls.proto", - "rcu.proto", - "regulator.proto", - "sched.proto", - "signal.proto", - "sunrpc.proto", - "task.proto", - "timer.proto", - "v4l2.proto", - "vmscan.proto", - "workqueue.proto", - "writeback.proto", -] diff --git a/protos/types/plugins/ftrace_data/6.6.30/binder.proto b/protos/types/plugins/ftrace_data/6.6.30/binder.proto deleted file mode 100644 index 31c5324d3..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/binder.proto +++ /dev/null @@ -1,209 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: binder -// /sys/kernel/debug/tracing/events/binder/binder_alloc_lru_end/format -message BinderAllocLruEndFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_alloc_lru_start/format -message BinderAllocLruStartFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_alloc_page_end/format -message BinderAllocPageEndFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_alloc_page_start/format -message BinderAllocPageStartFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_command/format -message BinderCommandFormat { - uint32 cmd = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_free_lru_end/format -message BinderFreeLruEndFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_free_lru_start/format -message BinderFreeLruStartFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_ioctl/format -message BinderIoctlFormat { - uint32 cmd = 1; - uint64 arg = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_ioctl_done/format -message BinderIoctlDoneFormat { - int32 ret = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_lock/format -message BinderLockFormat { - string tag = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_locked/format -message BinderLockedFormat { - string tag = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_read_done/format -message BinderReadDoneFormat { - int32 ret = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_return/format -message BinderReturnFormat { - uint32 cmd = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction/format -message BinderTransactionFormat { - int32 debug_id = 1; - int32 target_node = 2; - int32 to_proc = 3; - int32 to_thread = 4; - int32 reply = 5; - uint32 code = 6; - uint32 flags = 7; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction_alloc_buf/format -message BinderTransactionAllocBufFormat { - int32 debug_id = 1; - uint64 data_size = 2; - uint64 offsets_size = 3; - uint64 extra_buffers_size = 4; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction_buffer_release/format -message BinderTransactionBufferReleaseFormat { - int32 debug_id = 1; - uint64 data_size = 2; - uint64 offsets_size = 3; - uint64 extra_buffers_size = 4; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction_failed_buffer_release/format -message BinderTransactionFailedBufferReleaseFormat { - int32 debug_id = 1; - uint64 data_size = 2; - uint64 offsets_size = 3; - uint64 extra_buffers_size = 4; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction_node_to_ref/format -message BinderTransactionNodeToRefFormat { - int32 debug_id = 1; - int32 node_debug_id = 2; - uint64 node_ptr = 3; - int32 ref_debug_id = 4; - uint32 ref_desc = 5; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction_received/format -message BinderTransactionReceivedFormat { - int32 debug_id = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction_ref_to_node/format -message BinderTransactionRefToNodeFormat { - int32 debug_id = 1; - int32 ref_debug_id = 2; - uint32 ref_desc = 3; - int32 node_debug_id = 4; - uint64 node_ptr = 5; -} - -// /sys/kernel/debug/tracing/events/binder/binder_transaction_ref_to_ref/format -message BinderTransactionRefToRefFormat { - int32 debug_id = 1; - int32 node_debug_id = 2; - int32 src_ref_debug_id = 3; - uint32 src_ref_desc = 4; - int32 dest_ref_debug_id = 5; - uint32 dest_ref_desc = 6; -} - -// /sys/kernel/debug/tracing/events/binder/binder_unlock/format -message BinderUnlockFormat { - string tag = 1; -} - -// /sys/kernel/debug/tracing/events/binder/binder_unmap_kernel_end/format -message BinderUnmapKernelEndFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_unmap_kernel_start/format -message BinderUnmapKernelStartFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_unmap_user_end/format -message BinderUnmapUserEndFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_unmap_user_start/format -message BinderUnmapUserStartFormat { - int32 proc = 1; - uint64 page_index = 2; -} - -// /sys/kernel/debug/tracing/events/binder/binder_update_page_range/format -message BinderUpdatePageRangeFormat { - int32 proc = 1; - uint32 allocate = 2; - uint64 offset = 3; - uint64 size = 4; -} - -// /sys/kernel/debug/tracing/events/binder/binder_wait_for_work/format -message BinderWaitForWorkFormat { - uint32 proc_work = 1; - uint32 transaction_stack = 2; - uint32 thread_todo = 3; -} - -// /sys/kernel/debug/tracing/events/binder/binder_write_done/format -message BinderWriteDoneFormat { - int32 ret = 1; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/block.proto b/protos/types/plugins/ftrace_data/6.6.30/block.proto deleted file mode 100644 index a005ead62..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/block.proto +++ /dev/null @@ -1,170 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: block -// /sys/kernel/debug/tracing/events/block/block_bio_backmerge/format -message BlockBioBackmergeFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - string rwbs = 4; - string comm = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_bio_bounce/format -message BlockBioBounceFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - string rwbs = 4; - string comm = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_bio_complete/format -message BlockBioCompleteFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - int32 error = 4; - string rwbs = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_bio_frontmerge/format -message BlockBioFrontmergeFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - string rwbs = 4; - string comm = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_bio_queue/format -message BlockBioQueueFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - string rwbs = 4; - string comm = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_bio_remap/format -message BlockBioRemapFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - uint64 old_dev = 4; - uint64 old_sector = 5; - string rwbs = 6; -} - -// /sys/kernel/debug/tracing/events/block/block_dirty_buffer/format -message BlockDirtyBufferFormat { - uint64 dev = 1; - uint64 sector = 2; - uint64 size = 3; -} - -// /sys/kernel/debug/tracing/events/block/block_getrq/format -message BlockGetrqFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - string rwbs = 4; - string comm = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_plug/format -message BlockPlugFormat { - string comm = 1; -} - -// /sys/kernel/debug/tracing/events/block/block_rq_complete/format -message BlockRqCompleteFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - int32 error = 4; - string rwbs = 5; - string cmd = 6; -} - -// /sys/kernel/debug/tracing/events/block/block_rq_insert/format -message BlockRqInsertFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - uint32 bytes = 4; - string rwbs = 5; - string comm = 6; - string cmd = 7; -} - -// /sys/kernel/debug/tracing/events/block/block_rq_issue/format -message BlockRqIssueFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - uint32 bytes = 4; - string rwbs = 5; - string comm = 6; - string cmd = 7; -} - -// /sys/kernel/debug/tracing/events/block/block_rq_remap/format -message BlockRqRemapFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - uint64 old_dev = 4; - uint64 old_sector = 5; - uint32 nr_bios = 6; - string rwbs = 7; -} - -// /sys/kernel/debug/tracing/events/block/block_rq_requeue/format -message BlockRqRequeueFormat { - uint64 dev = 1; - uint64 sector = 2; - uint32 nr_sector = 3; - string rwbs = 4; - string cmd = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_split/format -message BlockSplitFormat { - uint64 dev = 1; - uint64 sector = 2; - uint64 new_sector = 3; - string rwbs = 4; - string comm = 5; -} - -// /sys/kernel/debug/tracing/events/block/block_touch_buffer/format -message BlockTouchBufferFormat { - uint64 dev = 1; - uint64 sector = 2; - uint64 size = 3; -} - -// /sys/kernel/debug/tracing/events/block/block_unplug/format -message BlockUnplugFormat { - int32 nr_rq = 1; - string comm = 2; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/cgroup.proto b/protos/types/plugins/ftrace_data/6.6.30/cgroup.proto deleted file mode 100644 index 30183973b..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/cgroup.proto +++ /dev/null @@ -1,127 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: cgroup -// /sys/kernel/debug/tracing/events/cgroup/cgroup_attach_task/format -message CgroupAttachTaskFormat { - int32 dst_root = 1; - int32 dst_level = 2; - uint64 dst_id = 3; - int32 pid = 4; - string dst_path = 5; - string comm = 6; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_destroy_root/format -message CgroupDestroyRootFormat { - int32 root = 1; - uint32 ss_mask = 2; - string name = 3; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_freeze/format -message CgroupFreezeFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_mkdir/format -message CgroupMkdirFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_notify_frozen/format -message CgroupNotifyFrozenFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; - int32 val = 5; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_notify_populated/format -message CgroupNotifyPopulatedFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; - int32 val = 5; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_release/format -message CgroupReleaseFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_remount/format -message CgroupRemountFormat { - int32 root = 1; - uint32 ss_mask = 2; - string name = 3; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_rename/format -message CgroupRenameFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_rmdir/format -message CgroupRmdirFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_setup_root/format -message CgroupSetupRootFormat { - int32 root = 1; - uint32 ss_mask = 2; - string name = 3; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_transfer_tasks/format -message CgroupTransferTasksFormat { - int32 dst_root = 1; - int32 dst_level = 2; - uint64 dst_id = 3; - int32 pid = 4; - string dst_path = 5; - string comm = 6; -} - -// /sys/kernel/debug/tracing/events/cgroup/cgroup_unfreeze/format -message CgroupUnfreezeFormat { - int32 root = 1; - int32 level = 2; - uint64 id = 3; - string path = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/clk.proto b/protos/types/plugins/ftrace_data/6.6.30/clk.proto deleted file mode 100644 index 62b596d12..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/clk.proto +++ /dev/null @@ -1,96 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: clk -// /sys/kernel/debug/tracing/events/clk/clk_disable/format -message ClkDisableFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/clk/clk_disable_complete/format -message ClkDisableCompleteFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/clk/clk_enable/format -message ClkEnableFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/clk/clk_enable_complete/format -message ClkEnableCompleteFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/clk/clk_prepare/format -message ClkPrepareFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/clk/clk_prepare_complete/format -message ClkPrepareCompleteFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/clk/clk_set_parent/format -message ClkSetParentFormat { - string name = 1; - string pname = 2; -} - -// /sys/kernel/debug/tracing/events/clk/clk_set_parent_complete/format -message ClkSetParentCompleteFormat { - string name = 1; - string pname = 2; -} - -// /sys/kernel/debug/tracing/events/clk/clk_set_phase/format -message ClkSetPhaseFormat { - string name = 1; - int32 phase = 2; -} - -// /sys/kernel/debug/tracing/events/clk/clk_set_phase_complete/format -message ClkSetPhaseCompleteFormat { - string name = 1; - int32 phase = 2; -} - -// /sys/kernel/debug/tracing/events/clk/clk_set_rate/format -message ClkSetRateFormat { - string name = 1; - uint64 rate = 2; -} - -// /sys/kernel/debug/tracing/events/clk/clk_set_rate_complete/format -message ClkSetRateCompleteFormat { - string name = 1; - uint64 rate = 2; -} - -// /sys/kernel/debug/tracing/events/clk/clk_unprepare/format -message ClkUnprepareFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/clk/clk_unprepare_complete/format -message ClkUnprepareCompleteFormat { - string name = 1; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/compaction.proto b/protos/types/plugins/ftrace_data/6.6.30/compaction.proto deleted file mode 100644 index b6007583a..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/compaction.proto +++ /dev/null @@ -1,36 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: compaction -// /sys/kernel/debug/tracing/events/compaction/mm_compaction_isolate_freepages/format -message MmCompactionIsolateFreepagesFormat { - uint64 start_pfn = 1; - uint64 end_pfn = 2; - uint64 nr_scanned = 3; - uint64 nr_taken = 4; -} - -// /sys/kernel/debug/tracing/events/compaction/mm_compaction_isolate_migratepages/format -message MmCompactionIsolateMigratepagesFormat { - uint64 start_pfn = 1; - uint64 end_pfn = 2; - uint64 nr_scanned = 3; - uint64 nr_taken = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/cpuhp.proto b/protos/types/plugins/ftrace_data/6.6.30/cpuhp.proto deleted file mode 100644 index 2d4027c73..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/cpuhp.proto +++ /dev/null @@ -1,44 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: cpuhp -// /sys/kernel/debug/tracing/events/cpuhp/cpuhp_enter/format -message CpuhpEnterFormat { - uint32 cpu = 1; - int32 target = 2; - int32 idx = 3; - uint64 fun = 4; -} - -// /sys/kernel/debug/tracing/events/cpuhp/cpuhp_exit/format -message CpuhpExitFormat { - uint32 cpu = 1; - int32 state = 2; - int32 idx = 3; - int32 ret = 4; -} - -// /sys/kernel/debug/tracing/events/cpuhp/cpuhp_multi_enter/format -message CpuhpMultiEnterFormat { - uint32 cpu = 1; - int32 target = 2; - int32 idx = 3; - uint64 fun = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/dma_fence.proto b/protos/types/plugins/ftrace_data/6.6.30/dma_fence.proto deleted file mode 100644 index dbfca1385..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/dma_fence.proto +++ /dev/null @@ -1,76 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: dma_fence -// /sys/kernel/debug/tracing/events/dma_fence/dma_fence_destroy/format -message DmaFenceDestroyFormat { - string driver = 1; - string timeline = 2; - uint32 context = 3; - uint32 seqno = 4; -} - -// /sys/kernel/debug/tracing/events/dma_fence/dma_fence_emit/format -message DmaFenceEmitFormat { - string driver = 1; - string timeline = 2; - uint32 context = 3; - uint32 seqno = 4; -} - -// /sys/kernel/debug/tracing/events/dma_fence/dma_fence_enable_signal/format -message DmaFenceEnableSignalFormat { - string driver = 1; - string timeline = 2; - uint32 context = 3; - uint32 seqno = 4; -} - -// /sys/kernel/debug/tracing/events/dma_fence/dma_fence_init/format -message DmaFenceInitFormat { - string driver = 1; - string timeline = 2; - uint32 context = 3; - uint32 seqno = 4; -} - -// /sys/kernel/debug/tracing/events/dma_fence/dma_fence_signaled/format -message DmaFenceSignaledFormat { - string driver = 1; - string timeline = 2; - uint32 context = 3; - uint32 seqno = 4; -} - -// /sys/kernel/debug/tracing/events/dma_fence/dma_fence_wait_end/format -message DmaFenceWaitEndFormat { - string driver = 1; - string timeline = 2; - uint32 context = 3; - uint32 seqno = 4; -} - -// /sys/kernel/debug/tracing/events/dma_fence/dma_fence_wait_start/format -message DmaFenceWaitStartFormat { - string driver = 1; - string timeline = 2; - uint32 context = 3; - uint32 seqno = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/ext4.proto b/protos/types/plugins/ftrace_data/6.6.30/ext4.proto deleted file mode 100644 index 72a7cf851..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/ext4.proto +++ /dev/null @@ -1,760 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: ext4 -// /sys/kernel/debug/tracing/events/ext4/ext4_alloc_da_blocks/format -message Ext4AllocDaBlocksFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 data_blocks = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_allocate_blocks/format -message Ext4AllocateBlocksFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 block = 3; - uint32 len = 4; - uint32 logical = 5; - uint32 lleft = 6; - uint32 lright = 7; - uint64 goal = 8; - uint64 pleft = 9; - uint64 pright = 10; - uint32 flags = 11; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_allocate_inode/format -message Ext4AllocateInodeFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 dir = 3; - uint32 mode = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_begin_ordered_truncate/format -message Ext4BeginOrderedTruncateFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 new_size = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_collapse_range/format -message Ext4CollapseRangeFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 offset = 3; - uint64 len = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_da_release_space/format -message Ext4DaReleaseSpaceFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 i_blocks = 3; - int32 freed_blocks = 4; - int32 reserved_data_blocks = 5; - uint32 mode = 6; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_da_reserve_space/format -message Ext4DaReserveSpaceFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 i_blocks = 3; - int32 reserved_data_blocks = 4; - uint32 mode = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_da_update_reserve_space/format -message Ext4DaUpdateReserveSpaceFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 i_blocks = 3; - int32 used_blocks = 4; - int32 reserved_data_blocks = 5; - int32 quota_claim = 6; - uint32 mode = 7; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_da_write_begin/format -message Ext4DaWriteBeginFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 len = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_da_write_end/format -message Ext4DaWriteEndFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 len = 4; - uint32 copied = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_da_write_pages/format -message Ext4DaWritePagesFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 first_page = 3; - uint64 nr_to_write = 4; - int32 sync_mode = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_da_write_pages_extent/format -message Ext4DaWritePagesExtentFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 lblk = 3; - uint32 len = 4; - uint32 flags = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_discard_blocks/format -message Ext4DiscardBlocksFormat { - uint64 dev = 1; - uint64 blk = 2; - uint64 count = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_discard_preallocations/format -message Ext4DiscardPreallocationsFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 len = 3; - uint32 needed = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_drop_inode/format -message Ext4DropInodeFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 drop = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_cache_extent/format -message Ext4EsCacheExtentFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 lblk = 3; - uint32 len = 4; - uint64 pblk = 5; - uint32 status = 6; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_insert_extent/format -message Ext4EsInsertExtentFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 lblk = 3; - uint32 len = 4; - uint64 pblk = 5; - uint32 status = 6; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_lookup_extent_enter/format -message Ext4EsLookupExtentEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 lblk = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_lookup_extent_exit/format -message Ext4EsLookupExtentExitFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 lblk = 3; - uint32 len = 4; - uint64 pblk = 5; - uint32 status = 6; - int32 found = 7; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_remove_extent/format -message Ext4EsRemoveExtentFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 lblk = 3; - uint64 len = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_shrink/format -message Ext4EsShrinkFormat { - uint64 dev = 1; - int32 nr_shrunk = 2; - uint64 scan_time = 3; - int32 nr_skipped = 4; - int32 retried = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_shrink_count/format -message Ext4EsShrinkCountFormat { - uint64 dev = 1; - int32 nr_to_scan = 2; - int32 cache_cnt = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_shrink_scan_enter/format -message Ext4EsShrinkScanEnterFormat { - uint64 dev = 1; - int32 nr_to_scan = 2; - int32 cache_cnt = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_es_shrink_scan_exit/format -message Ext4EsShrinkScanExitFormat { - uint64 dev = 1; - int32 nr_shrunk = 2; - int32 cache_cnt = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_evict_inode/format -message Ext4EvictInodeFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 nlink = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_convert_to_initialized_enter/format -message Ext4ExtConvertToInitializedEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 m_lblk = 3; - uint32 m_len = 4; - uint32 u_lblk = 5; - uint32 u_len = 6; - uint64 u_pblk = 7; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_convert_to_initialized_fastpath/format -message Ext4ExtConvertToInitializedFastpathFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 m_lblk = 3; - uint32 m_len = 4; - uint32 u_lblk = 5; - uint32 u_len = 6; - uint64 u_pblk = 7; - uint32 i_lblk = 8; - uint32 i_len = 9; - uint64 i_pblk = 10; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_handle_unwritten_extents/format -message Ext4ExtHandleUnwrittenExtentsFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 flags = 3; - uint32 lblk = 4; - uint64 pblk = 5; - uint32 len = 6; - uint32 allocated = 7; - uint64 newblk = 8; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_load_extent/format -message Ext4ExtLoadExtentFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pblk = 3; - uint32 lblk = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_map_blocks_enter/format -message Ext4ExtMapBlocksEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 lblk = 3; - uint32 len = 4; - uint32 flags = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_map_blocks_exit/format -message Ext4ExtMapBlocksExitFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 flags = 3; - uint64 pblk = 4; - uint32 lblk = 5; - uint32 len = 6; - uint32 mflags = 7; - int32 ret = 8; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_remove_space/format -message Ext4ExtRemoveSpaceFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 start = 3; - uint32 end = 4; - int32 depth = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_remove_space_done/format -message Ext4ExtRemoveSpaceDoneFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 start = 3; - uint32 end = 4; - int32 depth = 5; - uint64 pc_pclu = 6; - uint32 pc_lblk = 7; - int32 pc_state = 8; - uint32 eh_entries = 9; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_rm_idx/format -message Ext4ExtRmIdxFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pblk = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_rm_leaf/format -message Ext4ExtRmLeafFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 start = 3; - uint32 ee_lblk = 4; - uint64 ee_pblk = 5; - int32 ee_len = 6; - uint64 pc_pclu = 7; - uint32 pc_lblk = 8; - int32 pc_state = 9; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ext_show_extent/format -message Ext4ExtShowExtentFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pblk = 3; - uint32 lblk = 4; - uint32 len = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_fallocate_enter/format -message Ext4FallocateEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 offset = 3; - uint64 len = 4; - int32 mode = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_fallocate_exit/format -message Ext4FallocateExitFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 blocks = 4; - int32 ret = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_forget/format -message Ext4ForgetFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 block = 3; - int32 is_metadata = 4; - uint32 mode = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_free_blocks/format -message Ext4FreeBlocksFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 block = 3; - uint64 count = 4; - int32 flags = 5; - uint32 mode = 6; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_free_inode/format -message Ext4FreeInodeFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 uid = 3; - uint32 gid = 4; - uint64 blocks = 5; - uint32 mode = 6; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_get_implied_cluster_alloc_exit/format -message Ext4GetImpliedClusterAllocExitFormat { - uint64 dev = 1; - uint32 flags = 2; - uint32 lblk = 3; - uint64 pblk = 4; - uint32 len = 5; - int32 ret = 6; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ind_map_blocks_enter/format -message Ext4IndMapBlocksEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 lblk = 3; - uint32 len = 4; - uint32 flags = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_ind_map_blocks_exit/format -message Ext4IndMapBlocksExitFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 flags = 3; - uint64 pblk = 4; - uint32 lblk = 5; - uint32 len = 6; - uint32 mflags = 7; - int32 ret = 8; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_insert_range/format -message Ext4InsertRangeFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 offset = 3; - uint64 len = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_journal_start_reserved/format -message Ext4JournalStartReservedFormat { - uint64 dev = 1; - uint64 ip = 2; - int32 blocks = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_journalled_write_end/format -message Ext4JournalledWriteEndFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 len = 4; - uint32 copied = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_load_inode/format -message Ext4LoadInodeFormat { - uint64 dev = 1; - uint64 ino = 2; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_load_inode_bitmap/format -message Ext4LoadInodeBitmapFormat { - uint64 dev = 1; - uint32 group = 2; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mark_inode_dirty/format -message Ext4MarkInodeDirtyFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 ip = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mb_bitmap_load/format -message Ext4MbBitmapLoadFormat { - uint64 dev = 1; - uint32 group = 2; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mb_buddy_bitmap_load/format -message Ext4MbBuddyBitmapLoadFormat { - uint64 dev = 1; - uint32 group = 2; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mb_discard_preallocations/format -message Ext4MbDiscardPreallocationsFormat { - uint64 dev = 1; - int32 needed = 2; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mb_new_group_pa/format -message Ext4MbNewGroupPaFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pa_pstart = 3; - uint64 pa_lstart = 4; - uint32 pa_len = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mb_new_inode_pa/format -message Ext4MbNewInodePaFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pa_pstart = 3; - uint64 pa_lstart = 4; - uint32 pa_len = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mb_release_group_pa/format -message Ext4MbReleaseGroupPaFormat { - uint64 dev = 1; - uint64 pa_pstart = 2; - uint32 pa_len = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mb_release_inode_pa/format -message Ext4MbReleaseInodePaFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 block = 3; - uint32 count = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mballoc_alloc/format -message Ext4MballocAllocFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 orig_logical = 3; - int32 orig_start = 4; - uint32 orig_group = 5; - int32 orig_len = 6; - uint32 goal_logical = 7; - int32 goal_start = 8; - uint32 goal_group = 9; - int32 goal_len = 10; - uint32 result_logical = 11; - int32 result_start = 12; - uint32 result_group = 13; - int32 result_len = 14; - uint32 found = 15; - uint32 groups = 16; - uint32 buddy = 17; - uint32 flags = 18; - uint32 tail = 19; - uint32 cr = 20; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mballoc_discard/format -message Ext4MballocDiscardFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 result_start = 3; - uint32 result_group = 4; - int32 result_len = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mballoc_free/format -message Ext4MballocFreeFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 result_start = 3; - uint32 result_group = 4; - int32 result_len = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_mballoc_prealloc/format -message Ext4MballocPreallocFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 orig_logical = 3; - int32 orig_start = 4; - uint32 orig_group = 5; - int32 orig_len = 6; - uint32 result_logical = 7; - int32 result_start = 8; - uint32 result_group = 9; - int32 result_len = 10; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_other_inode_update_time/format -message Ext4OtherInodeUpdateTimeFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 orig_ino = 3; - uint32 uid = 4; - uint32 gid = 5; - uint32 mode = 6; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_punch_hole/format -message Ext4PunchHoleFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 offset = 3; - uint64 len = 4; - int32 mode = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_read_block_bitmap_load/format -message Ext4ReadBlockBitmapLoadFormat { - uint64 dev = 1; - uint32 group = 2; - uint32 prefetch = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_remove_blocks/format -message Ext4RemoveBlocksFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 from = 3; - uint32 to = 4; - uint64 ee_pblk = 5; - uint32 ee_lblk = 6; - uint32 ee_len = 7; - uint64 pc_pclu = 8; - uint32 pc_lblk = 9; - int32 pc_state = 10; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_request_blocks/format -message Ext4RequestBlocksFormat { - uint64 dev = 1; - uint64 ino = 2; - uint32 len = 3; - uint32 logical = 4; - uint32 lleft = 5; - uint32 lright = 6; - uint64 goal = 7; - uint64 pleft = 8; - uint64 pright = 9; - uint32 flags = 10; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_request_inode/format -message Ext4RequestInodeFormat { - uint64 dev = 1; - uint64 dir = 2; - uint32 mode = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_sync_file_enter/format -message Ext4SyncFileEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 parent = 3; - int32 datasync = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_sync_file_exit/format -message Ext4SyncFileExitFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 ret = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_sync_fs/format -message Ext4SyncFsFormat { - uint64 dev = 1; - int32 wait = 2; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_trim_all_free/format -message Ext4TrimAllFreeFormat { - int32 dev_major = 1; - int32 dev_minor = 2; - uint32 group = 3; - int32 start = 4; - int32 len = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_trim_extent/format -message Ext4TrimExtentFormat { - int32 dev_major = 1; - int32 dev_minor = 2; - uint32 group = 3; - int32 start = 4; - int32 len = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_truncate_enter/format -message Ext4TruncateEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 blocks = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_truncate_exit/format -message Ext4TruncateExitFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 blocks = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_unlink_enter/format -message Ext4UnlinkEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 parent = 3; - uint64 size = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_unlink_exit/format -message Ext4UnlinkExitFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 ret = 3; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_write_begin/format -message Ext4WriteBeginFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 len = 4; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_write_end/format -message Ext4WriteEndFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 len = 4; - uint32 copied = 5; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_writepages/format -message Ext4WritepagesFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 nr_to_write = 3; - uint64 pages_skipped = 4; - uint64 range_start = 5; - uint64 range_end = 6; - uint64 writeback_index = 7; - int32 sync_mode = 8; - uint32 for_kupdate = 9; - uint32 range_cyclic = 10; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_writepages_result/format -message Ext4WritepagesResultFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 ret = 3; - int32 pages_written = 4; - uint64 pages_skipped = 5; - uint64 writeback_index = 6; - int32 sync_mode = 7; -} - -// /sys/kernel/debug/tracing/events/ext4/ext4_zero_range/format -message Ext4ZeroRangeFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 offset = 3; - uint64 len = 4; - int32 mode = 5; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/f2fs.proto b/protos/types/plugins/ftrace_data/6.6.30/f2fs.proto deleted file mode 100644 index 7d056e826..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/f2fs.proto +++ /dev/null @@ -1,58 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: f2fs -// /sys/kernel/debug/tracing/events/f2fs/f2fs_sync_file_enter/format -message F2fsSyncFileEnterFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pino = 3; - uint32 mode = 4; - uint64 size = 5; - uint32 nlink = 6; - uint64 blocks = 7; - uint32 advise = 8; -} - -// /sys/kernel/debug/tracing/events/f2fs/f2fs_sync_file_exit/format -message F2fsSyncFileExitFormat { - uint64 dev = 1; - uint64 ino = 2; - int32 cp_reason = 3; - int32 datasync = 4; - int32 ret = 5; -} - -// /sys/kernel/debug/tracing/events/f2fs/f2fs_write_begin/format -message F2fsWriteBeginFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 len = 4; -} - -// /sys/kernel/debug/tracing/events/f2fs/f2fs_write_end/format -message F2fsWriteEndFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 pos = 3; - uint32 len = 4; - uint32 copied = 5; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/filelock.proto b/protos/types/plugins/ftrace_data/6.6.30/filelock.proto deleted file mode 100644 index d98e73ebb..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/filelock.proto +++ /dev/null @@ -1,97 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: filelock -// /sys/kernel/debug/tracing/events/filelock/break_lease_block/format -message BreakLeaseBlockFormat { - uint64 fl = 1; - uint64 i_ino = 2; - uint64 s_dev = 3; - uint64 fl_blocker = 4; - uint64 fl_owner = 5; - uint32 fl_flags = 6; - uint32 fl_type = 7; - uint64 fl_break_time = 8; - uint64 fl_downgrade_time = 9; -} - -// /sys/kernel/debug/tracing/events/filelock/break_lease_noblock/format -message BreakLeaseNoblockFormat { - uint64 fl = 1; - uint64 i_ino = 2; - uint64 s_dev = 3; - uint64 fl_blocker = 4; - uint64 fl_owner = 5; - uint32 fl_flags = 6; - uint32 fl_type = 7; - uint64 fl_break_time = 8; - uint64 fl_downgrade_time = 9; -} - -// /sys/kernel/debug/tracing/events/filelock/break_lease_unblock/format -message BreakLeaseUnblockFormat { - uint64 fl = 1; - uint64 i_ino = 2; - uint64 s_dev = 3; - uint64 fl_blocker = 4; - uint64 fl_owner = 5; - uint32 fl_flags = 6; - uint32 fl_type = 7; - uint64 fl_break_time = 8; - uint64 fl_downgrade_time = 9; -} - -// /sys/kernel/debug/tracing/events/filelock/generic_add_lease/format -message GenericAddLeaseFormat { - uint64 i_ino = 1; - int32 wcount = 2; - int32 rcount = 3; - int32 icount = 4; - uint64 s_dev = 5; - uint64 fl_owner = 6; - uint32 fl_flags = 7; - uint32 fl_type = 8; -} - -// /sys/kernel/debug/tracing/events/filelock/generic_delete_lease/format -message GenericDeleteLeaseFormat { - uint64 fl = 1; - uint64 i_ino = 2; - uint64 s_dev = 3; - uint64 fl_blocker = 4; - uint64 fl_owner = 5; - uint32 fl_flags = 6; - uint32 fl_type = 7; - uint64 fl_break_time = 8; - uint64 fl_downgrade_time = 9; -} - -// /sys/kernel/debug/tracing/events/filelock/time_out_leases/format -message TimeOutLeasesFormat { - uint64 fl = 1; - uint64 i_ino = 2; - uint64 s_dev = 3; - uint64 fl_blocker = 4; - uint64 fl_owner = 5; - uint32 fl_flags = 6; - uint32 fl_type = 7; - uint64 fl_break_time = 8; - uint64 fl_downgrade_time = 9; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/filemap.proto b/protos/types/plugins/ftrace_data/6.6.30/filemap.proto deleted file mode 100644 index a77e35e7b..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/filemap.proto +++ /dev/null @@ -1,54 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: filemap -// /sys/kernel/debug/tracing/events/filemap/file_check_and_advance_wb_err/format -message FileCheckAndAdvanceWbErrFormat { - uint64 file = 1; - uint64 i_ino = 2; - uint64 s_dev = 3; - uint32 old = 4; - uint32 seq_new = 5; -} - -// /sys/kernel/debug/tracing/events/filemap/filemap_set_wb_err/format -message FilemapSetWbErrFormat { - uint64 i_ino = 1; - uint64 s_dev = 2; - uint32 errseq = 3; -} - -// /sys/kernel/debug/tracing/events/filemap/mm_filemap_add_to_page_cache/format -message MmFilemapAddToPageCacheFormat { - uint64 pfn = 1; - uint64 i_ino = 2; - uint64 index = 3; - uint64 s_dev = 4; - uint32 order = 5; -} - -// /sys/kernel/debug/tracing/events/filemap/mm_filemap_delete_from_page_cache/format -message MmFilemapDeleteFromPageCacheFormat { - uint64 pfn = 1; - uint64 i_ino = 2; - uint64 index = 3; - uint64 s_dev = 4; - uint32 order = 5; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/ftrace.proto b/protos/types/plugins/ftrace_data/6.6.30/ftrace.proto deleted file mode 100644 index 94709f3a2..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/ftrace.proto +++ /dev/null @@ -1,115 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: ftrace -// /sys/kernel/debug/tracing/events/ftrace/bputs/format -message BputsFormat { - uint64 ip = 1; - string str = 2; -} - -// /sys/kernel/debug/tracing/events/ftrace/branch/format -message BranchFormat { - uint32 line = 1; - string func = 2; - string file = 3; - uint32 correct = 4; - uint32 constant = 5; -} - -// /sys/kernel/debug/tracing/events/ftrace/context_switch/format -message ContextSwitchFormat { - uint32 prev_pid = 1; - uint32 next_pid = 2; - uint32 next_cpu = 3; - uint32 prev_prio = 4; - uint32 prev_state = 5; - uint32 next_prio = 6; - uint32 next_state = 7; -} - -// /sys/kernel/debug/tracing/events/ftrace/funcgraph_entry/format -message FuncgraphEntryFormat { - uint64 func = 1; - int32 depth = 2; -} - -// /sys/kernel/debug/tracing/events/ftrace/funcgraph_exit/format -message FuncgraphExitFormat { - uint64 func = 1; - int32 depth = 2; - uint32 overrun = 3; - uint64 calltime = 4; - uint64 rettime = 5; -} - -// /sys/kernel/debug/tracing/events/ftrace/function/format -message FunctionFormat { - uint64 ip = 1; - uint64 parent_ip = 2; -} - -// /sys/kernel/debug/tracing/events/ftrace/kernel_stack/format -message KernelStackFormat { - int32 size = 1; - repeated uint64 caller = 2; -} - -// /sys/kernel/debug/tracing/events/ftrace/mmiotrace_map/format -message MmiotraceMapFormat { - uint64 phys = 1; - uint64 virt = 2; - uint64 len = 3; - int32 map_id = 4; - uint32 opcode = 5; -} - -// /sys/kernel/debug/tracing/events/ftrace/mmiotrace_rw/format -message MmiotraceRwFormat { - uint64 phys = 1; - uint64 value = 2; - uint64 pc = 3; - int32 map_id = 4; - uint32 opcode = 5; - uint32 width = 6; -} - -// /sys/kernel/debug/tracing/events/ftrace/print/format -message PrintFormat { - uint64 ip = 1; - string buf = 2; -} - -// /sys/kernel/debug/tracing/events/ftrace/user_stack/format -message UserStackFormat { - uint32 tgid = 1; - repeated uint64 caller = 2; -} - -// /sys/kernel/debug/tracing/events/ftrace/wakeup/format -message WakeupFormat { - uint32 prev_pid = 1; - uint32 next_pid = 2; - uint32 next_cpu = 3; - uint32 prev_prio = 4; - uint32 prev_state = 5; - uint32 next_prio = 6; - uint32 next_state = 7; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/ftrace_event.proto b/protos/types/plugins/ftrace_data/6.6.30/ftrace_event.proto deleted file mode 100644 index bbece165d..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/ftrace_event.proto +++ /dev/null @@ -1,439 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -import "binder.proto"; -import "block.proto"; -import "cgroup.proto"; -import "clk.proto"; -import "compaction.proto"; -import "cpuhp.proto"; -import "dma_fence.proto"; -import "ext4.proto"; -import "f2fs.proto"; -import "filelock.proto"; -import "filemap.proto"; -import "ftrace.proto"; -import "gpio.proto"; -import "i2c.proto"; -import "ipi.proto"; -import "irq.proto"; -import "kmem.proto"; -import "mmc.proto"; -import "net.proto"; -import "oom.proto"; -import "pagemap.proto"; -import "power.proto"; -import "printk.proto"; -import "raw_syscalls.proto"; -import "rcu.proto"; -import "regulator.proto"; -import "sched.proto"; -import "signal.proto"; -import "sunrpc.proto"; -import "task.proto"; -import "timer.proto"; -import "v4l2.proto"; -import "vmscan.proto"; -import "workqueue.proto"; -import "writeback.proto"; - -message FtraceEvent { - uint64 timestamp = 1; - int32 tgid = 2; - string comm = 3; - - message CommonFileds { - uint32 type = 1; - uint32 flags = 2; - uint32 preempt_count = 3; - int32 pid = 4; - }; - CommonFileds common_fields = 50; - - oneof event { - BinderAllocLruEndFormat binder_alloc_lru_end_format = 100; - BinderAllocLruStartFormat binder_alloc_lru_start_format = 101; - BinderAllocPageEndFormat binder_alloc_page_end_format = 102; - BinderAllocPageStartFormat binder_alloc_page_start_format = 103; - BinderCommandFormat binder_command_format = 104; - BinderFreeLruEndFormat binder_free_lru_end_format = 105; - BinderFreeLruStartFormat binder_free_lru_start_format = 106; - BinderIoctlFormat binder_ioctl_format = 107; - BinderIoctlDoneFormat binder_ioctl_done_format = 108; - BinderLockFormat binder_lock_format = 109; - BinderLockedFormat binder_locked_format = 110; - BinderReadDoneFormat binder_read_done_format = 111; - BinderReturnFormat binder_return_format = 112; - BinderTransactionFormat binder_transaction_format = 113; - BinderTransactionAllocBufFormat binder_transaction_alloc_buf_format = 114; - BinderTransactionBufferReleaseFormat binder_transaction_buffer_release_format = 115; - BinderTransactionFailedBufferReleaseFormat binder_transaction_failed_buffer_release_format = 116; - BinderTransactionNodeToRefFormat binder_transaction_node_to_ref_format = 117; - BinderTransactionReceivedFormat binder_transaction_received_format = 118; - BinderTransactionRefToNodeFormat binder_transaction_ref_to_node_format = 119; - BinderTransactionRefToRefFormat binder_transaction_ref_to_ref_format = 120; - BinderUnlockFormat binder_unlock_format = 121; - BinderUnmapKernelEndFormat binder_unmap_kernel_end_format = 122; - BinderUnmapKernelStartFormat binder_unmap_kernel_start_format = 123; - BinderUnmapUserEndFormat binder_unmap_user_end_format = 124; - BinderUnmapUserStartFormat binder_unmap_user_start_format = 125; - BinderUpdatePageRangeFormat binder_update_page_range_format = 126; - BinderWaitForWorkFormat binder_wait_for_work_format = 127; - BinderWriteDoneFormat binder_write_done_format = 128; - BlockBioBackmergeFormat block_bio_backmerge_format = 200; - BlockBioBounceFormat block_bio_bounce_format = 201; - BlockBioCompleteFormat block_bio_complete_format = 202; - BlockBioFrontmergeFormat block_bio_frontmerge_format = 203; - BlockBioQueueFormat block_bio_queue_format = 204; - BlockBioRemapFormat block_bio_remap_format = 205; - BlockDirtyBufferFormat block_dirty_buffer_format = 206; - BlockGetrqFormat block_getrq_format = 207; - BlockPlugFormat block_plug_format = 208; - BlockRqCompleteFormat block_rq_complete_format = 209; - BlockRqInsertFormat block_rq_insert_format = 210; - BlockRqIssueFormat block_rq_issue_format = 211; - BlockRqRemapFormat block_rq_remap_format = 212; - BlockRqRequeueFormat block_rq_requeue_format = 213; - BlockSplitFormat block_split_format = 214; - BlockTouchBufferFormat block_touch_buffer_format = 215; - BlockUnplugFormat block_unplug_format = 216; - CgroupAttachTaskFormat cgroup_attach_task_format = 300; - CgroupDestroyRootFormat cgroup_destroy_root_format = 301; - CgroupFreezeFormat cgroup_freeze_format = 302; - CgroupMkdirFormat cgroup_mkdir_format = 303; - CgroupNotifyFrozenFormat cgroup_notify_frozen_format = 304; - CgroupNotifyPopulatedFormat cgroup_notify_populated_format = 305; - CgroupReleaseFormat cgroup_release_format = 306; - CgroupRemountFormat cgroup_remount_format = 307; - CgroupRenameFormat cgroup_rename_format = 308; - CgroupRmdirFormat cgroup_rmdir_format = 309; - CgroupSetupRootFormat cgroup_setup_root_format = 310; - CgroupTransferTasksFormat cgroup_transfer_tasks_format = 311; - CgroupUnfreezeFormat cgroup_unfreeze_format = 312; - ClkDisableFormat clk_disable_format = 400; - ClkDisableCompleteFormat clk_disable_complete_format = 401; - ClkEnableFormat clk_enable_format = 402; - ClkEnableCompleteFormat clk_enable_complete_format = 403; - ClkPrepareFormat clk_prepare_format = 404; - ClkPrepareCompleteFormat clk_prepare_complete_format = 405; - ClkSetParentFormat clk_set_parent_format = 406; - ClkSetParentCompleteFormat clk_set_parent_complete_format = 407; - ClkSetPhaseFormat clk_set_phase_format = 408; - ClkSetPhaseCompleteFormat clk_set_phase_complete_format = 409; - ClkSetRateFormat clk_set_rate_format = 410; - ClkSetRateCompleteFormat clk_set_rate_complete_format = 411; - ClkUnprepareFormat clk_unprepare_format = 412; - ClkUnprepareCompleteFormat clk_unprepare_complete_format = 413; - MmCompactionIsolateFreepagesFormat mm_compaction_isolate_freepages_format = 500; - MmCompactionIsolateMigratepagesFormat mm_compaction_isolate_migratepages_format = 501; - CpuhpEnterFormat cpuhp_enter_format = 600; - CpuhpExitFormat cpuhp_exit_format = 601; - CpuhpMultiEnterFormat cpuhp_multi_enter_format = 602; - DmaFenceDestroyFormat dma_fence_destroy_format = 700; - DmaFenceEmitFormat dma_fence_emit_format = 701; - DmaFenceEnableSignalFormat dma_fence_enable_signal_format = 702; - DmaFenceInitFormat dma_fence_init_format = 703; - DmaFenceSignaledFormat dma_fence_signaled_format = 704; - DmaFenceWaitEndFormat dma_fence_wait_end_format = 705; - DmaFenceWaitStartFormat dma_fence_wait_start_format = 706; - Ext4AllocDaBlocksFormat ext4_alloc_da_blocks_format = 800; - Ext4AllocateBlocksFormat ext4_allocate_blocks_format = 801; - Ext4AllocateInodeFormat ext4_allocate_inode_format = 802; - Ext4BeginOrderedTruncateFormat ext4_begin_ordered_truncate_format = 803; - Ext4CollapseRangeFormat ext4_collapse_range_format = 804; - Ext4DaReleaseSpaceFormat ext4_da_release_space_format = 805; - Ext4DaReserveSpaceFormat ext4_da_reserve_space_format = 806; - Ext4DaUpdateReserveSpaceFormat ext4_da_update_reserve_space_format = 807; - Ext4DaWriteBeginFormat ext4_da_write_begin_format = 808; - Ext4DaWriteEndFormat ext4_da_write_end_format = 809; - Ext4DaWritePagesFormat ext4_da_write_pages_format = 810; - Ext4DaWritePagesExtentFormat ext4_da_write_pages_extent_format = 811; - Ext4DiscardBlocksFormat ext4_discard_blocks_format = 812; - Ext4DiscardPreallocationsFormat ext4_discard_preallocations_format = 813; - Ext4DropInodeFormat ext4_drop_inode_format = 814; - Ext4EsCacheExtentFormat ext4_es_cache_extent_format = 815; - Ext4EsInsertExtentFormat ext4_es_insert_extent_format = 816; - Ext4EsLookupExtentEnterFormat ext4_es_lookup_extent_enter_format = 817; - Ext4EsLookupExtentExitFormat ext4_es_lookup_extent_exit_format = 818; - Ext4EsRemoveExtentFormat ext4_es_remove_extent_format = 819; - Ext4EsShrinkFormat ext4_es_shrink_format = 820; - Ext4EsShrinkCountFormat ext4_es_shrink_count_format = 821; - Ext4EsShrinkScanEnterFormat ext4_es_shrink_scan_enter_format = 822; - Ext4EsShrinkScanExitFormat ext4_es_shrink_scan_exit_format = 823; - Ext4EvictInodeFormat ext4_evict_inode_format = 824; - Ext4ExtConvertToInitializedEnterFormat ext4_ext_convert_to_initialized_enter_format = 825; - Ext4ExtConvertToInitializedFastpathFormat ext4_ext_convert_to_initialized_fastpath_format = 826; - Ext4ExtHandleUnwrittenExtentsFormat ext4_ext_handle_unwritten_extents_format = 827; - Ext4ExtLoadExtentFormat ext4_ext_load_extent_format = 828; - Ext4ExtMapBlocksEnterFormat ext4_ext_map_blocks_enter_format = 829; - Ext4ExtMapBlocksExitFormat ext4_ext_map_blocks_exit_format = 830; - Ext4ExtRemoveSpaceFormat ext4_ext_remove_space_format = 831; - Ext4ExtRemoveSpaceDoneFormat ext4_ext_remove_space_done_format = 832; - Ext4ExtRmIdxFormat ext4_ext_rm_idx_format = 833; - Ext4ExtRmLeafFormat ext4_ext_rm_leaf_format = 834; - Ext4ExtShowExtentFormat ext4_ext_show_extent_format = 835; - Ext4FallocateEnterFormat ext4_fallocate_enter_format = 836; - Ext4FallocateExitFormat ext4_fallocate_exit_format = 837; - Ext4ForgetFormat ext4_forget_format = 838; - Ext4FreeBlocksFormat ext4_free_blocks_format = 839; - Ext4FreeInodeFormat ext4_free_inode_format = 840; - Ext4GetImpliedClusterAllocExitFormat ext4_get_implied_cluster_alloc_exit_format = 841; - Ext4IndMapBlocksEnterFormat ext4_ind_map_blocks_enter_format = 842; - Ext4IndMapBlocksExitFormat ext4_ind_map_blocks_exit_format = 843; - Ext4InsertRangeFormat ext4_insert_range_format = 844; - Ext4JournalStartReservedFormat ext4_journal_start_reserved_format = 845; - Ext4JournalledWriteEndFormat ext4_journalled_write_end_format = 846; - Ext4LoadInodeFormat ext4_load_inode_format = 847; - Ext4LoadInodeBitmapFormat ext4_load_inode_bitmap_format = 848; - Ext4MarkInodeDirtyFormat ext4_mark_inode_dirty_format = 849; - Ext4MbBitmapLoadFormat ext4_mb_bitmap_load_format = 850; - Ext4MbBuddyBitmapLoadFormat ext4_mb_buddy_bitmap_load_format = 851; - Ext4MbDiscardPreallocationsFormat ext4_mb_discard_preallocations_format = 852; - Ext4MbNewGroupPaFormat ext4_mb_new_group_pa_format = 853; - Ext4MbNewInodePaFormat ext4_mb_new_inode_pa_format = 854; - Ext4MbReleaseGroupPaFormat ext4_mb_release_group_pa_format = 855; - Ext4MbReleaseInodePaFormat ext4_mb_release_inode_pa_format = 856; - Ext4MballocAllocFormat ext4_mballoc_alloc_format = 857; - Ext4MballocDiscardFormat ext4_mballoc_discard_format = 858; - Ext4MballocFreeFormat ext4_mballoc_free_format = 859; - Ext4MballocPreallocFormat ext4_mballoc_prealloc_format = 860; - Ext4OtherInodeUpdateTimeFormat ext4_other_inode_update_time_format = 861; - Ext4PunchHoleFormat ext4_punch_hole_format = 862; - Ext4ReadBlockBitmapLoadFormat ext4_read_block_bitmap_load_format = 863; - Ext4RemoveBlocksFormat ext4_remove_blocks_format = 864; - Ext4RequestBlocksFormat ext4_request_blocks_format = 865; - Ext4RequestInodeFormat ext4_request_inode_format = 866; - Ext4SyncFileEnterFormat ext4_sync_file_enter_format = 867; - Ext4SyncFileExitFormat ext4_sync_file_exit_format = 868; - Ext4SyncFsFormat ext4_sync_fs_format = 869; - Ext4TrimAllFreeFormat ext4_trim_all_free_format = 870; - Ext4TrimExtentFormat ext4_trim_extent_format = 871; - Ext4TruncateEnterFormat ext4_truncate_enter_format = 872; - Ext4TruncateExitFormat ext4_truncate_exit_format = 873; - Ext4UnlinkEnterFormat ext4_unlink_enter_format = 874; - Ext4UnlinkExitFormat ext4_unlink_exit_format = 875; - Ext4WriteBeginFormat ext4_write_begin_format = 876; - Ext4WriteEndFormat ext4_write_end_format = 877; - Ext4WritepagesFormat ext4_writepages_format = 878; - Ext4WritepagesResultFormat ext4_writepages_result_format = 879; - Ext4ZeroRangeFormat ext4_zero_range_format = 880; - F2fsSyncFileEnterFormat f2fs_sync_file_enter_format = 900; - F2fsSyncFileExitFormat f2fs_sync_file_exit_format = 901; - F2fsWriteBeginFormat f2fs_write_begin_format = 902; - F2fsWriteEndFormat f2fs_write_end_format = 903; - BreakLeaseBlockFormat break_lease_block_format = 1000; - BreakLeaseNoblockFormat break_lease_noblock_format = 1001; - BreakLeaseUnblockFormat break_lease_unblock_format = 1002; - GenericAddLeaseFormat generic_add_lease_format = 1003; - GenericDeleteLeaseFormat generic_delete_lease_format = 1004; - TimeOutLeasesFormat time_out_leases_format = 1005; - FileCheckAndAdvanceWbErrFormat file_check_and_advance_wb_err_format = 1100; - FilemapSetWbErrFormat filemap_set_wb_err_format = 1101; - MmFilemapAddToPageCacheFormat mm_filemap_add_to_page_cache_format = 1102; - MmFilemapDeleteFromPageCacheFormat mm_filemap_delete_from_page_cache_format = 1103; - BputsFormat bputs_format = 1200; - BranchFormat branch_format = 1201; - ContextSwitchFormat context_switch_format = 1202; - FuncgraphEntryFormat funcgraph_entry_format = 1203; - FuncgraphExitFormat funcgraph_exit_format = 1204; - FunctionFormat function_format = 1205; - KernelStackFormat kernel_stack_format = 1206; - MmiotraceMapFormat mmiotrace_map_format = 1207; - MmiotraceRwFormat mmiotrace_rw_format = 1208; - PrintFormat print_format = 1209; - UserStackFormat user_stack_format = 1210; - WakeupFormat wakeup_format = 1211; - GpioDirectionFormat gpio_direction_format = 1300; - GpioValueFormat gpio_value_format = 1301; - I2cReadFormat i2c_read_format = 1400; - I2cReplyFormat i2c_reply_format = 1401; - I2cResultFormat i2c_result_format = 1402; - I2cWriteFormat i2c_write_format = 1403; - IpiEntryFormat ipi_entry_format = 1500; - IpiExitFormat ipi_exit_format = 1501; - IpiRaiseFormat ipi_raise_format = 1502; - IrqHandlerEntryFormat irq_handler_entry_format = 1600; - IrqHandlerExitFormat irq_handler_exit_format = 1601; - SoftirqEntryFormat softirq_entry_format = 1602; - SoftirqExitFormat softirq_exit_format = 1603; - SoftirqRaiseFormat softirq_raise_format = 1604; - KfreeFormat kfree_format = 1700; - KmallocFormat kmalloc_format = 1701; - KmemCacheAllocFormat kmem_cache_alloc_format = 1702; - KmemCacheFreeFormat kmem_cache_free_format = 1703; - MmPageAllocFormat mm_page_alloc_format = 1704; - MmPageAllocExtfragFormat mm_page_alloc_extfrag_format = 1705; - MmPageAllocZoneLockedFormat mm_page_alloc_zone_locked_format = 1706; - MmPageFreeFormat mm_page_free_format = 1707; - MmPageFreeBatchedFormat mm_page_free_batched_format = 1708; - MmPagePcpuDrainFormat mm_page_pcpu_drain_format = 1709; - RssStatFormat rss_stat_format = 1710; - MmcRequestDoneFormat mmc_request_done_format = 1800; - MmcRequestStartFormat mmc_request_start_format = 1801; - NapiGroFragsEntryFormat napi_gro_frags_entry_format = 1900; - NapiGroReceiveEntryFormat napi_gro_receive_entry_format = 1901; - NetDevQueueFormat net_dev_queue_format = 1902; - NetDevStartXmitFormat net_dev_start_xmit_format = 1903; - NetDevXmitFormat net_dev_xmit_format = 1904; - NetifReceiveSkbFormat netif_receive_skb_format = 1905; - NetifReceiveSkbEntryFormat netif_receive_skb_entry_format = 1906; - NetifRxFormat netif_rx_format = 1907; - NetifRxEntryFormat netif_rx_entry_format = 1908; - OomScoreAdjUpdateFormat oom_score_adj_update_format = 2000; - MmLruActivateFormat mm_lru_activate_format = 2100; - MmLruInsertionFormat mm_lru_insertion_format = 2101; - ClockDisableFormat clock_disable_format = 2200; - ClockEnableFormat clock_enable_format = 2201; - ClockSetRateFormat clock_set_rate_format = 2202; - CpuFrequencyFormat cpu_frequency_format = 2203; - CpuFrequencyLimitsFormat cpu_frequency_limits_format = 2204; - CpuIdleFormat cpu_idle_format = 2205; - DevPmQosAddRequestFormat dev_pm_qos_add_request_format = 2206; - DevPmQosRemoveRequestFormat dev_pm_qos_remove_request_format = 2207; - DevPmQosUpdateRequestFormat dev_pm_qos_update_request_format = 2208; - DevicePmCallbackEndFormat device_pm_callback_end_format = 2209; - DevicePmCallbackStartFormat device_pm_callback_start_format = 2210; - PmQosAddRequestFormat pm_qos_add_request_format = 2211; - PmQosRemoveRequestFormat pm_qos_remove_request_format = 2212; - PmQosUpdateFlagsFormat pm_qos_update_flags_format = 2213; - PmQosUpdateRequestFormat pm_qos_update_request_format = 2214; - PmQosUpdateTargetFormat pm_qos_update_target_format = 2215; - PowerDomainTargetFormat power_domain_target_format = 2216; - PstateSampleFormat pstate_sample_format = 2217; - SuspendResumeFormat suspend_resume_format = 2218; - WakeupSourceActivateFormat wakeup_source_activate_format = 2219; - WakeupSourceDeactivateFormat wakeup_source_deactivate_format = 2220; - ConsoleFormat console_format = 2300; - SysEnterFormat sys_enter_format = 2400; - SysExitFormat sys_exit_format = 2401; - RcuUtilizationFormat rcu_utilization_format = 2500; - RegulatorBypassDisableFormat regulator_bypass_disable_format = 2600; - RegulatorBypassDisableCompleteFormat regulator_bypass_disable_complete_format = 2601; - RegulatorBypassEnableFormat regulator_bypass_enable_format = 2602; - RegulatorBypassEnableCompleteFormat regulator_bypass_enable_complete_format = 2603; - RegulatorDisableFormat regulator_disable_format = 2604; - RegulatorDisableCompleteFormat regulator_disable_complete_format = 2605; - RegulatorEnableFormat regulator_enable_format = 2606; - RegulatorEnableCompleteFormat regulator_enable_complete_format = 2607; - RegulatorEnableDelayFormat regulator_enable_delay_format = 2608; - RegulatorSetVoltageFormat regulator_set_voltage_format = 2609; - RegulatorSetVoltageCompleteFormat regulator_set_voltage_complete_format = 2610; - SchedKthreadStopFormat sched_kthread_stop_format = 2700; - SchedKthreadStopRetFormat sched_kthread_stop_ret_format = 2701; - SchedMigrateTaskFormat sched_migrate_task_format = 2702; - SchedMoveNumaFormat sched_move_numa_format = 2703; - SchedPiSetprioFormat sched_pi_setprio_format = 2704; - SchedProcessExecFormat sched_process_exec_format = 2705; - SchedProcessExitFormat sched_process_exit_format = 2706; - SchedProcessForkFormat sched_process_fork_format = 2707; - SchedProcessFreeFormat sched_process_free_format = 2708; - SchedProcessWaitFormat sched_process_wait_format = 2709; - SchedStatBlockedFormat sched_stat_blocked_format = 2710; - SchedStatIowaitFormat sched_stat_iowait_format = 2711; - SchedStatRuntimeFormat sched_stat_runtime_format = 2712; - SchedStatSleepFormat sched_stat_sleep_format = 2713; - SchedStatWaitFormat sched_stat_wait_format = 2714; - SchedStickNumaFormat sched_stick_numa_format = 2715; - SchedSwapNumaFormat sched_swap_numa_format = 2716; - SchedSwitchFormat sched_switch_format = 2717; - SchedWaitTaskFormat sched_wait_task_format = 2718; - SchedWakeIdleWithoutIpiFormat sched_wake_idle_without_ipi_format = 2719; - SchedWakeupFormat sched_wakeup_format = 2720; - SchedWakeupNewFormat sched_wakeup_new_format = 2721; - SchedWakingFormat sched_waking_format = 2722; - SignalDeliverFormat signal_deliver_format = 2800; - SignalGenerateFormat signal_generate_format = 2801; - RpcCallStatusFormat rpc_call_status_format = 2900; - RpcConnectStatusFormat rpc_connect_status_format = 2901; - RpcSocketCloseFormat rpc_socket_close_format = 2902; - RpcSocketConnectFormat rpc_socket_connect_format = 2903; - RpcSocketErrorFormat rpc_socket_error_format = 2904; - RpcSocketResetConnectionFormat rpc_socket_reset_connection_format = 2905; - RpcSocketShutdownFormat rpc_socket_shutdown_format = 2906; - RpcSocketStateChangeFormat rpc_socket_state_change_format = 2907; - RpcTaskBeginFormat rpc_task_begin_format = 2908; - RpcTaskCompleteFormat rpc_task_complete_format = 2909; - RpcTaskRunActionFormat rpc_task_run_action_format = 2910; - RpcTaskSleepFormat rpc_task_sleep_format = 2911; - RpcTaskWakeupFormat rpc_task_wakeup_format = 2912; - SvcProcessFormat svc_process_format = 2913; - SvcSendFormat svc_send_format = 2914; - SvcWakeUpFormat svc_wake_up_format = 2915; - SvcXprtDequeueFormat svc_xprt_dequeue_format = 2916; - XprtLookupRqstFormat xprt_lookup_rqst_format = 2917; - XprtTransmitFormat xprt_transmit_format = 2918; - TaskNewtaskFormat task_newtask_format = 3000; - TaskRenameFormat task_rename_format = 3001; - HrtimerCancelFormat hrtimer_cancel_format = 3100; - HrtimerExpireEntryFormat hrtimer_expire_entry_format = 3101; - HrtimerExpireExitFormat hrtimer_expire_exit_format = 3102; - HrtimerInitFormat hrtimer_init_format = 3103; - HrtimerStartFormat hrtimer_start_format = 3104; - ItimerExpireFormat itimer_expire_format = 3105; - ItimerStateFormat itimer_state_format = 3106; - TimerCancelFormat timer_cancel_format = 3107; - TimerExpireEntryFormat timer_expire_entry_format = 3108; - TimerExpireExitFormat timer_expire_exit_format = 3109; - TimerInitFormat timer_init_format = 3110; - TimerStartFormat timer_start_format = 3111; - V4l2DqbufFormat v4l2_dqbuf_format = 3200; - V4l2QbufFormat v4l2_qbuf_format = 3201; - Vb2V4l2BufDoneFormat vb2_v4l2_buf_done_format = 3202; - Vb2V4l2BufQueueFormat vb2_v4l2_buf_queue_format = 3203; - Vb2V4l2DqbufFormat vb2_v4l2_dqbuf_format = 3204; - Vb2V4l2QbufFormat vb2_v4l2_qbuf_format = 3205; - MmShrinkSlabEndFormat mm_shrink_slab_end_format = 3300; - MmShrinkSlabStartFormat mm_shrink_slab_start_format = 3301; - MmVmscanDirectReclaimBeginFormat mm_vmscan_direct_reclaim_begin_format = 3302; - MmVmscanDirectReclaimEndFormat mm_vmscan_direct_reclaim_end_format = 3303; - MmVmscanKswapdSleepFormat mm_vmscan_kswapd_sleep_format = 3304; - MmVmscanKswapdWakeFormat mm_vmscan_kswapd_wake_format = 3305; - MmVmscanLruIsolateFormat mm_vmscan_lru_isolate_format = 3306; - MmVmscanLruShrinkInactiveFormat mm_vmscan_lru_shrink_inactive_format = 3307; - MmVmscanWakeupKswapdFormat mm_vmscan_wakeup_kswapd_format = 3308; - WorkqueueActivateWorkFormat workqueue_activate_work_format = 3400; - WorkqueueExecuteEndFormat workqueue_execute_end_format = 3401; - WorkqueueExecuteStartFormat workqueue_execute_start_format = 3402; - WorkqueueQueueWorkFormat workqueue_queue_work_format = 3403; - BalanceDirtyPagesFormat balance_dirty_pages_format = 3500; - BdiDirtyRatelimitFormat bdi_dirty_ratelimit_format = 3501; - GlobalDirtyStateFormat global_dirty_state_format = 3502; - WbcWritepageFormat wbc_writepage_format = 3503; - WritebackBdiRegisterFormat writeback_bdi_register_format = 3504; - WritebackDirtyInodeFormat writeback_dirty_inode_format = 3505; - WritebackDirtyInodeEnqueueFormat writeback_dirty_inode_enqueue_format = 3506; - WritebackDirtyInodeStartFormat writeback_dirty_inode_start_format = 3507; - WritebackExecFormat writeback_exec_format = 3508; - WritebackLazytimeFormat writeback_lazytime_format = 3509; - WritebackLazytimeIputFormat writeback_lazytime_iput_format = 3510; - WritebackMarkInodeDirtyFormat writeback_mark_inode_dirty_format = 3511; - WritebackPagesWrittenFormat writeback_pages_written_format = 3512; - WritebackQueueFormat writeback_queue_format = 3513; - WritebackQueueIoFormat writeback_queue_io_format = 3514; - WritebackSbInodesRequeueFormat writeback_sb_inodes_requeue_format = 3515; - WritebackSingleInodeFormat writeback_single_inode_format = 3516; - WritebackSingleInodeStartFormat writeback_single_inode_start_format = 3517; - WritebackStartFormat writeback_start_format = 3518; - WritebackWaitFormat writeback_wait_format = 3519; - WritebackWakeBackgroundFormat writeback_wake_background_format = 3520; - WritebackWriteInodeFormat writeback_write_inode_format = 3521; - WritebackWriteInodeStartFormat writeback_write_inode_start_format = 3522; - WritebackWrittenFormat writeback_written_format = 3523; - } -} diff --git a/protos/types/plugins/ftrace_data/6.6.30/gpio.proto b/protos/types/plugins/ftrace_data/6.6.30/gpio.proto deleted file mode 100644 index 14fae6170..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/gpio.proto +++ /dev/null @@ -1,34 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: gpio -// /sys/kernel/debug/tracing/events/gpio/gpio_direction/format -message GpioDirectionFormat { - uint32 gpio = 1; - int32 in = 2; - int32 err = 3; -} - -// /sys/kernel/debug/tracing/events/gpio/gpio_value/format -message GpioValueFormat { - uint32 gpio = 1; - int32 get = 2; - int32 value = 3; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/i2c.proto b/protos/types/plugins/ftrace_data/6.6.30/i2c.proto deleted file mode 100644 index 61ab8ad86..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/i2c.proto +++ /dev/null @@ -1,56 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: i2c -// /sys/kernel/debug/tracing/events/i2c/i2c_read/format -message I2cReadFormat { - int32 adapter_nr = 1; - uint32 msg_nr = 2; - uint32 addr = 3; - uint32 flags = 4; - uint32 len = 5; -} - -// /sys/kernel/debug/tracing/events/i2c/i2c_reply/format -message I2cReplyFormat { - int32 adapter_nr = 1; - uint32 msg_nr = 2; - uint32 addr = 3; - uint32 flags = 4; - uint32 len = 5; - uint32 buf = 6; -} - -// /sys/kernel/debug/tracing/events/i2c/i2c_result/format -message I2cResultFormat { - int32 adapter_nr = 1; - uint32 nr_msgs = 2; - int32 ret = 3; -} - -// /sys/kernel/debug/tracing/events/i2c/i2c_write/format -message I2cWriteFormat { - int32 adapter_nr = 1; - uint32 msg_nr = 2; - uint32 addr = 3; - uint32 flags = 4; - uint32 len = 5; - uint32 buf = 6; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/ipi.proto b/protos/types/plugins/ftrace_data/6.6.30/ipi.proto deleted file mode 100644 index 60a9feb08..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/ipi.proto +++ /dev/null @@ -1,36 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: ipi -// /sys/kernel/debug/tracing/events/ipi/ipi_entry/format -message IpiEntryFormat { - string reason = 1; -} - -// /sys/kernel/debug/tracing/events/ipi/ipi_exit/format -message IpiExitFormat { - string reason = 1; -} - -// /sys/kernel/debug/tracing/events/ipi/ipi_raise/format -message IpiRaiseFormat { - uint64 target_cpus = 1; - string reason = 2; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/irq.proto b/protos/types/plugins/ftrace_data/6.6.30/irq.proto deleted file mode 100644 index 0febc6a60..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/irq.proto +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: irq -// /sys/kernel/debug/tracing/events/irq/irq_handler_entry/format -message IrqHandlerEntryFormat { - int32 irq = 1; - string name = 2; -} - -// /sys/kernel/debug/tracing/events/irq/irq_handler_exit/format -message IrqHandlerExitFormat { - int32 irq = 1; - int32 ret = 2; -} - -// /sys/kernel/debug/tracing/events/irq/softirq_entry/format -message SoftirqEntryFormat { - uint32 vec = 1; -} - -// /sys/kernel/debug/tracing/events/irq/softirq_exit/format -message SoftirqExitFormat { - uint32 vec = 1; -} - -// /sys/kernel/debug/tracing/events/irq/softirq_raise/format -message SoftirqRaiseFormat { - uint32 vec = 1; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/kmem.proto b/protos/types/plugins/ftrace_data/6.6.30/kmem.proto deleted file mode 100644 index 459cc4e24..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/kmem.proto +++ /dev/null @@ -1,106 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: kmem -// /sys/kernel/debug/tracing/events/kmem/kfree/format -message KfreeFormat { - uint64 call_site = 1; - uint64 ptr = 2; -} - -// /sys/kernel/debug/tracing/events/kmem/kmalloc/format -message KmallocFormat { - uint64 call_site = 1; - uint64 ptr = 2; - uint64 bytes_req = 3; - uint64 bytes_alloc = 4; - uint64 gfp_flags = 5; - int32 node = 6; -} - -// /sys/kernel/debug/tracing/events/kmem/kmem_cache_alloc/format -message KmemCacheAllocFormat { - uint64 call_site = 1; - uint64 ptr = 2; - uint64 bytes_req = 3; - uint64 bytes_alloc = 4; - uint64 gfp_flags = 5; - int32 node = 6; - uint32 accounted = 7; -} - -// /sys/kernel/debug/tracing/events/kmem/kmem_cache_free/format -message KmemCacheFreeFormat { - uint64 call_site = 1; - uint64 ptr = 2; - string name = 3; -} - -// /sys/kernel/debug/tracing/events/kmem/mm_page_alloc/format -message MmPageAllocFormat { - uint64 pfn = 1; - uint32 order = 2; - uint64 gfp_flags = 3; - int32 migratetype = 4; -} - -// /sys/kernel/debug/tracing/events/kmem/mm_page_alloc_extfrag/format -message MmPageAllocExtfragFormat { - uint64 pfn = 1; - int32 alloc_order = 2; - int32 fallback_order = 3; - int32 alloc_migratetype = 4; - int32 fallback_migratetype = 5; - int32 change_ownership = 6; -} - -// /sys/kernel/debug/tracing/events/kmem/mm_page_alloc_zone_locked/format -message MmPageAllocZoneLockedFormat { - uint64 pfn = 1; - uint32 order = 2; - int32 migratetype = 3; - int32 percpu_refill = 4; -} - -// /sys/kernel/debug/tracing/events/kmem/mm_page_free/format -message MmPageFreeFormat { - uint64 pfn = 1; - uint32 order = 2; -} - -// /sys/kernel/debug/tracing/events/kmem/mm_page_free_batched/format -message MmPageFreeBatchedFormat { - uint64 pfn = 1; -} - -// /sys/kernel/debug/tracing/events/kmem/mm_page_pcpu_drain/format -message MmPagePcpuDrainFormat { - uint64 pfn = 1; - uint32 order = 2; - int32 migratetype = 3; -} - -// /sys/kernel/debug/tracing/events/kmem/rss_stat/format -message RssStatFormat { - uint32 mm_id = 1; - uint32 curr = 2; - int32 member = 3; - uint64 size = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/mmc.proto b/protos/types/plugins/ftrace_data/6.6.30/mmc.proto deleted file mode 100644 index b6ecbfacb..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/mmc.proto +++ /dev/null @@ -1,76 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: mmc -// /sys/kernel/debug/tracing/events/mmc/mmc_request_done/format -message MmcRequestDoneFormat { - uint32 cmd_opcode = 1; - int32 cmd_err = 2; - string cmd_resp = 3; - uint32 cmd_retries = 4; - uint32 stop_opcode = 5; - int32 stop_err = 6; - string stop_resp = 7; - uint32 stop_retries = 8; - uint32 sbc_opcode = 9; - int32 sbc_err = 10; - string sbc_resp = 11; - uint32 sbc_retries = 12; - uint32 bytes_xfered = 13; - int32 data_err = 14; - int32 tag = 15; - uint32 can_retune = 16; - uint32 doing_retune = 17; - uint32 retune_now = 18; - int32 need_retune = 19; - int32 hold_retune = 20; - uint32 retune_period = 21; - uint64 mrq = 22; - string name = 23; -} - -// /sys/kernel/debug/tracing/events/mmc/mmc_request_start/format -message MmcRequestStartFormat { - uint32 cmd_opcode = 1; - uint32 cmd_arg = 2; - uint32 cmd_flags = 3; - uint32 cmd_retries = 4; - uint32 stop_opcode = 5; - uint32 stop_arg = 6; - uint32 stop_flags = 7; - uint32 stop_retries = 8; - uint32 sbc_opcode = 9; - uint32 sbc_arg = 10; - uint32 sbc_flags = 11; - uint32 sbc_retries = 12; - uint32 blocks = 13; - uint32 blk_addr = 14; - uint32 blksz = 15; - uint32 data_flags = 16; - int32 tag = 17; - uint32 can_retune = 18; - uint32 doing_retune = 19; - uint32 retune_now = 20; - int32 need_retune = 21; - int32 hold_retune = 22; - uint32 retune_period = 23; - uint64 mrq = 24; - string name = 25; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/net.proto b/protos/types/plugins/ftrace_data/6.6.30/net.proto deleted file mode 100644 index f3e84eec2..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/net.proto +++ /dev/null @@ -1,162 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: net -// /sys/kernel/debug/tracing/events/net/napi_gro_frags_entry/format -message NapiGroFragsEntryFormat { - string name = 1; - uint32 napi_id = 2; - uint32 queue_mapping = 3; - uint64 skbaddr = 4; - uint32 vlan_tagged = 5; - uint32 vlan_proto = 6; - uint32 vlan_tci = 7; - uint32 protocol = 8; - uint32 ip_summed = 9; - uint32 hash = 10; - uint32 l4_hash = 11; - uint32 len = 12; - uint32 data_len = 13; - uint32 truesize = 14; - uint32 mac_header_valid = 15; - int32 mac_header = 16; - uint32 nr_frags = 17; - uint32 gso_size = 18; - uint32 gso_type = 19; -} - -// /sys/kernel/debug/tracing/events/net/napi_gro_receive_entry/format -message NapiGroReceiveEntryFormat { - string name = 1; - uint32 napi_id = 2; - uint32 queue_mapping = 3; - uint64 skbaddr = 4; - uint32 vlan_tagged = 5; - uint32 vlan_proto = 6; - uint32 vlan_tci = 7; - uint32 protocol = 8; - uint32 ip_summed = 9; - uint32 hash = 10; - uint32 l4_hash = 11; - uint32 len = 12; - uint32 data_len = 13; - uint32 truesize = 14; - uint32 mac_header_valid = 15; - int32 mac_header = 16; - uint32 nr_frags = 17; - uint32 gso_size = 18; - uint32 gso_type = 19; -} - -// /sys/kernel/debug/tracing/events/net/net_dev_queue/format -message NetDevQueueFormat { - uint64 skbaddr = 1; - uint32 len = 2; - string name = 3; -} - -// /sys/kernel/debug/tracing/events/net/net_dev_start_xmit/format -message NetDevStartXmitFormat { - string name = 1; - uint32 queue_mapping = 2; - uint64 skbaddr = 3; - uint32 vlan_tagged = 4; - uint32 vlan_proto = 5; - uint32 vlan_tci = 6; - uint32 protocol = 7; - uint32 ip_summed = 8; - uint32 len = 9; - uint32 data_len = 10; - int32 network_offset = 11; - uint32 transport_offset_valid = 12; - int32 transport_offset = 13; - uint32 tx_flags = 14; - uint32 gso_size = 15; - uint32 gso_segs = 16; - uint32 gso_type = 17; -} - -// /sys/kernel/debug/tracing/events/net/net_dev_xmit/format -message NetDevXmitFormat { - uint64 skbaddr = 1; - uint32 len = 2; - int32 rc = 3; - string name = 4; -} - -// /sys/kernel/debug/tracing/events/net/netif_receive_skb/format -message NetifReceiveSkbFormat { - uint64 skbaddr = 1; - uint32 len = 2; - string name = 3; -} - -// /sys/kernel/debug/tracing/events/net/netif_receive_skb_entry/format -message NetifReceiveSkbEntryFormat { - string name = 1; - uint32 napi_id = 2; - uint32 queue_mapping = 3; - uint64 skbaddr = 4; - uint32 vlan_tagged = 5; - uint32 vlan_proto = 6; - uint32 vlan_tci = 7; - uint32 protocol = 8; - uint32 ip_summed = 9; - uint32 hash = 10; - uint32 l4_hash = 11; - uint32 len = 12; - uint32 data_len = 13; - uint32 truesize = 14; - uint32 mac_header_valid = 15; - int32 mac_header = 16; - uint32 nr_frags = 17; - uint32 gso_size = 18; - uint32 gso_type = 19; -} - -// /sys/kernel/debug/tracing/events/net/netif_rx/format -message NetifRxFormat { - uint64 skbaddr = 1; - uint32 len = 2; - string name = 3; -} - -// /sys/kernel/debug/tracing/events/net/netif_rx_entry/format -message NetifRxEntryFormat { - string name = 1; - uint32 napi_id = 2; - uint32 queue_mapping = 3; - uint64 skbaddr = 4; - uint32 vlan_tagged = 5; - uint32 vlan_proto = 6; - uint32 vlan_tci = 7; - uint32 protocol = 8; - uint32 ip_summed = 9; - uint32 hash = 10; - uint32 l4_hash = 11; - uint32 len = 12; - uint32 data_len = 13; - uint32 truesize = 14; - uint32 mac_header_valid = 15; - int32 mac_header = 16; - uint32 nr_frags = 17; - uint32 gso_size = 18; - uint32 gso_type = 19; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/oom.proto b/protos/types/plugins/ftrace_data/6.6.30/oom.proto deleted file mode 100644 index 23d21ab7d..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/oom.proto +++ /dev/null @@ -1,27 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: oom -// /sys/kernel/debug/tracing/events/oom/oom_score_adj_update/format -message OomScoreAdjUpdateFormat { - int32 pid = 1; - string comm = 2; - int32 oom_score_adj = 3; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/pagemap.proto b/protos/types/plugins/ftrace_data/6.6.30/pagemap.proto deleted file mode 100644 index c057ea050..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/pagemap.proto +++ /dev/null @@ -1,34 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: pagemap -// /sys/kernel/debug/tracing/events/pagemap/mm_lru_activate/format -message MmLruActivateFormat { - uint64 folio = 1; - uint64 pfn = 2; -} - -// /sys/kernel/debug/tracing/events/pagemap/mm_lru_insertion/format -message MmLruInsertionFormat { - uint64 folio = 1; - uint64 pfn = 2; - uint32 lru = 3; - uint64 flags = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/power.proto b/protos/types/plugins/ftrace_data/6.6.30/power.proto deleted file mode 100644 index a6e0d8f31..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/power.proto +++ /dev/null @@ -1,165 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: power -// /sys/kernel/debug/tracing/events/power/clock_disable/format -message ClockDisableFormat { - string name = 1; - uint64 state = 2; - uint64 cpu_id = 3; -} - -// /sys/kernel/debug/tracing/events/power/clock_enable/format -message ClockEnableFormat { - string name = 1; - uint64 state = 2; - uint64 cpu_id = 3; -} - -// /sys/kernel/debug/tracing/events/power/clock_set_rate/format -message ClockSetRateFormat { - string name = 1; - uint64 state = 2; - uint64 cpu_id = 3; -} - -// /sys/kernel/debug/tracing/events/power/cpu_frequency/format -message CpuFrequencyFormat { - uint32 state = 1; - uint32 cpu_id = 2; -} - -// /sys/kernel/debug/tracing/events/power/cpu_frequency_limits/format -message CpuFrequencyLimitsFormat { - uint32 min_freq = 1; - uint32 max_freq = 2; - uint32 cpu_id = 3; -} - -// /sys/kernel/debug/tracing/events/power/cpu_idle/format -message CpuIdleFormat { - uint32 state = 1; - uint32 cpu_id = 2; -} - -// /sys/kernel/debug/tracing/events/power/dev_pm_qos_add_request/format -message DevPmQosAddRequestFormat { - string name = 1; - uint32 type = 2; - int32 new_value = 3; -} - -// /sys/kernel/debug/tracing/events/power/dev_pm_qos_remove_request/format -message DevPmQosRemoveRequestFormat { - string name = 1; - uint32 type = 2; - int32 new_value = 3; -} - -// /sys/kernel/debug/tracing/events/power/dev_pm_qos_update_request/format -message DevPmQosUpdateRequestFormat { - string name = 1; - uint32 type = 2; - int32 new_value = 3; -} - -// /sys/kernel/debug/tracing/events/power/device_pm_callback_end/format -message DevicePmCallbackEndFormat { - string device = 1; - string driver = 2; - int32 error = 3; -} - -// /sys/kernel/debug/tracing/events/power/device_pm_callback_start/format -message DevicePmCallbackStartFormat { - string device = 1; - string driver = 2; - string parent = 3; - string pm_ops = 4; - int32 event = 5; -} - -// /sys/kernel/debug/tracing/events/power/pm_qos_add_request/format -message PmQosAddRequestFormat { - int32 value = 1; -} - -// /sys/kernel/debug/tracing/events/power/pm_qos_remove_request/format -message PmQosRemoveRequestFormat { - int32 value = 1; -} - -// /sys/kernel/debug/tracing/events/power/pm_qos_update_flags/format -message PmQosUpdateFlagsFormat { - uint32 action = 1; - int32 prev_value = 2; - int32 curr_value = 3; -} - -// /sys/kernel/debug/tracing/events/power/pm_qos_update_request/format -message PmQosUpdateRequestFormat { - int32 value = 1; -} - -// /sys/kernel/debug/tracing/events/power/pm_qos_update_target/format -message PmQosUpdateTargetFormat { - uint32 action = 1; - int32 prev_value = 2; - int32 curr_value = 3; -} - -// /sys/kernel/debug/tracing/events/power/power_domain_target/format -message PowerDomainTargetFormat { - string name = 1; - uint64 state = 2; - uint64 cpu_id = 3; -} - -// /sys/kernel/debug/tracing/events/power/pstate_sample/format -message PstateSampleFormat { - uint32 core_busy = 1; - uint32 scaled_busy = 2; - uint32 from = 3; - uint32 to = 4; - uint64 mperf = 5; - uint64 aperf = 6; - uint64 tsc = 7; - uint32 freq = 8; - uint32 io_boost = 9; -} - -// /sys/kernel/debug/tracing/events/power/suspend_resume/format -message SuspendResumeFormat { - string action = 1; - int32 val = 2; - uint32 start = 3; -} - -// /sys/kernel/debug/tracing/events/power/wakeup_source_activate/format -message WakeupSourceActivateFormat { - string name = 1; - uint64 state = 2; -} - -// /sys/kernel/debug/tracing/events/power/wakeup_source_deactivate/format -message WakeupSourceDeactivateFormat { - string name = 1; - uint64 state = 2; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/printk.proto b/protos/types/plugins/ftrace_data/6.6.30/printk.proto deleted file mode 100644 index 8a7ecca32..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/printk.proto +++ /dev/null @@ -1,25 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: printk -// /sys/kernel/debug/tracing/events/printk/console/format -message ConsoleFormat { - string msg = 1; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/raw_syscalls.proto b/protos/types/plugins/ftrace_data/6.6.30/raw_syscalls.proto deleted file mode 100644 index 592f37643..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/raw_syscalls.proto +++ /dev/null @@ -1,32 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: raw_syscalls -// /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/format -message SysEnterFormat { - uint64 id = 1; - repeated uint64 args = 2; -} - -// /sys/kernel/debug/tracing/events/raw_syscalls/sys_exit/format -message SysExitFormat { - uint64 id = 1; - uint64 ret = 2; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/rcu.proto b/protos/types/plugins/ftrace_data/6.6.30/rcu.proto deleted file mode 100644 index 2f7f0904c..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/rcu.proto +++ /dev/null @@ -1,25 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: rcu -// /sys/kernel/debug/tracing/events/rcu/rcu_utilization/format -message RcuUtilizationFormat { - string s = 1; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/regulator.proto b/protos/types/plugins/ftrace_data/6.6.30/regulator.proto deleted file mode 100644 index 77df2a669..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/regulator.proto +++ /dev/null @@ -1,78 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: regulator -// /sys/kernel/debug/tracing/events/regulator/regulator_bypass_disable/format -message RegulatorBypassDisableFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_bypass_disable_complete/format -message RegulatorBypassDisableCompleteFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_bypass_enable/format -message RegulatorBypassEnableFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_bypass_enable_complete/format -message RegulatorBypassEnableCompleteFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_disable/format -message RegulatorDisableFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_disable_complete/format -message RegulatorDisableCompleteFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_enable/format -message RegulatorEnableFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_enable_complete/format -message RegulatorEnableCompleteFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_enable_delay/format -message RegulatorEnableDelayFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_set_voltage/format -message RegulatorSetVoltageFormat { - string name = 1; - int32 min = 2; - int32 max = 3; -} - -// /sys/kernel/debug/tracing/events/regulator/regulator_set_voltage_complete/format -message RegulatorSetVoltageCompleteFormat { - string name = 1; - uint32 val = 2; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/sched.proto b/protos/types/plugins/ftrace_data/6.6.30/sched.proto deleted file mode 100644 index e0dbd4ab4..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/sched.proto +++ /dev/null @@ -1,206 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: sched -// /sys/kernel/debug/tracing/events/sched/sched_kthread_stop/format -message SchedKthreadStopFormat { - string comm = 1; - int32 pid = 2; -} - -// /sys/kernel/debug/tracing/events/sched/sched_kthread_stop_ret/format -message SchedKthreadStopRetFormat { - int32 ret = 1; -} - -// /sys/kernel/debug/tracing/events/sched/sched_migrate_task/format -message SchedMigrateTaskFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; - int32 orig_cpu = 4; - int32 dest_cpu = 5; -} - -// /sys/kernel/debug/tracing/events/sched/sched_move_numa/format -message SchedMoveNumaFormat { - int32 pid = 1; - int32 tgid = 2; - int32 ngid = 3; - int32 src_cpu = 4; - int32 src_nid = 5; - int32 dst_cpu = 6; - int32 dst_nid = 7; -} - -// /sys/kernel/debug/tracing/events/sched/sched_pi_setprio/format -message SchedPiSetprioFormat { - string comm = 1; - int32 pid = 2; - int32 oldprio = 3; - int32 newprio = 4; -} - -// /sys/kernel/debug/tracing/events/sched/sched_process_exec/format -message SchedProcessExecFormat { - string filename = 1; - int32 pid = 2; - int32 old_pid = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_process_exit/format -message SchedProcessExitFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_process_fork/format -message SchedProcessForkFormat { - string parent_comm = 1; - int32 parent_pid = 2; - string child_comm = 3; - int32 child_pid = 4; -} - -// /sys/kernel/debug/tracing/events/sched/sched_process_free/format -message SchedProcessFreeFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_process_wait/format -message SchedProcessWaitFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_stat_blocked/format -message SchedStatBlockedFormat { - string comm = 1; - int32 pid = 2; - uint64 delay = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_stat_iowait/format -message SchedStatIowaitFormat { - string comm = 1; - int32 pid = 2; - uint64 delay = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_stat_runtime/format -message SchedStatRuntimeFormat { - string comm = 1; - int32 pid = 2; - uint64 runtime = 3; - uint64 vruntime = 4; -} - -// /sys/kernel/debug/tracing/events/sched/sched_stat_sleep/format -message SchedStatSleepFormat { - string comm = 1; - int32 pid = 2; - uint64 delay = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_stat_wait/format -message SchedStatWaitFormat { - string comm = 1; - int32 pid = 2; - uint64 delay = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_stick_numa/format -message SchedStickNumaFormat { - int32 src_pid = 1; - int32 src_tgid = 2; - int32 src_ngid = 3; - int32 src_cpu = 4; - int32 src_nid = 5; - int32 dst_pid = 6; - int32 dst_tgid = 7; - int32 dst_ngid = 8; - int32 dst_cpu = 9; - int32 dst_nid = 10; -} - -// /sys/kernel/debug/tracing/events/sched/sched_swap_numa/format -message SchedSwapNumaFormat { - int32 src_pid = 1; - int32 src_tgid = 2; - int32 src_ngid = 3; - int32 src_cpu = 4; - int32 src_nid = 5; - int32 dst_pid = 6; - int32 dst_tgid = 7; - int32 dst_ngid = 8; - int32 dst_cpu = 9; - int32 dst_nid = 10; -} - -// /sys/kernel/debug/tracing/events/sched/sched_switch/format -message SchedSwitchFormat { - string prev_comm = 1; - int32 prev_pid = 2; - int32 prev_prio = 3; - uint64 prev_state = 4; - string next_comm = 5; - int32 next_pid = 6; - int32 next_prio = 7; -} - -// /sys/kernel/debug/tracing/events/sched/sched_wait_task/format -message SchedWaitTaskFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; -} - -// /sys/kernel/debug/tracing/events/sched/sched_wake_idle_without_ipi/format -message SchedWakeIdleWithoutIpiFormat { - int32 cpu = 1; -} - -// /sys/kernel/debug/tracing/events/sched/sched_wakeup/format -message SchedWakeupFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; - int32 target_cpu = 4; -} - -// /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/format -message SchedWakeupNewFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; - int32 target_cpu = 4; -} - -// /sys/kernel/debug/tracing/events/sched/sched_waking/format -message SchedWakingFormat { - string comm = 1; - int32 pid = 2; - int32 prio = 3; - int32 target_cpu = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/signal.proto b/protos/types/plugins/ftrace_data/6.6.30/signal.proto deleted file mode 100644 index 339719e37..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/signal.proto +++ /dev/null @@ -1,40 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: signal -// /sys/kernel/debug/tracing/events/signal/signal_deliver/format -message SignalDeliverFormat { - int32 sig = 1; - int32 error_code = 2; - int32 code = 3; - uint64 sig_handler = 4; - uint64 sig_flags = 5; -} - -// /sys/kernel/debug/tracing/events/signal/signal_generate/format -message SignalGenerateFormat { - int32 sig = 1; - int32 error_code = 2; - int32 code = 3; - string comm = 4; - int32 pid = 5; - int32 group = 6; - int32 result = 7; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/sunrpc.proto b/protos/types/plugins/ftrace_data/6.6.30/sunrpc.proto deleted file mode 100644 index 6057b9b60..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/sunrpc.proto +++ /dev/null @@ -1,194 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: sunrpc -// /sys/kernel/debug/tracing/events/sunrpc/rpc_call_status/format -message RpcCallStatusFormat { - uint32 task_id = 1; - uint32 client_id = 2; - int32 status = 3; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_connect_status/format -message RpcConnectStatusFormat { - uint32 task_id = 1; - uint32 client_id = 2; - int32 status = 3; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_socket_close/format -message RpcSocketCloseFormat { - uint32 socket_state = 1; - uint32 sock_state = 2; - uint64 ino = 3; - string saddr = 4; - string daddr = 5; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_socket_connect/format -message RpcSocketConnectFormat { - int32 error = 1; - uint32 socket_state = 2; - uint32 sock_state = 3; - uint64 ino = 4; - string saddr = 5; - string daddr = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_socket_error/format -message RpcSocketErrorFormat { - int32 error = 1; - uint32 socket_state = 2; - uint32 sock_state = 3; - uint64 ino = 4; - string saddr = 5; - string daddr = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_socket_reset_connection/format -message RpcSocketResetConnectionFormat { - int32 error = 1; - uint32 socket_state = 2; - uint32 sock_state = 3; - uint64 ino = 4; - string saddr = 5; - string daddr = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_socket_shutdown/format -message RpcSocketShutdownFormat { - uint32 socket_state = 1; - uint32 sock_state = 2; - uint64 ino = 3; - string saddr = 4; - string daddr = 5; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_socket_state_change/format -message RpcSocketStateChangeFormat { - uint32 socket_state = 1; - uint32 sock_state = 2; - uint64 ino = 3; - string saddr = 4; - string daddr = 5; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_task_begin/format -message RpcTaskBeginFormat { - uint32 task_id = 1; - uint32 client_id = 2; - uint64 action = 3; - uint64 runstate = 4; - int32 status = 5; - uint32 flags = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_task_complete/format -message RpcTaskCompleteFormat { - uint32 task_id = 1; - uint32 client_id = 2; - uint64 action = 3; - uint64 runstate = 4; - int32 status = 5; - uint32 flags = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_task_run_action/format -message RpcTaskRunActionFormat { - uint32 task_id = 1; - uint32 client_id = 2; - uint64 action = 3; - uint64 runstate = 4; - int32 status = 5; - uint32 flags = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_task_sleep/format -message RpcTaskSleepFormat { - uint32 task_id = 1; - uint32 client_id = 2; - uint64 timeout = 3; - uint64 runstate = 4; - int32 status = 5; - uint32 flags = 6; - string q_name = 7; -} - -// /sys/kernel/debug/tracing/events/sunrpc/rpc_task_wakeup/format -message RpcTaskWakeupFormat { - uint32 task_id = 1; - uint32 client_id = 2; - uint64 timeout = 3; - uint64 runstate = 4; - int32 status = 5; - uint32 flags = 6; - string q_name = 7; -} - -// /sys/kernel/debug/tracing/events/sunrpc/svc_process/format -message SvcProcessFormat { - uint32 xid = 1; - uint32 vers = 2; - uint32 proc = 3; - string service = 4; - string procedure = 5; - string addr = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/svc_send/format -message SvcSendFormat { - uint32 server = 1; - uint32 client = 2; - uint32 netns_ino = 3; - uint32 xid = 4; - int32 status = 5; - uint64 flags = 6; -} - -// /sys/kernel/debug/tracing/events/sunrpc/svc_wake_up/format -message SvcWakeUpFormat { - int32 pid = 1; -} - -// /sys/kernel/debug/tracing/events/sunrpc/svc_xprt_dequeue/format -message SvcXprtDequeueFormat { - uint32 server = 1; - uint32 client = 2; - uint64 flags = 3; - uint32 netns_ino = 4; - uint64 wakeup = 5; -} - -// /sys/kernel/debug/tracing/events/sunrpc/xprt_lookup_rqst/format -message XprtLookupRqstFormat { - uint32 xid = 1; - int32 status = 2; - string addr = 3; - string port = 4; -} - -// /sys/kernel/debug/tracing/events/sunrpc/xprt_transmit/format -message XprtTransmitFormat { - uint32 task_id = 1; - uint32 client_id = 2; - uint32 xid = 3; - uint32 seqno = 4; - int32 status = 5; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/task.proto b/protos/types/plugins/ftrace_data/6.6.30/task.proto deleted file mode 100644 index fbd0cfd42..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/task.proto +++ /dev/null @@ -1,36 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: task -// /sys/kernel/debug/tracing/events/task/task_newtask/format -message TaskNewtaskFormat { - int32 pid = 1; - string comm = 2; - uint64 clone_flags = 3; - int32 oom_score_adj = 4; -} - -// /sys/kernel/debug/tracing/events/task/task_rename/format -message TaskRenameFormat { - int32 pid = 1; - string oldcomm = 2; - string newcomm = 3; - int32 oom_score_adj = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/timer.proto b/protos/types/plugins/ftrace_data/6.6.30/timer.proto deleted file mode 100644 index 094b3af8a..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/timer.proto +++ /dev/null @@ -1,102 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: timer -// /sys/kernel/debug/tracing/events/timer/hrtimer_cancel/format -message HrtimerCancelFormat { - uint64 hrtimer = 1; -} - -// /sys/kernel/debug/tracing/events/timer/hrtimer_expire_entry/format -message HrtimerExpireEntryFormat { - uint64 hrtimer = 1; - int64 now = 2; - uint64 function = 3; -} - -// /sys/kernel/debug/tracing/events/timer/hrtimer_expire_exit/format -message HrtimerExpireExitFormat { - uint64 hrtimer = 1; -} - -// /sys/kernel/debug/tracing/events/timer/hrtimer_init/format -message HrtimerInitFormat { - uint64 hrtimer = 1; - int32 clockid = 2; - uint32 mode = 3; -} - -// /sys/kernel/debug/tracing/events/timer/hrtimer_start/format -message HrtimerStartFormat { - uint64 hrtimer = 1; - uint64 function = 2; - int64 expires = 3; - int64 softexpires = 4; - uint32 mode = 5; -} - -// /sys/kernel/debug/tracing/events/timer/itimer_expire/format -message ItimerExpireFormat { - int32 which = 1; - int32 pid = 2; - uint64 now = 3; -} - -// /sys/kernel/debug/tracing/events/timer/itimer_state/format -message ItimerStateFormat { - int32 which = 1; - uint64 expires = 2; - uint64 value_sec = 3; - uint64 value_nsec = 4; - uint64 interval_sec = 5; - uint64 interval_nsec = 6; -} - -// /sys/kernel/debug/tracing/events/timer/timer_cancel/format -message TimerCancelFormat { - uint64 timer = 1; -} - -// /sys/kernel/debug/tracing/events/timer/timer_expire_entry/format -message TimerExpireEntryFormat { - uint64 timer = 1; - uint64 now = 2; - uint64 function = 3; - uint64 baseclk = 4; -} - -// /sys/kernel/debug/tracing/events/timer/timer_expire_exit/format -message TimerExpireExitFormat { - uint64 timer = 1; -} - -// /sys/kernel/debug/tracing/events/timer/timer_init/format -message TimerInitFormat { - uint64 timer = 1; -} - -// /sys/kernel/debug/tracing/events/timer/timer_start/format -message TimerStartFormat { - uint64 timer = 1; - uint64 function = 2; - uint64 expires = 3; - uint64 now = 4; - uint32 flags = 5; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/trace_plugin_config.proto b/protos/types/plugins/ftrace_data/6.6.30/trace_plugin_config.proto deleted file mode 100644 index d1783463f..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/trace_plugin_config.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Huawei Technologies Co., Ltd. 2021-2023. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; -option optimize_for = LITE_RUNTIME; - -message TracePluginConfig { - repeated string ftrace_events = 1; // kernel event set - repeated string hitrace_categories = 2; // hitrace event set - repeated string hitrace_apps = 3; // hitrace app set - uint32 buffer_size_kb = 4; // kernel trace buffer size - uint32 flush_interval_ms = 5; // time interval in milliseconds to notify service process - uint32 flush_threshold_kb = 6; // buffer water mark threshold to notify service process - bool parse_ksyms = 7; // parse /proc/kallsyms or not - string clock = 8; // value for trace_clock - uint32 trace_period_ms = 10; // time interval in milliseconds to read kernel trace buffer - string raw_data_prefix = 13; // raw data file prefix for debug - uint32 trace_duration_ms = 20; // time duration in millisconds for trace actions - bool debug_on = 30; // enable debug options - bool discard_cache_data = 31; // if set true, session will stop immediately.(cache data will be lost) - uint32 hitrace_time = 32; - enum ParseMode { - NORMAL = 0; - DELAY_PARSE = 1; - RAW_DATA = 2; - }; - ParseMode parse_mode = 33; -} diff --git a/protos/types/plugins/ftrace_data/6.6.30/trace_plugin_result.proto b/protos/types/plugins/ftrace_data/6.6.30/trace_plugin_result.proto deleted file mode 100644 index 4aef49322..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/trace_plugin_result.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -import "ftrace_event.proto"; - -option optimize_for = LITE_RUNTIME; - -message TracePluginResult { - repeated FtraceCpuStatsMsg ftrace_cpu_stats = 1; - repeated FtraceCpuDetailMsg ftrace_cpu_detail = 2; - repeated SymbolsDetailMsg symbols_detail = 5; - repeated ClockDetailMsg clocks_detail = 6; -} - -message ClockDetailMsg { - // man clock_gettime - enum ClockId { - UNKNOW = 0; - BOOTTIME = 1; - REALTIME = 2; - REALTIME_COARSE = 3; - MONOTONIC = 4; - MONOTONIC_COARSE = 5; - MONOTONIC_RAW = 6; - } - ClockId id = 1; - message TimeSpec { - uint32 tv_sec = 1; - uint32 tv_nsec = 2; - }; - TimeSpec time = 2; - TimeSpec resolution = 3; -}; - -message SymbolsDetailMsg { - uint64 symbol_addr = 1; // symbol address - string symbol_name = 2; // symbol name -} - -message FtraceCpuStatsMsg { - enum Status { - TRACE_START = 0; - TRACE_END = 1; - } - - Status status = 1; - repeated PerCpuStatsMsg per_cpu_stats = 2; - string trace_clock = 3; -} - -// cat /sys/kernel/debug/tracing/per_cpu/cpu0/stats -message PerCpuStatsMsg { - uint64 cpu = 1; - uint64 entries = 2; - uint64 overrun = 3; - uint64 commit_overrun = 4; - uint64 bytes = 5; - double oldest_event_ts = 6; - double now_ts = 7; - uint64 dropped_events = 8; - uint64 read_events = 9; -} - -message FtraceCpuDetailMsg { - uint32 cpu = 1; - repeated FtraceEvent event = 2; - uint64 overwrite = 3; -} diff --git a/protos/types/plugins/ftrace_data/6.6.30/v4l2.proto b/protos/types/plugins/ftrace_data/6.6.30/v4l2.proto deleted file mode 100644 index 99d8555e1..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/v4l2.proto +++ /dev/null @@ -1,140 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: v4l2 -// /sys/kernel/debug/tracing/events/v4l2/v4l2_dqbuf/format -message V4l2DqbufFormat { - int32 minor = 1; - uint32 index = 2; - uint32 type = 3; - uint32 bytesused = 4; - uint32 flags = 5; - uint32 field = 6; - int64 timestamp = 7; - uint32 timecode_type = 8; - uint32 timecode_flags = 9; - uint32 timecode_frames = 10; - uint32 timecode_seconds = 11; - uint32 timecode_minutes = 12; - uint32 timecode_hours = 13; - uint32 timecode_userbits0 = 14; - uint32 timecode_userbits1 = 15; - uint32 timecode_userbits2 = 16; - uint32 timecode_userbits3 = 17; - uint32 sequence = 18; -} - -// /sys/kernel/debug/tracing/events/v4l2/v4l2_qbuf/format -message V4l2QbufFormat { - int32 minor = 1; - uint32 index = 2; - uint32 type = 3; - uint32 bytesused = 4; - uint32 flags = 5; - uint32 field = 6; - int64 timestamp = 7; - uint32 timecode_type = 8; - uint32 timecode_flags = 9; - uint32 timecode_frames = 10; - uint32 timecode_seconds = 11; - uint32 timecode_minutes = 12; - uint32 timecode_hours = 13; - uint32 timecode_userbits0 = 14; - uint32 timecode_userbits1 = 15; - uint32 timecode_userbits2 = 16; - uint32 timecode_userbits3 = 17; - uint32 sequence = 18; -} - -// /sys/kernel/debug/tracing/events/v4l2/vb2_v4l2_buf_done/format -message Vb2V4l2BufDoneFormat { - int32 minor = 1; - uint32 flags = 2; - uint32 field = 3; - uint64 timestamp = 4; - uint32 timecode_type = 5; - uint32 timecode_flags = 6; - uint32 timecode_frames = 7; - uint32 timecode_seconds = 8; - uint32 timecode_minutes = 9; - uint32 timecode_hours = 10; - uint32 timecode_userbits0 = 11; - uint32 timecode_userbits1 = 12; - uint32 timecode_userbits2 = 13; - uint32 timecode_userbits3 = 14; - uint32 sequence = 15; -} - -// /sys/kernel/debug/tracing/events/v4l2/vb2_v4l2_buf_queue/format -message Vb2V4l2BufQueueFormat { - int32 minor = 1; - uint32 flags = 2; - uint32 field = 3; - uint64 timestamp = 4; - uint32 timecode_type = 5; - uint32 timecode_flags = 6; - uint32 timecode_frames = 7; - uint32 timecode_seconds = 8; - uint32 timecode_minutes = 9; - uint32 timecode_hours = 10; - uint32 timecode_userbits0 = 11; - uint32 timecode_userbits1 = 12; - uint32 timecode_userbits2 = 13; - uint32 timecode_userbits3 = 14; - uint32 sequence = 15; -} - -// /sys/kernel/debug/tracing/events/v4l2/vb2_v4l2_dqbuf/format -message Vb2V4l2DqbufFormat { - int32 minor = 1; - uint32 flags = 2; - uint32 field = 3; - uint64 timestamp = 4; - uint32 timecode_type = 5; - uint32 timecode_flags = 6; - uint32 timecode_frames = 7; - uint32 timecode_seconds = 8; - uint32 timecode_minutes = 9; - uint32 timecode_hours = 10; - uint32 timecode_userbits0 = 11; - uint32 timecode_userbits1 = 12; - uint32 timecode_userbits2 = 13; - uint32 timecode_userbits3 = 14; - uint32 sequence = 15; -} - -// /sys/kernel/debug/tracing/events/v4l2/vb2_v4l2_qbuf/format -message Vb2V4l2QbufFormat { - int32 minor = 1; - uint32 flags = 2; - uint32 field = 3; - uint64 timestamp = 4; - uint32 timecode_type = 5; - uint32 timecode_flags = 6; - uint32 timecode_frames = 7; - uint32 timecode_seconds = 8; - uint32 timecode_minutes = 9; - uint32 timecode_hours = 10; - uint32 timecode_userbits0 = 11; - uint32 timecode_userbits1 = 12; - uint32 timecode_userbits2 = 13; - uint32 timecode_userbits3 = 14; - uint32 sequence = 15; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/vmscan.proto b/protos/types/plugins/ftrace_data/6.6.30/vmscan.proto deleted file mode 100644 index 0892db4da..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/vmscan.proto +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: vmscan -// /sys/kernel/debug/tracing/events/vmscan/mm_shrink_slab_end/format -message MmShrinkSlabEndFormat { - uint64 shr = 1; - int32 nid = 2; - uint64 shrink = 3; - uint64 unused_scan = 4; - uint64 new_scan = 5; - int32 retval = 6; - uint64 total_scan = 7; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_shrink_slab_start/format -message MmShrinkSlabStartFormat { - uint64 shr = 1; - uint64 shrink = 2; - int32 nid = 3; - uint64 nr_objects_to_shrink = 4; - uint64 gfp_flags = 5; - uint64 cache_items = 6; - uint64 delta = 7; - uint64 total_scan = 8; - int32 priority = 9; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_begin/format -message MmVmscanDirectReclaimBeginFormat { - int32 order = 1; - uint64 gfp_flags = 2; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_end/format -message MmVmscanDirectReclaimEndFormat { - uint64 nr_reclaimed = 1; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_kswapd_sleep/format -message MmVmscanKswapdSleepFormat { - int32 nid = 1; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_kswapd_wake/format -message MmVmscanKswapdWakeFormat { - int32 nid = 1; - int32 zid = 2; - int32 order = 3; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_lru_isolate/format -message MmVmscanLruIsolateFormat { - int32 highest_zoneidx = 1; - int32 order = 2; - uint64 nr_requested = 3; - uint64 nr_scanned = 4; - uint64 nr_skipped = 5; - uint64 nr_taken = 6; - uint32 isolate_mode = 7; - int32 lru = 8; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_lru_shrink_inactive/format -message MmVmscanLruShrinkInactiveFormat { - int32 nid = 1; - uint64 nr_scanned = 2; - uint64 nr_reclaimed = 3; - uint64 nr_dirty = 4; - uint64 nr_writeback = 5; - uint64 nr_congested = 6; - uint64 nr_immediate = 7; - uint32 nr_activate0 = 8; - uint32 nr_activate1 = 9; - uint64 nr_ref_keep = 10; - uint64 nr_unmap_fail = 11; - int32 priority = 12; - int32 reclaim_flags = 13; -} - -// /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_wakeup_kswapd/format -message MmVmscanWakeupKswapdFormat { - int32 nid = 1; - int32 zid = 2; - int32 order = 3; - uint64 gfp_flags = 4; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/workqueue.proto b/protos/types/plugins/ftrace_data/6.6.30/workqueue.proto deleted file mode 100644 index e41a5a542..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/workqueue.proto +++ /dev/null @@ -1,46 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: workqueue -// /sys/kernel/debug/tracing/events/workqueue/workqueue_activate_work/format -message WorkqueueActivateWorkFormat { - uint64 work = 1; -} - -// /sys/kernel/debug/tracing/events/workqueue/workqueue_execute_end/format -message WorkqueueExecuteEndFormat { - uint64 work = 1; - uint64 function = 2; -} - -// /sys/kernel/debug/tracing/events/workqueue/workqueue_execute_start/format -message WorkqueueExecuteStartFormat { - uint64 work = 1; - uint64 function = 2; -} - -// /sys/kernel/debug/tracing/events/workqueue/workqueue_queue_work/format -message WorkqueueQueueWorkFormat { - uint64 work = 1; - uint64 function = 2; - string workqueue = 3; - int32 req_cpu = 4; - int32 cpu = 5; -} - diff --git a/protos/types/plugins/ftrace_data/6.6.30/writeback.proto b/protos/types/plugins/ftrace_data/6.6.30/writeback.proto deleted file mode 100644 index 0d991a7d8..000000000 --- a/protos/types/plugins/ftrace_data/6.6.30/writeback.proto +++ /dev/null @@ -1,268 +0,0 @@ -// THIS FILE IS GENERATED BY ftrace_proto_generator.py, PLEASE DON'T EDIT IT! -// Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -option optimize_for = LITE_RUNTIME; - -// category: writeback -// /sys/kernel/debug/tracing/events/writeback/balance_dirty_pages/format -message BalanceDirtyPagesFormat { - string bdi = 1; - uint64 limit = 2; - uint64 setpoint = 3; - uint64 dirty = 4; - uint64 bdi_setpoint = 5; - uint64 bdi_dirty = 6; - uint64 dirty_ratelimit = 7; - uint64 task_ratelimit = 8; - uint32 dirtied = 9; - uint32 dirtied_pause = 10; - uint64 paused = 11; - uint64 pause = 12; - uint64 period = 13; - uint64 think = 14; - uint64 cgroup_ino = 15; -} - -// /sys/kernel/debug/tracing/events/writeback/bdi_dirty_ratelimit/format -message BdiDirtyRatelimitFormat { - string bdi = 1; - uint64 write_bw = 2; - uint64 avg_write_bw = 3; - uint64 dirty_rate = 4; - uint64 dirty_ratelimit = 5; - uint64 task_ratelimit = 6; - uint64 balanced_dirty_ratelimit = 7; - uint64 cgroup_ino = 8; -} - -// /sys/kernel/debug/tracing/events/writeback/global_dirty_state/format -message GlobalDirtyStateFormat { - uint64 nr_dirty = 1; - uint64 nr_writeback = 2; - uint64 background_thresh = 3; - uint64 dirty_thresh = 4; - uint64 dirty_limit = 5; - uint64 nr_dirtied = 6; - uint64 nr_written = 7; -} - -// /sys/kernel/debug/tracing/events/writeback/wbc_writepage/format -message WbcWritepageFormat { - string name = 1; - uint64 nr_to_write = 2; - uint64 pages_skipped = 3; - int32 sync_mode = 4; - int32 for_kupdate = 5; - int32 for_background = 6; - int32 for_reclaim = 7; - int32 range_cyclic = 8; - uint64 range_start = 9; - uint64 range_end = 10; - uint64 cgroup_ino = 11; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_bdi_register/format -message WritebackBdiRegisterFormat { - string name = 1; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_dirty_inode/format -message WritebackDirtyInodeFormat { - string name = 1; - uint64 ino = 2; - uint64 state = 3; - uint64 flags = 4; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_dirty_inode_enqueue/format -message WritebackDirtyInodeEnqueueFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 state = 3; - uint32 mode = 4; - uint64 dirtied_when = 5; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_dirty_inode_start/format -message WritebackDirtyInodeStartFormat { - string name = 1; - uint64 ino = 2; - uint64 state = 3; - uint64 flags = 4; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_exec/format -message WritebackExecFormat { - string name = 1; - uint64 nr_pages = 2; - uint64 sb_dev = 3; - int32 sync_mode = 4; - int32 for_kupdate = 5; - int32 range_cyclic = 6; - int32 for_background = 7; - int32 reason = 8; - uint64 cgroup_ino = 9; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_lazytime/format -message WritebackLazytimeFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 state = 3; - uint32 mode = 4; - uint64 dirtied_when = 5; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_lazytime_iput/format -message WritebackLazytimeIputFormat { - uint64 dev = 1; - uint64 ino = 2; - uint64 state = 3; - uint32 mode = 4; - uint64 dirtied_when = 5; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_mark_inode_dirty/format -message WritebackMarkInodeDirtyFormat { - string name = 1; - uint64 ino = 2; - uint64 state = 3; - uint64 flags = 4; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_pages_written/format -message WritebackPagesWrittenFormat { - uint64 pages = 1; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_queue/format -message WritebackQueueFormat { - string name = 1; - uint64 nr_pages = 2; - uint64 sb_dev = 3; - int32 sync_mode = 4; - int32 for_kupdate = 5; - int32 range_cyclic = 6; - int32 for_background = 7; - int32 reason = 8; - uint64 cgroup_ino = 9; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_queue_io/format -message WritebackQueueIoFormat { - string name = 1; - uint64 older = 2; - uint64 age = 3; - int32 moved = 4; - int32 reason = 5; - uint64 cgroup_ino = 6; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_sb_inodes_requeue/format -message WritebackSbInodesRequeueFormat { - string name = 1; - uint64 ino = 2; - uint64 state = 3; - uint64 dirtied_when = 4; - uint64 cgroup_ino = 5; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_single_inode/format -message WritebackSingleInodeFormat { - string name = 1; - uint64 ino = 2; - uint64 state = 3; - uint64 dirtied_when = 4; - uint64 writeback_index = 5; - uint64 nr_to_write = 6; - uint64 wrote = 7; - uint64 cgroup_ino = 8; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_single_inode_start/format -message WritebackSingleInodeStartFormat { - string name = 1; - uint64 ino = 2; - uint64 state = 3; - uint64 dirtied_when = 4; - uint64 writeback_index = 5; - uint64 nr_to_write = 6; - uint64 wrote = 7; - uint64 cgroup_ino = 8; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_start/format -message WritebackStartFormat { - string name = 1; - uint64 nr_pages = 2; - uint64 sb_dev = 3; - int32 sync_mode = 4; - int32 for_kupdate = 5; - int32 range_cyclic = 6; - int32 for_background = 7; - int32 reason = 8; - uint64 cgroup_ino = 9; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_wait/format -message WritebackWaitFormat { - string name = 1; - uint64 nr_pages = 2; - uint64 sb_dev = 3; - int32 sync_mode = 4; - int32 for_kupdate = 5; - int32 range_cyclic = 6; - int32 for_background = 7; - int32 reason = 8; - uint64 cgroup_ino = 9; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_wake_background/format -message WritebackWakeBackgroundFormat { - string name = 1; - uint64 cgroup_ino = 2; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_write_inode/format -message WritebackWriteInodeFormat { - string name = 1; - uint64 ino = 2; - int32 sync_mode = 3; - uint64 cgroup_ino = 4; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_write_inode_start/format -message WritebackWriteInodeStartFormat { - string name = 1; - uint64 ino = 2; - int32 sync_mode = 3; - uint64 cgroup_ino = 4; -} - -// /sys/kernel/debug/tracing/events/writeback/writeback_written/format -message WritebackWrittenFormat { - string name = 1; - uint64 nr_pages = 2; - uint64 sb_dev = 3; - int32 sync_mode = 4; - int32 for_kupdate = 5; - int32 range_cyclic = 6; - int32 for_background = 7; - int32 reason = 8; - uint64 cgroup_ino = 9; -} - -- Gitee