pidin ttimes

How is the information for pidin ttimes gathered? Does the kernel record the
times whenever a new thread is scheduled, or is there a sampling of the
active thread when a clock tick expires, or some other mechanism? We’d like
to use the ttime info for evaluating which threads in our application are
using how many cpu cycles, but don’t know if it reliably conveys the right
information.

Thanks,

Marty Doane
Siemens Dematic

“Marty Doane” <marty.doane@rapistan.com> wrote in message
news:aj8cuk$bip$1@inn.qnx.com

How is the information for pidin ttimes gathered? Does the kernel record
the
times whenever a new thread is scheduled, or is there a sampling of the
active thread when a clock tick expires, or some other mechanism? We’d
like
to use the ttime info for evaluating which threads in our application are
using how many cpu cycles, but don’t know if it reliably conveys the right
information.

The time is updated on tick, to both the thread (and the process it’s bound
to). I believe Rob Krten wrote a tool called sysmon (and I think the source
is available), and the hogs utility is another example (contact your sales
rep for more details on getting source for hogs).

As a side note: using time under Neutrino gets tricky, since we’re a
ukernel - what is commonly considered system time, are not, since much of
the drivers/networking etc are done in userland processes.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

“Adam Mallory” <amalloryNOSPAM@NOSPAMqnx.com> wrote in message
news:aj9bn0$g8c$1@nntp.qnx.com

“Marty Doane” <> marty.doane@rapistan.com> > wrote in message
news:aj8cuk$bip$> 1@inn.qnx.com> …
How is the information for pidin ttimes gathered? Does the kernel record
the
times whenever a new thread is scheduled, or is there a sampling of the
active thread when a clock tick expires, or some other mechanism? We’d
like
to use the ttime info for evaluating which threads in our application
are
using how many cpu cycles, but don’t know if it reliably conveys the
right
information.

Note also that the source for pidin is available:
http://cvs.qnx.com/cgi-bin/cvsweb.cgi/utils/p/pidin/

Another good tool is Igor Kovalenko’s tool “spin”:
http://home.attbi.com/~kovalenko/qnx/spin/

Kris.

The time is updated on tick, to both the thread (and the process it’s
bound
to). I believe Rob Krten wrote a tool called sysmon (and I think the
source
is available), and the hogs utility is another example (contact your sales
rep for more details on getting source for hogs).

As a side note: using time under Neutrino gets tricky, since we’re a
ukernel - what is commonly considered system time, are not, since much of
the drivers/networking etc are done in userland processes.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

I should clarify:

Process running time is updated on a tick, and on a scheduling event.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

“Adam Mallory” <amalloryNOSPAM@NOSPAMqnx.com> wrote in message
news:aj9bn0$g8c$1@nntp.qnx.com

“Marty Doane” <> marty.doane@rapistan.com> > wrote in message
news:aj8cuk$bip$> 1@inn.qnx.com> …
How is the information for pidin ttimes gathered? Does the kernel record
the
times whenever a new thread is scheduled, or is there a sampling of the
active thread when a clock tick expires, or some other mechanism? We’d
like
to use the ttime info for evaluating which threads in our application
are
using how many cpu cycles, but don’t know if it reliably conveys the
right
information.

The time is updated on tick, to both the thread (and the process it’s
bound
to). I believe Rob Krten wrote a tool called sysmon (and I think the
source
is available), and the hogs utility is another example (contact your sales
rep for more details on getting source for hogs).

As a side note: using time under Neutrino gets tricky, since we’re a
ukernel - what is commonly considered system time, are not, since much of
the drivers/networking etc are done in userland processes.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

Grr… Thread running time, and the process it’s bound to.

Sorry, not enough coffee today.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>
“Adam Mallory” <amalloryNOSPAM@NOSPAMqnx.com> wrote in message
news:ajbgi5$5uf$1@nntp.qnx.com

I should clarify:

Process running time is updated on a tick, and on a scheduling event.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

