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

build/docs: running emulator in valgrind #4280

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

mmilata
Copy link
Member

@mmilata mmilata commented Oct 23, 2024

Some docs and ad-hoc CLI changes to make running emulator in Valgrind easier.

Depends on #4234 as otherwise the build command doesn't work.

matejcik and others added 4 commits September 30, 2024 15:10
…t passed as scons vars

so that we don't have to write "USE_FOO=$(USE_FOO)" 20 times every time
we add such flag
Here we change all FOO=VALUE defines to be tuples ("FOO", "VALUE").
Also, VALUE is always the raw string you want to end up in the C file,
instead of attempting to shell-escape it while specifying.

By all rights scons _should_ be using shlex.quote() on the CPPDEFINES,
but it doesn't, so we hack it by specifying the define prefix as `-D'`
and suffix as `'`. That way the arguments in shell are '-escaped, and
we're (currently) not using ' in any argument value so this should work
fine.

At the same time, when passing the flags to cargo, we can shlex.quote
the whole thing and get the right strings passed all the way into
build.rs -- as long as no argument contains a comma, which is the split
character...
@mmilata mmilata requested review from hiviah and M1nd3r October 23, 2024 20:28
Copy link
Contributor

@M1nd3r M1nd3r left a comment

Choose a reason for hiding this comment

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

LGTM, can be merged.

I have found only few punctuation details in the docs - fell free to ignore them.

docs/core/emulator/valgrind.md Outdated Show resolved Hide resolved
docs/core/emulator/valgrind.md Outdated Show resolved Hide resolved
@@ -0,0 +1,34 @@
# Profiling emulator with Valgrind

Sometimes it can be helpful to know which parts of your code take most of the CPU time.
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: punctuation

Suggested change
Sometimes it can be helpful to know which parts of your code take most of the CPU time.
Sometimes, it can be helpful to know which parts of your code take most of the CPU time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@hiviah hiviah left a comment

Choose a reason for hiding this comment

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

Neat. Though for me emulator dies after unlock with ERROR: rs, but seems unrelated.

@matejcik matejcik force-pushed the matejcik/scons-vars branch 7 times, most recently from 6752623 to f7d1e6c Compare November 20, 2024 13:50
@cepetr cepetr force-pushed the matejcik/scons-vars branch 2 times, most recently from 6f95dd5 to 5b2a1cf Compare November 21, 2024 12:39
Base automatically changed from matejcik/scons-vars to main November 21, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 Needs review
Development

Successfully merging this pull request may close these issues.

5 participants