JSON flow timestamp fix

Change-Id: I2dacc29250f2d9c5d56bf8ab3ca7f621cb7b663a
This commit is contained in:
Evgeny
2020-09-21 03:53:03 -04:00
parent a3fafe585d
commit a87d41c6e4
3 changed files with 61 additions and 46 deletions
+8 -8
View File
@@ -46,26 +46,26 @@ def gen_table_bins(db, table, outfile, name_var, dur_ns_var):
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;' % (start_us, table));
def gen_api_json_trace(db, table, start_ns, outfile):
db.execute('create view B as select "Index", Name as name, pid, tid, ((BeginNs - %d)/1000) as ts, (DurationNs/1000) as dur from %s;' % (start_ns, 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;' % (start_us, table));
def gen_ext_json_trace(db, table, start_ns, outfile):
db.execute('create view B as select Name as name, pid, tid, ((BeginNs - %d)/1000) as ts, ((EndNs - BeginNs)/1000) as dur from %s;' % (start_ns, 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;' % (base_pid, start_us, table));
def gen_ops_json_trace(db, table, base_pid, start_ns, outfile):
db.execute('create view B as select "Index", Name as name, ("dev-id" + %d) as pid, tid, ((BeginNs - %d)/1000) as ts, (DurationNs/1000) as dur from %s;' % (base_pid, start_ns, 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;' % (base_pid, start_us, table));
def gen_kernel_json_trace(db, table, base_pid, start_ns, outfile):
db.execute('create view B as select "Index", KernelName as name, ("gpu-id" + %d) as pid, (0) as tid, ((BeginNs - %d)/1000) as ts, (DurationNs/1000) as dur from %s;' % (base_pid, start_ns, table));
db.dump_json('B', table, outfile)
db.execute('DROP VIEW B')
gen_message(outfile)