##// END OF EJS Templates
rust: document how to enable debug information in optimized builds...
Simon Sapin -
r46756:ec14c379 default
parent child Browse files
Show More
@@ -64,6 +64,10 b' rust/*/target/'
64 64 # Generated wheels
65 65 wheelhouse/
66 66
67 syntax: rootglob
68 # See Profiling in rust/README.rst
69 .cargo/config
70
67 71 syntax: regexp
68 72 ^\.pc/
69 73 ^\.(pydev)?project
@@ -40,7 +40,7 b' Special features'
40 40 You might want to check the `features` section in ``hg-cpython/Cargo.toml``.
41 41 It may contain features that might be interesting to try out.
42 42
43 To use features from the Makefile, use the `HG_RUST_FEATURES` environment
43 To use features from the Makefile, use the `HG_RUST_FEATURES` environment
44 44 variable: for instance `HG_RUST_FEATURES="some-feature other-feature"`
45 45
46 46 Profiling
@@ -51,6 +51,14 b' a few high level rust-related performanc'
51 51 indicate why the rust code cannot be used (say, using lookarounds in
52 52 hgignore).
53 53
54 Creating a ``.cargo/config`` file with the following content enables
55 debug information in optimized builds. This make profiles more informative
56 with source file name and line number for Rust stack frames and
57 (in some cases) stack frames for Rust functions that have been inlined.
58
59 [profile.release]
60 debug = true
61
54 62 ``py-spy`` (https://github.com/benfred/py-spy) can be used to
55 63 construct a single profile with rust functions and python functions
56 64 (as opposed to ``hg --profile``, which attributes time spent in rust
@@ -58,6 +66,11 b' to some unlucky python code running shor'
58 66 as opposed to tools for native code like ``perf``, which attribute
59 67 time to the python interpreter instead of python functions).
60 68
69 Example usage:
70
71 $ make PURE=--rust local # Don't forget to recompile after a code change
72 $ py-spy record --native --output /tmp/profile.svg -- ./hg ...
73
61 74 Developing Rust
62 75 ===============
63 76
General Comments 0
You need to be logged in to leave comments. Login now