mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
perf: use #ifdef, not #if
config.h does not unconditionally define these, they are not defined when inactive.
This commit is contained in:
@ -244,7 +244,7 @@ sysprofd_perf_event_open (sd_bus_message *msg,
|
|||||||
attr.type = type;
|
attr.type = type;
|
||||||
attr.wakeup_events = wakeup_events;
|
attr.wakeup_events = wakeup_events;
|
||||||
|
|
||||||
#if HAVE_PERF_CLOCKID
|
#ifdef HAVE_PERF_CLOCKID
|
||||||
if (!use_clockid || clockid < 0)
|
if (!use_clockid || clockid < 0)
|
||||||
attr.clockid = CLOCK_MONOTONIC_RAW;
|
attr.clockid = CLOCK_MONOTONIC_RAW;
|
||||||
else
|
else
|
||||||
|
|||||||
@ -654,7 +654,7 @@ sp_perf_counter_open (SpPerfCounter *self,
|
|||||||
"("
|
"("
|
||||||
"["
|
"["
|
||||||
"{'comm', <%b>},"
|
"{'comm', <%b>},"
|
||||||
#if HAVE_PERF_CLOCKID
|
#ifdef HAVE_PERF_CLOCKID
|
||||||
"{'clockid', <%i>},"
|
"{'clockid', <%i>},"
|
||||||
"{'use_clockid', <%b>},"
|
"{'use_clockid', <%b>},"
|
||||||
#endif
|
#endif
|
||||||
@ -674,7 +674,7 @@ sp_perf_counter_open (SpPerfCounter *self,
|
|||||||
"%t"
|
"%t"
|
||||||
")",
|
")",
|
||||||
(gboolean)!!attr->comm,
|
(gboolean)!!attr->comm,
|
||||||
#if HAVE_PERF_CLOCKID
|
#ifdef HAVE_PERF_CLOCKID
|
||||||
(gint32)attr->clockid,
|
(gint32)attr->clockid,
|
||||||
(gboolean)!!attr->use_clockid,
|
(gboolean)!!attr->use_clockid,
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -298,7 +298,7 @@ sp_perf_source_start_pid (SpPerfSource *self,
|
|||||||
attr.exclude_idle = 1;
|
attr.exclude_idle = 1;
|
||||||
attr.sample_id_all = 1;
|
attr.sample_id_all = 1;
|
||||||
|
|
||||||
#if HAVE_PERF_CLOCKID
|
#ifdef HAVE_PERF_CLOCKID
|
||||||
attr.clockid = sp_clock;
|
attr.clockid = sp_clock;
|
||||||
attr.use_clockid = 1;
|
attr.use_clockid = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user