Conversation
|
Good! Please fix the CI and sign-off. (You could sign off a commit through |
abdc3d2 to
116668a
Compare
This is needed for windows support. Though the windows implementation is currently blank. It compiles and runs on windows and linux, but I haven't tested macos. Signed-off-by: Christian Jordan <svorre2304@gmail.com>
Signed-off-by: Christian Jordan <svorre2304@gmail.com>
they were moved into nix_impl/profiler in previous commit Signed-off-by: Christian Jordan <svorre2304@gmail.com>
Signed-off-by: Christian Jordan <svorre2304@gmail.com>
To make clippy happy the .unwrap on write! shouldn't fail Signed-off-by: Christian Jordan <svorre2304@gmail.com>
Signed-off-by: Christian Jordan <svorre2304@gmail.com>
116668a to
20c4ad7
Compare
Makes clippy happy Signed-off-by: Christian Jordan <svorre2304@gmail.com>
src/platform/nix_impl/profiler.rs
Outdated
| use crate::profiler::PROFILER; | ||
| use crate::{MAX_DEPTH, MAX_THREAD_NAME}; | ||
|
|
||
| pub fn register() -> Result<()> { |
There was a problem hiding this comment.
How about impl register in a trait? See /src/backtrace/mod.rs: trait Trace. We'll need to tell the developers which functions are needed to add a new Profiler (for different platform, or implementation)
src/report.rs
Outdated
| use parking_lot::RwLock; | ||
|
|
||
| use crate::frames::{Frames, UnresolvedFrames}; | ||
| use crate::platform::timer::ReportTiming; |
There was a problem hiding this comment.
Also, add a trait for ReportTiming, to tell the developers that it should implement Clone, and has a .get_frequency(), .get_duration() and .get_start_time() 🤔 .
|
Thanks for your contribution again. You've done a really good job 🍻 . I was also thinking about adding more sampling methods (like add sampling methods based on |
+ moved write_thread_name_fallback into profiler, since it's platform agnostic Signed-off-by: Christian Jordan <svorre2304@gmail.com>
b4cb45d to
c855009
Compare
Signed-off-by: Christian Jordan <svorre2304@gmail.com>
5f75b2f to
e9f8cf7
Compare
|
I'm not sure what to do with ReportTiming since it currently just stores some info. I've made a trait for Timer instead that has a start and stop. let me know if anything should change. |
|
I run the unit tests and examples on macos aarch64. Everything works fine as usual under both the dwarf and fp modes. There are some unimportant warnings about unused functions in tests. I can fix them for you later. |
| criterion = {version = "0.3", optional = true} | ||
| criterion = { version = "0.3", optional = true } | ||
|
|
||
| [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies] |
There was a problem hiding this comment.
Perhaps it's better to use more generic and inclusive template unless some other UNIX targets but tested linux and macos may fail
[target.'cfg(target_family = "unix")'.dependencies]
Rest of the code looks good
| NixError(#[from] nix::Error), | ||
| OsError(i32), | ||
|
|
||
| #[cfg(any(target_os = "linux", target_os = "macos"))] |
There was a problem hiding this comment.
[target.'cfg(target_family = "unix")'.dependencies]
| @@ -0,0 +1,49 @@ | |||
| #[cfg(any(target_os = "linux", target_os = "macos"))] | |||
There was a problem hiding this comment.
[target.'cfg(target_family = "unix")'.dependencies]
| pub use backtrace_rs::Trace as TraceImpl; | ||
| } | ||
|
|
||
| #[cfg(any(target_os = "linux", target_os = "macos"))] |
There was a problem hiding this comment.
[target.'cfg(target_family = "unix")'.dependencies]
|
I also tested as a dependency with our project and it compiles just fine. The target was Didn't have time to actually generate graph, but think it shall be fine as well. Will try tomorrow. |
|
Ah... actually flamegraphs functionality is still unimplemented on win :) |
|
@maksymsur pprof = { git = "https://github.com/Jardynq/pprof-rs/", branch = "windows-support", features = [
"flamegraph",
] }Though it's probably going to be a while before an actual release with windows support. |
|
Hi @maksymsur, @Jardynq is this now pending on Windows support for flamegraph? Would it be possible to move this along before that's fully resolved to get a fix for #151 ? |
|
Hi @maksymsur, @Jardynq, is there anything I can do to help this move along? |
|
I would also be interested in helping if someone could explain me the basics :) |
|
Hi @dveeden @AntoniosBarotsis sorry for late reply! |
Separated platform specific implementation into separate files.
This is needed for windows support.
Though the windows implementation is currently blank.
It compiles and runs on windows and linux, but I haven't tested macos.