Skip to content

Instantly share code, notes, and snippets.

@tadzik

tadzik/diff Secret

Created May 11, 2017 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/80060834fa015f7938cd4153cfcbe94e to your computer and use it in GitHub Desktop.
Save tadzik/80060834fa015f7938cd4153cfcbe94e to your computer and use it in GitHub Desktop.
diff --git a/bin/p6profiler-tui b/bin/p6profiler-tui
index a150650..a2fa2a1 100644
--- a/bin/p6profiler-tui
+++ b/bin/p6profiler-tui
@@ -12,22 +12,22 @@ sub routine_and_children($dbh, $id) {
routines.line as line,
routines.file as file,
- calls.callee_id as id,
- calls.caller_id as parent_id,
- calls.entries as entries,
+ calls.id as id,
+ calls.parent_id as parent_id,
+ calls.entries as entries,
calls.exclusive_time as exclusive,
calls.inclusive_time as inclusive
from calls inner join routines on calls.routine_id = routines.id
- where parent_id = ? or id = ?
+ where calls.parent_id = ? or calls.id = ?
- order by id asc
+ order by calls.id asc
;
STMT
my $childcount = $dbh.prepare(q:to/STMT/);
- select count(*) from calls where caller_id = ?
+ select count(*) from calls where parent_id = ?
STMT
$query.execute($id, $id);
@@ -44,6 +44,8 @@ sub routine_and_children($dbh, $id) {
$query.finish;
$childcount.finish;
+ say @results.perl;
+
@results;
}
@@ -54,8 +56,8 @@ sub breadcrumbs($dbh, $id) {
routines.line as line,
routines.file as file,
- calls.callee_id as id,
- calls.caller_id as parent_id,
+ calls.id as id,
+ calls.parent_id as parent_id,
calls.inclusive_time as inclusive,
calls.exclusive_time as exclusive
@@ -126,7 +128,7 @@ multi sub MAIN($databasefile where all(*.ends-with('sqlite3'), *.IO.f, *.IO.e))
my $totaltime;
{
my $query = $dbh.prepare(q:to/STMT/);
- select calls.inclusive_time from calls where callee_id = 0;
+ select calls.inclusive_time from calls where id = 0;
STMT
$query.execute;
@@ -150,7 +152,7 @@ multi sub MAIN($databasefile where all(*.ends-with('sqlite3'), *.IO.f, *.IO.e))
}
my $saved_termios = Term::termios.new(fd => 0).getattr;
- END { $saved_termios.setattr(:DRAIN) }
+ LEAVE { $saved_termios.setattr(:DRAIN) }
my $termios := Term::termios.new(fd => 0).getattr;
$termios.makeraw;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment