forked from bpftrace/bpftrace
-
Notifications
You must be signed in to change notification settings - Fork 2
/
swapin.bt
executable file
·35 lines (32 loc) · 946 Bytes
/
swapin.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bpftrace
/*
* swapin - Show swapins by process.
*
* See BPF Performance Tools, Chapter 7, for an explanation of this tool.
*
* Copyright (c) 2019 Brendan Gregg.
* Licensed under the Apache License, Version 2.0 (the "License").
* This was originally created for the BPF Performance Tools book
* published by Addison Wesley. ISBN-13: 9780136554820
* When copying or porting, include this comment.
*
* 26-Jan-2019 Brendan Gregg Created this.
* 31-May-2024 Rong Tao Add folio support.
*/
config = { missing_probes = "ignore" }
/**
* kernel commit c9bdf768dd93("mm: convert swap_readpage() to swap_read_folio()")
* convert swap_readpage() to swap_read_folio(), try attaching two kprobes,
* only one will succeed and the other will be silently ignored.
*/
kprobe:swap_readpage,
kprobe:swap_read_folio
{
@[comm, pid] = count();
}
interval:s:1
{
time();
print(@);
clear(@);
}