-
Notifications
You must be signed in to change notification settings - Fork 619
Open
Description
Hi - I'm having some problems trying to get a combined trace on Linux - I suspect I'm missing a configuration step or something from the docs.
This example from the documentation shows how to combine in-application and system tracing using the SDK.
Here's what I've tried:
Steps to reproduce
- Compile the following example with the Perfetto SDK -
#include <perfetto.h>
PERFETTO_DEFINE_CATEGORIES(
perfetto::Category("rendering")
.SetDescription("Events from the graphics subsystem"),
PERFETTO_TRACK_EVENT_STATIC_STORAGE();
int main(int argc, char** argv) {
perfetto::TracingInitArgs args;
args.backends |= perfetto::kSystemBackend;
perfetto::Tracing::Initialize(args);
perfetto::TrackEvent::Register();
{
TRACE_EVENT("rendering", "work");
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
TRACE_EVENT("rendering", "more_work");
return 0;
}- Run
traceboxas specified in Capturing a Trace with the following config:
buffers {
size_kb: 100024
fill_policy: RING_BUFFER
}
data_sources: {
config {
name: "linux.sys_stats"
sys_stats_config {
stat_period_ms: 1000
stat_counters: STAT_CPU_TIMES
stat_counters: STAT_FORK_COUNT
}
}
}
data_sources: {
config {
name: "track_event"
}
}
duration_ms: 30000
$ ./tracebox -o trace_file.perfetto-trace --txt -c config.cfg
-
Run the application to be traced.
-
When the
traceboxcommand exits, load the trace file into the Perfetto UI
Expected result
The track events and system events are visible in the timeline
Actual result
Only the system events are visible
Alternative steps
I also tried to run the tracebox commands separately as in example_system_wide.cc
- Run
tracebox traced - Launch the application to be traced
- Run
tracebox perfetto -o flutter.perfetto.trace --txt -c config.cfg - When the
traceboxcommand exits, load the trace file into the Perfetto UI
This time the application events were visible, but no system events were present.
How can I collect a combined trace?
Many thanks.
Metadata
Metadata
Assignees
Labels
No labels