From patchwork Tue Mar 28 23:52:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beau Belgrave X-Patchwork-Id: 13191679 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 B16E1C76196 for ; Tue, 28 Mar 2023 23:52:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72E5B900007; Tue, 28 Mar 2023 19:52:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 70540900006; Tue, 28 Mar 2023 19:52:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AFDA900007; Tue, 28 Mar 2023 19:52:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 347B6900006 for ; Tue, 28 Mar 2023 19:52:32 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 11A62A0483 for ; Tue, 28 Mar 2023 23:52:32 +0000 (UTC) X-FDA: 80619958944.28.34E0C76 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf07.hostedemail.com (Postfix) with ESMTP id 5B42F40009 for ; Tue, 28 Mar 2023 23:52:30 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=Jqyl4KPw; spf=pass (imf07.hostedemail.com: domain of beaub@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=beaub@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680047550; 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=MYYDTYE8Up+wGqx+f1YsuHPS1P/30RHQ/hjmHTBgUyY=; b=4xdnkwuq2HPQsKulnL9/euOk01ax0uBmCzE6zyDSCQdzG++GQ84B99lhsnBsX2yeU70o9l aDDVMgVqP+YeP73bBm2MrA+Ot87isSj9n3Y4F+pyDTFbrenVXqWIzwCrKbNYAxYbnwnb8Y H5QR3ph1yuWT1ZE5d+3iZSZY37KjKmc= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=Jqyl4KPw; spf=pass (imf07.hostedemail.com: domain of beaub@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=beaub@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680047550; a=rsa-sha256; cv=none; b=K2lSE7pscd3J3mRELEpBcq4Inm92pZniziJNKQzJnZamwbq/izIM26U6maYd4Xr6rd/AK1 rzTDfrWtOI4GDd6vWidMBUGjfrXY3aVL5dibARMNMc+hYV7o5eFZVGsg+EMcFAt5SOuTv9 IsWXIzd8hMZMpx47vUjM0tYTL+UbU5M= Received: from W11-BEAU-MD.localdomain (unknown [76.135.27.212]) by linux.microsoft.com (Postfix) with ESMTPSA id 1B87320FDC3A; Tue, 28 Mar 2023 16:52:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1B87320FDC3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680047549; bh=MYYDTYE8Up+wGqx+f1YsuHPS1P/30RHQ/hjmHTBgUyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jqyl4KPw+E+tV+T5GSisoQ5Rmyf37Cjz/I/bQERDIT2eym1qrzjyLDap9dlmJASTX A9VuVoCBgoqlVRQYTkaSH3yKyXSUBt8Uo4fYLa/UeSoopA5O3npO1Ucx2L/wG+nl0X v2RTgH45YmKPVqpwAhVUJYnsMKK7rdsu5GC8WwnU= 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 12/12] tracing/user_events: Align structs with tabs for readability Date: Tue, 28 Mar 2023 16:52:19 -0700 Message-Id: <20230328235219.203-13-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 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5B42F40009 X-Stat-Signature: hymycify15h73px3xz357zwzb83zf167 X-HE-Tag: 1680047550-285523 X-HE-Meta: U2FsdGVkX197AOZGm2Sl20lzMpVmUeHqaOjJmxZ5BT/lcTSp5jdSW9r0h+FvNWWM7AlrcbL2AwtHMGoUthzkc/U3ns35uWR7vLdxv1sAtUNB3eDYB4zUcbDDAPIaTuat5M+oDyhJEYTosGXs18ftCQ4OrvLePm68lzbz3RRGjC46ZwXg09sjfveNxbG5g+sPOpC5wDl8dGp4MnxgpeEH52bK/DJwQZu6hpdrr8LatR94WzKtGUieTBnnm5i0vERHdkNiy9x62X8sieQF6YC8ibPLCVwxqsWXbSB4RB5j8rpO8yJ/jH2xU8d+lL9DD0wxT1mmEkFdVt3hSEqFhQcpoA6T90UjW6rP4vxBgR6B42GqrdyBC8Fp6B04KF7NVRIbnKn8za2bWOHjfzUoW06eC49dS1US/3H0KTOrUvmis+jNKsjHUHkIVczCTzXPl42bCHqX3TupEBC3Aej3zj2xSlQK1HGGqahUvdF/4mYJ08YuuvuawZ7t+ztbUlXkkRbIRFbQeASxuP6PKwYB6Lv56D54KdQMnXUo0fSoglpylrLZYXatiQ5f+de7/CfQIcMmAQQmk8QbtZWmgbWKQgnB1TXCdsfyyG+OMjVfaC5z31iHdWk47H2wRVQEosUz2UvOzkADBm8T6ZvJrUI+S8M26Ss+bqVjxAyzxwtPRbxi7JMqqem5iQtL1BThfjb/XdTD/Y42Q5Jofkgu56/MAQBeJnErfvq3moqdXl/Fo1ejh7lSDDEN3ouAFjXd/zcmdikvqcvFkAP6LHTG9dqSd/LNr9/3wJLB2S4Bupih6ig8wgWFeeLUpB/yZeOUJj04Lz/CievU4plt9FB8kgIeTTkFvfDhR9wcrs+xrRr3nhJJj+cbnfRBdmsYn4L9LFFxOU8d/AC/Wi2u2XRdT8jpjkJRuPw57d/IGgbkgbr7uGUAdwuk6ow/ZSq8U54X1Fr8l3Iaj6uc8WjBR5das0lTSUp adODyQoG qgoibOP43JVcfirUwv4KNq4T7vinTqySS/nL6ep6tauhktpgM7BlN3icNjUiwow7pTfeRWM5JtEvCP7d3xmm5Hlic0i2tmyqhtMybVbmp2DWEAeyXKMvRl1ASkFGYpAHP2JTdCmOVJ4FPEpeFU3ciXK6oKo4ktZvsFHbfJQ9kjccFfkhTBabNLgxcPoMKz8Vl7bJB+HacLeI/QvXGt0hwitbrJPvCgn6HbvE3Dbus2cWsYtlIfBN8+r7QO+Mg5j8UE4qOgHsL+0K9VXRYkjtyRKWmddQ+qs55MQaDpwNNEBt66Tk= 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: Add tabs to make struct members easier to read and unify the style of the code. Signed-off-by: Beau Belgrave --- include/linux/user_events.h | 14 +++--- include/uapi/linux/user_events.h | 24 +++++----- kernel/trace/trace_events_user.c | 82 ++++++++++++++++---------------- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/include/linux/user_events.h b/include/linux/user_events.h index 0120b3dd5b03..2847f5a18a86 100644 --- a/include/linux/user_events.h +++ b/include/linux/user_events.h @@ -17,13 +17,13 @@ #ifdef CONFIG_USER_EVENTS struct user_event_mm { - struct list_head link; - struct list_head enablers; - struct mm_struct *mm; - struct user_event_mm *next; - refcount_t refcnt; - refcount_t tasks; - struct rcu_work put_rwork; + struct list_head link; + struct list_head enablers; + struct mm_struct *mm; + struct user_event_mm *next; + refcount_t refcnt; + refcount_t tasks; + struct rcu_work put_rwork; }; extern void user_event_mm_dup(struct task_struct *t, diff --git a/include/uapi/linux/user_events.h b/include/uapi/linux/user_events.h index 3e7275e3234a..2984aae4a2b4 100644 --- a/include/uapi/linux/user_events.h +++ b/include/uapi/linux/user_events.h @@ -25,25 +25,25 @@ struct user_reg { /* Input: Size of the user_reg structure being used */ - __u32 size; + __u32 size; /* Input: Bit in enable address to use */ - __u8 enable_bit; + __u8 enable_bit; /* Input: Enable size in bytes at address */ - __u8 enable_size; + __u8 enable_size; /* Input: Flags for future use, set to 0 */ - __u16 flags; + __u16 flags; /* Input: Address to update when enabled */ - __u64 enable_addr; + __u64 enable_addr; /* Input: Pointer to string with event name, description and flags */ - __u64 name_args; + __u64 name_args; /* Output: Index of the event to use when writing data */ - __u32 write_index; + __u32 write_index; } __attribute__((__packed__)); /* @@ -52,19 +52,19 @@ struct user_reg { */ struct user_unreg { /* Input: Size of the user_unreg structure being used */ - __u32 size; + __u32 size; /* Input: Bit to unregister */ - __u8 disable_bit; + __u8 disable_bit; /* Input: Reserved, set to 0 */ - __u8 __reserved; + __u8 __reserved; /* Input: Reserved, set to 0 */ - __u16 __reserved2; + __u16 __reserved2; /* Input: Address to unregister */ - __u64 disable_addr; + __u64 disable_addr; } __attribute__((__packed__)); #define DIAG_IOC_MAGIC '*' diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index 9b43a02e1597..67cb7b53caf6 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -53,9 +53,9 @@ * allows isolation for events by various means. */ struct user_event_group { - char *system_name; - struct hlist_node node; - struct mutex reg_mutex; + char *system_name; + struct hlist_node node; + struct mutex reg_mutex; DECLARE_HASHTABLE(register_table, 8); }; @@ -76,17 +76,17 @@ static unsigned int current_user_events; * refcnt reaches one. */ struct user_event { - struct user_event_group *group; - struct tracepoint tracepoint; - struct trace_event_call call; - struct trace_event_class class; - struct dyn_event devent; - struct hlist_node node; - struct list_head fields; - struct list_head validators; - refcount_t refcnt; - int min_size; - char status; + struct user_event_group *group; + struct tracepoint tracepoint; + struct trace_event_call call; + struct trace_event_class class; + struct dyn_event devent; + struct hlist_node node; + struct list_head fields; + struct list_head validators; + refcount_t refcnt; + int min_size; + char status; }; /* @@ -95,12 +95,12 @@ struct user_event { * these to track enablement sites that are tied to an event. */ struct user_event_enabler { - struct list_head link; - struct user_event *event; - unsigned long addr; + struct list_head link; + struct user_event *event; + unsigned long addr; /* Track enable bit, flags, etc. Aligned for bitops. */ - unsigned int values; + unsigned int values; }; /* Bits 0-5 are for the bit to update upon enable/disable (0-63 allowed) */ @@ -119,9 +119,9 @@ struct user_event_enabler { /* Used for asynchronous faulting in of pages */ struct user_event_enabler_fault { - struct work_struct work; - struct user_event_mm *mm; - struct user_event_enabler *enabler; + struct work_struct work; + struct user_event_mm *mm; + struct user_event_enabler *enabler; }; static struct kmem_cache *fault_cache; @@ -137,23 +137,23 @@ static DEFINE_SPINLOCK(user_event_mms_lock); * These are not shared and only accessible by the file that created it. */ struct user_event_refs { - struct rcu_head rcu; - int count; - struct user_event *events[]; + struct rcu_head rcu; + int count; + struct user_event *events[]; }; struct user_event_file_info { - struct user_event_group *group; - struct user_event_refs *refs; + struct user_event_group *group; + struct user_event_refs *refs; }; #define VALIDATOR_ENSURE_NULL (1 << 0) #define VALIDATOR_REL (1 << 1) struct user_event_validator { - struct list_head link; - int offset; - int flags; + struct list_head link; + int offset; + int flags; }; typedef void (*user_event_func_t) (struct user_event *user, struct iov_iter *i, @@ -2276,11 +2276,11 @@ static int user_events_release(struct inode *node, struct file *file) } static const struct file_operations user_data_fops = { - .open = user_events_open, - .write = user_events_write, - .write_iter = user_events_write_iter, + .open = user_events_open, + .write = user_events_write, + .write_iter = user_events_write_iter, .unlocked_ioctl = user_events_ioctl, - .release = user_events_release, + .release = user_events_release, }; static void *user_seq_start(struct seq_file *m, loff_t *pos) @@ -2346,10 +2346,10 @@ static int user_seq_show(struct seq_file *m, void *p) } static const struct seq_operations user_seq_ops = { - .start = user_seq_start, - .next = user_seq_next, - .stop = user_seq_stop, - .show = user_seq_show, + .start = user_seq_start, + .next = user_seq_next, + .stop = user_seq_stop, + .show = user_seq_show, }; static int user_status_open(struct inode *node, struct file *file) @@ -2375,10 +2375,10 @@ static int user_status_open(struct inode *node, struct file *file) } static const struct file_operations user_status_fops = { - .open = user_status_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, + .open = user_status_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, }; /*