projects
/
ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove hlist from kcompat's headers and code
[ust.git]
/
libust
/
marker.c
diff --git
a/libust/marker.c
b/libust/marker.c
index 56ffe39960dd6d6e79281410cf5cf5002019906d..2618b1aea1efea88c67d8b424b0c866b046e9be6 100644
(file)
--- a/
libust/marker.c
+++ b/
libust/marker.c
@@
-21,6
+21,7
@@
#define _LGPL_SOURCE
#include <urcu-bp.h>
#include <urcu/rculist.h>
#define _LGPL_SOURCE
#include <urcu-bp.h>
#include <urcu/rculist.h>
+#include <urcu/hlist.h>
#include <ust/core.h>
#include <ust/marker.h>
#include <ust/core.h>
#include <ust/marker.h>
@@
-45,17
+46,17
@@
static const int marker_debug;
*/
static DEFINE_MUTEX(markers_mutex);
*/
static DEFINE_MUTEX(markers_mutex);
-static LIST_HEAD(libs);
+static
CDS_
LIST_HEAD(libs);
void lock_markers(void)
{
void lock_markers(void)
{
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
}
void unlock_markers(void)
{
}
void unlock_markers(void)
{
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
}
/*
}
/*
@@
-64,7
+65,7
@@
void unlock_markers(void)
*/
#define MARKER_HASH_BITS 6
#define MARKER_TABLE_SIZE (1 << MARKER_HASH_BITS)
*/
#define MARKER_HASH_BITS 6
#define MARKER_TABLE_SIZE (1 << MARKER_HASH_BITS)
-static struct hlist_head marker_table[MARKER_TABLE_SIZE];
+static struct
cds_
hlist_head marker_table[MARKER_TABLE_SIZE];
/*
* Note about RCU :
/*
* Note about RCU :
@@
-75,7
+76,7
@@
static struct hlist_head marker_table[MARKER_TABLE_SIZE];
* marker entries modifications are protected by the markers_mutex.
*/
struct marker_entry {
* marker entries modifications are protected by the markers_mutex.
*/
struct marker_entry {
- struct hlist_node hlist;
+ struct
cds_
hlist_node hlist;
char *format;
char *name;
/* Probe wrapper */
char *format;
char *name;
/* Probe wrapper */
@@
-127,7
+128,7
@@
notrace void __mark_empty_function(const struct marker *mdata,
* @...: Variable argument list.
*
* Since we do not use "typical" pointer based RCU in the 1 argument case, we
* @...: 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,
* rcu_dereference() for the pointer read.
*/
notrace void marker_probe_cb(const struct marker *mdata,
@@
-146,12
+147,12
@@
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,
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
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);
va_start(args, regs);
func(mdata, mdata->single.probe_private, regs, call_private,
mdata->format, &args);
@@
-162,16
+163,16
@@
notrace void marker_probe_cb(const struct marker *mdata,
/*
* Read mdata->ptype before mdata->multi.
*/
/*
* 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
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,
for (i = 0; multi[i].func; i++) {
va_start(args, regs);
multi[i].func(mdata, multi[i].probe_private,
@@
-202,12
+203,12
@@
static notrace void marker_probe_cb_noarg(const struct marker *mdata,
if (likely(!ptype)) {
marker_probe_func *func;
/* Must read the ptype before ptr. They are not data dependant,
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
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 {
func(mdata, mdata->single.probe_private, regs, call_private,
mdata->format, &args);
} else {
@@
-216,16
+217,16
@@
static notrace void marker_probe_cb_noarg(const struct marker *mdata,
/*
* Read mdata->ptype before mdata->multi.
*/
/*
* 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
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);
for (i = 0; multi[i].func; i++)
multi[i].func(mdata, multi[i].probe_private, regs,
call_private, mdata->format, &args);
@@
-235,11
+236,11
@@
static notrace void marker_probe_cb_noarg(const struct marker *mdata,
static void free_old_closure(struct rcu_head *head)
{
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 */
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;
}
entry->rcu_pending = 0;
}
@@
-386,8
+387,8
@@
marker_entry_remove_probe(struct marker_entry *entry,
*/
static struct marker_entry *get_marker(const char *channel, const char *name)
{
*/
static struct marker_entry *get_marker(const char *channel, const char *name)
{
- struct hlist_head *head;
- struct hlist_node *node;
+ struct
cds_
hlist_head *head;
+ struct
cds_
hlist_node *node;
struct marker_entry *e;
size_t channel_len = strlen(channel) + 1;
size_t name_len = strlen(name) + 1;
struct marker_entry *e;
size_t channel_len = strlen(channel) + 1;
size_t name_len = strlen(name) + 1;
@@
-395,7
+396,7
@@
static struct marker_entry *get_marker(const char *channel, const char *name)
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
- hlist_for_each_entry(e, node, head, hlist) {
+
cds_
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name))
return e;
}
if (!strcmp(channel, e->channel) && !strcmp(name, e->name))
return e;
}
@@
-409,8
+410,8
@@
static struct marker_entry *get_marker(const char *channel, const char *name)
static struct marker_entry *add_marker(const char *channel, const char *name,
const char *format)
{
static struct marker_entry *add_marker(const char *channel, const char *name,
const char *format)
{
- struct hlist_head *head;
- struct hlist_node *node;
+ struct
cds_
hlist_head *head;
+ struct
cds_
hlist_node *node;
struct marker_entry *e;
size_t channel_len = strlen(channel) + 1;
size_t name_len = strlen(name) + 1;
struct marker_entry *e;
size_t channel_len = strlen(channel) + 1;
size_t name_len = strlen(name) + 1;
@@
-421,17
+422,17
@@
static struct marker_entry *add_marker(const char *channel, const char *name,
if (format)
format_len = strlen(format) + 1;
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
if (format)
format_len = strlen(format) + 1;
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
- hlist_for_each_entry(e, node, head, hlist) {
+
cds_
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
DBG("Marker %s.%s busy", channel, name);
return ERR_PTR(-EBUSY); /* Already there */
}
}
/*
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
DBG("Marker %s.%s busy", channel, name);
return ERR_PTR(-EBUSY); /* Already there */
}
}
/*
- * Using malloc here to allocate a variable length element. Could
+ * Using
z
malloc here to allocate a variable length element. Could
* cause some memory fragmentation if overused.
*/
* cause some memory fragmentation if overused.
*/
- e = malloc(sizeof(struct marker_entry)
+ e =
z
malloc(sizeof(struct marker_entry)
+ channel_len + name_len + format_len);
if (!e)
return ERR_PTR(-ENOMEM);
+ channel_len + name_len + format_len);
if (!e)
return ERR_PTR(-ENOMEM);
@@
-439,7
+440,7
@@
static struct marker_entry *add_marker(const char *channel, const char *name,
e->name = &e->channel[channel_len];
memcpy(e->name, name, name_len);
if (format) {
e->name = &e->channel[channel_len];
memcpy(e->name, name, name_len);
if (format) {
- e->format = &e->name[
channel_len +
name_len];
+ e->format = &e->name[name_len];
memcpy(e->format, format, format_len);
if (strcmp(e->format, MARK_NOARGS) == 0)
e->call = marker_probe_cb_noarg;
memcpy(e->format, format, format_len);
if (strcmp(e->format, MARK_NOARGS) == 0)
e->call = marker_probe_cb_noarg;
@@
-459,7
+460,7
@@
static struct marker_entry *add_marker(const char *channel, const char *name,
e->format_allocated = 0;
e->refcount = 0;
e->rcu_pending = 0;
e->format_allocated = 0;
e->refcount = 0;
e->rcu_pending = 0;
- hlist_add_head(&e->hlist, head);
+
cds_
hlist_add_head(&e->hlist, head);
return e;
}
return e;
}
@@
-469,8
+470,8
@@
static struct marker_entry *add_marker(const char *channel, const char *name,
*/
static int remove_marker(const char *channel, const char *name)
{
*/
static int remove_marker(const char *channel, const char *name)
{
- struct hlist_head *head;
- struct hlist_node *node;
+ struct
cds_
hlist_head *head;
+ struct
cds_
hlist_node *node;
struct marker_entry *e;
int found = 0;
size_t channel_len = strlen(channel) + 1;
struct marker_entry *e;
int found = 0;
size_t channel_len = strlen(channel) + 1;
@@
-480,7
+481,7
@@
static int remove_marker(const char *channel, const char *name)
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
- hlist_for_each_entry(e, node, head, hlist) {
+
cds_
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
found = 1;
break;
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
found = 1;
break;
@@
-490,14
+491,14
@@
static int remove_marker(const char *channel, const char *name)
return -ENOENT;
if (e->single.func != __mark_empty_function)
return -EBUSY;
return -ENOENT;
if (e->single.func != __mark_empty_function)
return -EBUSY;
- hlist_del(&e->hlist);
+
cds_
hlist_del(&e->hlist);
if (e->format_allocated)
free(e->format);
ret = ltt_channels_unregister(e->channel);
WARN_ON(ret);
/* Make sure the call_rcu has been executed */
//ust// if (e->rcu_pending)
if (e->format_allocated)
free(e->format);
ret = ltt_channels_unregister(e->channel);
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;
}
free(e);
return 0;
}
@@
-529,7
+530,7
@@
static int set_marker(struct marker_entry *entry, struct marker *elem,
if (entry->format) {
if (strcmp(entry->format, elem->format) != 0) {
if (entry->format) {
if (strcmp(entry->format, elem->format) != 0) {
-
DBG
("Format mismatch for probe %s (%s), marker (%s)",
+
ERR
("Format mismatch for probe %s (%s), marker (%s)",
entry->name,
entry->format,
elem->format);
entry->name,
entry->format,
elem->format);
@@
-563,7
+564,7
@@
static int set_marker(struct marker_entry *entry, struct marker *elem,
* Make sure the private data is valid when we update the
* single probe ptr.
*/
* 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
elem->single.func = entry->single.func;
/*
* We also make sure that the new probe callbacks array is consistent
@@
-574,7
+575,7
@@
static int set_marker(struct marker_entry *entry, struct marker *elem,
* Update the function or multi probe array pointer before setting the
* ptype.
*/
* 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))) {
elem->ptype = entry->ptype;
if (elem->tp_name && (active ^ _imv_read(elem->state))) {
@@
-594,11
+595,11
@@
static int set_marker(struct marker_entry *entry, struct marker *elem,
//ust// BUG_ON(!ret);
ret = tracepoint_probe_register_noupdate(
elem->tp_name,
//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,
} 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.
/*
* tracepoint_probe_update_all() must be called
* before the module containing tp_cb is unloaded.
@@
-630,7
+631,7
@@
static void disable_marker(struct marker *elem)
* checking has been done in the __trace_mark_tp() macro.
*/
ret = tracepoint_probe_unregister_noupdate(elem->tp_name,
* 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
WARN_ON(ret);
/*
* tracepoint_probe_update_all() must be called
@@
-641,7
+642,7
@@
static void disable_marker(struct marker *elem)
elem->state__imv = 0;
elem->single.func = __mark_empty_function;
/* Update the function before setting the ptype */
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
elem->ptype = 0; /* single probe */
/*
* Leave the private data and channel_id/event_id there, because removal
@@
-661,9
+662,9
@@
int is_marker_enabled(const char *channel, const char *name)
{
struct marker_entry *entry;
{
struct marker_entry *entry;
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker(channel, name);
entry = get_marker(channel, name);
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
return entry && !!entry->refcount;
}
return entry && !!entry->refcount;
}
@@
-681,7
+682,7
@@
void marker_update_probe_range(struct marker *begin,
struct marker *iter;
struct marker_entry *mark_entry;
struct marker *iter;
struct marker_entry *mark_entry;
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
for (iter = begin; iter < end; iter++) {
mark_entry = get_marker(iter->channel, iter->name);
if (mark_entry) {
for (iter = begin; iter < end; iter++) {
mark_entry = get_marker(iter->channel, iter->name);
if (mark_entry) {
@@
-707,7
+708,7
@@
void marker_update_probe_range(struct marker *begin,
disable_marker(iter);
}
}
disable_marker(iter);
}
}
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
}
static void lib_update_markers(void)
}
static void lib_update_markers(void)
@@
-715,11
+716,11
@@
static void lib_update_markers(void)
struct lib *lib;
/* FIXME: we should probably take a mutex here on libs */
struct lib *lib;
/* FIXME: we should probably take a mutex here on libs */
-//ust// mutex_lock(&module_mutex);
- list_for_each_entry(lib, &libs, list)
+//ust//
pthread_
mutex_lock(&module_mutex);
+
cds_
list_for_each_entry(lib, &libs, list)
marker_update_probe_range(lib->markers_start,
lib->markers_start + lib->markers_count);
marker_update_probe_range(lib->markers_start,
lib->markers_start + lib->markers_count);
-//ust// mutex_unlock(&module_mutex);
+//ust//
pthread_
mutex_unlock(&module_mutex);
}
/*
}
/*
@@
-774,7
+775,7
@@
int marker_probe_register(const char *channel, const char *name,
struct marker_probe_closure *old;
int first_probe = 0;
struct marker_probe_closure *old;
int first_probe = 0;
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker(channel, name);
if (!entry) {
first_probe = 1;
entry = get_marker(channel, name);
if (!entry) {
first_probe = 1;
@@
-816,7
+817,7
@@
int marker_probe_register(const char *channel, const char *name,
* make sure it's executed now.
*/
//ust// if (entry->rcu_pending)
* 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);
old = marker_entry_add_probe(entry, probe, probe_private);
if (IS_ERR(old)) {
ret = PTR_ERR(old);
@@
-825,21
+826,21
@@
int marker_probe_register(const char *channel, const char *name,
else
goto end;
}
else
goto end;
}
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
/* Activate marker if necessary */
marker_update_probes();
/* Activate marker if necessary */
marker_update_probes();
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker(channel, name);
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
entry = get_marker(channel, 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 */
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;
//ust// call_rcu_sched(&entry->rcu, free_old_closure);
synchronize_rcu(); free_old_closure(&entry->rcu);
goto end;
@@
-851,7
+852,7
@@
error_remove_marker:
ret_err = remove_marker(channel, name);
WARN_ON(ret_err);
end:
ret_err = remove_marker(channel, name);
WARN_ON(ret_err);
end:
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
return ret;
}
//ust// EXPORT_SYMBOL_GPL(marker_probe_register);
return ret;
}
//ust// EXPORT_SYMBOL_GPL(marker_probe_register);
@@
-876,33
+877,33
@@
int marker_probe_unregister(const char *channel, const char *name,
struct marker_probe_closure *old;
int ret = -ENOENT;
struct marker_probe_closure *old;
int ret = -ENOENT;
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker(channel, name);
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
entry = get_marker(channel, name);
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);
old = marker_entry_remove_probe(entry, probe, probe_private);
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
marker_update_probes();
marker_update_probes();
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker(channel, name);
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
entry = get_marker(channel, 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 */
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 */
ret = 0;
end:
//ust// call_rcu_sched(&entry->rcu, free_old_closure);
synchronize_rcu(); free_old_closure(&entry->rcu);
remove_marker(channel, name); /* Ignore busy error message */
ret = 0;
end:
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
return ret;
}
//ust// EXPORT_SYMBOL_GPL(marker_probe_unregister);
return ret;
}
//ust// EXPORT_SYMBOL_GPL(marker_probe_unregister);
@@
-912,12
+913,12
@@
get_marker_from_private_data(marker_probe_func *probe, void *probe_private)
{
struct marker_entry *entry;
unsigned int i;
{
struct marker_entry *entry;
unsigned int i;
- struct hlist_head *head;
- struct hlist_node *node;
+ struct
cds_
hlist_head *head;
+ struct
cds_
hlist_node *node;
for (i = 0; i < MARKER_TABLE_SIZE; i++) {
head = &marker_table[i];
for (i = 0; i < MARKER_TABLE_SIZE; i++) {
head = &marker_table[i];
- hlist_for_each_entry(entry, node, head, hlist) {
+
cds_
hlist_for_each_entry(entry, node, head, hlist) {
if (!entry->ptype) {
if (entry->single.func == probe
&& entry->single.probe_private
if (!entry->ptype) {
if (entry->single.func == probe
&& entry->single.probe_private
@@
-959,37
+960,37
@@
int marker_probe_unregister_private_data(marker_probe_func *probe,
struct marker_probe_closure *old;
char *channel = NULL, *name = NULL;
struct marker_probe_closure *old;
char *channel = NULL, *name = NULL;
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker_from_private_data(probe, probe_private);
if (!entry) {
ret = -ENOENT;
goto end;
}
//ust// if (entry->rcu_pending)
entry = get_marker_from_private_data(probe, probe_private);
if (!entry) {
ret = -ENOENT;
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);
old = marker_entry_remove_probe(entry, NULL, probe_private);
channel = strdup(entry->channel);
name = strdup(entry->name);
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
marker_update_probes();
marker_update_probes();
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker(channel, name);
if (!entry)
goto end;
//ust// if (entry->rcu_pending)
entry = get_marker(channel, 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 */
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 */
remove_marker(channel, name);
end:
//ust// call_rcu_sched(&entry->rcu, free_old_closure);
synchronize_rcu(); free_old_closure(&entry->rcu);
/* Ignore busy error message */
remove_marker(channel, name);
end:
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
free(channel);
free(name);
return ret;
free(channel);
free(name);
return ret;
@@
-1013,8
+1014,8
@@
end:
void *marker_get_private_data(const char *channel, const char *name,
marker_probe_func *probe, int num)
{
void *marker_get_private_data(const char *channel, const char *name,
marker_probe_func *probe, int num)
{
- struct hlist_head *head;
- struct hlist_node *node;
+ struct
cds_
hlist_head *head;
+ struct
cds_
hlist_node *node;
struct marker_entry *e;
size_t channel_len = strlen(channel) + 1;
size_t name_len = strlen(name) + 1;
struct marker_entry *e;
size_t channel_len = strlen(channel) + 1;
size_t name_len = strlen(name) + 1;
@@
-1023,7
+1024,7
@@
void *marker_get_private_data(const char *channel, const char *name,
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
head = &marker_table[hash & ((1 << MARKER_HASH_BITS)-1)];
- hlist_for_each_entry(e, node, head, hlist) {
+
cds_
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
if (!e->ptype) {
if (num == 0 && e->single.func == probe)
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
if (!e->ptype) {
if (num == 0 && e->single.func == probe)
@@
-1085,8
+1086,8
@@
int lib_get_iter_markers(struct marker_iter *iter)
struct lib *iter_lib;
int found = 0;
struct lib *iter_lib;
int found = 0;
-//ust// mutex_lock(&module_mutex);
- list_for_each_entry(iter_lib, &libs, list) {
+//ust//
pthread_
mutex_lock(&module_mutex);
+
cds_
list_for_each_entry(iter_lib, &libs, list) {
if (iter_lib < iter->lib)
continue;
else if (iter_lib > iter->lib)
if (iter_lib < iter->lib)
continue;
else if (iter_lib > iter->lib)
@@
-1099,7
+1100,7
@@
int lib_get_iter_markers(struct marker_iter *iter)
break;
}
}
break;
}
}
-//ust// mutex_unlock(&module_mutex);
+//ust//
pthread_
mutex_unlock(&module_mutex);
return found;
}
return found;
}
@@
-1178,14
+1179,14
@@
void marker_iter_reset(struct marker_iter *iter)
/*
* must be called with current->user_markers_mutex held
*/
/*
* must be called with current->user_markers_mutex held
*/
-static void free_user_marker(char __user *state, struct hlist_head *head)
+static void free_user_marker(char __user *state, struct
cds_
hlist_head *head)
{
struct user_marker *umark;
{
struct user_marker *umark;
- struct hlist_node *pos, *n;
+ struct
cds_
hlist_node *pos, *n;
- hlist_for_each_entry_safe(umark, pos, n, head, hlist) {
+
cds_
hlist_for_each_entry_safe(umark, pos, n, head, hlist) {
if (umark->state == state) {
if (umark->state == state) {
- hlist_del(&umark->hlist);
+
cds_
hlist_del(&umark->hlist);
free(umark);
}
}
free(umark);
}
}
@@
-1203,8
+1204,8
@@
static void free_user_marker(char __user *state, struct hlist_head *head)
//ust// struct hlist_node *pos;
//ust// struct marker_entry *entry;
//ust//
//ust// struct hlist_node *pos;
//ust// struct marker_entry *entry;
//ust//
-//ust// mutex_lock(&markers_mutex);
-//ust// mutex_lock(¤t->group_leader->user_markers_mutex);
+//ust//
pthread_
mutex_lock(&markers_mutex);
+//ust//
pthread_
mutex_lock(¤t->group_leader->user_markers_mutex);
//ust// if (strcmp(current->comm, "testprog") == 0)
//ust// DBG("do update pending for testprog");
//ust// hlist_for_each_entry(umark, pos,
//ust// if (strcmp(current->comm, "testprog") == 0)
//ust// DBG("do update pending for testprog");
//ust// hlist_for_each_entry(umark, pos,
@@
-1231,8
+1232,8
@@
static void free_user_marker(char __user *state, struct hlist_head *head)
//ust// }
//ust// }
//ust// clear_thread_flag(TIF_MARKER_PENDING);
//ust// }
//ust// }
//ust// clear_thread_flag(TIF_MARKER_PENDING);
-//ust// mutex_unlock(¤t->group_leader->user_markers_mutex);
-//ust// mutex_unlock(&markers_mutex);
+//ust//
pthread_
mutex_unlock(¤t->group_leader->user_markers_mutex);
+//ust//
pthread_
mutex_unlock(&markers_mutex);
//ust// }
/*
//ust// }
/*
@@
-1243,18
+1244,18
@@
static void free_user_marker(char __user *state, struct hlist_head *head)
void exit_user_markers(struct task_struct *p)
{
struct user_marker *umark;
void exit_user_markers(struct task_struct *p)
{
struct user_marker *umark;
- struct hlist_node *pos, *n;
+ struct
cds_
hlist_node *pos, *n;
if (thread_group_leader(p)) {
if (thread_group_leader(p)) {
- mutex_lock(&markers_mutex);
- mutex_lock(&p->user_markers_mutex);
- hlist_for_each_entry_safe(umark, pos, n, &p->user_markers,
+
pthread_
mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&p->user_markers_mutex);
+
cds_
hlist_for_each_entry_safe(umark, pos, n, &p->user_markers,
hlist)
free(umark);
INIT_HLIST_HEAD(&p->user_markers);
p->user_markers_sequence++;
hlist)
free(umark);
INIT_HLIST_HEAD(&p->user_markers);
p->user_markers_sequence++;
- mutex_unlock(&p->user_markers_mutex);
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&p->user_markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
}
}
}
}
@@
-1262,9
+1263,9
@@
int is_marker_enabled(const char *channel, const char *name)
{
struct marker_entry *entry;
{
struct marker_entry *entry;
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
entry = get_marker(channel, name);
entry = get_marker(channel, name);
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
return entry && !!entry->refcount;
}
return entry && !!entry->refcount;
}
@@
-1306,17
+1307,17
@@
void ltt_dump_marker_state(struct ust_trace *trace)
{
struct marker_entry *entry;
struct ltt_probe_private_data call_data;
{
struct marker_entry *entry;
struct ltt_probe_private_data call_data;
- struct hlist_head *head;
- struct hlist_node *node;
+ struct
cds_
hlist_head *head;
+ struct
cds_
hlist_node *node;
unsigned int i;
unsigned int i;
- mutex_lock(&markers_mutex);
+
pthread_
mutex_lock(&markers_mutex);
call_data.trace = trace;
call_data.serializer = NULL;
for (i = 0; i < MARKER_TABLE_SIZE; i++) {
head = &marker_table[i];
call_data.trace = trace;
call_data.serializer = NULL;
for (i = 0; i < MARKER_TABLE_SIZE; i++) {
head = &marker_table[i];
- hlist_for_each_entry(entry, node, head, hlist) {
+
cds_
hlist_for_each_entry(entry, node, head, hlist) {
__trace_mark(0, metadata, core_marker_id,
&call_data,
"channel %s name %s event_id %hu "
__trace_mark(0, metadata, core_marker_id,
&call_data,
"channel %s name %s event_id %hu "
@@
-1338,7
+1339,7
@@
void ltt_dump_marker_state(struct ust_trace *trace)
entry->format);
}
}
entry->format);
}
}
- mutex_unlock(&markers_mutex);
+
pthread_
mutex_unlock(&markers_mutex);
}
//ust// EXPORT_SYMBOL_GPL(ltt_dump_marker_state);
}
//ust// EXPORT_SYMBOL_GPL(ltt_dump_marker_state);
@@
-1363,14
+1364,14
@@
int marker_register_lib(struct marker *markers_start, int markers_count)
{
struct lib *pl;
{
struct lib *pl;
- pl = (struct lib *) malloc(sizeof(struct lib));
+ pl = (struct lib *)
z
malloc(sizeof(struct lib));
pl->markers_start = markers_start;
pl->markers_count = markers_count;
/* FIXME: maybe protect this with its own mutex? */
lock_markers();
pl->markers_start = markers_start;
pl->markers_count = markers_count;
/* 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);
unlock_markers();
new_markers(markers_start, markers_start + markers_count);
@@
-1393,11
+1394,11
@@
int marker_unregister_lib(struct marker *markers_start)
lock_markers();
/* FIXME: we should probably take a mutex here on libs */
lock_markers();
/* FIXME: we should probably take a mutex here on libs */
-//ust// mutex_lock(&module_mutex);
- list_for_each_entry(lib, &libs, list) {
+//ust//
pthread_
mutex_lock(&module_mutex);
+
cds_
list_for_each_entry(lib, &libs, list) {
if(lib->markers_start == markers_start) {
struct lib *lib2free = lib;
if(lib->markers_start == markers_start) {
struct lib *lib2free = lib;
- list_del(&lib->list);
+
cds_
list_del(&lib->list);
free(lib2free);
break;
}
free(lib2free);
break;
}
This page took
0.036558 seconds
and
4
git commands to generate.