Skip to contentSkip to conversation

fanotify25: Trace oom_kill_process() instead of load_module()

PATCH In review Martin Doucha 3 participants 4 messages Mar 3 – Mar 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fanotify25: Trace oom_kill_process() instead of load_module()

The load_module() function is available only if the kernel was built with CONFIG_MODULES enabled. Trace a function that's unconditionally available instead.

---
 testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/fanotify/fanotify25.c +4 -4
index c982f3225..db52e6a87 100644
@@ -24,10 +24,10 @@ static const struct traceconfig {
 	const char *filename;
 	const char *wdata;
 } trace_cmds[] = {
-	{EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"},
-	{MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"},
-	{MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"},
-	{EVENTS_SYSFILE, "-:ltp_load_module_0"},
+	{EVENTS_SYSFILE, "p:ltp_oom_kill_process_0 oom_kill_process"},
+	{MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "1"},
+	{MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "0"},
+	{EVENTS_SYSFILE, "-:ltp_oom_kill_process_0"},
 	{}
 };
 
Signature · 5 lines
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi all,

Quoted 3 lines

The load_module() function is available only if the kernel was built with CONFIG_MODULES enabled. Trace a function that's unconditionally available instead.

+1, that's obviously better than require CONFIG_BINFMT_SCRIPT or anything else.

@Amir @Jan will you add your ack, please?

Kind regards,
Petr

Quoted 24 lines
---
 testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/fanotify/fanotify25.c +4 -4
index c982f3225..db52e6a87 100644
@@ -24,10 +24,10 @@ static const struct traceconfig {
 	const char *filename;
 	const char *wdata;
 } trace_cmds[] = {
-	{EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"},
-	{MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"},
-	{MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"},
-	{EVENTS_SYSFILE, "-:ltp_load_module_0"},
+	{EVENTS_SYSFILE, "p:ltp_oom_kill_process_0 oom_kill_process"},
+	{MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "1"},
+	{MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "0"},
+	{EVENTS_SYSFILE, "-:ltp_oom_kill_process_0"},
 	{}
 };
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Acked-by
#2 lore raw
Quoted 11 lines · Petr Vorel

Hi all,

Quoted 3 lines

The load_module() function is available only if the kernel was built with CONFIG_MODULES enabled. Trace a function that's unconditionally available instead.

+1, that's obviously better than require CONFIG_BINFMT_SCRIPT or anything else.

@Amir @Jan will you add your ack, please?

Sure, whatever works for you in this case :)

Honza

Quoted 28 lines

Kind regards,
Petr

Quoted 24 lines
---
 testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/fanotify/fanotify25.c +4 -4
index c982f3225..db52e6a87 100644
@@ -24,10 +24,10 @@ static const struct traceconfig {
 	const char *filename;
 	const char *wdata;
 } trace_cmds[] = {
-	{EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"},
-	{MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"},
-	{MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"},
-	{EVENTS_SYSFILE, "-:ltp_load_module_0"},
+	{EVENTS_SYSFILE, "p:ltp_oom_kill_process_0 oom_kill_process"},
+	{MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "1"},
+	{MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "0"},
+	{EVENTS_SYSFILE, "-:ltp_oom_kill_process_0"},
 	{}
 };
Signature · 5 lines
Jan Kara <[email protected]>
SUSE Labs, CR

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi all,

patch merged, thanks!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp