/*
- * Copyright (C) 2007 Mathieu Desnoyers
+ * Copyright (C) 2007-2011 Mathieu Desnoyers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <ust/core.h>
#include <ust/marker.h>
#include <ust/tracepoint.h>
+#include <ust/tracepoint-internal.h>
#include "usterr_signal_safe.h"
#include "channels.h"
* ust_marker hash table, containing the active ust_marker.
* Protected by module_mutex.
*/
-#define ust_marker_HASH_BITS 6
-#define ust_marker_TABLE_SIZE (1 << ust_marker_HASH_BITS)
-static struct cds_hlist_head ust_marker_table[ust_marker_TABLE_SIZE];
+#define UST_MARKER_HASH_BITS 6
+#define UST_MARKER_TABLE_SIZE (1 << UST_MARKER_HASH_BITS)
+static struct cds_hlist_head ust_marker_table[UST_MARKER_TABLE_SIZE];
/*
* Note about RCU :
char *format;
char *name;
/* Probe wrapper */
- void (*call)(const struct ust_marker *mdata, void *call_private, struct registers *regs, ...);
+ void (*call)(const struct ust_marker *mdata, void *call_private, ...);
struct ust_marker_probe_closure single;
struct ust_marker_probe_closure *multi;
int refcount; /* Number of times armed. 0 if disarmed. */
* execution flow of preemptible code.
*/
notrace void __ust_marker_empty_function(const struct ust_marker *mdata,
- void *probe_private, struct registers *regs, void *call_private, const char *fmt, va_list *args)
+ void *probe_private, void *call_private, const char *fmt, va_list *args)
{
}
//ust// EXPORT_SYMBOL_GPL(__ust_marker_empty_function);
* rcu_dereference() for the pointer read.
*/
notrace void ust_marker_probe_cb(const struct ust_marker *mdata,
- void *call_private, struct registers *regs, ...)
+ void *call_private, ...)
{
va_list args;
char ptype;
/* Must read the ptr before private data. They are not data
* 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,
+ va_start(args, call_private);
+ func(mdata, mdata->single.probe_private, call_private,
mdata->format, &args);
va_end(args);
} else {
*/
cmm_smp_read_barrier_depends();
for (i = 0; multi[i].func; i++) {
- va_start(args, regs);
+ va_start(args, call_private);
multi[i].func(mdata, multi[i].probe_private,
- regs, call_private, mdata->format, &args);
+ call_private, mdata->format, &args);
va_end(args);
}
}
* Should be connected to ust_marker "UST_MARKER_NOARGS".
*/
static notrace void ust_marker_probe_cb_noarg(const struct ust_marker *mdata,
- void *call_private, struct registers *regs, ...)
+ void *call_private, ...)
{
va_list args; /* not initialized */
char ptype;
/* Must read the ptr before private data. They are not data
* dependant, so we put an explicit cmm_smp_rmb() here. */
cmm_smp_rmb();
- func(mdata, mdata->single.probe_private, regs, call_private,
+ func(mdata, mdata->single.probe_private, call_private,
mdata->format, &args);
} else {
struct ust_marker_probe_closure *multi;
*/
cmm_smp_read_barrier_depends();
for (i = 0; multi[i].func; i++)
- multi[i].func(mdata, multi[i].probe_private, regs,
+ multi[i].func(mdata, multi[i].probe_private,
call_private, mdata->format, &args);
}
//ust// rcu_read_unlock_sched_notrace();
u32 hash;
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
- head = &ust_marker_table[hash & ((1 << ust_marker_HASH_BITS)-1)];
+ head = &ust_marker_table[hash & ((1 << UST_MARKER_HASH_BITS)-1)];
cds_hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name))
return e;
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
if (format)
format_len = strlen(format) + 1;
- head = &ust_marker_table[hash & ((1 << ust_marker_HASH_BITS)-1)];
+ head = &ust_marker_table[hash & ((1 << UST_MARKER_HASH_BITS)-1)];
cds_hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
DBG("ust_marker %s.%s busy", channel, name);
int ret;
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
- head = &ust_marker_table[hash & ((1 << ust_marker_HASH_BITS)-1)];
+ head = &ust_marker_table[hash & ((1 << UST_MARKER_HASH_BITS)-1)];
cds_hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
found = 1;
struct cds_hlist_head *head;
struct cds_hlist_node *node;
- for (i = 0; i < ust_marker_TABLE_SIZE; i++) {
+ for (i = 0; i < UST_MARKER_TABLE_SIZE; i++) {
head = &ust_marker_table[i];
cds_hlist_for_each_entry(entry, node, head, hlist) {
if (!entry->ptype) {
u32 hash;
hash = jhash(channel, channel_len-1, 0) ^ jhash(name, name_len-1, 0);
- head = &ust_marker_table[hash & ((1 << ust_marker_HASH_BITS)-1)];
+ head = &ust_marker_table[hash & ((1 << UST_MARKER_HASH_BITS)-1)];
cds_hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(channel, e->channel) && !strcmp(name, e->name)) {
if (!e->ptype) {
//ust// struct hlist_node *node;
//ust// int ret;
//ust//
-//ust// for (i = 0; i < ust_marker_TABLE_SIZE; i++) {
+//ust// for (i = 0; i < UST_MARKER_TABLE_SIZE; i++) {
//ust// head = &ust_marker_table[i];
//ust// hlist_for_each_entry(entry, node, head, hlist) {
//ust// ret = ltt_channels_get_index_from_name(entry->channel);
//ust// }
//ust// }
//ust// }
-//ust// clear_thread_flag(TIF_ust_marker_PENDING);
+//ust// clear_thread_flag(TIF_UST_MARKER_PENDING);
//ust// pthread_mutex_unlock(¤t->group_leader->user_ust_marker_mutex);
//ust// pthread_mutex_unlock(&ust_marker_mutex);
//ust// }
call_data.trace = trace;
call_data.serializer = NULL;
- for (i = 0; i < ust_marker_TABLE_SIZE; i++) {
+ for (i = 0; i < UST_MARKER_TABLE_SIZE; i++) {
head = &ust_marker_table[i];
cds_hlist_for_each_entry(entry, node, head, hlist) {
__ust_marker(metadata, core_marker_id,