projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix conditional compilation of gdb support
[lttng-ust.git]
/
libust
/
marker.c
diff --git
a/libust/marker.c
b/libust/marker.c
index 8b120195677690186839884ab5cfbb940546bef7..d9cb88fca96b7c0f8521e32b1c270ed1ae549df7 100644
(file)
--- a/
libust/marker.c
+++ b/
libust/marker.c
@@
-33,18
+33,24
@@
#define _LGPL_SOURCE
#include <urcu-bp.h>
#define _LGPL_SOURCE
#include <urcu-bp.h>
-#include
"kernelcompat.h"
+#include
<ust/kernelcompat.h>
-#include
"marker.h"
+#include
<ust/marker.h>
#include "usterr.h"
#include "channels.h"
#include "tracercore.h"
#include "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")));
extern struct marker __start___markers[] __attribute__((visibility("hidden")));
extern struct marker __stop___markers[] __attribute__((visibility("hidden")));
+
+#ifdef CONFIG_UST_GDB_INTEGRATION
extern struct marker_addr __start___marker_addr[] __attribute__((visibility("hidden")));
extern struct marker_addr __stop___marker_addr[] __attribute__((visibility("hidden")));
extern struct marker_addr __start___marker_addr[] __attribute__((visibility("hidden")));
extern struct marker_addr __stop___marker_addr[] __attribute__((visibility("hidden")));
+#endif
/* Set to 1 to enable marker debug output */
static const int marker_debug;
/* Set to 1 to enable marker debug output */
static const int marker_debug;
@@
-89,7
+95,7
@@
struct marker_entry {
char *format;
char *name;
/* Probe wrapper */
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. */
struct marker_probe_closure single;
struct marker_probe_closure *multi;
int refcount; /* Number of times armed. 0 if disarmed. */
@@
-125,7
+131,7
@@
static void marker_update_processes(void)
* operations that modifies the execution flow of preemptible code.
*/
notrace void __mark_empty_function(const struct marker *mdata,
* 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);
{
}
//ust// EXPORT_SYMBOL_GPL(__mark_empty_function);
@@
-141,7
+147,7
@@
notrace void __mark_empty_function(const struct marker *mdata,
* 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,
- void *call_private, ...)
+ void *call_private,
struct registers *regs,
...)
{
va_list args;
char ptype;
{
va_list args;
char ptype;
@@
-162,8
+168,8
@@
notrace void marker_probe_cb(const struct marker *mdata,
/* Must read the ptr before private data. They are not data
* dependant, so we put an explicit smp_rmb() here. */
smp_rmb();
/* 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 {
mdata->format, &args);
va_end(args);
} else {
@@
-183,9
+189,9
@@
notrace void marker_probe_cb(const struct marker *mdata,
*/
smp_read_barrier_depends();
for (i = 0; multi[i].func; i++) {
*/
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,
multi[i].func(mdata, multi[i].probe_private,
- call_private, mdata->format, &args);
+
regs,
call_private, mdata->format, &args);
va_end(args);
}
}
va_end(args);
}
}
@@
-202,7
+208,7
@@
notrace void marker_probe_cb(const struct marker *mdata,
* Should be connected to markers "MARK_NOARGS".
*/
static notrace void marker_probe_cb_noarg(const struct marker *mdata,
* 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;
{
va_list args; /* not initialized */
char ptype;
@@
-218,7
+224,7
@@
static notrace void marker_probe_cb_noarg(const struct marker *mdata,
/* Must read the ptr before private data. They are not data
* dependant, so we put an explicit smp_rmb() here. */
smp_rmb();
/* 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;
mdata->format, &args);
} else {
struct marker_probe_closure *multi;
@@
-237,7
+243,7
@@
static notrace void marker_probe_cb_noarg(const struct marker *mdata,
*/
smp_read_barrier_depends();
for (i = 0; multi[i].func; i++)
*/
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();
call_private, mdata->format, &args);
}
//ust// rcu_read_unlock_sched_notrace();
@@
-1506,13
+1512,17
@@
int marker_register_lib(struct marker *markers_start, struct marker_addr *marker
pl = (struct lib *) malloc(sizeof(struct lib));
pl->markers_start = markers_start;
pl = (struct lib *) malloc(sizeof(struct lib));
pl->markers_start = markers_start;
+#ifdef CONFIG_UST_GDB_INTEGRATION
pl->markers_addr_start = marker_addr_start;
pl->markers_addr_start = marker_addr_start;
+#endif
pl->markers_count = markers_count;
pl->markers_count = markers_count;
+#ifdef CONFIG_UST_GDB_INTEGRATION
lock_markers();
for(addr = marker_addr_start; addr < marker_addr_start + markers_count; addr++)
addr->marker->location = addr->addr;
unlock_markers();
lock_markers();
for(addr = marker_addr_start; addr < marker_addr_start + markers_count; addr++)
addr->marker->location = addr->addr;
unlock_markers();
+#endif
/* FIXME: maybe protect this with its own mutex? */
lock_markers();
/* FIXME: maybe protect this with its own mutex? */
lock_markers();
@@
-1542,7
+1552,11
@@
static int initialized = 0;
void __attribute__((constructor)) init_markers(void)
{
if(!initialized) {
void __attribute__((constructor)) init_markers(void)
{
if(!initialized) {
+#ifdef CONFIG_UST_GDB_INTEGRATION
marker_register_lib(__start___markers, __start___marker_addr, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker));
marker_register_lib(__start___markers, __start___marker_addr, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker));
+#else
+ marker_register_lib(__start___markers, NULL, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker));
+#endif
//DBG("markers_start: %p, markers_stop: %p\n", __start___markers, __stop___markers);
initialized = 1;
}
//DBG("markers_start: %p, markers_stop: %p\n", __start___markers, __stop___markers);
initialized = 1;
}
This page took
0.026174 seconds
and
4
git commands to generate.