Skip to content
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

all: show pc hit count in /rawcover and /rawcoverfiles #5617

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jiangenj
Copy link
Contributor


Before sending a pull request, please review Contribution Guidelines:
https://github.com/google/syzkaller/blob/master/docs/contributing.md


- one pc can have multiple frames, print all frames
- cache output to accelarate buf writing
- output order by PC
Print the PC count when ?count=1 when accessing /rawcover*.

The largest counted pc is likely overflowed, we can either
disable the sanitize by KCOV_INSTRUMENT_file_name.o := n or
disable by __no_sanitize_coverage for the function.
sort.Slice(resFrames, func(i, j int) bool {
fl, fr := resFrames[i], resFrames[j]
if fl.PC == fr.PC {
resFrames := make(map[uint64][]backend.Frame)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this change help you achieve?
In the current code, we already print all frames. Moreover, they used to be sorted by PC, but in your change they are now shuffled by the Go's map implementation.

if frame.Module.Name == "" {
offset = frame.PC
}
output = append(output, fmt.Sprintf("0x%x,%v,0x%x,%v,%v,%v,%v\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intention switching to output []string? fmt.Fprintf directly into the buf should be the most efficient way to construct a large output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants