-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print all paths if no argument is given to twiggy paths
#63
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to a Vecir::Id rather than a BTreeSet so that the items could be sorted by size :)