diff --git a/Makefile b/Makefile index db988736bc320e255498974bbc74b01dcfac4613..7e5433de303ed81c2bda6419e8cbe852526f8914 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ DEFS = -DSTM32F40XX -DHSE_VALUE=8000000 -DTRACE -DOS_USE_TRACE_ITM else ifeq "$(MAKECMDGOALS)" "wcet" DEFS = -DSTM32F40XX -DHSE_VALUE=8000000 -DTRACE -DOS_USE_TRACE_ITM -DKLEE_WCET else -DEFS = -DSTM32F40XX -DHSE_VALUE=8000000 -DKLEE +DEFS = -DSTM32F40XX -DHSE_VALUE=8000000 -DKLEE endif # Definitions diff --git a/klee_stm_gdb.py b/klee_stm_gdb.py index 9d48346dc7c7ce7a0135daa519a7bca344762c29..f6ab1c52fd10cc7a74daad53f9ecd3a3bcdb822d 100644 --- a/klee_stm_gdb.py +++ b/klee_stm_gdb.py @@ -14,7 +14,7 @@ file_index_current = 0 object_index_current = 0 """ Max number of events guard """ -object_index_max = 10 +object_index_max = 100 database_name = "klee_profiling" @@ -33,7 +33,8 @@ cur.execute('''CREATE TABLE IF NOT EXISTS events FILE TEXT NOT NULL, TIME INT NOT NULL, RESOURCE TEXT NOT NULL, - ACTION TEXT);''') + ACTION TEXT + JOB TEXT);''') class KTestError(Exception): @@ -178,6 +179,10 @@ def posted_event_finish_execution(): str(object_index_current) + "].action") + """ Parse which running job is active """ + + event_job = gdb.parse_and_eval("job") + """ print("file: %r " % str(file_list[file_index_current])) print("time: %r " % int(event_time)) @@ -191,14 +196,15 @@ def posted_event_finish_execution(): event.append(int(event_time)) event.append(str(event_resource)) event.append(str(event_action)) + event.append("j" + str(event_job)) print("Event: %r " % event) try: cur = conn.cursor() - cur.execute('INSERT INTO events(FILE, TIME, RESOURCE, ACTION)\ - VALUES (?,?,?,?)', event) + cur.execute('INSERT INTO events(FILE, TIME, RESOURCE, ACTION, JOB)\ + VALUES (?,?,?,?,?)', event) except sqlite3.Error as e: print("An error occurred:", e.args[0]) @@ -280,6 +286,7 @@ def ktest_iterate(): # AddBreakpoint("main") MainBP("main") + """ Tell gdb-dashboard to hide """ gdb.execute("dashboard -enabled off") gdb.execute("dashboard -output /dev/null") @@ -287,7 +294,7 @@ gdb.execute("dashboard -output /dev/null") """ Also break at the main-loop """ # AddBreakpoint("finish_execution") MainBP("finish_execution") -MainBP("terminate_execution") +# MainBP("terminate_execution") """Used for making it scriptable""" gdb.execute("set confirm off") diff --git a/profiling_db_parser.py b/profiling_db_parser.py index eac5dc971b3e2c39b77ee5ba8168eda52ed01604..ee91f1b5ed9829ed271272272930852edb82da7d 100644 --- a/profiling_db_parser.py +++ b/profiling_db_parser.py @@ -145,6 +145,11 @@ def print_db_ktest(): (filename,)) resources = c.fetchall() + c.execute('SELECT DISTINCT job FROM events WHERE (file=?)', + (filename,)) + job = c.fetchall() + print("Job: j%s" % job) + """ Go through the unique list of resources If they are called multiple times this is handled later