From 277e07d1cc83abf66c9088e4a5d9594b2603492d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 30 May 2024 10:35:24 +0100 Subject: bitbake: cooker: Improve handling errors during parsing when profiling We've seeing profiling tracebacks when parse errors occur during profiling. Try and avoid these but not processing invalid profiles. (Bitbake rev: 171bd9dd575307fbd61b5179ad86131d76add067) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 255b9f199a..673af8daec 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -2236,12 +2236,13 @@ class CookerParser(object): profiles = [] for i in self.process_names: logfile = "profile-parse-%s.log" % i - if os.path.exists(logfile): + if os.path.exists(logfile) and os.path.getsize(logfile): profiles.append(logfile) - pout = "profile-parse.log.processed" - bb.utils.process_profilelog(profiles, pout = pout) - print("Processed parsing statistics saved to %s" % (pout)) + if profiles: + pout = "profile-parse.log.processed" + bb.utils.process_profilelog(profiles, pout = pout) + print("Processed parsing statistics saved to %s" % (pout)) def final_cleanup(self): if self.syncthread: -- cgit v1.2.3-54-g00ecf