mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 13:22:23 +00:00
mm/ksm: add tracepoint for ksm advisor
This adds a new tracepoint for the ksm advisor. It reports the last scan time, the new setting of the pages_to_scan parameter and the average cpu percent usage of the ksmd background thread for the last scan. Link: https://lkml.kernel.org/r/20231218231054.1625219-4-shr@devkernel.io Signed-off-by: Stefan Roesch <shr@devkernel.io> Acked-by: David Hildenbrand <david@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Rik van Riel <riel@surriel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
66790e9a73
commit
5088b49730
@ -245,6 +245,39 @@ TRACE_EVENT(ksm_remove_rmap_item,
|
||||
__entry->pfn, __entry->rmap_item, __entry->mm)
|
||||
);
|
||||
|
||||
/**
|
||||
* ksm_advisor - called after the advisor has run
|
||||
*
|
||||
* @scan_time: scan time in seconds
|
||||
* @pages_to_scan: new pages_to_scan value
|
||||
* @cpu_percent: cpu usage in percent
|
||||
*
|
||||
* Allows to trace the ksm advisor.
|
||||
*/
|
||||
TRACE_EVENT(ksm_advisor,
|
||||
|
||||
TP_PROTO(s64 scan_time, unsigned long pages_to_scan,
|
||||
unsigned int cpu_percent),
|
||||
|
||||
TP_ARGS(scan_time, pages_to_scan, cpu_percent),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(s64, scan_time)
|
||||
__field(unsigned long, pages_to_scan)
|
||||
__field(unsigned int, cpu_percent)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->scan_time = scan_time;
|
||||
__entry->pages_to_scan = pages_to_scan;
|
||||
__entry->cpu_percent = cpu_percent;
|
||||
),
|
||||
|
||||
TP_printk("ksm scan time %lld pages_to_scan %lu cpu percent %u",
|
||||
__entry->scan_time, __entry->pages_to_scan,
|
||||
__entry->cpu_percent)
|
||||
);
|
||||
|
||||
#endif /* _TRACE_KSM_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
Loading…
Reference in New Issue
Block a user