-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
branch stack reader needs updating for new information #151
Comments
Another problem with the branch stack reader: in PerfParser::MapBranchStack, if any of the branch stack entries has an unmappable address, the function immediately returns false. The caller, MapSampleEvent, then doesn't increment num_sample_events_mapped. At the end of the parse, if fewer than 95% of samples are mapped, the parse fails. Statistically, even if only 1% of branch entries were unmapped, this would cause around 30% of sample records to have at least one unmapped branch and the entire parse would fail. If we're using this kind of threshold the best way might be to count each branch stack entry as a sample, and have MapBranchStack return the number of successfully mapped branch entries. But it's worse than that. It may be that each sample record will contain at least one unmappable branch. E.g. for Arm BRBE we see each stack start with an IRQ entry:
to_ip is zero so this causes the whole branch stack to fail. And because every sample is like this, the entire parse fails. Either the reader should apply the 95% threshold to individual entries as suggested above, or test the type/new_type fields (see above) to see if the entry indicates an interrupt or abort, or (simplest) assume that a zero target address indicates an interrupt or abort. |
Hi Algr, we have not seen "warns about reserved bits being non-zero", I guess the arm perf raw have some data disparate from X86 world, will you be able to submit such a sample perf.data file and I may run and test? (If perf data contains google specific content, we may continue this discussion on bugnizer.) |
Could you also submit a sample perf.data file for this problem? (We may continue this discuss if per.data files contain sensitive data) |
Apologies, I can't easily submit a perf.data for this. I hope the problem description is enough. |
The branch stack entry reader will warn about reserved bits being non-zero, so the reader needs to know about all the fields that the kernel is producing:
Probably, it should save at least some of this new information in the entry. The 'type' field may be needed by whoever is consuming this infomation, in order to ignore or distinguish some kinds of branches (e.g. interrupts). If type==15, new_type is used as an extended type field.
(Support for 'type' seems to have been added by the recent "update to latest internal version" merge, but "new_type" is still missing and we are already seeing kernels make use of that.)
The text was updated successfully, but these errors were encountered: