Commit 752d596b authored by Daniel Bristot de Oliveira's avatar Daniel Bristot de Oliveira Committed by Steven Rostedt

tracing: Use __get_str() when manipulating strings

Use __get_str(str) rather than __get_dynamic_array(str) when
deadling with strings.

It is just a code cleanup, no changes on tracepoint ABI.

Link: http://lkml.kernel.org/r/ea260df91817411cca2a1f3db2abd88860094788.1467407618.git.bristot@redhat.com

Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-nfs@vger.kernel.org
Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent a17167ce
...@@ -1235,8 +1235,8 @@ DECLARE_EVENT_CLASS(nfs4_idmap_event, ...@@ -1235,8 +1235,8 @@ DECLARE_EVENT_CLASS(nfs4_idmap_event,
len = 0; len = 0;
__entry->error = error < 0 ? error : 0; __entry->error = error < 0 ? error : 0;
__entry->id = id; __entry->id = id;
memcpy(__get_dynamic_array(name), name, len); memcpy(__get_str(name), name, len);
((char *)__get_dynamic_array(name))[len] = 0; __get_str(name)[len] = 0;
), ),
TP_printk( TP_printk(
......
...@@ -707,9 +707,9 @@ TRACE_EVENT(nfs_sillyrename_unlink, ...@@ -707,9 +707,9 @@ TRACE_EVENT(nfs_sillyrename_unlink,
__entry->dev = dir->i_sb->s_dev; __entry->dev = dir->i_sb->s_dev;
__entry->dir = NFS_FILEID(dir); __entry->dir = NFS_FILEID(dir);
__entry->error = error; __entry->error = error;
memcpy(__get_dynamic_array(name), memcpy(__get_str(name),
data->args.name.name, len); data->args.name.name, len);
((char *)__get_dynamic_array(name))[len] = 0; __get_str(name)[len] = 0;
), ),
TP_printk( TP_printk(
......
...@@ -16,8 +16,8 @@ TRACE_EVENT(console, ...@@ -16,8 +16,8 @@ TRACE_EVENT(console,
), ),
TP_fast_assign( TP_fast_assign(
memcpy(__get_dynamic_array(msg), text, len); memcpy(__get_str(msg), text, len);
((char *)__get_dynamic_array(msg))[len] = 0; __get_str(msg)[len] = 0;
), ),
TP_printk("%s", __get_str(msg)) TP_printk("%s", __get_str(msg))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment