Skip to content
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

Generate jitdump to support linux perf for LLVM JIT #2788

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

lum1n0us
Copy link
Collaborator

No description provided.

@lum1n0us lum1n0us force-pushed the enable_jitdump branch 4 times, most recently from 92a04a1 to 349ad8b Compare November 21, 2023 06:42
core/iwasm/compilation/aot_llvm.c Show resolved Hide resolved
@@ -169,6 +169,14 @@ typedef struct RuntimeInitArgs {
uint32_t llvm_jit_size_level;
/* Segue optimization flags for LLVM JIT */
uint32_t segue_flags;
/**
* If enable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had better If enabled?

@@ -99,6 +99,7 @@ print_help()
#if WASM_ENABLE_STATIC_PGO != 0
printf(" --gen-prof-file=<path> Generate LLVM PGO (Profile-Guided Optimization) profile file\n");
#endif
printf(" --perf-profile Enable linux perf support. For now, it only works in llvm-jit.\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had better wrap the line with macro: #if WASM_ENABLE_JIT !=0 ... #endif

@@ -593,6 +594,7 @@ main(int argc, char *argv[])
#if WASM_ENABLE_THREAD_MGR != 0
int timeout_ms = -1;
#endif
bool enable_linux_perf_support = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, had better wrap the code with macro WASM_ENABLE_JIT

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about putting this line after L563 uint32 segue_flags = 0;

@lum1n0us lum1n0us force-pushed the enable_jitdump branch 2 times, most recently from 2476014 to 0af902b Compare November 27, 2023 02:51
@@ -593,6 +594,7 @@ main(int argc, char *argv[])
#if WASM_ENABLE_THREAD_MGR != 0
int timeout_ms = -1;
#endif
bool enable_linux_perf_support = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about putting this line after L563 uint32 segue_flags = 0;

product-mini/platforms/posix/main.c Outdated Show resolved Hide resolved
Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

doc/perf_tune.md Outdated

### 7.1 Flamegraph

[Flamegraph](https://www.brendangregg.com/flamegraphs.html) is a powerful tool to visualize stack traces of profiled software so that the most frequent code-paths to be identified quickly and accurately. In order to use it, you need to record call graphs when running `perf record`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be or can be?

Suggested change
[Flamegraph](https://www.brendangregg.com/flamegraphs.html) is a powerful tool to visualize stack traces of profiled software so that the most frequent code-paths to be identified quickly and accurately. In order to use it, you need to record call graphs when running `perf record`
[Flamegraph](https://www.brendangregg.com/flamegraphs.html) is a powerful tool to visualize stack traces of profiled software so that the most frequent code-paths can be identified quickly and accurately. In order to use it, you need to record call graphs when running `perf record`

Copy link
Collaborator

@xujuntwt95329 xujuntwt95329 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lum1n0us lum1n0us changed the title enable jitdump for linux perf Generate jitdump to support linux perf for LLVM JIT Nov 27, 2023
@wenyongh wenyongh merged commit 8aa813f into bytecodealliance:main Nov 27, 2023
383 checks passed
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
@lum1n0us lum1n0us deleted the enable_jitdump branch May 31, 2024 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants