All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lttng-tools] Fix: add missing UST perf counter support check
@ 2015-01-12 22:14 Mathieu Desnoyers
  0 siblings, 0 replies; only message in thread
From: Mathieu Desnoyers @ 2015-01-12 22:14 UTC (permalink / raw)
  To: jgalar; +Cc: lttng-dev

Report whether performance counters are supported by UST on the
architecture as soon as the user try to enable a perf counter context.

Fixes #851

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
 src/bin/lttng-sessiond/trace-ust.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c
index a3e25aa..4f06f1b 100644
--- a/src/bin/lttng-sessiond/trace-ust.c
+++ b/src/bin/lttng-sessiond/trace-ust.c
@@ -470,7 +470,12 @@ int trace_ust_context_type_event_to_ust(enum lttng_event_context_type type)
 		utype = LTTNG_UST_CONTEXT_IP;
 		break;
 	case LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER:
-		utype = LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER;
+		if (!ustctl_has_perf_counters()) {
+			utype = -1;
+			WARN("Perf counters not implemented in UST");
+		} else {
+			utype = LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER;
+		}
 		break;
 	default:
 		ERR("Invalid UST context");
-- 
2.1.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-12 22:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12 22:14 [PATCH lttng-tools] Fix: add missing UST perf counter support check Mathieu Desnoyers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.