[sysprof] sysprofd: add sample_id_all field to options



commit 3e1bc8eb4a9d01beecb8089f0d255bbce9e64c30
Author: Christian Hergert <chergert redhat com>
Date:   Fri Apr 15 04:43:37 2016 -0700

    sysprofd: add sample_id_all field to options
    
    We need this to get the time field from mmap/comm events.

 daemon/sysprofd.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/daemon/sysprofd.c b/daemon/sysprofd.c
index 1700456..0933a48 100644
--- a/daemon/sysprofd.c
+++ b/daemon/sysprofd.c
@@ -80,6 +80,7 @@ sysprofd_perf_event_open (sd_bus_message *msg,
   int exclude_idle = 0;
   int fd = -1;
   int use_clockid = 0;
+  int sample_id_all = 0;
   int r;
 
   assert (msg);
@@ -119,6 +120,12 @@ sysprofd_perf_event_open (sd_bus_message *msg,
           if (r < 0)
             GOTO (cleanup);
         }
+      else if (strcmp (name, "sample_id_all") == 0)
+        {
+          r = sd_bus_message_read (msg, "b", &sample_id_all);
+          if (r < 0)
+            GOTO (cleanup);
+        }
       else if (strcmp (name, "clockid") == 0)
         {
           r = sd_bus_message_read (msg, "i", &clockid);
@@ -224,20 +231,22 @@ sysprofd_perf_event_open (sd_bus_message *msg,
   if (!use_clockid || clockid < 0)
     clockid = CLOCK_MONOTONIC_RAW;
 
+  attr.clockid = clockid;
   attr.comm = !!comm;
   attr.config = config;
   attr.disabled = disabled;
   attr.exclude_idle = !!exclude_idle;
   attr.mmap = !!mmap_;
+  attr.sample_id_all = sample_id_all;
   attr.sample_period = sample_period;
   attr.sample_type = sample_type;
-  attr.size = sizeof attr;
   attr.task = !!task;
   attr.type = type;
-  attr.clockid = clockid;
   attr.use_clockid = use_clockid;
   attr.wakeup_events = wakeup_events;
 
+  attr.size = sizeof attr;
+
   fd = _perf_event_open (&attr, pid, cpu, -1, 0);
   if (fd < 0)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]