#define _LGPL_SOURCE
#include <urcu-bp.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
-#include "marker.h"
+#include <ust/marker.h>
+#include <ust/tracer.h>
#include "usterr.h"
#include "channels.h"
#include "tracercore.h"
-#include "tracer.h"
+
+__thread long ust_reg_stack[500];
+volatile __thread long *ust_reg_stack_ptr = (long *) 0;
extern struct marker __start___markers[] __attribute__((visibility("hidden")));
extern struct marker __stop___markers[] __attribute__((visibility("hidden")));
char *format;
char *name;
/* Probe wrapper */
- void (*call)(const struct marker *mdata, void *call_private, ...);
+ void (*call)(const struct marker *mdata, void *call_private, struct registers *regs, ...);
struct marker_probe_closure single;
struct marker_probe_closure *multi;
int refcount; /* Number of times armed. 0 if disarmed. */
* operations that modifies the execution flow of preemptible code.
*/
notrace void __mark_empty_function(const struct marker *mdata,
- void *probe_private, void *call_private, const char *fmt, va_list *args)
+ void *probe_private, struct registers *regs, void *call_private, const char *fmt, va_list *args)
{
}
//ust// EXPORT_SYMBOL_GPL(__mark_empty_function);
* rcu_dereference() for the pointer read.
*/
notrace void marker_probe_cb(const struct marker *mdata,
- void *call_private, ...)
+ void *call_private, struct registers *regs, ...)
{
va_list args;
char ptype;
/* Must read the ptr before private data. They are not data
* dependant, so we put an explicit smp_rmb() here. */
smp_rmb();
- va_start(args, call_private);
- func(mdata, mdata->single.probe_private, call_private,
+ va_start(args, regs);
+ func(mdata, mdata->single.probe_private, regs, call_private,
mdata->format, &args);
va_end(args);
} else {
*/
smp_read_barrier_depends();
for (i = 0; multi[i].func; i++) {
- va_start(args, call_private);
+ va_start(args, regs);
multi[i].func(mdata, multi[i].probe_private,
- call_private, mdata->format, &args);
+ regs, call_private, mdata->format, &args);
va_end(args);
}
}
* Should be connected to markers "MARK_NOARGS".
*/
static notrace void marker_probe_cb_noarg(const struct marker *mdata,
- void *call_private, ...)
+ void *call_private, struct registers *regs, ...)
{
va_list args; /* not initialized */
char ptype;
/* Must read the ptr before private data. They are not data
* dependant, so we put an explicit smp_rmb() here. */
smp_rmb();
- func(mdata, mdata->single.probe_private, call_private,
+ func(mdata, mdata->single.probe_private, regs, call_private,
mdata->format, &args);
} else {
struct marker_probe_closure *multi;
*/
smp_read_barrier_depends();
for (i = 0; multi[i].func; i++)
- multi[i].func(mdata, multi[i].probe_private,
+ multi[i].func(mdata, multi[i].probe_private, regs,
call_private, mdata->format, &args);
}
//ust// rcu_read_unlock_sched_notrace();