mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
heap_profiler: support new gperftools header locations
The google/ headers location has been deprecated as of gperftools 2.0. As of gperftools 2.2rc, the google/ headers will now give deprecation warnings, and they will probably disappear in a future gperftools update. Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
This commit is contained in:
parent
c4f934997a
commit
6edaf4e796
@ -290,7 +290,13 @@ AC_ARG_WITH([profiler],
|
|||||||
[with_profiler=no])
|
[with_profiler=no])
|
||||||
AS_IF([test "x$with_profiler" = xyes],
|
AS_IF([test "x$with_profiler" = xyes],
|
||||||
[AC_CHECK_LIB([profiler], [ProfilerFlush], [],
|
[AC_CHECK_LIB([profiler], [ProfilerFlush], [],
|
||||||
[AC_MSG_FAILURE([--with-profiler was given but libprofiler (libgoogle-perftools-dev on debian) not found])])],
|
[AC_MSG_FAILURE([--with-profiler was given but libprofiler (libgoogle-perftools-dev on debian) not found])]),
|
||||||
|
AC_LANG_PUSH([C++]),
|
||||||
|
AC_CHECK_HEADERS([gperftools/heap-profiler.h \
|
||||||
|
gperftools/malloc_extension.h \
|
||||||
|
gperftools/profiler.h]),
|
||||||
|
AC_LANG_POP([C++])
|
||||||
|
],
|
||||||
[])
|
[])
|
||||||
AM_CONDITIONAL(WITH_PROFILER, test "$with_profiler" = "yes")
|
AM_CONDITIONAL(WITH_PROFILER, test "$with_profiler" = "yes")
|
||||||
AS_IF([test "$with_profiler" = "yes"],
|
AS_IF([test "$with_profiler" = "yes"],
|
||||||
|
@ -12,11 +12,20 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "acconfig.h"
|
||||||
|
|
||||||
|
// Use the newer gperftools header locations if available.
|
||||||
|
// If not, fall back to the old (gperftools < 2.0) locations.
|
||||||
|
|
||||||
|
#ifdef HAVE_GPERFTOOLS_PROFILER_H
|
||||||
|
#include <gperftools/profiler.h>
|
||||||
|
#else
|
||||||
|
#include <google/profiler.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "common/LogClient.h"
|
#include "common/LogClient.h"
|
||||||
#include "perfglue/cpu_profiler.h"
|
#include "perfglue/cpu_profiler.h"
|
||||||
|
|
||||||
#include <google/profiler.h>
|
|
||||||
|
|
||||||
void cpu_profiler_handle_command(const std::vector<std::string> &cmd,
|
void cpu_profiler_handle_command(const std::vector<std::string> &cmd,
|
||||||
ostream& out)
|
ostream& out)
|
||||||
{
|
{
|
||||||
|
@ -12,8 +12,23 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <google/heap-profiler.h>
|
#include "acconfig.h"
|
||||||
#include <google/malloc_extension.h>
|
|
||||||
|
// Use the newer gperftools header locations if available.
|
||||||
|
// If not, fall back to the old (gperftools < 2.0) locations.
|
||||||
|
|
||||||
|
#ifdef HAVE_GPERFTOOLS_HEAP_PROFILER_H
|
||||||
|
#include <gperftools/heap-profiler.h>
|
||||||
|
#else
|
||||||
|
#include <google/heap-profiler.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GPERFTOOLS_MALLOC_EXTENSION_H
|
||||||
|
#include <gperftools/malloc_extension.h>
|
||||||
|
#else
|
||||||
|
#include <google/malloc_extension.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "heap_profiler.h"
|
#include "heap_profiler.h"
|
||||||
#include "common/environment.h"
|
#include "common/environment.h"
|
||||||
#include "common/LogClient.h"
|
#include "common/LogClient.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user