Skip to content

Commit 5acee74

Browse files
gowthamsiddarthdprashymh
authored andcommitted
debug(pal): gate info table dumps behind debug print level
Update PAL info table creation routines to conditionally dump internal tables only when debug verbosity is enabled. This avoids unnecessary exuctung the dump functions saving execution cycles while preserving debug visibility when required. Applied consistently across multiple PAL modules. Signed-off-by: Gowtham Siddarth <gowtham.siddarth@arm.com> Change-Id: I76c41130041de4cbee1ee34bb7289a535493b2e4
1 parent 0d7f9d3 commit 5acee74

9 files changed

Lines changed: 51 additions & 25 deletions

File tree

pal/baremetal/base/src/pal_hmat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -96,5 +96,6 @@ void pal_hmat_create_info_table(HMAT_INFO_TABLE *HmatTable)
9696
}
9797
}
9898

99-
pal_hmat_dump_info_table(HmatTable);
99+
if (g_print_level <= ACS_PRINT_DEBUG)
100+
pal_hmat_dump_info_table(HmatTable);
100101
}

pal/baremetal/base/src/pal_iovirt.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -289,9 +289,12 @@ pal_iovirt_create_info_table(IOVIRT_INFO_TABLE *IoVirtTable)
289289

290290
block = &(IoVirtTable->blocks[0]);
291291
print(ACS_PRINT_DEBUG, " Number of IOVIRT blocks = %d\n", IoVirtTable->num_blocks);
292-
for(i = 0; i < IoVirtTable->num_blocks; i++, block = IOVIRT_NEXT_BLOCK(block))
293-
{
294-
dump_block(block);
292+
293+
if (g_print_level <= ACS_PRINT_DEBUG) {
294+
for (i = 0; i < IoVirtTable->num_blocks; i++, block = IOVIRT_NEXT_BLOCK(block))
295+
{
296+
dump_block(block);
297+
}
295298
}
296299

297300
}

pal/baremetal/base/src/pal_mpam.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -153,7 +153,9 @@ pal_mpam_create_info_table(MPAM_INFO_TABLE *MpamTable)
153153
MpamTable->msc_count++;
154154
curr_entry = MPAM_NEXT_MSC(curr_entry);
155155
}
156-
pal_mpam_dump_table(MpamTable);
156+
157+
if (g_print_level <= ACS_PRINT_DEBUG)
158+
pal_mpam_dump_table(MpamTable);
157159
}
158160

159161
/**
@@ -207,5 +209,6 @@ pal_srat_create_info_table(SRAT_INFO_TABLE *SratTable)
207209
Ptr++;
208210
}
209211

210-
pal_srat_dump_table(SratTable);
212+
if (g_print_level <= ACS_PRINT_DEBUG)
213+
pal_srat_dump_table(SratTable);
211214
}

pal/baremetal/base/src/pal_pcc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -36,6 +36,7 @@ pal_pcc_dump_info_table(PCC_INFO_TABLE *PccInfoTable)
3636

3737
if (PccInfoTable == NULL) {
3838
print(ACS_PRINT_ERR, "\nUnable to dump PCC info table, input pointer is NULL\n");
39+
return;
3940
}
4041

4142
print(ACS_PRINT_INFO, "\n*** PCC Information ***");
@@ -127,7 +128,10 @@ pal_pcc_create_info_table(PCC_INFO_TABLE *PccInfoTable)
127128
= platform_pcc_cfg.pcc_info[i].type_spec_info.pcc_ss_type_3.min_req_turnaround_usec;
128129
}
129130
curr_entry++;
130-
}
131-
pal_pcc_dump_info_table(PccInfoTable);
131+
}
132+
133+
if (g_print_level <= ACS_PRINT_DEBUG)
134+
pal_pcc_dump_info_table(PccInfoTable);
135+
132136
return;
133137
}

pal/baremetal/base/src/pal_pmu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -93,7 +93,8 @@ pal_pmu_create_info_table(PMU_INFO_TABLE *PmuTable)
9393
}
9494

9595
/* Dump PMU info table */
96-
pal_pmu_dump_info_table(PmuTable);
96+
if (g_print_level <= ACS_PRINT_DEBUG)
97+
pal_pmu_dump_info_table(PmuTable);
9798
}
9899
}
99100

