Skip to contentSkip to conversation

trace-cmd: make python work again

PATCH Superseded Johannes Berg 1 participant 1 message Jan 19, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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/tracecmd.py | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
python/ctracecmd.i +1 -0
index b18cba9b3b5f..55fd8755c237 100644
@@ -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/tracecmd.py +2 -2
index f551a1489e25..a3816dfdb788 100644
@@ -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