ust: add markers autoconnect
[ust.git] / libmarkers / marker.c
index 198650b32d41846e0b8180c865ab5177e54119d7..43dfff7f58d38a5e06506d5a9c73d6b130e6229f 100644 (file)
@@ -817,6 +817,7 @@ int marker_probe_register(const char *channel, const char *name,
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
        call_rcu_sched(&entry->rcu, free_old_closure);
+       /*synchronize_rcu(); free_old_closure();*/
        goto end;
 
 error_unregister_channel:
@@ -1470,6 +1471,23 @@ void lib_update_markers(void)
 //ust//        mutex_unlock(&module_mutex);
 }
 
+static void (*new_marker_cb)(struct marker *) = NULL;
+
+void marker_set_new_marker_cb(void (*cb)(struct marker *))
+{
+       new_marker_cb = cb;
+}
+
+static void new_markers(struct marker *start, struct marker *end)
+{
+       if(new_marker_cb) {
+               struct marker *m;
+               for(m=start; m < end; m++) {
+                       new_marker_cb(m);
+               }
+       }
+}
+
 int marker_register_lib(struct marker *markers_start, int markers_count)
 {
        struct lib *pl;
@@ -1481,6 +1499,8 @@ int marker_register_lib(struct marker *markers_start, int markers_count)
 
        list_add(&pl->list, &libs);
 
+       new_markers(markers_start, markers_start + markers_count);
+
        /* FIXME: update just the loaded lib */
        lib_update_markers();
 
This page took 0.022747 seconds and 4 git commands to generate.