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

Add names to gathered stats for some events. #120996

Open
markshannon opened this issue Jun 25, 2024 · 1 comment
Open

Add names to gathered stats for some events. #120996

markshannon opened this issue Jun 25, 2024 · 1 comment
Labels
performance Performance or resource usage

Comments

@markshannon
Copy link
Member

Motivation

Sometimes we need to classify stats by name from an unknown set.
For example, 94% of the specialization failures for the CALL instruction is "class no vectorcall".
This is valuable information and suggests we need to implement more vectorcalls for classes.
But it doesn't tell us which classes lack vectorcalls.

Proposal

For some stats, e.g. call specialization we add the ability to record names.
If we record the first N names seen, provided N is large enough, we will see the most common names.
To avoid complications with objects and memory allocation distorting the stats, we can pre-allocate a fixed size array char names[N][M], as well as the usual table of uint64_t counts. For a table size 256, with up to 63 char names, this only uses 18kb.

@markshannon markshannon added the performance Performance or resource usage label Jun 25, 2024
@markshannon
Copy link
Member Author

The API would look something like: INC_STAT_FOR_NAME(stat_id, name)
where stat_id is the stat field name(s), e.g. call.classes and the name is a const char * name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage
1 participant