enable rocprofiler kernels trace; fixing signal value for proxy signal; fixing scope options in input txt format;
Change-Id: Ife63c4091e565a2158e292c7acf9718085c709be
This commit is contained in:
1 parent
00ca6d8a78
commit
d8560ae0b3
6 files changed
+57
-46
No files matched your search
+15
-5
@@ -1,13 +1,18 @@
|
||||
#!/usr/bin/python
|
||||
from sqlitedb import SQLiteDB
|
||||
|
||||
def post_process_data(db, table_name, outfile = ''):
|
||||
def gen_message(outfile):
|
||||
if outfile != '':
|
||||
print("File '" + outfile + "' is generating")
|
||||
|
||||
def post_process_data(db, table_name, outfile = ''):
|
||||
# db.add_data_column('A', 'DispDurNs', 'INTEGER', 'BeginNs - DispatchNs')
|
||||
# db.add_data_column('A', 'ComplDurNs', 'INTEGER', 'CompleteNs - EndNs')
|
||||
# db.add_data_column('A', 'TotalDurNs', 'INTEGER', 'CompleteNs - DispatchNs')
|
||||
# db.add_data_column(table_name, 'TimeNs', 'INTEGER', 'BeginNs - %d' % start_ns)
|
||||
db.add_data_column(table_name, 'DurationNs', 'INTEGER', 'EndNs - BeginNs')
|
||||
if outfile != '': db.dump_csv(table_name, outfile)
|
||||
gen_message(outfile)
|
||||
|
||||
def gen_data_bins(db, outfile):
|
||||
db.execute('create view C as select Name, Calls, TotalDurationNs, TotalDurationNs/Calls as AverageNs, TotalDurationNs*100.0/(select sum(TotalDurationNs) from %s) as Percentage from %s order by TotalDurationNs desc;' % ('B', 'B'));
|
||||
@@ -18,24 +23,29 @@ def gen_table_bins(db, table, outfile, name_var, dur_ns_var):
|
||||
db.execute('create view B as select (%s) as Name, count(%s) as Calls, sum(%s) as TotalDurationNs from %s group by %s' % (name_var, name_var, dur_ns_var, table, name_var))
|
||||
gen_data_bins(db, outfile)
|
||||
db.execute('DROP VIEW B')
|
||||
gen_message(outfile)
|
||||
|
||||
def gen_api_json_trace(db, table, start_us, outfile):
|
||||
db.execute('create view B as select "Index", Name as name, pid, tid, (BeginNs/1000 - %d) as ts, (DurationNs/1000) as dur from %s order by ts asc;' % (start_us, table));
|
||||
db.execute('create view B as select "Index", Name as name, pid, tid, (BeginNs/1000 - %d) as ts, (DurationNs/1000) as dur from %s;' % (start_us, table));
|
||||
db.dump_json('B', table, outfile)
|
||||
db.execute('DROP VIEW B')
|
||||
gen_message(outfile)
|
||||
|
||||
def gen_ext_json_trace(db, table, start_us, outfile):
|
||||
db.execute('create view B as select Name as name, pid, tid, (BeginNs/1000 - %d) as ts, ((EndNs - BeginNs)/1000) as dur from %s order by ts asc;' % (start_us, table));
|
||||
db.execute('create view B as select Name as name, pid, tid, (BeginNs/1000 - %d) as ts, ((EndNs - BeginNs)/1000) as dur from %s;' % (start_us, table));
|
||||
db.dump_json('B', table, outfile)
|
||||
db.execute('DROP VIEW B')
|
||||
gen_message(outfile)
|
||||
|
||||
def gen_ops_json_trace(db, table, base_pid, start_us, outfile):
|
||||
db.execute('create view B as select "Index", Name as name, ("dev-id" + %d) as pid, tid, (BeginNs/1000 - %d) as ts, (DurationNs/1000) as dur from %s order by ts asc;' % (base_pid, start_us, table));
|
||||
db.execute('create view B as select "Index", Name as name, ("dev-id" + %d) as pid, tid, (BeginNs/1000 - %d) as ts, (DurationNs/1000) as dur from %s;' % (base_pid, start_us, table));
|
||||
db.dump_json('B', table, outfile)
|
||||
db.execute('DROP VIEW B')
|
||||
gen_message(outfile)
|
||||
|
||||
def gen_kernel_json_trace(db, table, base_pid, start_us, outfile):
|
||||
db.execute('create view B as select "Index", KernelName as name, ("gpu-id" + %d) as pid, (0) as tid, (BeginNs/1000 - %d) as ts, (DurationNs/1000) as dur from %s order by ts asc;' % (base_pid, start_us, table));
|
||||
db.execute('create view B as select "Index", KernelName as name, ("gpu-id" + %d) as pid, (0) as tid, (BeginNs/1000 - %d) as ts, (DurationNs/1000) as dur from %s;' % (base_pid, start_us, table));
|
||||
db.dump_json('B', table, outfile)
|
||||
db.execute('DROP VIEW B')
|
||||
gen_message(outfile)
|
||||
##############################################################################################
|
||||
Reference in new issue
Block a user