]> sourceware.org Git - systemtap.git/commitdiff
runtime: Use INIT_WORK_ONSTACK for perf
authorJosh Stone <jistone@redhat.com>
Tue, 1 Apr 2014 00:33:36 +0000 (17:33 -0700)
committerJosh Stone <jistone@redhat.com>
Tue, 1 Apr 2014 00:33:36 +0000 (17:33 -0700)
This only appears to matter for debug kernels, but rawhide is such.

runtime/linux/perf.c

index d61335e9f0b69b18fa4e8985a6096c44c0089c13..6f8d713d9cd7813a0c3c90ebc5f0665e12d29e84 100644 (file)
 
 #include "perf.h"
 
+#ifndef INIT_WORK_ONSTACK
+#define INIT_WORK_ONSTACK(_work, _func) INIT_WORK((_work), (_func))
+#define destroy_work_on_stack(_work) do { (void)(_work); } while (0)
+#endif
+
 /** @file perf.c
  * @brief Implements performance monitoring hardware support
  */
@@ -205,11 +210,12 @@ static int _stp_perf_init_n (struct stap_perf_probe *probes, size_t n,
                             const char **ppfail)
 {
   struct _stp_perf_work pwork = { .probes = probes, .nprobes = n };
-  INIT_WORK(&pwork.work, _stp_perf_init_work);
+  INIT_WORK_ONSTACK(&pwork.work, _stp_perf_init_work);
   schedule_work(&pwork.work);
   flush_work(&pwork.work);
   if (pwork.rc)
     *ppfail = pwork.probe_point;
+  destroy_work_on_stack(&pwork.work);
   return pwork.rc;
 }
 
This page took 0.026459 seconds and 5 git commands to generate.