summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMohan Srinivasan <srmohan@google.com>2017-03-10 16:08:30 -0800
committerMohan Srinivasan <srmohan@google.com>2017-03-13 21:05:29 +0000
commit6f4a2453a14bae428dd10ba3bb9c15dccfc9eb8d (patch)
tree319a2304f501f19bda4dad9c2c43c108ef08fa2f /include
parentf52e71a12e80643225e7b6faf9b4dc171229af39 (diff)
ANDROID: Replace spaces by '_' for some android filesystem tracepoints.
Andoid files frequently have spaces in them, as do cmdline strings. Replace these spaces with '_', so tools that parse these tracepoints don't get terribly confused. Change-Id: I1cbbedf5c803aa6a58d9b8b7836e9125683c49d1 Signed-off-by: Mohan Srinivasan <srmohan@google.com> (cherry picked from commit 5035d5f0933758dd515327d038e5bef7e40dbaa7)
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/android_fs_template.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/trace/events/android_fs_template.h b/include/trace/events/android_fs_template.h
index 4e61ffe7a814..b23d17b56c63 100644
--- a/include/trace/events/android_fs_template.h
+++ b/include/trace/events/android_fs_template.h
@@ -18,11 +18,18 @@ DECLARE_EVENT_CLASS(android_fs_data_start_template,
),
TP_fast_assign(
{
+ /*
+ * Replace the spaces in filenames and cmdlines
+ * because this screws up the tooling that parses
+ * the traces.
+ */
__assign_str(pathbuf, pathname);
+ (void)strreplace(__get_str(pathbuf), ' ', '_');
__entry->offset = offset;
__entry->bytes = bytes;
__entry->i_size = i_size_read(inode);
__assign_str(cmdline, command);
+ (void)strreplace(__get_str(cmdline), ' ', '_');
__entry->pid = pid;
__entry->ino = inode->i_ino;
}