logo       

Solution to running opcontrol as root: msg#00051

Subject: Solution to running opcontrol as root
Hi,
The requirement to run opcontrol as a root is a known limitation of
oprofile. Basically, we want to keep opcontrol as a root-mode command,
while allowing user-mode clients to access this functionality.

We developed a solution for this problem based on a client-server approach,
called run_oprofile. Here is how it works:
1. One time setup of run_oprofile server. This is done by invoking
 $ run_oprofile.pl --server &
... with root permissions. This sets up a daemon that waits for socket
connections from a predefined socket port.

2. Performing oprofile measurements. This is done by running run_oprofile
in user mode:
 $ run_oprofile.pl [options] program arg ...
Common options are
 --group=number       Profile of all events in specified group
 --events=event,...   Profile selected events (CYCLES).
 --save=session       Name of session where profile is saved ()
The client opens a socket connection with the server and starts issuing
opcontrol commands through the connection. The server executes the
commands, reporting stdout log back to the client. After the last command
was responded, the client closes the connection and the server returns to
wait for next connection.
At this point any oprofile post-processing command can be used to query the
collected profile.

Run_oprofile is being used here in IBM for more then a year, on Linux
platforms RHEL4, SLES9, SLES10, and FC5, without any problems.

The code, written in Perl, totals about 500 lines. It is separated from
oprofile, it does not patch any oprofile code, so integrating it to the
source tree could be at the level of the auxiliary tools.

We are ready to contribute this code (see attachment).
Questions and comments are welcome.
Regards,
---
Yaakov  Yaari
Code Optimization Technologies
IBM Haifa Research Lab
(See attached file: run_oprofile-20061016.tgz)

Attachment: run_oprofile-20061016.tgz
Description: Binary data

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
oprofile-list mailing list
oprofile-list@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/oprofile-list
<Prev in Thread] Current Thread [Next in Thread>