Commit 181ea40a authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarAdrian 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8bd436b0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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():