X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=bindings%2Fpython%2Fexamples%2Fsched_switch.py;h=83c191f813f7cd7c8b99e5cfd8751727548ba232;hb=7a30a66858f0835baaf65fdd94ad6c50a44b41d2;hp=7ae834bc1ec698249f4b80304009588264bd96c9;hpb=bb919dd077169b5ee049ba3fc82f8555648cb22e;p=babeltrace.git diff --git a/bindings/python/examples/sched_switch.py b/bindings/python/examples/sched_switch.py index 7ae834bc..83c191f8 100644 --- a/bindings/python/examples/sched_switch.py +++ b/bindings/python/examples/sched_switch.py @@ -1,18 +1,19 @@ +#!/usr/bin/env python3 # sched_switch.py -# +# # Babeltrace example script with sched_switch events -# +# # Copyright 2012 EfficiOS Inc. -# +# # Author: Danny Serres -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. @@ -56,7 +57,7 @@ while event is not None: break # Next event # Getting PID - pid_field = event.get_field(sco, "_pid") + pid_field = event.get_field_with_scope(sco, "_pid") pid = pid_field.get_int64() if ctf.field_error(): @@ -69,43 +70,43 @@ while event is not None: sco = event.get_top_level_scope(ctf.scope.EVENT_FIELDS) # prev_comm - field = event.get_field(sco, "_prev_comm") + field = event.get_field_with_scope(sco, "_prev_comm") prev_comm = field.get_char_array() if ctf.field_error(): print("ERROR: Missing prev_comm context info") # prev_tid - field = event.get_field(sco, "_prev_tid") + field = event.get_field_with_scope(sco, "_prev_tid") prev_tid = field.get_int64() if ctf.field_error(): print("ERROR: Missing prev_tid context info") # prev_prio - field = event.get_field(sco, "_prev_prio") + field = event.get_field_with_scope(sco, "_prev_prio") prev_prio = field.get_int64() if ctf.field_error(): print("ERROR: Missing prev_prio context info") # prev_state - field = event.get_field(sco, "_prev_state") + field = event.get_field_with_scope(sco, "_prev_state") prev_state = field.get_int64() if ctf.field_error(): print("ERROR: Missing prev_state context info") # next_comm - field = event.get_field(sco, "_next_comm") + field = event.get_field_with_scope(sco, "_next_comm") next_comm = field.get_char_array() if ctf.field_error(): print("ERROR: Missing next_comm context info") # next_tid - field = event.get_field(sco, "_next_tid") + field = event.get_field_with_scope(sco, "_next_tid") next_tid = field.get_int64() if ctf.field_error(): print("ERROR: Missing next_tid context info") # next_prio - field = event.get_field(sco, "_next_prio") + field = event.get_field_with_scope(sco, "_next_prio") next_prio = field.get_int64() if ctf.field_error(): print("ERROR: Missing next_prio context info")