This Go program takes in a tracing JSON file, parses it and outputs a csv file for a playback utility //zircon/system/uapp/blk-playback/blk-playback.c which re-creates events that have previously occured on a block device.
A typical tracing data looks like this; {"cat":"sdmmc","name":"sdmmc_do_txn","ts":182697199.10074628,"pid":2759,"tid":3625,"ph":"b","id":683,"args":{"command":1,"extra":0,"length":16,"offset_vmo":0,"offset_dev":26137104,"pages":"0x0"}}
Here, “sdmmc” is the category, “sdmmc_do_txn” is the task name. It starts on 182697199.10074628 microsecond with pid 2759 and tid 3625.
A Go program that takes the following parameters in this order:
The output is a CSV file which contains information needed by the playback utility.
A CSV file with the following information is generated:
Example: category,name,start_time,end_time,duration,tid,length,offset_dev,command,offset_vmo sdmmc,sdmmc_do_txn,55833382.11069652,55833810.5920398,428.481343,3496,8192,4177922,417792