mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	samples/bpf: Add openat2() enter/exit tracepoint to syscall_tp sample
Commit fe3300897cbf("samples: bpf: fix syscall_tp due to unused syscall")
added openat() syscall tracepoints. This patch adds support for
openat2() as well.
Signed-off-by: Rong Tao <rongtao@cestc.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/tencent_9381CB1A158ED7ADD12C4406034E21A3AC07@qq.com
			
			
This commit is contained in:
		
							parent
							
								
									ab8684b8ce
								
							
						
					
					
						commit
						06744f2469
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -58,6 +58,13 @@ int trace_enter_open_at(struct syscalls_enter_open_args *ctx)
 | 
			
		|||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SEC("tracepoint/syscalls/sys_enter_openat2")
 | 
			
		||||
int trace_enter_open_at2(struct syscalls_enter_open_args *ctx)
 | 
			
		||||
{
 | 
			
		||||
	count(&enter_open_map);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SEC("tracepoint/syscalls/sys_exit_open")
 | 
			
		||||
int trace_enter_exit(struct syscalls_exit_open_args *ctx)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -71,3 +78,10 @@ int trace_enter_exit_at(struct syscalls_exit_open_args *ctx)
 | 
			
		|||
	count(&exit_open_map);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SEC("tracepoint/syscalls/sys_exit_openat2")
 | 
			
		||||
int trace_enter_exit_at2(struct syscalls_exit_open_args *ctx)
 | 
			
		||||
{
 | 
			
		||||
	count(&exit_open_map);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue