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

Set size of perf_attr_struct prior to getting pfm encoding #88

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

jishminor
Copy link
Contributor

@jishminor jishminor commented Sep 13, 2023

Pull Request Description

Simple fix to ensure correct size of struct gets mem copied in pfm_lib_perf_event_encode in libpfm4.

Events from pfm4 which contain values in the config2 field of the perf_event_attr struct seem to not get copied in pfm_lib_perf_event_encode when opening up a PAPI event.

The general trace of this issue is:

  1. ntv_evt->attr is zeroed out here
  2. attr.size is 0 here, resulting in PERF_ATTR_SIZE_VER0 being used as the default size used to memcpy the perf_event_attr which the user gets back from the function here.
  3. This results in additional fields required to open some events in perf such as config2 not being set when requested.

@gcongiu gcongiu added this to the PAPI 7.1.0 release milestone Nov 7, 2023
Signed-off-by: Josh Minor <josh.minor@arm.com>
@gcongiu gcongiu merged commit 57f70bb into icl-utk-edu:master Nov 8, 2023
14 checks passed
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