Adding python script for rocprofv3 (#849)
* Adding python script for rocprofv3 * script update * updating script * Fixing script for counter collection tests * Fixing Sanitizer issues * Adding YAML input file support * Fixing counter validation tests * script modifications * Adding missing LD_PRELOAD * doc updates * Adding test for yaml input * updated yaml extension support in doc * backward compatibility * updating scripts * Fixing git history rocprofv3- part1 * Fixing git history rocprofv3- part2 * Fixing rocprofv3 history final * Rebasing PR 860 for json support * Review comments: Parser updates * Removed color encoding and rebasing again * Addressing review comments * removing globals * Update rocprofv3.py - update tests to conform to new argparse requirements - added support for JSON * Slight tweak to update_env for ROCP_OUTPUT_FORMAT * Update rocprofv3.py - Handle ROCPROF_PRELOAD - Add --preload option - Add --kernel-names option * Update rocprofv3.py - Fix update_env handling of prepend/append - Tweak --preload argument --------- Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
@@ -1065,9 +1065,18 @@ list_metrics_iterate_agents(rocprofiler_agent_version_t,
|
||||
rocprofiler_client_finalize_t client_finalizer = nullptr;
|
||||
rocprofiler_client_id_t* client_identifier = nullptr;
|
||||
|
||||
void
|
||||
initialize_logging()
|
||||
{
|
||||
auto logging_cfg = rocprofiler::common::logging_config{.install_failure_handler = true};
|
||||
common::init_logging("ROCPROF", logging_cfg);
|
||||
FLAGS_colorlogtostderr = true;
|
||||
}
|
||||
|
||||
void
|
||||
initialize_rocprofv3()
|
||||
{
|
||||
ROCP_INFO << "initializing rocprofv3...";
|
||||
if(int status = 0;
|
||||
rocprofiler_is_initialized(&status) == ROCPROFILER_STATUS_SUCCESS && status == 0)
|
||||
{
|
||||
@@ -1083,6 +1092,7 @@ initialize_rocprofv3()
|
||||
void
|
||||
finalize_rocprofv3()
|
||||
{
|
||||
ROCP_INFO << "finalizing rocprofv3...";
|
||||
if(client_finalizer && client_identifier)
|
||||
{
|
||||
client_finalizer(*client_identifier);
|
||||
@@ -1597,9 +1607,7 @@ rocprofiler_configure(uint32_t version,
|
||||
uint32_t priority,
|
||||
rocprofiler_client_id_t* id)
|
||||
{
|
||||
auto logging_cfg = rocprofiler::common::logging_config{.install_failure_handler = true};
|
||||
common::init_logging("ROCPROF", logging_cfg);
|
||||
FLAGS_colorlogtostderr = true;
|
||||
initialize_logging();
|
||||
|
||||
// set the client name
|
||||
id->name = "rocprofv3";
|
||||
@@ -1673,19 +1681,15 @@ rocprofv3_set_main(main_func_t main_func)
|
||||
int
|
||||
rocprofv3_main(int argc, char** argv, char** envp)
|
||||
{
|
||||
auto logging_cfg = rocprofiler::common::logging_config{.install_failure_handler = true};
|
||||
common::init_logging("ROCPROF_LOG_LEVEL", logging_cfg);
|
||||
FLAGS_colorlogtostderr = true;
|
||||
initialize_logging();
|
||||
|
||||
LOG(INFO) << "initializing rocprofv3...";
|
||||
initialize_rocprofv3();
|
||||
|
||||
auto ret = CHECK_NOTNULL(get_main_function())(argc, argv, envp);
|
||||
|
||||
LOG(INFO) << "finalizing rocprofv3...";
|
||||
finalize_rocprofv3();
|
||||
|
||||
LOG(INFO) << "rocprofv3 finished. exit code: " << ret;
|
||||
ROCP_INFO << "rocprofv3 finished. exit code: " << ret;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user