Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/sqlite/src/tool/opcodesum.tcl

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/tool/mkvsix.tcl ('k') | third_party/sqlite/src/tool/replace.tcl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/tclsh
2 #
3 # Run this script, redirecting input from cachegrind output, to compute the
4 # number of CPU cycles used by each VDBE opcode.
5 #
6 # The cachegrind output should be configured so that it reports a single
7 # column of Ir at the left margin. Ex:
8 #
9 # cg_annotation --show=Ir --auto=yes cachegrind.out.* | tclsh opcodesum.tcl
10 #
11 set currentop x
12 set ncycle(x) 0
13 while {![eof stdin]} {
14 set line [string map {\173 x \175 x \042 x} [gets stdin]]
15 if {[regexp { \. case OP_.*:} $line]} {
16 regexp {OP_(.+):} $line all currentop
17 set ncycle($currentop) 0
18 } elseif {[lindex $line 1]=="default:"
19 && [regexp {really OP_Noop and OP_Explain} $line]} {
20 break
21 } elseif {[lindex $line 0]!="."} {
22 regsub -all {[^0-9]} [lindex $line 0] {} n
23 if {$n!=""} {incr ncycle($currentop) $n}
24 }
25 }
26 unset ncycle(x)
27 set results {}
28 foreach op [lsort [array names ncycle]] {
29 if {$ncycle($op)==0} continue
30 lappend results [list $ncycle($op) $op]
31 }
32 foreach entry [lsort -index 0 -int -decr $results] {
33 puts [format {%-16s %10d} [lindex $entry 1] [lindex $entry 0]]
34 }
OLDNEW
« no previous file with comments | « third_party/sqlite/src/tool/mkvsix.tcl ('k') | third_party/sqlite/src/tool/replace.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698