From: David Goulet Date: Mon, 25 Mar 2013 19:30:08 +0000 (-0400) Subject: Fix: kernel function event was listed as probe X-Git-Tag: v2.2.0-rc1~28 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1896972b00c0158cb09eb356e3f54fda9900950a;p=lttng-tools.git Fix: kernel function event was listed as probe Fixes #442 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 80834941d..38ce83c7e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -306,8 +306,12 @@ static int list_lttng_kernel_events(char *channel_name, case LTTNG_KERNEL_TRACEPOINT: (*events)[i].type = LTTNG_EVENT_TRACEPOINT; break; - case LTTNG_KERNEL_KPROBE: case LTTNG_KERNEL_KRETPROBE: + (*events)[i].type = LTTNG_EVENT_FUNCTION; + memcpy(&(*events)[i].attr.probe, &event->event->u.kprobe, + sizeof(struct lttng_kernel_kprobe)); + break; + case LTTNG_KERNEL_KPROBE: (*events)[i].type = LTTNG_EVENT_PROBE; memcpy(&(*events)[i].attr.probe, &event->event->u.kprobe, sizeof(struct lttng_kernel_kprobe)); diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 6677e4c4e..b7c2b6c22 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -220,6 +220,17 @@ static void print_events(struct lttng_event *event) } break; } + case LTTNG_EVENT_FUNCTION: + MSG("%s%s (type: function)%s%s", indent6, + event->name, enabled_string(event->enabled), + filter_string(event->filter)); + if (event->attr.probe.addr != 0) { + MSG("%saddr: 0x%" PRIx64, indent8, event->attr.probe.addr); + } else { + MSG("%soffset: 0x%" PRIx64, indent8, event->attr.probe.offset); + MSG("%ssymbol: %s", indent8, event->attr.probe.symbol_name); + } + break; case LTTNG_EVENT_PROBE: MSG("%s%s (type: probe)%s%s", indent6, event->name, enabled_string(event->enabled), @@ -231,7 +242,6 @@ static void print_events(struct lttng_event *event) MSG("%ssymbol: %s", indent8, event->attr.probe.symbol_name); } break; - case LTTNG_EVENT_FUNCTION: case LTTNG_EVENT_FUNCTION_ENTRY: MSG("%s%s (type: function)%s%s", indent6, event->name, enabled_string(event->enabled),