mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-07 20:34:22 +08:00
Deploying to gh-pages from @ eunomia-bpf/bpf-developer-tutorial@c120bb4912 🚀
This commit is contained in:
@@ -1,33 +1,24 @@
|
||||
#ifndef EBPF_EXAMPLE_GOROUTINE_H
|
||||
#define EBPF_EXAMPLE_GOROUTINE_H
|
||||
|
||||
|
||||
enum {
|
||||
/*
|
||||
* 0 ~ 16 for L7 socket event (struct socket_data_buffer),
|
||||
* indicates the number of socket data in socket_data_buffer.
|
||||
*/
|
||||
|
||||
/*
|
||||
* For event registrion
|
||||
*/
|
||||
EVENT_TYPE_MIN = 1 << 5,
|
||||
EVENT_TYPE_PROC_EXEC = 1 << 5,
|
||||
EVENT_TYPE_PROC_EXIT = 1 << 6
|
||||
// Add new event type here.
|
||||
enum goroutine_state {
|
||||
IDLE,
|
||||
RUNNABLE,
|
||||
RUNNING,
|
||||
SYSCALL,
|
||||
WAITING,
|
||||
MORIBUND_UNUSED,
|
||||
DEAD,
|
||||
ENQUEUE_UNUSED,
|
||||
COPYSTACK,
|
||||
PREEMPTED,
|
||||
};
|
||||
|
||||
// Description Provides basic information about an event
|
||||
struct event_meta {
|
||||
__u32 event_type;
|
||||
struct goroutine_execute_data {
|
||||
enum goroutine_state state;
|
||||
unsigned long goid;
|
||||
int pid;
|
||||
int tgid;
|
||||
};
|
||||
|
||||
// Process execution or exit event data
|
||||
struct process_event_t {
|
||||
struct event_meta meta;
|
||||
__u32 pid; // process ID
|
||||
__u8 name[TASK_COMM_LEN]; // process name
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user