summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/perfmon
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/perfmon')
-rw-r--r--src/vppinfra/perfmon/perfmon.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vppinfra/perfmon/perfmon.h b/src/vppinfra/perfmon/perfmon.h
index d940921d6bf..5b904a632e3 100644
--- a/src/vppinfra/perfmon/perfmon.h
+++ b/src/vppinfra/perfmon/perfmon.h
@@ -68,6 +68,7 @@ extern clib_perfmon_main_t clib_perfmon_main;
static_always_inline void
clib_perfmon_ioctl (int fd, u32 req)
{
+#ifdef __linux__
#ifdef __x86_64__
asm volatile("syscall"
:
@@ -76,6 +77,7 @@ clib_perfmon_ioctl (int fd, u32 req)
#else
ioctl (fd, req, PERF_IOC_FLAG_GROUP);
#endif
+#endif /* linux */
}
clib_error_t *clib_perfmon_init_by_bundle_name (clib_perfmon_ctx_t *ctx,
@@ -87,6 +89,7 @@ u64 *clib_perfmon_capture (clib_perfmon_ctx_t *ctx, u32 n_ops, char *fmt, ...);
void clib_perfmon_capture_group (clib_perfmon_ctx_t *ctx, char *fmt, ...);
format_function_t format_perfmon_bundle;
+#ifdef __linux__
static_always_inline void
clib_perfmon_reset (clib_perfmon_ctx_t *ctx)
{
@@ -102,6 +105,23 @@ clib_perfmon_disable (clib_perfmon_ctx_t *ctx)
{
clib_perfmon_ioctl (ctx->group_fd, PERF_EVENT_IOC_DISABLE);
}
+#elif __FreeBSD__
+static_always_inline void
+clib_perfmon_reset (clib_perfmon_ctx_t *ctx)
+{
+ /* TODO: Implement for FreeBSD */
+}
+static_always_inline void
+clib_perfmon_enable (clib_perfmon_ctx_t *ctx)
+{
+ /* TODO: Implement for FreeBSD */
+}
+static_always_inline void
+clib_perfmon_disable (clib_perfmon_ctx_t *ctx)
+{
+ /* TODO: Implement for FreeBSD */
+}
+#endif /* linux */
#define CLIB_PERFMON_BUNDLE(x) \
static clib_perfmon_bundle_reg_t clib_perfmon_bundle_reg_##x; \