Commit Graph

9 Commits

Author SHA1 Message Date
Emery Berger
d8e2e5efab Updated. 2023-07-01 16:41:36 -04:00
Emery Berger
cb12a722db
Merge pull request #214 from lopukhov/master
[Rust] Remove thread_init
2023-07-01 13:45:29 -04:00
Emery Berger
73af6f7f58
Update README.md
Added `--examples` flag and added a few other updates.
2023-06-30 16:22:46 -04:00
lopukhov
d5fd936960 Remove thread_init 2023-01-13 11:26:14 +00:00
lopukhov
d885444276 Replace the usage of AtomicUsize with OneCell clarifying the usage of unsafe in the process.
- Using `usize` or `AtomicUsize` to store pointers is not recommended following the reasons detailed in the "strict provenance" proposal
 - Using an explicit function type and `Option` is more idiomatic
 - `OneCell` was already being used and it "tracks" in a more explicit way the uninitialized state of the pointer
2022-12-26 16:16:48 +01:00
siedentop
86fc9b13c8
Rust: Document scope in favor of begin/end. 2020-06-09 20:55:56 -07:00
Bernhard Schuster
b8625be5ba
chore/rust: prep a new release 2020-04-09 10:32:16 +02:00
Leonhard Markert
26eda4b763 Fix README typos 2019-11-21 11:18:34 +01:00
Alex Crichton
2f12e6e4f3 Add a Rust implementation of coz.h
After seeing a recording of Emery's recent talk at Strange Loop I was
super impressed with `coz` and immediately wanted to try it out with
Rust code! I was curious to see if `coz` could help us out with
profiling either Cargo, Rust's build system, or perhaps the compiler
itself, `rustc`. In any case I ended up creating
https://github.com/alexcrichton/coz-rs as a repository to house an
implementation of `coz.h` for Rust so `coz` could be used to easily work
with Rust executables.

I toyed around a bit and Emery [mentioned] that this would be good
support to have upstream once it's working, and I think it's working
now! I haven't been able to get a ton of useful results myself yet, but
I'm still figuring out the best way to ask `coz` questions and the best
way to instrument programs myself.

Nonetheless I think that the Rust support here is correct in the sense
that it's a faithful translation of `coz.h`, and now it's just a problem
with me learning how best to instrument programs.

This commit adds a new `rust` directory with a crate (Rust parlance for
"library") which provides macros that allow using `coz` instrumentation
similar as you would in C, except in idiomatic Rust style. I've
published the crate on Rust's package registry, crates.io, as
[`coz`][crate], and I don't mind keeping it there or transferring it to
y'all, whichever you'd prefer! I also don't mind being on the hook for
reviewing any Rust-related changes, or if y'all need to jettison the
Rust support in the future I don't mind that either and can give it a
home!

[mentioned]: https://github.com/alexcrichton/coz-rs/issues/2
[crate]: https://crates.io/crates/coz
2019-09-25 11:07:44 -07:00