projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a generic get_value() implementation
[babeltrace.git]
/
bindings
/
python
/
examples
/
example-api-test.py
diff --git
a/bindings/python/examples/example-api-test.py
b/bindings/python/examples/example-api-test.py
index 66754ba6912cc999b57e7783136223358a8b10fd..d6b48ffda79e6119bbd13900ce3ba2ca4e549d18 100644
(file)
--- a/
bindings/python/examples/example-api-test.py
+++ b/
bindings/python/examples/example-api-test.py
@@
-54,16
+54,18
@@
while(event is not None):
if prev_field is None:
print("ERROR: Missing prev_comm context info")
else:
if prev_field is None:
print("ERROR: Missing prev_comm context info")
else:
- prev_comm = prev_field[0].get_char_array()
- print("sched_switch prev_comm: {}".format(prev_comm))
+ prev_comm = prev_field[0].get_value()
+ if prev_comm is not None:
+ print("sched_switch prev_comm: {}".format(prev_comm))
if event.get_name() == "exit_syscall":
ret_field = event.get_field("ret")
if ret_field is None:
print("ERROR: Unable to extract ret")
else:
if event.get_name() == "exit_syscall":
ret_field = event.get_field("ret")
if ret_field is None:
print("ERROR: Unable to extract ret")
else:
- ret_code = ret_field[0].get_int64()
- print("exit_syscall ret: {}".format(ret_code))
+ ret_code = ret_field[0].get_value()
+ if ret_code is not None:
+ print("exit_syscall ret: {}".format(ret_code))
ret = ctf_it.next()
if ret < 0:
ret = ctf_it.next()
if ret < 0:
This page took
0.023261 seconds
and
4
git commands to generate.