blob: 2a4647f20c466b1735cf09e28b8583c15255f8a5 [file] [log] [blame]
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */
#include "bpf_iter.h"
#include <bpf/bpf_helpers.h>
char _license[] SEC("license") = "GPL";
SEC("iter/task")
int dump_task(struct bpf_iter__task *ctx)
{
struct seq_file *seq = ctx->meta->seq;
struct task_struct *task = ctx->task;
int tgid;
tgid = task->tgid;
bpf_seq_write(seq, &tgid, sizeof(tgid));
return 0;
}