benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

[FR] Allow modification of perf attributes

Open double-fault opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

I have a multi-threaded benchmark where I'd like the performance counters to only measure the main thread.

Describe the solution you'd like

Setting the inherit attribute to false instead of true before passing the struct to perf_event_open would solve my issue. Some sort of configuration option which allows me to set this would be ideal. Maybe this can be extended to other attributes as well instead of hardcoding them.

Describe alternatives you've considered

Currently, I have to set it to false and recompile google benchmark.

double-fault avatar Jan 06 '25 09:01 double-fault

@dmah42 do you have any suggestions on what the interface to set the config should look like - as in, should it be a cmd line argument, an argument in the benchmark macros, etc. If you can suggest what the interface should be like maybe I can implement it when I get some time.

double-fault avatar Jan 09 '25 16:01 double-fault

i think a command line argument is probably the right way to go as it affects the entire run.

dmah42 avatar Jan 15 '25 12:01 dmah42