From: Pierre-Marc Fournier Date: Wed, 18 Feb 2009 00:06:45 +0000 (-0500) Subject: ust: cleanup hello.c X-Git-Tag: v1.9.1~1062 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=54d6c4f2322470b741653a49711c507023e4f48a;p=lttng-ust.git ust: cleanup hello.c --- diff --git a/hello/hello.c b/hello/hello.c index b4f5216e..d6429f13 100644 --- a/hello/hello.c +++ b/hello/hello.c @@ -200,26 +200,6 @@ int main() init_int_handler(); - init_ustrelay_transport(); - - printf("page size is %d\n", sysconf(_SC_PAGE_SIZE)); - -// extern struct marker __start___markers[] __attribute__((visibility("hidden"))); -// extern struct marker __stop___markers[] __attribute__((visibility("hidden"))); -// -// printf("the executable's markers start at %lx and end at %lx, the size of a marker is %d\n", __start___markers, __stop___markers, sizeof(struct marker)); - - 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"); @@ -253,16 +233,7 @@ int main() 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); } diff --git a/hello/marker-control.c b/hello/marker-control.c index 419147a4..9d231d11 100644 --- a/hello/marker-control.c +++ b/hello/marker-control.c @@ -409,7 +409,7 @@ static void disconnect_all_markers(void) } } -int marker_control_init(void) +int __attribute__((constructor)) marker_control_init(void) { int ret; diff --git a/libtracing/relay.c b/libtracing/relay.c index ad22727a..4c8dd2a5 100644 --- a/libtracing/relay.c +++ b/libtracing/relay.c @@ -2344,7 +2344,7 @@ static struct ltt_transport ust_relay_transport = { //ust// return 0; //ust// } -void init_ustrelay_transport(void) +void __attribute__((constructor)) init_ustrelay_transport(void) { ltt_transport_register(&ust_relay_transport); }