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

Output stacks in order they were encountered #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tempfile = "3.0.3"
benfred-read-process-memory = "0.1.3"
proc-maps = "0.1"
memmap = "0.7.0"
indexmap = "1.0.2"

[target.'cfg(unix)'.dependencies]
termios = "0.2.2"
Expand Down
6 changes: 3 additions & 3 deletions src/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SOFTWARE.
*/

use std;
use std::collections::HashMap;
use indexmap::IndexMap;
use std::io::Write;
use std::fs::File;
use std::path::Path;
Expand All @@ -41,13 +41,13 @@ use stack_trace::StackTrace;
const FLAMEGRAPH_SCRIPT: &[u8] = include_bytes!("../vendor/flamegraph/flamegraph.pl");

pub struct Flamegraph {
pub counts: HashMap<Vec<u8>, usize>,
pub counts: IndexMap<Vec<u8>, usize>,
pub show_linenumbers: bool,
}

impl Flamegraph {
pub fn new(show_linenumbers: bool) -> Flamegraph {
Flamegraph { counts: HashMap::new(), show_linenumbers }
Flamegraph { counts: IndexMap::new(), show_linenumbers }
}

pub fn increment(&mut self, traces: &[StackTrace]) -> std::io::Result<()> {
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern crate nix;
#[macro_use]
extern crate log;
extern crate memmap;
extern crate indexmap;
extern crate proc_maps;
extern crate benfred_read_process_memory as read_process_memory;
extern crate regex;
Expand Down