*/
static DEFINE_MUTEX(markers_mutex);
-static LIST_HEAD(libs);
+static CDS_LIST_HEAD(libs);
void lock_markers(void)
* @...: Variable argument list.
*
* Since we do not use "typical" pointer based RCU in the 1 argument case, we
- * need to put a full smp_rmb() in this branch. This is why we do not use
+ * need to put a full cmm_smp_rmb() in this branch. This is why we do not use
* rcu_dereference() for the pointer read.
*/
notrace void marker_probe_cb(const struct marker *mdata,
if (likely(!ptype)) {
marker_probe_func *func;
/* Must read the ptype before ptr. They are not data dependant,
- * so we put an explicit smp_rmb() here. */
- smp_rmb();
+ * so we put an explicit cmm_smp_rmb() here. */
+ cmm_smp_rmb();
func = mdata->single.func;
/* Must read the ptr before private data. They are not data
- * dependant, so we put an explicit smp_rmb() here. */
- smp_rmb();
+ * dependant, so we put an explicit cmm_smp_rmb() here. */
+ cmm_smp_rmb();
va_start(args, regs);
func(mdata, mdata->single.probe_private, regs, call_private,
mdata->format, &args);
/*
* Read mdata->ptype before mdata->multi.
*/
- smp_rmb();
+ cmm_smp_rmb();
multi = mdata->multi;
/*
* multi points to an array, therefore accessing the array
* depends on reading multi. However, even in this case,
* we must insure that the pointer is read _before_ the array
- * data. Same as rcu_dereference, but we need a full smp_rmb()
- * in the fast path, so put the explicit barrier here.
+ * data. Same as rcu_dereference, but we need a full cmm_smp_rmb()
+ * in the fast path, so put the explicit cmm_barrier here.
*/
- smp_read_barrier_depends();
+ cmm_smp_read_barrier_depends();
for (i = 0; multi[i].func; i++) {
va_start(args, regs);
multi[i].func(mdata, multi[i].probe_private,
if (likely(!ptype)) {
marker_probe_func *func;
/* Must read the ptype before ptr. They are not data dependant,
- * so we put an explicit smp_rmb() here. */
- smp_rmb();
+ * so we put an explicit cmm_smp_rmb() here. */
+ cmm_smp_rmb();
func = mdata->single.func;
/* Must read the ptr before private data. They are not data
- * dependant, so we put an explicit smp_rmb() here. */
- smp_rmb();
+ * dependant, so we put an explicit cmm_smp_rmb() here. */
+ cmm_smp_rmb();
func(mdata, mdata->single.probe_private, regs, call_private,
mdata->format, &args);
} else {
/*
* Read mdata->ptype before mdata->multi.
*/
- smp_rmb();
+ cmm_smp_rmb();
multi = mdata->multi;
/*
* multi points to an array, therefore accessing the array
* depends on reading multi. However, even in this case,
* we must insure that the pointer is read _before_ the array
- * data. Same as rcu_dereference, but we need a full smp_rmb()
- * in the fast path, so put the explicit barrier here.
+ * data. Same as rcu_dereference, but we need a full cmm_smp_rmb()
+ * in the fast path, so put the explicit cmm_barrier here.
*/
- smp_read_barrier_depends();
+ cmm_smp_read_barrier_depends();
for (i = 0; multi[i].func; i++)
multi[i].func(mdata, multi[i].probe_private, regs,
call_private, mdata->format, &args);
static void free_old_closure(struct rcu_head *head)
{
- struct marker_entry *entry = container_of(head,
+ struct marker_entry *entry = _ust_container_of(head,
struct marker_entry, rcu);
free(entry->oldptr);
/* Make sure we free the data before setting the pending flag to 0 */
- smp_wmb();
+ cmm_smp_wmb();
entry->rcu_pending = 0;
}
WARN_ON(ret);
/* Make sure the call_rcu has been executed */
//ust// if (e->rcu_pending)
-//ust// rcu_barrier_sched();
+//ust// rcu_cmm_barrier_sched();
free(e);
return 0;
}
* Make sure the private data is valid when we update the
* single probe ptr.
*/
- smp_wmb();
+ cmm_smp_wmb();
elem->single.func = entry->single.func;
/*
* We also make sure that the new probe callbacks array is consistent
* Update the function or multi probe array pointer before setting the
* ptype.
*/
- smp_wmb();
+ cmm_smp_wmb();
elem->ptype = entry->ptype;
if (elem->tp_name && (active ^ _imv_read(elem->state))) {
//ust// BUG_ON(!ret);
ret = tracepoint_probe_register_noupdate(
elem->tp_name,
- elem->tp_cb);
+ elem->tp_cb, NULL);
} else {
ret = tracepoint_probe_unregister_noupdate(
elem->tp_name,
- elem->tp_cb);
+ elem->tp_cb, NULL);
/*
* tracepoint_probe_update_all() must be called
* before the module containing tp_cb is unloaded.
* checking has been done in the __trace_mark_tp() macro.
*/
ret = tracepoint_probe_unregister_noupdate(elem->tp_name,
- elem->tp_cb);
+ elem->tp_cb, NULL);
WARN_ON(ret);
/*
* tracepoint_probe_update_all() must be called
elem->state__imv = 0;
elem->single.func = __mark_empty_function;
/* Update the function before setting the ptype */
- smp_wmb();
+ cmm_smp_wmb();
elem->ptype = 0; /* single probe */
/*
* Leave the private data and channel_id/event_id there, because removal
/* FIXME: we should probably take a mutex here on libs */
//ust// pthread_mutex_lock(&module_mutex);
- list_for_each_entry(lib, &libs, list)
+ cds_list_for_each_entry(lib, &libs, list)
marker_update_probe_range(lib->markers_start,
lib->markers_start + lib->markers_count);
//ust// pthread_mutex_unlock(&module_mutex);
* make sure it's executed now.
*/
//ust// if (entry->rcu_pending)
-//ust// rcu_barrier_sched();
+//ust// rcu_cmm_barrier_sched();
old = marker_entry_add_probe(entry, probe, probe_private);
if (IS_ERR(old)) {
ret = PTR_ERR(old);
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
-//ust// rcu_barrier_sched();
+//ust// rcu_cmm_barrier_sched();
entry->oldptr = old;
entry->rcu_pending = 1;
/* write rcu_pending before calling the RCU callback */
- smp_wmb();
+ cmm_smp_wmb();
//ust// call_rcu_sched(&entry->rcu, free_old_closure);
synchronize_rcu(); free_old_closure(&entry->rcu);
goto end;
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
-//ust// rcu_barrier_sched();
+//ust// rcu_cmm_barrier_sched();
old = marker_entry_remove_probe(entry, probe, probe_private);
pthread_mutex_unlock(&markers_mutex);
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
-//ust// rcu_barrier_sched();
+//ust// rcu_cmm_barrier_sched();
entry->oldptr = old;
entry->rcu_pending = 1;
/* write rcu_pending before calling the RCU callback */
- smp_wmb();
+ cmm_smp_wmb();
//ust// call_rcu_sched(&entry->rcu, free_old_closure);
synchronize_rcu(); free_old_closure(&entry->rcu);
remove_marker(channel, name); /* Ignore busy error message */
goto end;
}
//ust// if (entry->rcu_pending)
-//ust// rcu_barrier_sched();
+//ust// rcu_cmm_barrier_sched();
old = marker_entry_remove_probe(entry, NULL, probe_private);
channel = strdup(entry->channel);
name = strdup(entry->name);
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
-//ust// rcu_barrier_sched();
+//ust// rcu_cmm_barrier_sched();
entry->oldptr = old;
entry->rcu_pending = 1;
/* write rcu_pending before calling the RCU callback */
- smp_wmb();
+ cmm_smp_wmb();
//ust// call_rcu_sched(&entry->rcu, free_old_closure);
synchronize_rcu(); free_old_closure(&entry->rcu);
/* Ignore busy error message */
int found = 0;
//ust// pthread_mutex_lock(&module_mutex);
- list_for_each_entry(iter_lib, &libs, list) {
+ cds_list_for_each_entry(iter_lib, &libs, list) {
if (iter_lib < iter->lib)
continue;
else if (iter_lib > iter->lib)
/* FIXME: maybe protect this with its own mutex? */
lock_markers();
- list_add(&pl->list, &libs);
+ cds_list_add(&pl->list, &libs);
unlock_markers();
new_markers(markers_start, markers_start + markers_count);
/* FIXME: we should probably take a mutex here on libs */
//ust// pthread_mutex_lock(&module_mutex);
- list_for_each_entry(lib, &libs, list) {
+ cds_list_for_each_entry(lib, &libs, list) {
if(lib->markers_start == markers_start) {
struct lib *lib2free = lib;
- list_del(&lib->list);
+ cds_list_del(&lib->list);
free(lib2free);
break;
}