Thank you very much for your attention and reply! See below.

 2013-05-03 18:41:14"Robert Richter" <rric@kernel.org> д
>On 03.05.13 03:29:58, ΰ wrote:
>> root@nimbnode6:~# dmesg | grep 'perf\|oprofile'
>> [    7.140181] Initializing cgroup subsys perf_event
>> [161955.654083] oprofile: using NMI timer interrupt.
>
>This means, oprofile didn't detect hardware counters. Oprofile uses in
>this case an in-kernel perf_event which fails since running as guest
>(see below).
>
How to enable in-kernel perf_event success?
>> root@nimbnode6:~# zgrep 'PERF_EVENTS\|OPROFILE' /boot/config*
>> /boot/config-3.2.0-29-generic:CONFIG_HAVE_PERF_EVENTS=y
>> /boot/config-3.2.0-29-generic:CONFIG_PERF_EVENTS=y
>> /boot/config-3.2.0-29-generic:CONFIG_OPROFILE=m
>> /boot/config-3.2.0-29-generic:# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
>> /boot/config-3.2.0-29-generic:CONFIG_HAVE_OPROFILE=y
>> /boot/config-3.2.0-29-generic:CONFIG_HAVE_PERF_EVENTS_NMI=y
>> /boot/config-3.2.0-40-generic:CONFIG_HAVE_PERF_EVENTS=y
>> /boot/config-3.2.0-40-generic:CONFIG_PERF_EVENTS=y
>> /boot/config-3.2.0-40-generic:CONFIG_OPROFILE=m
>> /boot/config-3.2.0-40-generic:# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
>> /boot/config-3.2.0-40-generic:CONFIG_HAVE_OPROFILE=y
>> /boot/config-3.2.0-40-generic:CONFIG_HAVE_PERF_EVENTS_NMI=y
>
>From the dmesg you sent a couple of mails ago it seems you are running
>Xen. Even Dom0 is technically a guest. So no support for hardware
>counters for this case (maybe newer xen implementations support
>hardware counter virtualization, don't know).
>
Yes, I use xenoprofile on xen platform. I install xenoprofile in dom0. I use the newer xen version, 4.1.2. From other people's paper, they can use xenoprofle to get cache hit rate, even use the older xen. 
I try this operation on two servers. Also ubutun12.04, xen 4.1.2. They have different cpu type. For xen installation,  nimbnode6 from xen source code(I show you the information and questions of this server), nimbnode2 from apt-get install.   nimbnode2 can show multiple events, however, opcontrol can not start. They use the same xen version.
The following is the information of nimbnode2.
root@nimbnode2:~# rm -rf /var/lib/oprofile/
root@nimbnode2:~# rm -rf ~/.oprofile
root@nimbnode2:~# opcontrol --setup --event=CPU_CLK_UNHALTED:10000:0:1:1 --separate=lib,kernel --no-vmlinux
root@nimbnode2:~# opcontrol --start --image=all --verbose
Parameters used:
SESSION_DIR /var/lib/oprofile
LOCK_FILE /var/lib/oprofile/lock
SAMPLES_DIR /var/lib/oprofile/samples
CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current
CPUTYPE i386/core_i7
BUF_SIZE default value
BUF_WATERSHED default value
CPU_BUF_SIZE default value
SEPARATE_LIB 1
SEPARATE_KERNEL 1
SEPARATE_THREAD 0
SEPARATE_CPU 0
CALLGRAPH 0
VMLINUX none
KERNEL_RANGE
XENIMAGE none
XEN_RANGE
Error: counter 0 not available nmi_watchdog using this resource ? Try:
opcontrol --deinit
echo 0 > /proc/sys/kernel/nmi_watchdog
root@nimbnode2:~# cat /proc/sys/kernel/nmi_watchdog
0
root@nimbnode2:~# perf
The program 'perf' can be found in the following packages:
 * linux-tools-common
 * linux-base

In previous email, you mention that maybe perf occupy the performance counter, there is an conflict. However, I did not install perf on this server. 

I do not know why.

root@nimbnode2:~# dmesg | grep 'perf\|oprofile'
[    4.859756] Initializing cgroup subsys perf_event
[5085965.060248]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5086805.060248]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5086925.060244]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5087045.060241]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5087165.060248]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5087285.060240]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5087405.060285]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5087525.060283]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5087645.060292]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[5087765.060287]  [<ffffffff811187aa>] generic_perform_write+0xca/0x210
[6597549.864064] oprofile: using NMI interrupt.
[6649012.758607] oprofile: using NMI interrupt.
[6649280.861401] oprofile: using NMI interrupt.
[6649333.074229] oprofile: using NMI interrupt.
[6649994.923927] oprofile: using NMI interrupt.
[6650672.288479] oprofile: using NMI interrupt.
[6687385.842358] oprofile: using NMI interrupt.
[6724052.247300] oprofile: using NMI interrupt.
[7418052.512002] oprofile: using NMI interrupt.
[7612394.700827] oprofile: using NMI interrupt.
[7676044.408130] oprofile: using NMI interrupt.
root@nimbnode2:~# zgrep 'PERF_EVENTS\|OPROFILE' /boot/config*
/boot/config-3.2.0-29-generic:CONFIG_HAVE_PERF_EVENTS=y
/boot/config-3.2.0-29-generic:CONFIG_PERF_EVENTS=y
/boot/config-3.2.0-29-generic:CONFIG_OPROFILE=m
/boot/config-3.2.0-29-generic:# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
/boot/config-3.2.0-29-generic:CONFIG_HAVE_OPROFILE=y
/boot/config-3.2.0-29-generic:CONFIG_HAVE_PERF_EVENTS_NMI=y
/boot/config-3.2.0-37-generic:CONFIG_HAVE_PERF_EVENTS=y
/boot/config-3.2.0-37-generic:CONFIG_PERF_EVENTS=y
/boot/config-3.2.0-37-generic:CONFIG_OPROFILE=m
/boot/config-3.2.0-37-generic:# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
/boot/config-3.2.0-37-generic:CONFIG_HAVE_OPROFILE=y
/boot/config-3.2.0-37-generic:CONFIG_HAVE_PERF_EVENTS_NMI=y



>So wrt perf you should find a message like this in your dmesg:
>
> Broken PMU hardware detected, using software events only.
>
>So, again, your setup does not support hardware counters.
I do not know how to support hardware counters. Which place has some problem for my setup to bring this question.  Can you give me some guidance?
>
>-Robert