Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* Copyright (c) 2020 Facebook */
0003 #include "bpf_iter.h"
0004 #include <bpf/bpf_helpers.h>
0005 
0006 char _license[] SEC("license") = "GPL";
0007 
0008 SEC("iter/task")
0009 int dump_task(struct bpf_iter__task *ctx)
0010 {
0011     struct seq_file *seq = ctx->meta->seq;
0012     struct task_struct *task = ctx->task;
0013     int tgid;
0014 
0015     tgid = task->tgid;
0016     bpf_seq_write(seq, &tgid, sizeof(tgid));
0017     return 0;
0018 }