-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an -O flag to turn on optimizations
This will enable the optimizations even when debugging: see #229.
- Loading branch information
1 parent
d5bc4db
commit fdad1b3
Showing
15 changed files
with
192 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"command": "fregot", | ||
"arguments": ["repl", "--no-history-file"], | ||
"notes": [ | ||
"This actually takes fewer steps than `debug-opt` since we don't fully", | ||
"calculate the indexed comprehension." | ||
], | ||
"asserts": [ | ||
{"exit_code": 0}, | ||
{"stderr": "${GOLDPLATE_NAME}.stderr"}, | ||
{"stdout": "${GOLDPLATE_NAME}.stdout"} | ||
], | ||
"stdin": [ | ||
":load ../opt/comprehension-index.rego", | ||
":break exposed_ports_by_interface", | ||
"access_twice {exposed_ports_by_interface[\"eth0\"]; exposed_ports_by_interface[\"lo1\"]}", | ||
"access_twice", | ||
":next", | ||
":next", | ||
"mock_input.exposed[j].port", | ||
":next", | ||
"mock_input.exposed[j].port", | ||
":next", | ||
":next", | ||
":next", | ||
":next", | ||
":next" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
F u g u e R E G O T o o l k i t | ||
fregot v0.12.3 repl - use :help for usage info | ||
Loading ../opt/comprehension-index.rego... | ||
Loaded package comprehension_index | ||
Set breakpoint at comprehension_index.exposed_ports_by_interface | ||
Rule access_twice added | ||
Not paused | ||
Not paused | ||
Not paused |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
repl% comprehension_index% comprehension_index% comprehension_index% 32| intf := mock_input.exposed[i].interface | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% 35| mock_input.exposed[j].interface = intf | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% 36| port := mock_input.exposed[j].port | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% = 8080 | ||
| j = 0 | ||
| i = 0 | ||
| intf = "eth0" | ||
comprehension_index(debug)% 36| port := mock_input.exposed[j].port | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% = 8081 | ||
| j = 1 | ||
| i = 0 | ||
| intf = "eth0" | ||
comprehension_index(debug)% 1| access_twice {exposed_ports_by_interface["eth0"]; exposed_ports_by_interface["lo1"]} | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% (debug) = true | ||
(debug) finished | ||
comprehension_index% comprehension_index% comprehension_index% comprehension_index% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"notes": [ | ||
"This actually takes more steps than `debug-noopt` since we fully", | ||
"calculate the indexed comprehension! But that is what we're testing." | ||
], | ||
"command": "fregot", | ||
"arguments": ["repl", "-O", "--no-history-file"], | ||
"asserts": [ | ||
{"exit_code": 0}, | ||
{"stderr": "${GOLDPLATE_NAME}.stderr"}, | ||
{"stdout": "${GOLDPLATE_NAME}.stdout"} | ||
], | ||
"stdin": [ | ||
":load ../opt/comprehension-index.rego", | ||
":break exposed_ports_by_interface", | ||
"access_twice {exposed_ports_by_interface[\"eth0\"]; exposed_ports_by_interface[\"lo1\"]}", | ||
"access_twice", | ||
":next", | ||
":next", | ||
"mock_input.exposed[j].port", | ||
":next", | ||
"mock_input.exposed[j].port", | ||
":next", | ||
"mock_input.exposed[j].port", | ||
":next", | ||
"mock_input.exposed[j].port", | ||
":next", | ||
":next", | ||
":next" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
F u g u e R E G O T o o l k i t | ||
fregot v0.12.3 repl - use :help for usage info | ||
Loading ../opt/comprehension-index.rego... | ||
Loaded package comprehension_index | ||
Set breakpoint at comprehension_index.exposed_ports_by_interface | ||
Rule access_twice added | ||
Not paused |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
repl% comprehension_index% comprehension_index% comprehension_index% 32| intf := mock_input.exposed[i].interface | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% 35| mock_input.exposed[j].interface = intf | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% 36| port := mock_input.exposed[j].port | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% = 8080 | ||
| j = 0 | ||
| intf = "eth0" | ||
comprehension_index(debug)% 36| port := mock_input.exposed[j].port | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% = 8081 | ||
| j = 1 | ||
| intf = "eth0" | ||
comprehension_index(debug)% 36| port := mock_input.exposed[j].port | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% = 443 | ||
| j = 2 | ||
| intf = "eth1" | ||
comprehension_index(debug)% 36| port := mock_input.exposed[j].port | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% = 5000 | ||
| j = 3 | ||
| intf = "lo1" | ||
comprehension_index(debug)% 1| access_twice {exposed_ports_by_interface["eth0"]; exposed_ports_by_interface["lo1"]} | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
comprehension_index(debug)% (debug) = true | ||
(debug) finished | ||
comprehension_index% comprehension_index% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters