Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
bpf-ringbuf-examples/src/common.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32 lines (27 sloc)
678 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ | |
/* Copyright (c) 2020 Andrii Nakryiko */ | |
#ifndef __COMMON_H | |
#define __COMMON_H | |
struct trace_entry { | |
short unsigned int type; | |
unsigned char flags; | |
unsigned char preempt_count; | |
int pid; | |
}; | |
/* sched_process_exec tracepoint context */ | |
struct trace_event_raw_sched_process_exec { | |
struct trace_entry ent; | |
unsigned int __data_loc_filename; | |
int pid; | |
int old_pid; | |
char __data[0]; | |
}; | |
#define TASK_COMM_LEN 16 | |
#define MAX_FILENAME_LEN 512 | |
/* definition of a sample sent to user-space from BPF program */ | |
struct event { | |
int pid; | |
char comm[TASK_COMM_LEN]; | |
char filename[MAX_FILENAME_LEN]; | |
}; | |
#endif /* __COMMON_H */ |