aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorAdrian Hunter <[email protected]>2019-08-21 08:32:11 +0000
committerArnaldo Carvalho de Melo <[email protected]>2019-10-07 15:22:17 +0000
commit181ea40a24af9a60c2ee75d4f271980f6453f585 (patch)
tree047e18a29a81a69f3349376ba24324782563f183 /tools/perf/scripts/python/exported-sql-viewer.py
parentperf trace augmented_syscalls: Do not show syscalls when none was asked for (diff)
downloadkernel-181ea40a24af9a60c2ee75d4f271980f6453f585.tar.gz
kernel-181ea40a24af9a60c2ee75d4f271980f6453f585.zip
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 <[email protected]> Cc: Jiri Olsa <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
-rwxr-xr-xtools/perf/scripts/python/exported-sql-viewer.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index 61b3911d91e6..18ad04654adc 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/scripts/python/exported-sql-viewer.py
@@ -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():