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

Full color support #32

Merged
merged 77 commits into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
2066e5c
Implementing color support.
JordiChauzi Feb 3, 2019
18c4fda
Fixing typo in color output + Fixing error in palette.map sort + Smal…
Feb 4, 2019
938f57e
Update src/flamegraph/color.rs
jonhoo Feb 4, 2019
197431c
Update src/flamegraph/color.rs
jonhoo Feb 4, 2019
8a24ad9
Update src/flamegraph/mod.rs
jonhoo Feb 4, 2019
d500068
Some of the modifications needed for pull request#32:
JordiChauzi Feb 4, 2019
c70f667
Call to rustfmt
Feb 4, 2019
b0cd1ae
Fixing clippy warnings
Feb 5, 2019
11ebe11
Adding comment in hashname to explain the difference with the perl im…
Feb 5, 2019
e25e449
Separating basic and multi palettes to clarify color choice
Feb 5, 2019
b0a98a8
Adding comment to explain why we sort the palette map entries before …
Feb 5, 2019
2ee9ca7
Reverting change unrelated to color support
Feb 5, 2019
d891ec2
Adding StyleOptions structure to aggregate svg style options
Feb 5, 2019
b27f79d
simplifying use statement for StyleOptions
Feb 5, 2019
6251c05
Hoisting the ends_with 'j' up in the js palette resolve function
Feb 5, 2019
40386d5
Deriving Clone, Copy for Palette enum
Feb 5, 2019
e221f90
Removing new function for StyleOptions
Feb 5, 2019
ad146b6
Moving palette resolve functions to a separate module.
Feb 5, 2019
22b135b
Instantiating a ThreadRng once outside the outer loop, and passing it…
Feb 5, 2019
2c486fe
Removing Chain palette completely for now.
Feb 5, 2019
4a774c8
Moving palettes as a submodule of color
Feb 5, 2019
1ea6887
Moving palette_map functions in submodule of color
Feb 6, 2019
44cb22e
Creating a PaletteMap struct and adding load/save/find_color in assoc…
Feb 6, 2019
7383d25
Fixing namehash computation + using an iterator as argument to avoid …
Feb 6, 2019
01dacc3
Getting rid of the modulo > 12 check by taking only 3 characters (and…
Feb 6, 2019
3395d1d
Add un-inline support using addr2line (#14)
jasonrhansen Feb 5, 2019
ee3963d
Use log crate in flamegraph module (#36)
jasonrhansen Feb 5, 2019
aa14a1f
Support working with multiple collapsed files #28 (#35)
jasonrhansen Feb 5, 2019
c5eba69
Fixing typo after rebase
JordiChauzi Feb 10, 2019
a79fb71
Storing colors as (u8, u8, u8)
JordiChauzi Feb 10, 2019
00535c3
Using Cow<str> to store function names in palette map
JordiChauzi Feb 10, 2019
fc6936a
Fixing error in namehash where we took 4 characters to compute the hash
JordiChauzi Feb 10, 2019
81dd7d7
Adding unit tests for namehash
JordiChauzi Feb 10, 2019
c41f7f1
Implementing color support.
JordiChauzi Feb 3, 2019
c2e96c5
Fixing typo in color output + Fixing error in palette.map sort + Smal…
Feb 4, 2019
ca9c325
Update src/flamegraph/color.rs
jonhoo Feb 4, 2019
c931b5a
Update src/flamegraph/color.rs
jonhoo Feb 4, 2019
65960bb
Update src/flamegraph/mod.rs
jonhoo Feb 4, 2019
76aaebe
Some of the modifications needed for pull request#32:
JordiChauzi Feb 4, 2019
2f49469
Call to rustfmt
Feb 4, 2019
597cdce
Fixing clippy warnings
Feb 5, 2019
cc44666
Adding comment in hashname to explain the difference with the perl im…
Feb 5, 2019
abb6c7d
Separating basic and multi palettes to clarify color choice
Feb 5, 2019
7084dcc
Adding comment to explain why we sort the palette map entries before …
Feb 5, 2019
5b6244d
Adding StyleOptions structure to aggregate svg style options
Feb 5, 2019
824d94e
simplifying use statement for StyleOptions
Feb 5, 2019
9587bba
Hoisting the ends_with 'j' up in the js palette resolve function
Feb 5, 2019
04f5fc9
Deriving Clone, Copy for Palette enum
Feb 5, 2019
9291f64
Removing new function for StyleOptions
Feb 5, 2019
44a1f03
Moving palette resolve functions to a separate module.
Feb 5, 2019
c1dae1c
Instantiating a ThreadRng once outside the outer loop, and passing it…
Feb 5, 2019
828df84
Removing Chain palette completely for now.
Feb 5, 2019
d7cca6f
Moving palettes as a submodule of color
Feb 5, 2019
e990908
Moving palette_map functions in submodule of color
Feb 6, 2019
fac5191
Creating a PaletteMap struct and adding load/save/find_color in assoc…
Feb 6, 2019
72b62f1
Fixing namehash computation + using an iterator as argument to avoid …
Feb 6, 2019
a942484
Getting rid of the modulo > 12 check by taking only 3 characters (and…
Feb 6, 2019
f6fa239
Add un-inline support using addr2line (#14)
jasonrhansen Feb 5, 2019
ff9c34a
Fixing typo after rebase
JordiChauzi Feb 10, 2019
ff9625b
Storing colors as (u8, u8, u8)
JordiChauzi Feb 10, 2019
1c21eca
Using Cow<str> to store function names in palette map
JordiChauzi Feb 10, 2019
eba2d52
Fixing error in namehash where we took 4 characters to compute the hash
JordiChauzi Feb 10, 2019
3f11a03
Adding unit tests for namehash
JordiChauzi Feb 10, 2019
36de544
Merging master changes
JordiChauzi Feb 10, 2019
fc90fd0
Fixing bug when parsing rgb string
JordiChauzi Feb 10, 2019
76db4f4
Merge branch 'master' of https://github.com/JordiChauzi/inferno into …
JordiChauzi Feb 19, 2019
d5fb584
Improve java method matching (as done in upstream, commit 7700f16ecac…
JordiChauzi Feb 19, 2019
eefd6c4
Color improvment following upstream change (Colors #197)
JordiChauzi Feb 19, 2019
6c99de8
Fixing nameattr test with deterministic color choice
JordiChauzi Feb 19, 2019
d129e9b
Adding integration test for color features
JordiChauzi Feb 19, 2019
58dcec5
Refactoring from_sorted_lines a little by putting all attributes over…
JordiChauzi Feb 19, 2019
0740fa7
cargo fmt
JordiChauzi Feb 19, 2019
28c7425
Simplifying some flamegraph::Options initialization in tests.
JordiChauzi Feb 20, 2019
96a0f51
Fixing discrepency with flamegraph.pl behavior when coloring an empty…
JordiChauzi Feb 20, 2019
df75357
Merge branch 'master' of https://github.com/JordiChauzi/inferno into …
JordiChauzi Feb 20, 2019
fbf8e71
more java matching (following upstream)
JordiChauzi Feb 20, 2019
4a7f874
Merge branch 'master' into full_color_support
JordiChauzi Feb 20, 2019
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
137 changes: 134 additions & 3 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 @@ -32,6 +32,7 @@ pretty_toa = "1.0.0"
str_stack = "0.1"
addr2line = "0.8"
indexmap = "1.0"
rand = "0.6.5"

[dev-dependencies]
pretty_assertions = "0.5"
Expand Down
25 changes: 24 additions & 1 deletion src/bin/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::io::{self, BufReader, Read};
use std::path::PathBuf;
use structopt::StructOpt;

use inferno::flamegraph::{self, Direction, FuncFrameAttrsMap, Options};
use inferno::flamegraph::{self, BackgroundColor, Direction, FuncFrameAttrsMap, Options, Palette};

#[derive(Debug, StructOpt)]
#[structopt(name = "inferno-flamegraph", author = "")]
Expand All @@ -21,6 +21,25 @@ struct Opt {
/// Collapsed perf output files. With no INFILE, or INFILE is -, read STDIN.
#[structopt(name = "INFILE", parse(from_os_str))]
infiles: Vec<PathBuf>,
/// set color palette
#[structopt(
short = "c",
long = "colors",
default_value = "hot",
raw(
possible_values = r#"&["hot","mem","io","wakeup","java","js","perl","red","green","blue","aqua","yellow","purple","orange"]"#
)
)]
colors: Palette,
/// set background colors. Gradient choices are yellow (default), blue, green, grey; flat colors use "#rrggbb"
#[structopt(long = "bgcolors")]
bgcolors: Option<BackgroundColor>,
/// colors are keyed by function name hash
#[structopt(long = "hash")]
hash: bool,
/// use consistent palette (palette.map)
jonhoo marked this conversation as resolved.
Show resolved Hide resolved
#[structopt(long = "cp")]
cp: bool,
}

impl Into<Options> for Opt {
Expand All @@ -43,6 +62,10 @@ impl Into<Options> for Opt {
"Flame Graph".to_string()
};
Options {
colors: self.colors,
bgcolors: self.bgcolors,
hash: self.hash,
consistent_palette: self.cp,
func_frameattrs,
direction,
title,
Expand Down
Loading