Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Trace Compass » How to set PTID in Trace Compass (Control Flow view)
How to set PTID in Trace Compass [message #1854668] Thu, 01 September 2022 23:27 Go to next message
Shlomi Lalush is currently offline Shlomi LalushFriend
Messages: 4
Registered: August 2022
Junior Member
Hello Everyone,

I am writing a process in C with multiple threads (under Linux) that are created from the main thread with POSIX API pthread_create.

I am using lttng kernel events and Trace Compass to analyze the process
threads utilization.

I would like to present in the Trace Compass Control Flow view all my process threads names under my process name in the process tree.

I understand that for that I need to set the PTID (which is empty) but I don't know how to do that since in Linux all threads are peers and there is no parent thread ID.

Is anyone know how to set the PTID column in the Control Flow view in Trace Compass?

The lttng commands for my session
lttng create mySession
lttng enable-event -k sched_'*'
lttng enable-event -k timer_hrtimer_'*'
lttng add-context -k -t tid -t pid -t vpid -t procname -t ppid
lttng start
lttng stop
lttng save

Thanks,
Shlomi
Re: How to set PTID in Trace Compass [message #1854693 is a reply to message #1854668] Fri, 02 September 2022 13:41 Go to previous messageGo to next message
Matthew Khouzam is currently offline Matthew KhouzamFriend
Messages: 13
Registered: March 2011
Junior Member

Hi Shlomi,

This is a pretty silly request I have... I kind of remember wildcards not needing the single quote.

could you try this?

Please note that you don't need the contexts so your trace should be much lighterweight.
lttng create mySession
lttng enable-event -k lttng_* // for state dumps
lttng enable-event -k sched_* // for tid, pid, ppid and all
lttng enable-event -k timer_hrtimer_* // for timer stuff and critical path
(You may want IRQ too?)
lttng start
./myApplication
lttng stop
 

and see if that works?

Also, if I may, I have stopped using LTTng tools directly, but I use a wrapper here https://github.com/tahini/lttng-utils

My quality of life has improved since then.

Please tell me if these steps help

Also, which version of Trace Compass are you using?

BR
Matthew

[Updated on: Fri, 02 September 2022 13:43]

Report message to a moderator

Re: How to set PTID in Trace Compass [message #1854720 is a reply to message #1854693] Sat, 03 September 2022 21:10 Go to previous message
Shlomi Lalush is currently offline Shlomi LalushFriend
Messages: 4
Registered: August 2022
Junior Member
Thanks Matthew, it work! :)

Do you know why it works only when I start recording the session before I run my app?

I uploaded two files that show how it looks in Control Flow view in both cases.
1. capture.png - First start recording lttng session and then my app
2. capture2.png - Run my app and then lttng session.

Thanks, I need IRQ's as well.

I am using Trace Compass version 8.0.0.

Thanks, I will take a look on this lttng-utils.

Also, can you think of a reason why I see usermode (green) on my threads
only when they run on CPU0 but not when they run on CPU1?
Can it be something related to the way I defined the lttng recording session?

Thank you Matthew, it really helps.


  • Attachment: Capture.PNG
    (Size: 8.85KB, Downloaded 44 times)
  • Attachment: Capture2.PNG
    (Size: 8.65KB, Downloaded 43 times)

[Updated on: Mon, 05 September 2022 20:46]

Report message to a moderator

Previous Topic:Cross Platform Analysis
Next Topic:Automatic traces analysis
Goto Forum:
  


Current Time: Sat Apr 20 01:34:24 GMT 2024

Powered by FUDForum. Page generated in 0.02549 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top