mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Beau Belgrave <beaub@linux.microsoft.com>
Subject: [for-next][PATCH 23/25] tracing/user_events: Align structs with tabs for readability
Date: Wed, 29 Mar 2023 15:45:39 -0400	[thread overview]
Message-ID: <20230329194553.709416963@goodmis.org> (raw)
In-Reply-To: <20230329194516.146147554@goodmis.org>

From: Beau Belgrave <beaub@linux.microsoft.com>

Add tabs to make struct members easier to read and unify the style of
the code.

Link: https://lkml.kernel.org/r/20230328235219.203-13-beaub@linux.microsoft.com

Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 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,
 };
 
 /*
-- 
2.39.1

  parent reply	other threads:[~2023-03-29 19:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 19:45 [for-next][PATCH 00/25] tracing: Updates for 6.4 Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 01/25] fprobe: Pass entry_data to handlers Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 02/25] lib/test_fprobe: Add private entry_data testcases Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 03/25] fprobe: Add nr_maxactive to specify rethook_node pool size Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 04/25] lib/test_fprobe: Add a test case for nr_maxactive Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 05/25] fprobe: Skip exit_handler if entry_handler returns !0 Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 06/25] lib/test_fprobe: Add a testcase for skipping exit_handler Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 07/25] docs: tracing: Update fprobe documentation Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 08/25] selftests: use canonical ftrace path Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 09/25] leaking_addresses: also skip " Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 10/25] tools/kvm_stat: use " Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 11/25] tracing: Add "fields" option to show raw trace event fields Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 12/25] tracing/user_events: Split header into uapi and kernel Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 13/25] tracing/user_events: Track fork/exec/exit for mm lifetime Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 14/25] tracing/user_events: Use remote writes for event enablement Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 15/25] tracing/user_events: Fixup enable faults asyncly Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 16/25] tracing/user_events: Add ioctl for disabling addresses Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 17/25] tracing/user_events: Update self-tests to write ABI Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 18/25] tracing/user_events: Add ABI self-test Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 19/25] tracing/user_events: Use write ABI in example Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 20/25] tracing/user_events: Update documentation for ABI Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 21/25] tracing/user_events: Charge event allocs to cgroups Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 22/25] tracing/user_events: Limit global user_event count Steven Rostedt
2023-03-29 19:45 ` Steven Rostedt [this message]
2023-03-29 19:45 ` [for-next][PATCH 24/25] tracing/user_events: Use print_format_fields() for trace output Steven Rostedt
2023-03-29 19:45 ` [for-next][PATCH 25/25] tracing: Unbreak user events Steven Rostedt
2023-03-29 20:29   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230329194553.709416963@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=beaub@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®