- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Number of threads per process (pstat)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 04:14 AM
тАО09-14-2007 04:14 AM
While trying to figure out no of threads per process on HP-UX(In case of linux, i think the Threads field of /proc/
This is working fine on a HP-UX 11.31 machine(IA) but not on hp-ux 11.23 machine(IA).
Snip for both the OS(11.31 and 11.23):
--------------------------------------
On 11.31 IA machine:
[root@hpia5][/]uname -a
HP-UX hpia5 B.11.31 U ia64 1278630092 unlimited-user license
[root@hpia5][/]model
ia64 hp server rx2620
[root@hpia5][/]cc -o threads_per_process threads_list.c
[root@hpia5][/]./threads_per_process |head
------------------------------------------------------------------------------
PID | UID |Threads| RSS | Command
------------------------------------------------------------------------------
0 | 0 | 1 | 16 | swapper
1 | 0 | 2 | 164 | init
11 | 0 | 12 | 192 | ObjectThreadPool
10 | 0 | 1 | 16 | ttisr
9 | 0 | 3 | 48 | ksyncer_daemon
On 11.23 IA machine:
root@hpia7/ >uname -a
HP-UX hpia7 B.11.23 U ia64 0785257145 unlimited-user license
root@hpia7/ >model
ia64 hp server rx2620
root@hpia7/ >./threads_per_process |head
pstat_getproc failed: Value too large to be stored in data type
------------------------------------------------------------------------------
PID | UID |Threads| RSS | Command
------------------------------------------------------------------------------
0 | 0 | 1 | 16 | swapper
0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 |
more info here: http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=060818f70fe0211018f70fe02110275d6e10RCRD
I am not much of programmer,but would definitely like to port this program to work
on HP-UX 11.23 as well,Or if there is another
full proof method to determine this(No of threads per process)then please let me know.
Regards,
~amit
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 05:47 AM
тАО09-14-2007 05:47 AM
SolutionEither you are:
a) Compiling on 11.31 and attempting to run the binary on 11.23.
or
b) Not using -D_PSTAT64 in compilation.
I lean towards (a) since it looks like the 11.23 kernel is complaining about the size of the data structure in the pstat_getproc() call [and since pstat structures usually get new fields between releases (at the end for compatibility) that fits... the 11.31 structure is larger than the 11.23 kernel expects].
Compile the program on 11.23, and use the -D_PSTAT64 (since it doesn't work right otherwise from what I can tell) if you compile DD32.. or just compile DD64.
Here's my result on a r11.23 box:
# uname -a
HP-UX unknown B.11.23 U ia64 2456779667 unlimited-user license
# cc +DD32 -D_PSTAT64 -o tpp tpp.c
# ./tpp |more
------------------------------------------------------------------------------
PID | UID |Threads| RSS | Command
------------------------------------------------------------------------------
0 | 0 | 1 | 16 | swapper
1 | 0 | 2 | 153 | init
8 | 0 | 2 | 32 | kmemdaemon
9 | 0 | 2 | 80 | ioconfigd
10 | 0 | 12 | 192 | ObjectThreadPool
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 09:38 PM
тАО09-14-2007 09:38 PM
Re: No of threads per process
Thanks a lot.After compiling with
cc +DD32 -D_PSTAT64 option,it is working now.
Excerpt from the man page of cc :
On my system there wasn't MAN pages for cc,but those available here(link below) has
no info on "D_PSTAT64".
http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?debug=0&manpage=/opt/ansic/share/man/man1.Z/cc.1)
Also can you share some insight on hp-ux internals, poritng, hp-ux development to novice like me who aspire to involve in hp-ux development.
Thanks a lot again,Points to follow :)
~amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 10:26 PM - edited тАО11-06-2014 10:46 AM
тАО09-14-2007 10:26 PM - edited тАО11-06-2014 10:46 AM
Re: Number of threads per process (pstat)
>On my system there wasn't MAN pages for cc
If you have purchased the C/aC++ developer's bundle you should have the man page. If you have the bundled C compiler, you are out of luck. You can look at the aC++ Online Help here:
http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/HTML/index.htm
For more info on the aC++ compiler see:
http://www.hp.com/go/cpp
Why would you expect this with cc(1), see pstat(2):
and "Programming Model Considerations" for -D_PSTAT64.