perf.data file format
This crate provides support for reading and writing files compatible with the
perf.data files generated by the Linux
perf tool.
Core types:
PerfDataFileReadersupports enumerating the headers and events from aperf.datafile. It exposes the data using types from the tracepoint_decode crate, making it easy to decode the resulting events and their fields.PerfDataFileWritersupports writing aperf.datafile containing caller-supplied headers and event data. It includes support for synthesizing some of the more commonly-used headers fromtracepoint_decodemetadata types, including theTRACING_DATAandEVENT_DESCheaders.
Examples:
- decode_perf: demonstrates using
PerfDataFileReaderalong with the types from the tracepoint_decode crate to decode aperf.datafile and write it as text to stdout. - decode_perf_to_json: expands on the
decode_perfsample and converts event data to JSON. - rewrite_perf: demonstrates using
PerfDataFileWriter, generating a newperf.datafile using content from an existingperf.datafile.