trace-cmd: make python work again
PATCH v2 1/1 trace-cmd: make python work again
From: Johannes Berg <[email protected]>
Code reshuffling/renaming wasn't complete in ctracecmd.i:
* it needs to %include "trace-seq.h" so that we can access those functions from python
* it needs to use tep_* instead of pevent_* everywhere, even function calls done as parameters to functions, I guess some sort of automatic conversion missed those
--- python/ctracecmd.i | 1 + python/event-viewer.py | 4 ++-- python/tracecmd.py | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-)
python/ctracecmd.i +1 -0
@@ -239,4 +239,5 @@ static int python_callback(struct trace_seq *s, #define __thread %include "trace-cmd.h" +%include "trace-seq.h" %include "event-parse.h"
python/event-viewer.py +2 -2
@@ -68,8 +68,8 @@ class EventStore(gtk.GenericTreeModel): for cpu in range(0, trace.cpus): rec = tracecmd_read_data(self.trace._handle, cpu) while rec: - offset = pevent_record_offset_get(rec) - ts = pevent_record_ts_get(rec) + offset = tep_record_offset_get(rec) + ts = tep_record_ts_get(rec) self.refs.append(self.EventRef(index, ts, offset, cpu)) index = index + 1 rec = tracecmd_read_data(self.trace._handle, cpu)
python/tracecmd.py +4 -4
@@ -84,7 +84,7 @@ class Event(object, DictMixin): @cached_property def cpu(self): - return pevent_record_cpu_get(self._record) + return tep_record_cpu_get(self._record) @cached_property def name(self):
@@ -96,7 +96,7 @@ class Event(object, DictMixin): @cached_property def ts(self): - return pevent_record_ts_get(self._record) + return tep_record_ts_get(self._record) @cached_property def type(self):
@@ -106,7 +106,7 @@ class Event(object, DictMixin): f = tep_find_any_field(self._format, name) if f is None: return None - ret, val = tep_read_number_field(f, pevent_record_data_get(self._record)) + ret, val = tep_read_number_field(f, tep_record_data_get(self._record)) if ret: return None return val
@@ -142,7 +142,7 @@ class Field(object): def __long__(self): ret, val = tep_read_number_field(self._field, - pevent_record_data_get(self._record)) + tep_record_data_get(self._record)) if ret: raise FieldError("Not a number field") return val
Signature · 1 line
2.17.2
Steven Rostedt
AppliedQuoted 11 lines · On Wed, 23 Jan 2019 14:26:27 +0100 Johannes Berg <[email protected]>…
From: Johannes Berg <[email protected]>
Code reshuffling/renaming wasn't complete in ctracecmd.i:
* it needs to %include "trace-seq.h" so that we can access those functions from python
* it needs to use tep_* instead of pevent_* everywhere, even function calls done as parameters to functions, I guess some sort of automatic conversion missed thoseSigned-off-by Johannes Berg <[email protected]>
Applied.
Thanks Johannes!
-- Steve