commit 182b24fb635345d48c91ed1de58a08b620312f3d
parent 4b2c0b7e9649f2002208994707e9245a91c98196
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date: Sat, 10 Oct 2015 20:52:39 -0700
Ctrl-F to search
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/flamegraph.pl b/flamegraph.pl
@@ -10,6 +10,9 @@
#
# grep funcA input.txt | ./flamegraph.pl [options] > graph.svg
#
+# Then open the resulting .svg in a web browser, for interactivity: mouse-over
+# frames for info, click to zoom, and ctrl-F to search.
+#
# Options are listed in the usage message (--help).
#
# The input is stack frames and sample counts formatted as single lines. Each
@@ -611,6 +614,14 @@ my $inc = <<INC;
details.nodeValue = ' ';
}
+ // ctrl-F for search
+ window.addEventListener("keydown",function (e) {
+ if (e.keyCode === 114 || (e.ctrlKey && e.keyCode === 70)) {
+ e.preventDefault();
+ search_prompt();
+ }
+ })
+
// functions
function find_child(parent, name, attr) {
var children = parent.childNodes;