diff --git a/config.h.meson b/config.h.meson index 48b3c2c2..e1c9bbf0 100644 --- a/config.h.meson +++ b/config.h.meson @@ -20,6 +20,8 @@ #mesondefine HAVE_PERF_CLOCKID +#mesondefine HAVE_PERF_REGS_H + #mesondefine HAVE_POLKIT #mesondefine HAVE_POLKIT_AGENT diff --git a/meson.build b/meson.build index a118aa2b..3907354a 100644 --- a/meson.build +++ b/meson.build @@ -109,6 +109,10 @@ config_h.set10('HAVE_POLKIT_AGENT', polkit_agent_dep.found()) polkit_dep = dependency('polkit-gobject-1', version: polkit_req_version, required: false) config_h.set10('HAVE_POLKIT', polkit_dep.found()) +if cc.has_header('asm/perf_regs.h') + config_h.set10('HAVE_PERF_REGS_H', true) +endif + if need_libsysprof libunwind_dep = dependency('libunwind-generic', required: true) config_h.set('ENABLE_LIBUNWIND', libunwind_dep.found()) diff --git a/src/libsysprof/sysprof-user-sampler.c b/src/libsysprof/sysprof-user-sampler.c index 6079708e..4bccf7f5 100644 --- a/src/libsysprof/sysprof-user-sampler.c +++ b/src/libsysprof/sysprof-user-sampler.c @@ -25,7 +25,9 @@ #include #include -#include +#ifdef HAVE_PERF_REGS_H +# include +#endif #include