From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EF26C77B6C for ; Tue, 28 Mar 2023 23:52:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9F2A96B0078; Tue, 28 Mar 2023 19:52:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94FAB6B007E; Tue, 28 Mar 2023 19:52:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 814466B0078; Tue, 28 Mar 2023 19:52:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5E8486B0075 for ; Tue, 28 Mar 2023 19:52:28 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 169391204CE for ; Tue, 28 Mar 2023 23:52:28 +0000 (UTC) X-FDA: 80619958776.22.1721D69 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf23.hostedemail.com (Postfix) with ESMTP id 5AA80140016 for ; Tue, 28 Mar 2023 23:52:26 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=G6twUb0k; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf23.hostedemail.com: domain of beaub@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=beaub@linux.microsoft.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680047546; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OSmDP26J8YzoMhJc3UKK7slznwSGVE3KNwggNF1IdJc=; b=KE7KH8o+Df/O0kWHQysVmqrs9LUpw6p+ySpm6VrZx0M7MliHobZm7LO8YZuUT2qGhg/GL2 aO9dbRrZQPycOiYI++H96l/WBzjIK1fncc4aFC+qi6G78hUTF3O7w9QVnE7F4qKjSx7TLU ml1Tx2j7lxKsRpN8ppM84DqjEJ4vaT0= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=G6twUb0k; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf23.hostedemail.com: domain of beaub@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=beaub@linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680047546; a=rsa-sha256; cv=none; b=zsaGpZZ9ndmFI1oYUCp5EfQY3Sz/eoYGvOfY3QOdkMPIh86q6gb5SwbaE5HxLgwhk1jrg5 csCxqgOK2c2guR6tVsJW9y9/XPDuHpF2mpDt+2+wFWAle70h/mgPuWXTE5WcKRGgZj6OTb 5sQp+yvvHqaRvPDpysaVa/THjnM05vk= Received: from W11-BEAU-MD.localdomain (unknown [76.135.27.212]) by linux.microsoft.com (Postfix) with ESMTPSA id BFB5920FDAA3; Tue, 28 Mar 2023 16:52:24 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BFB5920FDAA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680047545; bh=OSmDP26J8YzoMhJc3UKK7slznwSGVE3KNwggNF1IdJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G6twUb0ke7eK5ynz9/PeHHdyqh6KQ95zr0iOHhkyuxOiVKml3Xc5Fptvp8sR+DX9z HbY+oR9AqNC+ixwArDWbmpgy9CbMHTMw45k8BgakrhTAN7tbRtHxDCy1121cQ7VOB9 6piQBcmQptm2Bl1DBPVjQQwn+jIkf6LcGJAezy2M= From: Beau Belgrave To: rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, dcook@linux.microsoft.com, alanau@linux.microsoft.com, brauner@kernel.org, akpm@linux-foundation.org, ebiederm@xmission.com, keescook@chromium.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v10 01/12] tracing/user_events: Split header into uapi and kernel Date: Tue, 28 Mar 2023 16:52:08 -0700 Message-Id: <20230328235219.203-2-beaub@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230328235219.203-1-beaub@linux.microsoft.com> References: <20230328235219.203-1-beaub@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AA80140016 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 4whgckocmgq3cuhatpbk3r9o96w1mh95 X-HE-Tag: 1680047546-870898 X-HE-Meta: U2FsdGVkX199m69HS45DyiEVZfpmHpCqs7opGUIau6EgYwY4Ye0E2Dsy29a7Pn8pC+jLw1mL9Y4IrTDtQn6bb0l/4QmMSMk0M/SbMSxWnTjTtXe5a6FfDSp6xmG8yphvHguJBNfwj2nIlYVS05G2ImB/iTa3V5RBkBMtiPCGgx6T8QjeaAHX/K/jeYA+lhGd8W1uAeiDnBk5qjhWW97WHUQwR1aT5Q15I5PQ+zK1arCIYfOnd6+aFybx2dZjcF6DaslNwFP80Z2O2aIvN39OH3f3iuVfoVFZiYu7fm/OQCfDCVtysFob/crdZto38dV36zc0HnQTe+i/40NsN993rR3DroatxHhTX8qG8DM252uU9LenMu/DXGHhtbpM6ovHb9qCNIwtmkBF7+s53qEuoDhZmYpES9JYkwnCKV9qTKEUNcR0ntIDkjdl3b5QthP+IE7/dpphTE+F5jzra4WeeFGDT102tXnCxCBeTTyoUpoWvHCPX+B+ofHszH1iB8GNlpyo7TMnghaxqXjhA7e7PBmbVFetmo3F7SZ1cmMNjqmACuJ6u+9TIcicJxuRk7799LCoqd6rba7sPkHTx+7N8QTxUV0DKtB78rFoVGtKJVEshcgzyOi1AgxEghKdWu5wKhLLLOh+rxPMJySUcOvJMub9j8y9Zlyeq/yT5pzJ6HSJEnxBposgrlpfB/xNN+s2CgdjykSsIDZr+xNacRS0vMRLkSyWVMSrdwiQfLpTxoA+36AGJ1cxfXZieXDuPLXxZPEdhx3E+vbmVI/JfkWcXUFSzFm1urV/tx3sqvM5SKlYJ9cIuDgocfDNFhO5D48/u0ffO2dmUP1eeXFmfnGSXflcw/oG3TRQ59rnLQkiYnu1j9OcMk+N+Ra7RlaEGIvOGPaHztsKbFi+601zDJek5u786D3TSEXp58CGdbje7opMUIbbhamkK+GF2cWoj5OFBVD2op1x7i45l3QErYy TN1YVN6Z ezPFDJwotWgE1Nesq9gOMRrrpEQI9mbmZSiQZI+Up2gwyZrYBEdT4vkf/bQQVD0Krzyy+UNxeRnwHPnIsYmbadaKYSeAfmaM9+Pk2013+/9WJd384q8Qn/O8eDFt1ZxdY0JwyogCFhHhtF+d7TyTBTv8gYXIjzIDkx7+VnSE2JJx0Cp2DYp363Cu7GauZroEn3dbLmIm86L1wkouKgCjgFsbwZn0/eKvA4ZBwDqrRu0ygscIx1J8l0OKo39iZG2T+URG/gYGkpBv+HGJqwvV6qWBrLSfazf7rMjQn9r0p2u8mziI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The UAPI parts need to be split out from the kernel parts of user_events now that other parts of the kernel will reference it. Do so by moving the existing include/linux/user_events.h into include/uapi/linux/user_events.h. Signed-off-by: Beau Belgrave --- include/linux/user_events.h | 52 ++++---------------------------- include/uapi/linux/user_events.h | 48 +++++++++++++++++++++++++++++ kernel/trace/trace_events_user.c | 5 --- 3 files changed, 54 insertions(+), 51 deletions(-) create mode 100644 include/uapi/linux/user_events.h diff --git a/include/linux/user_events.h b/include/linux/user_events.h index 592a3fbed98e..13689589d36e 100644 --- a/include/linux/user_events.h +++ b/include/linux/user_events.h @@ -1,54 +1,14 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2021, Microsoft Corporation. + * Copyright (c) 2022, Microsoft Corporation. * * Authors: * Beau Belgrave */ -#ifndef _UAPI_LINUX_USER_EVENTS_H -#define _UAPI_LINUX_USER_EVENTS_H -#include -#include +#ifndef _LINUX_USER_EVENTS_H +#define _LINUX_USER_EVENTS_H -#ifdef __KERNEL__ -#include -#else -#include -#endif +#include -#define USER_EVENTS_SYSTEM "user_events" -#define USER_EVENTS_PREFIX "u:" - -/* Create dynamic location entry within a 32-bit value */ -#define DYN_LOC(offset, size) ((size) << 16 | (offset)) - -/* - * Describes an event registration and stores the results of the registration. - * This structure is passed to the DIAG_IOCSREG ioctl, callers at a minimum - * must set the size and name_args before invocation. - */ -struct user_reg { - - /* Input: Size of the user_reg structure being used */ - __u32 size; - - /* Input: Pointer to string with event name, description and flags */ - __u64 name_args; - - /* Output: Bitwise index of the event within the status page */ - __u32 status_bit; - - /* Output: Index of the event to use when writing data */ - __u32 write_index; -} __attribute__((__packed__)); - -#define DIAG_IOC_MAGIC '*' - -/* Requests to register a user_event */ -#define DIAG_IOCSREG _IOWR(DIAG_IOC_MAGIC, 0, struct user_reg*) - -/* Requests to delete a user_event */ -#define DIAG_IOCSDEL _IOW(DIAG_IOC_MAGIC, 1, char*) - -#endif /* _UAPI_LINUX_USER_EVENTS_H */ +#endif /* _LINUX_USER_EVENTS_H */ diff --git a/include/uapi/linux/user_events.h b/include/uapi/linux/user_events.h new file mode 100644 index 000000000000..03f92366068d --- /dev/null +++ b/include/uapi/linux/user_events.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * Copyright (c) 2021-2022, Microsoft Corporation. + * + * Authors: + * Beau Belgrave + */ +#ifndef _UAPI_LINUX_USER_EVENTS_H +#define _UAPI_LINUX_USER_EVENTS_H + +#include +#include + +#define USER_EVENTS_SYSTEM "user_events" +#define USER_EVENTS_PREFIX "u:" + +/* Create dynamic location entry within a 32-bit value */ +#define DYN_LOC(offset, size) ((size) << 16 | (offset)) + +/* + * Describes an event registration and stores the results of the registration. + * This structure is passed to the DIAG_IOCSREG ioctl, callers at a minimum + * must set the size and name_args before invocation. + */ +struct user_reg { + + /* Input: Size of the user_reg structure being used */ + __u32 size; + + /* Input: Pointer to string with event name, description and flags */ + __u64 name_args; + + /* Output: Bitwise index of the event within the status page */ + __u32 status_bit; + + /* Output: Index of the event to use when writing data */ + __u32 write_index; +} __attribute__((__packed__)); + +#define DIAG_IOC_MAGIC '*' + +/* Request to register a user_event */ +#define DIAG_IOCSREG _IOWR(DIAG_IOC_MAGIC, 0, struct user_reg *) + +/* Request to delete a user_event */ +#define DIAG_IOCSDEL _IOW(DIAG_IOC_MAGIC, 1, char *) + +#endif /* _UAPI_LINUX_USER_EVENTS_H */ diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index 908e8a13c675..070551480747 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -19,12 +19,7 @@ #include #include #include -/* Reminder to move to uapi when everything works */ -#ifdef CONFIG_COMPILE_TEST #include -#else -#include -#endif #include "trace.h" #include "trace_dynevent.h" -- 2.25.1