1*288bf522SAndroid Build Coastguard WorkerThe code in this directory is used to process data from the mmc tracepoints 2*288bf522SAndroid Build Coastguard Workerin the kernel. To turn on mmc tracing, do this: 3*288bf522SAndroid Build Coastguard Worker 4*288bf522SAndroid Build Coastguard Worker adb shell echo 1 >/d/tracing/events/mmc/enable 5*288bf522SAndroid Build Coastguard Worker adb shell echo 1 >/d/tracing/tracing_on 6*288bf522SAndroid Build Coastguard Worker 7*288bf522SAndroid Build Coastguard WorkerTo get the trace: 8*288bf522SAndroid Build Coastguard Worker 9*288bf522SAndroid Build Coastguard Worker adb pull /d/tracing/trace 10*288bf522SAndroid Build Coastguard Worker 11*288bf522SAndroid Build Coastguard WorkerTo turn it back off, do: 12*288bf522SAndroid Build Coastguard Worker 13*288bf522SAndroid Build Coastguard Worker adb shell echo 0 >/d/tracing/tracing_enabled 14*288bf522SAndroid Build Coastguard Worker 15*288bf522SAndroid Build Coastguard WorkerThe output is in a form of start/stop pairs. The ops with rw in the name are 16*288bf522SAndroid Build Coastguard Workerread or write ops, and the ones with erase in the name are the various erase 17*288bf522SAndroid Build Coastguard Workeropts. 18*288bf522SAndroid Build Coastguard Worker 19*288bf522SAndroid Build Coastguard WorkerThe mmc_trace_reduce script will take the output from the kernel, and convert it 20*288bf522SAndroid Build Coastguard Workerto a single line per event, which includes the duration of the event. 21*288bf522SAndroid Build Coastguard Worker 22*288bf522SAndroid Build Coastguard WorkerThis can then be fed into other tools for further analysis. 23*288bf522SAndroid Build Coastguard Worker 24*288bf522SAndroid Build Coastguard WorkerThe file mmc_trace_sample_data contains sample mmc trace data from a Nexus 10. 25*288bf522SAndroid Build Coastguard WorkerIt includes read, write and discard entries. The discard entries came from 26*288bf522SAndroid Build Coastguard Workerinvoking fstrim in vold with "vdc fstrim dotrim". 27*288bf522SAndroid Build Coastguard Worker 28