mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	 64d5ce26d6
			
		
	
	64d5ce26d6
	
	
	
		
			
			* Remove standard C headers since we have vmlinux.h already * Simplify get_goroutine_id() implementation, this reduces a map and thus reduces runtime memory comsumption. While at it, unify all indention using 4 spaces. Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
		
			
				
	
	
		
			22 lines
		
	
	
		
			623 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			623 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include "vmlinux.h"
 | |
| #include "function_vals.bpf.h"
 | |
| #include <bpf/bpf_core_read.h>
 | |
| #include <bpf/bpf_helpers.h>
 | |
| #include <bpf/bpf_tracing.h>
 | |
| 
 | |
| #define BPF_MAX_VAR_SIZ	(1 << 29)
 | |
| 
 | |
| // Ring buffer to handle communication of variable values back to userspace.
 | |
| struct {
 | |
|     __uint(type, BPF_MAP_TYPE_RINGBUF);
 | |
|     __uint(max_entries, BPF_MAX_VAR_SIZ);
 | |
| } events SEC(".maps");
 | |
| 
 | |
| // Map which uses instruction address as key and function parameter info as the value.
 | |
| struct {
 | |
|     __uint(max_entries, 42);
 | |
|     __uint(type, BPF_MAP_TYPE_HASH);
 | |
|     __type(key, u64);
 | |
|     __type(value, function_parameter_list_t);
 | |
| } arg_map SEC(".maps");
 |