From patchwork Wed Jan 23 13:26:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 10777205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9CB991E for ; Wed, 23 Jan 2019 13:26:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9B9F2869A for ; Wed, 23 Jan 2019 13:26:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDBF428987; Wed, 23 Jan 2019 13:26:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E8E92869A for ; Wed, 23 Jan 2019 13:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726029AbfAWN0d (ORCPT ); Wed, 23 Jan 2019 08:26:33 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:59856 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbfAWN0d (ORCPT ); Wed, 23 Jan 2019 08:26:33 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92-RC4) (envelope-from ) id 1gmIY3-0002BE-1D; Wed, 23 Jan 2019 14:26:31 +0100 From: Johannes Berg To: linux-trace-devel@vger.kernel.org Cc: Steven Rostedt , Johannes Berg Subject: [PATCH v2] trace-cmd: make python work again Date: Wed, 23 Jan 2019 14:26:27 +0100 Message-Id: <20190123132627.7619-1-johannes@sipsolutions.net> X-Mailer: git-send-email 2.17.2 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Berg 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 --- 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