tracing: Updates for 6.7
Steven Rostedt
maintainercover tracing: Updates for 6.7
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/for-next
Head SHA1: 29e06c10702e81a7d0b75020ca514d2f2962704a
Christophe JAILLET (1):
tracing/histograms: Simplify last_cmd_set()
Matthew Wilcox (Oracle) (1):
powerpc: Remove initialisation of readpos
Steven Rostedt (Google) (2):
eventfs: Fix WARN_ON() in create_file_dentry()
eventfs: Fix typo in eventfs_inode union comment
----
arch/powerpc/kernel/setup-common.c | 1 - fs/tracefs/event_inode.c | 3 ++- fs/tracefs/internal.h | 2 +- kernel/trace/trace_events_hist.c | 11 ++--------- 4 files changed, 5 insertions(+), 12 deletions(-)
Steven Rostedt
maintainerPATCH 1/4 tracing/histograms: Simplify last_cmd_set()
From: Christophe JAILLET <[email protected]>
Turn a kzalloc()+strcpy()+strncat() into an equivalent and less verbose kasprintf().
--- kernel/trace/trace_events_hist.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
kernel/trace/trace_events_hist.c +2 -9
@@ -774,23 +774,16 @@ static void last_cmd_set(struct trace_event_file *file, char *str) {const char *system =NULL , *name =NULL ;struct trace_event_call *call; -int len;if (!str)return ; -/* sizeof() contains the nul byte */ - len =sizeof (HIST_PREFIX ) +strlen (str);kfree (last_cmd); - last_cmd =kzalloc (len,GFP_KERNEL ); + + last_cmd =kasprintf (GFP_KERNEL ,HIST_PREFIX "%s" , str);if (!last_cmd)return ; -strcpy (last_cmd,HIST_PREFIX ); -/* Again, sizeof() contains the nul byte */ - len -=sizeof (HIST_PREFIX ); -strncat (last_cmd, str, len); -if (file) { call = file->event_call; system = call->class->system;
Signature · 1 line
2.42.0
Steven Rostedt
maintainerPATCH 3/4 eventfs: Fix WARN_ON() in create_file_dentry()
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
As the comment right above a WARN_ON() in create_file_dentry() states:
* Note, with the mutex held, the e_dentry cannot have content
* and the ei->is_freed be true at the same time.
But the WARN_ON() only has:
WARN_ON_ONCE(ei->is_free);
Where to match the comment (and what it should actually do) is:
dentry = *e_dentry; WARN_ON_ONCE(dentry && ei->is_free)
Also in that case, set dentry to NULL (although it should never happen).
--- fs/tracefs/event_inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/tracefs/event_inode.c +2 -1
@@ -264,8 +264,9 @@ create_file_dentry(struct eventfs_inode *ei, struct dentry **e_dentry,* Note, with the mutex held, the e_dentry cannot have content * and the ei->is_freed be true at the same time. */ -WARN_ON_ONCE (ei->is_freed); dentry = *e_dentry; +if (WARN_ON_ONCE (dentry && ei->is_freed)) + dentry =NULL ;/* The lookup does not need to up the dentry refcount */ if (dentry && !lookup)dget (dentry);
Signature · 1 line
2.42.0
Steven Rostedt
maintainerPATCH 2/4 powerpc: Remove initialisation of readpos
In reply to Steven RostedtFrom: "Matthew Wilcox (Oracle)" <[email protected]>
While powerpc doesn't use the seq_buf readpos, it did explicitly initialise it for no good reason.
--- arch/powerpc/kernel/setup-common.c | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/kernel/setup-common.c +0 -1
@@ -601,7 +601,6 @@ struct seq_buf ppc_hw_desc __initdata = { .buffer = ppc_hw_desc_buf, .size = sizeof(ppc_hw_desc_buf), .len = 0, - .readpos = 0, };static __init void probe_machine (void )
Signature · 1 line
2.42.0
Steven Rostedt
maintainerPATCH 4/4 eventfs: Fix typo in eventfs_inode union comment
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
It's eventfs_inode not eventfs_indoe. There's no deer involved!
--- fs/tracefs/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/tracefs/internal.h +1 -1
@@ -37,7 +37,7 @@ struct eventfs_inode {/* * Union - used for deletion * @del_list: list of eventfs_inode to delete -* @rcu: eventfs_indoe to delete in RCU +* @rcu: eventfs_inode to delete in RCU * @is_freed: node is freed if one of the above is set */ union {
Signature · 1 line
2.42.0