“Adam Mallory” <> amalloryNOSPAM@NOSPAMqnx.com> > wrote in message
news:aj9bn0$g8c$> 1@nntp.qnx.com> …
“Marty Doane” <> marty.doane@rapistan.com> > wrote in message
news:aj8cuk$bip$> 1@inn.qnx.com> …
How is the information for pidin ttimes gathered? Does the kernel
record
the
times whenever a new thread is scheduled, or is there a sampling of
the
active thread when a clock tick expires, or some other mechanism? We’d
like
to use the ttime info for evaluating which threads in our application
are
using how many cpu cycles, but don’t know if it reliably conveys the
right
information.

The time is updated on tick, to both the thread (and the process it’s
bound
to). I believe Rob Krten wrote a tool called sysmon (and I think the
source
is available), and the hogs utility is another example (contact your
sales
rep for more details on getting source for hogs).

As a side note: using time under Neutrino gets tricky, since we’re a
ukernel - what is commonly considered system time, are not, since much
of
the drivers/networking etc are done in userland processes.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net
\

This looks like it behaves exactly like I was hoping it would.

Thanks for the clarification.

Marty Doane
Siemens Dematic

“Adam Mallory” <amalloryNOSPAM@NOSPAMqnx.com> wrote in message
news:ajbgo5$68h$1@nntp.qnx.com

Grr… Thread running time, and the process it’s bound to.

Sorry, not enough coffee today.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net
“Adam Mallory” <> amalloryNOSPAM@NOSPAMqnx.com> > wrote in message
news:ajbgi5$5uf$> 1@nntp.qnx.com> …
I should clarify:

Process running time is updated on a tick, and on a scheduling event.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

“Adam Mallory” <> amalloryNOSPAM@NOSPAMqnx.com> > wrote in message
news:aj9bn0$g8c$> 1@nntp.qnx.com> …
“Marty Doane” <> marty.doane@rapistan.com> > wrote in message
news:aj8cuk$bip$> 1@inn.qnx.com> …
How is the information for pidin ttimes gathered? Does the kernel
record
the
times whenever a new thread is scheduled, or is there a sampling of
the
active thread when a clock tick expires, or some other mechanism?
We’d
like
to use the ttime info for evaluating which threads in our
application
are
using how many cpu cycles, but don’t know if it reliably conveys the
right
information.

The time is updated on tick, to both the thread (and the process it’s
bound
to). I believe Rob Krten wrote a tool called sysmon (and I think the
source
is available), and the hogs utility is another example (contact your
sales
rep for more details on getting source for hogs).

As a side note: using time under Neutrino gets tricky, since we’re a
ukernel - what is commonly considered system time, are not, since much
of
the drivers/networking etc are done in userland processes.

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net


\

“Adam Mallory” <amalloryNOSPAM@NOSPAMqnx.com> writes:

| I should clarify:
|
| Process running time is updated on a tick, and on a scheduling event.

Actually, it’s not updated on a scheduling event; I have an open
bug on this (at least, not most scheduling events, like yield, blocking
on a message, etc.)

You really know how to wreck a guy’s day :slight_smile:

The events I’m most interested in are:
MsgReceive - waiting for a pulse from a timer
pthread_mutex_lock
pthread_mutex_unlock
pthread_cond_wait
pthread_cond_signal
read
write

Anyone know the details?


Marty Doane
Siemens Dematic

“Dave Olson” <olson@free.tahoenetworks.com> wrote in message
news:olson.1029279401@free.tahoenetworks.com

“Adam Mallory” <> amalloryNOSPAM@NOSPAMqnx.com> > writes:

| I should clarify:
|
| Process running time is updated on a tick, and on a scheduling event.

Actually, it’s not updated on a scheduling event; I have an open
bug on this (at least, not most scheduling events, like yield, blocking
on a message, etc.)

Actually, it’s not updated on a scheduling event; I have an open
bug on this (at least, not most scheduling events, like yield, blocking
on a message, etc.)

Mmm, looking at the code it does - Do you have the PR number handy?

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>