Skip to content

Commit

Permalink
Merge android-4.9 into canting-4.9
Browse files Browse the repository at this point in the history
Change-Id: Idbc0c666cc71b7e62c0f1b56c303fd550574632e

Conflicts:
	Makefile
	arch/arm64/kernel/vdso.c
  • Loading branch information
khusika committed Jul 21, 2019
2 parents 7de543a + 5e2c340 commit 8e7f5b4
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/f2fs/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,10 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio)
inc_page_count(fio->sbi, is_read_io(fio->op) ?
__read_io_type(page): WB_DATA_TYPE(fio->page));

__f2fs_submit_read_bio(fio->sbi, bio, fio->type);
if (is_read_io(fio->op))
__f2fs_submit_read_bio(fio->sbi, bio, fio->type);
else
__submit_bio(fio->sbi, bio, fio->type);
return 0;
}

Expand Down
12 changes: 12 additions & 0 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "gc.h"
#include "trace.h"
#include <trace/events/f2fs.h>
#include <trace/events/android_fs.h>

static int f2fs_filemap_fault(struct vm_area_struct *vma,
struct vm_fault *vmf)
Expand Down Expand Up @@ -220,6 +221,15 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,

trace_f2fs_sync_file_enter(inode);

if (trace_android_fs_fsync_start_enabled()) {
char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];

path = android_fstrace_get_pathname(pathbuf,
MAX_TRACE_PATHBUF_LEN, inode);
trace_android_fs_fsync_start(inode,
current->pid, path, current->comm);
}

if (S_ISDIR(inode->i_mode))
goto go_write;

Expand Down Expand Up @@ -325,6 +335,8 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
out:
trace_f2fs_sync_file_exit(inode, cp_reason, datasync, ret);
f2fs_trace_ios(NULL, 1);
trace_android_fs_fsync_end(inode, start, end - start);

return ret;
}

Expand Down
9 changes: 9 additions & 0 deletions include/trace/events/android_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ DEFINE_EVENT(android_fs_data_end_template, android_fs_datawrite_end,
TP_PROTO(struct inode *inode, loff_t offset, int bytes),
TP_ARGS(inode, offset, bytes));

DEFINE_EVENT(android_fs_fsync_start_template, android_fs_fsync_start,
TP_PROTO(struct inode *inode,
pid_t pid, char *pathname, char *command),
TP_ARGS(inode, pid, pathname, command));

DEFINE_EVENT(android_fs_data_end_template, android_fs_fsync_end,
TP_PROTO(struct inode *inode, loff_t offset, int bytes),
TP_ARGS(inode, offset, bytes));

#endif /* _TRACE_ANDROID_FS_H */

/* This part must be outside protection */
Expand Down
34 changes: 34 additions & 0 deletions include/trace/events/android_fs_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,38 @@ DECLARE_EVENT_CLASS(android_fs_data_end_template,
__entry->offset, __entry->bytes)
);

DECLARE_EVENT_CLASS(android_fs_fsync_start_template,
TP_PROTO(struct inode *inode,
pid_t pid, char *pathname, char *command),
TP_ARGS(inode, pid, pathname, command),
TP_STRUCT__entry(
__string(pathbuf, pathname);
__field(loff_t, i_size);
__string(cmdline, command);
__field(pid_t, pid);
__field(ino_t, ino);
),
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->i_size = i_size_read(inode);
__assign_str(cmdline, command);
(void)strreplace(__get_str(cmdline), ' ', '_');
__entry->pid = pid;
__entry->ino = inode->i_ino;
}
),
TP_printk("entry_name %s, cmdline %s,"
" pid %d, i_size %llu, ino %lu",
__get_str(pathbuf),
__get_str(cmdline), __entry->pid, __entry->i_size,
(unsigned long) __entry->ino)
);

#endif /* _TRACE_ANDROID_FS_TEMPLATE_H */

0 comments on commit 8e7f5b4

Please sign in to comment.