Skip to content
Snippets Groups Projects
Commit 1be03462 authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Reordering and some cleanup

parent edc46b48
Branches
No related tags found
No related merge requests found
...@@ -141,7 +141,6 @@ def stop_event(evt): ...@@ -141,7 +141,6 @@ def stop_event(evt):
global file_index_current global file_index_current
global file_list global file_list
cyccnt = gdb_cyccnt_read()
file_name = file_list[file_index_current].split('/')[-1] file_name = file_list[file_index_current].split('/')[-1]
""" """
Get the current ceiling level, cast it to an integer Get the current ceiling level, cast it to an integer
...@@ -155,7 +154,7 @@ def stop_event(evt): ...@@ -155,7 +154,7 @@ def stop_event(evt):
If there is no ceiling, it means we have returned to main If there is no ceiling, it means we have returned to main
since every claim have ceiling since every claim have ceiling
""" """
# gdb.events.stop.disconnect(stop_event) cyccnt = gdb_cyccnt_read()
outputdata.append([file_name, task_name, cyccnt, 0, "Finish"]) outputdata.append([file_name, task_name, cyccnt, 0, "Finish"])
gdb_cyccnt_reset() gdb_cyccnt_reset()
...@@ -166,13 +165,12 @@ def stop_event(evt): ...@@ -166,13 +165,12 @@ def stop_event(evt):
print("\nFinished all ktest files!\n") print("\nFinished all ktest files!\n")
print("Claims:") print("Claims:")
for index, obj in enumerate(outputdata): for index, obj in enumerate(outputdata):
if obj[4] == 'Exit': if obj[4] == "Exit":
claim_time = (obj[2] - claim_time = (obj[2] -
outputdata[index - (offset)][2]) outputdata[index - (offset)][2])
# print("Claim time: %s" % claim_time)
print("%s Claim time: %s" % (obj, claim_time)) print("%s Claim time: %s" % (obj, claim_time))
offset += 2 offset += 2
elif obj[4] == 'Finish' and not obj[2] == 0: elif obj[4] == "Finish" and not obj[2] == 0:
offset = 1 offset = 1
tot_time = obj[2] tot_time = obj[2]
print("%s Total time: %s" % (obj, tot_time)) print("%s Total time: %s" % (obj, tot_time))
...@@ -183,8 +181,6 @@ def stop_event(evt): ...@@ -183,8 +181,6 @@ def stop_event(evt):
return return
print("CYCCNT: %s\nCeiling: %s" % (cyccnt, outputdata[-1][3]))
""" """
If outputdata is empty, we start If outputdata is empty, we start
If the same ceiling as previously: exit If the same ceiling as previously: exit
...@@ -197,12 +193,10 @@ def stop_event(evt): ...@@ -197,12 +193,10 @@ def stop_event(evt):
else: else:
action = "Enter" action = "Enter"
cyccnt = gdb_cyccnt_read()
outputdata.append([file_name, task_name, cyccnt, ceiling, action]) outputdata.append([file_name, task_name, cyccnt, ceiling, action])
""" print("CYCCNT: %s\nCeiling: %s" % (cyccnt, outputdata[-1][3]))
Prepare a prompt for do_continue()
"""
gdb.prompt_hook = prompt
do_continue() do_continue()
...@@ -235,6 +229,7 @@ def posted_event_init(): ...@@ -235,6 +229,7 @@ def posted_event_init():
# print("Entering posted_event_init") # print("Entering posted_event_init")
global init_done
global tasks global tasks
global task_to_test global task_to_test
global task_name global task_name
...@@ -245,6 +240,16 @@ def posted_event_init(): ...@@ -245,6 +240,16 @@ def posted_event_init():
""" Load the variable data """ """ Load the variable data """
ktest_setdata(file_index_current) ktest_setdata(file_index_current)
"""
If the number of the task is greater than the available tasks just finish
"""
if task_to_test > len(tasks):
print("Nothing to call...")
init_done = 0
file_index_current += 1
gdb.post_event(posted_event_init)
return
""" """
Prepare the cycle counter Prepare the cycle counter
""" """
...@@ -253,15 +258,9 @@ def posted_event_init(): ...@@ -253,15 +258,9 @@ def posted_event_init():
# print("Tasks: ", tasks) # print("Tasks: ", tasks)
# print("Name of task to test:", tasks[task_to_test]) # print("Name of task to test:", tasks[task_to_test])
if task_to_test > len(tasks):
print("Nothing to call...")
do_continue()
return
if not task_to_test == -1: if not task_to_test == -1:
task_name = tasks[task_to_test]
file_name = file_list[file_index_current].split('/')[-1] file_name = file_list[file_index_current].split('/')[-1]
task_name = tasks[task_to_test]
outputdata.append([file_name, task_name, 0, 0, "Start"]) outputdata.append([file_name, task_name, 0, 0, "Start"])
gdb.write('Task to call: %s \n' % ( gdb.write('Task to call: %s \n' % (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment