The python bindings stopped working after some changes to trace-cmd. This series addresses the bindings and python object member naming issues. With these changes, event-viewer.py and the tracecmd.py self-tests work again. -- Darren --
The handle member object was changed to _handle, correct the usage
in event-viewer.py.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Tom Zanussi <tom.zanussi@intel.com>
---
event-viewer.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/event-viewer.py b/event-viewer.py
index 6f35642..28afca2 100755
--- a/event-viewer.py
+++ b/event-viewer.py
@@ -66,13 +66,13 @@ class EventStore(gtk.GenericTreeModel):
print "Building trace index..."
index = 0
for cpu in range(0, trace.cpus):
- rec = tracecmd_read_data(self.trace.handle, cpu)
+ rec = tracecmd_read_data(self.trace._handle, cpu)
while rec:
offset = record_offset_get(rec)
ts = record_ts_get(rec)
self.refs.append(self.EventRef(index, ts, offset, cpu))
index = index + 1
- rec = tracecmd_read_data(self.trace.handle, cpu)
+ rec = tracecmd_read_data(self.trace._handle, cpu)
print "Loaded %d events from trace" % (index)
@timing
--
1.7.1
--
Make tracecmd_(get|put)_tracing_file available to shared objects, such
the python ctracecmd.so module generated by the SWIG mechanism.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Tom Zanussi <tom.zanussi@intel.com>
---
trace-cmd.c | 111 +++++++++++++++++++--------------------------------------
trace-util.c | 24 ++++++++++++
2 files changed, 61 insertions(+), 74 deletions(-)
diff --git a/trace-cmd.c b/trace-cmd.c
index f8992a8..293bb98 100644
--- a/trace-cmd.c
+++ b/trace-cmd.c
@@ -55,19 +55,6 @@
int silence_warnings;
int show_status;
-static char *get_tracing_file(const char *name);
-static void put_tracing_file(char *file);
-
-char *tracecmd_get_tracing_file(const char *name)
-{
- return get_tracing_file(name);
-}
-
-void tracecmd_put_tracing_file(char *name)
-{
- put_tracing_file(name);
-}
-
static int tracing_on_init_val;
static int rt_prio;
@@ -305,11 +292,11 @@ static void clear_trace(void)
char *path;
/* reset the trace */
- path = get_tracing_file("trace");
+ path = tracecmd_get_tracing_file("trace");
fp = fopen(path, "w");
if (!fp)
die("writing to '%s'", path);
- put_tracing_file(path);
+ tracecmd_put_tracing_file(path);
fwrite("0", 1, 1, fp);
fclose(fp);
}
@@ -320,11 +307,11 @@ static void reset_max_latency(void)
char *path;
/* reset the trace */
- path = get_tracing_file("tracing_max_latency");
+ path = tracecmd_get_tracing_file("tracing_max_latency");
fp = fopen(path, "w");
if (!fp)
die("writing to '%s'", path);
- put_tracing_file(path);
+ tracecmd_put_tracing_file(path);
fwrite("0", 1, 1, fp);
fclose(fp);
}
@@ -335,7 +322,7 @@ static void update_ftrace_pid(const char *pid)
int ret;
int fd;
- path = get_tracing_file("set_ftrace_pid");
+ path = tracecmd_get_tracing_file("set_ftrace_pid");
if (!path)
return;
@@ -399,30 +386,6 @@ void run_cmd(int argc, char **argv)
waitpid(pid, &status, 0);
}
-static char ...Make the usage function available to shared objects, such as the python ctracecmd.so module built by the SWIG mechanism. Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Steven Rostedt <rostedt@goodmis.org> CC: Tom Zanussi <tom.zanussi@intel.com> --- Makefile | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 41f0d43..74f2c44 100644 --- a/Makefile +++ b/Makefile @@ -261,8 +261,7 @@ $(obj)/%.o: $(src)/%.c TRACE_GUI_OBJS = trace-filter.o trace-compat.o trace-hash.o trace-dialog.o \ trace-xml.o -TRACE_CMD_OBJS = trace-cmd.o trace-usage.o trace-read.o trace-split.o trace-listen.o \ - trace-stack.o +TRACE_CMD_OBJS = trace-cmd.o trace-read.o trace-split.o trace-listen.o trace-stack.o TRACE_VIEW_OBJS = trace-view.o trace-view-store.o TRACE_GRAPH_OBJS = trace-graph.o trace-plot.o trace-plot-cpu.o trace-plot-task.o TRACE_VIEW_MAIN_OBJS = trace-view-main.o $(TRACE_VIEW_OBJS) $(TRACE_GUI_OBJS) @@ -272,7 +271,7 @@ KERNEL_SHARK_OBJS = $(TRACE_VIEW_OBJS) $(TRACE_GRAPH_OBJS) $(TRACE_GUI_OBJS) \ PEVENT_LIB_OBJS = parse-events.o trace-seq.o parse-filter.o parse-utils.o TCMD_LIB_OBJS = $(PEVENT_LIB_OBJS) trace-util.o trace-input.o trace-ftrace.o \ - trace-output.o trace-record.o trace-restore.o + trace-output.o trace-record.o trace-restore.o trace-usage.o PLUGIN_OBJS = plugin_hrtimer.o plugin_kmem.o plugin_sched_switch.o \ plugin_mac80211.o plugin_jbd2.o plugin_function.o plugin_kvm.o -- 1.7.1 --
