Trace Labs is a Trace Compass plugin that can be used to perform analysis on system calls and performance counters.
This is a school project completed for COSC 3P99 at Brock University. See the report for more details about that.
- Download the Eclipse IDE from https://www.eclipse.org/ide
- Install Trace Compass 9.0.0 from the Eclipse Marketplace (including LTTng Kernel Analysis and LTTng Userspace Analysis)
- Install Plug-In Development Environment Latest from the Eclipse Marketplace
Note: Eclipse Marketplace can be accessed from Help > Eclipse Marketplace in the application menu. You may need to restart Eclipse several times during plugin installation.
- Clone or download this project to your computer.
- Select
File > Open Projects from File Systemin the application menu. - Click the
Directory...in theImport Projects from File System or Archivemodal window. - From the file explorer, choose the
tracelabsdirectory copied to your computer in step one. - Click the
Finishbutton in theImport Projects from File System or Archivemodal window.
- Click the
Runbutton in the Eclipse toolbar and if prompted, selectEclipse ApplicationforRun As. - From the new Eclipse window that opens, select
Window > Perspective > Open Perspective > Otherfrom the application menu. - Choose
Tracingfrom the modal window then click theOpenbutton. - From the
Project ExplorerclickCreate a new Tracing projectcalledTrace Labs Dev. - Right-click on
Trace Labs Devand selectimportfrom the context menu. - From the
Importmodal window, selectTracing > Trace Importand click theNextbutton. - From the file explorer, choose a Trace directory.
- From the
Importmodal, click the checkbox next to the name of the Trace directory then click theFinishbutton. - From the
Project Explorer, select a Kernel trace from the trace that you just imported intoTrace Labs Dev. - If prompted in the
Confirm Perspective Switchto open theLTTng Kernel perspective, click theYesbutton. - Select
Window > Show View > Otherfrom the application menu. - From the
Show Viewmodal window, open theTraceLabsfolder and selectPerformance Counters - Growth Viz,Performance Counters - Total Table,Performance Counters - Total Viz,SysCalls - Aggregated Table, andSysCalls - Table.
After following all those steps, you should be able to see all of the views under development in the Trace Labs project.
To collect traces compatible with this plug-in, you will need to run a program such as LTTng or Perf on a compatible Linux operating system. You will need to collect syscall events with fields for process id, thread id, and one or more performance counters. The resulting trace must be in Common Trace Format (CTF).
Here's an example script for using LTTng to trace syscall events on the Linux kernel while executing a wget command with all of the context required by this plug-in:
- Run
lttng createto create a new tracing session. - Run
lttng enable-event -k --syscallto create a tracing rule that will capture all Linux kernel syscall events. - Run
lttng add-context --kernel --type=pid --type=tidto add context fields to each event for the process id (pid) and thread id (tid). - Run
lttng add-context --kernel --type=perf:cpu:cpu-cycles --type=perf:cpu:cycles --type=perf:cpu:branch-instructions --type=perf:cpu:branch-missesto add context fields to each event for performance counters. - Run
lttng startto start tracing. - Execute a program and trace syscalls on the Linux kernel, i.e.
wget https://lttng.org. - Run
lttng destroyto stop tracing, destroy the tracing session, and write the results to disk in Common Trace Format (CTF).
Note: you can see all of the context that you can add to an event by running lttng add-context --list, this includes all performance counters. You cannot add context for more than four performance counters at a time.
tracelabs.models: classes for modeling trace events and collections of trace events.tracelabs.ui: Small user interface components used within views.tracelabs.views: Complete user interfaces. Each class corresponds to a single view within the plug-in.