1758581 Members
2120 Online
108872 Solutions
New Discussion юеВ

nkthread

 
SOLVED
Go to solution
Jannik
Honored Contributor

nkthread

How can i see the online usages of nkthread?
kmtune give the maximum and dmesg give info if the kthread is full.
jaton
10 REPLIES 10
Alex Glennie
Honored Contributor
Solution

Re: nkthread

cat > /tmp/nkthreads.c

Paste in the following:

#include
#include
#include
#include

int main()
{
struct pst_dynamic dyn;
int error;

if ( pstat_getdynamic( &dyn, sizeof(dyn), 1, 0) == 1 )
{
printf("Thread usage: %d of %d\n", dyn.psd_numkthreadsallocd,
dyn.psd_maxkthreads);
printf("Proc usage: %d of %d\n", dyn.psd_numprocsallocd,
dyn.psd_maxprocs);
}
else
perror("pstat_getdynamic:");
}

Press followed by Ctrl D to close the file.

# cc /tmp/nkthreads.c -o /tmp/nkthreads # Compile and name executable
nkthreads
# /tmp/nkthreads #Execute it

Sample output ....

Thread usage: 302 of 6000
Proc usage: 135 of 2048
Jannik
Honored Contributor

Re: nkthread

# cc /tmp/nkthreads.c -o /tmp/nkthreads
cpp: "/tmp/nkthreads.c", line 1: error 4034: Bad syntax for #include directive.
cpp: "/tmp/nkthreads.c", line 2: error 4034: Bad syntax for #include directive.
cpp: "/tmp/nkthreads.c", line 3: error 4034: Bad syntax for #include directive.
cpp: "/tmp/nkthreads.c", line 4: error 4034: Bad syntax for #include directive.

could you supplie me with the includes.
jaton
Cheryl Griffin
Honored Contributor

Re: nkthread

You didnt mention your operating system version.

At 11.23 use kcweb and kcusage.
# kcusage -l nkthread
Parameter: nkthread
Usage: 361
Setting: 8416
Percentage: 4.3
"Downtime is a Crime."
Alex Glennie
Honored Contributor

Re: nkthread

#include
#include
#include

see man pstat ... that said I'm haivng problems myself getting it to work now ...

appologies a bit busy at present.
Jannik
Honored Contributor

Re: nkthread

I'm running 11.11 so the command wil not work I can't get the C script to work. I will wait a'bit with the points.
jaton
Alex Glennie
Honored Contributor

Re: nkthread

Jannik,

Drop me an email tomorrow morning ... alex_glennie@hp.com.

Maria Simon
New Member

Re: nkthread

I have the same problem as Jannik, since I am running on a B.11.11,

cpp: "/tmp/nkthreads.c", line 1: error 4034: Bad syntax for #include directive.
cpp: "/tmp/nkthreads.c", line 2: error 4034: Bad syntax for #include directive.
cpp: "/tmp/nkthreads.c", line 3: error 4034: Bad syntax for #include directive.
cpp: "/tmp/nkthreads.c", line 4: error 4034: Bad syntax for #include directive.


Any possible help?

Thanks in advance.
Jannik
Honored Contributor

Re: nkthread

drop alex a mail... I were able to compile it on another host. This should run for you as well.
Copy the file to say /tmp and do a chmod 755 /tmp/nkthreads and the run it.
jaton
Jannik
Honored Contributor

Re: nkthread

and the file is :-)
cc /tmp/nkthreads.c -o /tmp/nkthreads

or drop me a mail and i will send the compiled file: jto@telia.dk
jaton