X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Futils.c;h=0e96ef0c3daf36f08b41c26749356a56705dac01;hb=e7ab49a85e4e5c5749949191bdeefa21a9aef9b1;hp=885f498b73c72340dedc99ae67a3ca5d226ed8ab;hpb=3e8f2238b96759216a76c7f26ca875247a45d06f;p=lttng-tools.git diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c index 885f498b7..0e96ef0c3 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -41,6 +41,12 @@ static const char *str_ust = "UST"; static const char *str_jul = "JUL"; static const char *str_log4j = "LOG4J"; static const char *str_python = "Python"; +static const char *str_all = "ALL"; +static const char *str_tracepoint = "Tracepoint"; +static const char *str_syscall = "Syscall"; +static const char *str_probe = "Probe"; +static const char *str_userspace_probe = "Userspace Probe"; +static const char *str_function = "Function"; static char *_get_session_name(int quiet) @@ -311,6 +317,37 @@ const char *get_domain_str(enum lttng_domain_type domain) return str_dom; } +const char *get_event_type_str(enum lttng_event_type type) +{ + const char *str_event_type; + + switch (type) { + case LTTNG_EVENT_ALL: + str_event_type = str_all; + break; + case LTTNG_EVENT_TRACEPOINT: + str_event_type = str_tracepoint; + break; + case LTTNG_EVENT_SYSCALL: + str_event_type = str_syscall; + break; + case LTTNG_EVENT_PROBE: + str_event_type = str_probe; + break; + case LTTNG_EVENT_USERSPACE_PROBE: + str_event_type = str_userspace_probe; + break; + case LTTNG_EVENT_FUNCTION: + str_event_type = str_function; + break; + default: + /* Should not have an unknown event type or else define it. */ + assert(0); + } + + return str_event_type; +} + /* * Spawn a lttng relayd daemon by forking and execv. */ @@ -387,7 +424,7 @@ int check_relayd(void) * A successful connect means the relayd exists thus returning 0 else a * negative value means it does NOT exists. */ - ret = connect(fd, &sin, sizeof(sin)); + ret = connect(fd, (struct sockaddr *) &sin, sizeof(sin)); if (ret < 0) { /* Not found. */ ret = 0;