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>
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 {
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.
*/