Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] State System Information Retrieval Question

Hi Ben

thanks for the interest in Trace Compass. It's possible to an existing state system and query the content. See below a example on how to use the kernel state system. It reads and prints the state system start and end time, gets the quarks for the exec names and does a single query. It does not do what you'd like to achieve but I hope it gets you started.

Best Regards
Bernd

------------------------------------------------------------------------------------

// Load the proper modules
loadModule("/TraceCompass/Trace")
loadModule("/TraceCompass/Analysis")

// Get the active trace
var trace = getActiveTrace()

// Get an analysis
var analysis = getTraceAnalysis(trace, "org.eclipse.tracecompass.analysis.os.linux.kernel")
// Get the analysis's state system so we can fill it, false indicates to create a new state system even if one already exists
var ss = analysis.getStateSystem();

// Get start and end time
var start = ss.getStartTime();
var end = ss.getCurrentEndTime();
print("start: " + start)
print("end: " + end)

// Get the Exec_name quarks
var quarks = ss.getQuarks(-1, "Threads", "*", "Exec_name")
print (quarks.get(0))

// Get interval of first quark at trace start time
var interval = ss.querySingleState(start, quarks.get(0))
print (interval)


From: tracecompass-dev <tracecompass-dev-bounces@xxxxxxxxxxx> on behalf of Ben Grandy <bengrandy98@xxxxxxxxx>
Sent: March 29, 2023 5:58 PM
To: tracecompass-dev@xxxxxxxxxxx <tracecompass-dev@xxxxxxxxxxx>
Subject: [tracecompass-dev] State System Information Retrieval Question
 
Hello,

I have a question about retrieving state information using EASE scripting for Trace Compass. I want to retrieve the PID/TID of the process/thread that was interrupted by an IRQ. My idea was to get the event iterator and filter for the IRQ event handlers which holds the value of the CPU it's running on. Then query the state system to retrieve the Current_thread of the interrupted CPU. I'm having difficulties retrieving the state system even though I can see it in the state system explorer. When retrieving the information should I use the queryFullState method or the getTraceAnalysis() method with the parameters: myTrace, "Linux Kernel"? When using the queryFullState() method I have issues getting the specific information I'm looking for and when using the getTraceAnalysis method I receive an empty analysis.

Any help would be greatly appreciated.

Thanks,
Ben 

Back to the top