-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit solves #57. The
twiggy paths
will now print all paths if
no arguments are given. In adittion, there is now a descending flag that can be used to move down rather than up the retaining paths.
- Loading branch information
Showing
11 changed files
with
309 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Shallow Bytes │ Shallow % │ Retaining Paths | ||
───────────────┼───────────┼──────────────────────────────── | ||
5 ┊ 3.47% ┊ calledOnce | ||
┊ ┊ ⬑ func[0] | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" |
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,13 @@ | ||
Shallow Bytes │ Shallow % │ Retaining Paths | ||
───────────────┼───────────┼──────────────────────────────────────── | ||
5 ┊ 3.47% ┊ calledTwice | ||
┊ ┊ ⬑ func[1] | ||
┊ ┊ ⬑ bark | ||
┊ ┊ ⬑ func[2] | ||
┊ ┊ ⬑ export "bark" | ||
┊ ┊ ⬑ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" |
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,81 @@ | ||
Shallow Bytes │ Shallow % │ Retaining Paths | ||
───────────────┼───────────┼──────────────────────────────────────── | ||
44 ┊ 30.56% ┊ "function names" subsection | ||
8 ┊ 5.56% ┊ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
7 ┊ 4.86% ┊ export "awoo" | ||
7 ┊ 4.86% ┊ export "bark" | ||
7 ┊ 4.86% ┊ export "woof" | ||
5 ┊ 3.47% ┊ calledOnce | ||
┊ ┊ ⬑ func[0] | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
5 ┊ 3.47% ┊ calledTwice | ||
┊ ┊ ⬑ func[1] | ||
┊ ┊ ⬑ bark | ||
┊ ┊ ⬑ func[2] | ||
┊ ┊ ⬑ export "bark" | ||
┊ ┊ ⬑ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
5 ┊ 3.47% ┊ bark | ||
┊ ┊ ⬑ func[2] | ||
┊ ┊ ⬑ export "bark" | ||
┊ ┊ ⬑ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
5 ┊ 3.47% ┊ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
4 ┊ 2.78% ┊ type[0] | ||
┊ ┊ ⬑ func[0] | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
┊ ┊ ⬑ func[1] | ||
┊ ┊ ⬑ bark | ||
┊ ┊ ⬑ func[2] | ||
┊ ┊ ⬑ export "bark" | ||
┊ ┊ ⬑ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
┊ ┊ ⬑ func[2] | ||
┊ ┊ ⬑ export "bark" | ||
┊ ┊ ⬑ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
1 ┊ 0.69% ┊ func[0] | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
1 ┊ 0.69% ┊ func[1] | ||
┊ ┊ ⬑ bark | ||
┊ ┊ ⬑ func[2] | ||
┊ ┊ ⬑ export "bark" | ||
┊ ┊ ⬑ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
┊ ┊ ⬑ woof | ||
┊ ┊ ⬑ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
1 ┊ 0.69% ┊ func[2] | ||
┊ ┊ ⬑ export "bark" | ||
┊ ┊ ⬑ awoo | ||
┊ ┊ ⬑ func[4] | ||
┊ ┊ ⬑ export "awoo" | ||
1 ┊ 0.69% ┊ func[3] | ||
┊ ┊ ⬑ export "woof" | ||
1 ┊ 0.69% ┊ func[4] | ||
┊ ┊ ⬑ export "awoo" |
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,30 @@ | ||
Shallow Bytes │ Shallow % │ Retaining Paths | ||
───────────────┼───────────┼────────────────────────────────────── | ||
44 ┊ 30.56% ┊ "function names" subsection | ||
7 ┊ 4.86% ┊ export "awoo" | ||
┊ ┊ ↳ func[4] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ awoo | ||
┊ ┊ ↳ func[2] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ bark | ||
┊ ┊ ↳ func[1] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ calledTwice | ||
7 ┊ 4.86% ┊ export "bark" | ||
┊ ┊ ↳ func[2] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ bark | ||
┊ ┊ ↳ func[1] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ calledTwice | ||
7 ┊ 4.86% ┊ export "woof" | ||
┊ ┊ ↳ func[3] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ woof | ||
┊ ┊ ↳ func[0] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ calledOnce | ||
┊ ┊ ↳ func[1] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ calledTwice |
15 changes: 15 additions & 0 deletions
15
twiggy/tests/expectations/paths_test_default_output_desc_with_depth
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,15 @@ | ||
Shallow Bytes │ Shallow % │ Retaining Paths | ||
───────────────┼───────────┼──────────────────────────── | ||
44 ┊ 30.56% ┊ "function names" subsection | ||
7 ┊ 4.86% ┊ export "awoo" | ||
┊ ┊ ↳ func[4] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ awoo | ||
7 ┊ 4.86% ┊ export "bark" | ||
┊ ┊ ↳ func[2] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ bark | ||
7 ┊ 4.86% ┊ export "woof" | ||
┊ ┊ ↳ func[3] | ||
┊ ┊ ↳ type[0] | ||
┊ ┊ ↳ woof |
File renamed without changes.
Binary file not shown.
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,50 @@ | ||
(module | ||
;; ------------------------------------------------------------------------ | ||
;; This is a WebAssembly text file that can be compiled in a wasm module to | ||
;; test the `twiggy paths` command. This intends to provide a non-trivial | ||
;; structure of call paths for testing purposes. | ||
;; | ||
;; The call path is shown in the ascii diagram below with exported | ||
;; functions enclosed in braces, and unexported functions in quotes. | ||
;; | ||
;; [awoo] | ||
;; | | ||
;; v | ||
;; [woof] [bark] | ||
;; | | | | ||
;; | -------- | | ||
;; | | | | ||
;; v v v | ||
;; 'calledOnce' 'calledTwice' | ||
;; ------------------------------------------------------------------------ | ||
;; NOTE: The test cases expect that this module is compiled with debug | ||
;; names written to the binary file, which affects the size percentages. | ||
;; Compile this file using the following command: | ||
;; | ||
;; wat2wasm --debug-names paths_test.wat -o paths_test.wasm | ||
;; ------------------------------------------------------------------------- | ||
|
||
|
||
;; This function is called once, by 'woof'. | ||
(func $calledOnce (result i32) | ||
i32.const 1) | ||
|
||
;; This function is called twice, by 'bark' and 'woof'. | ||
(func $calledTwice (result i32) | ||
i32.const 2) | ||
|
||
(func $bark (result i32) | ||
call $calledTwice) | ||
|
||
(func $woof (result i32) | ||
call $calledOnce | ||
call $calledTwice | ||
i32.add) | ||
|
||
(func $awoo (result i32) | ||
call $bark) | ||
|
||
(export "awoo" (func $awoo)) | ||
(export "bark" (func $bark)) | ||
(export "woof" (func $woof)) | ||
) |
Oops, something went wrong.