Define the run options shared by bucketing, correlation and the profiler
pipeline: thread count, sample threshold, live sampling period and the
diagnostic dump paths.

afdo_tools/ChangeLog:

        * src/autofdo_options.h: New file.

Signed-off-by: Kugan Vivekanandarajah <[email protected]>
Co-authored-by: Dhruv Chawla <[email protected]>
Co-authored-by: Rahul Shinde <[email protected]>
---
 afdo_tools/src/autofdo_options.h | 42 ++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 afdo_tools/src/autofdo_options.h

diff --git a/afdo_tools/src/autofdo_options.h b/afdo_tools/src/autofdo_options.h
new file mode 100644
index 00000000000..480eb10e77d
--- /dev/null
+++ b/afdo_tools/src/autofdo_options.h
@@ -0,0 +1,42 @@
+/* Copyright The GNU Toolchain Authors
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_AUTOFDO_OPTIONS_H
+#define GCC_AUTOFDO_OPTIONS_H
+
+#include <cstdint>
+#include <string>
+
+namespace autofdo {
+
+constexpr unsigned DEFAULT_CORRELATE_THREADS = 8;
+
+/* CLI configuration for profile generation and correlation.  */
+struct profiler_run_options
+{
+  bool use_branch_stack = true;
+  unsigned correlate_threads = DEFAULT_CORRELATE_THREADS;
+  double sample_threshold_frac = 0.0;
+  uint64_t live_sample_period = 0;
+  std::string dump_address_mapping;
+  std::string dump_perf_maps;
+};
+
+} /* namespace autofdo.  */
+
+#endif /* GCC_AUTOFDO_OPTIONS_H.  */
-- 
2.34.1

Reply via email to