Forum Discussion
13 Replies
- Altera_Forum
Honored Contributor
Look in the /proc file system.
- Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by hippo@Mar 22 2006, 03:30 AM look in the /proc file system.<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13657)
--- quote end ---
--- Quote End --- Ok hippo, thanks Warm Regards
- Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- I want to monitor all the processes that are loaded in µClinux (CPU usage, memory usage,...). <div align='right'><{post_snapback}> (index.php?act=findpost&pid=13655) --- Quote End --- [/b] --- Quote End --- Hi, To do so I executed the ps command, it gives all the stuff I need, unfortunately there is no top command so I got to write a script to execute the ps command every 3s and write results to a file. If anybody could help in that, that's gonna be cool. Warm Regards. - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by mfm@Mar 24 2006, 02:42 AM ...unfortunately there is no top command so i got to write a script to execute the ps command every 3s and write results to a file.if anybody could help in that, that's gonna be cool. --- Quote End --- Hi MFM, I haven't tried it yet, but it looks like top command may already have been been ported http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif * Follow step 13 here... http://forum.niosforum.com/forum/index.php?showtopic=3174# (http://forum.niosforum.com/forum/index.php?showtopic=3174#) * Select Miscellaneous Applications --> Propcs tools --> top
- Altera_Forum
Honored Contributor
Oops. I tried building the top and setserial apps from dist-test, however no binaries were generated.
Any ideas? - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- unfortunately there is no top command so I got to write a script to execute the ps command every 3s and write results to a file.[/b] --- Quote End --- Hi, well, I wrote that script and it works fine with one exception: I want to launch the ps command every 3s and save results in mfm.txt till the q key is pressed. I'm still testing it in Redhat before implementing it in µClinux. The only problem is how to get the q key stopping the execution of the script # ################################## # !/bin/sh touch mfm.txt until [ "$*" = "q" ]; do sleep 3 date >> mfm.txt ps >> mfm.txt echo " " >> mfm.txt; done # ################################## Can anybody help me with that ? Warm Regards - Altera_Forum
Honored Contributor
Why are you doing this when you can just get 'top' from busybox? Moreso, doesn't the processor need some sort of time reference to actual calculate loading on the CPU? IE: a RTC
- Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- ################################### # !/bin/sh touch mfm.txt until [ "$*" = "q" ]; do sleep 3 date >> mfm.txt ps >> mfm.txt echo " " >> mfm.txt; done # ##################################/b --- Quote End --- Hi, I've tried to execute that script under µClinux after changing the sleep 3 command, which isn't implemented in µClinux, by the following:# ############### for ((a=1;a<300;a++)) do echo done# ############### But unfortunately it won't work http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif I'm getting some "syntax error". Can anybody help me with that. Warm Regards - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by jdhar@Mar 24 2006, 06:02 PM why are you doing this when you can just get 'top' from busybox? --- Quote End --- Hi, that's cause I spent a lot of time trying to compile it but all I got is a lot of errors maybe you can help. This is the console output (I'm under Windows) <div class='quotetop'>QUOTE </div> --- Quote Start --- make -k all no emulation specific options. nios2-elf-gcc -nostdinc -D__linux__ -O2 -I"c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/include -I/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1//include -fno-optimize-sibling-calls -mhw-mul -mhw-mulx -Wall -c -o top.o top.c In file included from top.c:37: page.h:27:20: config.h: No such file or directory In file included from busybox.h:27, from top.c:38: config.h:4:28: linux/autoconf.h: No such file or directory In file included from busybox.h:54, from top.c:38: libbb.h:49:18: pwd_.h: No such file or directory libbb.h:50:18: grp_.h: No such file or directory In file included from busybox.h:54, from top.c:38: libbb.h:426: warning: "struct passwd" declared inside parameter list libbb.h:426: warning: its scope is only this definition or declaration, which is probably not what you want libbb.h:427: warning: "struct passwd" declared inside parameter list libbb.h:435: warning: "struct passwd" declared inside parameter list libbb.h:436: warning: "struct passwd" declared inside parameter list libbb.h:438: warning: "struct passwd" declared inside parameter list libbb.h:439: warning: "struct passwd" declared inside parameter list top.c:57: warning: 'pid_sort' defined but not used make: *** [top.o] Error 1 make: Target `all' not remade because of errors.[/b] --- Quote End --- - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by jdhar@Mar 24 2006, 06:02 PM why are you doing this when you can just get 'top' from busybox? --- Quote End --- I succeded in building that one but when I launch it, µClinux reboot. I tested it again and again and it's always the same!!!!!!! Any idea? Warm Regards