How to check the footprint of a running task in vxworks? - target

I would like to know of any commands or utilities there are to check the runtime footprint of application in vxworks (target board).
And I'd also like to know how to find the CPU usage of target board.

Not quite sure what you mean by "runtime footprint", but the ti command will show you the stack usage for a particular task:
-> ti tNet0
NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY
---------- ------------ -------- --- ---------- -------- -------- ------- -----
tNet0 ipcomNetTask 1040fad0 50 PEND 1014c42b 1078ff10 0 0
full task name : tNet0
task entry : ipcomNetTask
process : kernel
options : 0x9007
VX_SUPERVISOR_MODE VX_UNBREAKABLE VX_DEALLOC_STACK VX_DEALLOC_TCB
VX_DEALLOC_EXC_STACK
STACK BASE END SP SIZE HIGH MARGIN
--------- -------- -------- -------- ------- ------- -------
execution 10790000 10780000 1078ff10 65536 2404 63132
exception 10428fb8 10426030 12168 360 11808
For cpu usage, enable INCLUDE_SPY in your BSP and execute spy to start the display of the cpu usage:
->spy
NAME ENTRY TID PRI total % (ticks) delta % (ticks)
------------ ------------ ---------- --- --------------- ---------------
tJobTask 0x10098410 0x103eeb00 0 0% ( 0) 0% ( 0)
tExcTask 0x10097880 0x101d6560 0 0% ( 0) 0% ( 0)
tLogTask logTask 0x103efa58 0 0% ( 0) 0% ( 0)
tShell0 shellTask 0x1058c5c8 1 0% ( 2) 0% ( 2)
tWdbTask 0x10141e80 0x104ae950 3 0% ( 0) 0% ( 0)
tSpyTask spyComTask 0x1042ecb8 5 0% ( 8) 0% ( 2)
ipcom_tickd 0x10060090 0x1058fb50 20 0% ( 0) 0% ( 0)
tVxdbgTask 0x10051810 0x104ae658 25 0% ( 0) 0% ( 0)
tAioIoTask1 aioIoTask 0x1040df78 50 0% ( 0) 0% ( 0)
tAioIoTask0 aioIoTask 0x1040e3a0 50 0% ( 0) 0% ( 0)
tNet0 ipcomNetTask 0x1040fad0 50 0% ( 0) 0% ( 0)
ipcom_syslog 0x10055190 0x1042e5a8 50 0% ( 0) 0% ( 0)
tNetConf 0x100887e0 0x1044f8b8 50 0% ( 0) 0% ( 0)
tAioWait aioWaitTask 0x1040aa40 51 0% ( 0) 0% ( 0)
KERNEL 0% ( 0) 0% ( 0)
INTERRUPT 0% ( 0) 0% ( 0)
IDLE 99% ( 2495) 99% ( 498)
TOTAL 99% ( 2505) 99% ( 502)
->spyStop

Related

Find specific value in file using lua

i have file with below format :-
** Resuming transfer from byte position 13247324
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:10 --:--:-- 0
0 9539k 0 0 0 0 0 0 --:--:-- 0:00:11 --:--:-- 0
0 9539k 0 0 0 0 0 0 --:--:-- 0:00:12 --:--:-- 0
0 9539k 0 8192 0 0 598 0 4:32:14 0:00:13 4:32:01 1882
0 9539k 0 13238 0 0 865 0 3:08:12 0:00:15 3:07:57 2459
39k 11 1109k 0 0 12684 0 0:12:50 0:01:29 0:11:21 22753
11 9539k 11 1117k 0 0 12570 0 0:12:57 0:01:31 0:11:26 15004
11 9539k 11 1117k 0 0 12433 0 0:13:05 0:01:32 0:11:33 11847
11 9539k 11 1117k 0 0 12299 0 0:13:14 0:01:33 0:11:41 9191
11 9539k 11 1117k 0 0 12168 0 0:13:22 0:01:34 0:11:48 6011
11 9539k 11 1124k 0 0 12122 0 0:13:25 0:01:35 0:11:50 2844
12 9539k 12 1173k 0 0 12566 0 0:12:57 0:01:35 0:11:22 12479
12 9539k 12 1173k 0 0 12384 0 0:13:08 0:01:37 0:11:31 11475
12 9539k 12 1173k 0 0 12257 0 0:13:16 0:01:38 0:11:38 11473
12 9539k 12 1197k 0 0 12371 0 0:13:09 0:01:39 0:11:30 16129
I want to find only the average dload values
My current code is :-
local file = io.open(path, "rb")
if not file then return nil end
local lines = {}
local words = {}
for line in io.lines(path) do
for word in line:gmatch("%w+") do
table.insert(words, word)
end
table.insert(lines, words)
end
file:close()
return words;
But this code is giving me indexes , and all words as values. I am not able to find specific value for average dload
I am new to lua , any help is much appreciated
I think you are almost there. This is how I would do that. col will hold the number of the column for which we are gathering the output, such that you can separately get the stats for the different columns.
local file = io.open(path, "rb")
if not file then return nil end
local lines = {}
local stats = {}
local col
for line in io.lines(path) do
col = 0
for word in line:gmatch("%w+") do
if word then
col = col + 1
stats[col] = stats[col] or { }
stats[col][word] = (stats[col][word] or 0) + 1
end
end
table.insert(lines, words)
end
file:close()
When I do now the following:
for col, val in ipairs(stats) do
for word, count in pairs(val) do
print("Col=", col, "word=", word, "count=",count)
end
end
I get the following output:
Col= 1 word= 39k count= 1
Col= 1 word= 0 count= 13
Col= 1 word= 11 count= 5
Col= 1 word= 12 count= 4
Col= 2 word= 0 count= 9
Col= 2 word= 9539k count= 13
Col= 2 word= 11 count= 1
Col= 3 word= 12 count= 4
...etc.

