mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
import-chrome: import zone metadata from "args" key
This commit is contained in:
parent
8e11cd5ebb
commit
bcbf8edd8a
1
NEWS
1
NEWS
@ -9,6 +9,7 @@ a mistake.
|
||||
v0.7 (xxxx-xx-xx)
|
||||
-----------------
|
||||
|
||||
- chrome:tracing importer now imports zone metadata from "args" key.
|
||||
- Added display of statistical mode to find zone menu.
|
||||
- Automatic stack sampling is now available on windows.
|
||||
- Properly handle tracing on long-running systems.
|
||||
|
@ -70,13 +70,23 @@ int main( int argc, char** argv )
|
||||
for( auto& v : j )
|
||||
{
|
||||
const auto type = v["ph"].get<std::string>();
|
||||
|
||||
std::string zoneText = "";
|
||||
if ( v.contains( "args" ) )
|
||||
{
|
||||
for ( auto& kv : v["args"].items() )
|
||||
{
|
||||
zoneText += kv.key() + ": " + kv.value().dump() + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
if( type == "B" )
|
||||
{
|
||||
timeline.emplace_back( tracy::Worker::ImportEventTimeline {
|
||||
v["tid"].get<uint64_t>(),
|
||||
uint64_t( v["ts"].get<double>() * 1000. ),
|
||||
v["name"].get<std::string>(),
|
||||
"",
|
||||
std::move(zoneText),
|
||||
false
|
||||
} );
|
||||
}
|
||||
@ -86,7 +96,7 @@ int main( int argc, char** argv )
|
||||
v["tid"].get<uint64_t>(),
|
||||
uint64_t( v["ts"].get<double>() * 1000. ),
|
||||
"",
|
||||
"",
|
||||
std::move(zoneText),
|
||||
true
|
||||
} );
|
||||
}
|
||||
@ -96,7 +106,7 @@ int main( int argc, char** argv )
|
||||
const auto ts0 = uint64_t( v["ts"].get<double>() * 1000. );
|
||||
const auto ts1 = v["dur"].is_object() ? ts0 + uint64_t( v["dur"].get<double>() * 1000. ) : ts0;
|
||||
const auto name = v["name"].get<std::string>();
|
||||
timeline.emplace_back( tracy::Worker::ImportEventTimeline { tid, ts0, name, "", false } );
|
||||
timeline.emplace_back( tracy::Worker::ImportEventTimeline { tid, ts0, name, std::move(zoneText), false } );
|
||||
timeline.emplace_back( tracy::Worker::ImportEventTimeline { tid, ts1, "", "", true } );
|
||||
}
|
||||
else if( type == "i" || type == "I" )
|
||||
|
Loading…
Reference in New Issue
Block a user