Move perf counter symbols to private header
[lttng-ust.git] / liblttng-ust-ctl / ustctl.c
index 0272d9b9331c6750c276993b14552bbeb6e565f2..e31f8392500a0713547afdd27b1c0c0272596a65 100644 (file)
@@ -1,19 +1,8 @@
 /*
- * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
- * Copyright (C) 2011-2013 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License only.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
+ * Copyright (C) 2011-2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  */
 
 #include <stdint.h>
@@ -30,7 +19,8 @@
 #include <lttng/ust-endian.h>
 #include <usterr-signal-safe.h>
 #include <ust-comm.h>
-#include <helper.h>
+#include <ust-helper.h>
+#include "ust-compat.h"
 
 #include "../libringbuffer/backend.h"
 #include "../libringbuffer/frontend.h"
@@ -2008,7 +1998,7 @@ int ustctl_get_instance_id(struct ustctl_consumer_stream *stream,
        return client_cb->instance_id(buf, handle, id);
 }
 
-#ifdef LTTNG_UST_HAVE_PERF_EVENT
+#ifdef HAVE_PERF_EVENT
 
 int ustctl_has_perf_counters(void)
 {
@@ -2067,6 +2057,7 @@ int get_cred(int sock,
 }
 #elif defined(__FreeBSD__)
 #include <sys/ucred.h>
+#include <sys/un.h>
 
 /*
  * Override application uid/gid with unix socket credentials. Use the
@@ -2094,11 +2085,11 @@ int get_cred(int sock,
        }
        DBG("Unix socket peercred [ uid: %u, gid: %u ], "
                "application registered claiming [ pid: %d, ppid: %d, uid: %u, gid: %u ]",
-               xucred.uid, xucred.cr_groups[0],
+               xucred.cr_uid, xucred.cr_groups[0],
                reg_msg->pid, reg_msg->ppid, reg_msg->uid, reg_msg->gid);
        *pid = reg_msg->pid;
        *ppid = reg_msg->ppid;
-       *uid = xucred.uid;
+       *uid = xucred.cr_uid;
        *gid = xucred.cr_groups[0];
        return 0;
 }
@@ -2930,8 +2921,8 @@ int ustctl_counter_clear(struct ustctl_daemon_counter *counter,
 static __attribute__((constructor))
 void ustctl_init(void)
 {
-       init_usterr();
-       lttng_ust_getenv_init();        /* Needs init_usterr() to be completed. */
+       ust_err_init();
+       lttng_ust_getenv_init();        /* Needs ust_err_init() to be completed. */
        lttng_ust_clock_init();
        lttng_ring_buffer_metadata_client_init();
        lttng_ring_buffer_client_overwrite_init();
This page took 0.025738 seconds and 4 git commands to generate.