What does the "*A" and "*U" means in the "sctp assocs" display?

cat /proc/net/sctp/assocs
ASSOC-ID ASSOC SOCK STY SST ST HBKT TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS HBINT INS OUTS MAXRT T1X T2X RTXC wmema wmemq sndbuf rcvbuf
13 ffff8800b93a9000 ffff8800ac752300 2 1 3 9176 0 0 0 20735 3905 48538 *192.168.44.228 <-> *A172.16.236.92 7500 10 10 2 0 0 23 1 0 2000000 2000000
0 ffff88042aea3000 ffff880422e88000 0 10 1 40840 0 0 0 9542 3868 3868 *10.127.58.66 <-> *U10.127.115.194 7500 17 17 10 0 0 0 1 0 8388608 8388608

Jenkins process high cpu usage 800%.

I have installed jenkins version 1.614 on ubuntu 12.04 with configuration - 32 GB ram, 2 TB hdd and 8 CPU cores. Currently Jenkins has 594 jobs added.
In normal condition when no job is running cpu usage is 0% but When I start any job build cpu usage suddenly reaches 700-800%.
Following are the stats for cpu usage.
top - 06:29:55 up 160 days, 17:43, 3 users, load average: 4.27, 2.54, 2.43
Tasks: 123 total, 2 running, 118 sleeping, 0 stopped, 3 zombie
Cpu0 : 96.7%us, 0.3%sy, 0.0%ni, 3.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 95.7%us, 1.0%sy, 0.0%ni, 3.0%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 96.7%us, 0.7%sy, 0.0%ni, 2.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 92.0%us, 0.7%sy, 0.0%ni, 7.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 96.7%us, 0.3%sy, 0.0%ni, 3.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 :100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 96.7%us, 0.7%sy, 0.0%ni, 2.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 97.0%us, 0.0%sy, 0.0%ni, 3.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32809732k total, 26551884k used, 6257848k free, 481144k buffers
Swap: 16768892k total, 8376k used, 16760516k free, 15064772k cached
3852 jenkins 20 0 12.5g 8.1g 21m S 774 26.0 2095:06 java
14 root 20 0 0 0 0 S 0 0.0 5:05.81 kworker/2:0
67 root 20 0 0 0 0 S 0 0.0 4:51.63 kworker/3:1
399 root 20 0 0 0 0 S 0 0.0 4:12.45 jbd2/md2-8
1251 root 20 0 0 0 0 S 0 0.0 6:02.19 flush-9:2
6754 appster 20 0 1052m 152m 2244 S 0 0.5 317:39.39 statsd
1 root 20 0 24196 1528 832 S 0 0.0 0:18.22 init
I have also deleted job builds older than 30 days and current running job build is also small job, Still cpu usage is very high.

Pthread "manager" thread crashed due to get signal 33

I have linux application on embedded linux that uses pthread library. From time to time pthread "manager" thread get signal 33 and crashed.
How do I know who is sending the signal?
Strace log:
...
18:15:07 getppid() = 30
18:15:07 poll([{fd=31, events=POLLIN}], 1, 2000) = 0
18:15:09 getppid() = 30
18:15:09 poll([{fd=31, events=POLLIN}], 1, 2000) = 0
18:15:11 getppid() = 30
18:15:11 poll([{fd=31, events=POLLIN}], 1, 2000) = 0
18:15:13 getppid() = 30
18:15:13 poll([{fd=31, events=POLLIN}], 1, 2000) = -1 EINTR (Interrupted system call)
18:15:13 --- SIGRT_1 (Unknown signal 33) # 0 (0) ---
18:15:13 getppid() = 30
18:15:13 wait4(-1, [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV], WNOHANG|__WCLONE, NULL) = 68
18:15:13 --- SIGSEGV (Segmentation fault) # 0 (0) ---
Signal 33 is used internally by the pthreads library (it is referred to as SIGSETXID, and is raised by the library for every thread whenever one of the uids or gids of the process are changed).
It should not cause a thread to crash. Why do you believe this signal is responsible?

puppettop? How can I see what puppet is doing?

I'm getting started with Puppet. I added some lines to a manifest and when running Puppet now it's been at 100% cpu for a very longtime. Is there a good way to see what puppet is actually doing? puppettop?
top gives me this, which is quite useless:
top - 20:02:11 up 1 day, 2:30, 5 users, load average: 1.02, 1.12, 0.93
Tasks: 164 total, 2 running, 162 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.5%us, 0.0%sy, 0.0%ni, 87.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32809072k total, 10412396k used, 22396676k free, 243832k buffers
Swap: 16768892k total, 0k used, 16768892k free, 6978500k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9761 root 20 0 646m 558m 3568 R 100 1.7 20:42.88 puppet
10509 guaka 20 0 17344 1352 972 R 0 0.0 0:00.28 top
1 root 20 0 24216 2192 1344 S 0 0.0 0:00.85 init
2 root 20 0 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0 0.0 0:02.83 ksoftirqd/0
4 root 20 0 0 0 0 S 0 0.0 0:00.00 kworker/0:0
5 root 0 -20 0 0 0 S 0 0.0 0:00.00 kworker/0:0H

Resources