diff options
Diffstat (limited to 'tracecmd.py')
-rw-r--r-- | tracecmd.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tracecmd.py b/tracecmd.py index b14a3b9..ad80ccd 100644 --- a/tracecmd.py +++ b/tracecmd.py | |||
@@ -110,6 +110,11 @@ class Event(object): | |||
110 | return None | 110 | return None |
111 | return val | 111 | return val |
112 | 112 | ||
113 | def str_field(self, name): | ||
114 | f = pevent_find_any_field(self._format, name) | ||
115 | if f is None: | ||
116 | return None | ||
117 | return py_field_get_str(f, self._record) | ||
113 | 118 | ||
114 | class TraceSeq(object): | 119 | class TraceSeq(object): |
115 | def __init__(self, trace_seq): | 120 | def __init__(self, trace_seq): |
@@ -138,6 +143,9 @@ class Field(object): | |||
138 | return val | 143 | return val |
139 | __int__ = __long__ | 144 | __int__ = __long__ |
140 | 145 | ||
146 | def __str__(self): | ||
147 | return py_field_get_str(self._field, self._record) | ||
148 | |||
141 | class PEvent(object): | 149 | class PEvent(object): |
142 | def __init__(self, pevent): | 150 | def __init__(self, pevent): |
143 | self._pevent = pevent | 151 | self._pevent = pevent |