add set_program_name implementation

This commit is contained in:
Patrick Lipka 2025-08-07 17:41:07 +02:00
parent cc9a7ece7a
commit 60ce804e36
1 changed files with 14 additions and 1 deletions

View File

@ -72,4 +72,17 @@ void rvprof_init(const char* output_file){
// register atexit handler to automate cleanup
register_atexit_handler();
}
}
void rvprof_set_program_name(const char* program_name){
if (g_rvprof.config.program_name){
rvprof_free(g_rvprof.config.program_name, strlen(g_rvprof.config.program_name)+1);
}
if (program_name) {
g_rvprof.config.program_name = rvprof_malloc(strlen(program_name)+1);
if (g_rvprof.config.program_name) {
strcpy(g_rvprof.config.program_name, program_name);
}
}
}