Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

LWP pthread_self ()

 
   Soft32 Home -> Linux -> Development RSS
Next:  how do i know if it is a redhat kernel distributi..  
Author Message
paul

External


Since: Jun 08, 2006
Posts: 1



(Msg. 1) Posted: Thu Jun 08, 2006 4:22 am
Post subject: LWP pthread_self ()
Archived from groups: linux>redhat>devel (more info?)

I have an application that has multiple threads. Every time I start a thread
I write an entry in the log file with the thread id as returned by the
pthread_self () call and a description of what the thread does.

When my application has been running for a while I do a ps -eLf to find out
how much CPU each thread has been using. Unfortunately ps returns LWPs and
pthread_self () returns a thread id.

When I have my application in gdb it shows both the thread id and the LWP
but I can not do this in production.

Does anyone know how in my c++ application I can find out what the LWP is
for a thread so that I can link this information with the output of ps.

Gdb Output:
(gdb) info threads
4 Thread -167969872 (LWP 11083) 0x003d27a2 in _dl_sysinfo_int80 ()
from /lib/ld-linux.so.2
3 Thread -165868624 (LWP 11082) 0x003d27a2 in _dl_sysinfo_int80 ()
from /lib/ld-linux.so.2
2 Thread -162210896 (LWP 11081) 0x003d27a2 in _dl_sysinfo_int80 ()
from /lib/ld-linux.so.2
* 1 Thread -162202816 (LWP 11074) 0x003d27a2 in _dl_sysinfo_int80 ()
from /lib/ld-linux.so.2


ps output:
lx-chdev10.wfg.com:/home/optdev/usa-dev $ ps -eLf|grep PLC
optdev 10906 10855 10906 2 1 19:14 pts/2 00:00:05 gdb --args
../PLCalc -csAppName PLCalc -d 20060605 -csFamily US_OMM
optdev 11074 10906 11074 0 4 19:16 pts/2 00:00:00
/home/optdev/usa-dev.new/linux_bin/pnl/PLCalc -csAppName PLCalc -d
20060605 -csFamily US_OMM
optdev 11074 10906 11081 0 4 19:16 pts/2 00:00:00
/home/optdev/usa-dev.new/linux_bin/pnl/PLCalc -csAppName PLCalc -d
20060605 -csFamily US_OMM
optdev 11074 10906 11082 0 4 19:16 pts/2 00:00:00
/home/optdev/usa-dev.new/linux_bin/pnl/PLCalc -csAppName PLCalc -d
20060605 -csFamily US_OMM
optdev 11074 10906 11083 0 4 19:16 pts/2 00:00:00
/home/optdev/usa-dev.new/linux_bin/pnl/PLCalc -csAppName PLCalc -d
20060605 -csFamily US_OMM
Back to top
Login to vote
Display posts from previous:   
Related Topics:
source code for shutdown - Hi, Can anyone tell me where to get the source code for the command shutdown. I would like to port it to my Agenda..

a function to add to newt - If anybody still uses newt, it's got a neat feature to listen on socket descriptors, but no way to remove the socket..

download discountinued redhat-betas? - Hi, does anyone know where i can download discontinued redhat-betas, who have removed from the official server? Greet...

RH 9.0 +glut link problem - All my open GL code that uses the glut library fails to link under RH 9.0. It works fine under RH 8.0. Lib glut can'...

Regina Rexx for redhat 2.1 - Has anyone sucessfully build Regina Rexx 3.01 for RH Linux 2.1AW running on an IA64 Itanium? I got the package and the...

Problem building apache from source RPM on RH9 - I am trying to rebuild apache 2.0.40 from the source RPM for Red Hat 9. Just downloaded and installed SRPMS. and runnin...
       Soft32 Home -> Linux -> Development All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]