Hi,
On 03/31/2014 10:59 PM, [email protected] wrote:
> Hi!
>> +#define _GNU_SOURCE
>> +#include <unistd.h>
>> +#include <sys/syscall.h>
>> +#include <linux/perf_event.h>
>> +int main(void) {
>> + struct perf_event_attr pe;
>> + syscall(__NR_perf_event_open, &pe, 0, -1, -1, 0);
>> + return 0;
>> +}])],[has_perf_event_open_syscall="yes"])
>> +if test "x$has_perf_event_open_syscall" = "xyes"; then
>> + AC_DEFINE(HAVE_PERF_EVENT_OPEN_SYSCALL,1,[Define to 1 if you have the
>> perf_event_open syscall support on your system])
>> +else
>> + AC_DEFINE(HAVE_PERF_EVENT_OPEN_SYSCALL,0,[Define to 0 if you do not
>> have the perf_event_open syscall support on your system])
>> +fi
>> +])
> This is wrong, we have linux_syscall_numbers.h in
> testcases/kernel/include/ in order to make sure syscall numbers are
> defined.
OK, got it.
> Looking at the code it should rather be check for
> struct perf_event_attr in /usr/include/linux/perf_event.h, right?
Yes, I just want to ensure perf_event.h exists and struct perf_event_attr is
defined there.
It seems there are some misunderstandings in the comments and I will make a new
version, thanks.
>> +static void do_work(void)
>> +{
>> + int i;
>> +
>> + for (i = 0; i < LOOPS; ++i)
>> + asm volatile ("" : : "g" (i));
>> +}
> What is the exact purpose of the asm snippet here?
Hmm, This asm code is actually pointless and it's just to introduce some work
load between enabling and disabling the event counters.
Regards,
Xiaoguang Wang
>
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list