Commit 41507aee authored by Brenden Blanco's avatar Brenden Blanco

Merge pull request #65 from iovisor/ast_dev

add get_current_pid/tgid/uid/gid/comm helpers
parents 3a65d81c cf35811c
......@@ -34,3 +34,7 @@ A: You need to obtain a recent version of the Linux source code
make install
make modules_install
make headers_install INSTALL_HDR_PATH=/usr/local/
Q: hello_world.py fails with:
ImportError: No module named past.builtins
A: sudo pip install future
......@@ -73,6 +73,14 @@ static int (*bpf_trace_printk_)(const char *fmt, u64 fmt_size, ...) =
({ char fmt[] = _fmt; bpf_trace_printk_(fmt, sizeof(fmt), ##__VA_ARGS__); })
static u64 (*bpf_clone_redirect)(void *ctx, u64 ifindex, u64 flags) =
(void *) BPF_FUNC_clone_redirect;
static u64 (*bpf_get_smp_processor_id)(void) =
(void *) BPF_FUNC_get_smp_processor_id;
static u64 (*bpf_get_current_pid_tgid)(void) =
(void *) BPF_FUNC_get_current_pid_tgid;
static u64 (*bpf_get_current_uid_gid)(void) =
(void *) BPF_FUNC_get_current_uid_gid;
static int (*bpf_get_current_comm)(void *buf, int buf_size) =
(void *) BPF_FUNC_get_current_comm;
static void bpf_tail_call_(u64 map_fd, void *ctx, int index) {
((void (*)(void *, u64, int))BPF_FUNC_tail_call)(ctx, map_fd, index);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment