Add rocprofiler_load_counter_definition (#1193)

Adds rocprofiler_load_counter_definition. This function allows a counter definition file to be supplied to rocprofiler-sdk directly. Takes in a string containing the counter definition YAML, its size (in bytes), and a flag value to state whether this is an append operation or not.

---------

Co-authored-by: Benjamin Welton <ben@amd.com>
Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>
Co-authored-by: usrihari123 <srihari.u@amd.com>

[ROCm/rocprofiler-sdk commit: 7ddc72ad45]
This commit is contained in:
Benjamin Welton
2024-11-22 01:55:47 -08:00
committed by GitHub
vanhempi 5bea1772ea
commit 39db3e8a1d
22 muutettua tiedostoa jossa 384 lisäystä ja 8 poistoa
@@ -144,6 +144,13 @@ For MPI applications (or other job launchers such as SLURM), place rocprofv3 ins
choices=("fatal", "error", "warning", "info", "trace", "env"),
type=str.lower,
)
io_options.add_argument(
"-E",
"--extra-counters",
help="Path to YAML file containing extra counter definitions",
type=str,
required=False,
)
aggregate_tracing_options = parser.add_argument_group("Aggregate tracing options")
@@ -881,6 +888,11 @@ def run(app_args, args, **kwargs):
if args.kernel_iteration_range:
update_env("ROCPROF_KERNEL_FILTER_RANGE", ", ".join(args.kernel_iteration_range))
if args.extra_counters is not None:
with open(args.extra_counters, "r") as e_file:
e_file_contents = e_file.read()
update_env("ROCPROF_EXTRA_COUNTERS_CONTENTS", e_file_contents, overwrite=True)
if args.pmc:
update_env("ROCPROF_COUNTER_COLLECTION", True, overwrite=True)
update_env(