Skip to content

Allow Mod of Perf Attributes#2129

Open
IshanPhadte776 wants to merge 2 commits intogoogle:mainfrom
IshanPhadte776:iphadte/Allow-mod-of-perf-attributes
Open

Allow Mod of Perf Attributes#2129
IshanPhadte776 wants to merge 2 commits intogoogle:mainfrom
IshanPhadte776:iphadte/Allow-mod-of-perf-attributes

Conversation

@IshanPhadte776
Copy link

@IshanPhadte776 IshanPhadte776 commented Feb 18, 2026

I added an optional Command Line Argument
-- benchmark_perf_counters_inherit (Either True or False) and True by Default

True = Benchmark Parent and Child Processes
False = Benchmark just the parent process

True if unspecified

@google-cla
Copy link

google-cla bot commented Feb 18, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@LebedevRI LebedevRI left a comment

Choose a reason for hiding this comment

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

I think inherit is too undecipherable,
it should probably be benchmark_perf_counters_for_all_threads / benchmark_perf_counters_all_threads or something..

" [--benchmark_counters_tabular={true|false}]\n"
#if defined HAVE_LIBPFM
" [--benchmark_perf_counters=<counter>,...]\n"
" [--benchmark_perf_counters_inherit={true|false}]\n" // <--- Add this
Copy link
Member

Choose a reason for hiding this comment

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

remove the AI generated comment please


PerfCounters PerfCounters::Create(
const std::vector<std::string>& counter_names) {
const std::vector<std::string>& counter_names, bool inherit) {
Copy link
Member

Choose a reason for hiding this comment

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

boolean parameters are notoriously hard to track as the callsite becomes opaque : https://abseil.io/tips/94

@@ -311,20 +312,21 @@ bool PerfCounters::Initialize() { return false; }
bool PerfCounters::IsCounterSupported(const std::string&) { return false; }

PerfCounters PerfCounters::Create(
Copy link
Member

Choose a reason for hiding this comment

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

i think this would be clearer as two methods: Create and CreateInherited (or whatever naming you land on)

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.

3 participants

Comments