nobase_include_HEADERS = \
- ust/immediate.h \
ust/marker.h \
ust/tracepoint.h \
ust/define_trace.h \
+++ /dev/null
-#ifndef _LINUX_IMMEDIATE_H
-#define _LINUX_IMMEDIATE_H
-
-/*
- * Immediate values, can be updated at runtime and save cache lines.
- *
- * (C) Copyright 2007 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef USE_IMMEDIATE
-
-#include <asm/immediate.h>
-
-/**
- * imv_set - set immediate variable (with locking)
- * @name: immediate value name
- * @i: required value
- *
- * Sets the value of @name, taking the module_mutex if required by
- * the architecture.
- */
-#define imv_set(name, i) \
- do { \
- name##__imv = (i); \
- core_imv_update(); \
- module_imv_update(); \
- } while (0)
-
-/*
- * Internal update functions.
- */
-extern void core_imv_update(void);
-extern void imv_update_range(const struct __imv *begin,
- const struct __imv *end);
-extern void imv_unref_core_init(void);
-extern void imv_unref(struct __imv *begin, struct __imv *end, void *start,
- unsigned long size);
-
-#else
-
-/*
- * Generic immediate values: a simple, standard, memory load.
- */
-
-/**
- * imv_read - read immediate variable
- * @name: immediate value name
- *
- * Reads the value of @name.
- */
-#define imv_read(name) _imv_read(name)
-
-/**
- * imv_set - set immediate variable (with locking)
- * @name: immediate value name
- * @i: required value
- *
- * Sets the value of @name, taking the module_mutex if required by
- * the architecture.
- */
-#define imv_set(name, i) (name##__imv = (i))
-
-static inline void core_imv_update(void) { }
-static inline void imv_unref_core_init(void) { }
-
-#endif
-
-#define DECLARE_IMV(type, name) extern __typeof__(type) name##__imv
-#define DEFINE_IMV(type, name) __typeof__(type) name##__imv
-
-#define EXPORT_IMV_SYMBOL(name) EXPORT_SYMBOL(name##__imv)
-#define EXPORT_IMV_SYMBOL_GPL(name) EXPORT_SYMBOL_GPL(name##__imv)
-
-/**
- * _imv_read - Read immediate value with standard memory load.
- * @name: immediate value name
- *
- * Force a data read of the immediate value instead of the immediate value
- * based mechanism. Useful for __init and __exit section data read.
- */
-#define _imv_read(name) (name##__imv)
-
-#endif
#define _UST_MARKER_H
#include <stdarg.h>
-#include <ust/immediate.h>
#include <ust/core.h>
#include <urcu/list.h>
#include <ust/processor.h>
const char *format; /* Marker format string, describing the
* variable argument list.
*/
- DEFINE_IMV(char, state);/* Immediate value state. */
+ char state; /* State. */
char ptype; /* probe type : 0 : single, 1 : multi */
/* Probe wrapper */
u16 channel_id; /* Numeric channel identifier, dynamic */
* Make sure the alignment of the structure in the __ust_marker section will
* not add unwanted padding between the beginning of the section and the
* structure. Force alignment to the same alignment as the section start.
- *
- * The "generic" argument controls which marker enabling mechanism must be used.
- * If generic is true, a variable read is used.
- * If generic is false, immediate values are used.
*/
-#define __ust_marker(generic, channel, name, call_private, format, args...) \
- __ust_marker_counter(generic, channel, name, __LINE__, call_private, format, ## args)
+#define __ust_marker(channel, name, call_private, format, args...) \
+ __ust_marker_counter(channel, name, __LINE__, call_private, format, ## args)
-#define __ust_marker_counter(generic, channel, name, unique, call_private, format, args...) \
+#define __ust_marker_counter(channel, name, unique, call_private, format, args...) \
do { \
struct ust_marker *__ust_marker_counter_ptr; \
_DEFINE_UST_MARKER(channel, name, NULL, NULL, format, unique, __ust_marker_counter_ptr); \
__ust_marker_check_format(format, ## args); \
- if (!generic) { \
- if (unlikely(imv_read(__ust_marker_counter_ptr->state))) \
- (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args); \
- } else { \
- if (unlikely(_imv_read(__ust_marker_counter_ptr->state))) \
- (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args); \
- } \
+ if (unlikely(__ust_marker_counter_ptr->state)) \
+ (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args); \
} while (0)
#define __ust_marker_tp(channel, name, call_private, tp_name, tp_cb, format, args...) \
* @format: format string
* @args...: variable argument list
*
- * Places a marker using optimized code patching technique (imv_read())
- * to be enabled when immediate values are present.
+ * Places a marker at caller site.
*/
#define ust_marker(name, format, args...) \
- __ust_marker(0, ust, name, NULL, format, ## args)
-
-/**
- * _ust_marker - Marker using variable read
- * @name: marker name, not quoted.
- * @format: format string
- * @args...: variable argument list
- *
- * Places a marker using a standard memory read (_imv_read()) to be
- * enabled. Should be used for markers in code paths where instruction
- * modification based enabling is not welcome.
- */
-#define _ust_marker(name, format, args...) \
- __ust_marker(1, ust, name, NULL, format, ## args)
+ __ust_marker(ust, name, NULL, format, ## args)
/**
* ust_marker_tp - Marker in a tracepoint callback
#define _LGPL_SOURCE
#include <urcu-bp.h>
-#include <ust/immediate.h>
#include <ust/core.h>
struct module;
struct tracepoint {
const char *name; /* Tracepoint name */
- DEFINE_IMV(char, state); /* State. */
+ char state; /* State. */
struct probe *probes;
};
rcu_read_unlock(); \
} while (0)
-#define __CHECK_TRACE(name, generic, proto, args) \
+#define __CHECK_TRACE(name, proto, args) \
do { \
- if (!generic) { \
- if (unlikely(imv_read(__tracepoint_##name.state))) \
- __DO_TRACE(&__tracepoint_##name, \
- TP_PROTO(proto), TP_ARGS(args)); \
- } else { \
- if (unlikely(_imv_read(__tracepoint_##name.state))) \
- __DO_TRACE(&__tracepoint_##name, \
- TP_PROTO(proto), TP_ARGS(args)); \
- } \
+ if (unlikely(__tracepoint_##name.state)) \
+ __DO_TRACE(&__tracepoint_##name, \
+ TP_PROTO(proto), TP_ARGS(args)); \
} while (0)
/*
* Make sure the alignment of the structure in the __tracepoints section will
* not add unwanted padding between the beginning of the section and the
* structure. Force alignment to the same alignment as the section start.
- *
- * The "generic" argument, passed to the declared __trace_##name inline
- * function controls which tracepoint enabling mechanism must be used.
- * If generic is true, a variable read is used.
- * If generic is false, immediate values are used.
*/
#define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \
extern struct tracepoint __tracepoint_##name; \
static inline void __trace_##name(proto) \
{ \
- __CHECK_TRACE(name, 0, TP_PROTO(data_proto), \
- TP_ARGS(data_args)); \
- } \
- static inline void _trace_##name(proto) \
- { \
- __CHECK_TRACE(name, 1, TP_PROTO(data_proto), \
+ __CHECK_TRACE(name, TP_PROTO(data_proto), \
TP_ARGS(data_args)); \
} \
static inline int \
#ifndef UST_H
#define UST_H
-#include <ust/immediate.h>
#include <ust/marker.h>
#include <ust/processor.h>
#include <ust/tracepoint.h>
e->call = ust_marker_probe_cb_noarg;
else
e->call = ust_marker_probe_cb;
- __ust_marker(0, metadata, core_marker_format, NULL,
+ __ust_marker(metadata, core_marker_format, NULL,
"channel %s name %s format %s",
e->channel, e->name, e->format);
} else {
return -ENOMEM;
entry->format_allocated = 1;
- __ust_marker(0, metadata, core_marker_format, NULL,
+ __ust_marker(metadata, core_marker_format, NULL,
"channel %s name %s format %s",
entry->channel, entry->name, entry->format);
return 0;
cmm_smp_wmb();
elem->ptype = entry->ptype;
- if (elem->tp_name && (active ^ _imv_read(elem->state))) {
+ if (elem->tp_name && (active ^ elem->state)) {
WARN_ON(!elem->tp_cb);
/*
* It is ok to directly call the probe registration because type
//ust// (unsigned long)elem->tp_cb));
}
}
- elem->state__imv = active;
+ elem->state = active;
return ret;
}
int ret;
/* leave "call" as is. It is known statically. */
- if (elem->tp_name && _imv_read(elem->state)) {
+ if (elem->tp_name && elem->state) {
WARN_ON(!elem->tp_cb);
/*
* It is ok to directly call the probe registration because type
*/
//ust// module_put(__module_text_address((unsigned long)elem->tp_cb));
}
- elem->state__imv = 0;
+ elem->state = 0;
elem->single.func = __ust_marker_empty_function;
/* Update the function before setting the ptype */
cmm_smp_wmb();
{
lib_update_ust_marker();
tracepoint_probe_update_all();
- /* Update immediate values */
- core_imv_update();
-//ust// module_imv_update(); /* FIXME: need to port for libs? */
ust_marker_update_processes();
}
goto error_unregister_channel;
entry->event_id = ret;
ret = 0;
- __ust_marker(0, metadata, core_marker_id, NULL,
+ __ust_marker(metadata, core_marker_id, NULL,
"channel %s name %s event_id %hu "
"int #1u%zu long #1u%zu pointer #1u%zu "
"size_t #1u%zu alignment #1u%u",
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(0, metadata, core_marker_id,
+ __ust_marker(metadata, core_marker_id,
&call_data,
"channel %s name %s event_id %hu "
"int #1u%zu long #1u%zu pointer #1u%zu "
sizeof(void *), sizeof(size_t),
ltt_get_alignment());
if (entry->format)
- __ust_marker(0, metadata,
+ __ust_marker(metadata,
core_marker_format,
&call_data,
"channel %s name %s format %s",
fprintf(fp, "ust_marker: %s/%s %d \"%s\" %p\n",
(*iter.ust_marker)->channel,
(*iter.ust_marker)->name,
- (int)imv_read((*iter.ust_marker)->state),
+ (int)(*iter.ust_marker)->state,
(*iter.ust_marker)->format,
(*iter.ust_marker)->location);
ust_marker_iter_next(&iter);
* is used.
*/
rcu_assign_pointer(elem->probes, (*entry)->probes);
- elem->state__imv = active;
+ elem->state = active;
}
/*
*/
static void disable_tracepoint(struct tracepoint *elem)
{
- elem->state__imv = 0;
+ elem->state = 0;
rcu_assign_pointer(elem->probes, NULL);
}
//ust// __stop___tracepoints);
/* tracepoints in modules. */
lib_update_tracepoints();
- /* Update immediate values */
- core_imv_update();
-//ust// module_imv_update();
}
static struct probe *