diff options
author | Xin Li <delphij@google.com> | 2018-08-06 16:50:46 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2018-08-06 16:50:46 -0700 |
commit | da847891e1c9cd36d37a1f975e3b4b847d9c8d40 (patch) | |
tree | 2ee6dc8fe789340553a66e15d20aa4d7b8dee2a8 /trappy/filesystem.py | |
parent | 31ccc081929e27f780a87a94deb20e4333c6b323 (diff) | |
parent | beecbc049b8ea9340930186d6936cd63557646a3 (diff) | |
download | trappy-da847891e1c9cd36d37a1f975e3b4b847d9c8d40.tar.gz |
Merge Android Pie into masterandroid-o-mr1-iot-release-smart-display-r3android-o-mr1-iot-release-1.0.5android-o-mr1-iot-release-1.0.4android-o-mr1-iot-release-1.0.3oreo-mr1-1.2-iot-releasemaster-cuttlefish-testing-release
Bug: 112104996
Change-Id: Icb7cf76bc97e423a4cff040b8a2800c679e6cb51
Diffstat (limited to 'trappy/filesystem.py')
-rw-r--r-- | trappy/filesystem.py | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/trappy/filesystem.py b/trappy/filesystem.py new file mode 100644 index 0000000..0c4a57d --- /dev/null +++ b/trappy/filesystem.py @@ -0,0 +1,67 @@ +# Copyright 2017 Google, ARM Limited +# +# 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. +# + + +""" +Definitions of filesystem (ext4) trace parsers +registered by the FTrace class +""" + +from trappy.base import Base +from trappy.dynamic import register_ftrace_parser, register_dynamic_ftrace + +class FilesystemExt4Base(Base): + def generate_data_dict(self, data_str): + #filesystem traces are space delimited in the form: + #fieldA valueA fieldB valueB ... + data = data_str.split(' ') + return zip(data[0::2], data[1::2]) + + def finalize_object(self): + self.data_frame.rename(columns={'ino':'inode'}, inplace=True) + + +class FilesystemExt4DaWriteBegin(FilesystemExt4Base): + """Corresponds to Linux kernel trace event ext4_da_write_begin""" + + unique_word = "ext4_da_write_begin:" + """The unique word that will be matched in a trace line""" + + +register_ftrace_parser(FilesystemExt4DaWriteBegin) + +class FilesystemExt4DaWriteEnd(FilesystemExt4Base): + """Corresponds to Linux kernel trace event ext4_da_write_end""" + + unique_word = "ext4_da_write_end:" + """The unique word that will be matched in a trace line""" + +register_ftrace_parser(FilesystemExt4DaWriteEnd) + +class FilesystemExt4SyncFileEnter(FilesystemExt4Base): + """Corresponds to Linux kernel trace event ext4_sync_file_enter""" + + unique_word = "ext4_sync_file_enter:" + """The unique word that will be matched in a trace line""" + +register_ftrace_parser(FilesystemExt4SyncFileEnter) + +class FilesystemExt4SyncFileExit(FilesystemExt4Base): + """Corresponds to Linux kernel trace event ext4_sync_file_exit""" + + unique_word = "ext4_sync_file_exit:" + """The unique word that will be matched in a trace line""" + +register_ftrace_parser(FilesystemExt4SyncFileExit) |