Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scripts/build/check_init_priorities.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import pathlib
import pickle
import sys
import re

from elftools.elf.elffile import ELFFile
from elftools.elf.relocation import RelocationSection
Expand Down Expand Up @@ -75,9 +76,18 @@ class Priority:
"""
def __init__(self, name):
for idx, level in enumerate(_DEVICE_INIT_LEVELS):
expr = re.compile(rf".*{level}(\d+)_(\d+).*")
if level in name:
_, priority_str = name.strip("_").split(level)
priority, sub_priority = priority_str.split("_")

# ARCMWDT linker generates extended section names
# (ex.: .rela.z_init_POST_KERNEL40_0_.__init_k_sys_work_q_init).
# limitation is required for reading only 2 parameters from
# priority string.
Comment on lines +83 to +86
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is now redundant, also please check @fabiobaltieri PR, because these changes may not be needed at all

Copy link
Author

@kokas-a kokas-a Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabiobaltieri, @gmarull , Suggested changes #62459 works fine for WMDT compiler. So if pointed PR is applied in nearest future there is no need in this one (#62459).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's merged, hopefully we should be good to go

Sorry about the breakage again, thanks for you patience.

m = expr.match(name)
if not m:
continue
priority, sub_priority = m.groups()
self._level = idx
self._priority = int(priority)
self._sub_priority = int(sub_priority)
Expand Down