Skip to content

Commit

Permalink
add support of AsyncProfiler generated stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderEnder committed Jun 22, 2020
1 parent bcd8fc2 commit a411e0f
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/flamegraph/color/palettes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ pub(super) mod java {
name
};

if java_prefix.starts_with("java/")
|| java_prefix.starts_with("javax/")
|| java_prefix.starts_with("jdk/")
|| java_prefix.starts_with("net/")
|| java_prefix.starts_with("org/")
|| java_prefix.starts_with("com/")
|| java_prefix.starts_with("io/")
|| java_prefix.starts_with("sun/")
if name.contains("::") || name.starts_with("-[") || name.starts_with("+[") {
// C++ or Objective C
BasicPalette::Yellow
} else if java_prefix.contains("/")
|| (java_prefix.contains(".") && !java_prefix.starts_with("["))
|| match java_prefix.chars().next() {
Some(c) => c.is_ascii_uppercase(),
_ => false,
}
{
// Java
BasicPalette::Green
} else if name.contains("::") {
// C++
BasicPalette::Yellow
} else {
// system
BasicPalette::Red
Expand Down Expand Up @@ -269,11 +267,11 @@ mod tests {
},
TestData {
input: String::from("jdk/::[ki]"),
output: BasicPalette::Green,
output: BasicPalette::Yellow,
},
TestData {
input: String::from("Ajdk/_[ki]"),
output: BasicPalette::Red,
output: BasicPalette::Green,
},
TestData {
input: String::from("Ajdk/::[ki]"),
Expand Down

0 comments on commit a411e0f

Please sign in to comment.