config, btrace: check for pt_insn_event in libipt
Version 2 of libipt adds an event system to instruction flow decoders and deprecates indicating events via flags in struct pt_insn. Add configuration checks to determine which version we have. gdb/ * configure.ac: Check for pt_insn_event, struct pt_insn.enabled, and struct pt_insn.resynced. * configure: Regenerated. * config.in: Regenerated.
This commit is contained in:
parent
5b4a1ff337
commit
c56ccc05b2
|
@ -1,3 +1,10 @@
|
||||||
|
2017-05-31 Markus Metzger <markus.t.metzger@intel.com>
|
||||||
|
|
||||||
|
* configure.ac: Check for pt_insn_event, struct pt_insn.enabled,
|
||||||
|
and struct pt_insn.resynced.
|
||||||
|
* configure: Regenerated.
|
||||||
|
* config.in: Regenerated.
|
||||||
|
|
||||||
2017-05-30 Tim Wiederhake <tim.wiederhake@intel.com>
|
2017-05-30 Tim Wiederhake <tim.wiederhake@intel.com>
|
||||||
|
|
||||||
* btrace.c (ftrace_find_call_by_number): New function.
|
* btrace.c (ftrace_find_call_by_number): New function.
|
||||||
|
|
|
@ -381,6 +381,9 @@
|
||||||
/* Define if sys/ptrace.h defines the PT_GETXMMREGS request. */
|
/* Define if sys/ptrace.h defines the PT_GETXMMREGS request. */
|
||||||
#undef HAVE_PT_GETXMMREGS
|
#undef HAVE_PT_GETXMMREGS
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `pt_insn_event' function. */
|
||||||
|
#undef HAVE_PT_INSN_EVENT
|
||||||
|
|
||||||
/* Define to 1 if you have the `pwrite' function. */
|
/* Define to 1 if you have the `pwrite' function. */
|
||||||
#undef HAVE_PWRITE
|
#undef HAVE_PWRITE
|
||||||
|
|
||||||
|
@ -462,6 +465,12 @@
|
||||||
/* Define to 1 if `struct ptrace_lwpinfo' is a member of `pl_tdname'. */
|
/* Define to 1 if `struct ptrace_lwpinfo' is a member of `pl_tdname'. */
|
||||||
#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
|
#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
|
||||||
|
|
||||||
|
/* Define to 1 if `struct pt_insn' is a member of `enabled'. */
|
||||||
|
#undef HAVE_STRUCT_PT_INSN_ENABLED
|
||||||
|
|
||||||
|
/* Define to 1 if `struct pt_insn' is a member of `resynced'. */
|
||||||
|
#undef HAVE_STRUCT_PT_INSN_RESYNCED
|
||||||
|
|
||||||
/* Define to 1 if your system has struct reg in <machine/reg.h>. */
|
/* Define to 1 if your system has struct reg in <machine/reg.h>. */
|
||||||
#undef HAVE_STRUCT_REG
|
#undef HAVE_STRUCT_REG
|
||||||
|
|
||||||
|
|
|
@ -2248,6 +2248,63 @@ $as_echo "$ac_res" >&6; }
|
||||||
|
|
||||||
} # ac_fn_c_check_func
|
} # ac_fn_c_check_func
|
||||||
|
|
||||||
|
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
|
||||||
|
# ----------------------------------------------------
|
||||||
|
# Tries to find if the field MEMBER exists in type AGGR, after including
|
||||||
|
# INCLUDES, setting cache variable VAR accordingly.
|
||||||
|
ac_fn_c_check_member ()
|
||||||
|
{
|
||||||
|
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
|
||||||
|
$as_echo_n "checking for $2.$3... " >&6; }
|
||||||
|
if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
$5
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
static $2 ac_aggr;
|
||||||
|
if (ac_aggr.$3)
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"; then :
|
||||||
|
eval "$4=yes"
|
||||||
|
else
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
$5
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
static $2 ac_aggr;
|
||||||
|
if (sizeof ac_aggr.$3)
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"; then :
|
||||||
|
eval "$4=yes"
|
||||||
|
else
|
||||||
|
eval "$4=no"
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
eval ac_res=\$$4
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||||
|
$as_echo "$ac_res" >&6; }
|
||||||
|
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
|
||||||
|
|
||||||
|
} # ac_fn_c_check_member
|
||||||
|
|
||||||
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
|
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
|
||||||
# -------------------------------------------
|
# -------------------------------------------
|
||||||
# Tests whether TYPE exists after having included INCLUDES, setting cache
|
# Tests whether TYPE exists after having included INCLUDES, setting cache
|
||||||
|
@ -2346,63 +2403,6 @@ $as_echo "$ac_res" >&6; }
|
||||||
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
|
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
|
||||||
|
|
||||||
} # ac_fn_c_check_decl
|
} # ac_fn_c_check_decl
|
||||||
|
|
||||||
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
|
|
||||||
# ----------------------------------------------------
|
|
||||||
# Tries to find if the field MEMBER exists in type AGGR, after including
|
|
||||||
# INCLUDES, setting cache variable VAR accordingly.
|
|
||||||
ac_fn_c_check_member ()
|
|
||||||
{
|
|
||||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
|
|
||||||
$as_echo_n "checking for $2.$3... " >&6; }
|
|
||||||
if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
|
|
||||||
$as_echo_n "(cached) " >&6
|
|
||||||
else
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
$5
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
static $2 ac_aggr;
|
|
||||||
if (ac_aggr.$3)
|
|
||||||
return 0;
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_compile "$LINENO"; then :
|
|
||||||
eval "$4=yes"
|
|
||||||
else
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
$5
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
static $2 ac_aggr;
|
|
||||||
if (sizeof ac_aggr.$3)
|
|
||||||
return 0;
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_compile "$LINENO"; then :
|
|
||||||
eval "$4=yes"
|
|
||||||
else
|
|
||||||
eval "$4=no"
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
eval ac_res=\$$4
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
|
||||||
$as_echo "$ac_res" >&6; }
|
|
||||||
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
|
|
||||||
|
|
||||||
} # ac_fn_c_check_member
|
|
||||||
cat >config.log <<_ACEOF
|
cat >config.log <<_ACEOF
|
||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
@ -11440,6 +11440,42 @@ $as_echo "$LIBIPT" >&6; }
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
|
||||||
$as_echo "$as_me: WARNING: libipt is missing or unusable; some features may be unavailable." >&2;}
|
$as_echo "$as_me: WARNING: libipt is missing or unusable; some features may be unavailable." >&2;}
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
save_LIBS=$LIBS
|
||||||
|
LIBS="$LIBS $LIBIPT"
|
||||||
|
for ac_func in pt_insn_event
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_func "$LINENO" "pt_insn_event" "ac_cv_func_pt_insn_event"
|
||||||
|
if test "x$ac_cv_func_pt_insn_event" = x""yes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_PT_INSN_EVENT 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include <intel-pt.h>
|
||||||
|
"
|
||||||
|
if test "x$ac_cv_member_struct_pt_insn_enabled" = x""yes; then :
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_STRUCT_PT_INSN_ENABLED 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
ac_fn_c_check_member "$LINENO" "struct pt_insn" "resynced" "ac_cv_member_struct_pt_insn_resynced" "#include <intel-pt.h>
|
||||||
|
"
|
||||||
|
if test "x$ac_cv_member_struct_pt_insn_resynced" = x""yes; then :
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_STRUCT_PT_INSN_RESYNCED 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
LIBS=$save_LIBS
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1272,6 +1272,13 @@ else
|
||||||
else
|
else
|
||||||
AC_MSG_WARN([libipt is missing or unusable; some features may be unavailable.])
|
AC_MSG_WARN([libipt is missing or unusable; some features may be unavailable.])
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
save_LIBS=$LIBS
|
||||||
|
LIBS="$LIBS $LIBIPT"
|
||||||
|
AC_CHECK_FUNCS(pt_insn_event)
|
||||||
|
AC_CHECK_MEMBERS([struct pt_insn.enabled, struct pt_insn.resynced], [], [],
|
||||||
|
[#include <intel-pt.h>])
|
||||||
|
LIBS=$save_LIBS
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue