populate attributes when re-writing perf data
JoinCallChains, PostUnwindRecords, and MergeMapRecords all flush the
current data to file and start a new data file using MoveRecordFile.
Normally, creating the file fills in the attributes from the event
selection set. However, DoRecording recently added CloseEventFiles
calls which clear the event_fds which are used to populate the attrs.
This change fixes the issue by copying the attrs from the old file.
Test: ran simpleperf on device
$ adb shell
$ cd /data/local/tmp
$ simpleperf record -a --exclude-perf --duration 2 -g \
-e power:sugov_next_freq -e power:sugov_util_update
$ simpleperf report
Before the fix, all samples would be attributed to the first event type.
With this fix, the samples are correctly attributed.
Bug: 231357972
Change-Id: Id077e3c6f6c4460df595fad04c355717985a914e
1 file changed