Skip to content

Commit ba64c67

Browse files
reatmon-tiRob Clark
authored andcommitted
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 <[email protected]> Signed-off-by: Bruce Ashfield <[email protected]> Signed-off-by: Viswanath Kraleti <[email protected]> Acked-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/655599/ Signed-off-by: Rob Clark <[email protected]>
1 parent 2b520c6 commit ba64c67

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)