Fix: add ustctl_has_perf_counters
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Jan 2015 22:11:32 +0000 (17:11 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Jan 2015 22:12:56 +0000 (17:12 -0500)
Allow sessiond to 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>
include/lttng/ust-ctl.h
liblttng-ust-ctl/ustctl.c

index 40e831e585fb44facd555841256d1f0ed4063e80..8e60f0d8e4db572c4b7c4f32f7ed50534a241c8c 100644 (file)
@@ -238,6 +238,9 @@ int ustctl_get_stream_id(struct ustctl_consumer_stream *stream,
 int ustctl_get_current_timestamp(struct ustctl_consumer_stream *stream,
                uint64_t *ts);
 
+/* returns whether UST has perf counters support. */
+int ustctl_has_perf_counters(void);
+
 /* event registry management */
 
 enum ustctl_socket_type {
index 195f29c03cd211eac3a3fc354e56cd88a574dc4a..b44d9e34020a5cbe61d547c4b8ba7d01e723bc83 100644 (file)
@@ -1639,6 +1639,22 @@ int ustctl_get_current_timestamp(struct ustctl_consumer_stream *stream,
        return client_cb->current_timestamp(buf, handle, ts);
 }
 
+#if defined(__x86_64__) || defined(__i386__)
+
+int ustctl_has_perf_counters(void)
+{
+       return 1;
+}
+
+#else
+
+int ustctl_has_perf_counters(void)
+{
+       return 0;
+}
+
+#endif
+
 /*
  * Returns 0 on success, negative error value on error.
  */
This page took 0.026472 seconds and 4 git commands to generate.