History

perf scripts python: exported-sql-viewer.py: Add LookupModel()

Add LookupModel() to find a model in the model cache without creating it.

Adrian Hunter committed 7 years ago

Commit 181ea401 parent 8bd436b1 file · +9 −0Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/exported-sql-viewer.py+9−0
@@ -341,6 +341,15 @@ def LookupCreateModel(model_name, create_fn): · 340 unmodified lines
341341 model_cache_lock.release()
342342 return model
343343
344+def LookupModel(model_name):
345+ model_cache_lock.acquire()
346+ try:
347+ model = model_cache[model_name]
348+ except:
349+ model = None
350+ model_cache_lock.release()
351+ return model
352+
344353 # Find bar
345354
346355 class FindBar():