mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 09:31:50 +00:00
perf scripts python: exported-sql-viewer.py: Add LookupModel()
Add LookupModel() to find a model in the model cache without creating it. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20190821083216.1340-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
8bd436b006
commit
181ea40a24
@ -341,6 +341,15 @@ def LookupCreateModel(model_name, create_fn):
|
||||
model_cache_lock.release()
|
||||
return model
|
||||
|
||||
def LookupModel(model_name):
|
||||
model_cache_lock.acquire()
|
||||
try:
|
||||
model = model_cache[model_name]
|
||||
except:
|
||||
model = None
|
||||
model_cache_lock.release()
|
||||
return model
|
||||
|
||||
# Find bar
|
||||
|
||||
class FindBar():
|
||||
|
Loading…
Reference in New Issue
Block a user