Skip to content

Commit aa742d7

Browse files
reatmon-tishashim-quic
authored andcommitted
FROMLIST: drivers: gpu: drm: msm: registers: improve reproducibility
The files generated by gen_header.py capture the source path to the input files and the date. While that can be informative, it varies based on where and when the kernel was built as the full path is captured. Since all of the files that this tool is run on is under the drivers directory, this modifies the application to strip all of the path before drivers. Additionally it prints <stripped> instead of the date. Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Link: https://lore.kernel.org/dri-devel/20250524-binrep-v2-1-09040177218e@oss.qualcomm.com/ Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
1 parent 82f2b0b commit aa742d7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/gpu/drm/msm/registers/gen_header.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import argparse
1212
import time
1313
import datetime
14+
import re
1415

1516
class Error(Exception):
1617
def __init__(self, message):
@@ -877,13 +878,14 @@ def dump_c(args, guard, func):
877878
""")
878879
maxlen = 0
879880
for filepath in p.xml_files:
880-
maxlen = max(maxlen, len(filepath))
881+
new_filepath = re.sub("^.+drivers","drivers",filepath)
882+
maxlen = max(maxlen, len(new_filepath))
881883
for filepath in p.xml_files:
882-
pad = " " * (maxlen - len(filepath))
884+
pad = " " * (maxlen - len(new_filepath))
883885
filesize = str(os.path.getsize(filepath))
884886
filesize = " " * (7 - len(filesize)) + filesize
885887
filetime = time.ctime(os.path.getmtime(filepath))
886-
print("- " + filepath + pad + " (" + filesize + " bytes, from " + filetime + ")")
888+
print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)")
887889
if p.copyright_year:
888890
current_year = str(datetime.date.today().year)
889891
print()

0 commit comments

Comments
 (0)