Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
mm/khugepaged: refactor mm_khugepaged_scan_file tracepoint to remove …
Browse files Browse the repository at this point in the history
…filename from function call

Refactor the mm_khugepaged_scan_file tracepoint to move filename
dereference to the tracepoint definition, to maintain consistency with
other tracepoints[1].

[1]:lore.kernel.org/lkml/[email protected]/

Link: https://lkml.kernel.org/r/[email protected]
Fixes: d41fd20 ("mm/khugepaged: add tracepoint to hpage_collapse_scan_file()")
Signed-off-by: Gautam Menghani <[email protected]>
Reviewed-by: Yang Shi <[email protected]>
Reviewed-by: Zach O'Keefe <[email protected]>
Reviewed-by: Steven Rostedt (Google) <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Masami Hiramatsu (Google) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Gautam-Menghani authored and akpm00 committed Nov 17, 2022
1 parent 460126b commit 5856be0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions include/trace/events/huge_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ TRACE_EVENT(mm_collapse_huge_page_swapin,

TRACE_EVENT(mm_khugepaged_scan_file,

TP_PROTO(struct mm_struct *mm, struct page *page, const char *filename,
TP_PROTO(struct mm_struct *mm, struct page *page, struct file *file,
int present, int swap, int result),

TP_ARGS(mm, page, filename, present, swap, result),
TP_ARGS(mm, page, file, present, swap, result),

TP_STRUCT__entry(
__field(struct mm_struct *, mm)
__field(unsigned long, pfn)
__string(filename, filename)
__string(filename, file->f_path.dentry->d_iname)
__field(int, present)
__field(int, swap)
__field(int, result)
Expand All @@ -188,7 +188,7 @@ TRACE_EVENT(mm_khugepaged_scan_file,
TP_fast_assign(
__entry->mm = mm;
__entry->pfn = page ? page_to_pfn(page) : -1;
__assign_str(filename, filename);
__assign_str(filename, file->f_path.dentry->d_iname);
__entry->present = present;
__entry->swap = swap;
__entry->result = result;
Expand Down
3 changes: 1 addition & 2 deletions mm/khugepaged.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,8 +2153,7 @@ static int hpage_collapse_scan_file(struct mm_struct *mm, unsigned long addr,
}
}

trace_mm_khugepaged_scan_file(mm, page, file->f_path.dentry->d_iname,
present, swap, result);
trace_mm_khugepaged_scan_file(mm, page, file, present, swap, result);
return result;
}
#else
Expand Down

0 comments on commit 5856be0

Please sign in to comment.