Hi! > AC_OUTPUT > diff --git a/m4/ltp-perf_event_open.m4 b/m4/ltp-perf_event_open.m4 > new file mode 100644 > index 0000000..a1084cf > --- /dev/null > +++ b/m4/ltp-perf_event_open.m4 > @@ -0,0 +1,47 @@ > +dnl > +dnl Copyright (c) 2014 Fujitsu Ltd. > +dnl Author: Xiaoguang Wang <[email protected]> > +dnl > +dnl This program is free software; you can redistribute it and/or modify > +dnl it under the terms of the GNU General Public License as published by > +dnl the Free Software Foundation; either version 2 of the License, or > +dnl (at your option) any later version. > +dnl > +dnl This program is distributed in the hope that it will be useful, > +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of > +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See > +dnl the GNU General Public License for more details. > +dnl > +dnl You should have received a copy of the GNU General Public License > +dnl along with this program; if not, write to the Free Software > +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > +dnl > + > +dnl > +dnl LTP_CHECK_SYSCALL_PERF_EVENT_OPEN > +dnl ---------------------------- > +dnl > +AC_DEFUN([LTP_CHECK_SYSCALL_PERF_EVENT_OPEN],[dnl > + AC_MSG_CHECKING([for perf_event_open struct perf_event_attr]) > + save_CPPFLAGS=$CPPFLAGS > + CPPFLAGS="$CPPFLAGS -I$srcdir/testcases/kernel/include > -I$srcdir/include" > + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ > +#define _GNU_SOURCE > +#include <unistd.h> > +#include <linux/perf_event.h> > +#include "linux_syscall_numbers.h" > +int main(void) { > + struct perf_event_attr pe; > + syscall(__NR_perf_event_open, &pe, 0, -1, -1, 0); > + return 0; > +}])],[has_perf_event_attr="yes"]) > + > + > +if test "x$has_perf_event_attr" = xyes; then > + AC_DEFINE(HAVE_PERF_EVENT_ATTR,1,[Define to 1 if you have struct > perf_event_attr]) > + AC_MSG_RESULT(yes) > +else > + AC_MSG_RESULT(no) > +fi > +CPPFLAGS=$save_CPPFLAGS > +])
I've simplified this configure check, you don't have to call the syscall() because __NR_perf_event_open is always defined (due to linux_syscall_numbers.h). So all that needs to be done here is to check for existence of perf_event_attr structure in linux/perf_event.h. Patches pushed, thanks. -- Cyril Hrubis [email protected] ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
