char consumer_stack[10000];
-char trace_name[] = "theusttrace";
-char trace_type[] = "ustrelay";
#define CPRINTF(fmt, args...) safe_printf(fmt "\n", ## args)
struct ltt_trace_struct *trace;
struct consumer_channel *consumer_channels;
int i;
+ char trace_name[] = "auto";
ltt_lock_traces();
trace = _ltt_trace_find(trace_name);
}
consumer_channels = (struct consumer_channel *) malloc(trace->nr_channels * sizeof(struct consumer_channel));
- if(consumer_channels == NULL) {
+if(consumer_channels == NULL) {
ERR("malloc returned NULL");
return 1;
}
{
int result;
- result = clone(consumer, consumer_stack+sizeof(consumer_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM, NULL);
+ result = clone(consumer, consumer_stack+sizeof(consumer_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM | CLONE_SIGHAND | CLONE_THREAD, NULL);
if(result == -1) {
perror("clone");
}
init_int_handler();
- init_ustrelay_transport();
-
- printf("page size is %d\n", sysconf(_SC_PAGE_SIZE));
-
- marker_control_init();
-
- //marker_probe_register("abc", "testmark", "", probe, NULL);
-//ust// marker_probe_register("metadata", "core_marker_id", "channel %s name %s event_id %hu int #1u%zu long #1u%zu pointer #1u%zu size_t #1u%zu alignment #1u%u", probe, NULL);
-//ust// result = ltt_probe_register(&default_probe);
-//ust// if(result)
-//ust// ERR("ltt_probe_register");
-
- //result = ltt_marker_connect("metadata", "testev", "default");
- //if(result)
- // ERR("ltt_marker_connect");
- result = ltt_marker_connect("foo", "bar", "default");
- if(result)
- ERR("ltt_marker_connect");
-
- result = ltt_trace_setup(trace_name);
- if(result < 0) {
- ERR("ltt_trace_setup failed");
- return 1;
- }
-
- result = ltt_trace_set_type(trace_name, trace_type);
- if(result < 0) {
- ERR("ltt_trace_set_type failed");
- return 1;
- }
-
- result = ltt_trace_alloc(trace_name);
- if(result < 0) {
- ERR("ltt_trace_alloc failed");
- return 1;
- }
-
- result = ltt_trace_start(trace_name);
- if(result < 0) {
- ERR("ltt_trace_start failed");
- return 1;
- }
-
start_consumer();
printf("Hello, World!\n");
sleep(1);
for(i=0; i<50; i++) {
- //trace_mark(abc, testmark, "", MARK_NOARGS);
- //trace_mark(metadata, testev, "", MARK_NOARGS);
trace_mark(foo, bar, "%s", "FOOBAZ");
- //trace_mark(metadata, core_marker_id,
- // "channel %s name %s event_id %hu "
- // "int #1u%zu long #1u%zu pointer #1u%zu "
- // "size_t #1u%zu alignment #1u%u",
- // "abc", "def", (unsigned short)1000,
- // sizeof(int), sizeof(long), sizeof(void *),
- // sizeof(size_t), ltt_get_alignment());
usleep(100000);
}
- ltt_trace_stop(trace_name);
- ltt_trace_destroy(trace_name);
+ ltt_trace_stop("auto");
+ ltt_trace_destroy("auto");
scanf("%*s");
return 0;
}
+
+MARKER_LIB