-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Lally/marker api #20
Lally/marker api #20
Conversation
@lally, please review. Notice |
@lally, ping |
I've got a draft I'll put up this weekend for the TODOs
…On Fri, May 5, 2023, 10:26 AM Denis Bakhvalov ***@***.***> wrote:
@lally <https://github.com/lally>, ping
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAK4SZDM4CTWJ25LAOSUNDXEUEZHANCNFSM6AAAAAAW5T6RGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@dendibakh this is getting confusing. I couldn't push to the branch for this PR. I've pushed to this branch: https://github.com/lally/perf-book/tree/upstream/lally/marker-api |
@lally, I pulled your changes and made some more edits. From my perspective, we are good to go. |
I'll put in 2 comments here instead of ping-ponging with branches. I think this is good.
static int s_event_fd = -1;
void setup_render_instrumentation() {
if (s_event_fd < 0) {
pfm_initialize();
struct perf_event_attr perf_attr;
memset(&perf_attr, 0, sizeof(perf_attr));
perf_attr.size = sizeof(struct perf_event_attr);
perf_attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
PERF_FORMAT_TOTAL_TIME_RUNNING | PERF_FORMAT_GROUP;
pfm_perf_encode_arg_t arg;
memset(&arg, 0, sizeof(pfm_perf_encode_arg_t));
arg.size = sizeof(pfm_perf_encode_arg_t);
arg.attr = &perf_attr;
pfm_get_os_event_encoding("instructions", PFM_PLM3, PFM_OS_PERF_EVENT_EXT, &arg);
int leader_fd = perf_event_open(&perf_attr, 0, -1, -1, 0);
pfm_get_os_event_encoding("cycles", PFM_PLM3, PFM_OS_PERF_EVENT_EXT, &arg);
s_event_fd = perf_event_open(&perf_attr, 0, -1, leader_fd, 0);
pfm_get_os_event_encoding("branches", PFM_PLM3, PFM_OS_PERF_EVENT_EXT, &arg);
s_event_fd = perf_event_open(&perf_attr, 0, -1, leader_fd, 0);
pfm_get_os_event_encoding("branch-misses", PFM_PLM3, PFM_OS_PERF_EVENT_EXT, &arg);
s_event_fd = perf_event_open(&perf_attr, 0, -1, leader_fd, 0);
}
}
struct read_format { uint64_t nr, time_enabled, time_running, values[4]; }; And then call |
Thanks. Will fix.
Good catch. In this case, |
1f818c8
to
4e94d63
Compare
Hey @lally, for some reason I couldn't push changes into your branch (protected branch?), so I opened a new PR here. Previous PR is here: #17.