Hello all!!

I am trying to implement a dynamic meter which will show the CPU
utilization by the application while it is being run. for that I have
used 

The following piece of code in the application:---

Int pid;

Pid=getpid();//will return the pid of running application

Char *command=(char*)malloc(50*sizeof(char*));

Char *cmd="%C > pid.txt");

Sprintf(command,"ps -p %d -o",pid);

Strcat(command,cmd);//so  full system command used is ps -p pid -o %C
>pid.txt, CPU utilization will be in pid.txt file.

System("command");//should run the command and print cpu utilization in
pid.txt file


But unfortunately the application hangs whenever this code is
encountered, I have placed this code in frame callback function of
PLAYTO () is there some flaw in this method and is there some another
method by which I can display the %cpu  utilization by the application
dynamically on the surface of a window. THANKS FOR ANY HELP IN ADVANCE!!


 
 
Thanks and Regards,
HEMANT KUMAR
WIireless & Embedded Solutions Group
NET CENTRIC TECHNOLOGIES DIVISION

 
 
 


_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to