diff --git a/import-chrome/src/import-chrome.cpp b/import-chrome/src/import-chrome.cpp index 2e3a41c2..d1670210 100644 --- a/import-chrome/src/import-chrome.cpp +++ b/import-chrome/src/import-chrome.cpp @@ -56,6 +56,17 @@ int main( int argc, char** argv ) std::vector timeline; std::vector messages; + if( j.is_object() && j.contains( "traceEvents" ) ) + { + j = j["traceEvents"]; + } + + if( !j.is_array() ) + { + fprintf( stderr, "Input must be either an array of events or an object containing an array of events under \"traceEvents\" key.\n" ); + exit( 1 ); + } + for( auto& v : j ) { const auto type = v["ph"].get();