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 System
in the application menu. - Click the
Directory...
in theImport Projects from File System or Archive
modal window. - From the file explorer, choose the
tracelabs
directory copied to your computer in step one. - Click the
Finish
button in theImport Projects from File System or Archive
modal window.
- Click the
Run
button in the Eclipse toolbar and if prompted, selectEclipse Application
forRun As
. - From the new Eclipse window that opens, select
Window > Perspective > Open Perspective > Other
from the application menu. - Choose
Tracing
from the modal window then click theOpen
button. - From the
Project Explorer
clickCreate a new Tracing project
calledTrace Labs Dev
. - Right-click on
Trace Labs Dev
and selectimport
from the context menu. - From the
Import
modal window, selectTracing > Trace Import
and click theNext
button. - From the file explorer, choose a Trace directory.
- From the
Import
modal, click the checkbox next to the name of the Trace directory then click theFinish
button. - From the
Project Explorer
, select a Kernel trace from the trace that you just imported intoTrace Labs Dev
. - If prompted in the
Confirm Perspective Switch
to open theLTTng Kernel perspective
, click theYes
button. - Select
Window > Show View > Other
from the application menu. - From the
Show View
modal window, open theTraceLabs
folder 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 create
to create a new tracing session. - Run
lttng enable-event -k --syscall
to create a tracing rule that will capture all Linux kernel syscall events. - Run
lttng add-context --kernel --type=pid --type=tid
to 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-misses
to add context fields to each event for performance counters. - Run
lttng start
to start tracing. - Execute a program and trace syscalls on the Linux kernel, i.e.
wget https://lttng.org
. - Run
lttng destroy
to 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.