pal/baremetal/base/src/pal_pptt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -135,5 +135,7 @@ pal_cache_create_info_table(CACHE_INFO_TABLE *CacheTable, PE_INFO_TABLE *PeTable
135135
}
136136

137137
pal_cache_store_pe_res(CacheTable, PeTable);
138-
pal_cache_dump_info_table(CacheTable, PeTable);
138+
139+
if (g_print_level <= ACS_PRINT_DEBUG)
140+
pal_cache_dump_info_table(CacheTable, PeTable);
139141
}

pal/baremetal/base/src/pal_ras.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -236,7 +236,8 @@ pal_ras_create_info_table(RAS_INFO_TABLE *RasInfoTable)
236236
curr_node++;
237237
}
238238

239-
pal_ras_dump_info_table(RasInfoTable);
239+
if (g_print_level <= ACS_PRINT_DEBUG)
240+
pal_ras_dump_info_table(RasInfoTable);
240241
}
241242

242243
/**
@@ -331,5 +332,7 @@ pal_ras2_create_info_table(RAS2_INFO_TABLE *RasFeatInfoTable)
331332

332333
RasFeatInfoTable->num_all_block++;
333334
}
334-
pal_ras2_dump_info_table(RasFeatInfoTable);
335+
336+
if (g_print_level <= ACS_PRINT_DEBUG)
337+
pal_ras2_dump_info_table(RasFeatInfoTable);
335338
}

val/driver/smmu_v3/smmu_v3.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,9 @@ static int smmu_cdtab_write_ctx_desc(smmu_master_t *master,
10231023
CDTAB_CD_0_V;
10241024

10251025
cdptr[0] = val;
1026-
dump_cdtab(cdptr);
1026+
1027+
if (g_print_level <= ACS_PRINT_DEBUG)
1028+
dump_cdtab(cdptr);
10271029

10281030
return 1;
10291031
}
@@ -1209,7 +1211,9 @@ uint64_t val_smmu_map(smmu_master_attributes_t master_attr, pgt_descriptor_t pgt
12091211

12101212
ste = smmu_strtab_get_ste_for_sid(smmu, master->sid);
12111213
smmu_strtab_write_ste(master, ste);
1212-
dump_strtab(ste);
1214+
1215+
if (g_print_level <= ACS_PRINT_DEBUG)
1216+
dump_strtab(ste);
12131217

12141218
smmu_tlbi_cfgi(smmu);
12151219

@@ -1236,8 +1240,11 @@ uint32_t val_smmu_config_ste_dcp(smmu_master_attributes_t master_attr, uint32_t
12361240
else
12371241
ste[1] = ste[1] & BITFIELD_SET(STRTAB_STE_1_DCP, value);
12381242

1239-
val_print(ACS_PRINT_INFO, "\n Dump STE values", 0);
1240-
dump_strtab(ste);
1243+
if (g_print_level <= ACS_PRINT_DEBUG)
1244+
{
1245+
val_print(ACS_PRINT_INFO, "\n Dump STE values", 0);
1246+
dump_strtab(ste);
1247+
}
12411248

12421249
dcp_value = (ste[1] >> STRTAB_STE_1_DCP_SHIFT) & 0x1;
12431250

val/src/acs_peripherals.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2016-2018, 2021-2025, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2016-2018, 2021-2026, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -299,7 +299,9 @@ val_peripheral_create_info_table(uint64_t *peripheral_info_table)
299299
val_peripheral_get_info(NUM_SATA, 0));
300300
val_print(ACS_PRINT_TEST, " Peripheral: Num of UART controllers : %d\n",
301301
val_peripheral_get_info(NUM_UART, 0));
302-
val_peripheral_dump_info();
302+
303+
if (g_print_level <= ACS_PRINT_DEBUG)
304+
val_peripheral_dump_info();
303305

304306
}
305307

0 commit comments

Comments
 (0)