aboutsummaryrefslogtreecommitdiff
path: root/trappy/tracing_mark_write.py
blob: 49a23b07f034f5fd437c921295e92555fea0d95f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#    Copyright 2017 ARM Limited, Google and contributors
#
# 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.
#

"""This module contains the class for representing a tracing_mark_write
trace_event used for ftrace events injected from userspace.
"""

from trappy.base import Base
from trappy.dynamic import register_ftrace_parser

class TracingMarkWrite(Base):
    """Parse tracing_mark_write events that couldn't be matched with more specific unique words
       This class is always used as a fallback if nothing more specific could match the particular
       tracing_mark_write event.
    """

    unique_word = "tracing_mark_write"

    def generate_data_dict(self, data_str):
        if self.tracer:
            data_dict = self.tracer.generate_data_dict(data_str)
            if data_dict:
                return data_dict

        data_dict = { 'string': data_str }
        return data_dict

    def __init__(self):
        super(TracingMarkWrite, self).__init__(fallback=True)

register_ftrace_parser(TracingMarkWrite)