/* ... set values of v and st ... */
/* a marker: */
- trace_mark(ust, myevent, "firstarg %d secondarg %s", v, st);
+ ust_marker(ust, myevent, "firstarg %d secondarg %s", v, st);
/* a marker without arguments: */
- trace_mark(ust, myotherevent, MARK_NOARGS);
+ ust_marker(ust, myotherevent, MARK_NOARGS);
return 0;
}
/* ... set values of v and st ... */
/* a marker: */
- trace_mark(main, myevent, "firstarg %d secondarg %s", v, st);
+ ust_marker(main, myevent, "firstarg %d secondarg %s", v, st);
/* another marker without arguments: */
- trace_mark(main, myotherevent, MARK_NOARGS);
+ ust_marker(main, myotherevent, MARK_NOARGS);
return 0;
}
@end verbatim
@end example
-The invocation of the trace_mark() macro requires at least 3 arguments. The
+The invocation of the ust_marker() macro requires at least 3 arguments. The
first, here "main", is the name of the event category. It is also the name of
the channel the event will go in. The second, here "myevent" is the name of the
event. The third is a format string that announces the names and the types of
void mychannel_myevent_probe(int v, char *st)
{
- trace_mark(mychannel, myevent, "v %d st %s", v, st);
+ ust_marker(mychannel, myevent, "v %d st %s", v, st);
}
static void __attribute__((constructor)) init()
* If generic is false, immediate values are used.
*/
-#define __trace_mark(generic, channel, name, call_private, format, args...) \
- __trace_mark_counter(generic, channel, name, __LINE__, call_private, format, ## args)
+#define __ust_marker(generic, channel, name, call_private, format, args...) \
+ __ust_marker_counter(generic, channel, name, __LINE__, call_private, format, ## args)
-#define __trace_mark_counter(generic, channel, name, unique, call_private, format, args...) \
+#define __ust_marker_counter(generic, channel, name, unique, call_private, format, args...) \
do { \
struct marker *__marker_counter_ptr; \
_DEFINE_MARKER(channel, name, NULL, NULL, format, unique, __marker_counter_ptr); \
} \
} while (0)
-#define __trace_mark_tp(channel, name, call_private, tp_name, tp_cb, format, args...) \
- __trace_mark_tp_counter(channel, name, __LINE__, call_private, tp_name, tp_cb, format, ## args)
+#define __ust_marker_tp(channel, name, call_private, tp_name, tp_cb, format, args...) \
+ __ust_marker_tp_counter(channel, name, __LINE__, call_private, tp_name, tp_cb, format, ## args)
-#define __trace_mark_tp_counter(channel, name, unique, call_private, tp_name, tp_cb, format, args...) \
+#define __ust_marker_tp_counter(channel, name, unique, call_private, tp_name, tp_cb, format, args...) \
do { \
struct registers __marker_regs; \
void __check_tp_type(void) \
struct marker * const *end);
/**
- * trace_mark - Marker using code patching
+ * ust_marker - Marker using code patching
* @name: marker name, not quoted.
* @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.
*/
-#define trace_mark(name, format, args...) \
- __trace_mark(0, ust, name, NULL, format, ## args)
+#define ust_marker(name, format, args...) \
+ __ust_marker(0, ust, name, NULL, format, ## args)
/**
- * _trace_mark - Marker using variable read
+ * _ust_marker - Marker using variable read
* @name: marker name, not quoted.
* @format: format string
* @args...: variable argument list
* enabled. Should be used for markers in code paths where instruction
* modification based enabling is not welcome.
*/
-#define _trace_mark(name, format, args...) \
- __trace_mark(1, ust, name, NULL, format, ## args)
+#define _ust_marker(name, format, args...) \
+ __ust_marker(1, ust, name, NULL, format, ## args)
/**
- * trace_mark_tp - Marker in a tracepoint callback
+ * ust_marker_tp - Marker in a tracepoint callback
* @name: marker name, not quoted.
* @tp_name: tracepoint name, not quoted.
* @tp_cb: tracepoint callback. Should have an associated global symbol so it
*
* Places a marker in a tracepoint callback.
*/
-#define trace_mark_tp(name, tp_name, tp_cb, format, args...) \
- __trace_mark_tp(ust, name, NULL, tp_name, tp_cb, format, ## args)
+#define ust_marker_tp(name, tp_name, tp_cb, format, args...) \
+ __ust_marker_tp(ust, name, NULL, tp_name, tp_cb, format, ## args)
/**
* MARK_NOARGS - Format string for a marker with no argument.
const char *ev_name_cstr = (*env)->GetStringUTFChars(env, ev_name, &iscopy);
const char *args_cstr = (*env)->GetStringUTFChars(env, args, &iscopy);
- trace_mark(ust, java_event, "name %s args %s", ev_name_cstr, args_cstr);
+ ust_marker(ust, java_event, "name %s args %s", ev_name_cstr, args_cstr);
}
MARKER_LIB
e->call = marker_probe_cb_noarg;
else
e->call = marker_probe_cb;
- __trace_mark(0, metadata, core_marker_format, NULL,
+ __ust_marker(0, metadata, core_marker_format, NULL,
"channel %s name %s format %s",
e->channel, e->name, e->format);
} else {
return -ENOMEM;
entry->format_allocated = 1;
- __trace_mark(0, metadata, core_marker_format, NULL,
+ __ust_marker(0, metadata, core_marker_format, NULL,
"channel %s name %s format %s",
entry->channel, entry->name, entry->format);
return 0;
WARN_ON(!elem->tp_cb);
/*
* It is ok to directly call the probe registration because type
- * checking has been done in the __trace_mark_tp() macro.
+ * checking has been done in the __ust_marker_tp() macro.
*/
if (active) {
WARN_ON(!elem->tp_cb);
/*
* It is ok to directly call the probe registration because type
- * checking has been done in the __trace_mark_tp() macro.
+ * checking has been done in the __ust_marker_tp() macro.
*/
ret = tracepoint_probe_unregister_noupdate(elem->tp_name,
elem->tp_cb, NULL);
goto error_unregister_channel;
entry->event_id = ret;
ret = 0;
- __trace_mark(0, metadata, core_marker_id, NULL,
+ __ust_marker(0, 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 < MARKER_TABLE_SIZE; i++) {
head = &marker_table[i];
cds_hlist_for_each_entry(entry, node, head, hlist) {
- __trace_mark(0, metadata, core_marker_id,
+ __ust_marker(0, 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)
- __trace_mark(0, metadata,
+ __ust_marker(0, metadata,
core_marker_format,
&call_data,
"channel %s name %s format %s",
void ust_potential_exec(void)
{
- trace_mark(potential_exec, MARK_NOARGS);
+ ust_marker(potential_exec, MARK_NOARGS);
DBG("test");
} \
} \
\
- trace_mark(ust, __I_FUNC_NAME, __I_TRACE_FMT, __I_TRACE_ARGS); \
+ ust_marker(ust, __I_FUNC_NAME, __I_TRACE_FMT, __I_TRACE_ARGS); \
\
return plibc_ ## __I_FUNC_NAME (__I_CALL_ARGS); \
}
retval = plibc_malloc(size);
- trace_mark(malloc, "size %d ptr %p", (int)size, retval);
+ ust_marker(malloc, "size %d ptr %p", (int)size, retval);
return retval;
}
}
}
- trace_mark(free, "ptr %p", ptr);
+ ust_marker(free, "ptr %p", ptr);
plibc_free(ptr);
}
printf("Basic test program\n");
for(i=0; i<50; i++) {
- trace_mark(bar, "str %s", "FOOBAZ");
- trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+ ust_marker(bar, "str %s", "FOOBAZ");
+ ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
usleep(100000);
}
printf("Basic test program\n");
for(;;) {
- trace_mark(bar, "str %s", "FOOBAZ");
- trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+ ust_marker(bar, "str %s", "FOOBAZ");
+ ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
usleep(1000000);
}
time(NULL);
#ifdef MARKER
- trace_mark(event, "event %d", v);
+ ust_marker(event, "event %d", v);
#endif
}
{
int (*fptr)();
- trace_mark(from_main_before_lib, "%s", "Event occured in the main program before"
+ ust_marker(from_main_before_lib, "%s", "Event occured in the main program before"
" the opening of the library\n");
void *lib_handle = dlopen("libdummy.so", RTLD_LAZY);
(*fptr)();
dlclose(lib_handle);
- trace_mark(from_main_after_lib,"%s", "Event occured in the main program after "
+ ust_marker(from_main_after_lib,"%s", "Event occured in the main program after "
"the library has been closed\n");
return 0;
void exported_function()
{
- trace_mark(from_library, "%s", "Event occured in library function");
+ ust_marker(from_library, "%s", "Event occured in library function");
}
}
printf("Fork test program, parent pid is %d\n", getpid());
- trace_mark(before_fork, MARK_NOARGS);
+ ust_marker(before_fork, MARK_NOARGS);
/* Sleep here to make sure the consumer is initialized before we fork */
sleep(1);
printf("Child pid is %d\n", getpid());
- trace_mark(after_fork_child, MARK_NOARGS);
+ ust_marker(after_fork_child, MARK_NOARGS);
- trace_mark(before_exec, "pid %d", getpid());
+ ust_marker(before_exec, "pid %d", getpid());
result = execve(argv[1], args, env);
if(result == -1) {
return 1;
}
- trace_mark(after_exec, "pid %d", getpid());
+ ust_marker(after_exec, "pid %d", getpid());
}
else {
- trace_mark(after_fork_parent, MARK_NOARGS);
+ ust_marker(after_fork_parent, MARK_NOARGS);
}
return 0;
{
printf("IN FORK2\n");
- trace_mark(after_exec, MARK_NOARGS);
+ ust_marker(after_exec, MARK_NOARGS);
return 0;
}
sleep(1);
for(i=0; i<50; i++) {
- trace_mark(bar, "str %s", "FOOBAZ");
- trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+ ust_marker(bar, "str %s", "FOOBAZ");
+ ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
trace_hello_tptest(i);
usleep(100000);
}
printf("Hello, World!\n");
for(i=0; i<500; i++) {
- trace_mark(bar, "str %d", i);
- trace_mark(bar2, "number1 %d number2 %d", (int)53, (int)9800);
+ ust_marker(bar, "str %d", i);
+ ust_marker(bar2, "number1 %d number2 %d", (int)53, (int)9800);
}
// ltt_trace_stop("auto");
child_pid = fork();
if (child_pid) {
for(i=0; i<10; i++) {
- trace_mark(bar, "str %s", "FOOBAZ");
- trace_mark(bar2, "number1 %d number2 %d", 53, 9800);
+ ust_marker(bar, "str %s", "FOOBAZ");
+ ust_marker(bar2, "number1 %d number2 %d", 53, 9800);
usleep(100000);
}
void myfunc(void)
{
- trace_mark(in_lib, MARK_NOARGS);
+ ust_marker(in_lib, MARK_NOARGS);
printf("testfunc\n");
}
int main(void)
{
myfunc();
- trace_mark(in_prog, MARK_NOARGS);
+ ust_marker(in_prog, MARK_NOARGS);
return 0;
}
int main()
{
- trace_mark(same_line_event, "%s","An event occured in the same line"); trace_mark(same_line_event, "%s","An event occured in the same line");
+ ust_marker(same_line_event, "%s","An event occured in the same line"); ust_marker(same_line_event, "%s","An event occured in the same line");
return 0;
}
int i;
for(i=0; i<N_ITER; i++) {
- trace_mark(an_event, "%d", i);
- trace_mark(another_event, "%s", "Hello, World!");
+ ust_marker(an_event, "%d", i);
+ ust_marker(another_event, "%s", "Hello, World!");
}
return 0;
*/
/*
- * This test is aimed at testing tracepoint *with* trace_mark :
+ * This test is aimed at testing tracepoint *with* ust_marker :
*
* 1) tracepoint named : "ust_event"
* -) Probe 1 registered and recording the value 42
*/
/*
- * This test is aimed at testing tracepoint *with* trace_mark :
+ * This test is aimed at testing tracepoint *with* ust_marker :
*
* 1) tracepoint named : "ust_event"
* -) Probe 1 registered and recording the value 13 (x5)
{
int i;
for (i = 0; i < 100; i++) {
- trace_mark_tp(event2, ust_event2, tp_probe4, "probe4 %u", p4);
+ ust_marker_tp(event2, ust_event2, tp_probe4, "probe4 %u", p4);
}
}
{
struct message *msg;
msg = (struct message*) data;
- trace_mark_tp(event_msg, ust_event_msg,
+ ust_marker_tp(event_msg, ust_event_msg,
tp_probe3, "probe %s", msg->payload);
}
{
int i;
for (i = 0; i < 5; i++) {
- trace_mark_tp(event, ust_event, tp_probe2, "probe %u", 13);
+ ust_marker_tp(event, ust_event, tp_probe2, "probe %u", 13);
}
}
{
int i;
for (i = 0; i < 5; i++) {
- trace_mark_tp(event, ust_event, tp_probe, "probe %u", p1);
+ ust_marker_tp(event, ust_event, tp_probe, "probe %u", p1);
}
}