mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
build: fix build on macOS
This commit is contained in:
@ -52,6 +52,7 @@ static void
|
|||||||
sysprof_cpu_aid_prepare (SysprofAid *self,
|
sysprof_cpu_aid_prepare (SysprofAid *self,
|
||||||
SysprofProfiler *profiler)
|
SysprofProfiler *profiler)
|
||||||
{
|
{
|
||||||
|
#ifdef __linux__
|
||||||
g_autoptr(SysprofSource) source = NULL;
|
g_autoptr(SysprofSource) source = NULL;
|
||||||
|
|
||||||
g_assert (SYSPROF_IS_CPU_AID (self));
|
g_assert (SYSPROF_IS_CPU_AID (self));
|
||||||
@ -59,6 +60,7 @@ sysprof_cpu_aid_prepare (SysprofAid *self,
|
|||||||
|
|
||||||
source = sysprof_hostinfo_source_new ();
|
source = sysprof_hostinfo_source_new ();
|
||||||
sysprof_profiler_add_source (profiler, source);
|
sysprof_profiler_add_source (profiler, source);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@ -52,6 +52,7 @@ static void
|
|||||||
sysprof_memory_aid_prepare (SysprofAid *self,
|
sysprof_memory_aid_prepare (SysprofAid *self,
|
||||||
SysprofProfiler *profiler)
|
SysprofProfiler *profiler)
|
||||||
{
|
{
|
||||||
|
#ifdef __linux__
|
||||||
g_autoptr(SysprofSource) source = NULL;
|
g_autoptr(SysprofSource) source = NULL;
|
||||||
|
|
||||||
g_assert (SYSPROF_IS_MEMORY_AID (self));
|
g_assert (SYSPROF_IS_MEMORY_AID (self));
|
||||||
@ -59,6 +60,7 @@ sysprof_memory_aid_prepare (SysprofAid *self,
|
|||||||
|
|
||||||
source = sysprof_memory_source_new ();
|
source = sysprof_memory_source_new ();
|
||||||
sysprof_profiler_add_source (profiler, source);
|
sysprof_profiler_add_source (profiler, source);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@ -53,7 +53,6 @@ sysprof_recording_state_view_notify_elapsed (SysprofRecordingStateView *self,
|
|||||||
SysprofProfiler *profiler)
|
SysprofProfiler *profiler)
|
||||||
{
|
{
|
||||||
SysprofRecordingStateViewPrivate *priv = sysprof_recording_state_view_get_instance_private (self);
|
SysprofRecordingStateViewPrivate *priv = sysprof_recording_state_view_get_instance_private (self);
|
||||||
g_autofree gchar *str = NULL;
|
|
||||||
SysprofCaptureWriter *writer;
|
SysprofCaptureWriter *writer;
|
||||||
gint64 elapsed;
|
gint64 elapsed;
|
||||||
|
|
||||||
|
|||||||
@ -272,6 +272,7 @@ get_lines (const char *format,
|
|||||||
...)
|
...)
|
||||||
G_GNUC_PRINTF (1, 2);
|
G_GNUC_PRINTF (1, 2);
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
static char **
|
static char **
|
||||||
get_lines (const char *format,
|
get_lines (const char *format,
|
||||||
...)
|
...)
|
||||||
@ -296,6 +297,7 @@ get_lines (const char *format,
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const uint8_t *
|
static const uint8_t *
|
||||||
get_vdso_bytes (size_t *length)
|
get_vdso_bytes (size_t *length)
|
||||||
|
|||||||
@ -92,7 +92,7 @@ endif
|
|||||||
|
|
||||||
if host_machine.system() == 'darwin'
|
if host_machine.system() == 'darwin'
|
||||||
libsysprof_deps += [ dependency('libelf') ]
|
libsysprof_deps += [ dependency('libelf') ]
|
||||||
libsysprof_c_args = [ '-DNT_GNU_BUILD_ID=3', '-DELF_NOTE_GNU="GNU"', '-D__LIBELF_INTERNAL__' ]
|
libsysprof_c_args += [ '-DNT_GNU_BUILD_ID=3', '-DELF_NOTE_GNU="GNU"', '-D__LIBELF_INTERNAL__' ]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if host_machine.system() != 'darwin'
|
if host_machine.system() != 'darwin'
|
||||||
|
|||||||
@ -4,12 +4,14 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#ifndef HAVE_POLKIT_AUTOPTR
|
#ifdef HAVE_POLKIT
|
||||||
# include <polkit/polkit.h>
|
# ifndef HAVE_POLKIT_AUTOPTR
|
||||||
|
# include <polkit/polkit.h>
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !GLIB_CHECK_VERSION(2, 56, 0)
|
#if !GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
|
|||||||
@ -90,7 +90,6 @@ sysprof_capture_symbol_resolver_load (SysprofSymbolResolver *resolver,
|
|||||||
SysprofCaptureReader *reader)
|
SysprofCaptureReader *reader)
|
||||||
{
|
{
|
||||||
SysprofCaptureSymbolResolver *self = (SysprofCaptureSymbolResolver *)resolver;
|
SysprofCaptureSymbolResolver *self = (SysprofCaptureSymbolResolver *)resolver;
|
||||||
g_autoptr(GError) error = NULL;
|
|
||||||
gint byte_order;
|
gint byte_order;
|
||||||
gint fd;
|
gint fd;
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <gio/gunixfdlist.h>
|
#include <gio/gunixfdlist.h>
|
||||||
#include <polkit/polkit.h>
|
|
||||||
|
|
||||||
#include "sysprof-helpers.h"
|
#include "sysprof-helpers.h"
|
||||||
#include "sysprof-polkit-private.h"
|
#include "sysprof-polkit-private.h"
|
||||||
@ -549,7 +548,6 @@ sysprof_helpers_authorize_async (SysprofHelpers *self,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
g_autoptr(GTask) task = NULL;
|
g_autoptr(GTask) task = NULL;
|
||||||
g_autoptr(PolkitSubject) subject = NULL;
|
|
||||||
GDBusConnection *bus;
|
GDBusConnection *bus;
|
||||||
|
|
||||||
g_return_if_fail (SYSPROF_IS_HELPERS (self));
|
g_return_if_fail (SYSPROF_IS_HELPERS (self));
|
||||||
|
|||||||
@ -407,9 +407,9 @@ sysprof_local_profiler_class_init (SysprofLocalProfilerClass *klass)
|
|||||||
g_object_class_override_property (object_class, PROP_WHOLE_SYSTEM, "whole-system");
|
g_object_class_override_property (object_class, PROP_WHOLE_SYSTEM, "whole-system");
|
||||||
|
|
||||||
g_type_ensure (SYSPROF_TYPE_GJS_SOURCE);
|
g_type_ensure (SYSPROF_TYPE_GJS_SOURCE);
|
||||||
|
#ifdef __linux__
|
||||||
g_type_ensure (SYSPROF_TYPE_HOSTINFO_SOURCE);
|
g_type_ensure (SYSPROF_TYPE_HOSTINFO_SOURCE);
|
||||||
g_type_ensure (SYSPROF_TYPE_PROC_SOURCE);
|
g_type_ensure (SYSPROF_TYPE_PROC_SOURCE);
|
||||||
#ifdef __linux__
|
|
||||||
g_type_ensure (SYSPROF_TYPE_PERF_SOURCE);
|
g_type_ensure (SYSPROF_TYPE_PERF_SOURCE);
|
||||||
#endif
|
#endif
|
||||||
g_type_ensure (SYSPROF_TYPE_PROXY_SOURCE);
|
g_type_ensure (SYSPROF_TYPE_PROXY_SOURCE);
|
||||||
|
|||||||
Reference in New Issue
Block a user