mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Adrian Hunter" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
	linux-kernel@vger.kernel.org
Subject: [tip: perf/core] perf scripts python: exported-sql-viewer.py: Add LookupModel()
Date: Tue, 15 Oct 2019 05:31:50 -0000	[thread overview]
Message-ID: <157111751078.12254.15231324042009196459.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20190821083216.1340-2-adrian.hunter@intel.com>

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     181ea40a24af9a60c2ee75d4f271980f6453f585
Gitweb:        https://git.kernel.org/tip/181ea40a24af9a60c2ee75d4f271980f6453f585
Author:        Adrian Hunter <adrian.hunter@intel.com>
AuthorDate:    Wed, 21 Aug 2019 11:32:11 +03:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Mon, 07 Oct 2019 12:22:17 -03: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>
---
 tools/perf/scripts/python/exported-sql-viewer.py |  9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index 61b3911..18ad046 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():

  reply	other threads:[~2019-10-15  5:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21  8:32 [PATCH 0/6] perf scripts python: exported-sql-viewer.py: Add Time chart by CPU Adrian Hunter
2019-08-21  8:32 ` [PATCH 1/6] perf scripts python: exported-sql-viewer.py: Add LookupModel() Adrian Hunter
2019-10-15  5:31   ` tip-bot2 for Adrian Hunter [this message]
2019-08-21  8:32 ` [PATCH 2/6] perf scripts python: exported-sql-viewer.py: Add HBoxLayout and VBoxLayout Adrian Hunter
2019-10-15  5:31   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-08-21  8:32 ` [PATCH 3/6] perf scripts python: exported-sql-viewer.py: Add global time range calculations Adrian Hunter
2019-10-15  5:31   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-08-21  8:32 ` [PATCH 4/6] perf scripts python: exported-sql-viewer.py: Tidy up Call tree call_time Adrian Hunter
2019-10-15  5:31   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-08-21  8:32 ` [PATCH 5/6] perf scripts python: exported-sql-viewer.py: Add ability for Call tree to open at a specified task and time Adrian Hunter
2019-10-15  5:31   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-08-21  8:32 ` [PATCH 6/6] perf scripts python: exported-sql-viewer.py: Add Time chart by CPU Adrian Hunter
2019-10-15  5:31   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-09-06  8:57 ` [PATCH 0/6] " Adrian Hunter
2019-10-03 11:01   ` Adrian Hunter
2019-10-03 13:25     ` Arnaldo Carvalho de Melo
2019-10-03 13:43       ` Arnaldo Carvalho de Melo
2019-10-04  8:33         ` Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157111751078.12254.15231324042009196459.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=bp@alien8.de \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®