Skip to content

Commit

Permalink
Improve Memory Access Error Message
Browse files Browse the repository at this point in the history
Resolves #143
  • Loading branch information
Falcosc committed Apr 27, 2021
1 parent 09026df commit c392de1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ EXP int CALL init_table(ryzen_access ry)
ry->mem_obj = init_mem_obj(ry->table_addr);
if(!ry->mem_obj)
{
printf("Unable to get MEM Obj\n");
printf("Unable to get memory access\n");
return ADJ_ERR_MEMORY_ACCESS;
}

Expand Down
24 changes: 13 additions & 11 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,9 @@ int main(int argc, const char **argv)

if (info || dump_table) {
//init before adjustment to get the default values
int errorcode = init_table(ry);
if(errorcode){
printf("Unable to init power metric table: %d\n", errorcode);
return errorcode;
err = init_table(ry);
if (err) {
printf("Unable to init power metric table: %d, this does not affect adjustments because it is only needed for monitoring.\n", err);
}
}

Expand Down Expand Up @@ -291,13 +290,16 @@ int main(int argc, const char **argv)
_do_enable(power_saving);
_do_enable(max_performance);

//call show table dump before anybody did call table refresh, because we want to copy the old values first
if (dump_table)
show_table_dump(ry, any_adjust_applied);

//show power table after apply settings
if (info)
show_info_table(ry);
if (!err) {
//call show table dump before anybody did call table refresh, because we want to copy the old values first
if (dump_table) {
show_table_dump(ry, any_adjust_applied);
}
//show power table after apply settings
if (info) {
show_info_table(ry);
}
}

cleanup_ryzenadj(ry);

Expand Down

0 comments on commit c392de1

Please sign in to comment.