Hi:
I want to code a customized daemon, and only interests in IBS samples. After I traced the opcontrol script, and used the logic to start the kernel module, the /dev/oprofile/enable and buffer didn't work. Though I can use opcontrol to start and stop the kernel module, the following logic leads to an error: echo 1 > /dev/oprofile/enable, "bash: echo: write error: Invalid argument".
After I start the daemon, the above statement works correctly. What's the extra work done by daemon?
=============
MOUNT=/dev/oprofile
modprobe oprofile
mkdir /dev/oprofile >/dev/null 2>&1
mount -t oprofilefs nodev /dev/oprofile >/dev/null
echo 750000 > $MOUNT/ibs_op/max_count
echo 1 > $MOUNT/ibs_op/enable
echo 1 > $MOUNT/ibs_op/dispatched_ops
echo 1 > $MOUNT/enable
 
DaFENG
Coder
Telecommunication && Network Industry
Gmail:sunspiderX@gmail.com