[sysprof] perf: use #ifdef, not #if
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] perf: use #ifdef, not #if
- Date: Sat, 16 Apr 2016 23:57:17 +0000 (UTC)
commit 9f8f33b210216e971e311b3c9912a219f6237682
Author: Christian Hergert <christian hergert me>
Date: Sat Apr 16 16:56:41 2016 -0700
perf: use #ifdef, not #if
config.h does not unconditionally define these, they are not defined when
inactive.
daemon/sysprofd.c | 2 +-
lib/sp-perf-counter.c | 4 ++--
lib/sp-perf-source.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/daemon/sysprofd.c b/daemon/sysprofd.c
index 51cc456..331abd1 100644
--- a/daemon/sysprofd.c
+++ b/daemon/sysprofd.c
@@ -244,7 +244,7 @@ sysprofd_perf_event_open (sd_bus_message *msg,
attr.type = type;
attr.wakeup_events = wakeup_events;
-#if HAVE_PERF_CLOCKID
+#ifdef HAVE_PERF_CLOCKID
if (!use_clockid || clockid < 0)
attr.clockid = CLOCK_MONOTONIC_RAW;
else
diff --git a/lib/sp-perf-counter.c b/lib/sp-perf-counter.c
index 1ceb513..11c9ae2 100644
--- a/lib/sp-perf-counter.c
+++ b/lib/sp-perf-counter.c
@@ -654,7 +654,7 @@ sp_perf_counter_open (SpPerfCounter *self,
"("
"["
"{'comm', <%b>},"
-#if HAVE_PERF_CLOCKID
+#ifdef HAVE_PERF_CLOCKID
"{'clockid', <%i>},"
"{'use_clockid', <%b>},"
#endif
@@ -674,7 +674,7 @@ sp_perf_counter_open (SpPerfCounter *self,
"%t"
")",
(gboolean)!!attr->comm,
-#if HAVE_PERF_CLOCKID
+#ifdef HAVE_PERF_CLOCKID
(gint32)attr->clockid,
(gboolean)!!attr->use_clockid,
#endif
diff --git a/lib/sp-perf-source.c b/lib/sp-perf-source.c
index 5eaa723..5c4a67e 100644
--- a/lib/sp-perf-source.c
+++ b/lib/sp-perf-source.c
@@ -298,7 +298,7 @@ sp_perf_source_start_pid (SpPerfSource *self,
attr.exclude_idle = 1;
attr.sample_id_all = 1;
-#if HAVE_PERF_CLOCKID
+#ifdef HAVE_PERF_CLOCKID
attr.clockid = sp_clock;
attr.use_clockid = 1;
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]