From: Johannes Berg <johannes@sipsolutions.net>
To: linux-trace-devel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH v2] trace-cmd: make python work again
Date: Wed, 23 Jan 2019 14:26:27 +0100 [thread overview]
Message-ID: <20190123132627.7619-1-johannes@sipsolutions.net> (raw)
From: Johannes Berg <johannes.berg@intel.com>
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
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
python/ctracecmd.i | 1 +
python/event-viewer.py | 4 ++--
python/tracecmd.py | 8 ++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/python/ctracecmd.i b/python/ctracecmd.i
index b18cba9b3b5f..55fd8755c237 100644
--- a/python/ctracecmd.i
+++ b/python/ctracecmd.i
@@ -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"
diff --git a/python/event-viewer.py b/python/event-viewer.py
index 3a082b81fc3d..c7c50d16df14 100755
--- a/python/event-viewer.py
+++ b/python/event-viewer.py
@@ -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)
diff --git a/python/tracecmd.py b/python/tracecmd.py
index f551a1489e25..f4f241e22580 100644
--- a/python/tracecmd.py
+++ b/python/tracecmd.py
@@ -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
--
2.17.2
next reply other threads:[~2019-01-23 13:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 13:26 Johannes Berg [this message]
2019-01-24 0:27 ` [PATCH v2] trace-cmd: make python work again Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190123132627.7619-1-johannes@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=johannes.berg@intel.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.